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 * ---------------------------------------------------
27 /* $ModDesc: Provides support for unreal-style SAPART command */
32 class cmd_sapart : public command_t
35 cmd_sapart (InspIRCd* Instance) : command_t(Instance,"SAPART", 'o', 2)
37 this->source = "m_sapart.so";
38 syntax = "<nick> <channel>";
41 void Handle (const char** parameters, int pcnt, userrec *user)
43 userrec* dest = ServerInstance->FindNick(parameters[0]);
44 chanrec* channel = ServerInstance->FindChan(parameters[1]);
47 if (ServerInstance->ULine(dest->server))
49 user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
52 ServerInstance->WriteOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
53 if (!channel->PartUser(dest, dest->nick))
60 class ModuleSapart : public Module
62 cmd_sapart* mycommand;
64 ModuleSapart(InspIRCd* Me)
68 mycommand = new cmd_sapart(ServerInstance);
69 ServerInstance->AddCommand(mycommand);
72 virtual ~ModuleSapart()
76 virtual Version GetVersion()
78 return Version(1,0,0,1,VF_VENDOR);
83 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
85 class ModuleSapartFactory : public ModuleFactory
92 ~ModuleSapartFactory()
96 virtual Module * CreateModule(InspIRCd* Me)
98 return new ModuleSapart(Me);
104 extern "C" void * init_module( void )
106 return new ModuleSapartFactory;