summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/cs_set.cpp1
-rw-r--r--modules/pseudoclients/chanserv.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp
index 4ade813c1..5769adb30 100644
--- a/modules/commands/cs_set.cpp
+++ b/modules/commands/cs_set.cpp
@@ -1319,6 +1319,7 @@ class CSSet : public Module
if (noautoop.HasExt(chan->ci))
give_modes = false;
if (secureops.HasExt(chan->ci))
+ // This overrides what chanserv does because it is loaded after chanserv
take_modes = true;
}
}
diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp
index 3e066527e..388a14649 100644
--- a/modules/pseudoclients/chanserv.cpp
+++ b/modules/pseudoclients/chanserv.cpp
@@ -457,6 +457,17 @@ class ChanServCore : public Module, public ChanServService
if (!ci->HasExt("CS_NO_EXPIRE") && chanserv_expire && !Anope::NoExpire && ci->last_used != Anope::CurTime)
info[_("Expires")] = Anope::strftime(ci->last_used + chanserv_expire, source.GetAccount());
}
+
+ void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) anope_override
+ {
+ if (always_lower)
+ // Since we always lower the TS, the other side will remove the modes if the channel ts lowers, so we don't
+ // have to worry about it
+ take_modes = false;
+ else if (ModeManager::FindChannelModeByName("REGISTERED"))
+ // Otherwise if the registered channel mode exists, we should remove modes if the channel is not +r
+ take_modes = !chan->HasMode("REGISTERED");
+ }
};
MODULE_INIT(ChanServCore)