mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix '/msg *status disconnect' to *really* disconnect from IRC
Before this commit, if a connection attempt was still going on, that attempt wasn't aborted. This is now fixed. This was reported by Kuja, thanks! git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1194 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -266,8 +266,20 @@ void CClient::UserCommand(const CString& sLine) {
|
||||
}
|
||||
} else if (sCommand.CaseCmp("DISCONNECT") == 0) {
|
||||
if (m_pUser) {
|
||||
if (m_pIRCSock)
|
||||
// m_pIRCSock is only set after the low level connection
|
||||
// to the IRC server was established. Before this we can
|
||||
// only find the IRC socket by its name.
|
||||
if (m_pIRCSock) {
|
||||
m_pIRCSock->Quit();
|
||||
} else {
|
||||
Csock* pIRCSock;
|
||||
CString sSockName = "IRC::" + m_pUser->GetUserName();
|
||||
// This is *slow*, we try to avoid doing this
|
||||
pIRCSock = CZNC::Get().GetManager().FindSockByName(sSockName);
|
||||
if (pIRCSock)
|
||||
pIRCSock->Close();
|
||||
}
|
||||
|
||||
m_pUser->SetIRCConnectEnabled(false);
|
||||
PutStatus("Disconnected from IRC. Use 'connect' to reconnect.");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user