summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-09-09 13:06:47 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-09-09 13:06:47 +0000
commit4becc46d15baf8393a347c1d3897af5d8d55dea6 (patch)
tree7643734cd731ed4d31bb2c58151b5259608c5c03
parent24a161c41edfebcc4850bd58480649ff2ddf8d7f (diff)
VKontakte: fix for chat messages mistake
git-svn-id: http://svn.miranda-ng.org/main/trunk@10411 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp4
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp6
2 files changed, 8 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index ba78103f0d..c8d041157a 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -218,9 +218,9 @@ void CVkProto::AppendChatMessage(int id, JSONNODE *pMsg, bool bIsHistory)
if (cc == NULL)
return;
- int mid = json_as_int(json_get(pMsg, "mid"));
+ int mid = json_as_int(json_get(pMsg, "id"));
int isOut = json_as_int(json_get(pMsg, "out"));
- int uid = json_as_int(json_get(pMsg, "uid"));
+ int uid = json_as_int(json_get(pMsg, "user_id"));
int msgTime = json_as_int(json_get(pMsg, "date"));
time_t now = time(NULL);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 0d7761fa1d..cdb229d591 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -461,6 +461,12 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
mids.Append(szMid);
}
+ int chat_id = json_as_int(json_get(pMsg, "chat_id"));
+ if (chat_id != 0) {
+ AppendChatMessage(chat_id, pMsg, false);
+ continue;
+ }
+
PROTORECVEVENT recv = { 0 };
recv.flags = PREF_TCHAR;
if (isRead&&!m_bMesAsUnread)