summaryrefslogtreecommitdiff
path: root/protocols/Facebook
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-01-23 14:29:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-01-23 14:29:59 +0300
commit65801ab151b397c846df7da6117d509202e8e4d0 (patch)
tree65a8f921c90f6bee81e298f72b22ea903691791e /protocols/Facebook
parent9aa5329a4b4077970571f40f79486a3a1bf3e9f8 (diff)
Facebook: valid processing of MQTT error code 4 (bad login/password)
Diffstat (limited to 'protocols/Facebook')
-rw-r--r--protocols/Facebook/src/mqtt.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/protocols/Facebook/src/mqtt.cpp b/protocols/Facebook/src/mqtt.cpp
index d342d545ef..8d468ece89 100644
--- a/protocols/Facebook/src/mqtt.cpp
+++ b/protocols/Facebook/src/mqtt.cpp
@@ -101,7 +101,15 @@ bool FacebookProto::MqttParse(const MqttMessage &payload)
switch (payload.getType()) {
case FB_MQTT_MESSAGE_TYPE_CONNACK:
if (pData[1] != 0) { // connection failed;
- ProtoBroadcastAck(0, ACKTYPE_LOGIN, ACKRESULT_FAILED, (HANDLE)m_iStatus, m_iDesiredStatus);
+ int iErrorCode = ntohs(*(u_short *)pData);
+ debugLogA("Login failed with error %d", iErrorCode);
+
+ if (iErrorCode == 4) { // invalid login/password
+ delSetting(DBKEY_TOKEN);
+ m_szAuthToken.Empty();
+ ProtoBroadcastAck(0, ACKTYPE_LOGIN, ACKRESULT_FAILED, 0, LOGINERR_WRONGPASSWORD);
+ }
+ else ProtoBroadcastAck(0, ACKTYPE_LOGIN, ACKRESULT_FAILED, 0, LOGINERR_WRONGPROTOCOL);
return false;
}