summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-06-09 18:43:25 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-06-09 18:43:25 +0000
commitc5246c7f79804274be40cad3cb8d48fe1f67e050 (patch)
tree8999a16793c90a8055f2f15e9b3dda51312cbfd9 /protocols/FacebookRM
parent8423eadde65c72c96392c506068c7977621f28e7 (diff)
Facebook: MessageState support.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14088 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r--protocols/FacebookRM/src/communication.cpp3
-rw-r--r--protocols/FacebookRM/src/db.h2
-rw-r--r--protocols/FacebookRM/src/proto.cpp8
3 files changed, 7 insertions, 6 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index fde25c036f..342845436f 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -691,8 +691,9 @@ 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, NULL);
}
diff --git a/protocols/FacebookRM/src/db.h b/protocols/FacebookRM/src/db.h
index c261ecbbf5..3e1a0ac804 100644
--- a/protocols/FacebookRM/src/db.h
+++ b/protocols/FacebookRM/src/db.h
@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define FACEBOOK_KEY_DELETED "DeletedTS"
#define FACEBOOK_KEY_CONTACT_TYPE "ContactType"
#define FACEBOOK_KEY_MESSAGE_ID "LastMessageId"
-#define FACEBOOK_KEY_MESSAGE_READ "MessageRead"
+#define FACEBOOK_KEY_MESSAGE_READ "LastMsgReadTime"
#define FACEBOOK_KEY_MESSAGE_READERS "MessageReaders"
// Contact and account DB keys
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index a7184d4ff0..1170c298be 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -170,7 +170,7 @@ DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT)
else
return 0;
case PFLAGNUM_4:
- return PF4_NOCUSTOMAUTH | PF4_FORCEADDED | PF4_AVATARS | PF4_SUPPORTTYPING | PF4_NOAUTHDENYREASON | PF4_IMSENDOFFLINE;
+ return PF4_NOCUSTOMAUTH | PF4_FORCEADDED | PF4_AVATARS | PF4_SUPPORTTYPING | PF4_NOAUTHDENYREASON | PF4_IMSENDOFFLINE | PF4_READNOTIFY;
case PFLAGNUM_5:
return PF2_ONTHEPHONE;
case PFLAG_MAXLENOFMESSAGE:
@@ -1135,9 +1135,9 @@ void FacebookProto::MessageRead(MCONTACT hContact)
// Load readers names
ptrT treaders(getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS));
mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : _T("???"));
- } else {
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
+ } else if (!ServiceExists("MessageState/DummyService")){
mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime);
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}
-
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}