2 * CHGHOST module for InspIRCD
6 * Syntax: /CHGHOST [nick] [new name]
7 * Changes a users DHOST (oper only)
17 /* $ModDesc: Provides support for the CHGHOST command */
21 void handle_chghost(char **parameters, int pcnt, userrec *user)
23 userrec* dest = Srv->FindNick(std::string(parameters[0]));
26 strncpy(dest->dhost,parameters[1],127);
27 Srv->SendOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+std::string(dest->nick)+" become "+std::string(parameters[1]));
32 class ModuleChgHost : public Module
38 Srv->AddCommand("CHGHOST",handle_chghost,'o',2);
41 virtual ~ModuleChgHost()
46 virtual Version GetVersion()
48 return Version(1,0,0,0);
53 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
55 class ModuleChgHostFactory : public ModuleFactory
58 ModuleChgHostFactory()
62 ~ModuleChgHostFactory()
66 virtual Module * CreateModule()
68 return new ModuleChgHost;
74 extern "C" void * init_module( void )
76 return new ModuleChgHostFactory;