diff options
author | ElzorFox <elzorfox@ya.ru> | 2016-11-03 09:51:35 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2016-11-03 09:51:35 +0500 |
commit | 4de57225a80715e7c5e7bcd60d06b4c8531b54e5 (patch) | |
tree | ec6baa1d211284458cd7e3cbb0e8144cbc6e74ed /protocols/VKontakte | |
parent | 2c5081fe7d0e6b155847c5ead1b32b4b42bfe4ae (diff) |
VKontakte: fix removing groups where user is not member on auto clean contacrts
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 38fad14848..d68790ab2b 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -651,8 +651,12 @@ void CVkProto::OnReceiveGroupInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR const JSONNode &jnItem = (*it);
int iGroupId = (-1)*jnItem["id"].as_int();
+ bool bIsMember = jnItem["is_member"].as_bool();
+
+ if (!bIsMember && m_vkOptions.bAutoClean)
+ continue;
+
MCONTACT hContact = FindUser(iGroupId, true);
-
if (!hContact)
continue;
@@ -665,11 +669,9 @@ void CVkProto::OnReceiveGroupInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_ONLINE)
setWord(hContact, "Status", ID_STATUS_ONLINE);
- setByte(hContact, "IsGroup", 1);
-
- bool bIsMember = jnItem["is_member"].as_bool();
setByte(hContact, "Auth", !bIsMember);
setByte(hContact, "friend", bIsMember);
+ setByte(hContact, "IsGroup", 1);
wszValue = jnItem["screen_name"].as_mstring();
if (!wszValue.IsEmpty()) {
@@ -735,7 +737,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq return;
CVkSendMsgParam *param = (CVkSendMsgParam *)pReq->pUserInfo;
- bool bCleanContacts = getBool("AutoClean") || (param->iMsgID != 0);
+ bool bCleanContacts = m_vkOptions.bAutoClean || (param->iMsgID != 0);
delete param;
LIST<void> arContacts(10, PtrKeySortT);
|