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]
36 /* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */
41 class cmd_saquit : public command_t
44 cmd_saquit (InspIRCd* Instance) : command_t(Instance,"SAQUIT",'o',2)
46 this->source = "m_saquit.so";
47 syntax = "<nick> <reason>";
50 void Handle (const char** parameters, int pcnt, userrec *user)
52 userrec* dest = ServerInstance->FindNick(parameters[0]);
55 if (ServerInstance->ULine(dest->server))
57 user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
60 std::string line = "";
61 for (int i = 1; i < pcnt - 1; i++)
63 line = line + std::string(parameters[i]) + " ";
65 line = line + std::string(parameters[pcnt-1]);
67 ServerInstance->WriteOpers(std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line);
68 userrec::QuitUser(ServerInstance, dest, line);
73 class ModuleSaquit : public Module
75 cmd_saquit* mycommand;
77 ModuleSaquit(InspIRCd* Me)
81 mycommand = new cmd_saquit(ServerInstance);
82 ServerInstance->AddCommand(mycommand);
85 virtual ~ModuleSaquit()
89 virtual Version GetVersion()
91 return Version(1,0,0,1,VF_VENDOR);
96 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
98 class ModuleSaquitFactory : public ModuleFactory
101 ModuleSaquitFactory()
105 ~ModuleSaquitFactory()
109 virtual Module * CreateModule(InspIRCd* Me)
111 return new ModuleSaquit(Me);
117 extern "C" void * init_module( void )
119 return new ModuleSaquitFactory;