From 623d05cf20310910bcd924838210504c6a2af2a0 Mon Sep 17 00:00:00 2001 From: ElzorFox Date: Mon, 31 Oct 2016 15:01:49 +0500 Subject: VKontakte: add user deactivate events --- protocols/VKontakte/src/vk_thread.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'protocols/VKontakte/src/vk_thread.cpp') 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'); -- cgit v1.2.3