summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-08-26 11:00:13 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-08-26 11:00:13 +0000
commit620a8e00fae60a5bef18a000c8bc5a3b98eff6a1 (patch)
tree34807eff3f20075c4341e264526eb75da0637b14 /protocols/SkypeWeb/src
parent6a78b8c34efc8856acab62e22c61a0883311170c (diff)
SkypeWeb: more fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15033 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r--protocols/SkypeWeb/src/requests/chatrooms.h3
-rw-r--r--protocols/SkypeWeb/src/skype_network.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_polling.cpp3
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp4
4 files changed, 8 insertions, 6 deletions
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);