src/twc-profile.c

This commit is contained in:
emdee@spm.plastiras.org 2024-04-30 08:51:38 +00:00
parent 1a18e112a7
commit 1941bdcd64
1 changed files with 21 additions and 13 deletions

View File

@ -575,7 +575,15 @@ twc_profile_set_online_status(struct t_twc_profile *profile, bool status)
if (!(profile)) {
weechat_printf(profile->buffer, "%sno profile",
weechat_prefix("network"));
} else if (profile->tox_online ^ status) {
return;
}
/* failsafe - called while exiting! */
if (!(profile->tox)) {
weechat_printf(profile->buffer, "%sno tox",
weechat_prefix("network"));
return;
}
if (profile->tox_online ^ status) {
TOX_CONNECTION connection = tox_self_get_connection_status(profile->tox);
profile->tox_online = status;