]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_operlog.cpp
Move options vlaues netbuffersize, maxwho, maxconn, softlimit, quietbursts, nouserdns...
[user/henk/code/inspircd.git] / src / modules / m_operlog.cpp
index b02689704e8beed68dc59861ff503f3295d0f664..aa7923be9d000bd1657cf4ddafd94ea3eb8f8ea0 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
@@ -23,6 +23,8 @@ class ModuleOperLog : public Module
        ModuleOperLog(InspIRCd* Me) : Module(Me)
        {
                
+               Implementation eventlist[] = { I_OnPreCommand, I_On005Numeric };
+               ServerInstance->Modules->Attach(eventlist, this, 2);
        }
  
        virtual ~ModuleOperLog()
@@ -31,15 +33,11 @@ class ModuleOperLog : public Module
  
        virtual Version GetVersion()
        {
-               return Version(1,1,0,0,VF_VENDOR,API_VERSION);
+               return Version(1,2,0,0,VF_VENDOR,API_VERSION);
        }
  
-       void Implements(char* List)
-       {
-               List[I_OnPreCommand] = List[I_On005Numeric] = 1;
-       }
 
-       virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line)
+       virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line)
        {
                /* If the command doesnt appear to be valid, we dont want to mess with it. */
                if (!validated)
@@ -47,14 +45,14 @@ class ModuleOperLog : public Module
  
                if ((IS_OPER(user)) && (IS_LOCAL(user)) && (user->HasPermission(command)))
                {
-                       command_t* thiscommand = ServerInstance->Parser->GetHandler(command);
+                       Command* thiscommand = ServerInstance->Parser->GetHandler(command);
                        if ((thiscommand) && (thiscommand->flags_needed == 'o'))
                        {
                                std::string plist;
                                for (int j = 0; j < pcnt; j++)
                                        plist.append(std::string(" ")+std::string(parameters[j]));
 
-                               ServerInstance->Log(DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str());
+                               ServerInstance->Logs->Log("m_operlog",DEFAULT,"OPERLOG: [%s!%s@%s] %s%s",user->nick,user->ident,user->host,command.c_str(),plist.c_str());
                        }
                }