highlight module: Nicks are not counted uniquely
In doc/reference.conf
, it says:
/*
* mass_highlight_nicks: defines how many nicks can be highlighted in a
* message before the message is blocked. Set to 0 to disable.
*/
# mass_highlight_nicks = 4;
So it says "how many nicks can be highlighted in a message".
But what is_masshl()
in module/m_highlight.c
apparently actually counts are all occurrences of nicks in the message, leading to unexpected behavior, as demonstrated in the below example.
This is an actual message from a client that has been blocked by the server:
<xSh> 17h Assistenzärztin von der Orthoklinik zu Besuch <xSh> Sie hat Spätdienst <Holz> Ah, Quickie vor Schichtbeginn. <xSh> Das ist der Plan. <xSh> Heute ist es soweit [...] <xSh> Das war nichts <xSh> Kein Blowjob <xSh> Handjob als ob Arm gebrochen <xSh> Da ging nichts <xSh> Als Doktor der Medizin muss sie dies doch auch können wollen/müssen
Even though the message only contains two nicks present on the channel (xSh, Holz), it has been blocked:
13:56:24 !irc.rizon.io *** Notice -- Blocked mass highlight from YouTube[YouTube@[...]] to channel #k
It should count the nicks uniquely instead of all occurrences because multiple occurrences of one nick in one message will only ever lead to one highlight for the affected user anyway. This way, it would count the number of possible highlights, and after all this module is about blocking mass highlights. In the example above, the message would only have triggered two possible highlights.
Workaround: Give the client at least +v
on the channel.
Bonus: On top of counting uniquely, perhaps it should be up to the user running the channel to allow or block such messages. This could be controlled via a channel mode such as +H
(Block Mass Highlights), similar to +N
(No Notices) or +C
(No CTCPs).