]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_opermotd.cpp
Fix these to use new hook system (u_listmode wasnt fixed yet)
[user/henk/code/inspircd.git] / src / modules / m_opermotd.cpp
index ef3ae98c45952acb36d0a9fab6d99d5228adcda0..ec22d1de62ed34684c19a5b9800d4e7251882c39 100644 (file)
@@ -40,10 +40,10 @@ CmdResult ShowOperMOTD(User* user)
 
 /** Handle /OPERMOTD
  */
-class cmd_opermotd : public Command
+class CommandOpermotd : public Command
 {
  public:
-       cmd_opermotd (InspIRCd* Instance) : Command(Instance,"OPERMOTD", 'o', 0)
+       CommandOpermotd (InspIRCd* Instance) : Command(Instance,"OPERMOTD", 'o', 0)
        {
                this->source = "m_opermotd.so";
                syntax = "[<servername>]";
@@ -58,7 +58,7 @@ class cmd_opermotd : public Command
 
 class ModuleOpermotd : public Module
 {
-       cmd_opermotd* mycommand;
+       CommandOpermotd* mycommand;
  public:
 
        void LoadOperMOTD()
@@ -72,17 +72,19 @@ class ModuleOpermotd : public Module
                        opermotd = NULL;
                }
                opermotd = new FileReader(ServerInstance, filename);
-               DELETE(conf);
+               delete conf;
        }
        
        ModuleOpermotd(InspIRCd* Me)
                : Module(Me)
        {
                opermotd = NULL;
-               mycommand = new cmd_opermotd(ServerInstance);
+               mycommand = new CommandOpermotd(ServerInstance);
                ServerInstance->AddCommand(mycommand);
                opermotd = new FileReader(ServerInstance);
                LoadOperMOTD();
+               Implementation eventlist[] = { I_OnRehash, I_OnOper };
+               ServerInstance->Modules->Attach(eventlist, this, 2);
        }
 
        virtual ~ModuleOpermotd()