summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-02-26 00:41:00 +0300
committeraunsane <aunsane@gmail.com>2017-02-26 00:41:38 +0300
commit1b9bdb2ef210ce55b97c988c183a02cfcf101063 (patch)
tree68f854ce4cc91bc59c243e2ed8bbcc37d3c665b1
parent3361bc0c6d4f17b7eca7fe04801b2e3e41ab2da3 (diff)
Tox: attempt to fix for #720
-rw-r--r--protocols/Tox/src/tox_contacts.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index f25c5f4dd7..0f429c80a1 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -319,14 +319,16 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE
if (!hContact)
return;
- Netlib_Logf(proto->m_hNetlibUser, __FUNCTION__": friend(%d) status changed to (%d)", friendNumber, status);
-
if (status == TOX_CONNECTION_NONE)
{
proto->SetContactStatus(hContact, ID_STATUS_OFFLINE);
return;
}
+ WORD status = proto->GetContactStatus(hContact);
+ if (status > ID_STATUS_OFFLINE)
+ return;
+
proto->delSetting(hContact, "Auth");
proto->delSetting(hContact, "Grant");