diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-10 17:19:27 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-10 17:19:27 +0200 |
commit | b6da8d9e22a8b03ae13339ab8db3305797cba295 (patch) | |
tree | 7d3f8cc414d83d26487267788c3ff31ef383c77d /src/coremods | |
parent | 854af2945eb6b9b62c19e3c823d3bcc8a84e52ae (diff) |
Use the iterator version of Channel::KickUser() in a few places
Diffstat (limited to 'src/coremods')
-rw-r--r-- | src/coremods/core_channel/cmd_kick.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp index 9039d8551..d646d9a45 100644 --- a/src/coremods/core_channel/cmd_kick.cpp +++ b/src/coremods/core_channel/cmd_kick.cpp @@ -66,12 +66,13 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User } } - Membership* const memb = c->GetUser(u); - if (!memb) + const UserMembIter victimiter = c->userlist.find(u); + if (victimiter == c->userlist.end()) { user->WriteNumeric(ERR_USERNOTINCHANNEL, "%s %s :They are not on that channel", u->nick.c_str(), c->name.c_str()); return CMD_FAILURE; } + Membership* const memb = victimiter->second; if (parameters.size() > 2) { @@ -112,7 +113,7 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User } } - c->KickUser(user, u, reason); + c->KickUser(user, victimiter, reason); return CMD_SUCCESS; } |