summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-01-05 11:27:41 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-01-05 11:27:41 +0300
commit41914c60e56e169410382361353209df3e929090 (patch)
tree684a8b3735ed72272e5924102e25d5dab5633351
parenta9a97c244bf5cea6d1e7a2e48b91f08558829387 (diff)
fixes #2664 (SkypeWeb: cannot connect)
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp7
-rw-r--r--protocols/SkypeWeb/src/skype_utils.cpp5
-rw-r--r--protocols/SkypeWeb/src/skype_utils.h3
-rw-r--r--protocols/SkypeWeb/src/version.h2
4 files changed, 6 insertions, 11 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp
index bb920fb00e..47f9451b53 100644
--- a/protocols/SkypeWeb/src/skype_login.cpp
+++ b/protocols/SkypeWeb/src/skype_login.cpp
@@ -133,8 +133,11 @@ void CSkypeProto::OnEndpointCreated(NETLIBHTTPREQUEST *response, AsyncHttpReques
case 301:
case 302: // redirect to the closest data center
- if (auto *hdr = Netlib_GetHeader(response, "Location"))
- g_plugin.szDefaultServer = GetServerFromUrl(hdr);
+ if (auto *hdr = Netlib_GetHeader(response, "Location")) {
+ CMStringA szUrl(hdr+8);
+ int iEnd = szUrl.Find('/');
+ g_plugin.szDefaultServer = (iEnd != -1) ? szUrl.Left(iEnd) : szUrl;
+ }
PushRequest(new CreateEndpointRequest(this));
return;
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp
index 291ca892e7..8a53c232d4 100644
--- a/protocols/SkypeWeb/src/skype_utils.cpp
+++ b/protocols/SkypeWeb/src/skype_utils.cpp
@@ -565,11 +565,6 @@ CMStringW UrlToSkypeId(const wchar_t *url, int *pUserType)
/////////////////////////////////////////////////////////////////////////////////////////
-CMStringA GetServerFromUrl(const char *url)
-{
- return ParseUrl(url, "://");
-}
-
INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam)
{
wchar_t *arg = (wchar_t *)lParam;
diff --git a/protocols/SkypeWeb/src/skype_utils.h b/protocols/SkypeWeb/src/skype_utils.h
index 77278f9346..ab29528fb8 100644
--- a/protocols/SkypeWeb/src/skype_utils.h
+++ b/protocols/SkypeWeb/src/skype_utils.h
@@ -24,13 +24,10 @@ const char* GetSkypeNick(const char *pszSkypeId);
const wchar_t* GetSkypeNick(const wchar_t *szSkypeId);
CMStringA ParseUrl(const char *url, const char *token);
-CMStringW ParseUrl(const wchar_t *url, const wchar_t *token);
CMStringA UrlToSkypeId(const char *url, int *pUserType = nullptr);
CMStringW UrlToSkypeId(const wchar_t *url, int *pUserType = nullptr);
-CMStringA GetServerFromUrl(const char *url);
-
class EventHandle
{
HANDLE _hEvent;
diff --git a/protocols/SkypeWeb/src/version.h b/protocols/SkypeWeb/src/version.h
index 3e0c412e5d..427006e38e 100644
--- a/protocols/SkypeWeb/src/version.h
+++ b/protocols/SkypeWeb/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 95
#define __RELEASE_NUM 13
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>