summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-04-11 15:03:06 +0100
committerSadie Powell <sadie@witchery.services>2021-04-11 15:03:06 +0100
commitb00cf4ca15d992623720b24a9c2487d41be8d6cb (patch)
tree1901dab89f75391d06835f432cf4db39d8a4bfa8 /src
parent405396945a7a3f8f120ad71386b039edfcae0657 (diff)
Only show the WebIRC gateway name to unprivileged users.
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_cgiirc.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 0759854a2..434043e46 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -532,11 +532,16 @@ class ModuleCgiIRC
void OnWhois(Whois::Context& whois) CXX11_OVERRIDE
{
// If these fields are not set then the client is not using a gateway.
- const std::string* realhost = cmdwebirc.realhost.get(whois.GetTarget());
- const std::string* realip = cmdwebirc.realip.get(whois.GetTarget());
+ std::string* realhost = cmdwebirc.realhost.get(whois.GetTarget());
+ std::string* realip = cmdwebirc.realip.get(whois.GetTarget());
if (!realhost || !realip)
return;
+ // If the source doesn't have the right privs then only show the gateway name.
+ std::string hidden = "*";
+ if (!whois.GetSource()->HasPrivPermission("users/auspex"))
+ realhost = realip = &hidden;
+
const std::string* gateway = cmdwebirc.gateway.get(whois.GetTarget());
if (gateway)
whois.SendLine(RPL_WHOISGATEWAY, *realhost, *realip, "is connected via the " + *gateway + " WebIRC gateway");