|
|||
|
|||
|
#include <modules.h>
Inheritance diagram for Module:


Public Member Functions | |
| Module (InspIRCd *Me) | |
| Default constructor. | |
| virtual | ~Module () |
| Default destructor. | |
| virtual void | Prioritize () |
| virtual Version | GetVersion () |
| Returns the version number of a Module. | |
| virtual void | OnUserConnect (User *user) |
| Called when a user connects. | |
| virtual void | OnUserQuit (User *user, const std::string &message, const std::string &oper_message) |
| Called when a user quits. | |
| virtual void | OnUserDisconnect (User *user) |
| Called whenever a user's socket is closed. | |
| virtual int | OnChannelPreDelete (Channel *chan) |
| Called whenever a channel is about to be deleted. | |
| virtual void | OnChannelDelete (Channel *chan) |
| Called whenever a channel is deleted, either by QUIT, KICK or PART. | |
| virtual void | OnUserJoin (User *user, Channel *channel, bool sync, bool &silent) |
| Called when a user joins a channel. | |
| virtual void | OnPostJoin (User *user, Channel *channel) |
| Called after a user joins a channel Identical to OnUserJoin, but called immediately afterwards, when any linking module has seen the join. | |
| virtual void | OnUserPart (User *user, Channel *channel, std::string &partmessage, bool &silent) |
| Called when a user parts a channel. | |
| virtual void | OnRehash (User *user, const std::string ¶meter) |
| Called on rehash. | |
| virtual void | OnServerRaw (std::string &raw, bool inbound, User *user) |
| Called when a raw command is transmitted or received. | |
| virtual int | OnSendSnotice (char &snomask, std::string &type, const std::string &message) |
| Called whenever a snotice is about to be sent to a snomask. | |
| virtual int | OnUserPreJoin (User *user, Channel *chan, const char *cname, std::string &privs, const std::string &keygiven) |
| Called whenever a user is about to join a channel, before any processing is done. | |
| virtual int | OnUserPreKick (User *source, User *user, Channel *chan, const std::string &reason) |
| Called whenever a user is about to be kicked. | |
| virtual void | OnUserKick (User *source, User *user, Channel *chan, const std::string &reason, bool &silent) |
| Called whenever a user is kicked. | |
| virtual void | OnOper (User *user, const std::string &opertype) |
| Called whenever a user opers locally. | |
| virtual void | OnPostOper (User *user, const std::string &opername, const std::string &opertype) |
| Called after a user opers locally. | |
| virtual void | OnInfo (User *user) |
| Called whenever a user types /INFO. | |
| virtual void | OnWhois (User *source, User *dest) |
| Called whenever a /WHOIS is performed on a local user. | |
| virtual int | OnUserPreInvite (User *source, User *dest, Channel *channel, time_t timeout) |
| Called whenever a user is about to invite another user into a channel, before any processing is done. | |
| virtual void | OnUserInvite (User *source, User *dest, Channel *channel, time_t timeout) |
| Called after a user has been successfully invited to a channel. | |
| virtual int | OnUserPreMessage (User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list) |
| Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. | |
| virtual int | OnUserPreNotice (User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list) |
| Called whenever a user is about to NOTICE A user or a channel, before any processing is done. | |
| virtual void | OnBuildExemptList (MessageType message_type, Channel *chan, User *sender, char status, CUList &exempt_list, const std::string &text) |
| Called whenever the server wants to build the exemption list for a channel, but is not directly doing a PRIVMSG or NOTICE. | |
| virtual int | OnUserPreNick (User *user, const std::string &newnick) |
| Called before any nickchange, local or remote. | |
| virtual void | OnUserMessage (User *user, void *dest, int target_type, const std::string &text, char status, const CUList &exempt_list) |
| Called after any PRIVMSG sent from a user. | |
| virtual void | OnUserNotice (User *user, void *dest, int target_type, const std::string &text, char status, const CUList &exempt_list) |
| Called after any NOTICE sent from a user. | |
| virtual void | OnText (User *user, void *dest, int target_type, const std::string &text, char status, CUList &exempt_list) |
| Called immediately before any NOTICE or PRIVMSG sent from a user, local or remote. | |
| virtual void | OnMode (User *user, void *dest, int target_type, const std::string &text) |
| 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. | |
| virtual void | OnGetServerDescription (const std::string &servername, std::string &description) |
| Allows modules to alter or create server descriptions Whenever a module requires a server description, for example for display in WHOIS, this function is called in all modules. | |
| virtual void | OnSyncUser (User *user, Module *proto, void *opaque) |
| Allows modules to synchronize data which relates to users during a netburst. | |
| virtual void | OnSyncChannel (Channel *chan, Module *proto, void *opaque) |
| Allows modules to synchronize data which relates to channels during a netburst. | |
| virtual void | OnSyncChannelMetaData (Channel *chan, Module *proto, void *opaque, const std::string &extname, bool displayable=false) |
| virtual void | OnSyncUserMetaData (User *user, Module *proto, void *opaque, const std::string &extname, bool displayable=false) |
| virtual void | OnSyncOtherMetaData (Module *proto, void *opaque, bool displayable=false) |
| virtual void | OnDecodeMetaData (int target_type, void *target, const std::string &extname, const std::string &extdata) |
| Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. | |
| virtual void | ProtoSendMode (void *opaque, int target_type, void *target, const std::string &modeline) |
| Implemented by modules which provide the ability to link servers. | |
| virtual void | ProtoSendMetaData (void *opaque, int target_type, void *target, const std::string &extname, const std::string &extdata) |
| Implemented by modules which provide the ability to link servers. | |
| virtual void | OnWallops (User *user, const std::string &text) |
| Called after every WALLOPS command. | |
| virtual void | OnChangeHost (User *user, const std::string &newhost) |
| Called whenever a user's hostname is changed. | |
| virtual void | OnChangeName (User *user, const std::string &gecos) |
| Called whenever a user's GECOS (realname) is changed. | |
| virtual void | OnAddLine (User *source, XLine *line) |
| Called whenever an xline is added by a local user. | |
| virtual void | OnDelLine (User *source, XLine *line) |
| Called whenever an xline is deleted MANUALLY. | |
| virtual void | OnExpireLine (XLine *line) |
| Called whenever an xline expires. | |
| virtual void | OnCleanup (int target_type, void *item) |
| Called before your module is unloaded to clean up Extensibles. | |
| virtual void | OnUserPostNick (User *user, const std::string &oldnick) |
| Called after any nickchange, local or remote. | |
| virtual int | OnAccessCheck (User *source, User *dest, Channel *channel, int access_type) |
| Called before an action which requires a channel privilage check. | |
| virtual void | On005Numeric (std::string &output) |
| Called when a 005 numeric is about to be output. | |
| virtual int | OnKill (User *source, User *dest, const std::string &reason) |
| Called when a client is disconnected by KILL. | |
| virtual void | OnRemoteKill (User *source, User *dest, const std::string &reason, const std::string &operreason) |
| Called when an oper wants to disconnect a remote user via KILL. | |
| virtual void | OnLoadModule (Module *mod, const std::string &name) |
| Called whenever a module is loaded. | |
| virtual void | OnUnloadModule (Module *mod, const std::string &name) |
| Called whenever a module is unloaded. | |
| virtual void | OnBackgroundTimer (time_t curtime) |
| Called once every five seconds for background processing. | |
| virtual int | OnPreCommand (std::string &command, std::vector< std::string > ¶meters, User *user, bool validated, const std::string &original_line) |
| Called whenever any command is about to be executed. | |
| virtual void | OnPostCommand (const std::string &command, const std::vector< std::string > ¶meters, User *user, CmdResult result, const std::string &original_line) |
| Called after any command has been executed. | |
| virtual bool | OnCheckReady (User *user) |
| Called to check if a user who is connecting can now be allowed to register If any modules return false for this function, the user is held in the waiting state until all modules return true. | |
| virtual int | OnUserRegister (User *user) |
| Called whenever a user is about to register their connection (e.g. | |
| virtual int | OnCheckInvite (User *user, Channel *chan) |
| Called whenever a user joins a channel, to determine if invite checks should go ahead or not. | |
| virtual int | OnRawMode (User *user, Channel *chan, const char mode, const std::string ¶m, bool adding, int pcnt, bool servermode=true) |
| Called whenever a mode character is processed. | |
| virtual int | OnCheckKey (User *user, Channel *chan, const std::string &keygiven) |
| Called whenever a user joins a channel, to determine if key checks should go ahead or not. | |
| virtual int | OnCheckLimit (User *user, Channel *chan) |
| Called whenever a user joins a channel, to determine if channel limit checks should go ahead or not. | |
| virtual int | OnCheckBan (User *user, Channel *chan) |
| Called whenever a user joins a channel, to determine if banlist checks should go ahead or not. | |
| virtual int | OnCheckExtBan (User *u, Channel *c, char type) |
| virtual int | OnCheckStringExtBan (const std::string &s, Channel *c, char type) |
| Called whenever checking whether or not a string is extbanned. | |
| virtual int | OnStats (char symbol, User *user, string_list &results) |
| Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core. | |
| virtual int | OnChangeLocalUserHost (User *user, const std::string &newhost) |
| Called whenever a change of a local users displayed host is attempted. | |
| virtual int | OnChangeLocalUserGECOS (User *user, const std::string &newhost) |
| Called whenever a change of a local users GECOS (fullname field) is attempted. | |
| virtual int | OnLocalTopicChange (User *user, Channel *chan, const std::string &topic) |
| Called whenever a topic is changed by a local user. | |
| virtual void | OnPostLocalTopicChange (User *user, Channel *chan, const std::string &topic) |
| Called whenever a local topic has been changed. | |
| virtual void | OnEvent (Event *event) |
| Called whenever an Event class is sent to all module by another module. | |
| virtual const char * | OnRequest (Request *request) |
| Called whenever a Request class is sent to your module by another module. | |
| virtual int | OnPassCompare (Extensible *ex, const std::string &password, const std::string &input, const std::string &hashtype) |
| Called whenever a password check is to be made. | |
| virtual void | OnGlobalOper (User *user) |
| Called whenever a user is given usermode +o, anywhere on the network. | |
| virtual void | OnPostConnect (User *user) |
| Called after a user has fully connected and all modules have executed OnUserConnect This event is informational only. | |
| virtual int | OnAddBan (User *source, Channel *channel, const std::string &banmask) |
| Called whenever a ban is added to a channel's list. | |
| virtual int | OnDelBan (User *source, Channel *channel, const std::string &banmask) |
| Called whenever a ban is removed from a channel's list. | |
| virtual void | OnHookUserIO (User *user, const std::string &targetip) |
| virtual void | OnRawSocketAccept (int fd, const std::string &ip, int localport) |
| Called immediately after any connection is accepted. | |
| virtual int | OnRawSocketWrite (int fd, const char *buffer, int count) |
| Called immediately before any write() operation on a user's socket in the core. | |
| virtual void | OnRawSocketClose (int fd) |
| Called immediately before any socket is closed. | |
| virtual void | OnRawSocketConnect (int fd) |
| Called immediately upon connection of an outbound BufferedSocket which has been hooked by a module. | |
| virtual int | OnRawSocketRead (int fd, char *buffer, unsigned int count, int &readresult) |
| Called immediately before any read() operation on a client socket in the core. | |
| virtual int | OnSetAway (User *user, const std::string &awaymsg) |
| Called whenever a user sets away or returns from being away. | |
| virtual int | OnUserList (User *user, Channel *Ptr, CUList *&userlist) |
| Called whenever a NAMES list is requested. | |
| virtual int | OnWhoisLine (User *user, User *dest, int &numeric, std::string &text) |
| Called whenever a line of WHOIS output is sent to a user. | |
| virtual void | OnGarbageCollect () |
| Called at intervals for modules to garbage-collect any hashes etc. | |
| virtual void | OnBufferFlushed (User *user) |
| Called whenever a user's write buffer has been completely sent. | |
| virtual void | OnRunTestSuite () |
| Add test suite hooks here. | |
| virtual void | OnNamesListItem (User *issuer, User *user, Channel *channel, std::string &prefixes, std::string &nick) |
| Called for every item in a NAMES list, so that modules may reformat portions of it as they see fit. | |
| virtual int | OnNumeric (User *user, unsigned int numeric, const std::string &text) |
| virtual bool | OnHostCycle (User *user) |
| Called for every time the user's host or ident changes, to indicate wether or not the 'Changing host' message should be sent, if enabled. | |
Protected Attributes | |
| InspIRCd * | ServerInstance |
| Creator/owner pointer. | |
All modules must inherit from this class, its methods will be called when irc server events occur. class inherited from module must be instantiated by the ModuleFactory class (see relevent section) for the module to be initialised.
Definition at line 414 of file modules.h.
|
|
Default constructor. Creates a module class.
Definition at line 106 of file modules.cpp. |
|
|
Default destructor. destroys a module class Definition at line 107 of file modules.cpp. |
|
|
|
Called when a 005 numeric is about to be output. The module should modify the 005 numeric if needed to indicate its features.
Reimplemented in ModuleAllowInvite, ModuleBanException, ModuleBlockCAPS, ModuleBlockColour, ModuleCallerID, ModuleBadChannelExtban, ModuleGecosBan, ModuleInviteException, ModuleQuietBan, ModuleNamesX, ModuleNoCTCP, ModuleNoKicks, ModuleNoNickChange, ModuleNoNotice, ModulePartMsgBan, ModuleGecosBan, ModuleOperLog, ModuleOverride, ModuleRemove, ModuleSafeList, ModuleSecureList, ModuleServerBan, ModuleServicesAccount, ModuleSilence, ModuleStripColor, ModuleUHNames, ModuleUserIP, Modulewatch, ModuleSSLGnuTLS, and ModuleSSLOpenSSL. Definition at line 131 of file modules.cpp. |
|
||||||||||||||||||||
|
Called before an action which requires a channel privilage check.
This function is called before many functions which check a users status on a channel, for example before opping a user, deopping a user, kicking a user, etc. There are several values for access_type which indicate for what reason access is being checked. These are:
Reimplemented in ModuleChanProtect, ModuleNoKicks, and ModuleOverride. Definition at line 130 of file modules.cpp. References ACR_DEFAULT. |
|
||||||||||||||||
|
Called whenever a ban is added to a channel's list. Return a non-zero value to 'eat' the mode change and prevent the ban from being added.
Definition at line 158 of file modules.cpp. |
|
||||||||||||
|
Called whenever an xline is added by a local user. This method is triggered after the line is added.
Reimplemented in ModuleXLineDB, and ModuleSpanningTree. Definition at line 182 of file modules.cpp. |
|
|
Called once every five seconds for background processing. This timer can be used to control timed features. Its period is not accurate enough to be used as a clock, but it is gauranteed to be called at least once in any five second period, directly from the main loop of the server.
Reimplemented in ModuleTimedBans, ModuleTestClient, and ModuleSpanningTree. Definition at line 135 of file modules.cpp. |
|
|
Called whenever a user's write buffer has been completely sent. This is called when the user's write buffer is completely empty, and there are no more pending bytes to be written and no pending write events in the socket engine's queue. This may be used to refill the buffer with data which is being spooled in a controlled manner, e.g. LIST lines.
Reimplemented in ModuleSafeList, ModuleSSLGnuTLS, and ModuleSSLOpenSSL. Definition at line 193 of file modules.cpp. |
|
||||||||||||||||||||||||||||
|
Called whenever the server wants to build the exemption list for a channel, but is not directly doing a PRIVMSG or NOTICE. For example, the spanningtree protocol will call this event when passing a privmsg on (but not processing it directly).
Reimplemented in ModuleDeaf, and ModuleSilence. Definition at line 191 of file modules.cpp. |
|
||||||||||||
|
Called whenever a user's hostname is changed. This event triggers after the host has been set.
Reimplemented in ModuleSpanningTree. Definition at line 180 of file modules.cpp. |
|
||||||||||||
|
Called whenever a change of a local users GECOS (fullname field) is attempted. return 1 to deny the name change, or 0 to allow it.
Definition at line 151 of file modules.cpp. |
|
||||||||||||
|
Called whenever a change of a local users displayed host is attempted. Return 1 to deny the host change, or 0 to allow it.
Definition at line 150 of file modules.cpp. |
|
||||||||||||
|
Called whenever a user's GECOS (realname) is changed. This event triggers after the name has been set.
Reimplemented in ModuleSpanningTree. Definition at line 181 of file modules.cpp. |
|
|
Called whenever a channel is deleted, either by QUIT, KICK or PART.
Reimplemented in ModuleBanException, |