From 620a8e00fae60a5bef18a000c8bc5a3b98eff6a1 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 26 Aug 2015 11:00:13 +0000 Subject: SkypeWeb: more fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@15033 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/requests/chatrooms.h | 3 +-- protocols/SkypeWeb/src/skype_network.cpp | 4 +++- protocols/SkypeWeb/src/skype_polling.cpp | 3 ++- protocols/SkypeWeb/src/skype_proto.cpp | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'protocols/SkypeWeb') diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h index 6e7f53ee84..767bfb1eb4 100644 --- a/protocols/SkypeWeb/src/requests/chatrooms.h +++ b/protocols/SkypeWeb/src/requests/chatrooms.h @@ -47,10 +47,9 @@ public: << CHAR_VALUE("Accept", "application/json, text/javascript") << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", li.endpoint.szToken) << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); - JSONNode node; node - << JSONNode("clientmessageid", (long)timestamp) + << JSONNode("clientmessageid", CMStringA(::FORMAT, "%llu", (ULONGLONG)timestamp)) << JSONNode("messagetype", "RichText") << JSONNode("contenttype", "text") << JSONNode("content", message); diff --git a/protocols/SkypeWeb/src/skype_network.cpp b/protocols/SkypeWeb/src/skype_network.cpp index 541bff250e..f0f3e2c804 100644 --- a/protocols/SkypeWeb/src/skype_network.cpp +++ b/protocols/SkypeWeb/src/skype_network.cpp @@ -37,5 +37,7 @@ void CSkypeProto::UnInitNetwork() void CSkypeProto::ShutdownConnections() { - Netlib_Shutdown(m_hNetlibUser); + Netlib_Shutdown(m_pollingConnection); + Netlib_Shutdown(m_TrouterConnection); + //Netlib_Shutdown(m_hNetlibUser); } \ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp index cec5055c66..3d10898c4a 100644 --- a/protocols/SkypeWeb/src/skype_polling.cpp +++ b/protocols/SkypeWeb/src/skype_polling.cpp @@ -26,7 +26,7 @@ void CSkypeProto::PollingThread(void*) { WaitForSingleObject(m_hPollingEvent, INFINITE); - while ((nErrors < POLLING_ERRORS_LIMIT) && (m_iStatus > ID_STATUS_OFFLINE || IsStatusConnecting(m_iStatus))) + while ((nErrors < POLLING_ERRORS_LIMIT) && m_iStatus != ID_STATUS_OFFLINE) { PollRequest *request = new PollRequest(li); request->nlc = m_pollingConnection; @@ -210,6 +210,7 @@ void CSkypeProto::ProcessUserPresence(const JSONNode &node) if (IsMe(skypename)) { int iNewStatus = SkypeToMirandaStatus(status.c_str()); + if (iNewStatus == ID_STATUS_OFFLINE) return; int old_status = m_iStatus; m_iDesiredStatus = iNewStatus; m_iStatus = iNewStatus; diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 4d1e236bce..d2eeaf0b68 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -249,13 +249,13 @@ int CSkypeProto::SetStatus(int iNewStatus) delSetting("endpointId"); delSetting("expires"); } + m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; // logout requestQueue->Stop(); ShutdownConnections(); CloseDialogs(); - ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, ID_STATUS_OFFLINE); - m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; + ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, ID_STATUS_OFFLINE); if (!Miranda_Terminated()) SetAllContactsStatus(ID_STATUS_OFFLINE); -- cgit v1.2.3