mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-03 06:06:45 +02:00
properly handle invalid statuses
This commit is contained in:
@ -325,7 +325,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m)
|
||||
|
||||
if (statusbar->is_online) {
|
||||
int colour = WHITE;
|
||||
char *status_text = "Unknown";
|
||||
const char *status_text = "Unknown";
|
||||
|
||||
switch (statusbar->status) {
|
||||
case TOX_USERSTATUS_NONE:
|
||||
@ -340,6 +340,10 @@ static void prompt_onDraw(ToxWindow *self, Tox *m)
|
||||
status_text = "Busy";
|
||||
colour = RED;
|
||||
break;
|
||||
case TOX_USERSTATUS_INVALID:
|
||||
status_text = "ERROR";
|
||||
colour = MAGENTA;
|
||||
break;
|
||||
}
|
||||
wattron(statusbar->topline, COLOR_PAIR(colour) | A_BOLD);
|
||||
wprintw(statusbar->topline, " [%s]", status_text);
|
||||
|
Reference in New Issue
Block a user