diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-22 19:09:19 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-22 19:09:19 +0000 |
commit | 793ed2c300803e66baf0e39559cf6cc71e4766b2 (patch) | |
tree | dcd82f2e07dae9a6241bb53e6b7a9c28c939f6b3 /protocols/SkypeWeb/src/skype_login.cpp | |
parent | adbd50c5672bf7e6c7cbb863d763c867266162b4 (diff) |
SkypeWeb: attempt to fix login troubles
git-svn-id: http://svn.miranda-ng.org/main/trunk@15013 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_login.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 3db5b33aaf..3a9446553c 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. UINT_PTR CSkypeProto::m_timer;
-void CSkypeProto::Login()
+void CSkypeProto::Login(void*)
{
// login
m_iStatus = ID_STATUS_CONNECTING;
@@ -34,6 +34,11 @@ void CSkypeProto::Login() ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
return;
}
+
+ mir_cslock lck(m_LoginLock);
+
+ if (m_iStatus > ID_STATUS_OFFLINE) return;
+
HistorySynced = isTerminated = false;
if ((tokenExpires - 1800) > time(NULL))
OnLoginSuccess();
@@ -44,6 +49,10 @@ void CSkypeProto::Login() else
SendRequest(new LoginOAuthRequest(li.szSkypename, szPassword), &CSkypeProto::OnLoginOAuth);
}
+
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, ID_STATUS_CONNECTING);
+
+ WaitForSingleObject(m_hLoginEvent, INFINITE);
}
void CSkypeProto::OnLoginOAuth(const NETLIBHTTPREQUEST *response)
@@ -257,6 +266,8 @@ void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) m_hPollingThread = ForkThreadEx(&CSkypeProto::PollingThread, 0, NULL);
+ SetEvent(m_hLoginEvent);
+
SendRequest(new LoadChatsRequest(li), &CSkypeProto::OnLoadChats);
SendRequest(new CreateTrouterRequest(), &CSkypeProto::OnCreateTrouter);
PushRequest(new GetContactListRequest(li, NULL), &CSkypeProto::LoadContactList);
|