summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/communication.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-03-27 00:19:03 +0000
committerRobert Pösel <robyer@seznam.cz>2016-03-27 00:19:03 +0000
commit3e19b9ac8c27d804c5103be23bc9c476c2884948 (patch)
tree9cb0273cf8b94144ed49d98e6b140d3141dcf576 /protocols/FacebookRM/src/communication.cpp
parentb40bfa3a816268de244ae2f2e6c0a4a8818e88b8 (diff)
Facebook: Improve login procedure
Tries to automatically delete DeviceID and login again once. Maybe also fixes notification that someone logged in from unknown device. git-svn-id: http://svn.miranda-ng.org/main/trunk@16551 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r--protocols/FacebookRM/src/communication.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index b4abb94c6a..122fd615b0 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -801,6 +801,8 @@ bool facebook_client::login(const char *username, const char *password)
get_data += "&" + utils::text::source_get_value(&form, 2, "login.php?login_attempt=1&amp;", "\"");
}
+ data += "&lgndim=eyJ3IjoxOTIwLCJoIjoxMDgwLCJhdyI6MTgzNCwiYWgiOjEwODAsImMiOjMyfQ=="; // means base64 encoded: {"w":1920,"h":1080,"aw":1834,"ah":1080,"c":32}
+
// Send validation
http::response resp = flap(REQUEST_LOGIN, &data, &get_data);
@@ -889,10 +891,20 @@ bool facebook_client::login(const char *username, const char *password)
resp = flap(REQUEST_SETUP_MACHINE, &inner_data);
}
else if (resp.data.find("name=\"submit[Get Started]\"") != std::string::npos) {
- // Facebook things that computer was infected by malware and needs cleaning
- 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);
+ if (!parent->getBool(FACEBOOK_KEY_TRIED_DELETING_DEVICE_ID)) {
+ // Try to remove DeviceID and login again
+ cookies["datr"] = "";
+ parent->delSetting(FACEBOOK_KEY_DEVICE_ID);
+ parent->setByte(FACEBOOK_KEY_TRIED_DELETING_DEVICE_ID, 1);
+ return login(username, password);
+ } else {
+ // Reset flag
+ parent->delSetting(FACEBOOK_KEY_TRIED_DELETING_DEVICE_ID);
+ // Facebook things that computer was infected by malware and needs cleaning
+ 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);
+ }
}
}
}