diff options
Diffstat (limited to 'protocols/FacebookRM/src/messages.cpp')
-rw-r--r-- | protocols/FacebookRM/src/messages.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index bb3808c225..e7d2c7c081 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -172,19 +172,19 @@ void FacebookProto::ReadMessageWorker(void *p) HANDLE hContact = static_cast<HANDLE>(p);
- if (!db_get_b(NULL, m_szModuleName, FACEBOOK_KEY_MARK_READ, 0)) {
- // 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;
+ // first mark message read
+ 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;
- http::response resp = facy.flap(FACEBOOK_REQUEST_ASYNC, &data);
- } else {
- // new variant - with seen info
+ facy.flap(FACEBOOK_REQUEST_ASYNC, &data);
+
+ // then send seen info, if enabled
+ if (db_get_b(NULL, m_szModuleName, FACEBOOK_KEY_MARK_READ, 1)) {
ptrA mid( db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_MESSAGE_ID));
if (mid == NULL) return;
@@ -193,7 +193,7 @@ void FacebookProto::ReadMessageWorker(void *p) data += "&__user=" + facy.self_.user_id;
data += "&__a=1&__dyn=&__req=j&phstamp=0";
- http::response resp = facy.flap(FACEBOOK_REQUEST_MARK_READ, &data);
+ facy.flap(FACEBOOK_REQUEST_MARK_READ, &data);
}
}
|