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 SAJOIN command */
32 class cmd_sajoin : public command_t
35 cmd_sajoin (InspIRCd* Instance) : command_t(Instance,"SAJOIN", 'o', 2)
37 this->source = "m_sajoin.so";
38 syntax = "<nick> <channel>";
41 void Handle (const char** parameters, int pcnt, userrec *user)
43 userrec* dest = ServerInstance->FindNick(parameters[0]);
46 if (ServerInstance->ULine(dest->server))
48 user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
51 if (!ServerInstance->IsChannel(parameters[1]))
53 /* we didn't need to check this for each character ;) */
54 user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");
58 ServerInstance->WriteOpers(std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
59 chanrec::JoinUser(ServerInstance, dest, parameters[1], true);
64 class ModuleSajoin : public Module
66 cmd_sajoin* mycommand;
68 ModuleSajoin(InspIRCd* Me)
72 mycommand = new cmd_sajoin(ServerInstance);
73 ServerInstance->AddCommand(mycommand);
76 virtual ~ModuleSajoin()
80 virtual Version GetVersion()
82 return Version(1,0,0,1,VF_VENDOR);
87 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
89 class ModuleSajoinFactory : public ModuleFactory
96 ~ModuleSajoinFactory()
100 virtual Module * CreateModule(InspIRCd* Me)
102 return new ModuleSajoin(Me);
108 extern "C" void * init_module( void )
110 return new ModuleSajoinFactory;