diff options
author | Robert Pösel <robyer@seznam.cz> | 2016-03-13 19:56:01 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2016-03-13 19:56:01 +0000 |
commit | 3680d4e2acd1777bb7c7f103ae8fdf7c8c2c3e6a (patch) | |
tree | 56c6e23b078d747887db32331d870e039f1f4c87 /protocols/FacebookRM/src | |
parent | 9533501dd610e5b1df0d720c904b4e76b6724c5a (diff) |
Facebook: Fix getting correct login error message
Also use special message for "Your computer needs to be cleaned" error.
git-svn-id: http://svn.miranda-ng.org/main/trunk@16476 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 892840f966..391c7249f3 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -860,6 +860,7 @@ bool facebook_client::login(const char *username, const char *password) // 2) Approve last unknown login // inner_data = "submit[I%20don't%20recognize]=I%20don't%20recognize"; // Don't recognize - this will force to change account password inner_data = "submit[This%20is%20Okay]=This%20is%20Okay"; // Recognize + inner_data += "&submit[This is Okay]=This is Okay"; // I don't know whether it's with classic spaces now or not 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); @@ -887,9 +888,11 @@ bool facebook_client::login(const char *username, const char *password) 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); } - else if (resp.data.find("name=\"submit[Get%20Started]\"") != std::string::npos) { + else if (resp.data.find("name=\"submit[Get Started]\"") != std::string::npos) { // Facebook things that computer was infected by malware and needs cleaning - parent->debugLogA("!!! Facebook requires computer scan."); + client_notify(TranslateT("Login error: Facebook thinks your computer is infected. Solve it by logging in via 'private browsing' mode of your web browser and run their antivirus check.")); + parent->debugLogA("!!! Login error: Facebook requires computer scan."); + return handle_error("login", FORCE_QUIT); } } } @@ -916,6 +919,10 @@ bool facebook_client::login(const char *username, const char *password) // Get and notify error message std::string error = utils::text::slashu_to_utf8(utils::text::source_get_value(&resp.data, 3, "[\"LoginFormError\"", "\"__html\":\"", "\"}")); + if (error.empty()) + error = utils::text::slashu_to_utf8(utils::text::source_get_value(&resp.data, 3, "id=\"globalContainer\"", ">", "</div")); + if (error.empty()) + error = utils::text::slashu_to_utf8(utils::text::source_get_value(&resp.data, 2, "<strong>", "</strong")); loginError(parent, error); } case HTTP_CODE_FORBIDDEN: // Forbidden |