]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/xline.h
Run modulemanager upgrade to check for updates to third party (and extras) modules...
[user/henk/code/inspircd.git] / include / xline.h
index 74c58e05c87dd000c40fdc146fc6e362ddefc65a..8ac21f98841f61aebbb802148f492f94b07165fb 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
 #ifndef __XLINE_H
 #define __XLINE_H
 
-#include <string>
-#include <deque>
-#include <vector>
-#include "users.h"
-#include "channels.h"
+//#include <string>
+//#include <deque>
+//#include <vector>
 
 /** XLine is the base class for ban lines such as G lines and K lines.
  * Modules may derive from this, and their xlines will automatically be
@@ -37,8 +35,9 @@ class CoreExport XLine : public classbase
        /** Default 'apply' action. Quits the user.
         * @param u User to apply the line against
         * @param line The line typed, used for display purposes in the quit message
+        * @param bancache If true, the user will be added to the bancache if they match. Else not.
         */
-       void DefaultApply(User* u, const std::string &line);
+       void DefaultApply(User* u, const std::string &line, bool bancache);
 
  public:
 
@@ -122,15 +121,15 @@ class CoreExport XLine : public classbase
        /** The time the line was added.
         */
        time_t set_time;
-       
+
        /** The duration of the ban, or 0 if permenant
         */
        long duration;
-       
+
        /** Source of the ban. This can be a servername or an oper nickname
         */
        char* source;
-       
+
        /** Reason for the ban
         */
        char* reason;
@@ -143,6 +142,8 @@ class CoreExport XLine : public classbase
         * type of line this is.
         */
        const std::string type;
+
+       virtual bool IsBurstable();
 };
 
 /** KLine class
@@ -185,6 +186,8 @@ class CoreExport KLine : public XLine
 
        virtual const char* Displayable();
 
+       virtual bool IsBurstable();
+
        /** Ident mask (ident part only)
         */
        char* identmask;
@@ -375,14 +378,14 @@ class CoreExport QLine : public XLine
  */
 typedef std::pair<std::string, std::string> IdentHostPair;
 
-/** XLineFactory is used to generate an XLine pointer, given just the 
+/** XLineFactory is used to generate an XLine pointer, given just the
  * pattern, timing information and type of line to create. This is used
  * for example in the spanningtree module which will call an XLineFactory
  * to create a new XLine when it is inbound on a server link, so that it
  * does not have to know the specifics of the internals of an XLine class
  * and/or how to call its constructor.
  */
-class CoreExport XLineFactory
+class CoreExport XLineFactory : public classbase
 {
  protected:
 
@@ -396,7 +399,7 @@ class CoreExport XLineFactory
         * @param t Type of XLine this factory generates
         */
        XLineFactory(InspIRCd* Instance, const std::string &t) : ServerInstance(Instance), type(t) { }
-       
+
        /** Return the type of XLine this factory generates
         * @return The type of XLine this factory generates
         */
@@ -412,6 +415,8 @@ class CoreExport XLineFactory
         */
        virtual XLine* Generate(time_t set_time, long duration, const char* source, const char* reason, const char* xline_specific_mask) = 0;
 
+       virtual bool AutoApplyToUserList(XLine* x) { return true; }
+
        /** Destructor
         */
        virtual ~XLineFactory() { }
@@ -434,7 +439,7 @@ typedef std::map<std::string, XLineFactory*> XLineFactMap;
 
 /** A map of XLines indexed by string
  */
-typedef std::map<std::string, XLine *> XLineLookup;
+typedef std::map<irc::string, XLine *> XLineLookup;
 
 /** A map of XLineLookup maps indexed by string
  */
@@ -452,7 +457,7 @@ typedef XLineLookup::iterator LookupIter;
  * or any other line created by a module. It also manages XLineFactory classes which
  * can generate a specialized XLine for use by another module.
  */
-class CoreExport XLineManager
+class CoreExport XLineManager : public classbase
 {
  protected:
        /** The owner/creator of this class
@@ -512,6 +517,10 @@ class CoreExport XLineManager
         */
        XLineLookup* GetAll(const std::string &type);
 
+       /** Remove all lines of a certain type.
+        */
+       void DelAll(const std::string &type);
+
        /** Return all known types of line currently stored by the XLineManager.
         * @return A vector containing all known line types currently stored in the main list.
         */
@@ -538,7 +547,7 @@ class CoreExport XLineManager
         * will generate a new XLine specialized to that type. For example if you
         * pass the XLineFactory that handles glines some data it will return a
         * pointer to a GLine, polymorphically represented as XLine. This is used where
-        * you do not know the full details of the item you wish to create, e.g. in a 
+        * you do not know the full details of the item you wish to create, e.g. in a
         * server protocol module like m_spanningtree, when you receive xlines from other
         * servers.
         * @param xlf XLineFactory pointer to register
@@ -672,4 +681,3 @@ class CoreExport ZLineFactory : public XLineFactory
 };
 
 #endif
-