summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
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;