summaryrefslogtreecommitdiff
path: root/protocols/Facebook/src/server.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-01-03 20:09:05 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-01-03 20:09:05 +0300
commit7937e21de4d288fc45d3b1a4b30ccb801df70b3d (patch)
treeec4fae290c3fb3367255d9e669a0a42145f56a24 /protocols/Facebook/src/server.cpp
parent412da1b25c0db3dadc5442901e1d037acb4d4d52 (diff)
OnLoggedOut to be called in the ServerThread, as the only safe place to do that
Diffstat (limited to 'protocols/Facebook/src/server.cpp')
-rw-r--r--protocols/Facebook/src/server.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp
index 8f6ac2cbcb..f1b6acd9ce 100644
--- a/protocols/Facebook/src/server.cpp
+++ b/protocols/Facebook/src/server.cpp
@@ -26,7 +26,8 @@ void FacebookProto::ConnectionFailed()
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, m_iDesiredStatus);
- OnLoggedOut();
+
+ OnShutdown();
}
void FacebookProto::OnLoggedIn()
@@ -86,10 +87,12 @@ void FacebookProto::OnLoggedIn()
void FacebookProto::OnLoggedOut()
{
- OnShutdown();
-
m_impl.m_heartBeat.Stop();
m_bOnline = false;
+
+ ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, ID_STATUS_OFFLINE);
+ m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
+
setAllContactStatuses(ID_STATUS_OFFLINE);
}
@@ -254,9 +257,7 @@ LBL_Begin:
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);
+ OnLoggedOut();
}
/////////////////////////////////////////////////////////////////////////////////////////