Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: znc/znc
base: 62c843f8cfd7
...
head fork: znc/znc
compare: f6b8167e364a
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on May 02, 2013
Cork Add a Disablechan to match the Enablechan command a3c6684
Commits on Nov 14, 2013
@DarthGandalf DarthGandalf Merge pull request #341 from cork/master
Add irc command to allow disabling channel
f6b8167
Showing with 33 additions and 0 deletions.
  1. +33 −0 src/ClientCommand.cpp
View
33 src/ClientCommand.cpp
@@ -383,6 +383,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 <channel>");
+ } else {
+ const vector<CChan*>& vChans = m_pNetwork->GetChans();
+ vector<CChan*>::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");
@@ -1573,6 +1601,11 @@ void CClient::HelpUser() {
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>");
Table.SetCell("Description", "Detach from the channel");

No commit comments for this range

Something went wrong with that request. Please try again.