summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_chats.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_chats.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_chats.cpp')
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index a604e9bda9..0df57d6856 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -243,12 +243,13 @@ void CVkProto::AppendChatMessage(int id, JSONNODE *pMsg, bool bIsHistory)
if (cc->m_bHistoryRead)
AppendChatMessage(cc, uid, msgTime, tszBody, bIsHistory);
else {
- CVkChatMessage *cm = new CVkChatMessage();
- cm->m_mid = mid;
+ CVkChatMessage *cm = cc->m_msgs.find((CVkChatMessage *)&mid);
+ if (cm == NULL)
+ cc->m_msgs.insert(cm = new CVkChatMessage(mid));
+
cm->m_uid = uid;
cm->m_date = msgTime;
cm->m_tszBody = tszBody.detouch();
- cc->m_msgs.insert(cm);
}
}