summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-08-23 15:38:37 +0000
committerRobert Pösel <robyer@seznam.cz>2015-08-23 15:38:37 +0000
commit8c0cac9d9b9079e5a9d146634a2013ec543e6f7e (patch)
tree3d247cf710e3b5acbe2c1efb71b73def8e321a7d /protocols
parent9dff6b9a911c6a6b9c2471e49004c9608cddcc77 (diff)
Facebook: Fix getting login error message
git-svn-id: http://svn.miranda-ng.org/main/trunk@15021 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/communication.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 3b6407d3d2..2630f567c9 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -741,8 +741,6 @@ bool facebook_client::login(const char *username, const char *password)
if (!cookies["datr"].empty())
parent->setString(FACEBOOK_KEY_DEVICE_ID, cookies["datr"].c_str());
- bool scanComputerRequest = false;
-
if (resp.code == HTTP_CODE_FOUND && resp.headers.find("Location") != resp.headers.end())
{
std::string location = resp.headers["Location"];
@@ -825,28 +823,6 @@ bool facebook_client::login(const char *username, const char *password)
else if (resp.data.find("name=\"submit[Get%20Started]\"") != std::string::npos) {
// Facebook things that computer was infected by malware and needs cleaning
parent->debugLogA("!!! Facebook requires computer scan.");
- scanComputerRequest = true;
-
- // Step 1: Get started
- inner_data = "submit[Get%20Started]=Get%20Started";
- inner_data += "&nh=" + utils::text::source_get_value(&resp.data, 3, "name=\"nh\"", "value=\"", "\"");
- inner_data += "&fb_dtsg=" + utils::url::encode(utils::text::source_get_value(&resp.data, 3, "name=\"fb_dtsg\"", "value=\"", "\""));
-
- resp = flap(REQUEST_SETUP_MACHINE, &inner_data);
-
- // Step 2: Download F-Secure Online Scanner (we're not really downloading anything)
- inner_data = "submit[Download]=Download";
- inner_data += "&nh=" + utils::text::source_get_value(&resp.data, 3, "name=\"nh\"", "value=\"", "\"");
- inner_data += "&fb_dtsg=" + utils::url::encode(utils::text::source_get_value(&resp.data, 3, "name=\"fb_dtsg\"", "value=\"", "\""));
-
- resp = flap(REQUEST_SETUP_MACHINE, &inner_data);
-
- // Step 3: Skip scanning and try to do Complete login
- inner_data = "submit[Complete%20Login]=Complete%20Login";
- inner_data += "&nh=" + utils::text::source_get_value(&resp.data, 3, "name=\"nh\"", "value=\"", "\"");
- inner_data += "&fb_dtsg=" + utils::url::encode(utils::text::source_get_value(&resp.data, 3, "name=\"fb_dtsg\"", "value=\"", "\""));
-
- resp = flap(REQUEST_SETUP_MACHINE, &inner_data);
}
}
}
@@ -871,15 +847,10 @@ bool facebook_client::login(const char *username, const char *password)
return handle_error("login", FORCE_QUIT);
}
- if (scanComputerRequest) {
- // FIXME: remove this message when someone confirm that it works...
- client_notify(TranslateT("Facebook required computer cleaning and plugin correctly skipped it. Please report this to the plugin developer!"));
- }
-
// Get and notify error message
std::string error = utils::text::source_get_value(&resp.data, 4, "login_error_box", "<div", ">", "</div>");
if (error.empty())
- error = utils::text::source_get_value(&resp.data, 3, "<form", "title=\"", "\"");
+ error = utils::text::source_get_value(&resp.data, 4, "<form", "<strong", ">", "</strong>");
loginError(parent, error);
}