From e2dd2ccaf0613e8c81175b1af4872baf72ef34a9 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Fri, 12 Sep 2014 05:51:45 +0000 Subject: VKontakte: fix for ticket #788 git-svn-id: http://svn.miranda-ng.org/main/trunk@10436 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_thread.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'protocols/VKontakte/src') diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index da26a7649c..05494e53f7 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -318,7 +318,9 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe szValue = json_as_string( json_get(pRecord, "photo_100")); SetAvatarUrl(hContact, szValue); - setWord(hContact, "Status", (json_as_int(json_get(pRecord, "online")) == 0) ? ID_STATUS_OFFLINE : ID_STATUS_ONLINE); + int iNewStatus = (json_as_int(json_get(pRecord, "online")) == 0) ? ID_STATUS_OFFLINE : ID_STATUS_ONLINE; + if (getWord(hContact, "Status", 0) != iNewStatus) + setWord(hContact, "Status", iNewStatus); if ((iValue = json_as_int(json_get(pRecord, "timezone"))) != 0) setByte(hContact, "Timezone", iValue * -2); @@ -332,7 +334,8 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe szValue = json_as_string(json_get(pRecord, "status")); if (szValue && *szValue) - db_set_ts(hContact, "CList", "StatusMsg", szValue); + if (_tcscmp(db_get_tsa(hContact, "CList", "StatusMsg"), szValue)) + db_set_ts(hContact, "CList", "StatusMsg", szValue); szValue = json_as_string(json_get(pRecord, "about")); if (szValue && *szValue) @@ -401,7 +404,9 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq szValue = json_as_string(json_get(pInfo, "photo_100")); SetAvatarUrl(hContact, szValue); - setWord(hContact, "Status", (json_as_int(json_get(pInfo, "online")) == 0) ? ID_STATUS_OFFLINE : ID_STATUS_ONLINE); + int iNewStatus = (json_as_int(json_get(pInfo, "online")) == 0) ? ID_STATUS_OFFLINE : ID_STATUS_ONLINE; + if (getWord(hContact, "Status", 0) != iNewStatus) + setWord(hContact, "Status", iNewStatus); int iValue = json_as_int(json_get(pInfo, "sex")); if (iValue) @@ -419,7 +424,8 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq szValue = json_as_string(json_get(pInfo, "status")); if (szValue && *szValue) - db_set_ts(hContact, "CList", "StatusMsg", szValue); + if (_tcscmp(db_get_tsa(hContact, "CList", "StatusMsg"), szValue)) + db_set_ts(hContact, "CList", "StatusMsg", szValue); szValue = json_as_string(json_get(pInfo, "about")); if (szValue && *szValue) -- cgit v1.2.3