1 // Sapart and +g support module by C.J.Edwards
9 /* $ModDesc: Provides support for unreal-style SAPART command */
13 void handle_sapart(char **parameters, int pcnt, userrec *user)
15 userrec* dest = Srv->FindNick(std::string(parameters[0]));
18 for (int x = 0; x < strlen(parameters[1]); x++)
20 if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ','))
22 Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");
27 Srv->SendOpers(std::string(user->nick)+" used SAPART to make "+std::string(dest->nick)+" part "+parameters[1]);
28 Srv->PartUserFromChannel(dest,std::string(parameters[1]),std::string(dest->nick));
33 class ModuleSapart : public Module
39 Srv->AddCommand("SAPART",handle_sapart,'o',2);
42 virtual ~ModuleSapart()
47 virtual Version GetVersion()
49 return Version(1,0,0,1);
54 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
56 class ModuleSapartFactory : public ModuleFactory
63 ~ModuleSapartFactory()
67 virtual Module * CreateModule()
69 return new ModuleSapart;
75 extern "C" void * init_module( void )
77 return new ModuleSapartFactory;