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 unreal-style SAPART command */
27 void handle_sapart(char **parameters, int pcnt, userrec *user)
29 userrec* dest = Srv->FindNick(std::string(parameters[0]));
32 for (int x = 0; x < strlen(parameters[1]); x++)
34 if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ','))
36 Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");
41 Srv->SendOpers(std::string(user->nick)+" used SAPART to make "+std::string(dest->nick)+" part "+parameters[1]);
42 Srv->PartUserFromChannel(dest,std::string(parameters[1]),std::string(dest->nick));
47 class ModuleSapart : public Module
53 Srv->AddCommand("SAPART",handle_sapart,'o',2,"m_sapart.so");
56 virtual ~ModuleSapart()
61 virtual Version GetVersion()
63 return Version(1,0,0,1,VF_VENDOR);
68 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
70 class ModuleSapartFactory : public ModuleFactory
77 ~ModuleSapartFactory()
81 virtual Module * CreateModule()
83 return new ModuleSapart;
89 extern "C" void * init_module( void )
91 return new ModuleSapartFactory;