summaryrefslogtreecommitdiff
path: root/modules/commands/os_akill.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-01-08 19:42:48 -0500
committerAdam <Adam@anope.org>2012-01-08 19:42:48 -0500
commit815e140ecf7bac0db41fd29d7c4f7298d4eddb2b (patch)
tree9eb1c2fa6ced4b4ace4c60574cfc15a30db3d2e1 /modules/commands/os_akill.cpp
parentf8245574dca875543c2bb8a0ad871cfe0a93874a (diff)
Fixed loading akill reasons
Diffstat (limited to 'modules/commands/os_akill.cpp')
-rw-r--r--modules/commands/os_akill.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp
index ea6a8ddaf..86dc2a8db 100644
--- a/modules/commands/os_akill.cpp
+++ b/modules/commands/os_akill.cpp
@@ -98,10 +98,11 @@ class CommandOSAKill : public Command
reason += " " + params[3];
if (!mask.empty() && !reason.empty())
{
+ User *targ = NULL;
std::pair<int, XLine *> canAdd = akills->CanAdd(mask, expires);
if (mask.find('!') != Anope::string::npos)
source.Reply(_("\002Reminder\002: AKILL masks cannot contain nicknames; make sure you have \002not\002 included a nick portion in your mask."));
- else if (mask.find('@') == Anope::string::npos)
+ else if (mask.find('@') == Anope::string::npos && !(targ = finduser(mask)))
source.Reply(BAD_USERHOST_MASK);
else if (mask.find_first_not_of("~@.*?") == Anope::string::npos)
source.Reply(USERHOST_MASK_TOO_WIDE, mask.c_str());
@@ -113,9 +114,8 @@ class CommandOSAKill : public Command
source.Reply(_("\002%s\002 is already covered by %s."), mask.c_str(), canAdd.second->Mask.c_str());
else
{
- User *user = finduser(mask);
- if (user)
- mask = "*@" + user->host;
+ if (targ)
+ mask = "*@" + targ->host;
unsigned int affected = 0;
for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
if (Anope::Match(it->second->GetIdent() + "@" + it->second->host, mask))