]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_watch.cpp
Fix these to use new hook system (u_listmode wasnt fixed yet)
[user/henk/code/inspircd.git] / src / modules / m_watch.cpp
index 6cc96d0f9c241a022cfa993c2a87fcff61486300..57799db51f8d66220153ba2d7fdd8add746dbacc 100644 (file)
@@ -76,7 +76,7 @@ watchentries* whos_watching_me;
 
 /** Handle /WATCH
  */
-class cmd_watch : public Command
+class CommandWatch : public Command
 {
        unsigned int& MAX_WATCH;
  public:
@@ -192,7 +192,7 @@ class cmd_watch : public Command
                return CMD_FAILURE;
        }
 
-       cmd_watch (InspIRCd* Instance, unsigned int &maxwatch) : Command(Instance,"WATCH",0,0), MAX_WATCH(maxwatch)
+       CommandWatch (InspIRCd* Instance, unsigned int &maxwatch) : Command(Instance,"WATCH",0,0), MAX_WATCH(maxwatch)
        {
                this->source = "m_watch.so";
                syntax = "[C|L|S]|[+|-<nick>]";
@@ -301,7 +301,7 @@ class cmd_watch : public Command
 
 class Modulewatch : public Module
 {
-       cmd_watch* mycommand;
+       CommandWatch* mycommand;
        unsigned int maxwatch;
  public:
 
@@ -310,8 +310,10 @@ class Modulewatch : public Module
        {
                OnRehash(NULL, "");
                whos_watching_me = new watchentries();
-               mycommand = new cmd_watch(ServerInstance, maxwatch);
+               mycommand = new CommandWatch(ServerInstance, maxwatch);
                ServerInstance->AddCommand(mycommand);
+               Implementation eventlist[] = { I_OnRehash, I_OnGarbageCollect, I_OnCleanup, I_OnUserQuit, I_OnPostConnect, I_OnUserPostNick, I_On005Numeric };
+               ServerInstance->Modules->Attach(eventlist, this, 7);
        }
 
        virtual void OnRehash(User* user, const std::string &parameter)