]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sethost.cpp
Commit patch from danieldg that makes a ton of stuff const-safe for latest warn-happy...
[user/henk/code/inspircd.git] / src / modules / m_sethost.cpp
index 87b88666102b36fcf4666b78880edcb1472dcab9..2410f4140062bb619d09292de25b401f59579734 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
@@ -22,7 +22,7 @@ class CommandSethost : public Command
  private:
        char* hostmap;
  public:
-       CommandSethost (InspIRCd* Instance, char* hmap) : Command(Instance,"SETHOST",'o',1), hostmap(hmap)
+       CommandSethost (InspIRCd* Instance, char* hmap) : Command(Instance,"SETHOST","o",1), hostmap(hmap)
        {
                this->source = "m_sethost.so";
                syntax = "<new-hostname>";
@@ -52,7 +52,7 @@ class CommandSethost : public Command
                }
                if (user->ChangeDisplayedHost(parameters[0]))
                {
-                       ServerInstance->WriteOpers(std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost);
+                       ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost);
                        return CMD_SUCCESS;
                }
 
@@ -72,12 +72,10 @@ class ModuleSetHost : public Module
                OnRehash(NULL,"");
                mycommand = new CommandSethost(ServerInstance, hostmap);
                ServerInstance->AddCommand(mycommand);
+               Implementation eventlist[] = { I_OnRehash };
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnRehash] = 1;
-       }
 
        void OnRehash(User* user, const std::string &parameter)
        {