Merge branch 'insp3' into master.

This commit is contained in:
Sadie Powell 2022-04-01 18:16:33 +01:00
commit c1b53e24d3
3 changed files with 16 additions and 6 deletions

View File

@ -27,6 +27,7 @@
# - users/mass-message: allows opers with this priv to PRIVMSG and NOTICE to a server mask (e.g. NOTICE $*).
# - users/samode-usermodes: allows opers with this priv to change the user modes of any other user using /SAMODE.
# PERMISSIONS:
# - channels/ignore-chanfilter: allows opers with this priv to be immune to channel filters.
# - channels/ignore-delaymsg: allows opers with this priv to be immune to delaymsg restriction on a +d channel.
# - channels/ignore-noctcp: allows opers with this priv to send a CTCP to a +C channel.
# - channels/ignore-nonicks: allows opers with this priv to change their nick when on a +N channel.

View File

@ -36,11 +36,15 @@ ListModeBase::ListModeBase(Module* Creator, const std::string& Name, char modech
void ListModeBase::DisplayList(User* user, Channel* channel)
{
ChanData* cd = extItem.Get(channel);
if (cd)
if (!cd || cd->list.empty())
{
for (const auto& item : cd->list)
user->WriteNumeric(listnumeric, channel->name, item.mask, item.setter, item.time);
this->DisplayEmptyList(user, channel);
return;
}
for (const auto& item : cd->list)
user->WriteNumeric(listnumeric, channel->name, item.mask, item.setter, item.time);
user->WriteNumeric(endoflistnumeric, channel->name, endofliststring);
}

View File

@ -69,9 +69,14 @@ class ModuleChanFilter final
const ChanFilter::ListItem* Match(User* user, Channel* chan, const std::string& text)
{
ModResult res = CheckExemption::Call(exemptionprov, user, chan, "filter");
if (!IS_LOCAL(user) || res == MOD_RES_ALLOW)
return NULL;
if (!IS_LOCAL(user))
return NULL; // We don't handle remote users.
if (user->HasPrivPermission("channels/ignore-chanfilter"))
return NULL; // The source is an exempt server operator.
if (CheckExemption::Call(exemptionprov, user, chan, "filter") == MOD_RES_ALLOW)
return NULL; // The source matches an exemptchanops entry.
ListModeBase::ModeList* list = cf.GetList(chan);
if (!list)