Added leachim's +qa prefix patch

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5016 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2006-08-25 12:04:32 +00:00
parent eb754aea27
commit 550c076c9a
2 changed files with 30 additions and 9 deletions

View File

@ -517,6 +517,11 @@
# only useful on networks running the m_chanprotect #
# module without services. #
# #
# qaprefixes - If qaprefixes is true, yes, or 1, then users #
# with +q or +a will get the ~ or & prefixes #
# used in unreal. This is only useful on networks #
# running the m_chanprotect module #
# #
# netbuffersize - size of the buffer used to receive data from #
# clients. The ircd may only read() this amount #
# of text in one go at any time. (OPTIONAL) #
@ -608,7 +613,7 @@
# this can save a lot of resources on very busy irc #
# servers. #
# #
# syntaxhints - If et to 'yes', 'true' or '1', when a user does #
# syntaxhints - If set to 'yes', 'true' or '1', when a user does #
# not give enough parameters for a command, a syntax #
# hint will be given (using the RPL_TEXT numeric) #
# as well as the standard ERR_NEEDMOREPARAMS. #
@ -619,6 +624,7 @@
netbuffersize="10240"
maxwho="128"
noservices="0"
qaprefixes="0"
somaxconn="128"
softlimit="128"
operonlystats="oclgkz"

View File

@ -23,7 +23,8 @@
/* $ModDesc: Provides channel modes +a and +q */
#define PROTECT_VALUE 40000
#define FOUNDER_VALUE 50000
const char* fakevalue = "on";
@ -31,7 +32,13 @@ class ChanFounder : public ModeHandler
{
char* dummyptr;
public:
ChanFounder(InspIRCd* Instance) : ModeHandler(Instance, 'q', 1, 1, true, MODETYPE_CHANNEL, false) { }
ChanFounder(InspIRCd* Instance, bool using_prefixes) : ModeHandler(Instance, 'q', 1, 1, true, MODETYPE_CHANNEL, false, using_prefixes ? '~' : 0) { }
unsigned int GetPrefixRank()
{
return FOUNDER_VALUE;
}
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@ -145,7 +152,13 @@ class ChanProtect : public ModeHandler
{
char* dummyptr;
public:
ChanProtect(InspIRCd* Instance) : ModeHandler(Instance, 'a', 1, 1, true, MODETYPE_CHANNEL, false) { }
ChanProtect(InspIRCd* Instance, bool using_prefixes) : ModeHandler(Instance, 'a', 1, 1, true, MODETYPE_CHANNEL, false, using_prefixes ? '&' : 0) { }
unsigned int GetPrefixRank()
{
return PROTECT_VALUE;
}
ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
{
@ -246,6 +259,7 @@ class ModuleChanProtect : public Module
{
bool FirstInGetsFounder;
bool QAPrefixes;
ChanProtect* cp;
ChanFounder* cf;
char* dummyptr;
@ -254,16 +268,16 @@ class ModuleChanProtect : public Module
ModuleChanProtect(InspIRCd* Me) : Module::Module(Me)
{
/* Load config stuff */
OnRehash("");
/* Initialise module variables */
cp = new ChanProtect(ServerInstance);
cf = new ChanFounder(ServerInstance);
cp = new ChanProtect(ServerInstance,QAPrefixes);
cf = new ChanFounder(ServerInstance,QAPrefixes);
ServerInstance->AddMode(cp, 'a');
ServerInstance->AddMode(cf, 'q');
/* Load config stuff */
OnRehash("");
}
void Implements(char* List)
@ -299,6 +313,7 @@ class ModuleChanProtect : public Module
ConfigReader Conf(ServerInstance);
FirstInGetsFounder = Conf.ReadFlag("options","noservices",0);
QAPrefixes = Conf.ReadFlag("options","qaprefixes",0);
}
virtual void OnUserJoin(userrec* user, chanrec* channel)