static void chat_onConnectionChange(ToxWindow *self, Tox *m, int32_t num, uint8_t status) { if (self->num != num) return; StatusBar *statusbar = self->stb; if (status == 1) { /* Friend goes online */ statusbar->is_online = true; friends[num].is_typing = user_settings_->show_typing_other == SHOW_TYPING_ON ? tox_get_is_typing(m, num) : 0; notify(self, user_log_in, NT_NOFOCUS); } else { /* Friend goes offline */ statusbar->is_online = false; friends[num].is_typing = 0; notify(self, user_log_out, NT_NOFOCUS); if (self->chatwin->self_is_typing) set_self_typingstatus(self, m, 0); } }
bool ToxFriend::isTyping() { return tox_get_is_typing(m_tox, m_id); }