]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
More AddModes fixes
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index 0ec88d7e1e11d74f27025e4c6917a41a044bb2a5..e13dc1c311116c73e2b20f42719f9ead20b541f0 100644 (file)
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /* $ModDesc: Provides support for the CHGHOST command */
 
 /** Handle /CHGHOST
  */
-class cmd_chghost : public command_t
+class CommandChghost : public Command
 {
  private:
        char* hostmap;
  public:
-       cmd_chghost (InspIRCd* Instance, char* hmap) : command_t(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, userrec *user)
+       CmdResult Handle(const char** parameters, int pcnt, User *user)
        {
                const char * x = parameters[1];
 
@@ -54,7 +52,7 @@ class cmd_chghost : public command_t
                        user->WriteServ("NOTICE %s :*** CHGHOST: Host too long", user->nick);
                        return CMD_FAILURE;
                }
-               userrec* dest = ServerInstance->FindNick(parameters[0]);
+               User* dest = ServerInstance->FindNick(parameters[0]);
 
                if (!dest)
                {
@@ -77,14 +75,14 @@ class cmd_chghost : public command_t
 
 class ModuleChgHost : public Module
 {
-       cmd_chghost* mycommand;
+       CommandChghost* mycommand;
        char hostmap[256];
  public:
        ModuleChgHost(InspIRCd* Me)
                : Module(Me)
        {
                OnRehash(NULL,"");
-               mycommand = new cmd_chghost(ServerInstance, hostmap);
+               mycommand = new CommandChghost(ServerInstance, hostmap);
                ServerInstance->AddCommand(mycommand);
        }
 
@@ -93,7 +91,7 @@ class ModuleChgHost : public Module
                List[I_OnRehash] = 1;
        }
        
-       void OnRehash(userrec* user, const std::string &parameter)
+       void OnRehash(User* user, const std::string &parameter)
        {
                ConfigReader Conf(ServerInstance);
                std::string hmap = Conf.ReadValue("hostname", "charmap", 0);
@@ -112,7 +110,7 @@ class ModuleChgHost : public Module
        
        Version GetVersion()
        {
-               return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
+               return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
        }
        
 };