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 * ---------------------------------------------------
23 #include "helperfuncs.h"
25 /* $ModDesc: Provides support for unreal-style channel mode +Q */
27 class ModuleNoKicks : public Module
33 ModuleNoKicks(Server* Me)
37 Srv->AddExtendedMode('Q',MT_CHANNEL,false,0,0);
40 void Implements(char* List)
42 List[I_On005Numeric] = List[I_OnAccessCheck] = List[I_OnExtendedMode] = 1;
45 virtual void On005Numeric(std::string &output)
47 InsertMode(output,"Q",4);
50 virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type)
52 if (access_type == AC_KICK)
54 if (channel->IsModeSet('Q'))
56 if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!strcmp(source->server,"")))
58 // ulines can still kick with +Q in place
63 // nobody else can (not even opers with override, and founders)
64 WriteServ(source->fd,"484 %s %s :Can't kick user %s from channel (+Q set)",source->nick, channel->name,dest->nick);
72 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
74 // check if this is our mode character...
75 if ((modechar == 'Q') && (type == MT_CHANNEL))
85 virtual ~ModuleNoKicks()
89 virtual Version GetVersion()
91 return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
96 class ModuleNoKicksFactory : public ModuleFactory
99 ModuleNoKicksFactory()
103 ~ModuleNoKicksFactory()
107 virtual Module * CreateModule(Server* Me)
109 return new ModuleNoKicks(Me);
115 extern "C" void * init_module( void )
117 return new ModuleNoKicksFactory;