From b56e71ab14b020a3a01f1fbd183382083156aaf4 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 1 Jun 2013 14:55:45 -0400 Subject: Move CheckKick event to Channel and make os_forbid use it instead of kicking users in the join event, which does bad things --- include/channels.h | 6 ++++++ include/modules.h | 4 ++-- include/regchannel.h | 6 ------ 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/channels.h b/include/channels.h index 25bd95097..15b66e928 100644 --- a/include/channels.h +++ b/include/channels.h @@ -278,6 +278,12 @@ class CoreExport Channel : public Base, public Extensible */ bool Unban(User *u, bool full = false); + /** Check whether a user is permitted to be on this channel + * @param u The user + * @return true if they are allowed, false if they aren't and were kicked + */ + bool CheckKick(User *user); + /** Finds a channel * @param name The channel to find * @return The channel, if found diff --git a/include/modules.h b/include/modules.h index b645bb7f3..286ba5246 100644 --- a/include/modules.h +++ b/include/modules.h @@ -679,13 +679,13 @@ class CoreExport Module : public Extensible /** Called after a user join a channel when we decide whether to kick them or not * @param u The user - * @param ci The channel + * @param c The channel * @param kick Set to true to kick * @param mask The mask to ban, if any * @param reason The reason for the kick * @return EVENT_STOP to prevent the user from joining by kicking/banning the user */ - virtual EventReturn OnCheckKick(User *u, ChannelInfo *ci, Anope::string &mask, Anope::string &reason) { throw NotImplementedException(); } + virtual EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) { throw NotImplementedException(); } /** Called when a user requests info for a channel * @param source The user requesting info diff --git a/include/regchannel.h b/include/regchannel.h index 08fae12b3..65d3236ef 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -393,12 +393,6 @@ class CoreExport ChannelInfo : public Serializable, public Extensible */ Anope::string GetMLockAsString(bool complete) const; - /** Check whether a user is permitted to be on this channel - * @param u The user - * @return true if they are allowed, false if they aren't and were kicked - */ - bool CheckKick(User *user); - /** Get the level for a privilege * @param priv The privilege name * @return the level -- cgit