]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/xline.h
Add more features to modestacker so that we can stack +, -, and parameterless modes
[user/henk/code/inspircd.git] / include / xline.h
index bec693da6ec29d08518970a426bcc9d5600d9ce8..daefe8a1efbe84e52875b4ee19eb11c5915a5181 100644 (file)
@@ -42,6 +42,7 @@ class XLine : public classbase
        {
                source = strdup(src);
                reason = strdup(re);
+               expiry = set_time + duration;
        }
 
        virtual ~XLine()
@@ -64,6 +65,10 @@ class XLine : public classbase
        /** Reason for the ban
         */
        char* reason;
+
+       /** Expiry time
+        */
+       time_t expiry;
 };
 
 /** KLine class
@@ -204,57 +209,57 @@ class XLineManager
 
        /** This functor is used by the std::sort() function to keep glines in order
         */
-       static bool GSortComparison ( const GLine one, const GLine two );
+       static bool GSortComparison ( const GLine* one, const GLine* two );
 
        /** This functor is used by the std::sort() function to keep elines in order
         */
-       static bool ESortComparison ( const ELine one, const ELine two );
+       static bool ESortComparison ( const ELine* one, const ELine* two );
 
        /** This functor is used by the std::sort() function to keep zlines in order
         */
-       static bool ZSortComparison ( const ZLine one, const ZLine two );
+       static bool ZSortComparison ( const ZLine* one, const ZLine* two );
 
        /** This functor is used by the std::sort() function to keep klines in order
         */
-       static bool KSortComparison ( const KLine one, const KLine two );
+       static bool KSortComparison ( const KLine* one, const KLine* two );
 
        /** This functor is used by the std::sort() function to keep qlines in order
         */
-       static bool QSortComparison ( const QLine one, const QLine two );
+       static bool QSortComparison ( const QLine* one, const QLine* two );
  public:
        /* Lists for temporary lines with an expiry time */
 
        /** Temporary KLines */
-       std::vector<KLine> klines;
+       std::vector<KLine*> klines;
 
        /** Temporary Glines */
-       std::vector<GLine> glines;
+       std::vector<GLine*> glines;
 
        /** Temporary Zlines */
-       std::vector<ZLine> zlines;
+       std::vector<ZLine*> zlines;
 
        /** Temporary QLines */
-       std::vector<QLine> qlines;
+       std::vector<QLine*> qlines;
 
        /** Temporary ELines */
-       std::vector<ELine> elines;
+       std::vector<ELine*> elines;
 
        /* Seperate lists for perm XLines that isnt checked by expiry functions */
 
        /** Permenant KLines */
-       std::vector<KLine> pklines;
+       std::vector<KLine*> pklines;
 
        /** Permenant GLines */
-       std::vector<GLine> pglines;
+       std::vector<GLine*> pglines;
 
        /** Permenant ZLines */
-       std::vector<ZLine> pzlines;
+       std::vector<ZLine*> pzlines;
 
        /** Permenant QLines */
-       std::vector<QLine> pqlines;
+       std::vector<QLine*> pqlines;
 
        /** Permenant ELines */
-       std::vector<ELine> pelines;
+       std::vector<ELine*> pelines;
        
        /** Constructor
         * @param Instance A pointer to the creator object
@@ -342,31 +347,31 @@ class XLineManager
         * @return nick The nick to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
-       char* matches_qline(const char* nick);
+       QLine* matches_qline(const char* nick);
 
        /** Check if a hostname matches a GLine
         * @param user The user to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
-       char* matches_gline(userrec* user);
+       GLine* matches_gline(userrec* user);
 
        /** Check if a IP matches a ZLine
         * @param ipaddr The IP to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
-       char* matches_zline(const char* ipaddr);
+       ZLine* matches_zline(const char* ipaddr);
 
        /** Check if a hostname matches a KLine
         * @param user The user to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
-       char* matches_kline(userrec* user);
+       KLine* matches_kline(userrec* user);
 
        /** Check if a hostname matches a ELine
         * @param user The user to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
-       char* matches_exception(userrec* user);
+       ELine* matches_exception(userrec* user);
 
        /** Expire any pending non-permenant lines
         */