From fe77d2543f2822b6637c4090887bf349fc4ccb75 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 18 Dec 2019 20:39:59 +0300 Subject: Facebook: - MqttSend now calculates payload size automatically (no need to add some magic numbers); - support for MQTT publish requests; - minor code cleaning --- protocols/Facebook/src/server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'protocols/Facebook/src/server.cpp') diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp index 72942d8cce..9eb13b9378 100644 --- a/protocols/Facebook/src/server.cpp +++ b/protocols/Facebook/src/server.cpp @@ -23,9 +23,12 @@ along with this program. If not, see . void FacebookProto::OnLoggedIn() { m_bOnline = true; + m_mid = 0; ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, m_iDesiredStatus); m_iStatus = m_iDesiredStatus; + + // MqttPublish("/foreground_state", "{\"foreground\":\"true\", \"keepalive_timeout\":\"60\"}"); } void FacebookProto::OnLoggedOut() @@ -107,6 +110,10 @@ FAIL: } debugLogA("exiting ServerThread"); + + Netlib_CloseHandle(m_mqttConn); + m_mqttConn = nullptr; + int oldStatus = m_iStatus; m_iDesiredStatus = m_iStatus = ID_STATUS_OFFLINE; ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus); -- cgit v1.2.3