From 90cc4b0ee93696e6e6b3208cd2877ae6e786440d Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 1 May 2004 16:12:17 +0000 Subject: Provided modules with the ability to sync data on a netjoin git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@767 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modules.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'include/modules.h') diff --git a/include/modules.h b/include/modules.h index 866bed269..df971b611 100644 --- a/include/modules.h +++ b/include/modules.h @@ -50,6 +50,10 @@ typedef std::deque file_cache; typedef file_cache string_list; +/** Holds a list of users in a channel + */ +typedef std::deque chanuserlist; + // This #define allows us to call a method in all // loaded modules in a readable simple way, e.g.: @@ -266,7 +270,7 @@ class Module : public classbase * 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:
+ * These are:

* AC_KICK (0) - A user is being kicked
* AC_DEOP (1) - a user is being deopped
* AC_OP (2) - a user is being opped
@@ -275,7 +279,7 @@ class Module : public classbase * AC_HALFOP (5) - a user is being halfopped
* AC_DEHALFOP (6) - a user is being dehalfopped
* AC_INVITE (7) - a user is being invited
- * AC_GENERAL_MODE (8) - a user channel mode is being changed
+ * AC_GENERAL_MODE (8) - a user channel mode is being changed

* Upon returning from your function you must return either ACR_DEFAULT, to indicate the module wishes * to do nothing, or ACR_DENY where approprate to deny the action, and ACR_ALLOW where appropriate to allow * the action. Please note that in the case of some access checks (such as AC_GENERAL_MODE) access may be @@ -283,7 +287,21 @@ class Module : public classbase * AC_GENERAL_MODE type, as it may inadvertently override the behaviour of other modules. When the access_type * is AC_GENERAL_MODE, the destination of the mode will be NULL (as it has not yet been determined). */ + virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type); + /** Called during a netburst to sync user data. + * This is called during the netburst on a per-user basis. You should use this call to up any special + * user-related things which are implemented by your module, e.g. sending listmodes. You may return + * multiple commands in the string_list. + */ + virtual string_list OnUserSync(userrec* user); + + /** Called during a netburst to sync channel data. + * This is called during the netburst on a per-channel basis. You should use this call to up any special + * channel-related things which are implemented by your module, e.g. sending listmodes. You may return + * multiple commands in the string_list. + */ + virtual string_list OnChannelSync(chanrec* chan); }; @@ -577,6 +595,12 @@ class Server : public classbase * links and must operate in this manner. */ virtual bool IsUlined(std::string server); + + /** Fetches the userlist of a channel. This function must be here and not a member of userrec or + * chanrec due to include constraints. + */ + virtual chanuserlist Server::GetUsers(chanrec* chan); + }; /** Allows reading of values from configuration files -- cgit v1.2.3