summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-10 17:12:00 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-10 17:12:00 +0200
commit854af2945eb6b9b62c19e3c823d3bcc8a84e52ae (patch)
tree3ccf9b4ae39f4ae7964a0391f6af7ee3045fb8e4 /src
parentbef2d3f462cacd978898235dc49a0a6c3bac0356 (diff)
Change Channel::KickUser() to accept an iterator, add overload that accepts a User
Remove srcmemb parameter
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp6
-rw-r--r--src/coremods/core_channel/cmd_kick.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 8b9e38e9c..77b7f81db 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -444,13 +444,13 @@ void Channel::PartUser(User *user, std::string &reason)
}
}
-void Channel::KickUser(User* src, User* victim, const std::string& reason, Membership* srcmemb)
+void Channel::KickUser(User* src, const UserMembIter& victimiter, const std::string& reason)
{
- UserMembIter victimiter = userlist.find(victim);
- Membership* memb = ((victimiter != userlist.end()) ? victimiter->second : NULL);
+ Membership* memb = victimiter->second;
CUList except_list;
FOREACH_MOD(OnUserKick, (src, memb, reason, except_list));
+ User* victim = memb->user;
WriteAllExcept(src, false, 0, except_list, "KICK %s %s :%s", name.c_str(), victim->nick.c_str(), reason.c_str());
victim->chans.erase(memb);
diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp
index a9e7ee2cd..9039d8551 100644
--- a/src/coremods/core_channel/cmd_kick.cpp
+++ b/src/coremods/core_channel/cmd_kick.cpp
@@ -112,7 +112,7 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User
}
}
- c->KickUser(user, u, reason, srcmemb);
+ c->KickUser(user, u, reason);
return CMD_SUCCESS;
}