summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_thread.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-10-15 09:54:32 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-10-15 09:54:32 +0000
commit40d90d097b40f76b156b5fc1da6422ee03772951 (patch)
treef88fbba488649e92dbe76fa18c979c51ec1f0415 /protocols/VKontakte/src/vk_thread.cpp
parent63a417acde67f9ae22311611f1a3a77ed8a0615a (diff)
VKontakte:
fix C4018 warning rework leave chat support add leave chat by kick add rejoin to chat git-svn-id: http://svn.miranda-ng.org/main/trunk@10787 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 7fea5b8ab6..d0dacb36df 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -573,7 +573,12 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
}
if (chat_id != 0) {
- AppendChatMessage(chat_id, pMsg, false);
+ CMString action_chat = json_as_string(json_get(pMsg, "action"));
+ CMString action_mid = json_as_string(json_get(pMsg, "action_mid"));
+ if (action_chat == "chat_kick_user")
+ KickFromChat(chat_id, _ttoi(action_mid.GetBuffer()), pMsg);
+ else
+ AppendChatMessage(chat_id, pMsg, false);
continue;
}
@@ -621,7 +626,9 @@ void CVkProto::OnReceiveDlgs(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
return;
if (m_bAutoSyncHistory&&m_bPopUpSyncHistory)
MsgPopup(NULL, TranslateT("Start sync history"), TranslateT("Sync history"));
+ debugLogA("CVkProto::OnReceiveDlgs numDlgs = %d", numDlgs);
for (int i = 0; i < numDlgs; i++) {
+ debugLogA("CVkProto::OnReceiveDlgs i = %d", i);
JSONNODE *pDlg = json_at(pDlgs, i);
if (pDlg == NULL)
break;
@@ -634,6 +641,7 @@ void CVkProto::OnReceiveDlgs(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
int chatid = json_as_int(json_get(pDlg, "chat_id"));
if (chatid != 0) {
+ debugLogA("CVkProto::OnReceiveDlgs chatid = %d", chatid);
if (m_chats.find((CVkChatInfo*)&chatid) == NULL)
AppendChat(chatid, pDlg);
}