Permalink
Browse files

controlpanel: Check if adding a new channel succeeded

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information...
1 parent 5e6e3be commit 74c91e8cfa351eef9b72893efdecccc214291c3e @psychon psychon committed Apr 13, 2014
Showing with 4 additions and 3 deletions.
  1. +4 −3 modules/controlpanel.cpp
View
@@ -578,9 +578,10 @@ class CAdminMod : public CModule {
}
CChan* pChan = new CChan(sChan, pNetwork, true);
- pNetwork->AddChan(pChan);
-
- PutModule("Channel [" + sChan + "] for user [" + sUsername + "] added.");
+ if (pNetwork->AddChan(pChan))
+ PutModule("Channel [" + pChan->GetName() + "] for user [" + sUsername + "] added.");
+ else
+ PutModule("Could not add channel [" + sChan + "] for user [" + sUsername + "], does it already exist?");
}
void DelChan(const CString& sLine) {

0 comments on commit 74c91e8

Please sign in to comment.