From e3cea4cc5c8f844fedbccd76077a4b15897f9b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 3 Nov 2012 19:22:54 +0000 Subject: Facebook: No more post_form_id. Elliot! No more! git-svn-id: http://svn.miranda-ng.org/main/trunk@2169 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/client.h | 4 +--- protocols/FacebookRM/src/communication.cpp | 38 ++++++++---------------------- protocols/FacebookRM/src/contacts.cpp | 24 +++++++------------ protocols/FacebookRM/src/messages.cpp | 13 ++++------ 4 files changed, 23 insertions(+), 56 deletions(-) diff --git a/protocols/FacebookRM/src/client.h b/protocols/FacebookRM/src/client.h index 5882c62945..69e5077dbb 100644 --- a/protocols/FacebookRM/src/client.h +++ b/protocols/FacebookRM/src/client.h @@ -35,9 +35,8 @@ public: facebook_client( ) { username_ = password_ = \ - post_form_id_ = dtsg_ = \ chat_sequence_num_ = chat_channel_host_ = chat_channel_partition_ = \ - logout_hash_ = ""; + dtsg_ = logout_hash_ = ""; msgid_ = error_count_ = last_feeds_update_ = last_notification_time_ = 0; @@ -64,7 +63,6 @@ public: std::string username_; std::string password_; - std::string post_form_id_; std::string dtsg_; std::string logout_hash_; std::string chat_channel_; diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 43d9cf127e..1e9b8aeaaa 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -429,14 +429,13 @@ std::string facebook_client::choose_action( int request_type, std::string* data, case FACEBOOK_REQUEST_RECONNECT: { - std::string action = "/ajax/presence/reconnect.php?__a=1&reason=%s&fb_dtsg=%s&post_form_id=%s&__user=%s"; + std::string action = "/ajax/presence/reconnect.php?__a=1&reason=%s&fb_dtsg=%s&__user=%s"; if (this->chat_reconnect_reason_.empty()) this->chat_reconnect_reason_ = "6"; utils::text::replace_first( &action, "%s", this->chat_reconnect_reason_ ); utils::text::replace_first( &action, "%s", this->dtsg_ ); - utils::text::replace_first( &action, "%s", this->post_form_id_ ); utils::text::replace_first( &action, "%s", this->self_.user_id ); return action; } @@ -732,8 +731,7 @@ bool facebook_client::logout( ) handle_entry( "logout" ); - std::string data = "post_form_id=" + (this->post_form_id_.length() ? this->post_form_id_ : "0"); - data += "&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + std::string data = "fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); data += "&ref=mb&h=" + this->logout_hash_; http::response resp = flap( FACEBOOK_REQUEST_LOGOUT, &data ); @@ -817,10 +815,9 @@ bool facebook_client::chat_state( bool online ) { handle_entry( "chat_state" ); - std::string data = "visibility="; - data += ( online ) ? "1" : "0"; - data += "&window_id=0&post_form_id=" + (post_form_id_.length() ? post_form_id_ : "0"); - data += "&post_form_id_source=AsyncRequest&fb_dtsg=" + this->dtsg_; + std::string data = (online ? "visibility=1" : "visibility=0"); + data += "&window_id=0"; + data += "&fb_dtsg=" + this->dtsg_; data += "&lsd=&phstamp=0&__user=" + self_.user_id; http::response resp = flap( FACEBOOK_REQUEST_VISIBILITY, &data ); @@ -866,7 +863,7 @@ bool facebook_client::buddy_list( ) handle_entry( "buddy_list" ); // Prepare update data - std::string data = "user=" + this->self_.user_id + "&fetch_mobile=true&post_form_id=" + this->post_form_id_ + "&fb_dtsg=" + this->dtsg_ + "&lsd=&post_form_id_source=AsyncRequest&__user=" + this->self_.user_id; + std::string data = "user=" + this->self_.user_id + "&fetch_mobile=true&fb_dtsg=" + this->dtsg_ + "&lsd=&__user=" + this->self_.user_id; { ScopedLock s(buddies_lock_); @@ -1106,7 +1103,6 @@ bool facebook_client::send_message( std::string message_recipient, std::string m data += "&recipients[0]=" + message_recipient; data += "&lsd="; data += "&fb_dtsg=" + (dtsg_.length() ? dtsg_ : "0"); - data += "&post_form_id=" + (post_form_id_.length() ? post_form_id_ : "0"); resp = flap( FACEBOOK_REQUEST_ASYNC, &data ); break; @@ -1134,17 +1130,6 @@ bool facebook_client::send_message( std::string message_recipient, std::string m case 1356026: // Contact has alternative client { client_notify(TranslateT("Need confirmation for sending messages to other clients.\nOpen facebook website and try to send message to this contact again!")); - /* - post na url http://www.facebook.com/ajax/chat/post_application_settings.php?__a=1 - - enable_and_send Povolit a odeslat - to_send AQCoweMPeszBoKpd4iahcOyhmh0kiTYIhv1b5wCtuBiD0AaPVZIdEp3Pf5JMBmQ-9wf0ju-xdi-VRuk0ERk_I7XzI5dVJCs6-B0FExTZhspD-4-kTZLmZI-_M6fIuF2328yMyT3R3UEUmMV8P9MHcZwu-_pS3mOhsaHf6rIVcQ2rocSqLKi03wLKCfg0m8VsptPADWpOI-UNcIo-xl1PAoC1yVnL2wEXEtnF1qI_xFcmlJZ40AOONfIF_LS_lBrGYA-oCWLUK-GLHtQAHjO8aDeNXDU8Jk7Z_ES-_oAHee2PVLHcG_ACHXpasE7Iu3XFLMrdN2hjM96AjPRIf0Vk8gBZzfW_lUspakZmXxMI7iSNQE8lourK_6B3Z1s4UHxDZCNXYuc9gh70nm_xnaxnF9K1bR00s4MltnFjUT_3ypThzA - __d 1 - post_form_id c73ebd9d94b7449c40e6965410fcdcf6 - fb_dtsg Tb-T9 - lsd - post_form_id_source AsyncRequest - */ return false; } break; @@ -1181,8 +1166,8 @@ void facebook_client::close_chat( std::string message_recipient ) Sleep(300); std::string data = "close_chat=" + message_recipient; - data += "&window_id=0&post_form_id=" + (post_form_id_.length() ? post_form_id_ : "0"); - data += "&post_form_id_source=AsyncRequest&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + data += "&window_id=0"; + data += "&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); data += "&__user=" + self_.user_id; http::response resp = flap( FACEBOOK_REQUEST_TABS, &data ); @@ -1194,9 +1179,8 @@ void facebook_client::chat_mark_read( std::string message_recipient ) std::string data = "action=chatMarkRead"; data += "&other_user=" + message_recipient; - data += "&post_form_id=" + (post_form_id_.length() ? post_form_id_ : "0"); data += "&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); - data += "&post_form_id_source=AsyncRequest&lsd=&__user=" + self_.user_id; + data += "&lsd=&__user=" + self_.user_id; http::response resp = flap( FACEBOOK_REQUEST_ASYNC, &data ); } @@ -1205,9 +1189,7 @@ bool facebook_client::set_status(const std::string &status_text) { handle_entry( "set_status" ); - std::string data = "post_form_id_source=AsyncRequest"; - data += "&post_form_id=" + (this->post_form_id_.length() ? this->post_form_id_ : "0"); - data += "&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + std::string data = "&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); data += "&target_id=" + this->self_.user_id; if ( status_text.length( )) diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 9e6c6abfa0..5337ce6dbe 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -167,14 +167,10 @@ void FacebookProto::DeleteContactFromServer(void *data) std::string id = (*(std::string*)data); delete data; - std::string query = "norefresh=false&post_form_id_source=AsyncRequest&lsd=&fb_dtsg="; - query += facy.dtsg_; - query += "&post_form_id="; - query += facy.post_form_id_; - query += "&uid="; - query += id; - query += "&__user="; - query += facy.self_.user_id; + std::string query = "norefresh=false&lsd="; + query += "&fb_dtsg=" + facy.dtsg_; + query += "&uid=" + id; + query += "&__user=" + facy.self_.user_id; // Get unread inbox threads http::response resp = facy.flap( FACEBOOK_REQUEST_DELETE_FRIEND, &query ); @@ -217,14 +213,10 @@ void FacebookProto::AddContactToServer(void *data) std::string id = (*(std::string*)data); delete data; - std::string query = "action=add_friend&how_found=profile_button&ref_param=ts&outgoing_id=&unwanted=&logging_location=&no_flyout_on_click=false&ego_log_data=&post_form_id_source=AsyncRequest&lsd=&fb_dtsg="; - query += facy.dtsg_; - query += "&post_form_id="; - query += facy.post_form_id_; - query += "&to_friend="; - query += id; - query += "&__user="; - query += facy.self_.user_id; + std::string query = "action=add_friend&how_found=profile_button&ref_param=ts&outgoing_id=&unwanted=&logging_location=&no_flyout_on_click=false&ego_log_data=&lsd="; + query += "&fb_dtsg=" + facy.dtsg_; + query += "&to_friend=" + id; + query += "&__user=" + facy.self_.user_id; // Get unread inbox threads http::response resp = facy.flap( FACEBOOK_REQUEST_REQUEST_FRIEND, &query ); diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index 596fab0424..9e962cb100 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -154,16 +154,11 @@ void FacebookProto::SendTypingWorker(void *p) DBVARIANT dbv; if ( !DBGetContactSettingString(typing->hContact,m_szModuleName,FACEBOOK_KEY_ID,&dbv)) { - std::string data = "typ="; - data += ( typing->status == PROTOTYPE_SELFTYPING_ON ) ? "1" : "0"; // PROTOTYPE_SELFTYPING_OFF - data += "&to="; - data += dbv.pszVal; - data += "&source=mercury-chat"; + std::string data = "&source=mercury-chat"; + data += (typing->status == PROTOTYPE_SELFTYPING_ON ? "&typ=1" : "&typ=0"); // PROTOTYPE_SELFTYPING_OFF + data += "&to=" + std::string(dbv.pszVal); data += "&fb_dtsg=" + facy.dtsg_; - data += "&post_form_id="; - data += ( facy.post_form_id_.length( )) ? facy.post_form_id_ : "0"; - data += "&post_form_id_source=AsyncRequest&lsd=&phstamp=0&__user="; - data += facy.self_.user_id; + data += "&lsd=&phstamp=0&__user=" + facy.self_.user_id; http::response resp = facy.flap( FACEBOOK_REQUEST_TYPING_SEND, &data ); -- cgit v1.2.3