summaryrefslogtreecommitdiff
path: root/modules/commands/cs_mode.cpp
diff options
context:
space:
mode:
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");