From 854af2945eb6b9b62c19e3c823d3bcc8a84e52ae Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 10 Jun 2014 17:12:00 +0200 Subject: Change Channel::KickUser() to accept an iterator, add overload that accepts a User Remove srcmemb parameter --- include/channels.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/channels.h b/include/channels.h index 736ca2e98..cf7285210 100644 --- a/include/channels.h +++ b/include/channels.h @@ -178,11 +178,22 @@ class CoreExport Channel : public Extensible, public InviteBase /** Make src kick user from this channel with the given reason. * @param src The source of the kick - * @param user The user being kicked (must be on this channel) + * @param victimiter Iterator to the user being kicked, must be valid * @param reason The reason for the kick - * @param srcmemb The membership of the user who does the kick, can be NULL */ - void KickUser(User* src, User* user, const std::string& reason, Membership* srcmemb = NULL); + void KickUser(User* src, const UserMembIter& victimiter, const std::string& reason); + + /** Make src kick user from this channel with the given reason. + * @param src The source of the kick + * @param user The user being kicked + * @param reason The reason for the kick + */ + void KickUser(User* src, User* user, const std::string& reason) + { + UserMembIter it = userlist.find(user); + if (it != userlist.end()) + KickUser(src, it, reason); + } /** Part a user from this channel with the given reason. * If the reason field is NULL, no reason will be sent. -- cgit v1.2.3