diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-18 07:05:03 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-18 07:05:03 +0000 |
commit | 52741a247b2f01c0495f2527e0939755d3348fc3 (patch) | |
tree | 7061b63893f33f59f9775acc694b543606546cdf /protocols/SkypeWeb/src/skype_login.cpp | |
parent | 67c3941db8a7ea1965dbed909f33380200f04090 (diff) |
SkypeWeb: Optimizations.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12899 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_login.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 60c6b41064..e7df084f9c 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -107,10 +107,11 @@ void CSkypeProto::OnLoginSecond(const NETLIBHTTPREQUEST *response) void CSkypeProto::OnLoginSuccess()
{
- PushRequest(new CreateEndpointRequest(ptrA(getStringA("TokenSecret"))), &CSkypeProto::OnEndpointCreated);
- PushRequest(new GetProfileRequest(ptrA(getStringA("TokenSecret"))), &CSkypeProto::LoadProfile);
- PushRequest(new GetAvatarRequest(ptrA(getStringA("AvatarUrl"))), &CSkypeProto::OnReceiveAvatar, NULL);
- PushRequest(new GetContactListRequest(ptrA(getStringA("TokenSecret"))), &CSkypeProto::LoadContactList);
+ TokenSecret = getStringA("TokenSecret");
+ SendRequest(new CreateEndpointRequest(TokenSecret), &CSkypeProto::OnEndpointCreated);
+ PushRequest(new GetProfileRequest(TokenSecret), &CSkypeProto::LoadProfile);
+ PushRequest(new GetAvatarRequest(TokenSecret), &CSkypeProto::OnReceiveAvatar, NULL);
+ PushRequest(new GetContactListRequest(TokenSecret), &CSkypeProto::LoadContactList);
}
void CSkypeProto::OnEndpointCreated(const NETLIBHTTPREQUEST *response)
@@ -145,7 +146,8 @@ void CSkypeProto::OnEndpointCreated(const NETLIBHTTPREQUEST *response) else if (!mir_strcmpi(response->headers[i].szName, "Location"))
{
CMStringA szValue = response->headers[i].szValue, szCookieName, szCookieVal;
- setString("Server", ptrA(GetServerFromUrl(szValue)));
+ Server = GetServerFromUrl(szValue);
+ setString("Server", Server);
}
}
@@ -158,16 +160,15 @@ void CSkypeProto::OnEndpointCreated(const NETLIBHTTPREQUEST *response) return;
}
- ptrA server(getStringA("Server"));
if (response->resultCode != 201)
{
- ptrA token(getStringA("TokenSecret"));
- PushRequest(new CreateEndpointRequest(token, server), &CSkypeProto::OnEndpointCreated);
+ PushRequest(new CreateEndpointRequest(TokenSecret, Server), &CSkypeProto::OnEndpointCreated);
return;
}
- ptrA regToken(getStringA("registrationToken"));
- PushRequest(new CreateSubscriptionsRequest(regToken, server), &CSkypeProto::OnSubscriptionsCreated);
+ RegToken = getStringA("registrationToken");
+ EndpointId = getStringA("endpointId");
+ SendRequest(new CreateSubscriptionsRequest(RegToken, Server), &CSkypeProto::OnSubscriptionsCreated);
}
void CSkypeProto::OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response)
@@ -182,17 +183,14 @@ void CSkypeProto::OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response) return;
}
- ptrA regToken(getStringA("registrationToken"));
ptrA skypename(getStringA(SKYPE_SETTINGS_ID));
- ptrA endpoint(getStringA("endpointId"));
- ptrA server(getStringA("Server"));
- PushRequest(new SendCapabilitiesRequest(regToken, endpoint, server));
- PushRequest(new SetStatusRequest(regToken, MirandaToSkypeStatus(m_iDesiredStatus), server), &CSkypeProto::OnStatusChanged);
+ PushRequest(new SendCapabilitiesRequest(RegToken, EndpointId, Server));
+ SendRequest(new SetStatusRequest(RegToken, MirandaToSkypeStatus(m_iDesiredStatus), Server), &CSkypeProto::OnStatusChanged);
LIST<char> skypenames(1);
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
skypenames.insert(getStringA(hContact, SKYPE_SETTINGS_ID));
- PushRequest(new CreateContactsRequest(regToken, skypenames, server));
+ PushRequest(new CreateContactsRequest(RegToken, skypenames, Server));
for (int i = 0; i < skypenames.getCount(); i++)
mir_free(skypenames[i]);
skypenames.destroy();
|