summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-11-09 14:11:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-11-09 14:11:01 +0000
commit7c892dc6fd0f243bf9e38a7be7dc387a9c270291 (patch)
treee73c03cf9b7fe22a1fe5f3a9650aa1c9052abd5c /protocols
parent911aa265efca7b33045405f3ac0f0a3c65688edf (diff)
VK: added reading of contact's timezone & gender
git-svn-id: http://svn.miranda-ng.org/main/trunk@6832 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index e33a881a71..684d03d38e 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -292,7 +292,7 @@ void CVkProto::RetrieveFriends()
debugLogA("CVkProto::RetrieveFriends");
HttpParam params[] = {
- { "fields", "uid,first_name,last_name,photo_medium,contacts" },
+ { "fields", "uid,first_name,last_name,photo_medium,sex,country,timezone,contacts" },
{ "count", "1000" },
{ "access_token", m_szAccessToken }
};
@@ -338,6 +338,13 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
setWord(hContact, "Status", (json_as_int( json_get(pInfo, "online")) == 0) ? ID_STATUS_OFFLINE : ID_STATUS_ONLINE);
+ int iValue = json_as_int( json_get(pInfo, "sex"));
+ if (iValue)
+ setByte(hContact, "Gender", (iValue == 2) ? 'M' : 'F');
+
+ if ((iValue = json_as_int( json_get(pInfo, "timezone"))) != 0)
+ setByte(hContact, "Timezone", iValue * -2);
+
szValue = json_as_string( json_get(pInfo, "mobile_phone"));
if (szValue && *szValue) setTString(hContact, "Cellular", szValue);
szValue = json_as_string( json_get(pInfo, "home_phone"));