summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-10 17:04:42 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-10 17:04:42 +0200
commitbef2d3f462cacd978898235dc49a0a6c3bac0356 (patch)
treef28fd2dc8aa1a51d4d03bc3809954dd6247ce585 /src/channels.cpp
parent53c59d9a99d9ddcfcaf7a9249c00fb27619cffad (diff)
Move pre-kick checks from core to cmd_kick (core_channel)
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 19b1281d5..8b9e38e9c 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -448,45 +448,6 @@ void Channel::KickUser(User* src, User* victim, const std::string& reason, Membe
{
UserMembIter victimiter = userlist.find(victim);
Membership* memb = ((victimiter != userlist.end()) ? victimiter->second : NULL);
-
- if (!memb)
- {
- src->WriteNumeric(ERR_USERNOTINCHANNEL, "%s %s :They are not on that channel", victim->nick.c_str(), this->name.c_str());
- return;
- }
-
- // Do the following checks only if the KICK is done by a local user;
- // each server enforces its own rules.
- if (IS_LOCAL(src))
- {
- // Modules are allowed to explicitly allow or deny kicks done by local users
- ModResult res;
- FIRST_MOD_RESULT(OnUserPreKick, res, (src,memb,reason));
- if (res == MOD_RES_DENY)
- return;
-
- if (res == MOD_RES_PASSTHRU)
- {
- if (!srcmemb)
- srcmemb = GetUser(src);
- unsigned int them = srcmemb ? srcmemb->getRank() : 0;
- unsigned int req = HALFOP_VALUE;
- for (std::string::size_type i = 0; i < memb->modes.length(); i++)
- {
- ModeHandler* mh = ServerInstance->Modes->FindMode(memb->modes[i], MODETYPE_CHANNEL);
- if (mh && mh->GetLevelRequired() > req)
- req = mh->GetLevelRequired();
- }
-
- if (them < req)
- {
- src->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s :You must be a channel %soperator",
- this->name.c_str(), req > HALFOP_VALUE ? "" : "half-");
- return;
- }
- }
- }
-
CUList except_list;
FOREACH_MOD(OnUserKick, (src, memb, reason, except_list));