From bc2fa5c4a50ea174f229979f9e060a817dd3a281 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 7 Apr 2021 15:36:15 +0100 Subject: Show all prefix modes in the CHECK onchans output. --- src/modules/m_check.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index f19f610e9..714f0bddd 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -171,7 +171,6 @@ class CommandCheck : public Command User *targuser; Channel *targchan; - std::string chliststr; targuser = ServerInstance->FindNick(parameters[0]); targchan = ServerInstance->FindChan(parameters[0]); @@ -242,13 +241,7 @@ class CommandCheck : public Command for (User::ChanList::iterator i = targuser->chans.begin(); i != targuser->chans.end(); i++) { Membership* memb = *i; - Channel* c = memb->chan; - char prefix = memb->GetPrefixChar(); - if (prefix) - chliststr.push_back(prefix); - chliststr.append(c->name); - chanlist.Add(chliststr); - chliststr.clear(); + chanlist.Add(memb->GetAllPrefixChars() + memb->chan->name); } chanlist.Flush(); -- cgit v1.3.1-10-gc9f91 From 405396945a7a3f8f120ad71386b039edfcae0657 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 11 Apr 2021 14:32:39 +0100 Subject: Allow banning WebIRC users by their gateway name. Closes #1857. --- src/modules/m_cgiirc.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 9ad25e6fb..0759854a2 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -332,6 +332,21 @@ class ModuleCgiIRC ServerInstance->SNO->EnableSnomask('w', "CGIIRC"); } + ModResult OnCheckBan(User* user, Channel*, const std::string& mask) CXX11_OVERRIDE + { + if (mask.length() <= 2 || mask[0] != 'w' || mask[1] != ':') + return MOD_RES_PASSTHRU; + + const std::string* gateway = cmdwebirc.gateway.get(user); + if (!gateway) + return MOD_RES_PASSTHRU; + + if (InspIRCd::Match(*gateway, mask.substr(2))) + return MOD_RES_DENY; + + return MOD_RES_PASSTHRU; + } + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { std::vector identhosts; @@ -516,9 +531,6 @@ class ModuleCgiIRC void OnWhois(Whois::Context& whois) CXX11_OVERRIDE { - if (!whois.IsSelfWhois() && !whois.GetSource()->HasPrivPermission("users/auspex")) - return; - // 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()); -- cgit v1.3.1-10-gc9f91