summaryrefslogtreecommitdiff
path: root/protocols/Facebook/src/server.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-12-18 20:39:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-12-18 20:39:59 +0300
commitfe77d2543f2822b6637c4090887bf349fc4ccb75 (patch)
treec3ab1b2e4e9a1c4ca3bf1ee8a5b9a316e77ab83b /protocols/Facebook/src/server.cpp
parent406f0e4a4f42979778757243ed29c2753cbb1107 (diff)
Facebook:
- MqttSend now calculates payload size automatically (no need to add some magic numbers); - support for MQTT publish requests; - minor code cleaning
Diffstat (limited to 'protocols/Facebook/src/server.cpp')
-rw-r--r--protocols/Facebook/src/server.cpp7
1 files changed, 7 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
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);