summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-05 10:07:30 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-05 10:07:30 +0000
commitb754e2e21ea8c3d122ba35d8a0eeba18e94e9e7f (patch)
tree53aed01857f1e5869bc93d3dd19b42d0a11dbeaf
parente7cee36fa4222ecd447e98a51c20d96ce018bfdc (diff)
Vkontakte: new MessageState api
git-svn-id: http://svn.miranda-ng.org/main/trunk@15250 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/VKontakte/src/misc.cpp4
-rw-r--r--protocols/VKontakte/src/stdafx.h1
-rw-r--r--protocols/VKontakte/src/vk_pollserver.cpp7
3 files changed, 9 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>.
#include <m_utils.h>
#include <m_proto_listeningto.h>
+#include <m_messagestate.h>
#include <m_popup.h>
#include <m_folders.h>
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);