From dd0025211d2682bf8e89ead0f93ecb190ce38c7b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 12 Aug 2020 20:31:07 +0300 Subject: =?UTF-8?q?fixes=20#2520=20(SkypeWeb:=20=D0=BC=D0=B8=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B4=D0=B0=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D0=B4=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=D1=81=D1=8F=20=D0=B1=D1=80=D0=B0=D1=83=D0=B7=D0=B5?= =?UTF-8?q?=D1=80=D0=BE=D0=BC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/SkypeWeb/src/skype_network.cpp | 29 ----------------------------- protocols/SkypeWeb/src/skype_proto.cpp | 7 ++++++- protocols/SkypeWeb/src/skype_proto.h | 2 -- protocols/SkypeWeb/src/skype_utils.cpp | 2 ++ 4 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 protocols/SkypeWeb/src/skype_network.cpp (limited to 'protocols/SkypeWeb/src') diff --git a/protocols/SkypeWeb/src/skype_network.cpp b/protocols/SkypeWeb/src/skype_network.cpp deleted file mode 100644 index a982b70346..0000000000 --- a/protocols/SkypeWeb/src/skype_network.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright (c) 2015-20 Miranda NG team (https://miranda-ng.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation version 2 -of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdafx.h" - -void CSkypeProto::InitNetwork() -{ - CMStringW name(FORMAT, TranslateT("%s connection"), m_tszUserName); - - NETLIBUSER nlu = {}; - nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; - nlu.szDescriptiveName.w = name.GetBuffer(); - nlu.szSettingsModule = m_szModuleName; - m_hNetlibUser = Netlib_RegisterUser(&nlu); -} diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 4536dc4b8f..eddaa3d9a3 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -28,7 +28,12 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) : m_impl(*this), m_requests(1) { - InitNetwork(); + NETLIBUSER nlu = {}; + CMStringW name(FORMAT, TranslateT("%s connection"), m_tszUserName); + nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; + nlu.szDescriptiveName.w = name.GetBuffer(); + nlu.szSettingsModule = m_szModuleName; + m_hNetlibUser = Netlib_RegisterUser(&nlu); CreateProtoService(PS_CREATEACCMGRUI, &CSkypeProto::OnAccountManagerInit); CreateProtoService(PS_GETAVATARINFO, &CSkypeProto::SvcGetAvatarInfo); diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 52a8e04cc9..2760c47f39 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -183,8 +183,6 @@ private: INT_PTR __cdecl SvcSetMyAvatar(WPARAM, LPARAM); // requests - void InitNetwork(); - bool m_isTerminated = true; mir_cs m_requestQueueLock; LIST m_requests; diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index c0ab50c155..41815c55ec 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -616,6 +616,8 @@ AsyncHttpRequest::AsyncHttpRequest(int type, SkypeHost host, LPCSTR url, MTHttpR break; } + AddHeader("User-Agent", NETLIB_USER_AGENT); + if (url) m_szUrl.Append(url); m_pFunc = pFunc; -- cgit v1.2.3