diff options
author | Adam <Adam@anope.org> | 2014-06-25 11:02:19 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-06-25 11:02:19 -0400 |
commit | ee3289029d61da12013e0f5a3e4faf2d07543a0e (patch) | |
tree | df7391c321a913fc56db2d075292c0a6ddb0536d /modules/commands/cs_enforce.cpp | |
parent | fd9bb0ea7e3c8a39f1632c2ebbdc25d0fac192a0 (diff) |
Remove the rest of the 1.8 logic "let's write all of the command handler with no return statement!"
Fix if (something) else if (!something) tests
Remove returns at the bottom of void functions
Diffstat (limited to 'modules/commands/cs_enforce.cpp')
-rw-r--r-- | modules/commands/cs_enforce.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/modules/commands/cs_enforce.cpp b/modules/commands/cs_enforce.cpp index 64ef9ab0d..80abed196 100644 --- a/modules/commands/cs_enforce.cpp +++ b/modules/commands/cs_enforce.cpp @@ -235,12 +235,24 @@ class CommandCSEnforce : public Command ChanServ::Channel *ci = ChanServ::Find(params[0]); if (!ci) + { source.Reply(_("Channel \002{0}\002 isn't registered."), params[0]); - else if (!ci->c) + return; + } + + if (!ci->c) + { source.Reply(_("Channel \002{0}\002 doesn't exist."), ci->name); - else if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify")) + return; + } + + if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify")) + { source.Reply("Access denied. You do not have the \002{0}\002 privilege on \002{1}\002.", "AKICK", ci->name); - else if (what.equals_ci("SECUREOPS")) + return; + } + + if (what.equals_ci("SECUREOPS")) this->DoSecureOps(source, ci); else if (what.equals_ci("RESTRICTED")) this->DoRestricted(source, ci); |