]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
Add initial query support to m_mysql [patch by Athenon]
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index 3f366d0d21cb26485d4eba55a6b6051dce6d3a18..a8cad8d43c47a91dfa7b19f1bdfb4ee4b03496c5 100644 (file)
@@ -22,9 +22,8 @@ class CommandChghost : public Command
  private:
        char* hostmap;
  public:
-       CommandChghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST","o",2), hostmap(hmap)
+       CommandChghost (InspIRCd* Instance, Module* Creator, char* hmap) : Command(Instance,Creator,"CHGHOST","o",2), hostmap(hmap)
        {
-               this->source = "m_chghost.so";
                syntax = "<nick> <newhost>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -65,7 +64,7 @@ class CommandChghost : public Command
                        if ((dest->ChangeDisplayedHost(parameters[1].c_str())) && (!ServerInstance->ULine(user->server)))
                        {
                                // fix by brain - ulines set hosts silently
-                               ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost);
+                               ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost);
                        }
 
                        /* ChangeDisplayedHost fixes it for us */
@@ -81,21 +80,20 @@ class CommandChghost : public Command
 
 class ModuleChgHost : public Module
 {
-       CommandChghost* mycommand;
+       CommandChghost cmd;
        char hostmap[256];
  public:
        ModuleChgHost(InspIRCd* Me)
-               : Module(Me)
+               : Module(Me), cmd(Me, this, hostmap)
        {
-               OnRehash(NULL,"");
-               mycommand = new CommandChghost(ServerInstance, hostmap);
-               ServerInstance->AddCommand(mycommand);
+               OnRehash(NULL);
+               ServerInstance->AddCommand(&cmd);
                Implementation eventlist[] = { I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
 
-       void OnRehash(User* user, const std::string &parameter)
+       void OnRehash(User* user)
        {
                ConfigReader Conf(ServerInstance);
                std::string hmap = Conf.ReadValue("hostname", "charmap", 0);