1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 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 * ---------------------------------------------------
25 /* $ModDesc: Provides support for unreal-style SAPART command */
29 class cmd_sapart : public command_t
32 cmd_sapart () : command_t("SAPART", 'o', 2)
34 this->source = "m_sapart.so";
37 void Handle (char **parameters, int pcnt, userrec *user)
39 userrec* dest = Srv->FindNick(std::string(parameters[0]));
42 if (!IsValidChannelName(parameters[1]))
44 Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");
48 Srv->SendOpers(std::string(user->nick)+" used SAPART to make "+std::string(dest->nick)+" part "+parameters[1]);
49 Srv->PartUserFromChannel(dest,std::string(parameters[1]),std::string(dest->nick));
55 class ModuleSapart : public Module
57 cmd_sapart* mycommand;
59 ModuleSapart(Server* Me)
63 mycommand = new cmd_sapart();
64 Srv->AddCommand(mycommand);
67 virtual ~ModuleSapart()
71 virtual Version GetVersion()
73 return Version(1,0,0,1,VF_VENDOR);
78 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
80 class ModuleSapartFactory : public ModuleFactory
87 ~ModuleSapartFactory()
91 virtual Module * CreateModule(Server* Me)
93 return new ModuleSapart(Me);
99 extern "C" void * init_module( void )
101 return new ModuleSapartFactory;