From 3f3e848b6f391c09787dd35d354289eb8324e11e Mon Sep 17 00:00:00 2001 From: jfreegman Date: Thu, 5 Jan 2023 11:43:58 -0500 Subject: [PATCH] Show connection status in groupchat peerlist --- src/groupchats.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/groupchats.c b/src/groupchats.c index a2baa22..4f480e1 100644 --- a/src/groupchats.c +++ b/src/groupchats.c @@ -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);