From 13337041ce75c0b401632191400a4a6638ead7de Mon Sep 17 00:00:00 2001 From: jfreegman Date: Wed, 10 Nov 2021 13:27:11 -0500 Subject: [PATCH] Show friend connection type (UDP/TCP) in friend status bar --- src/chat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/chat.c b/src/chat.c index e57df90..693bf56 100644 --- a/src/chat.c +++ b/src/chat.c @@ -1307,12 +1307,14 @@ static void chat_onDraw(ToxWindow *self, Tox *m) break; } + const char *connection_status_s = statusbar->connection == TOX_CONNECTION_TCP ? "TCP" : "UDP"; + wattron(statusbar->topline, COLOR_PAIR(BAR_ACCENT)); wprintw(statusbar->topline, " ["); wattroff(statusbar->topline, COLOR_PAIR(BAR_ACCENT)); wattron(statusbar->topline, COLOR_PAIR(colour) | A_BOLD); - wprintw(statusbar->topline, "%s", ONLINE_CHAR); + wprintw(statusbar->topline, "%s", connection_status_s); wattroff(statusbar->topline, COLOR_PAIR(colour) | A_BOLD); wattron(statusbar->topline, COLOR_PAIR(BAR_ACCENT)); @@ -1342,7 +1344,7 @@ static void chat_onDraw(ToxWindow *self, Tox *m) wattroff(statusbar->topline, COLOR_PAIR(BAR_ACCENT)); wattron(statusbar->topline, COLOR_PAIR(BAR_TEXT)); - wprintw(statusbar->topline, "%s", OFFLINE_CHAR); + wprintw(statusbar->topline, "Offline"); wattroff(statusbar->topline, COLOR_PAIR(BAR_TEXT)); wattron(statusbar->topline, COLOR_PAIR(BAR_ACCENT));