diff options
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 32 |
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"); |