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 #include "helperfuncs.h"
25 /* $ModDesc: Only opers may create new channels if this module is loaded */
29 class ModuleRestrictChans : public Module
37 virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
39 // user is not an oper
40 if (!strchr(user->modes,'o'))
42 // channel does not yet exist (record is null, about to be created IF we were to allow it)
45 WriteServ(user->fd,"530 %s %s :Only IRC operators may create new channels",user->nick,cname,cname);
52 virtual ~ModuleRestrictChans()
57 virtual Version GetVersion()
59 return Version(1,0,0,1,VF_VENDOR);
64 class ModuleRestrictChansFactory : public ModuleFactory
67 ModuleRestrictChansFactory()
71 ~ModuleRestrictChansFactory()
75 virtual Module * CreateModule()
77 return new ModuleRestrictChans;
83 extern "C" void * init_module( void )
85 return new ModuleRestrictChansFactory;