X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules.h;h=caea6e4210ebd6f909c91da9f39e8a9923f80d29;hb=38c9d65253a67dbe13c77792027a9db601735813;hp=60d951623989357ed595a169cba34aa1ea30646f;hpb=0f2cf28d39404881b9719330ca86757c51b87bad;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/modules.h b/include/modules.h index 60d951623..caea6e421 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1,8 +1,18 @@ -/* - - - -*/ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * Inspire is copyright (C) 2002-2004 ChatSpike-Dev. + * E-mail: + * + * + * + * Written by Craig Edwards, Craig McLure, and others. + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ #ifndef __PLUGIN_H @@ -70,12 +80,12 @@ typedef std::deque chanuserlist; #define FOREACH_RESULT(x) { MOD_RESULT = 0; \ for (int i = 0; i <= MODCOUNT; i++) { \ int res = modules[i]->x ; \ - if (res) { \ + if (res != 0) { \ MOD_RESULT = res; \ break; \ } \ } \ - } + } // ********************************************************************************************* @@ -201,9 +211,10 @@ class Module : public classbase virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms); /** Called whenever a user is about to join a channel, before any processing is done. - * Returning any nonzero value from this function stops the process immediately, causing no + * Returning a value of 1 from this function stops the process immediately, causing no * output to be sent to the user by the core. If you do this you must produce your own numerics, - * notices etc. This is useful for modules which may want to mimic +b, +k, +l etc. + * notices etc. This is useful for modules which may want to mimic +b, +k, +l etc. Returning -1 from + * this function forces the join to be allowed, bypassing restrictions such as banlists, invite, keys etc. * * IMPORTANT NOTE! * @@ -227,7 +238,7 @@ class Module : public classbase * It is purposefully not possible to modify any info that has already been output, or halt the list. * You must write a 371 numeric to the user, containing your info in the following format: * - * :information here + * <nick> :information here */ virtual void OnInfo(userrec* user); @@ -237,6 +248,13 @@ class Module : public classbase */ virtual void OnWhois(userrec* source, userrec* dest); + /** Called whenever a user is about to invite another user into a channel, before any processing is done. + * Returning 1 from this function stops the process immediately, causing no + * output to be sent to the user by the core. If you do this you must produce your own numerics, + * notices etc. This is useful for modules which may want to filter invites to channels. + */ + virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); + /** Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. * Returning any nonzero value from this function stops the process immediately, causing no * output to be sent to the user by the core. If you do this you must produce your own numerics,