2 * SAQUIT module for InspIRCd
6 * Syntax: /SAQUIT <user> [reason]
7 * Makes it appear as though <user> has /quit with [reason]
17 /* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */
21 void handle_saquit(char **parameters, int pcnt, userrec *user)
23 userrec* dest = Srv->FindNick(std::string(parameters[0]));
26 std::string line = "";
27 for (int i = 1; i < pcnt - 1; i++)
29 line = line + std::string(parameters[i]) + " ";
31 line = line + std::string(parameters[pcnt-1]);
33 Srv->SendOpers(std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line);
34 Srv->QuitUser(dest, line);
39 class ModuleSaquit : public Module
45 Srv->AddCommand("SAQUIT",handle_saquit,'o',2);
48 virtual ~ModuleSaquit()
53 virtual Version GetVersion()
55 return Version(1,0,0,0);
60 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
62 class ModuleSaquitFactory : public ModuleFactory
69 ~ModuleSaquitFactory()
73 virtual Module * CreateModule()
75 return new ModuleSaquit;
81 extern "C" void * init_module( void )
83 return new ModuleSaquitFactory;