summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_thread.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-11 22:04:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-11 22:04:51 +0000
commit7a3cc797437ff18ec801978a7606db347345cb34 (patch)
treeb9ccc439b29cd555847d6117967159cff6a0d3cc /protocols/VKontakte/src/vk_thread.cpp
parent9636f1633b90f1b45cfa42ae23bb2c507d154e91 (diff)
- fixed chat messages duping
- chat messages are marked read git-svn-id: http://svn.miranda-ng.org/main/trunk@7610 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 1effedd0db..eb24d1b226 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -432,16 +432,19 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
if (pMsg == NULL)
continue;
+ char szMid[40];
+ int mid = json_as_int(json_get(pMsg, "mid"));
+ _itoa(mid, szMid, 10);
+ if (!mids.IsEmpty())
+ mids.AppendChar(',');
+ mids.Append(szMid);
+
int chat_id = json_as_int(json_get(pMsg, "chat_id"));
if (chat_id != 0) {
AppendChatMessage(chat_id, pMsg, false);
continue;
}
- char szMid[40];
- int mid = json_as_int(json_get(pMsg, "mid"));
- _itoa(mid, szMid, 10);
-
// VK documentation lies: even if you specified preview_length=0,
// long messages get cut out. So we need to retrieve them from scratch
ptrT ptszBody( json_as_string( json_get(pMsg, "body")));
@@ -475,10 +478,6 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
recv.pCustomData = szMid;
recv.cbCustomDataSize = (int)strlen(szMid);
ProtoChainRecvMsg(hContact, &recv);
-
- if (!mids.IsEmpty())
- mids.AppendChar(',');
- mids.Append(szMid);
}
MarkMessagesRead(mids);