From 550c076c9abdcff0751ae10a5e4e66aff22db714 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 25 Aug 2006 12:04:32 +0000 Subject: Added leachim's +qa prefix patch git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5016 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_chanprotect.cpp | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 832798b1f..e5df3e1ca 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -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 ¶meter) { @@ -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 ¶meter) { @@ -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) -- cgit v1.2.3