X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules.h;h=2ba139e7eb463fb24b847dbb3f764c170f8ff16f;hb=8869f710e51a459ccf22a8b73a1c45d33237c973;hp=65e5a9ea343250a01c15f1736778e488b94a149a;hpb=3ba6fa6d7f81cc1c20a3ad4a7d2aa9521e9b36a8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/modules.h b/include/modules.h index 65e5a9ea3..2ba139e7e 100644 --- a/include/modules.h +++ b/include/modules.h @@ -60,7 +60,8 @@ enum WriteModeFlags { enum TargetTypeFlags { TYPE_USER = 1, TYPE_CHANNEL, - TYPE_SERVER + TYPE_SERVER, + TYPE_OTHER }; #include "dynamic.h" @@ -288,7 +289,7 @@ enum Implementation { I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUse 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_OnGlobalConnect, I_OnAddBan, I_OnDelBan, I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister, - I_OnOperCompare, I_OnChannelDelete, I_OnPostOper }; + I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData }; /** Base class for all InspIRCd modules * This class is the base class for InspIRCd modules. All modules must inherit from this class, @@ -461,7 +462,7 @@ class Module : public classbase * @param user The user being kicked * @param chan The channel the user is being kicked from * @param reason The kick reason - * @return 1 to prevent the kick, 0 to allow it + * @return 1 to prevent the kick, 0 to continue normally, -1 to explicitly allow the kick regardless of normal operation */ virtual int OnUserPreKick(userrec* source, userrec* user, chanrec* chan, std::string reason); @@ -543,9 +544,10 @@ class Module : public classbase * @param dest The target of the message (chanrec* or userrec*) * @param target_type The type of target (TYPE_USER or TYPE_CHANNEL) * @param text Changeable text being sent by the user + * @param status The status being used, e.g. PRIVMSG @#chan has status== '@', 0 to send to everyone. * @return 1 to deny the NOTICE, 0 to allow it */ - virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text); + virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text,char status); /** Called whenever a user is about to NOTICE A user or a channel, before any processing is done. * Returning any nonzero value from this function stops the process immediately, causing no @@ -561,9 +563,10 @@ class Module : public classbase * @param dest The target of the message (chanrec* or userrec*) * @param target_type The type of target (TYPE_USER or TYPE_CHANNEL) * @param text Changeable text being sent by the user + * @param status The status being used, e.g. PRIVMSG @#chan has status== '@', 0 to send to everyone. * @return 1 to deny the NOTICE, 0 to allow it */ - virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text); + virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text,char status); /** Called before any nickchange, local or remote. This can be used to implement Q-lines etc. * Please note that although you can see remote nickchanges through this function, you should @@ -584,8 +587,9 @@ class Module : public classbase * @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. PRIVMSG @#chan has status== '@', 0 to send to everyone. */ - virtual void OnUserMessage(userrec* user, void* dest, int target_type, std::string text); + virtual void OnUserMessage(userrec* user, void* dest, int target_type, std::string text, char status); /** Called after any NOTICE sent from a user. * The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* @@ -594,8 +598,9 @@ class Module : public classbase * @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 OnUserNotice(userrec* user, void* dest, int target_type, std::string text); + virtual void OnUserNotice(userrec* user, void* dest, int target_type, std::string text, char status); /** Called after every MODE command sent from a user * The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* @@ -675,6 +680,17 @@ class Module : public classbase */ virtual void OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, std::string extname); + /* Allows modules to syncronize metadata not related to users or channels, over the network during a netburst. + * Whenever the linking module wants to send out data, but doesnt know what the data + * represents (e.g. it is Extensible metadata, added to a userrec or chanrec by a module) then + * this method is called. You should use the ProtoSendMetaData function after you've + * correctly decided how the data should be represented, to send the metadata on its way if + * if it belongs to your module. + * @param proto A pointer to the module handling network protocol + * @param opaque An opaque pointer set by the protocol module, should not be modified! + */ + virtual void OnSyncOtherMetaData(Module* proto, void* opaque); + /** Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. * Please see src/modules/m_swhois.cpp for a working example of how to use this method call. * @param target_type The type of item to decode data for, TYPE_USER or TYPE_CHANNEL