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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user