summaryrefslogtreecommitdiff
path: root/modules/operserv/kill.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/operserv/kill.cpp')
-rw-r--r--modules/operserv/kill.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/operserv/kill.cpp b/modules/operserv/kill.cpp
index 224cf7bfd..e4c97bcf4 100644
--- a/modules/operserv/kill.cpp
+++ b/modules/operserv/kill.cpp
@@ -35,18 +35,23 @@ class CommandOSKill : public Command
User *u2 = User::Find(nick, true);
if (u2 == NULL)
+ {
source.Reply(_("\002{0}\002 isn't currently online."), nick);
- else if (u2->IsProtected() || u2->server == Me)
- source.Reply(_("\002{0}\002 is protected and cannot be killed."), u2->nick);
- else
+ return;
+ }
+
+ if (u2->IsProtected() || u2->server == Me)
{
- if (reason.empty())
- reason = "No reason specified";
- if (Config->GetModule("operserv/main")->Get<bool>("addakiller"))
- reason = "(" + source.GetNick() + ") " + reason;
- Log(LOG_ADMIN, source, this) << "on " << u2->nick << " for " << reason;
- u2->Kill(*source.service, reason);
+ source.Reply(_("\002{0}\002 is protected and cannot be killed."), u2->nick);
+ return;
}
+
+ if (reason.empty())
+ reason = "No reason specified";
+ if (Config->GetModule("operserv/main")->Get<bool>("addakiller"))
+ reason = "(" + source.GetNick() + ") " + reason;
+ Log(LOG_ADMIN, source, this) << "on " << u2->nick << " for " << reason;
+ u2->Kill(*source.service, reason);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override