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 * ---------------------------------------------------
25 /* $ModDesc: Provides support for unreal-style SAPART command */
29 void handle_sapart(char **parameters, int pcnt, userrec *user)
31 userrec* dest = Srv->FindNick(std::string(parameters[0]));
34 for (unsigned int x = 0; x < strlen(parameters[1]); x++)
36 if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ','))
38 Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");
43 Srv->SendOpers(std::string(user->nick)+" used SAPART to make "+std::string(dest->nick)+" part "+parameters[1]);
44 Srv->PartUserFromChannel(dest,std::string(parameters[1]),std::string(dest->nick));
49 class ModuleSapart : public Module
52 ModuleSapart(Server* Me)
56 Srv->AddCommand("SAPART",handle_sapart,'o',2,"m_sapart.so");
59 virtual ~ModuleSapart()
63 virtual Version GetVersion()
65 return Version(1,0,0,1,VF_VENDOR);
70 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
72 class ModuleSapartFactory : public ModuleFactory
79 ~ModuleSapartFactory()
83 virtual Module * CreateModule(Server* Me)
85 return new ModuleSapart(Me);
91 extern "C" void * init_module( void )
93 return new ModuleSapartFactory;