]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
Patch to fix timedbans crash reported earlier today, thanks for the headsup wonderwal
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index 266d3cb3b1e46334a107a6468764db9df0b9410c..e067bd78b29688a8437c9f447e9ad5418a8cba7b 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,14 +22,14 @@ class CommandChghost : public Command
  private:
        char* hostmap;
  public:
-       CommandChghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST",'o',2), hostmap(hmap)
+       CommandChghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST","o",2), hostmap(hmap)
        {
                this->source = "m_chghost.so";
                syntax = "<nick> <newhost>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
  
-       CmdResult Handle(const char** parameters, int pcnt, User *user)
+       CmdResult Handle(const char* const* parameters, int pcnt, User *user)
        {
                const char * x = parameters[1];
 
@@ -56,14 +56,14 @@ class CommandChghost : public Command
 
                if (!dest)
                {
-                       user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]);
+                       user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick, parameters[0]);
                        return CMD_FAILURE;
                }
 
                if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->ULine(user->server)))
                {
                        // fix by brain - ulines set hosts silently
-                       ServerInstance->WriteOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost);
+                       ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost);
                }
 
                /* route it! */
@@ -108,7 +108,7 @@ class ModuleChgHost : public Module
        
        Version GetVersion()
        {
-               return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
        }
        
 };