diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-03 20:09:05 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-03 20:09:05 +0300 |
commit | 7937e21de4d288fc45d3b1a4b30ccb801df70b3d (patch) | |
tree | ec4fae290c3fb3367255d9e669a0a42145f56a24 /protocols | |
parent | 412da1b25c0db3dadc5442901e1d037acb4d4d52 (diff) |
OnLoggedOut to be called in the ServerThread, as the only safe place to do that
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Facebook/src/proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Facebook/src/server.cpp | 13 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/http.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 2 |
6 files changed, 10 insertions, 13 deletions
diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp index d3c1355fe3..b2e97d901e 100644 --- a/protocols/Facebook/src/proto.cpp +++ b/protocols/Facebook/src/proto.cpp @@ -226,7 +226,7 @@ int FacebookProto::SetStatus(int iNewStatus) // log off & free all resources if (iNewStatus == ID_STATUS_OFFLINE) { - OnLoggedOut(); + OnShutdown(); m_iStatus = ID_STATUS_OFFLINE; } 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(); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/ICQ-WIM/src/http.cpp b/protocols/ICQ-WIM/src/http.cpp index 4826a411c6..bfa22866b3 100644 --- a/protocols/ICQ-WIM/src/http.cpp +++ b/protocols/ICQ-WIM/src/http.cpp @@ -75,6 +75,8 @@ void __cdecl CIcqProto::ServerThread(void*) } } + OnLoggedOut(); + m_hWorkerThread = nullptr; for (auto &it : m_ConnPool) { if (it.s) diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index cfc28506f9..e50442fd8b 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -130,8 +130,6 @@ void CIcqProto::OnModulesLoaded() void CIcqProto::OnShutdown() { - UI_SAFE_CLOSE(m_pdlgEditIgnore); - m_bTerminated = true; } diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index e4cc21cd08..040796bb87 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -297,8 +297,6 @@ class CIcqProto : public PROTO<CIcqProto> OBJLIST<IcqGroup> m_arGroups; - CIcqDlgBase *m_pdlgEditIgnore; - int m_unreadEmails = -1; CMStringA m_szMailBox; diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 4bf8ab7385..b3bbcc460c 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -538,8 +538,6 @@ void CIcqProto::ShutdownSession() if (m_hWorkerThread) SetEvent(m_evRequestsQueue); - OnLoggedOut(); - for (auto &it : m_ConnPool) { if (it.s) { Netlib_Shutdown(it.s); |