aboutsummaryrefslogtreecommitdiff
path: root/modules/hidechans.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-09-30 17:12:11 +0100
committerGravatar Sadie Powell2024-09-30 17:15:12 +0100
commitd40740062154ae21d1ee0369ae07adafac1c91ea (patch)
tree51ba556a197b5911e0cf32707b861d8918e8e390 /modules/hidechans.cpp
parentFix some warnings when building with Clang. (diff)
parentImplement ldap_initialize on Windows using InternetCrackUrlA. (diff)
Merge branch 'insp4' into master.
Diffstat (limited to 'modules/hidechans.cpp')
-rw-r--r--modules/hidechans.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/hidechans.cpp b/modules/hidechans.cpp
index 36fbbaac8..9afaa872b 100644
--- a/modules/hidechans.cpp
+++ b/modules/hidechans.cpp
@@ -44,7 +44,8 @@ class ModuleHideChans final
, public Whois::LineEventListener
{
private:
- bool AffectsOpers;
+ bool affectsopers;
+ bool hideservices;
HideChans hm;
ModResult ShouldHideChans(LocalUser* source, User* target)
@@ -55,7 +56,10 @@ private:
if (!target->IsModeSet(hm))
return MOD_RES_PASSTHRU; // Mode not set on the target.
- if (!AffectsOpers && source->HasPrivPermission("users/auspex"))
+ 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.
return MOD_RES_DENY;
@@ -72,7 +76,9 @@ public:
void ReadConfig(ConfigStatus& status) override
{
- AffectsOpers = ServerInstance->Config->ConfValue("hidechans")->getBool("affectsopers");
+ 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