From d2847debb6a983d9217deb8652e360cc2ec62533 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 8 Apr 2015 08:35:33 +0000 Subject: connection fix (thx Unsane) git-svn-id: http://svn.miranda-ng.org/main/trunk@12673 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/requests/endpoint.h | 1 - protocols/SkypeWeb/src/skype_login.cpp | 17 +++++++++-------- protocols/SkypeWeb/src/skype_polling.cpp | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/protocols/SkypeWeb/src/requests/endpoint.h b/protocols/SkypeWeb/src/requests/endpoint.h index 51c7e6f634..be4a5d9ce7 100644 --- a/protocols/SkypeWeb/src/requests/endpoint.h +++ b/protocols/SkypeWeb/src/requests/endpoint.h @@ -7,7 +7,6 @@ public: CreateEndpointRequest(const char *token, const char *server = "client-s.gateway.messenger.live.com") : HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/endpoints", server) { - Headers << CHAR_VALUE("Accept", "application/json, text/javascript") << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8") diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index ea5a949af0..83c2d7883f 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -90,7 +90,7 @@ void CSkypeProto::OnLoginSecond(const NETLIBHTTPREQUEST *response) } ptrA server(getStringA("Server")); - PushRequest(new CreateEndpointRequest(token.c_str()), &CSkypeProto::OnEndpointCreated); + PushRequest(new CreateEndpointRequest(token.c_str(), server), &CSkypeProto::OnEndpointCreated); PushRequest(new GetProfileRequest(token.c_str()), &CSkypeProto::LoadProfile); PushRequest(new GetContactListRequest(token.c_str()), &CSkypeProto::LoadContactList); @@ -133,14 +133,14 @@ void CSkypeProto::OnEndpointCreated(const NETLIBHTTPREQUEST *response) if (response->resultCode != 201) { ptrA token(getStringA("Token")); - PushRequest(new CreateEndpointRequest(token), &CSkypeProto::OnEndpointCreated); + PushRequest(new CreateEndpointRequest(token, server), &CSkypeProto::OnEndpointCreated); return; } ptrA regToken(getStringA("registrationToken")); - PushRequest(new CreateSubscriptionsRequest(regToken), &CSkypeProto::OnSubscriptionsCreated); + PushRequest(new CreateSubscriptionsRequest(regToken, server), &CSkypeProto::OnSubscriptionsCreated); } void CSkypeProto::OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response) @@ -150,15 +150,16 @@ void CSkypeProto::OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response) ptrA regToken(getStringA("registrationToken")); ptrA skypename(getStringA(SKYPE_SETTINGS_ID)); - //ptrA endpoint(getStringA("endpointId")); - //PushRequest(new SendCapabilitiesRequest(regToken, endpoint)); - //PushRequest(new SetStatusRequest(regToken, MirandaToSkypeStatus(m_iDesiredStatus)), &CSkypeProto::OnStatusChanged); - PushRequest(new GetContactStatusRequest(regToken, skypename), &CSkypeProto::OnStatusChanged); + 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 GetContactStatusRequest(regToken, skypename), &CSkypeProto::OnStatusChanged); LIST 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)); + PushRequest(new CreateContactsRequest(regToken, skypenames, server)); for (int i = 0; i < skypenames.getCount(); i++) mir_free(skypenames[i]); skypenames.destroy(); diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp index fb2ea0fd7b..0a1905ff13 100644 --- a/protocols/SkypeWeb/src/skype_polling.cpp +++ b/protocols/SkypeWeb/src/skype_polling.cpp @@ -52,7 +52,7 @@ void CSkypeProto::PollingThread(void*) isTerminated = false; while (!isTerminated && !breaked && errors < POLLING_ERRORS_LIMIT) { - PollRequest *request = new PollRequest(regToken); + PollRequest *request = new PollRequest(regToken, server); request->nlc = m_pollingConnection; NETLIBHTTPREQUEST *response = request->Send(m_hNetlibUser); -- cgit v1.2.3