diff options
Diffstat (limited to 'src/core/cs_ban.cpp')
-rw-r--r-- | src/core/cs_ban.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/core/cs_ban.cpp b/src/core/cs_ban.cpp index 9aee9d1dc..578ca9868 100644 --- a/src/core/cs_ban.cpp +++ b/src/core/cs_ban.cpp @@ -7,9 +7,8 @@ * * Based on the original code of Epona by Lara. * Based on the original code of Services by Andy Church. - * - * */ + /*************************************************************************/ #include "module.h" @@ -28,9 +27,7 @@ class CommandCSBan : public Command const char *reason = NULL; if (params.size() > 2) - { reason = params[2].c_str(); - } Channel *c = findchan(chan); ChannelInfo *ci; @@ -41,30 +38,29 @@ class CommandCSBan : public Command if (!reason) reason = "Requested"; - is_same = (stricmp(target, u->nick.c_str()) == 0); + is_same = !stricmp(target, u->nick.c_str()); if (c) ci = c->ci; - if (!c) { + if (!c) notice_lang(Config.s_ChanServ, u, CHAN_X_NOT_IN_USE, chan); - } else if (is_same ? !(u2 = u) : !(u2 = finduser(target))) { + else if (is_same ? !(u2 = u) : !(u2 = finduser(target))) notice_lang(Config.s_ChanServ, u, NICK_X_NOT_IN_USE, target); - } else if (!is_same ? !check_access(u, ci, CA_BAN) : - !check_access(u, ci, CA_BANME)) { + else if (!is_same ? !check_access(u, ci, CA_BAN) : !check_access(u, ci, CA_BANME)) notice_lang(Config.s_ChanServ, u, ACCESS_DENIED); - } else if (!is_same && (ci->HasFlag(CI_PEACE)) - && (get_access(u2, ci) >= get_access(u, ci))) { + else if (!is_same && (ci->HasFlag(CI_PEACE)) && (get_access(u2, ci) >= get_access(u, ci))) notice_lang(Config.s_ChanServ, u, ACCESS_DENIED); - /* - * Dont ban/kick the user on channels where he is excepted - * to prevent services <-> server wars. - */ - } else if (ModeManager::FindChannelModeByName(CMODE_EXCEPT) && is_excepted(ci, u2)) { + /* + * Dont ban/kick the user on channels where he is excepted + * to prevent services <-> server wars. + */ + else if (ModeManager::FindChannelModeByName(CMODE_EXCEPT) && is_excepted(ci, u2)) notice_lang(Config.s_ChanServ, u, CHAN_EXCEPTED, u2->nick.c_str(), ci->name.c_str()); - } else if (u2->IsProtected()) + else if (u2->IsProtected()) notice_lang(Config.s_ChanServ, u, ACCESS_DENIED); - else { + else + { char mask[BUFSIZE]; get_idealban(ci, u2, mask, sizeof(mask)); @@ -100,7 +96,6 @@ class CommandCSBan : public Command } }; - class CSBan : public Module { public: @@ -114,5 +109,4 @@ class CSBan : public Module } }; - MODULE_INIT(CSBan) |