1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/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) : Command(Instance, "SAQUIT", "o", 2, false, 0)
25 this->source = "m_saquit.so";
26 syntax = "<nick> <reason>";
27 TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
30 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
32 User* dest = ServerInstance->FindNick(parameters[0]);
35 if (ServerInstance->ULine(dest->server))
37 user->WriteNumeric(990, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str());
41 ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+parameters[1]);
43 // Pass the command on, so the client's server can quit it properly.
47 ServerInstance->Users->QuitUser(dest, parameters[1]);
52 user->WriteServ("NOTICE %s :*** Invalid nickname '%s'", user->nick.c_str(), parameters[0].c_str());
59 class ModuleSaquit : public Module
61 CommandSaquit* mycommand;
63 ModuleSaquit(InspIRCd* Me)
67 mycommand = new CommandSaquit(ServerInstance);
68 ServerInstance->AddCommand(mycommand);
72 virtual ~ModuleSaquit()
76 virtual Version GetVersion()
78 return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
83 MODULE_INIT(ModuleSaquit)