X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules.h;h=e9ada30ff367aab31e1a477810c3a2d71ad1f42a;hb=7410e81e80513d09c1116de4d4536258bb25d914;hp=7945a33ad02eb9e357ebcb54cc736dde67c9dd93;hpb=8ed5d452db32932d2b1148332dd9012cb3aed625;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/modules.h b/include/modules.h index 7945a33ad..e9ada30ff 100644 --- a/include/modules.h +++ b/include/modules.h @@ -14,7 +14,6 @@ #ifndef __MODULES_H #define __MODULES_H -#include "globals.h" #include "dynamic.h" #include "base.h" #include "ctables.h" @@ -252,13 +251,17 @@ do { \ class CoreExport Version : public classbase { public: - /** Version numbers, build number, flags and API version - */ - const int Major, Minor, Revision, Build, Flags, API; + /** Version information. + */ + std::string version; + + /** Flags and API version + */ + const int Flags, API; - /** Initialize version class - */ - Version(int major, int minor, int revision, int build, int flags, int api_ver); + /** Initialize version class + */ + Version(const std::string &sversion, int flags, int api_ver); }; /** The ModuleMessage class is the base class of Request and Event @@ -385,7 +388,7 @@ enum Priority { PRIORITY_FIRST, PRIORITY_DONTCARE, PRIORITY_LAST, PRIORITY_BEFOR enum Implementation { I_BEGIN, - I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUserJoin, I_OnUserPart, I_OnRehash, I_OnServerRaw, + I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUserJoin, I_OnUserPart, I_OnRehash, I_OnServerRaw, I_OnSendSnotice, 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, @@ -528,6 +531,15 @@ class CoreExport Module : public Extensible */ virtual void OnServerRaw(std::string &raw, bool inbound, User* user); + /** Called whenever a snotice is about to be sent to a snomask. + * snomask and type may both be modified; the message may not. + * @param snomask The snomask the message is going to (e.g. 'A') + * @param type The textual description the snomask will go to (e.g. 'OPER') + * @param message The text message to be sent via snotice + * @return 1 to block the snotice from being sent entirely, 0 else. + */ + virtual int OnSendSnotice(char &snomask, std::string &type, const std::string &message); + /** Called whenever a user is about to join a channel, before any processing is done. * 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, @@ -620,7 +632,7 @@ class CoreExport Module : public Extensible * @param dest The user being invited * @param channel The channel the user is being invited to * @param timeout The time the invite will expire (0 == never) - * @return 1 to deny the invite, 0 to allow + * @return 1 to deny the invite, 0 to check whether or not the user has permission to invite, -1 to explicitly allow the invite */ virtual int OnUserPreInvite(User* source,User* dest,Channel* channel, time_t timeout); @@ -1174,7 +1186,7 @@ class CoreExport Module : public Extensible virtual int OnChangeLocalUserGECOS(User* user, const std::string &newhost); /** Called whenever a topic is changed by a local user. - * Return 1 to deny the topic change, or 0 to allow it. + * Return 1 to deny the topic change, 0 to check details on the change, -1 to let it through with no checks * @param user The user changing the topic * @param chan The channels who's topic is being changed * @param topic The actual topic text