diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-09-12 05:51:45 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-09-12 05:51:45 +0000 |
commit | e2dd2ccaf0613e8c81175b1af4872baf72ef34a9 (patch) | |
tree | 7f87ffc52e29d097b9464db765ccf2a863496d91 /protocols/VKontakte | |
parent | 4eb09f2d68b16951f2a3ff848bdf20ab6566170f (diff) |
VKontakte: fix for ticket #788
git-svn-id: http://svn.miranda-ng.org/main/trunk@10436 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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)
|