diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-05-21 23:55:12 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-05-21 23:55:12 +0000 |
commit | 5b45218994ffaafc8f0a787eaa425029c37183c3 (patch) | |
tree | 99e65254d67db81f5590e6dff04a7363bcc548e9 /protocols/FacebookRM/src/communication.cpp | |
parent | b8d8fdaf9111b962a11a02ce21647f5fb5495b26 (diff) |
Facebook: Mind dialog improvements: added toolbar button, privacy and place settings. Version bump.
git-svn-id: http://svn.miranda-ng.org/main/trunk@4786 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index c92a1c7b5b..5cfd9fab99 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -567,6 +567,15 @@ std::string facebook_client::get_server_type() return server_types[server_type].id;
}
+std::string facebook_client::get_privacy_type()
+{
+ BYTE privacy_type = db_get_b(NULL, parent->m_szModuleName, FACEBOOK_KEY_PRIVACY_TYPE, 0);
+ if (privacy_type < 0 || privacy_type >= SIZEOF(privacy_types))
+ privacy_type = 0;
+ return privacy_types[privacy_type].id;
+}
+
+
char* facebook_client::load_cookies()
{
ScopedLock s(cookies_lock_);
@@ -1200,12 +1209,18 @@ bool facebook_client::set_status(const std::string &status_text) if (status_text.empty())
return handle_success("set_status");
- // TODO: use also privacy options
- std::string data = "&fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0");
+ std::string text = utils::url::encode(status_text);
+ ptrA place = db_get_sa(NULL, parent->m_szModuleName, FACEBOOK_KEY_PLACE);
+
+ std::string data = "fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0");
+ data += "&xhpc_context=home&xhpc_ismeta=1&xhpc_timeline=&xhpc_composerid=u_jsonp_2_0&is_explicit_place=&composertags_place=&composer_session_id=0&composertags_city=&disable_location_sharing=false&composer_predicted_city=&nctr[_mod]=pagelet_composer&__a=1&__dyn=&__req=1f&phstamp=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);
+ data += "&xhpc_message=" + text;
+ data += "&xhpc_message_text=" + text;
+ data += "&audience[0][value]=" + get_privacy_type();
+ data += "&composertags_place_name=";
+ data += ptrA(mir_urlEncode(place));
http::response resp = flap(FACEBOOK_REQUEST_STATUS_SET, &data);
|