summaryrefslogtreecommitdiff
path: root/src/modules/m_chanprotect.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-22 15:02:37 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-22 15:02:37 +0000
commit6a88b90b036f3cfc21d45eb76d1ae3e767b8ac5c (patch)
tree8f1a4e27b8491e69163b32e6688e8e7e7efee362 /src/modules/m_chanprotect.cpp
parentc68d2cb200c01b95017cf88d8b4f0fb96d5e97b8 (diff)
Fix bug #659, #524 and others: Allow operoverride to set +qa. Based on patch by Phoenix. Note that this is currently untested, feedback is very welcome.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10979 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_chanprotect.cpp')
-rw-r--r--src/modules/m_chanprotect.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index cbb59948d..892c18bd1 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -12,6 +12,7 @@
*/
#include "inspircd.h"
+#include "m_override.h"
/* $ModDesc: Provides channel modes +a and +q */
@@ -193,13 +194,23 @@ class ChanFounder : public ModeHandler, public FounderProtectBase
{
return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter);
}
+
+ char isoverride=0;
+ Module *Override = ServerInstance->Modules->FindFeature("Override");
+ if (Override)
+ {
+ OVRrequest ovr(NULL,Override,source,"OTHERMODE");
+ const char * tmp = ovr.Send();
+ isoverride = tmp[0];
+ }
// source is a server, or ulined, we'll let them +-q the user.
if (source == ServerInstance->FakeClient ||
((source == theuser) && (!adding) && (FounderProtectBase::remove_own_privs)) ||
(ServerInstance->ULine(source->nick.c_str())) ||
(ServerInstance->ULine(source->server)) ||
(!*source->server) ||
- (!IS_LOCAL(source)))
+ (!IS_LOCAL(source)) ||
+ isoverride)
{
return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter);
}
@@ -259,6 +270,15 @@ class ChanProtect : public ModeHandler, public FounderProtectBase
{
return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter);
}
+
+ char isoverride=0;
+ Module *Override = ServerInstance->Modules->FindFeature("Override");
+ if (Override)
+ {
+ OVRrequest ovr(NULL,Override,source,"OTHERMODE");
+ const char * tmp = ovr.Send();
+ isoverride = tmp[0];
+ }
// source has +q, is a server, or ulined, we'll let them +-a the user.
if (source == ServerInstance->FakeClient ||
((source == theuser) && (!adding) && (FounderProtectBase::remove_own_privs)) ||
@@ -266,7 +286,9 @@ class ChanProtect : public ModeHandler, public FounderProtectBase
(ServerInstance->ULine(source->server)) ||
(!*source->server) ||
(source->GetExt(founder)) ||
- (!IS_LOCAL(source)))
+ (!IS_LOCAL(source)) ||
+ isoverride
+ )
{
return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter);
}