summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_thread.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-11-03 17:55:37 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-11-03 17:55:37 +0000
commit43865da50e05ff4225123b476addd3247083dc16 (patch)
tree7f4235e1710baf4381221760444bb563100b8a29 /protocols/VKontakte/src/vk_thread.cpp
parentf903074b63cf7a6f63476e14be1476056e6b76e3 (diff)
VKontakte:
minor fix for translation add ‘Wipe contacts missing in friend list’ proto menu item git-svn-id: http://svn.miranda-ng.org/main/trunk@15673 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index f6a02cbfa4..09ffbb81f7 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -500,7 +500,7 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
}
}
-void CVkProto::RetrieveFriends()
+void CVkProto::RetrieveFriends(bool bCleanNonFriendContacts)
{
debugLogA("CVkProto::RetrieveFriends");
if (!IsOnline())
@@ -508,7 +508,7 @@ void CVkProto::RetrieveFriends()
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/friends.get.json", true, &CVkProto::OnReceiveFriends)
<< INT_PARAM("count", 1000)
<< CHAR_PARAM("fields", fieldsName)
- <<VER_API);
+ << VER_API)->pUserInfo = new CVkSendMsgParam(NULL, bCleanNonFriendContacts ? 1 : 0);
}
void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
@@ -521,8 +521,11 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
const JSONNode &jnResponse = CheckJsonResponse(pReq, reply, jnRoot);
if (!jnResponse)
return;
+
+ CVkSendMsgParam *param = (CVkSendMsgParam *)pReq->pUserInfo;
+ bool bCleanContacts = getBool("AutoClean") || (param->iMsgID != 0);
+ delete param;
- bool bCleanContacts = getBool("AutoClean");
LIST<void> arContacts(10, PtrKeySortT);
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
@@ -571,6 +574,17 @@ INT_PTR __cdecl CVkProto::SvcAddAsFriend(WPARAM hContact, LPARAM)
return 0;
}
+INT_PTR CVkProto::SvcWipeNonFriendContacts(WPARAM, LPARAM)
+{
+ debugLogA("CVkProto::SvcWipeNonFriendContacts");
+ if (IDNO == MessageBox(NULL, TranslateT("Are you sure to wipe local contacts missing in your friend list?"),
+ TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
+ return 0;
+
+ RetrieveFriends(true);
+ return 0;
+}
+
INT_PTR __cdecl CVkProto::SvcDeleteFriend(WPARAM hContact, LPARAM flag)
{
debugLogA("CVkProto::SvcDeleteFriend");