From df5a99c47693ecca5337b1c0f1a65cdb6a4048a0 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 6 Jun 2015 19:01:08 +0000 Subject: SkypeWeb: Fix status changing error 729. git-svn-id: http://svn.miranda-ng.org/main/trunk@14027 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_login.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_login.cpp') diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index a6e26bc53c..b26516bc32 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -17,6 +17,8 @@ along with this program. If not, see . #include "stdafx.h" +UINT_PTR CSkypeProto::m_timer; + void CSkypeProto::OnLoginOAuth(const NETLIBHTTPREQUEST *response) { if (response == NULL || response->pData == NULL) @@ -80,7 +82,6 @@ void CSkypeProto::OnLoginOAuth(const NETLIBHTTPREQUEST *response) OnLoginSuccess(); } - void CSkypeProto::OnLoginSuccess() { ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_SUCCESS, NULL, 0); @@ -172,21 +173,27 @@ void CSkypeProto::OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response) SetStatus(ID_STATUS_OFFLINE); return; } - char *cName; + SendPresence(true); +} + +void CSkypeProto::SendPresence(bool isLogin) +{ + ptrA epname; ptrT place(getTStringA("Place")); - if (place && *place) - cName = mir_utf8encodeT(place); + if (!getBool("UseHostName", false) && place && *place) + epname = mir_utf8encodeT(place); else { - char compName[MAX_COMPUTERNAME_LENGTH + 1]; + TCHAR compName[MAX_COMPUTERNAME_LENGTH + 1]; DWORD size = SIZEOF(compName); - GetComputerNameA(compName, &size); - cName = compName; + GetComputerName(compName, &size); + epname = mir_utf8encodeT(compName); } - PushRequest(new SendCapabilitiesRequest(RegToken, EndpointId, cName, Server), &CSkypeProto::OnCapabilitiesSended); - - mir_free(cName); + if (isLogin) + PushRequest(new SendCapabilitiesRequest(RegToken, EndpointId, epname, Server), &CSkypeProto::OnCapabilitiesSended); + else + PushRequest(new SendCapabilitiesRequest(RegToken, EndpointId, epname, Server)); } void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) -- cgit v1.2.3