]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
No gaurantees this works AT ALL. do not use yet!!!
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index 0ec88d7e1e11d74f27025e4c6917a41a044bb2a5..4b53e7c12f6cafc8f479eb8a4e6d4ce2ed8d0ed7 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 cmd_chghost : public Command
 {
  private:
        char* hostmap;
  public:
-       cmd_chghost (InspIRCd* Instance, char* hmap) : command_t(Instance,"CHGHOST",'o',2), hostmap(hmap)
+       cmd_chghost (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)
                {
@@ -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);
        }
        
 };