summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/communication.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-07-31 08:59:00 +0000
committerRobert Pösel <robyer@seznam.cz>2013-07-31 08:59:00 +0000
commit3de73f4e34db0c8119f9424558ba724a2b793506 (patch)
treed6f957b385cb66271b9e94e5dc40e3beb97a1094 /protocols/FacebookRM/src/communication.cpp
parentad9fda4db13269823d9ef3333f6c8e03898610f7 (diff)
Facebook: Many fixes for "Post status" window and function
git-svn-id: http://svn.miranda-ng.org/main/trunk@5534 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r--protocols/FacebookRM/src/communication.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index ae677ed30e..0e040c31d7 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -1294,10 +1294,10 @@ bool facebook_client::send_message(std::string message_recipient, std::string me
bool facebook_client::post_status(status_data *status)
{
- handle_entry("post_status");
+ if (status == NULL || (status->text.empty() && status->url.empty()))
+ return false;
- if (status == NULL || status->text.empty())
- return handle_success("post_status");
+ handle_entry("post_status");
if (status->isPage) {
std::string data = "fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0");
@@ -1341,6 +1341,14 @@ bool facebook_client::post_status(status_data *status)
data += "&composertags_place_name=";
data += utils::url::encode(status->place);
}
+ for(std::vector<facebook_user*>::size_type i = 0; i < status->users.size(); i++) {
+ data += "&composertags_with[" + utils::conversion::to_string(&i, UTILS_CONV_UNSIGNED_NUMBER);
+ data += "]=" + status->users[i]->user_id;
+ data += "&text_composertags_with[" + utils::conversion::to_string(&i, UTILS_CONV_UNSIGNED_NUMBER);
+ data += "]=" + status->users[i]->real_name;
+ delete status->users[i];
+ }
+ status->users.clear();
data += "&xhpc_context=profile&xhpc_ismeta=1&xhpc_timeline=1&xhpc_composerid=u_0_2y&is_explicit_place=&composertags_place=&composertags_city=";
@@ -1354,14 +1362,15 @@ bool facebook_client::post_status(status_data *status)
}
validate_response(&resp);
- if (resp.error_number != 0 && !resp.error_text.empty())
- client_notify(ptrT(mir_utf8decodeT(resp.error_text.c_str())));
switch (resp.code)
{
case HTTP_CODE_OK:
- return handle_success("post_status");
-
+ if (resp.error_number != 0 && !resp.error_text.empty())
+ client_notify(ptrT(mir_utf8decodeT(resp.error_text.c_str())));
+ else
+ parent->NotifyEvent(parent->m_tszUserName, TranslateT("Status update was successful."), NULL, FACEBOOK_EVENT_OTHER);
+ return handle_success("post_status");
case HTTP_CODE_FAKE_ERROR:
case HTTP_CODE_FAKE_DISCONNECTED:
default: