]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_rline.cpp
Replace std::deque with std::vector in spanningtree and related modules
[user/henk/code/inspircd.git] / src / modules / m_rline.cpp
index 27ca31f48dbf2fdfb5af2d56012fb4f5521a78c9..824d6229a9258df687e2685b260fe0fb082c64c9 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -57,6 +57,9 @@ class RLine : public XLine
 
        bool Matches(User *u)
        {
+               if (u->exempt)
+                       return false;
+
                std::string compare = u->nick + "!" + u->ident + "@" + u->host + " " + u->fullname;
                return regex->Matches(compare);
        }
@@ -73,7 +76,7 @@ class RLine : public XLine
 
        void DisplayExpiry()
        {
-               ServerInstance->SNO->WriteToSnoMask('x',"Removing expired R-Line %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, ServerInstance->Time() - this->set_time);
+               ServerInstance->SNO->WriteToSnoMask('x',"Removing expired R-Line %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, (long int)(ServerInstance->Time() - this->set_time));
        }
 
        const char* Displayable()
@@ -183,25 +186,21 @@ class CommandRLine : public Command
 class ModuleRLine : public Module
 {
  private:
-       CommandRLine *r;
-       RLineFactory *f;
+       CommandRLine r;
+       RLineFactory f;
        bool MatchOnNickChange;
        std::string RegexEngine;
 
  public:
-       ModuleRLine(InspIRCd* Me) : Module(Me)
+       ModuleRLine(InspIRCd* Me) : Module(Me), r(Me), f(Me)
        {
                mymodule = this;
-               OnRehash(NULL, "");
+               OnRehash(NULL);
 
                Me->Modules->UseInterface("RegularExpression");
 
-               // Create a new command
-               r = new CommandRLine(ServerInstance);
-               ServerInstance->AddCommand(r);
-
-               f = new RLineFactory(ServerInstance);
-               ServerInstance->XLines->RegisterFactory(f);
+               ServerInstance->AddCommand(&r);
+               ServerInstance->XLines->RegisterFactory(&f);
 
                Implementation eventlist[] = { I_OnUserConnect, I_OnRehash, I_OnUserPostNick, I_OnLoadModule, I_OnStats };
                ServerInstance->Modules->Attach(eventlist, this, 5);
@@ -212,7 +211,7 @@ class ModuleRLine : public Module
        {
                ServerInstance->Modules->DoneWithInterface("RegularExpression");
                ServerInstance->XLines->DelAll("R");
-               ServerInstance->XLines->UnregisterFactory(f);
+               ServerInstance->XLines->UnregisterFactory(&f);
        }
 
        virtual Version GetVersion()
@@ -232,7 +231,7 @@ class ModuleRLine : public Module
                }
        }
 
-       virtual void OnRehash(User *user, const std::string &parameter)
+       virtual void OnRehash(User *user)
        {
                ConfigReader Conf(ServerInstance);