summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-09-22 09:30:48 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-09-22 09:30:48 +0000
commit5a5a0265a25e063ae560adbf83042e01d0ce1941 (patch)
treef6c3782d2b911a36f0b8abe71d19a68b38e99edb /protocols/VKontakte/src/misc.cpp
parent3bbcdbe69ab3e2c084eb1e863315718c9c7b2aa1 (diff)
VKontakte:
hidden option for full load clist support for sync message read status from server version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@15421 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index b83bb0d396..06e0bccac2 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -655,6 +655,32 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact)
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}
+void CVkProto::MarkDialogAsRead(MCONTACT hContact)
+{
+ debugLogA("CVkProto::MarkDialogAsRead");
+ if (!IsOnline())
+ return;
+
+ LONG userID = getDword(hContact, "ID", -1);
+ if (userID == -1 || userID == VK_FEED_USER)
+ return;
+
+ MEVENT hDBEvent;
+ while ((hDBEvent = db_event_firstUnread(hContact)) != NULL) {
+ db_event_markRead(hContact, hDBEvent);
+ int res = CallService(MS_CLIST_REMOVEEVENT, hContact, hDBEvent);
+ debugLogA("CVkProto::MarkDialogAsRead [1] result = %d, hDbEvent = %d", res, (int)hDBEvent);
+ }
+
+ hContact = db_mc_tryMeta(hContact);
+ CLISTEVENT *cle = NULL;
+ while ((cle = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, hContact, 0)) != NULL) {
+ db_event_markRead(hContact, cle->hDbEvent);
+ int res = CallService(MS_CLIST_REMOVEEVENT, hContact, cle->hDbEvent);
+ debugLogA("CVkProto::MarkDialogAsRead [2] result = %d, hDbEvent = %d", res, (int)(cle->hDbEvent));
+ }
+}
+
char* CVkProto::GetStickerId(const char* Msg, int &stickerid)
{
stickerid = 0;