summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-05 10:17:07 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-05 10:17:07 +0000
commit3e66e9b159ce9ef494bd2caedf36481a952acd4a (patch)
tree5d5992e43017839c4da57d38a41b2e806799546e
parentb754e2e21ea8c3d122ba35d8a0eeba18e94e9e7f (diff)
Facebook: new MessageState api
git-svn-id: http://svn.miranda-ng.org/main/trunk@15251 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/FacebookRM/src/communication.cpp9
-rw-r--r--protocols/FacebookRM/src/proto.cpp2
-rw-r--r--protocols/FacebookRM/src/stdafx.h1
3 files changed, 9 insertions, 3 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index d6ffff32bb..b9d7a9d980 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -682,6 +682,11 @@ void facebook_client::insert_reader(MCONTACT hContact, time_t timestamp, const s
parent->setDword(hContact, FACEBOOK_KEY_MESSAGE_READ, timestamp);
readers.insert(std::make_pair(hContact, timestamp));
parent->MessageRead(hContact);
+ if (ServiceExists(MS_MESSAGESTATE_UPDATE))
+ {
+ MessageReadData data(timestamp, MRD_TYPE_READTIME);
+ CallService(MS_MESSAGESTATE_UPDATE, hContact, (LPARAM)&data);
+ }
}
/**
@@ -692,8 +697,8 @@ void facebook_client::erase_reader(MCONTACT hContact)
if (parent->isChatRoom(hContact)) {
parent->delSetting(hContact, FACEBOOK_KEY_MESSAGE_READERS);
}
- if (!ServiceExists("MessageState/DummyService"))
- parent->delSetting(hContact, FACEBOOK_KEY_MESSAGE_READ);
+
+ parent->delSetting(hContact, FACEBOOK_KEY_MESSAGE_READ);
readers.erase(hContact);
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact);
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 7992d2785d..38c89ed0de 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -1125,7 +1125,7 @@ void FacebookProto::MessageRead(MCONTACT hContact)
ptrT treaders(getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS));
mir_sntprintf(st.tszText, TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : _T("???"));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
- } else if (!ServiceExists("MessageState/DummyService")){
+ } else if (!ServiceExists(MS_MESSAGESTATE_UPDATE)){
mir_sntprintf(st.tszText, TranslateT("Message read: %s"), ttime);
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}
diff --git a/protocols/FacebookRM/src/stdafx.h b/protocols/FacebookRM/src/stdafx.h
index c76ce9bba2..2e16e05152 100644
--- a/protocols/FacebookRM/src/stdafx.h
+++ b/protocols/FacebookRM/src/stdafx.h
@@ -60,6 +60,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_json.h>
#include <m_imgsrvc.h>
#include <m_http.h>
+#include <m_messagestate.h>
class FacebookProto;