summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-03-11 12:13:08 -0400
committerAdam <Adam@anope.org>2015-03-11 12:13:08 -0400
commit3f093d708f198c105e9ac528436a78d4246b8273 (patch)
treef52407d30f1df2e04836779c304006ef1665eb3a
parentc3cc5804c32f423d4017a825300d926895ef64ed (diff)
Normalize masks given to cs_kick, use entry to match them against users
-rw-r--r--modules/commands/cs_kick.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp
index c95445557..a3505d254 100644
--- a/modules/commands/cs_kick.cpp
+++ b/modules/commands/cs_kick.cpp
@@ -73,7 +73,9 @@ class CommandCSKick : public Command
}
else if (u_access.HasPriv("FOUNDER"))
{
- Log(LOG_COMMAND, source, this, ci) << "for " << target;
+ Anope::string mask = IRCD->NormalizeMask(target);
+
+ Log(LOG_COMMAND, source, this, ci) << "for " << mask;
int matched = 0, kicked = 0;
for (Channel::ChanUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end;)
@@ -81,7 +83,8 @@ class CommandCSKick : public Command
ChanUserContainer *uc = it->second;
++it;
- if (Anope::Match(uc->user->nick, target) || Anope::Match(uc->user->GetDisplayedMask(), target))
+ Entry e("", mask);
+ if (e.Matches(uc->user))
{
++matched;
@@ -93,16 +96,16 @@ class CommandCSKick : public Command
++kicked;
if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !u_access.HasPriv("SIGNKICK")))
- c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s) (%s)", reason.c_str(), target.c_str(), source.GetNick().c_str());
+ c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s) (%s)", reason.c_str(), mask.c_str(), source.GetNick().c_str());
else
- c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), target.c_str());
+ c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), mask.c_str());
}
}
if (matched)
- source.Reply(_("Kicked %d/%d users matching %s from %s."), kicked, matched, target.c_str(), c->name.c_str());
+ source.Reply(_("Kicked %d/%d users matching %s from %s."), kicked, matched, mask.c_str(), c->name.c_str());
else
- source.Reply(_("No users on %s match %s."), c->name.c_str(), target.c_str());
+ source.Reply(_("No users on %s match %s."), c->name.c_str(), mask.c_str());
}
else
source.Reply(NICK_X_NOT_IN_USE, target.c_str());