diff options
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 4cbe5efc89..238da89732 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -705,11 +705,11 @@ void loginError(FacebookProto *proto, std::string error_str) { utils::text::remove_html( utils::text::edit_html(error_str)))); - proto->debugLogA(" ! ! Login error: %s", error_str.length() ? error_str.c_str() : "Unknown error"); + proto->debugLogA(" ! ! Login error: %s", !error_str.empty() ? error_str.c_str() : "Unknown error"); TCHAR buf[200]; mir_sntprintf(buf, SIZEOF(buf), TranslateT("Login error: %s"), - (!error_str.length()) ? TranslateT("Unknown error") : ptrT(mir_utf8decodeT(error_str.c_str()))); + (error_str.empty()) ? TranslateT("Unknown error") : ptrT(mir_utf8decodeT(error_str.c_str()))); proto->facy.client_notify(buf); } @@ -743,7 +743,7 @@ bool facebook_client::login(const char *username, const char *password) http::response resp = flap(REQUEST_LOGIN, &data); // Save Device ID - if (cookies["datr"].length()) + if (!cookies["datr"].empty()) parent->setString(FACEBOOK_KEY_DEVICE_ID, cookies["datr"].c_str()); if (resp.code == HTTP_CODE_FOUND && resp.headers.find("Location") != resp.headers.end()) @@ -871,7 +871,7 @@ bool facebook_client::logout() handle_entry("logout"); - std::string data = "fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + std::string data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0"); data += "&ref=mb&h=" + this->logout_hash_; http::response resp = flap(REQUEST_LOGOUT, &data); @@ -973,7 +973,7 @@ bool facebook_client::chat_state(bool online) std::string data = (online ? "visibility=1" : "visibility=0"); data += "&window_id=0"; - data += "&fb_dtsg=" + (dtsg_.length() ? dtsg_ : "0"); + data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0"); data += "&phstamp=0&__user=" + self_.user_id; http::response resp = flap(REQUEST_VISIBILITY, &data); @@ -1096,7 +1096,7 @@ bool facebook_client::send_message(MCONTACT hContact, std::string message_recipi data += "&recipients[0]=" + message_recipient; data += "&__user=" + this->self_.user_id; data += "&__a=1"; - data += "&fb_dtsg=" + (dtsg_.length() ? dtsg_ : "0"); + data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0"); data += "&phstamp=0"; resp = flap(REQUEST_MESSAGE_SEND2, &data); @@ -1128,7 +1128,7 @@ bool facebook_client::send_message(MCONTACT hContact, std::string message_recipi data += "&message_batch[0][message_id]"; data += "&message_batch[0][client_thread_id]=user:" + message_recipient; data += "&client=mercury"; - data += "&fb_dtsg=" + (dtsg_.length() ? dtsg_ : "0"); + data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0"); data += "&__user=" + this->self_.user_id; data += "&__a=1"; data += "&phstamp=0"; @@ -1153,7 +1153,7 @@ bool facebook_client::send_message(MCONTACT hContact, std::string message_recipi data += "&message_batch[0][has_attachment]=false"; data += "&message_batch[0][is_html]=false"; data += "&message_batch[0][message_id]="; - data += "&fb_dtsg=" + (dtsg_.length() ? dtsg_ : "0"); + data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0"); data += "&__user=" + this->self_.user_id; data += "&phstamp=0"; @@ -1167,7 +1167,7 @@ bool facebook_client::send_message(MCONTACT hContact, std::string message_recipi data += "&body=" + utils::url::encode(message_text); data += "&recipients[0]=" + message_recipient; data += "&lsd="; - data += "&fb_dtsg=" + (dtsg_.length() ? dtsg_ : "0"); + data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0"); resp = flap(REQUEST_ASYNC, &data); break; @@ -1230,7 +1230,7 @@ bool facebook_client::post_status(status_data *status) handle_entry("post_status"); if (status->isPage) { - std::string data = "fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + std::string data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0"); data += "&user_id=" + status->user_id; data += "&url=" + std::string(FACEBOOK_URL_HOMEPAGE); flap(REQUEST_IDENTITY_SWITCH, &data); @@ -1240,7 +1240,7 @@ bool facebook_client::post_status(status_data *status) RequestType request = REQUEST_POST_STATUS; if (!status->url.empty()) { - data = "fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0"); data += "&composerid=u_jsonp_2_b"; data += "&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"; @@ -1260,7 +1260,7 @@ bool facebook_client::post_status(status_data *status) std::string text = utils::url::encode(status->text); - data += "fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + data += "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0"); 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; @@ -1285,7 +1285,7 @@ bool facebook_client::post_status(status_data *status) http::response resp = flap(request, &data); if (status->isPage) { - std::string data = "fb_dtsg=" + (this->dtsg_.length() ? this->dtsg_ : "0"); + std::string data = "fb_dtsg=" + (!this->dtsg_.empty() ? this->dtsg_ : "0"); data += "&user_id=" + this->self_.user_id; data += "&url=" + std::string(FACEBOOK_URL_HOMEPAGE); flap(REQUEST_IDENTITY_SWITCH, &data); |