1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 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 * ---------------------------------------------------
23 /* $ModDesc: Provides support for unreal-style SAJOIN command */
27 void handle_sajoin(char **parameters, int pcnt, userrec *user)
29 userrec* dest = Srv->FindNick(std::string(parameters[0]));
33 for (int x = 0; x < strlen(parameters[1]); x++)
35 if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ','))
37 Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name");
42 Srv->SendOpers(std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]);
43 Srv->JoinUserToChannel(dest,std::string(parameters[1]),std::string(dest->nick));
48 class ModuleSajoin : public Module
54 Srv->AddCommand("SAJOIN",handle_sajoin,'o',2,"m_sajoin.so");
57 virtual ~ModuleSajoin()
62 virtual Version GetVersion()
64 return Version(1,0,0,1,VF_VENDOR);
69 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
71 class ModuleSajoinFactory : public ModuleFactory
78 ~ModuleSajoinFactory()
82 virtual Module * CreateModule()
84 return new ModuleSajoin;
90 extern "C" void * init_module( void )
92 return new ModuleSajoinFactory;