summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_login.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-04-14 17:21:31 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-04-14 17:21:31 +0000
commit5116d00341d784f690650bc4da8a5daed493fd59 (patch)
tree15b3af321689f2d306a52dec97746f7a974fb1b0 /protocols/SkypeWeb/src/skype_login.cpp
parent1681b4828192e02e34c74a65387562a8b2215faa (diff)
SkypeWeb: Login/logout refactoring part 1.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_login.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp
index 2df0ff7ceb..dc86c654dc 100644
--- a/protocols/SkypeWeb/src/skype_login.cpp
+++ b/protocols/SkypeWeb/src/skype_login.cpp
@@ -84,13 +84,13 @@ void CSkypeProto::OnLoginSecond(const NETLIBHTTPREQUEST *response)
std::string token = match[1];
setString("TokenSecret", token.c_str());
- /*regex = "<input type=\"hidden\" name=\"expires_in\" value=\"(.+?)\"/>";
+ regex = "<input type=\"hidden\" name=\"expires_in\" value=\"(.+?)\"/>";
if (std::regex_search(content, match, regex))
{
std::string expiresIn = match[1];
int seconds = atoi(expiresIn.c_str());
setDword("TokenExpiresIn", time(NULL) + seconds);
- }*/
+ }
for (int i = 0; i < response->headersCount; i++)
{
@@ -102,13 +102,15 @@ void CSkypeProto::OnLoginSecond(const NETLIBHTTPREQUEST *response)
if (std::regex_search(content, match, regex))
cookies[match[1]] = match[2];
}
+ OnLoginSuccess();
+}
- PushRequest(new CreateEndpointRequest(token.c_str()), &CSkypeProto::OnEndpointCreated);
-
- PushRequest(new GetProfileRequest(token.c_str()), &CSkypeProto::LoadProfile);
- ptrA szUrl(getStringA("AvatarUrl"));
- PushRequest(new GetAvatarRequest(szUrl), &CSkypeProto::OnReceiveAvatar, NULL);
- PushRequest(new GetContactListRequest(token.c_str()), &CSkypeProto::LoadContactList);
+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);
}
void CSkypeProto::OnEndpointCreated(const NETLIBHTTPREQUEST *response)