summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-04-19 17:31:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-04-19 17:31:27 +0300
commitd38e9be8124b1f87748ca7925b7e2e969ade40e6 (patch)
treeba33057d6fdb4e30ea977cf6cf96119e2152504e
parentbddfbe34b81f5c1f1501f9be02aba36eb1c65d17 (diff)
code cleaning
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp
index 012507684e..61420cc4ce 100644
--- a/protocols/SkypeWeb/src/skype_login.cpp
+++ b/protocols/SkypeWeb/src/skype_login.cpp
@@ -133,25 +133,25 @@ void CSkypeProto::OnEndpointCreated(const NETLIBHTTPREQUEST *response)
switch (response->resultCode) {
case 200:
case 201: // ok, endpoint created
- case 301: // redirect
+ case 301:
+ case 302: // redirect
break;
- default:
- if (response->resultCode == 401) {
- if (auto *szStatus = Netlib_GetHeader(response, "StatusText"))
- if (!strstr(szStatus, "SkypeTokenExpired"))
- delSetting("TokenSecret");
- delSetting("TokenExpiresIn");
- SendRequest(new LoginOAuthRequest(m_szSkypename, pass_ptrA(getStringA(SKYPE_SETTINGS_PASSWORD))), &CSkypeProto::OnLoginOAuth);
- return;
- }
- if (response->resultCode == 400) {
- delSetting("TokenExpiresIn");
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
- SetStatus(ID_STATUS_OFFLINE);
- return;
- }
- // it should be rewritten
+ case 401: // unauthorized
+ if (auto *szStatus = Netlib_GetHeader(response, "StatusText"))
+ if (!strstr(szStatus, "SkypeTokenExpired"))
+ delSetting("TokenSecret");
+ delSetting("TokenExpiresIn");
+ SendRequest(new LoginOAuthRequest(m_szSkypename, pass_ptrA(getStringA(SKYPE_SETTINGS_PASSWORD))), &CSkypeProto::OnLoginOAuth);
+ return;
+
+ case 400:
+ delSetting("TokenExpiresIn");
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
+ SetStatus(ID_STATUS_OFFLINE);
+ return;
+
+ default: // it should be rewritten
SendRequest(new CreateEndpointRequest(this), &CSkypeProto::OnEndpointCreated);
return;
}