summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-10-07 16:52:47 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-10-07 16:52:47 +0000
commit492fc206271dd44d312a80b8ef6f91a7e360ce40 (patch)
tree9761798e3a20432d5062824b87c69745fc69d1e8 /protocols/VKontakte/src/misc.cpp
parentdf0f5de95815eedd34834c9b4becb66c62b63033 (diff)
VKontakte: add read notification in *srmm status bar
git-svn-id: http://svn.miranda-ng.org/main/trunk@10727 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 9d299a31cc..14b2d13a3d 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -501,4 +501,42 @@ bool tlstrstr(TCHAR* _s1, TCHAR* _s2)
CharLowerBuff(s1, SIZEOF(s1));
CharLowerBuff(s2, SIZEOF(s2));
return (_tcsstr(s1, s2) != NULL);
+}
+
+void CVkProto::ContactTypingThread(void *p)
+{
+ MCONTACT hContact = (MCONTACT)p;
+ CallService(MS_PROTO_CONTACTISTYPING, hContact, 5);
+ Sleep(5500);
+ CallService(MS_PROTO_CONTACTISTYPING, hContact, 0);
+ Sleep(1500);
+ SetSrmmReadStatus(hContact);
+}
+
+int CVkProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
+{
+ MessageWindowEventData *event = (MessageWindowEventData *)lParam;
+
+ if (event->uType == MSG_WINDOW_EVT_OPENING)
+ SetSrmmReadStatus(event->hContact);
+
+ return 0;
+}
+
+
+void CVkProto::SetSrmmReadStatus(MCONTACT hContact)
+{
+ time_t time = getDword(hContact, "LastMsgReadTime", 0);
+ if (!time)
+ return;
+
+ TCHAR ttime[64];
+ _tcsftime(ttime, SIZEOF(ttime), _T("%X"), localtime(&time));
+
+ StatusTextData st = { 0 };
+ st.cbSize = sizeof(st);
+ st.hIcon = LoadSkinnedIcon(SKINICON_OTHER_EMPTYBLOB);
+ mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime);
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, NULL);
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
} \ No newline at end of file