summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/contacts.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-09-01 21:17:16 +0000
committerRobert Pösel <robyer@seznam.cz>2015-09-01 21:17:16 +0000
commitf2b5b0dd953573cbce3fe8df62daa2ada646c626 (patch)
tree85ac873ee705901fbd00b6e348d0314c6c818fdb /protocols/FacebookRM/src/contacts.cpp
parente596945743e029945b7fd8657de5d3f6c279d44b (diff)
Facebook: Revise various requests, remove weird typing optimization
Revised requests: * typing notification * thread_sync * thread_info * user_info * user_info_all * buddy_list git-svn-id: http://svn.miranda-ng.org/main/trunk@15143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r--protocols/FacebookRM/src/contacts.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 0b94c31701..1d8153b335 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -175,12 +175,16 @@ std::string FacebookProto::ThreadIDToContactID(const std::string &thread_id)
std::string data = "client=mercury";
data += "&__user=" + facy.self_.user_id;
+ data += "&__dyn=" + facy.__dyn();
+ data += "&__req=" + facy.__req();
data += "&fb_dtsg=" + facy.dtsg_;
- data += "&__a=1&__dyn=&__req=&ttstamp=" + facy.ttstamp_;
+ data += "&ttstamp=" + facy.ttstamp_;
+ data += "&__rev=" + facy.__rev();
+
data += "&threads[thread_ids][0]=" + utils::url::encode(thread_id);
std::string user_id;
- http::response resp = facy.flap(REQUEST_THREAD_INFO, &data);
+ http::response resp = facy.flap(REQUEST_THREAD_INFO, &data); // NOTE: Request revised 1.9.2015
if (resp.code == HTTP_CODE_OK) {
CODE_BLOCK_TRY
@@ -210,18 +214,25 @@ void FacebookProto::LoadContactInfo(facebook_user* fbu)
return;
// TODO: support for more friends at once
- std::string get_query = "&ids[0]=" + utils::url::encode(fbu->user_id);
+ std::string data = "ids[0]=" + utils::url::encode(fbu->user_id);
+
+ data += "&__user=" + facy.self_.user_id;
+ data += "&__dyn=" + facy.__dyn();
+ data += "&__req=" + facy.__req();
+ data += "&fb_dtsg=" + facy.dtsg_;
+ data += "&ttstamp=" + facy.ttstamp_;
+ data += "&__rev=" + facy.__rev();
- http::response resp = facy.flap(REQUEST_USER_INFO, NULL, &get_query);
+ http::response resp = facy.flap(REQUEST_USER_INFO, &data); // NOTE: Request revised 1.9.2015
if (resp.code == HTTP_CODE_OK) {
CODE_BLOCK_TRY
facebook_json_parser* p = new facebook_json_parser(this);
- p->parse_user_info(&resp.data, fbu);
- delete p;
+ p->parse_user_info(&resp.data, fbu);
+ delete p;
- debugLogA("*** Contact thread info processed");
+ debugLogA("*** Contact thread info processed");
CODE_BLOCK_CATCH
@@ -266,15 +277,18 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
std::string data = "client=mercury";
data += "&__user=" + facy.self_.user_id;
+ data += "&__dyn=" + facy.__dyn();
+ data += "&__req=" + facy.__req();
data += "&fb_dtsg=" + facy.dtsg_;
- data += "&__a=1&__dyn=&__req=&ttstamp=" + facy.ttstamp_;
+ data += "&ttstamp=" + facy.ttstamp_;
+ data += "&__rev=" + facy.__rev();
std::string thread_id = utils::url::encode(fbc->thread_id);
// request info about thread
data += "&threads[thread_ids][0]=" + thread_id;
- http::response resp = facy.flap(REQUEST_THREAD_INFO, &data);
+ http::response resp = facy.flap(REQUEST_THREAD_INFO, &data); // NOTE: Request revised 1.9.2015
if (resp.code != HTTP_CODE_OK) {
facy.handle_error("LoadChatInfo");