summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index e9e8bb035a..5d36024b34 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -562,15 +562,16 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
ptszBody = mir_tstrdup(CMString(ptszBody) + GetAttachmentDescr(pAttachments));
MCONTACT hContact = FindUser(uid, true);
+ int chat_id = json_as_int(json_get(pMsg, "chat_id"));
+
char szMid[40];
_itoa(mid, szMid, 10);
- if (m_iMarkMessageReadOn == markOnReceive){
+ if ((m_iMarkMessageReadOn == markOnReceive) || (chat_id != 0)){
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;
@@ -598,7 +599,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
}
}
- if (m_iMarkMessageReadOn == markOnReceive)
+ if (!mids.IsEmpty())
MarkMessagesRead(mids);
}