From b754e2e21ea8c3d122ba35d8a0eeba18e94e9e7f Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 5 Sep 2015 10:07:30 +0000 Subject: Vkontakte: new MessageState api git-svn-id: http://svn.miranda-ng.org/main/trunk@15250 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 4 ++-- protocols/VKontakte/src/stdafx.h | 1 + protocols/VKontakte/src/vk_pollserver.cpp | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 5507ca4f90..b5c3238027 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -701,7 +701,7 @@ void CVkProto::ContactTypingThread(void *p) Sleep(5500); CallService(MS_PROTO_CONTACTISTYPING, hContact); - if (!ServiceExists("MessageState/DummyService")) { + if (!ServiceExists(MS_MESSAGESTATE_UPDATE)) { Sleep(1500); SetSrmmReadStatus(hContact); } @@ -712,7 +712,7 @@ int CVkProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam) debugLogA("CVkProto::OnProcessSrmmEvent"); MessageWindowEventData *event = (MessageWindowEventData *)lParam; - if (event->uType == MSG_WINDOW_EVT_OPENING && !ServiceExists("MessageState/DummyService")) + if (event->uType == MSG_WINDOW_EVT_OPENING && !ServiceExists(MS_MESSAGESTATE_UPDATE)) SetSrmmReadStatus(event->hContact); return 0; diff --git a/protocols/VKontakte/src/stdafx.h b/protocols/VKontakte/src/stdafx.h index 0db91b86dc..8aaa81e389 100644 --- a/protocols/VKontakte/src/stdafx.h +++ b/protocols/VKontakte/src/stdafx.h @@ -58,6 +58,7 @@ along with this program. If not, see . #include #include +#include #include #include diff --git a/protocols/VKontakte/src/vk_pollserver.cpp b/protocols/VKontakte/src/vk_pollserver.cpp index 4bcf807a4f..f835fbc510 100644 --- a/protocols/VKontakte/src/vk_pollserver.cpp +++ b/protocols/VKontakte/src/vk_pollserver.cpp @@ -87,7 +87,12 @@ void CVkProto::PollUpdates(const JSONNode &jnUpdates) if (hContact != NULL && (flags & VKFLAG_MSGUNREAD) && !CheckMid(m_incIds, msgid)) { setDword(hContact, "LastMsgReadTime", time(NULL)); - if (!ServiceExists("MessageState/DummyService")) + if (ServiceExists(MS_MESSAGESTATE_UPDATE)) + { + MessageReadData data(time(NULL), MRD_TYPE_READTIME); + CallService(MS_MESSAGESTATE_UPDATE, hContact, (LPARAM)&data); + } + else SetSrmmReadStatus(hContact); if (m_bUserForceOnlineOnActivity) SetInvisible(hContact); -- cgit v1.2.3