summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-08-07 02:02:10 +0000
committerRobert Pösel <robyer@seznam.cz>2014-08-07 02:02:10 +0000
commit85f8b97d732b1408ddce9d115a9b8796a6b9537c (patch)
treeb213ee24259e514ced70d42e5d99cc8ccddd4f88 /protocols
parent28837ed04f46a04b09b035ff97e28e53af171530 (diff)
Facebook: Try to get some error message on unsucessful login
git-svn-id: http://svn.miranda-ng.org/main/trunk@10106 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/communication.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 6153fbc77b..89805f56b0 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -849,15 +849,18 @@ bool facebook_client::login(const char *username, const char *password)
case HTTP_CODE_OK: // OK page returned, but that is regular login page we don't want in fact
{
// Check whether captcha code is required
- if (resp.data.find("id=\"captcha\"") != std::string::npos)
- {
+ if (resp.data.find("id=\"captcha\"") != std::string::npos) {
client_notify(TranslateT("Login error: Captcha code is required. Bad login credentials?"));
parent->debugLogA(" ! ! Login error: Captcha code is required.");
return handle_error("login", FORCE_QUIT);
}
// Get and notify error message
- loginError(parent, utils::text::source_get_value(&resp.data, 4, "login_error_box", "<div", ">", "</div>"));
+ 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=\"", "\"");
+
+ loginError(parent, error);
}
case HTTP_CODE_FORBIDDEN: // Forbidden
case HTTP_CODE_NOT_FOUND: // Not Found