summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-02-21 20:52:04 +0000
committerRobert Pösel <robyer@seznam.cz>2014-02-21 20:52:04 +0000
commit04d80b0cc1a2fa993bfc8254fc65dd04a22cf6ac (patch)
tree7578e60333b69e1278400a43dd29893beb0742f4 /protocols
parentc1df68a227ef30f37411593fed2aee62e2d46f5e (diff)
Facebook: Mark messages as read when they are really read in Miranda (only for private conversations - group chats are still marked as read instantly)
git-svn-id: http://svn.miranda-ng.org/main/trunk@8209 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/messages.cpp2
-rw-r--r--protocols/FacebookRM/src/proto.cpp9
-rw-r--r--protocols/FacebookRM/src/proto.h1
3 files changed, 11 insertions, 1 deletions
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp
index 83fd36df27..e7c6630642 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
int FacebookProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
{
- ForkThread(&FacebookProto::ReadMessageWorker, (void*)hContact);
+ //ForkThread(&FacebookProto::ReadMessageWorker, (void*)hContact);
CallService(MS_PROTO_CONTACTISTYPING, hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF);
return Proto_RecvMessage(hContact, pre);
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 520d13719a..10e61fc840 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -52,6 +52,7 @@ FacebookProto::FacebookProto(const char* proto_name,const TCHAR* username) :
HookProtoEvent(ME_TTB_MODULELOADED, &FacebookProto::OnToolbarInit);
HookProtoEvent(ME_GC_EVENT, &FacebookProto::OnGCEvent);
HookProtoEvent(ME_GC_BUILDMENU, &FacebookProto::OnGCMenuHook);
+ HookProtoEvent(ME_DB_EVENT_MARKED_READ, &FacebookProto::OnDbEventRead);
db_set_resident(m_szModuleName, "Status");
db_set_resident(m_szModuleName, "IdleTS");
@@ -474,6 +475,14 @@ INT_PTR FacebookProto::OnMind(WPARAM wParam, LPARAM lParam)
return 0;
}
+int FacebookProto::OnDbEventRead(WPARAM contactID, LPARAM dbei)
+{
+ if (!isOffline()) {
+ ForkThread(&FacebookProto::ReadMessageWorker, (void*)contactID);
+ }
+ return 0;
+}
+
INT_PTR FacebookProto::CheckNewsfeeds(WPARAM, LPARAM)
{
if (!isOffline()) {
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h
index cf01d962d5..06aae5acb4 100644
--- a/protocols/FacebookRM/src/proto.h
+++ b/protocols/FacebookRM/src/proto.h
@@ -146,6 +146,7 @@ public:
int __cdecl OnIdleChanged(WPARAM,LPARAM);
int __cdecl OnGCEvent(WPARAM,LPARAM);
int __cdecl OnGCMenuHook(WPARAM,LPARAM);
+ int __cdecl OnDbEventRead(WPARAM, LPARAM);
// Loops
bool NegotiateConnection();