summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/communication.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-03-27 00:19:08 +0000
committerRobert Pösel <robyer@seznam.cz>2016-03-27 00:19:08 +0000
commit61efc6be20aa4315e9e524dffeb9b5c812ab19cc (patch)
tree1a0ca8bdd6e8ff891d598277acac91656b0e56d6 /protocols/FacebookRM/src/communication.cpp
parent3e19b9ac8c27d804c5103be23bc9c476c2884948 (diff)
Facebook: More messaging fixes
Receiving chat messages should work now. And some other fixes. But attachments/stickers still doesn't work. git-svn-id: http://svn.miranda-ng.org/main/trunk@16552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r--protocols/FacebookRM/src/communication.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 122fd615b0..3e2da643fa 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -469,9 +469,11 @@ std::string facebook_client::choose_action(RequestType request_type, std::string
if (!isPing) {
action += "&qp=y"; // TODO: what's this item?
action += "&pws=fresh"; // TODO: what's this item?
- action += "&isq=449655"; // TODO: what's this item?
+ action += "&isq=487632"; // TODO: what's this item?
action += "&msgs_recv=" + utils::conversion::to_string(&this->chat_msgs_recv_, UTILS_CONV_UNSIGNED_NUMBER);
- // TODO: sometimes there is &tur=1697 and &qpmade=<some actual timestamp>
+ // TODO: sometimes there is &tur=1711 and &qpmade=<some actual timestamp> and &isq=487632
+ // action += "&request_batch=1"; // it somehow batches up more responses to one - then response has special "t=batched" type and "batches" array with the data
+ // action += "&msgr_region=LLA"; // it was here only for first pull, same as request_batch
}
action += "&cap=8"; // TODO: what's this item? Sometimes it's 0, sometimes 8
@@ -1331,14 +1333,11 @@ int facebook_client::send_message(int seqid, MCONTACT hContact, const std::strin
} else {
data += "&message_batch[0][specific_to_list][0]=fbid:" + std::string(userId);
data += "&message_batch[0][specific_to_list][1]=fbid:" + this->self_.user_id;
- data += "&message_batch[0][client_thread_id]=user:" + std::string(userId);
data += "&message_batch[0][other_user_fbid]=" + std::string(userId);
}
- data += "&message_batch[0][thread_fbid]";
data += "&message_batch[0][author]=fbid:" + this->self_.user_id;
data += "&message_batch[0][author_email]";
- data += "&message_batch[0][coordinates]";
data += "&message_batch[0][timestamp]=" + utils::time::mili_timestamp();
data += "&message_batch[0][timestamp_absolute]";
data += "&message_batch[0][timestamp_relative]";
@@ -1346,6 +1345,10 @@ int facebook_client::send_message(int seqid, MCONTACT hContact, const std::strin
data += "&message_batch[0][is_unread]=false";
data += "&message_batch[0][is_forward]=false";
data += "&message_batch[0][is_filtered_content]=false";
+ data += "&message_batch[0][is_filtered_content_bh]=false";
+ data += "&message_batch[0][is_filtered_content_account]=false";
+ data += "&message_batch[0][is_filtered_content_quasar]=false";
+ data += "&message_batch[0][is_filtered_content_invalid_app]=false";
data += "&message_batch[0][is_spoof_warning]=false";
data += "&message_batch[0][source]=source:chat:web";
data += "&message_batch[0][source_tags][0]=source:chat";
@@ -1366,10 +1369,9 @@ int facebook_client::send_message(int seqid, MCONTACT hContact, const std::strin
data += "&message_batch[0][status]=0";
data += "&message_batch[0][offline_threading_id]";
data += "&message_batch[0][message_id]";
- data += "&message_batch[0][manual_retry_cnt]";
data += "&message_batch[0][ephemeral_ttl_mode]=0";
data += "&message_batch[0][manual_retry_cnt]=0";
- data += "&client=mercury&__a=1";
+ data += "&client=mercury&__a=1&__pc=EXP1:DEFAULT";
data += "&fb_dtsg=" + this->dtsg_;
data += "&__user=" + this->self_.user_id;
data += "&ttstamp=" + ttstamp_;
@@ -1388,7 +1390,7 @@ int facebook_client::send_message(int seqid, MCONTACT hContact, const std::strin
// Remember this message id
std::string mid = utils::text::source_get_value(&resp.data, 2, "\"message_id\":\"", "\"");
if (mid.empty())
- mid = utils::text::source_get_value(&resp.data, 2, "\"mid\":\"", "\"");
+ mid = utils::text::source_get_value(&resp.data, 2, "\"mid\":\"", "\""); // TODO: This is probably not used anymore
// For classic contacts remember last message id
if (!parent->isChatRoom(hContact))