]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
Instantiate BanCache in InspIRCd class.
[user/henk/code/inspircd.git] / include / modules.h
index 025f35bf33c9cfbcbafa515d01857790e07b7917..f6ac7fd613dd4e3b9b819748bf184dd0d8642139 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef __MODULES_H
 #define __MODULES_H
 
+class XLine;
+
 /** Used with OnAccessCheck() method of modules
  */
 enum AccessControlType {
@@ -372,15 +374,15 @@ enum Implementation {     I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUse
                        I_OnUserPreJoin, I_OnUserPreKick, I_OnUserKick, I_OnOper, I_OnInfo, I_OnWhois, I_OnUserPreInvite,
                        I_OnUserInvite, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreNick, I_OnUserMessage, I_OnUserNotice, I_OnMode,
                        I_OnGetServerDescription, I_OnSyncUser, I_OnSyncChannel, I_OnSyncChannelMetaData, I_OnSyncUserMetaData,
-                       I_OnDecodeMetaData, I_ProtoSendMode, I_ProtoSendMetaData, I_OnWallops, I_OnChangeHost, I_OnChangeName, I_OnAddGLine,
-                       I_OnAddZLine, I_OnAddQLine, I_OnAddKLine, I_OnAddELine, I_OnDelGLine, I_OnDelZLine, I_OnDelKLine, I_OnDelELine, I_OnDelQLine,
-                       I_OnCleanup, I_OnUserPostNick, I_OnAccessCheck, I_On005Numeric, I_OnKill, I_OnRemoteKill, I_OnLoadModule, I_OnUnloadModule,
+                       I_OnDecodeMetaData, I_ProtoSendMode, I_ProtoSendMetaData, I_OnWallops, I_OnChangeHost, I_OnChangeName, I_OnAddLine,
+                       I_OnDelLine, I_OnCleanup, I_OnUserPostNick, I_OnAccessCheck, I_On005Numeric, I_OnKill, I_OnRemoteKill, I_OnLoadModule, I_OnUnloadModule,
                        I_OnBackgroundTimer, I_OnPreCommand, I_OnCheckReady, I_OnUserRrgister, I_OnCheckInvite,
                        I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange,
                        I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnOperCompre, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan,
                        I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister,
                        I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList,
-                       I_OnPostCommand, I_OnPostJoin, I_OnWhoisLine, I_OnBuildExemptList, I_OnRawSocketConnect, I_OnGarbageCollect, I_OnBufferFlushed };
+                       I_OnPostCommand, I_OnPostJoin, I_OnWhoisLine, I_OnBuildExemptList, I_OnRawSocketConnect, I_OnGarbageCollect, I_OnBufferFlushed,
+                       I_OnText };
 
 /** Base class for all InspIRCd modules
  *  This class is the base class for InspIRCd modules. All modules must inherit from this class,
@@ -716,6 +718,20 @@ class CoreExport Module : public Extensible
         */
        virtual void OnUserNotice(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
 
+       /** Called immediately before any NOTICE or PRIVMSG sent from a user, local or remote.
+        * The dest variable contains a User* if target_type is TYPE_USER and a Channel*
+        * if target_type is TYPE_CHANNEL.
+        * The difference between this event and OnUserPreNotice/OnUserPreMessage is that delivery is gauranteed,
+        * the message has already been vetted. In the case of the other two methods, a later module may stop your
+        * message. This also differs from OnUserMessage which occurs AFTER the message has been sent.
+        * @param user The user sending the message
+        * @param dest The target of the message
+        * @param target_type The type of target (TYPE_USER or TYPE_CHANNEL)
+        * @param text the text being sent by the user
+        * @param status The status being used, e.g. NOTICE @#chan has status== '@', 0 to send to everyone.
+        */
+       virtual void OnText(User* user, void* dest, int target_type, const std::string &text, char status, CUList &exempt_list);
+
        /** Called after every MODE command sent from a user
         * The dest variable contains a User* if target_type is TYPE_USER and a Channel*
         * if target_type is TYPE_CHANNEL. The text variable contains the remainder of the
@@ -871,85 +887,25 @@ class CoreExport Module : public Extensible
         */
        virtual void OnChangeName(User* user, const std::string &gecos);
 
-       /** Called whenever a gline is added by a local user.
+       /** Called whenever an xline is added by a local user.
         * This method is triggered after the line is added.
-        * @param duration The duration of the line in seconds
-        * @param source The sender of the line
-        * @param reason The reason text to be displayed
-        * @param hostmask The hostmask to add
+        * @param source The sender of the line or NULL for local server
+        * @param line The xline being added
         */
-       virtual void OnAddGLine(long duration, User* source, const std::string &reason, const std::string &hostmask);
+       virtual void OnAddLine(User* source, XLine* line);
 
-       /** Called whenever a zline is added by a local user.
-        * This method is triggered after the line is added.
-        * @param duration The duration of the line in seconds
-        * @param source The sender of the line
-        * @param reason The reason text to be displayed
-        * @param ipmask The hostmask to add
-        */
-       virtual void OnAddZLine(long duration, User* source, const std::string &reason, const std::string &ipmask);
-
-       /** Called whenever a kline is added by a local user.
-        * This method is triggered after the line is added.
-        * @param duration The duration of the line in seconds
-        * @param source The sender of the line
-        * @param reason The reason text to be displayed
-        * @param hostmask The hostmask to add
-        */
-       virtual void OnAddKLine(long duration, User* source, const std::string &reason, const std::string &hostmask);
-
-       /** Called whenever a qline is added by a local user.
-        * This method is triggered after the line is added.
-        * @param duration The duration of the line in seconds
-        * @param source The sender of the line
-        * @param reason The reason text to be displayed
-        * @param nickmask The hostmask to add
-        */
-       virtual void OnAddQLine(long duration, User* source, const std::string &reason, const std::string &nickmask);
-
-       /** Called whenever a eline is added by a local user.
-        * This method is triggered after the line is added.
-        * @param duration The duration of the line in seconds
-        * @param source The sender of the line
-        * @param reason The reason text to be displayed
-        * @param hostmask The hostmask to add
-        */
-       virtual void OnAddELine(long duration, User* source, const std::string &reason, const std::string &hostmask);
-
-       /** Called whenever a gline is deleted.
+       /** Called whenever an xline is deleted.
         * This method is triggered after the line is deleted.
-        * @param source The user removing the line
-        * @param hostmask The hostmask to delete
+        * @param source The user removing the line or NULL for local server
+        * @param line the line being deleted
         */
-       virtual void OnDelGLine(User* source, const std::string &hostmask);
+       virtual void OnDelLine(User* source, XLine* line);
 
        /** Called whenever a zline is deleted.
         * This method is triggered after the line is deleted.
         * @param source The user removing the line
         * @param hostmask The hostmask to delete
         */
-       virtual void OnDelZLine(User* source, const std::string &ipmask);
-
-       /** Called whenever a kline is deleted.
-        * This method is triggered after the line is deleted.
-        * @param source The user removing the line
-        * @param hostmask The hostmask to delete
-        */
-       virtual void OnDelKLine(User* source, const std::string &hostmask);
-       
-       /** Called whenever a qline is deleted.
-        * This method is triggered after the line is deleted.
-        * @param source The user removing the line
-        * @param hostmask The hostmask to delete
-        */
-       virtual void OnDelQLine(User* source, const std::string &nickmask);
-
-       /** Called whenever a eline is deleted.
-        * This method is triggered after the line is deleted.
-        * @param source The user removing the line
-        * @param hostmask The hostmask to delete
-        */
-       virtual void OnDelELine(User* source, const std::string &hostmask);
 
        /** Called before your module is unloaded to clean up Extensibles.
         * This method is called once for every user and channel on the network,
@@ -1297,7 +1253,7 @@ class CoreExport Module : public Extensible
         */
        virtual void OnRawSocketClose(int fd);
 
-       /** Called immediately upon connection of an outbound InspSocket which has been hooked
+       /** Called immediately upon connection of an outbound BufferedSocket which has been hooked
         * by a module.
         * @param fd The file descriptor of the socket immediately after connect()
         */