summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/FacebookRM/src/communication.cpp20
-rw-r--r--protocols/FacebookRM/src/contacts.cpp6
-rw-r--r--protocols/FacebookRM/src/messages.cpp6
-rw-r--r--protocols/FacebookRM/src/process.cpp6
-rw-r--r--protocols/FacebookRM/src/proto.cpp2
5 files changed, 20 insertions, 20 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 932fbbcdec..bb64c65634 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -939,7 +939,7 @@ bool facebook_client::logout()
{
handle_entry("logout");
- std::string data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0");
+ std::string data = "fb_dtsg=" + this->dtsg_;
data += "&ref=mb&h=" + this->logout_hash_;
http::response resp = flap(REQUEST_LOGOUT, &data);
@@ -1039,7 +1039,7 @@ bool facebook_client::chat_state(bool online)
std::string data = (online ? "visibility=1" : "visibility=0");
data += "&window_id=0";
- data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0");
+ data += "&fb_dtsg=" + dtsg_;
data += "&__user=" + self_.user_id;
http::response resp = flap(REQUEST_VISIBILITY, &data);
@@ -1192,7 +1192,7 @@ int facebook_client::send_message(MCONTACT hContact, std::string message_recipie
data += "&recipients[0]=" + message_recipient;
data += "&__user=" + this->self_.user_id;
data += "&__a=1";
- data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0");
+ data += "&fb_dtsg=" + this->dtsg_;
data += "&phstamp=0";
resp = flap(REQUEST_MESSAGE_SEND_INBOX, &data);
@@ -1224,7 +1224,7 @@ int facebook_client::send_message(MCONTACT hContact, std::string message_recipie
data += "&message_batch[0][message_id]";
data += "&message_batch[0][client_thread_id]=user:" + message_recipient;
data += "&client=mercury";
- data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0");
+ data += "&fb_dtsg=" + this->dtsg_;
data += "&__user=" + this->self_.user_id;
data += "&__a=1";
data += "&phstamp=0";
@@ -1249,7 +1249,7 @@ int facebook_client::send_message(MCONTACT hContact, std::string message_recipie
data += "&message_batch[0][has_attachment]=false";
data += "&message_batch[0][is_html]=false";
data += "&message_batch[0][message_id]=";
- data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0");
+ data += "&fb_dtsg=" + this->dtsg_;
data += "&__user=" + this->self_.user_id;
data += "&phstamp=0";
@@ -1263,7 +1263,7 @@ int facebook_client::send_message(MCONTACT hContact, std::string message_recipie
data += "&body=" + utils::url::encode(message_text);
data += "&recipients[0]=" + message_recipient;
data += "&lsd=";
- data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0");
+ data += "&fb_dtsg=" + this->dtsg_;
resp = flap(REQUEST_ASYNC, &data);
break;
@@ -1346,7 +1346,7 @@ bool facebook_client::post_status(status_data *status)
handle_entry("post_status");
if (status->isPage) {
- std::string data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0");
+ std::string data = "fb_dtsg=" + this->dtsg_;
data += "&user_id=" + status->user_id;
data += "&url=" + std::string(FACEBOOK_URL_HOMEPAGE);
flap(REQUEST_IDENTITY_SWITCH, &data);
@@ -1354,7 +1354,7 @@ bool facebook_client::post_status(status_data *status)
std::string data;
if (!status->url.empty()) {
- data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0");
+ data = "fb_dtsg=" + this->dtsg_;
data += "&targetid=" + (status->user_id.empty() ? this->self_.user_id : status->user_id);
data += "&xhpc_targetid=" + (status->user_id.empty() ? this->self_.user_id : status->user_id);
data += "&istimeline=1&composercontext=composer&onecolumn=1&nctr[_mod]=pagelet_timeline_recent&__a=1&ttstamp=0";
@@ -1372,7 +1372,7 @@ bool facebook_client::post_status(status_data *status)
std::string text = utils::url::encode(status->text);
- data += "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0");
+ data += "fb_dtsg=" + this->dtsg_;
data += "&xhpc_targetid=" + (status->user_id.empty() ? this->self_.user_id : status->user_id);
data += "&__user=" + (status->isPage && !status->user_id.empty() ? status->user_id : this->self_.user_id);
data += "&xhpc_message=" + text;
@@ -1397,7 +1397,7 @@ bool facebook_client::post_status(status_data *status)
http::response resp = flap(REQUEST_POST_STATUS, &data);
if (status->isPage) {
- std::string data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0");
+ std::string data = "fb_dtsg=" + this->dtsg_;
data += "&user_id=" + this->self_.user_id;
data += "&url=" + std::string(FACEBOOK_URL_HOMEPAGE);
flap(REQUEST_IDENTITY_SWITCH, &data);
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 7905007485..02c059fc88 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -126,7 +126,7 @@ std::string FacebookProto::ThreadIDToContactID(std::string thread_id)
std::string data = "client=mercury";
data += "&__user=" + facy.self_.user_id;
- data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&__a=1&__dyn=&__req=&ttstamp=0";
data += "&threads[thread_ids][0]=" + utils::url::encode(thread_id);
@@ -214,7 +214,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
std::string data = "client=mercury";
data += "&__user=" + facy.self_.user_id;
- data += "&fb_dtsg=" + (!facy.dtsg_.empty() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&__a=1&__dyn=&__req=&ttstamp=0";
std::string thread_id = utils::url::encode(std::string(_T2A(fbc->thread_id.c_str())));
@@ -574,7 +574,7 @@ void FacebookProto::SendPokeWorker(void *p)
std::string data = "poke_target=" + id;
data += "&do_confirm=0&phstamp=0";
- data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&__user=" + facy.self_.user_id;
// Send poke
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp
index 59d75ec6f1..72e4e3487c 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -86,7 +86,7 @@ void FacebookProto::SendChatMsgWorker(void *p)
tid = tid_;
} else {
std::string post_data = "threads[group_ids][0]=" + utils::url::encode(data->chat_id);
- post_data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0");
+ post_data += "&fb_dtsg=" + facy.dtsg_;
post_data += "&__user=" + facy.self_.user_id;
post_data += "&phstamp=0";
@@ -160,7 +160,7 @@ void FacebookProto::SendTypingWorker(void *p)
data += "&thread=";
data += utils::url::encode(std::string(id));
- data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&lsd=&phstamp=0&__user=" + facy.self_.user_id;
http::response resp = facy.flap(REQUEST_TYPING_SEND, &data);
@@ -185,7 +185,7 @@ void FacebookProto::ReadMessageWorker(void *p)
return;
std::string data = "ids[" + utils::url::encode(std::string(tid)) + "]=true";
- data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&__user=" + facy.self_.user_id;
data += "&__a=1&__dyn=&__req=&ttstamp=0";
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 137483d9f6..b10b9165b7 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -296,7 +296,7 @@ void FacebookProto::ProcessUnreadMessages(void*)
data += "&folders[1]=other";
data += "&client=mercury";
data += "__user=" + facy.self_.user_id;
- data += "&fb_dtsg=" + (!facy.dtsg_.empty() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&__a=1&__dyn=&__req=&ttstamp=0";
http::response resp = facy.flap(REQUEST_UNREAD_THREADS, &data);
@@ -355,7 +355,7 @@ void FacebookProto::ProcessUnreadMessage(void *p)
while (!threads.empty()) {
std::string data = "client=mercury";
data += "&__user=" + facy.self_.user_id;
- data += "&fb_dtsg=" + (!facy.dtsg_.empty() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&__a=1&__dyn=&__req=&ttstamp=0";
for (std::vector<std::string>::size_type i = 0; i < threads.size(); i++) {
@@ -456,7 +456,7 @@ void FacebookProto::LoadLastMessages(void *p)
std::string data = "client=mercury";
data += "&__user=" + facy.self_.user_id;
- data += "&fb_dtsg=" + (!facy.dtsg_.empty() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&__a=1&__dyn=&__req=&ttstamp=0";
bool isChat = isChatRoom(hContact);
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 18fb6fc93a..3b3f82f972 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -835,7 +835,7 @@ void FacebookProto::ReadNotificationWorker(void *p)
std::string *id = static_cast<std::string*>(p);
std::string data = "seen=0&asyncSignal=&__dyn=&__req=a&alert_ids%5B0%5D=" + utils::url::encode(*id);
- data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0");
+ data += "&fb_dtsg=" + facy.dtsg_;
data += "&__user=" + facy.self_.user_id;
facy.flap(REQUEST_NOTIFICATIONS_READ, NULL, &data);