summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/client.h
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-11-17 16:45:04 +0000
committerRobert Pösel <robyer@seznam.cz>2014-11-17 16:45:04 +0000
commit6029781c4a2ca30552d96de331a640c653d8bfba (patch)
tree77564aefd40bb512fe295266d526d45c9b4cc239 /protocols/FacebookRM/src/client.h
parent5507917da919d55aad972f8331a11da8f721f786 (diff)
Facebook: Use correct phstamp and ttstamp values in POST data (Facebook doesn't give a .... anyway)
git-svn-id: http://svn.miranda-ng.org/main/trunk@11005 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/client.h')
-rw-r--r--protocols/FacebookRM/src/client.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/protocols/FacebookRM/src/client.h b/protocols/FacebookRM/src/client.h
index 902477e573..58bbeb5a41 100644
--- a/protocols/FacebookRM/src/client.h
+++ b/protocols/FacebookRM/src/client.h
@@ -39,7 +39,7 @@ public:
{
username_ = password_ = \
chat_sequence_num_ = chat_channel_host_ = chat_channel_partition_ = \
- dtsg_ = logout_hash_ = chat_sticky_num_ = chat_sticky_pool_ = chat_conn_num_ = chat_clientid_ = chat_traceid_ = "";
+ dtsg_ = csrf_ = logout_hash_ = chat_sticky_num_ = chat_sticky_pool_ = chat_conn_num_ = chat_clientid_ = chat_traceid_ = "";
msgid_ = error_count_ = last_feeds_update_ = last_notification_time_ = 0;
@@ -67,6 +67,7 @@ public:
std::string password_;
std::string dtsg_;
+ std::string csrf_;
std::string logout_hash_;
std::string chat_channel_;
std::string chat_channel_host_;
@@ -140,6 +141,22 @@ public:
////////////////////////////////////////////////////////////
+ // Helpers for data
+
+ std::string __inline phstamp(std::string data) {
+ std::stringstream out;
+ out << '2' << this->csrf_ << (int)data.length();
+ return out.str();
+ }
+
+ std::string __inline ttstamp() {
+ std::stringstream out;
+ out << '1' << this->csrf_;
+ return out.str();
+ }
+
+ ////////////////////////////////////////////////////////////
+
// Login handling
bool login(const char *username, const char *password);
@@ -171,6 +188,7 @@ public:
bool channel();
int send_message(MCONTACT, std::string message_recipient, std::string message_text, std::string *error_text, MessageMethod method, std::string captchaPersistData = "", std::string captcha = "");
+
////////////////////////////////////////////////////////////
// Status handling