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
1 changed files with 9 additions and 1 deletions

View File

@ -1679,7 +1679,15 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m)
wattron(ctx->sidebar, A_BOLD);
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);
wattroff(ctx->sidebar, A_BOLD);