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 * ---------------------------------------------------
22 /* $ModDesc: Only opers may create new channels if this module is loaded */
26 class ModuleRestrictChans : public Module
34 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
36 // user is not an oper
37 if (!strchr(user->modes,'o'))
39 // channel does not yet exist (record is null, about to be created IF we were to allow it)
42 WriteServ(user->fd,"530 %s %s :Only IRC operators may create new channels",user->nick,cname,cname);
49 virtual ~ModuleRestrictChans()
54 virtual Version GetVersion()
56 return Version(1,0,0,1,VF_VENDOR);
61 class ModuleRestrictChansFactory : public ModuleFactory
64 ModuleRestrictChansFactory()
68 ~ModuleRestrictChansFactory()
72 virtual Module * CreateModule()
74 return new ModuleRestrictChans;
80 extern "C" void * init_module( void )
82 return new ModuleRestrictChansFactory;