aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-09-22 14:38:19 +0100
committerGravatar Sadie Powell2024-09-22 14:38:19 +0100
commit43a5068798cd8ca4b1e4f31a17d330c6dff35a91 (patch)
tree655579a30c4a533aa9917571b25102bb017ea302 /src/modules
parentRefactor hidechans slightly. (diff)
Hide the channels of services pseudoclient with +I from opers too.
Closes #2106.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_hidechans.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp
index da3caa552..9afaa872b 100644
--- a/src/modules/m_hidechans.cpp
+++ b/src/modules/m_hidechans.cpp
@@ -45,6 +45,7 @@ class ModuleHideChans final
{
private:
bool affectsopers;
+ bool hideservices;
HideChans hm;
ModResult ShouldHideChans(LocalUser* source, User* target)
@@ -55,6 +56,9 @@ private:
if (!target->IsModeSet(hm))
return MOD_RES_PASSTHRU; // Mode not set on the target.
+ if (hideservices && target->server->IsService())
+ return MOD_RES_DENY; // Nobody is allowed to see services not even opers.
+
if (!affectsopers && source->HasPrivPermission("users/auspex"))
return MOD_RES_PASSTHRU; // Opers aren't exempt or the oper doesn't have the right priv.
@@ -74,6 +78,7 @@ public:
{
const auto& tag = ServerInstance->Config->ConfValue("hidechans");
affectsopers = tag->getBool("affectsopers");
+ hideservices = tag->getBool("hideservices", true);
}
ModResult OnWhoVisible(const Who::Request& request, LocalUser* source, Membership* memb) override