summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2003-04-19 12:41:44 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2003-04-19 12:41:44 +0000
commite1cc6b33f4e5510f65d8cfeb62b0f31d567e1bbf (patch)
tree26e091df454f728198dc58b3bd1aef39ff64148f /include
parent7493cbb6b96253da72eae375acc7b4d0d309122c (diff)
Added more code for custom channel/user modes via modules
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@175 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/channels.h19
-rw-r--r--include/modules.h7
2 files changed, 14 insertions, 12 deletions
diff --git a/include/channels.h b/include/channels.h
index ffa984033..a800c73a9 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -133,18 +133,17 @@ class chanrec : public classbase
*/
BanList bans;
+ /** Sets or unsets a custom mode in the channels info
+ */
+ SetCustomMode(char mode,bool mode_on);
+
+ /** Sets or unsets the parameterrs for a custom mode in a channels info
+ */
+ SetCustomModeParam(char mode,char* parameter,bool mode_on);
+
/** Creates a channel record and initialises it with default values
*/
- chanrec()
- {
- strcpy(name,"");
- strcpy(custom_modes,"");
- strcpy(topic,"");
- strcpy(setby,"");
- strcpy(key,"");
- created = topicset = limit = 0;
- topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
- }
+ chanrec();
virtual ~chanrec() { /* stub */ }
};
diff --git a/include/modules.h b/include/modules.h
index 378c7ba31..9a1c4cfef 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -145,8 +145,9 @@ class Module : public classbase
* parameters for the mode as strings. If mode_on is false, the mode is being removed, and parameters
* may contain the parameters for the mode, dependent on wether they were defined when a mode handler
* was set up with Server::AddExtendedMode
+ * If the mode is not a channel mode, chanrec* chan is null, and should not be read from or written to.
*/
- virtual bool OnExtendedMode(char modechar, int type, bool mode_on, string_list &params);
+ virtual bool OnExtendedMode(userrec* user, chanrec* chan, char modechar, int type, bool mode_on, string_list &params);
};
@@ -265,7 +266,9 @@ class Server : public classbase
* use this parameter. The function returns false if the mode is unavailable, and will not
* attempt to allocate another character, as this will confuse users. This also means that
* as only one module can claim a specific mode character, the core does not need to keep track
- * of which modules own which modes, which speeds up operation of the server.
+ * of which modules own which modes, which speeds up operation of the server. In this version,
+ * a mode can have at most one parameter, attempting to use more parameters will have undefined
+ * effects.
*/
virtual bool AddExtendedMode(char modechar, int type, bool default_on, int params_when_on, int params_when_off);