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 * ---------------------------------------------------
24 #include "helperfuncs.h"
26 /* $ModDesc: Provides support for unreal-style SAPART command */
30 class cmd_sapart : public command_t
33 cmd_sapart () : command_t("SAPART", 'o', 2)
35 this->source = "m_sapart.so";
36 syntax = "<nick> <channel>";
39 void Handle (const char** parameters, int pcnt, userrec *user)
41 userrec* dest = Srv->FindNick(parameters[0]);
42 chanrec* channel = Srv->FindChannel(parameters[1]);
45 if (Srv->IsUlined(dest->server))
47 WriteServ(user->fd,"990 %s :Cannot use an SA command on a u-lined client",user->nick);
50 Srv->SendOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
51 if (!channel->PartUser(dest, dest->nick))
58 class ModuleSapart : public Module
60 cmd_sapart* mycommand;
62 ModuleSapart(Server* Me)
66 mycommand = new cmd_sapart();
67 Srv->AddCommand(mycommand);
70 virtual ~ModuleSapart()
74 virtual Version GetVersion()
76 return Version(1,0,0,1,VF_VENDOR);
81 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
83 class ModuleSapartFactory : public ModuleFactory
90 ~ModuleSapartFactory()
94 virtual Module * CreateModule(Server* Me)
96 return new ModuleSapart(Me);
102 extern "C" void * init_module( void )
104 return new ModuleSapartFactory;