1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
23 /* $ModDesc: Provides support for SANICK command */
27 void handle_sanick(char **parameters, int pcnt, userrec *user)
29 userrec* source = Srv->FindNick(std::string(parameters[0]));
32 if (Srv->IsNick(std::string(parameters[1])))
34 // FIX by brain: Cant use source->nick here because if it traverses a server link then
35 // source->nick becomes invalid as the object data moves in memory.
36 Srv->SendOpers(std::string(user->nick)+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]);
37 Srv->ChangeUserNick(source,std::string(parameters[1]));
43 class ModuleSanick : public Module
49 Srv->AddCommand("SANICK",handle_sanick,'o',2,"m_sanick.so");
52 virtual ~ModuleSanick()
57 virtual Version GetVersion()
59 return Version(1,0,0,1,VF_VENDOR);
64 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
66 class ModuleSanickFactory : public ModuleFactory
73 ~ModuleSanickFactory()
77 virtual Module * CreateModule()
79 return new ModuleSanick;
85 extern "C" void * init_module( void )
87 return new ModuleSanickFactory;