1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 02:23:12 +02:00

Unwrap list modes too in cs_mode, and fix clear on virtual modes to show an error

This commit is contained in:
Adam
2017-02-21 12:36:59 -05:00
parent 98e62b4032
commit 6990c692d6
+10
View File
@@ -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");