1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */
20 class CommandSaquit : public Command
23 CommandSaquit (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "SAQUIT", "o", 2, 2, false, 0)
25 syntax = "<nick> <reason>";
26 TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
29 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
31 User* dest = ServerInstance->FindNick(parameters[0]);
34 if (ServerInstance->ULine(dest->server))
36 user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str());
40 // Pass the command on, so the client's server can quit it properly.
44 ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+parameters[1]);
46 ServerInstance->Users->QuitUser(dest, parameters[1]);
51 user->WriteServ("NOTICE %s :*** Invalid nickname '%s'", user->nick.c_str(), parameters[0].c_str());
58 class ModuleSaquit : public Module
62 ModuleSaquit(InspIRCd* Me)
63 : Module(Me), cmd(Me, this)
65 ServerInstance->AddCommand(&cmd);
68 virtual ~ModuleSaquit()
72 virtual Version GetVersion()
74 return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
79 MODULE_INIT(ModuleSaquit)