summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_thread.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-09-24 09:19:28 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-09-24 09:19:28 +0000
commitb68aad07ca94035442309cf8c68b039573f949ca (patch)
tree8aecaab73d620460dc80bf827b6f14253cd102d7 /protocols/VKontakte/src/vk_thread.cpp
parent1eec1e5f5b57fb56fbfeb56fc57777153c14df82 (diff)
VKontakte:
add PopUp support add AuthRequest (add as friend support) version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@10569 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, 15 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index d0e20419db..45fb8ca95d 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -389,10 +389,12 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
bool bCleanContacts = getBool("AutoClean", false);
LIST<void> arContacts(10, PtrKeySortT);
- if (bCleanContacts)
- for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
- if (!isChatRoom(hContact))
- arContacts.insert((HANDLE)hContact);
+
+ for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)){
+ db_unset(hContact, m_szModuleName, "friend");
+ if (bCleanContacts&&!isChatRoom(hContact))
+ arContacts.insert((HANDLE)hContact);
+ }
int iCount = json_as_int(json_get(pResponse, "count"));
JSONNODE *pItems = json_get(pResponse, "items");
@@ -403,12 +405,14 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
continue;
CMString tszNick;
+
MCONTACT hContact = FindUser(_ttoi(szValue), true);
arContacts.remove((HANDLE)hContact);
+ setByte(hContact, "friend", 1);
+
szValue = json_as_string(json_get(pInfo, "first_name"));
if (szValue) {
setTString(hContact, "FirstName", szValue);
-
tszNick.Append(szValue);
tszNick.AppendChar(' ');
}
@@ -838,6 +842,12 @@ INT_PTR __cdecl CVkProto::SvcSetListeningTo(WPARAM wParam, LPARAM lParam)
}
/////////////////////////////////////////////////////////////////////////////////////////
+INT_PTR __cdecl CVkProto::SvcAddAsFriend(WPARAM hContact, LPARAM)
+{
+ CallContactService(hContact, PSS_AUTHREQUESTW, 0, (LPARAM)TranslateT("Please authorize me to add you to my friend list."));
+ return 0;
+}
+
INT_PTR __cdecl CVkProto::SvcVisitProfile(WPARAM hContact, LPARAM)
{