diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-25 12:04:32 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-25 12:04:32 +0000 |
commit | 550c076c9abdcff0751ae10a5e4e66aff22db714 (patch) | |
tree | aeb5e01199398dfba446be4b299a7d43674817c0 | |
parent | eb754aea2728a00734e2051bca6fd9651d92c4a2 (diff) |
Added leachim's +qa prefix patch
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5016 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | docs/inspircd.conf.example | 8 | ||||
-rw-r--r-- | src/modules/m_chanprotect.cpp | 31 |
2 files changed, 30 insertions, 9 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example index e6f5d8ea1..3cd1536e5 100644 --- a/docs/inspircd.conf.example +++ b/docs/inspircd.conf.example @@ -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" 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) |