summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-12-24 19:47:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-12-24 19:47:37 +0300
commit296290304c3f922be6905c2be4131baeafc46342 (patch)
treefc7c19a26b69e154d7a0c702811c51ad5fb908dd /protocols
parent146138489431bfea31bbeb285ba2dc15b2bc458b (diff)
Facebook: fix for MqttUnsubscribe format
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Facebook/src/mqtt.cpp8
-rw-r--r--protocols/Facebook/src/server.cpp4
2 files changed, 3 insertions, 9 deletions
diff --git a/protocols/Facebook/src/mqtt.cpp b/protocols/Facebook/src/mqtt.cpp
index 8731e2bcd8..92370dc971 100644
--- a/protocols/Facebook/src/mqtt.cpp
+++ b/protocols/Facebook/src/mqtt.cpp
@@ -106,7 +106,6 @@ bool FacebookProto::MqttParse(const MqttMessage &payload)
}
OnLoggedIn();
- MqttPing();
break;
case FB_MQTT_MESSAGE_TYPE_PUBREL:
@@ -287,19 +286,14 @@ void FacebookProto::MqttSubscribe(const char *topic, ...)
void FacebookProto::MqttUnsubscribe(const char *topic, ...)
{
- uint8_t zeroByte = 0;
-
MqttMessage payload(FB_MQTT_MESSAGE_TYPE_UNSUBSCRIBE, FB_MQTT_CONNECT_FLAG_QOS1);
payload.writeInt16(++m_mid);
payload.writeStr(topic);
- payload << zeroByte;
va_list ap;
va_start(ap, topic);
- while ((topic = va_arg(ap, const char *)) != nullptr) {
+ while ((topic = va_arg(ap, const char *)) != nullptr)
payload.writeStr(topic);
- payload << zeroByte;
- }
va_end(ap);
MqttSend(payload);
diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp
index 3d57ae2cb9..58b55fd942 100644
--- a/protocols/Facebook/src/server.cpp
+++ b/protocols/Facebook/src/server.cpp
@@ -31,7 +31,7 @@ void FacebookProto::OnLoggedIn()
// MqttPublish("/foreground_state", "{\"foreground\":\"true\", \"keepalive_timeout\":\"60\"}");
MqttSubscribe("/inbox", "/mercury", "/messaging_events", "/orca_presence", "/orca_typing_notifications", "/pp", "/t_ms", "/t_p", "/t_rtc", "/webrtc", "/webrtc_response", 0);
- // MqttUnsubscribe("/orca_message_notifications", 0);
+ MqttUnsubscribe("/orca_message_notifications", 0);
}
void FacebookProto::OnLoggedOut()
@@ -208,6 +208,7 @@ void FacebookProto::OnPublish(const char *topic, const uint8_t *p, size_t cbLen)
size_t dataSize;
void *pData = doUnzip(cbLen, p, dataSize);
if (pData != nullptr) {
+ debugLogA("UNZIP: <%s>", CMStringA((const char *)pData, (int)dataSize).c_str());
rdr.reset(dataSize, pData);
mir_free(pData);
}
@@ -221,7 +222,6 @@ void FacebookProto::OnPublish(const char *topic, const uint8_t *p, size_t cbLen)
OnPublishPresence(rdr);
else if (!strcmp(topic, "/orca_typing_notifications"))
OnPublishUtn(rdr);
-
}
void FacebookProto::OnPublishPresence(FbThriftReader &rdr)