diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-09-29 14:16:53 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-09-29 14:16:53 +0000 |
commit | b728069180bcea77894d344753a7fdfc4f30a061 (patch) | |
tree | 7f9b37762348d62adb3ddb223a526b16003138cf /protocols/FacebookRM/src/communication.cpp | |
parent | 4a80fff5bf8d7868735fc3df97fa0d2bdbc59262 (diff) |
Facebook: login fixes and cleanup
- fixed login for password with not-ASCII chars
- fixed login when disabled https in miranda but enabled on facebook
git-svn-id: http://svn.miranda-ng.org/main/trunk@6269 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/communication.cpp')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index e48bfd676c..6cd98e11e7 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -675,15 +675,22 @@ void loginError(FacebookProto *proto, std::string error_str) { proto->facy.client_notify(buf);
}
-bool facebook_client::login(const std::string &username,const std::string &password)
+bool facebook_client::login(const char *username, const char *password)
{
handle_entry("login");
username_ = username;
password_ = password;
-
- // Get initial cookies
- flap(REQUEST_LOGIN);
+
+ if (cookies.empty()) {
+ // Set device ID
+ ptrA device( parent->getStringA(FACEBOOK_KEY_DEVICE_ID));
+ if (device != NULL)
+ cookies["datr"] = device;
+
+ // Get initial cookies
+ flap(REQUEST_HOME);
+ }
// Prepare login data
std::string data = "charset_test=%e2%82%ac%2c%c2%b4%2c%e2%82%ac%2c%c2%b4%2c%e6%b0%b4%2c%d0%94%2c%d0%84&pass_placeHolder=Password&login=Login&persistent=1";
@@ -718,7 +725,6 @@ bool facebook_client::login(const std::string &username,const std::string &passw client_notify(TranslateT("Your account requires HTTPS connection. Activating."));
parent->setByte(FACEBOOK_KEY_FORCE_HTTPS, 1);
this->https_ = true;
- return login(username, password);
}
// Check whether some Facebook things are required
|