diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-06-08 12:03:44 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-06-08 12:03:44 +0000 |
commit | 9c4ba307862a3408c67a55bd0c003b6f0f2bdc7d (patch) | |
tree | 3bb2fa32d6c6529b6b5f597d80a1e03a46ff3a8d /protocols/SkypeWeb/src/skype_login.cpp | |
parent | 57c27326f7ba7b6ae6a29665dcc6554a98971f3d (diff) |
SkypeWeb: Memleaks fix (detected by coverity).
git-svn-id: http://svn.miranda-ng.org/main/trunk@14066 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_login.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 063360f894..97d0eedce3 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -57,6 +57,7 @@ void CSkypeProto::OnLoginOAuth(const NETLIBHTTPREQUEST *response) if (response->resultCode != 200)
{
+ int error = 0;
if (!json["status"].isnull())
{
const JSONNode &status = json["status"];
@@ -64,25 +65,34 @@ void CSkypeProto::OnLoginOAuth(const NETLIBHTTPREQUEST *response) {
switch(status["code"].as_int())
{
+ case 40002:
+ {
+ ShowNotification(_T("Skype"), TranslateT("Authentication failed. Invalid username."), NULL, 1);
+ error = LOGINERR_BADUSERID;
+ break;
+ }
case 40120:
{
ShowNotification(_T("Skype"), TranslateT("Authentication failed. Bad username or password."), NULL, 1);
+ error = LOGINERR_WRONGPASSWORD;
break;
}
case 40121:
{
ShowNotification(_T("Skype"), TranslateT("Too many failed authentication attempts with given username or IP."), NULL, 1);
+ error = LOGIN_ERROR_TOOMANY_REQUESTS;
break;
}
default:
{
ShowNotification(_T("Skype"), !status["text"].isnull() ? status["text"].as_mstring().GetBuffer() : TranslateT("Authentication failed. Unknown error."), NULL, 1);
+ error = LOGIN_ERROR_UNKNOWN;
}
}
}
}
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, error);
SetStatus(ID_STATUS_OFFLINE);
return;
}
|