diff options
| author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-10 22:56:03 +0000 |
|---|---|---|
| committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-10 22:56:03 +0000 |
| commit | b73210e538038a8dd803c0c250369b8fd3c2b3f7 (patch) | |
| tree | 5e35bc86ca22875321378dd755d32999efdf7bb3 /include | |
| parent | 01d43e7db5514e29460c7952762739cdb7ee4b23 (diff) | |
Rewrote the code that handles and sends kicks
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2746 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
| -rw-r--r-- | include/extern.h | 1 | ||||
| -rw-r--r-- | include/modules.h | 8 | ||||
| -rw-r--r-- | include/regchannel.h | 6 | ||||
| -rw-r--r-- | include/services.h | 15 |
4 files changed, 26 insertions, 4 deletions
diff --git a/include/extern.h b/include/extern.h index 0ca8d4d3c..6d00c347c 100644 --- a/include/extern.h +++ b/include/extern.h @@ -141,7 +141,6 @@ E int check_should_voice(User * user, char *chan); E int check_should_halfop(User * user, char *chan); E int check_should_owner(User * user, char *chan); E int check_should_protect(User * user, char *chan); -E int check_kick(User * user, const char *chan, time_t chants); E void record_topic(const char *chan); E void restore_topic(const char *chan); E int check_topiclock(Channel * c, time_t topic_time); diff --git a/include/modules.h b/include/modules.h index a15657608..67aafc580 100644 --- a/include/modules.h +++ b/include/modules.h @@ -619,12 +619,14 @@ class CoreExport Module */ virtual void OnBotPreLoad(BotInfo *bi) { } - /** Called when a bot kicks a user + /** Called before a bot kicks a user + * @param bi The bot sending the kick + * @param c The channel the user is being kicked on * @param u The user being kicked - * @param ci The channel * @param reason The reason + * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it */ - virtual void OnBotKick(User *u, ChannelInfo *ci, const std::string &reason) { } + virtual EventReturn OnBotKick(BotInfo *bi, Channel *c, User *u, const std::string &reason) { return EVENT_CONTINUE; } /** Called before a user parts a channel * @param u The user diff --git a/include/regchannel.h b/include/regchannel.h index a6275db1d..2304467de 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -289,4 +289,10 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag> /** Clear all the params from the channel */ void ClearParams(); + + /** 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); }; diff --git a/include/services.h b/include/services.h index a2a328eb5..0a92a7c8e 100644 --- a/include/services.h +++ b/include/services.h @@ -989,6 +989,21 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags> * @param cmodes The modes to set */ void SetModes(BotInfo *bi, bool EnforceMLock, const char *cmodes, ...); + + /** Kick a user from a channel internally + * @param source The sender of the kick + * @param nick The nick being kicked + * @param reason The reason for the kick + */ + void KickInternal(const std::string &source, const std::string &nick, const std::string &reason); + + /** Kick a user from the channel + * @param bi The sender, can be NULL for the service bot for this channel + * @param u The user being kicked + * @param reason The reason for the kick + * @return true if the kick was scucessful, false if a module blocked the kick + */ + bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...); }; /** Channelban type flags |
