]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_tline.cpp
Fix m_chanlog crashing.
[user/henk/code/inspircd.git] / src / modules / m_tline.cpp
index 834cb7f4cf7c4be236fb92e76d88e217fc6f1684..28a3d2f69945929ed2bb980acf1ece2de11d7621 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "wildcard.h"
 
 /* $ModDesc: Provides /tline command used to test who a mask matches */
 
 /** Handle /TLINE
  */ 
-class cmd_tline : public command_t
+class CommandTline : public Command
 {
  public:
-       cmd_tline (InspIRCd* Instance) : command_t(Instance,"TLINE", 'o', 1)
+       CommandTline (InspIRCd* Instance) : Command(Instance,"TLINE", 'o', 1)
        {
                this->source = "m_tline.so";
                this->syntax = "<mask>";
        }
 
-       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle (const char** parameters, int pcnt, User *user)
        {
                float n_counted = 0;
                float n_matched = 0;
                float n_match_host = 0;
                float n_match_ip = 0;
 
-               for (user_hash::const_iterator u = ServerInstance->clientlist->begin(); u != ServerInstance->clientlist->end(); u++)
+               for (user_hash::const_iterator u = ServerInstance->Users->clientlist->begin(); u != ServerInstance->Users->clientlist->end(); u++)
                {
                        n_counted++;
                        if (match(u->second->GetFullRealHost(),parameters[0]))
@@ -67,20 +64,18 @@ class cmd_tline : public command_t
 
 class ModuleTLine : public Module
 {
-       cmd_tline* newcommand;
+       CommandTline* newcommand;
  public:
        ModuleTLine(InspIRCd* Me)
                : Module(Me)
        {
                
-               newcommand = new cmd_tline(ServerInstance);
+               newcommand = new CommandTline(ServerInstance);
                ServerInstance->AddCommand(newcommand);
-       }
 
-       void Implements(char* List)
-       {
        }
 
+
        virtual ~ModuleTLine()
        {
        }