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 * ---------------------------------------------------
20 * SAQUIT module for InspIRCd
24 * Syntax: /SAQUIT <user> [reason]
25 * Makes it appear as though <user> has /quit with [reason]
35 /* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */
39 void handle_saquit(char **parameters, int pcnt, userrec *user)
41 userrec* dest = Srv->FindNick(std::string(parameters[0]));
44 std::string line = "";
45 for (int i = 1; i < pcnt - 1; i++)
47 line = line + std::string(parameters[i]) + " ";
49 line = line + std::string(parameters[pcnt-1]);
51 Srv->SendOpers(std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line);
52 Srv->QuitUser(dest, line);
57 class ModuleSaquit : public Module
60 ModuleSaquit(Server* Me)
64 Srv->AddCommand("SAQUIT",handle_saquit,'o',2,"m_saquit.so");
67 virtual ~ModuleSaquit()
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 ModuleSaquitFactory : public ModuleFactory
87 ~ModuleSaquitFactory()
91 virtual Module * CreateModule(Server* Me)
93 return new ModuleSaquit(Me);
99 extern "C" void * init_module( void )
101 return new ModuleSaquitFactory;