From cd5bf3d7a652267afe75f288b664812a32d167dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Fri, 8 Feb 2013 21:45:38 +0000 Subject: Facebook: Sharing status through classic web + added from city "Miranda NG" git-svn-id: http://svn.miranda-ng.org/main/trunk@3497 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/communication.cpp | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index f4e6881e4f..dbc41f1640 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -315,7 +315,6 @@ std::string facebook_client::choose_server( int request_type, std::string* data, case FACEBOOK_REQUEST_APPROVE_FRIEND: case FACEBOOK_REQUEST_LOAD_REQUESTS: case FACEBOOK_REQUEST_SEARCH: - case FACEBOOK_REQUEST_STATUS_SET: return FACEBOOK_SERVER_MOBILE; // case FACEBOOK_REQUEST_LOGOUT: @@ -324,6 +323,7 @@ std::string facebook_client::choose_server( int request_type, std::string* data, // case FACEBOOK_REQUEST_FEEDS: // case FACEBOOK_REQUEST_NOTIFICATIONS: // case FACEBOOK_REQUEST_RECONNECT: +// case FACEBOOK_REQUEST_STATUS_SET: // case FACEBOOK_REQUEST_MESSAGE_SEND: // case FACEBOOK_REQUEST_MESSAGE_SEND2: // case FACEBOOK_REQUEST_THREAD_INFO: @@ -439,7 +439,7 @@ std::string facebook_client::choose_action( int request_type, std::string* data, } case FACEBOOK_REQUEST_STATUS_SET: - return "/a/home.php"; + return "/ajax/updatestatus.php?__a=1"; case FACEBOOK_REQUEST_MESSAGE_SEND: return "/ajax/mercury/send_messages.php?__a=1"; @@ -1187,23 +1187,15 @@ bool facebook_client::set_status(const std::string &status_text) { handle_entry( "set_status" ); - std::string data = "&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); - //data += "&target_id=" + this->self_.user_id; + if (status_text.empty()) + return handle_success( "set_status" ); - if ( status_text.length( )) - { - /* - TODO: privacy options - status=v%C5%A1ichni &update=P%C5%99idat+p%C5%99%C3%ADsp%C4%9Bvek&users_with=&at=&privacy=%7B%22value%22%3A80%2C%22row_updated_time%22%3A1360357575%2C%22_pr_%22%3A1360357575%7D - status=p%C5%99%C3%A1tel%C3%A9&update=P%C5%99idat+p%C5%99%C3%ADsp%C4%9Bvek&users_with=&at=&privacy=%7B%22value%22%3A40%2C%22row_updated_time%22%3A1360357601%2C%22_pr_%22%3A1360357601%7D - status=jen+j%C3%A1+ &update=P%C5%99idat+p%C5%99%C3%ADsp%C4%9Bvek&users_with=&at=&privacy=%7B%22value%22%3A10%2C%22row_updated_time%22%3A1360357610%2C%22_pr_%22%3A1360357610%7D - status=aaa+ro &update=P%C5%99idat+p%C5%99%C3%ADsp%C4%9Bvek&users_with=1438384745&at=&privacy=%7B%22value%22%3A10%2C%22row_updated_time%22%3A1360357631%2C%22_pr_%22%3A1360357631%7D&tagged_friends%5B%5D=1438384745 - */ - - data += "&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&update=&target="; - data += "&status=" + utils::url::encode( status_text ); - //data += "&profile_id=" + this->self_.user_id; - } + // TODO: use also privacy options + std::string data = "&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + data += "&xhpc_targetid=" + this->self_.user_id; + data += "&__user=" + this->self_.user_id; + data += "nctr[_mod]=pagelet_composer&__a=1&__req=b&phstamp=&composertags_place_name=Miranda+NG"; + data += "&xhpc_message=" + utils::url::encode(status_text); http::response resp = flap( FACEBOOK_REQUEST_STATUS_SET, &data ); -- cgit v1.2.3