1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-13 02:33:03 +01:00

add peer count to sidepanel

This commit is contained in:
Jfreegman 2013-11-29 01:30:10 -05:00
parent 04b394d6dd
commit b909ab37b7
2 changed files with 12 additions and 5 deletions

View File

@ -314,12 +314,21 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m)
mvwaddch(ctx->sidebar, y-CHATBOX_HEIGHT, 0, ACS_BTEE);
int num_peers = groupchats[self->num].num_peers;
wmove(ctx->sidebar, 0, 1);
wattron(ctx->sidebar, A_BOLD);
wprintw(ctx->sidebar, "Peers: %d\n", num_peers);
wattroff(ctx->sidebar, A_BOLD);
mvwaddch(ctx->sidebar, 1, 0, ACS_LTEE);
mvwhline(ctx->sidebar, 1, 1, ACS_HLINE, SIDEBAR_WIDTH-1);
int N = TOX_MAX_NAME_LENGTH;
int maxlines = y - CHATBOX_HEIGHT;
int i;
for (i = 0; i < num_peers && i < maxlines; ++i) {
wmove(ctx->sidebar, i, 1);
wmove(ctx->sidebar, i+2, 1);
groupchats[self->num].peer_names[i*N+SIDEBAR_WIDTH-2] = '\0';
wprintw(ctx->sidebar, "%s\n", &groupchats[self->num].peer_names[i*N]);
}

View File

@ -425,10 +425,8 @@ static void close_file_transfers(Tox *m)
int i;
for (i = 0; i < max_file_senders_index; ++i) {
if (!file_senders[i].active)
continue;
fclose(file_senders[i].file);
if (file_senders[i].active)
fclose(file_senders[i].file);
}
}