From 1b9bdb2ef210ce55b97c988c183a02cfcf101063 Mon Sep 17 00:00:00 2001 From: aunsane Date: Sun, 26 Feb 2017 00:41:00 +0300 Subject: Tox: attempt to fix for #720 --- protocols/Tox/src/tox_contacts.cpp | 6 ++++-- 1 file 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"); -- cgit v1.2.3