summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_thread.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-10-10 07:01:31 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-10-10 07:01:31 +0000
commit3e604c7a2542790b5a3f22f2ddd714af520190be (patch)
treeb70dd13151b4d3be3ffc6b1f4652ab1a521ebdba /protocols/VKontakte/src/vk_thread.cpp
parent16b6caa0a8b5e80c75a93b67db1ae5812a81fc80 (diff)
VKontakte: reworked mark as read process
git-svn-id: http://svn.miranda-ng.org/main/trunk@10752 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 1205137f90..232703f7ad 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -482,6 +482,12 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
}
/////////////////////////////////////////////////////////////////////////////////////////
+int CVkProto::OnDbEventRead(WPARAM hContact, LPARAM)
+{
+ if (m_iMarkMessageReadOn == markOnRead)
+ MarkMessagesRead(hContact);
+ return 0;
+}
void CVkProto::MarkMessagesRead(const CMStringA &mids)
{
@@ -557,7 +563,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
MCONTACT hContact = FindUser(uid, true);
char szMid[40];
_itoa(mid, szMid, 10);
- if (!m_bMarkReadOnReply){
+ if (m_iMarkMessageReadOn == markOnReceive){
if (!mids.IsEmpty())
mids.AppendChar(',');
mids.Append(szMid);
@@ -589,7 +595,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
}
}
- if (!m_bMarkReadOnReply)
+ if (m_iMarkMessageReadOn == markOnReceive)
MarkMessagesRead(mids);
}
@@ -639,7 +645,7 @@ void CVkProto::OnReceiveDlgs(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
else
GetHistoryDlg(hContact, mid);
- if (!m_bMarkReadOnReply&&numUnread)
+ if (m_iMarkMessageReadOn==markOnReceive&&numUnread)
MarkMessagesRead(hContact);
}
else if (numUnread) {
@@ -649,7 +655,7 @@ void CVkProto::OnReceiveDlgs(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
setDword(hContact, "new_lastmsgid", mid);
GetHistoryDlgMessages(hContact, 0, numUnread, -1);
- if (!m_bMarkReadOnReply)
+ if (m_iMarkMessageReadOn == markOnReceive)
MarkMessagesRead(hContact);
}
}