From 8f6de9cc591e1ab1084f8685e99c49bad0b0f42c Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Mon, 15 Dec 2014 08:43:06 +0000 Subject: VKontakte: fix for freeze MirVer for offline contacts git-svn-id: http://svn.miranda-ng.org/main/trunk@11432 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 3 +++ protocols/VKontakte/src/vk_thread.cpp | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 31124b26b3..eba3462555 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -32,6 +32,9 @@ void CVkProto::SetAllContactStatuses(int iStatus) SetChatStatus(hContact, iStatus); else if (getWord(hContact, "Status", 0) != iStatus) setWord(hContact, "Status", iStatus); + + if (iStatus == ID_STATUS_OFFLINE) + SetMirVer(hContact, -1); } } diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 39dc6b304a..f4e5866713 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -314,7 +314,7 @@ MCONTACT CVkProto::SetContactInfo(JSONNODE* pItem, bool flag, bool self) } int iNewStatus = (json_as_int(json_get(pItem, "online")) == 0) ? ID_STATUS_OFFLINE : ID_STATUS_ONLINE; - if (getWord(hContact, "Status", 0) != iNewStatus) + if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != iNewStatus) setWord(hContact, "Status", iNewStatus); if (iNewStatus == ID_STATUS_ONLINE) { @@ -456,10 +456,9 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe LONG userID = getDword(hContact, "ID", -1); if (userID == m_myUserId || userID == VK_FEED_USER) continue; - if (getWord(hContact, "Status", 0) != ID_STATUS_OFFLINE) { - setWord(hContact, "Status", ID_STATUS_OFFLINE); - SetMirVer(hContact, -1); - } + if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) + setWord(hContact, "Status", ID_STATUS_OFFLINE); + SetMirVer(hContact, -1); } arContacts.destroy(); AddFeedSpecialUser(); -- cgit v1.2.3