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/connection.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/connection.cpp')
-rw-r--r-- | protocols/FacebookRM/src/connection.cpp | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp index 38e00a4fc2..9c2f866f4c 100644 --- a/protocols/FacebookRM/src/connection.cpp +++ b/protocols/FacebookRM/src/connection.cpp @@ -139,44 +139,22 @@ bool FacebookProto::NegotiateConnection() {
LOG("***** Negotiating connection with Facebook");
- bool error;
- std::string user, pass;
DBVARIANT dbv = {0};
- error = true;
- if (!getString(FACEBOOK_KEY_LOGIN, &dbv))
- {
- user = dbv.pszVal;
- db_free(&dbv);
- error = user.empty();
- }
- if (error)
- {
+ ptrA username( getStringA(FACEBOOK_KEY_LOGIN));
+ if (!username || !strlen(username)) {
NotifyEvent(m_tszUserName,TranslateT("Please enter a username."),NULL,FACEBOOK_EVENT_CLIENT);
return false;
}
- error = true;
- if (!getString(FACEBOOK_KEY_PASS, &dbv))
- {
- CallService(MS_DB_CRYPT_DECODESTRING,strlen(dbv.pszVal)+1,
- reinterpret_cast<LPARAM>(dbv.pszVal));
- pass = dbv.pszVal;
- db_free(&dbv);
- error = pass.empty();
- }
- if (error)
- {
+ ptrA password( getStringA(FACEBOOK_KEY_PASS));
+ if (!password || !strlen(password)) {
NotifyEvent(m_tszUserName,TranslateT("Please enter a password."),NULL,FACEBOOK_EVENT_CLIENT);
return false;
}
- // Load machine name
- if (!getString(FACEBOOK_KEY_DEVICE_ID, &dbv))
- {
- facy.cookies["datr"] = dbv.pszVal;
- db_free(&dbv);
- }
+ CallService(MS_DB_CRYPT_DECODESTRING, strlen(password) + 1, password);
+ password = mir_utf8encode(password);
// Refresh last time of feeds update
facy.last_feeds_update_ = ::time(NULL);
@@ -189,7 +167,7 @@ bool FacebookProto::NegotiateConnection() if (groupName != NULL)
Clist_CreateGroup(0, groupName);
- return facy.login(user, pass);
+ return facy.login(username, password);
}
void FacebookProto::UpdateLoop(void *)
|