summaryrefslogtreecommitdiff
path: root/modules/commands/cs_mode.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-02-21 12:36:59 -0500
committerAdam <Adam@anope.org>2017-02-21 12:36:59 -0500
commit6990c692d694aaebb20c958be71d895fdd3d552a (patch)
treeb8dea34710e85ab31bcdfb5306e7f3f9f120cfbe /modules/commands/cs_mode.cpp
parent98e62b403237fad5e99d3a648204c517d692e286 (diff)
Unwrap list modes too in cs_mode, and fix clear on virtual modes to show an error
Diffstat (limited to 'modules/commands/cs_mode.cpp')
-rw-r--r--modules/commands/cs_mode.cpp10
1 files changed, 10 insertions, 0 deletions
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<Anope::string> new_params;
new_params.push_back(params[0]);
new_params.push_back("SET");