]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_swhois.cpp
Fix these to use new hook system (u_listmode wasnt fixed yet)
[user/henk/code/inspircd.git] / src / modules / m_swhois.cpp
index 196c435531d176459491cd567cbd0a4839734d84..5125fbf54a68b072e398278090f088009de24368 100644 (file)
 
 /** Handle /SWHOIS
  */
-class cmd_swhois : public Command
+class CommandSwhois : public Command
 {
        
  public:
-       cmd_swhois (InspIRCd* Instance) : Command(Instance,"SWHOIS",'o',2)
+       CommandSwhois (InspIRCd* Instance) : Command(Instance,"SWHOIS",'o',2)
        {
                this->source = "m_swhois.so";
                syntax = "<nick> <swhois>";
@@ -65,7 +65,7 @@ class cmd_swhois : public Command
                                ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois from '%s' to '%s'", user->nick, dest->nick, text->c_str(), line.c_str());
                        
                        dest->Shrink("swhois");
-                       DELETE(text);
+                       delete text;
                }
                else if (!ServerInstance->ULine(user->server))
                {
@@ -97,7 +97,7 @@ class cmd_swhois : public Command
 
 class ModuleSWhois : public Module
 {
-       cmd_swhois* mycommand;
+       CommandSwhois* mycommand;
        
        ConfigReader* Conf;
        
@@ -106,13 +106,15 @@ class ModuleSWhois : public Module
        {
                
                Conf = new ConfigReader(ServerInstance);
-               mycommand = new cmd_swhois(ServerInstance);
+               mycommand = new CommandSwhois(ServerInstance);
                ServerInstance->AddCommand(mycommand);
+               Implementation eventlist[] = { I_OnDecodeMetaData, I_OnWhoisLine, I_OnSyncUserMetaData, I_OnUserQuit, I_OnCleanup, I_OnRehash, I_OnPostCommand };
+               ServerInstance->Modules->Attach(eventlist, this, 7);
        }
 
        void OnRehash(User* user, const std::string &parameter)
        {
-               DELETE(Conf);
+               delete Conf;
                Conf = new ConfigReader(ServerInstance);
        }
 
@@ -169,7 +171,7 @@ class ModuleSWhois : public Module
                if (swhois)
                {
                        user->Shrink("swhois");
-                       DELETE(swhois);
+                       delete swhois;
                }
        }
 
@@ -184,7 +186,7 @@ class ModuleSWhois : public Module
                        if (swhois)
                        {
                                user->Shrink("swhois");
-                               DELETE(swhois);
+                               delete swhois;
                        }
                }
        }
@@ -248,7 +250,7 @@ class ModuleSWhois : public Module
                if (user->GetExt("swhois", old))
                {
                        user->Shrink("swhois");
-                       DELETE(old);
+                       delete old;
                }
                
                if (!swhois.length())
@@ -267,7 +269,7 @@ class ModuleSWhois : public Module
 
        virtual ~ModuleSWhois()
        {
-               DELETE(Conf);
+               delete Conf;
        }
        
        virtual Version GetVersion()