From 6990c692d694aaebb20c958be71d895fdd3d552a Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 21 Feb 2017 12:36:59 -0500 Subject: Unwrap list modes too in cs_mode, and fix clear on virtual modes to show an error --- modules/commands/cs_mode.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/commands/cs_mode.cpp') diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 4cc8779c4..fb91ce6bd 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -654,6 +654,10 @@ class CommandCSMode : public Command break; if (!sep.GetToken(param)) break; + + // Change to internal name, eg giving -b ~q:* + cm = cm->Unwrap(param); + if (adding) { if (IRCD->GetMaxListFor(ci->c) && ci->c->HasMode(cm->name) < IRCD->GetMaxListFor(ci->c)) @@ -709,6 +713,12 @@ class CommandCSMode : public Command return; } + if (!cm->mchar) + { + source.Reply(_("Mode %s is a virtual mode and can't be cleared."), cm->name.c_str()); + return; + } + std::vector new_params; new_params.push_back(params[0]); new_params.push_back("SET"); -- cgit