]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_tline.cpp
Prevent using invalid UIDs and enforce UID/SID matching
[user/henk/code/inspircd.git] / src / modules / m_tline.cpp
index dd3639fa47c029b607f803a76f7da8e1a23fc1c1..78c90f68c3f571faaf441cef89863f07b30b69b3 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
 class CommandTline : public Command
 {
  public:
-       CommandTline (InspIRCd* Instance) : Command(Instance,"TLINE", "o", 1)
+       CommandTline(Module* Creator) : Command(Creator,"TLINE", 1)
        {
-               this->source = "m_tline.so";
-               this->syntax = "<mask>";
+               flags_needed = 'o'; this->syntax = "<mask>";
        }
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
@@ -56,21 +55,18 @@ class CommandTline : public Command
                else
                        user->WriteServ( "NOTICE %s :*** TLINE: Counted %0.0f user(s). Matched '%s' against no user(s).", user->nick.c_str(), n_counted, parameters[0].c_str());
 
-               return CMD_LOCALONLY;
+               return CMD_SUCCESS;
        }
 };
 
 class ModuleTLine : public Module
 {
-       CommandTline* newcommand;
+       CommandTline cmd;
  public:
-       ModuleTLine(InspIRCd* Me)
-               : Module(Me)
+       ModuleTLine()
+               : cmd(this)
        {
-
-               newcommand = new CommandTline(ServerInstance);
-               ServerInstance->AddCommand(newcommand);
-
+               ServerInstance->AddCommand(&cmd);
        }
 
 
@@ -80,7 +76,7 @@ class ModuleTLine : public Module
 
        virtual Version GetVersion()
        {
-               return Version("$Id$", VF_VENDOR,API_VERSION);
+               return Version("Provides /tline command used to test who a mask matches", VF_VENDOR);
        }
 };