diff options
author | ElzorFox <elzorfox@ya.ru> | 2016-10-31 15:01:49 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2016-10-31 15:01:49 +0500 |
commit | 623d05cf20310910bcd924838210504c6a2af2a0 (patch) | |
tree | 4c02cddc38309d301fddf3b970be71ad0371104e /protocols/VKontakte/src/vk_thread.cpp | |
parent | aea29a34173d692e237b1c74de8d10c76b4dfd0d (diff) |
VKontakte: add user deactivate events
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index b546761193..38fad14848 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -298,6 +298,19 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) if (!wszNick.IsEmpty())
setWString(hContact, "Nick", wszNick);
+ wszValue = jnItem["deactivated"].as_mstring();
+ CMStringW wszOldDeactivated(ptrW(db_get_wsa(hContact, m_szModuleName, "Deactivated")));
+ if (wszValue != wszOldDeactivated) {
+ AddVkDeactivateEvent(hContact, wszValue);
+ if (wszValue.IsEmpty())
+ db_unset(hContact, m_szModuleName, "Deactivated");
+ else
+ setWString(hContact, "Deactivated", wszValue);
+ }
+
+ if (!wszValue.IsEmpty())
+ return hContact;
+
int sex = jnItem["sex"].as_int();
if (sex)
setByte(hContact, "Gender", sex == 2 ? 'M' : 'F');
|