diff options
Diffstat (limited to 'src/commands/cmd_kick.cpp')
-rw-r--r-- | src/commands/cmd_kick.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/commands/cmd_kick.cpp b/src/commands/cmd_kick.cpp index 3c5fb0052..016a14b2e 100644 --- a/src/commands/cmd_kick.cpp +++ b/src/commands/cmd_kick.cpp @@ -62,10 +62,21 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User return CMD_FAILURE; } - if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!ServerInstance->ULine(user->server))) + Membership* srcmemb = NULL; + 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; + srcmemb = c->GetUser(user); + if (!srcmemb) + { + 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) @@ -77,7 +88,7 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User reason.assign(user->nick, 0, ServerInstance->Config->Limits.MaxKick); } - c->KickUser(user, u, reason.c_str()); + c->KickUser(user, u, reason, srcmemb); return CMD_SUCCESS; } |