Skip to content

Commit

Permalink
Warn if a *module message is ignored
Browse files Browse the repository at this point in the history
Some modules (e.g. webadmin) don't handle messages to *module in any way. Make
it clear to the user why they didn't get any reply back in this case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information
psychon committed May 13, 2011
1 parent 55ba59d commit eb22965
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Modules.cpp
Expand Up @@ -493,7 +493,12 @@ void CModule::OnModCommand(const CString& sCommand) {
HandleCommand(sCommand); HandleCommand(sCommand);
} }
void CModule::OnUnknownModCommand(const CString& sLine) { void CModule::OnUnknownModCommand(const CString& sLine) {
if (!m_mCommands.empty()) if (m_mCommands.empty())
// This function is only called if OnModCommand wasn't
// overriden, so no false warnings for modules which don't use
// CModCommand for command handling.
PutModule("This module doesn't implement any commands.");
else
PutModule("Unknown command!"); PutModule("Unknown command!");
} }


Expand Down

0 comments on commit eb22965

Please sign in to comment.