summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-25 12:04:32 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-25 12:04:32 +0000
commit550c076c9abdcff0751ae10a5e4e66aff22db714 (patch)
treeaeb5e01199398dfba446be4b299a7d43674817c0 /src
parenteb754aea2728a00734e2051bca6fd9651d92c4a2 (diff)
Added leachim's +qa prefix patch
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5016 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_chanprotect.cpp31
1 files changed, 23 insertions, 8 deletions
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 &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)