From 46c5b2884e13d2abbf8ac4bfce616cc9575eeabe Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Tue, 20 Jun 2017 21:55:53 +0100 Subject: [PATCH] Don't send PART to client which sent QUIT Reported by milky --- src/Client.cpp | 13 +++++++------ src/IRCNetwork.cpp | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Client.cpp b/src/Client.cpp index ef5e7802..68ab6152 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -237,10 +237,11 @@ void CClient::SetNick(const CString& s) { m_sNick = s; } void CClient::SetNetwork(CIRCNetwork* pNetwork, bool bDisconnect, bool bReconnect) { - if (bDisconnect) { - if (m_pNetwork) { - m_pNetwork->ClientDisconnected(this); + if (m_pNetwork) { + m_pNetwork->ClientDisconnected(this); + if (bDisconnect) { + ClearServerDependentCaps(); // Tell the client they are no longer in these channels. const vector& vChans = m_pNetwork->GetChans(); for (const CChan* pChan : vChans) { @@ -249,9 +250,9 @@ void CClient::SetNetwork(CIRCNetwork* pNetwork, bool bDisconnect, " PART " + pChan->GetName()); } } - } else if (m_pUser) { - m_pUser->UserDisconnected(this); } + } else if (m_pUser) { + m_pUser->UserDisconnected(this); } m_pNetwork = pNetwork; @@ -445,7 +446,7 @@ void CClient::ConnectionRefused() { void CClient::Disconnected() { DEBUG(GetSockName() << " == Disconnected()"); CIRCNetwork* pNetwork = m_pNetwork; - SetNetwork(nullptr, true, false); + SetNetwork(nullptr, false, false); if (m_pUser) { NETWORKMODULECALL(OnClientDisconnect(), m_pUser, pNetwork, this, diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 63f15089..5396b71e 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -731,7 +731,6 @@ void CIRCNetwork::ClientDisconnected(CClient* pClient) { if (it != m_vClients.end()) { m_vClients.erase(it); } - pClient->ClearServerDependentCaps(); } CUser* CIRCNetwork::GetUser() const { return m_pUser; }