]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/channels.h
Fixed recursive 'splat' in the actors table
[user/henk/code/inspircd.git] / include / channels.h
index 9f97c3b8b9c3e99c8cdd86f616b6ae34cfa6326b..633d7edef4541b490d0c1811e7008584108758a7 100644 (file)
@@ -1,12 +1,24 @@
-/*
-
-   
-*/
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *                       E-mail:
+ *                <brain@chatspike.net>
+ *               <Craig@chatspike.net>
+ *     
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
 
 #include "inspircd_config.h"
 #include "base.h"
 #include <time.h>
 #include <vector>
+#include <string>
 
 #ifndef __CHANNELS_H__
 #define __CHANNELS_H__
@@ -51,6 +63,18 @@ class InviteItem : public HostItem
 };
 
 
+/** Holds a custom parameter to a module-defined channel mode
+  * e.g. for +L this would hold the channel name.
+  */
+
+class ModeParameter : public classbase
+{
+ public:
+       char mode;
+       char parameter[MAXBUF];
+       char channel[CHANMAX];
+};
+
 /** Holds a complete ban list
  */
 typedef std::vector<BanItem>   BanList;
@@ -67,7 +91,7 @@ typedef std::vector<InviteItem>       InviteList;
  * This class represents a channel, and contains its name, modes, time created, topic, topic set time,
  * etc, and an instance of the BanList type.
  */
-class chanrec : public classbase
+class chanrec : public Extensible
 {
  public:
        /** The channels name.
@@ -77,6 +101,7 @@ class chanrec : public classbase
         * Plugins may use this field in any way they see fit.
         */
        char custom_modes[MAXMODES];     /* modes handled by modules */
+       
        /** Channel topic.
         * If this is an empty string, no channel topic is set.
         */
@@ -141,6 +166,18 @@ class chanrec : public classbase
         */
        void SetCustomModeParam(char mode,char* parameter,bool mode_on);
  
+       /** Returns true if a custom mode is set on a channel
+         */
+       bool IsCustomModeSet(char mode);
+
+       /** Returns the parameter for a custom mode on a channel.
+         * For example if "+L #foo" is set, and you pass this method
+         * 'L', it will return '#foo'. If the mode is not set on the
+         * channel, or the mode has no parameters associated with it,
+         * it will return an empty string.
+         */
+       std::string GetModeParameter(char mode);
+
        /** Creates a channel record and initialises it with default values
         */
        chanrec();