summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-02 22:30:39 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-02 22:30:39 +0000
commite88a7d6fbeeb509e3af61af9a92a2dd7731118df (patch)
tree4fc549bc840ad692a7009d83cd4977ff3070fad3
parent6a63702d274731e9a8d8f651795d4c4cf4b137b3 (diff)
Remove unload_kludge: this still isn't handled in a very polite way (it uses FakeClient to force removal) but it is tidier than it was. We can only do this now FakeClient is global rather than constantly reinstantiated.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9278 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_chanprotect.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index a1f1fe960..6aa7c5d3b 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -18,12 +18,6 @@
#define PROTECT_VALUE 40000
#define FOUNDER_VALUE 50000
-/* When this is set to true, no restrictions apply to setting or
- * removal of +qa. This is used while unloading so that the server
- * can freely clear all of its users of the modes.
- */
-bool unload_kludge = false;
-
/** Handles basic operation of +qa channel modes
*/
class FounderProtectBase
@@ -71,7 +65,6 @@ class FounderProtectBase
void RemoveMode(Channel* channel, char mc)
{
- unload_kludge = true;
CUList* cl = channel->GetUsers();
std::string item = extend + std::string(channel->name);
const char* mode_junk[MAXMODES+2];
@@ -95,8 +88,6 @@ class FounderProtectBase
}
MyInstance->SendMode(mode_junk, stackresult.size() + 1, MyInstance->FakeClient);
}
-
- unload_kludge = false;
}
void DisplayList(User* user, Channel* channel)
@@ -199,7 +190,12 @@ class ChanFounder : public ModeHandler, public FounderProtectBase
return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter);
}
// source is a server, or ulined, we'll let them +-q the user.
- if ((unload_kludge) || ((source == theuser) && (!adding) && (FounderProtectBase::remove_own_privs)) || (ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server) || (!IS_LOCAL(source)))
+ if (source == ServerInstance->FakeClient ||
+ ((source == theuser) && (!adding) && (FounderProtectBase::remove_own_privs)) ||
+ (ServerInstance->ULine(source->nick)) ||
+ (ServerInstance->ULine(source->server)) ||
+ (!*source->server) ||
+ (!IS_LOCAL(source)))
{
return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter);
}
@@ -261,7 +257,13 @@ class ChanProtect : public ModeHandler, public FounderProtectBase
return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter);
}
// source has +q, is a server, or ulined, we'll let them +-a the user.
- if ((unload_kludge) || ((source == theuser) && (!adding) && (FounderProtectBase::remove_own_privs)) || (ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server) || (source->GetExt(founder,dummyptr)) || (!IS_LOCAL(source)))
+ if (source == ServerInstance->FakeClient ||
+ ((source == theuser) && (!adding) && (FounderProtectBase::remove_own_privs)) ||
+ (ServerInstance->ULine(source->nick)) ||
+ (ServerInstance->ULine(source->server)) ||
+ (!*source->server) ||
+ (source->GetExt(founder,dummyptr)) ||
+ (!IS_LOCAL(source)))
{
return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter);
}