summaryrefslogtreecommitdiff
path: root/src/modules/m_denychans.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-06-18 18:30:10 +0200
committerattilamolnar <attilamolnar@hush.com>2013-07-19 19:40:03 +0200
commitb954283ccc4253a6881513bbe7f743c39886d3b7 (patch)
tree56386d71e6132d06e8e4e786fba867a4945114b1 /src/modules/m_denychans.cpp
parent5288eb159451aea53168c1a812a72594801f6421 (diff)
Replace hardcoded mode letters, part 2
This changes all remaining Channel::IsModeSet() and Channel::GetModeParameter() calls to use ModeReferences for modes that were created by other modules or the core
Diffstat (limited to 'src/modules/m_denychans.cpp')
-rw-r--r--src/modules/m_denychans.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp
index 0b82d0750..60af0e391 100644
--- a/src/modules/m_denychans.cpp
+++ b/src/modules/m_denychans.cpp
@@ -24,7 +24,14 @@
class ModuleDenyChannels : public Module
{
+ ChanModeReference redirectmode;
+
public:
+ ModuleDenyChannels()
+ : redirectmode(this, "redirect")
+ {
+ }
+
void init() CXX11_OVERRIDE
{
Implementation eventlist[] = { I_OnUserPreJoin, I_OnRehash };
@@ -110,7 +117,7 @@ class ModuleDenyChannels : public Module
{
/* simple way to avoid potential loops: don't redirect to +L channels */
Channel *newchan = ServerInstance->FindChan(redirect);
- if ((!newchan) || (!(newchan->IsModeSet('L'))))
+ if ((!newchan) || (!newchan->IsModeSet(redirectmode)))
{
user->WriteNumeric(926, "%s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick.c_str(),cname.c_str(),cname.c_str(),redirect.c_str(), reason.c_str());
Channel::JoinUser(user, redirect);