diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-10 17:22:02 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-10 17:22:02 +0200 |
commit | 252f2b4f2b1027da7cf41d06e779305767048f14 (patch) | |
tree | 6adffd49a9315a0f2dd2399ee704766b3895c5a5 /src | |
parent | b6da8d9e22a8b03ae13339ab8db3305797cba295 (diff) |
cmd_kick Assign a value to the kick reason string more reasonably
Diffstat (limited to 'src')
-rw-r--r-- | src/coremods/core_channel/cmd_kick.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp index d646d9a45..dfa9bf217 100644 --- a/src/coremods/core_channel/cmd_kick.cpp +++ b/src/coremods/core_channel/cmd_kick.cpp @@ -31,7 +31,6 @@ CommandKick::CommandKick(Module* parent) */ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User *user) { - std::string reason; Channel* c = ServerInstance->FindChan(parameters[0]); User* u; @@ -74,14 +73,8 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User } Membership* const memb = victimiter->second; - if (parameters.size() > 2) - { - reason.assign(parameters[2], 0, ServerInstance->Config->Limits.MaxKick); - } - else - { - reason.assign(user->nick, 0, ServerInstance->Config->Limits.MaxKick); - } + const bool has_reason = (parameters.size() > 2); + const std::string reason((has_reason ? parameters.back() : user->nick), 0, ServerInstance->Config->Limits.MaxKick); // Do the following checks only if the KICK is done by a local user; // each server enforces its own rules. |