From 1596f83daf39b7b33ef342d819b02111a175447d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Fri, 17 May 2013 19:26:34 +0000 Subject: Facebook: Ooooops. Fixed marking messages as read. git-svn-id: http://svn.miranda-ng.org/main/trunk@4711 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/messages.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index e7d2c7c081..58dcc8275f 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -168,23 +168,21 @@ void FacebookProto::ReadMessageWorker(void *p) if (p == NULL) return; - return; - HANDLE hContact = static_cast(p); - // first mark message read - ptrA id( db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_ID)); - if (id == NULL) return; + if (!db_get_b(NULL, m_szModuleName, FACEBOOK_KEY_MARK_READ, 1)) { + // old variant - no seen info updated + ptrA id( db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_ID)); + if (id == NULL) return; - std::string data = "action=chatMarkRead"; - data += "&other_user=" + std::string(id); - data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0"); - data += "&lsd=&__user=" + facy.self_.user_id; + std::string data = "action=chatMarkRead"; + data += "&other_user=" + std::string(id); + data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0"); + data += "&lsd=&__user=" + facy.self_.user_id; - facy.flap(FACEBOOK_REQUEST_ASYNC, &data); - - // then send seen info, if enabled - if (db_get_b(NULL, m_szModuleName, FACEBOOK_KEY_MARK_READ, 1)) { + facy.flap(FACEBOOK_REQUEST_ASYNC, &data); + } else { + // new variant - with seen info ptrA mid( db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_MESSAGE_ID)); if (mid == NULL) return; -- cgit v1.2.3