mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 23:03:27 +01:00
add peer count to sidepanel
This commit is contained in:
parent
04b394d6dd
commit
b909ab37b7
@ -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]);
|
||||
}
|
||||
|
@ -425,9 +425,7 @@ static void close_file_transfers(Tox *m)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < max_file_senders_index; ++i) {
|
||||
if (!file_senders[i].active)
|
||||
continue;
|
||||
|
||||
if (file_senders[i].active)
|
||||
fclose(file_senders[i].file);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user