diff --git a/src/ClientCommand.cpp b/src/ClientCommand.cpp index c8a31c86..0cffe55b 100644 --- a/src/ClientCommand.cpp +++ b/src/ClientCommand.cpp @@ -375,6 +375,34 @@ void CClient::UserCommand(CString& sLine) { PutStatus("There were [" + CString(uMatches) + "] channels matching [" + sChan + "]"); PutStatus("Enabled [" + CString(uEnabled) + "] channels"); } + } else if (sCommand.Equals("DISABLECHAN")) { + if (!m_pNetwork) { + PutStatus("You must be connected with a network to use this command"); + return; + } + + CString sChan = sLine.Token(1, true); + + if (sChan.empty()) { + PutStatus("Usage: DisableChan "); + } else { + const vector& vChans = m_pNetwork->GetChans(); + vector::const_iterator it; + unsigned int uMatches = 0, uDisabled = 0; + for (it = vChans.begin(); it != vChans.end(); ++it) { + if (!(*it)->GetName().WildCmp(sChan)) + continue; + uMatches++; + + if ((*it)->IsDisabled()) + continue; + uDisabled++; + (*it)->Disable(); + } + + PutStatus("There were [" + CString(uMatches) + "] channels matching [" + sChan + "]"); + PutStatus("Disabled [" + CString(uDisabled) + "] channels"); + } } else if (sCommand.Equals("LISTCHANS")) { if (!m_pNetwork) { PutStatus("You must be connected with a network to use this command"); @@ -1558,6 +1586,11 @@ void CClient::HelpUser() { Table.SetCell("Arguments", "<#chan>"); Table.SetCell("Description", "Enable the channel"); + Table.AddRow(); + Table.SetCell("Command", "Disablechan"); + Table.SetCell("Arguments", "<#chan>"); + Table.SetCell("Description", "Disable the channel"); + Table.AddRow(); Table.SetCell("Command", "Detach"); Table.SetCell("Arguments", "<#chan>");