diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-28 15:11:55 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-28 15:11:55 +0000 |
commit | 7e5605856d1bfabc931537e186620a9a29d0446a (patch) | |
tree | 3cc8387c2cff427fb8880d579d7e383ba5f96dcc /protocols/SkypeWeb | |
parent | 6bd7ca89447e90524cbd9c5c18d0f7c5e39101d6 (diff) |
SkypeWeb: More fixes.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13229 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 3 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 19 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 2 |
3 files changed, 16 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index c84357c850..8d0c4c4366 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -118,7 +118,7 @@ void CSkypeProto::LoadContactsAuth(const NETLIBHTTPREQUEST *response) JSONNODE *node = json_get(root, "greeting");
CMStringA reason = ptrA(mir_t2a(ptrT(json_as_string(node))));
- if (reason != "null")
+ if (reason == "null")
reason.Empty();
MCONTACT hContact = AddContact(skypename);
@@ -179,7 +179,6 @@ void CSkypeProto::LoadContactsInfo(const NETLIBHTTPREQUEST *response) UpdateProfileCountry(item, hContact);
UpdateProfileCity(item, hContact);
UpdateProfileStatusMessage(item, hContact);
- //richMood
UpdateProfileAvatar(item, hContact);
}
}
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 4c91ce49e2..ea77a60369 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -52,7 +52,7 @@ void CSkypeProto::OnLoginFirst(const NETLIBHTTPREQUEST *response) ptrA skypename(getStringA(SKYPE_SETTINGS_ID));
ptrA password(getStringA(SKYPE_SETTINGS_PASSWORD));
- PushRequest(new LoginRequest(skypename, password, pie.c_str(), etm.c_str()), &CSkypeProto::OnLoginSecond);
+ SendRequest(new LoginRequest(skypename, password, pie.c_str(), etm.c_str()), &CSkypeProto::OnLoginSecond);
}
void CSkypeProto::OnLoginSecond(const NETLIBHTTPREQUEST *response)
@@ -107,8 +107,8 @@ void CSkypeProto::OnLoginSuccess() {
SelfSkypeName = getStringA(SKYPE_SETTINGS_ID);
TokenSecret = getStringA("TokenSecret");
- Server = getStringA("registrationToken");
- SendRequest(new CreateEndpointRequest(TokenSecret), &CSkypeProto::OnEndpointCreated);
+ Server = getStringA("Server");
+ SendRequest(new CreateEndpointRequest(TokenSecret, Server), &CSkypeProto::OnEndpointCreated);
PushRequest(new GetProfileRequest(TokenSecret), &CSkypeProto::LoadProfile);
PushRequest(new GetAvatarRequest(ptrA(getStringA("AvatarUrl"))), &CSkypeProto::OnReceiveAvatar, NULL);
PushRequest(new GetContactListRequest(TokenSecret), &CSkypeProto::LoadContactList);
@@ -162,8 +162,17 @@ void CSkypeProto::OnEndpointCreated(const NETLIBHTTPREQUEST *response) if (response->resultCode != 201)
{
- SendRequest(new CreateEndpointRequest(TokenSecret, Server), &CSkypeProto::OnEndpointCreated);
- return;
+ if (response->resultCode == 401)
+ {
+ delSetting("TokenExpiresIn");
+ SendRequest(new LoginRequest(), &CSkypeProto::OnLoginFirst);
+ return;
+ }
+ else //it should be rewritten
+ {
+ SendRequest(new CreateEndpointRequest(TokenSecret, Server), &CSkypeProto::OnEndpointCreated);
+ return;
+ }
}
RegToken = getStringA("registrationToken");
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index f91bd41d45..cc30702395 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -201,7 +201,7 @@ int CSkypeProto::SetStatus(int iNewStatus) if ((tokenExpires - 1800) > time(NULL))
OnLoginSuccess();
else
- PushRequest(new LoginRequest(), &CSkypeProto::OnLoginFirst);
+ SendRequest(new LoginRequest(), &CSkypeProto::OnLoginFirst);
}
else
{
|