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

Show connection status in groupchat peerlist

This commit is contained in:
jfreegman 2023-01-05 11:43:58 -05:00
parent 8d125d5e6b
commit 3f3e848b6f
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -1679,7 +1679,15 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m)
wattron(ctx->sidebar, A_BOLD); wattron(ctx->sidebar, A_BOLD);
pthread_mutex_lock(&Winthread.lock); pthread_mutex_lock(&Winthread.lock);
wprintw(ctx->sidebar, "Peers: %d\n", chat->num_peers);
if (chat->num_peers > 1) {
wprintw(ctx->sidebar, "Peers: %d\n", chat->num_peers);
} else if (tox_group_is_connected(m, self->num, NULL)) {
wprintw(ctx->sidebar, "Connecting...\n");
} else {
wprintw(ctx->sidebar, "Disconnected\n");
}
pthread_mutex_unlock(&Winthread.lock); pthread_mutex_unlock(&Winthread.lock);
wattroff(ctx->sidebar, A_BOLD); wattroff(ctx->sidebar, A_BOLD);