diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-06-02 19:30:55 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-06-04 01:57:35 +0200 |
commit | 6db924458501457768d7ddafd5de8a69839f6399 (patch) | |
tree | b0e19da0e086074efcf5b479e44a6ac8201f0823 /src/commands | |
parent | 3a01b55a118d4937b75541fbf385180f7106fa12 (diff) |
Channel::KickUser() and cmd_kick changes
- Remove uline checks from KickUser()
- Disallow the kick if done by a local user and the victim is ulined in cmd_kick
- Remove call to RemoveAllPrefixes() as it has no additional effect, the Membership object containing the prefixes is destroyed soon after the call
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_kick.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/commands/cmd_kick.cpp b/src/commands/cmd_kick.cpp index 87ee1da6d..ecbdbad1e 100644 --- a/src/commands/cmd_kick.cpp +++ b/src/commands/cmd_kick.cpp @@ -62,10 +62,19 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User return CMD_FAILURE; } - if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!ServerInstance->ULine(user->server))) + if (IS_LOCAL(user)) { - user->WriteServ( "442 %s %s :You're not on that channel!", user->nick.c_str(), parameters[0].c_str()); - return CMD_FAILURE; + if (!c->HasUser(user)) + { + user->WriteServ( "442 %s %s :You're not on that channel!", user->nick.c_str(), parameters[0].c_str()); + return CMD_FAILURE; + } + + if (ServerInstance->ULine(u->server)) + { + user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :You may not kick a u-lined client", user->nick.c_str(), c->name.c_str()); + return CMD_FAILURE; + } } if (parameters.size() > 2) |