diff options
author | Robert Pösel <robyer@seznam.cz> | 2017-06-23 23:04:00 +0200 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2017-06-23 23:06:09 +0200 |
commit | b71358ca8a217133f04ede0ba3f26718a45df802 (patch) | |
tree | 63a369b93dfeeec29369213450a41337143a7edd | |
parent | eb2de5cc9dd3b76513c552f5e58c4d6a5340997c (diff) |
Facebook: unneeded crutch removed (reverted from commit b846cb5043b6d5f5ac59cb40f252bc9ced189dfd)
We need values with "abcdefgh...xyz0123456789", that's why radix 36 was used. INT_VALUE produces only numbers.
-rw-r--r-- | protocols/FacebookRM/src/client.h | 7 | ||||
-rw-r--r-- | protocols/FacebookRM/src/requests/contacts.h | 4 | ||||
-rw-r--r-- | protocols/FacebookRM/src/requests/feeds.h | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/requests/history.h | 4 | ||||
-rw-r--r-- | protocols/FacebookRM/src/requests/login.h | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/requests/messages.h | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/src/requests/notifications.h | 4 | ||||
-rw-r--r-- | protocols/FacebookRM/src/requests/status.h | 4 | ||||
-rw-r--r-- | protocols/FacebookRM/src/requests/utils.h | 4 |
9 files changed, 20 insertions, 17 deletions
diff --git a/protocols/FacebookRM/src/client.h b/protocols/FacebookRM/src/client.h index 6018a196aa..6e3a3e2e87 100644 --- a/protocols/FacebookRM/src/client.h +++ b/protocols/FacebookRM/src/client.h @@ -153,8 +153,11 @@ public: return ""; // FIXME: What's this value and where it come from? Looks like it is the same through all requests.
}
- __inline unsigned int __req() { // Increment request number
- return InterlockedIncrement(&this->chat_req_);
+ __inline CMStringA __req() {
+ // Increment request number and convert it to string with radix 36 (whole numbers + whole alphabet)
+ char buffer[10];
+ itoa(InterlockedIncrement(&this->chat_req_), buffer, 36);
+ return CMStringA(buffer);
}
__inline const char *__rev() {
diff --git a/protocols/FacebookRM/src/requests/contacts.h b/protocols/FacebookRM/src/requests/contacts.h index b7793cdc40..c49aabfabf 100644 --- a/protocols/FacebookRM/src/requests/contacts.h +++ b/protocols/FacebookRM/src/requests/contacts.h @@ -56,7 +56,7 @@ public: << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << "__a=1" << "__pc=PHASED:DEFAULT" @@ -81,7 +81,7 @@ public: << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << "__a=1" << "__pc=PHASED:DEFAULT" diff --git a/protocols/FacebookRM/src/requests/feeds.h b/protocols/FacebookRM/src/requests/feeds.h index 1fc7c3fbc8..24d9836812 100644 --- a/protocols/FacebookRM/src/requests/feeds.h +++ b/protocols/FacebookRM/src/requests/feeds.h @@ -55,7 +55,7 @@ public: << "__pc=PHASED:DEFAULT" << LONG_VALUE("timestamp", ::time(NULL)) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << CHAR_VALUE("__user", fc->self_.user_id.c_str()); } diff --git a/protocols/FacebookRM/src/requests/history.h b/protocols/FacebookRM/src/requests/history.h index 2c35cdcecb..2d8d58b1ea 100644 --- a/protocols/FacebookRM/src/requests/history.h +++ b/protocols/FacebookRM/src/requests/history.h @@ -149,7 +149,7 @@ private: << "client=mercury" << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) @@ -176,7 +176,7 @@ public: << "client=mercury" << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) diff --git a/protocols/FacebookRM/src/requests/login.h b/protocols/FacebookRM/src/requests/login.h index 0c73a6e834..c07a88a511 100644 --- a/protocols/FacebookRM/src/requests/login.h +++ b/protocols/FacebookRM/src/requests/login.h @@ -70,7 +70,7 @@ public: << "__pc=EXP1:DEFAULT" << CHAR_VALUE("current_time", (utils::time::unix_timestamp() + ".000").c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("fb_dtsg", dtsg) << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) << CHAR_VALUE("__rev", fc->__rev()); diff --git a/protocols/FacebookRM/src/requests/messages.h b/protocols/FacebookRM/src/requests/messages.h index 9dbbf3aab7..5241e86d25 100644 --- a/protocols/FacebookRM/src/requests/messages.h +++ b/protocols/FacebookRM/src/requests/messages.h @@ -95,7 +95,7 @@ public: << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) @@ -125,7 +125,7 @@ public: << "source=mercury-chat" << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) @@ -160,7 +160,7 @@ public: << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << "__a=1"; } diff --git a/protocols/FacebookRM/src/requests/notifications.h b/protocols/FacebookRM/src/requests/notifications.h index ecaed10966..72643ce6e8 100644 --- a/protocols/FacebookRM/src/requests/notifications.h +++ b/protocols/FacebookRM/src/requests/notifications.h @@ -42,7 +42,7 @@ public: << "businessID=" // probably for pages? << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << "__pc=PHASED:DEFAULT" << "__be=-1" @@ -66,7 +66,7 @@ public: << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << CHAR_VALUE("alert_ids%5B0%5D", ptrA(mir_urlEncode(id))); } diff --git a/protocols/FacebookRM/src/requests/status.h b/protocols/FacebookRM/src/requests/status.h index 8407fc7329..b835fad0b9 100644 --- a/protocols/FacebookRM/src/requests/status.h +++ b/protocols/FacebookRM/src/requests/status.h @@ -39,7 +39,7 @@ public: << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()); } }; @@ -65,7 +65,7 @@ public: << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) << CHAR_VALUE("__user", fc->self_.user_id.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()); ; } diff --git a/protocols/FacebookRM/src/requests/utils.h b/protocols/FacebookRM/src/requests/utils.h index 3ce9483497..92c913d890 100644 --- a/protocols/FacebookRM/src/requests/utils.h +++ b/protocols/FacebookRM/src/requests/utils.h @@ -35,7 +35,7 @@ public: << "new_captcha_type=TFBCaptcha" << CHAR_VALUE("skipped_captcha_data", captchaPersistData) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("__rev", fc->__rev()) << CHAR_VALUE("__user", fc->self_.user_id.c_str()); } @@ -128,7 +128,7 @@ public: Body << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) << CHAR_VALUE("__dyn", fc->__dyn()) - << INT_VALUE("__req", fc->__req()) + << CHAR_VALUE("__req", fc->__req()) << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) << CHAR_VALUE("__user", status->isPage && !status->user_id.empty() ? status->user_id.c_str() : fc->self_.user_id.c_str()) << CHAR_VALUE("xhpc_targetid", status->user_id.empty() ? fc->self_.user_id.c_str() : status->user_id.c_str()) |