summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-10-17 03:50:25 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-10-17 03:50:25 +0000
commitcdb643a8d54843c523433b79e8eb6ca5a4ce0d5c (patch)
tree5eb8e2edec95b7330fa9240c2833d794cec5fdfd /protocols/VKontakte/src
parent8fac280dcdf11c02948e0af8cd2f3b5badef88fa (diff)
VKontakte: sel-contact userinfo loading
git-svn-id: http://svn.miranda-ng.org/main/trunk@10810 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp1
-rw-r--r--protocols/VKontakte/src/vk_proto.h2
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp18
3 files changed, 13 insertions, 8 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 90a7b93081..36f2ba84da 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -587,7 +587,6 @@ void CVkProto::OnChatLeave(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
CVkChatInfo *cc = (CVkChatInfo*)pReq->pUserInfo;
LeaveChat(cc->m_chatid);
-
}
INT_PTR __cdecl CVkProto::SvcDestroyKickChat(WPARAM hContact, LPARAM)
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index 181ca23fb0..de595211a8 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -275,7 +275,7 @@ struct CVkProto : public PROTO<CVkProto>
void RetrieveStatusMsg(const CMString &StatusMsg);
void RetrieveStatusMusic(const CMString &StatusMsg);
- MCONTACT SetContactInfo(JSONNODE* Item, bool flag = false);
+ MCONTACT SetContactInfo(JSONNODE* Item, bool flag = false, bool self = false);
void RetrieveMyInfo(void);
void OnReceiveMyInfo(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void RetrieveUserInfo(LONG userId);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index d6bcf02c31..1babac70be 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -239,9 +239,9 @@ void CVkProto::OnReceiveMyInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
static char fieldsName[] = "id, first_name, last_name, photo_100, bdate, sex, timezone, contacts, online, status, about, domain";
-MCONTACT CVkProto::SetContactInfo(JSONNODE* pItem, bool flag)
+MCONTACT CVkProto::SetContactInfo(JSONNODE* pItem, bool flag, bool self)
{
- debugLogA("CVkProto::SetContactInfo");
+ debugLogA("CVkProto::SetContactInfo flag=%d self = %d", flag, self);
if (pItem == NULL)
return -1;
@@ -249,10 +249,16 @@ MCONTACT CVkProto::SetContactInfo(JSONNODE* pItem, bool flag)
if (userid == 0)
return -1;
- MCONTACT hContact;
- if (userid == m_myUserId)
- hContact = NULL;
- else if ((hContact = FindUser(userid, flag)) == NULL)
+ MCONTACT hContact = FindUser(userid, flag);
+
+ if (userid == m_myUserId){
+ if (hContact != NULL)
+ if (self)
+ hContact = NULL;
+ else
+ SetContactInfo(pItem, flag, true);
+ }
+ else if (hContact == NULL)
return -1;
CMString tszNick, tszValue;