summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-06-06 19:01:08 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-06-06 19:01:08 +0000
commitdf5a99c47693ecca5337b1c0f1a65cdb6a4048a0 (patch)
tree49ff4b050ff24817b2e94375579f2463833d49db /protocols
parentad1456fa6df7a681e91c75fb8912e507e9d0abc4 (diff)
SkypeWeb: Fix status changing error 729.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14027 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp27
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h3
-rw-r--r--protocols/SkypeWeb/src/skype_trouter.cpp3
-rw-r--r--protocols/SkypeWeb/src/skype_utils.cpp2
4 files changed, 22 insertions, 13 deletions
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 <http://www.gnu.org/licenses/>.
#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)
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 6a16d06939..ca3ddc7a26 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -98,7 +98,7 @@ public:
void __cdecl SearchBasicThread(void* id);
////////////////////////////////////////////
- UINT_PTR m_timer;
+ static UINT_PTR m_timer;
static int CompareAccounts(const CSkypeProto *p1, const CSkypeProto *p2);
void ProcessTimer();
static INT_PTR EventGetIcon(WPARAM wParam, LPARAM lParam);
@@ -174,6 +174,7 @@ private:
void OnLoginOAuth(const NETLIBHTTPREQUEST *response);
void OnLoginSuccess();
void OnEndpointCreated(const NETLIBHTTPREQUEST *response);
+ void SendPresence(bool isLogin = false);
void OnSubscriptionsCreated(const NETLIBHTTPREQUEST *response);
void OnCapabilitiesSended(const NETLIBHTTPREQUEST *response);
void OnStatusChanged(const NETLIBHTTPREQUEST *response);
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp
index 5971a6a49b..f86f29376c 100644
--- a/protocols/SkypeWeb/src/skype_trouter.cpp
+++ b/protocols/SkypeWeb/src/skype_trouter.cpp
@@ -105,7 +105,8 @@ void CSkypeProto::OnGetTrouter(const NETLIBHTTPREQUEST *response, void *p)
int iStart = 0;
CMStringA szToken = data.Tokenize(":", iStart).Trim();
TRouter.sessId = szToken.GetString();
- m_hTrouterThread = ForkThreadEx(&CSkypeProto::TRouterThread, 0, NULL);
+ if (!m_hTrouterThread)
+ m_hTrouterThread = ForkThreadEx(&CSkypeProto::TRouterThread, 0, NULL);
if (!isHealth)
SendRequest(new RegisterTrouterRequest(TokenSecret, TRouter.url.c_str(), TRouter.sessId.c_str()));
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp
index 9430f0f2e6..d0cf4ed480 100644
--- a/protocols/SkypeWeb/src/skype_utils.cpp
+++ b/protocols/SkypeWeb/src/skype_utils.cpp
@@ -760,7 +760,7 @@ void CSkypeProto::ProcessTimer()
if (IsOnline())
{
PushRequest(new GetContactListRequest(TokenSecret), &CSkypeProto::LoadContactList);
-
+ SendPresence(false);
if (!m_hTrouterThread)
SendRequest(new CreateTrouterRequest(), &CSkypeProto::OnCreateTrouter);
}