mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-01 16:16:46 +02:00
better way to check connection status
This commit is contained in:
@ -77,6 +77,13 @@ void prompt_update_status(ToxWindow *prompt, TOX_USERSTATUS status)
|
||||
statusbar->status = status;
|
||||
}
|
||||
|
||||
/* Updates own connection status */
|
||||
void prompt_update_connectionstatus(ToxWindow *prompt, bool is_connected)
|
||||
{
|
||||
StatusBar *statusbar = (StatusBar *) prompt->s;
|
||||
statusbar->is_online = is_connected;
|
||||
}
|
||||
|
||||
void prompt_onFriendRequest(ToxWindow *prompt, uint8_t *key, uint8_t *data, uint16_t length)
|
||||
{
|
||||
int n = add_req(key);
|
||||
@ -584,7 +591,7 @@ static void prompt_onDraw(ToxWindow *self, Tox *m)
|
||||
|
||||
werase(statusbar->topline);
|
||||
|
||||
if (tox_isconnected(m)) {
|
||||
if (statusbar->is_online) {
|
||||
int colour = WHITE;
|
||||
char *status_text = "Unknown";
|
||||
|
||||
|
Reference in New Issue
Block a user