1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 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 class cmd_saquit : public command_t
42 cmd_saquit () : command_t("SAQUIT",'o',2)
44 this->source = "m_saquit.so";
45 syntax = "<nick> <reason>";
48 void Handle (const char** parameters, int pcnt, userrec *user)
50 userrec* dest = Srv->FindNick(std::string(parameters[0]));
53 if (Srv->IsUlined(dest->server))
55 WriteServ(user->fd,"990 %s :Cannot use an SA command on a u-lined client",user->nick);
58 std::string line = "";
59 for (int i = 1; i < pcnt - 1; i++)
61 line = line + std::string(parameters[i]) + " ";
63 line = line + std::string(parameters[pcnt-1]);
65 Srv->SendOpers(std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line);
66 Srv->QuitUser(dest, line);
71 class ModuleSaquit : public Module
73 cmd_saquit* mycommand;
75 ModuleSaquit(Server* Me)
79 mycommand = new cmd_saquit();
80 Srv->AddCommand(mycommand);
83 virtual ~ModuleSaquit()
87 virtual Version GetVersion()
89 return Version(1,0,0,1,VF_VENDOR);
94 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
96 class ModuleSaquitFactory : public ModuleFactory
103 ~ModuleSaquitFactory()
107 virtual Module * CreateModule(Server* Me)
109 return new ModuleSaquit(Me);
115 extern "C" void * init_module( void )
117 return new ModuleSaquitFactory;