From 81e6f71199f062a54e6f663f48921c8d763ab4e2 Mon Sep 17 00:00:00 2001 From: Janik Kleinhoff Date: Sun, 14 Feb 2016 02:11:51 +0000 Subject: splitflood: allow whitelisting certain regex per channel Accessible via editing the config only; this is a feature that is probably only useful to a handful of channels. --- lib/ASM/Util.pm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/ASM/Util.pm') diff --git a/lib/ASM/Util.pm b/lib/ASM/Util.pm index 6372037..4b0137d 100644 --- a/lib/ASM/Util.pm +++ b/lib/ASM/Util.pm @@ -131,6 +131,15 @@ sub mayAlert { return !( ($::channels->{channel}{lc $chan}{monitor} // 'yes') eq 'no' || $module->isSuppressed($chan) ); } +sub isFloodedPhraseOK { + my ($module, $chan, $text) = @_; + + return undef unless exists $::channels->{channel}{$chan}{floodedphraseok}; + my $exempt_regex = $::channels->{channel}{$chan}{floodedphraseok}; + + return $text =~ $exempt_regex; +} + #this item is a stub, dur sub hostip { return gethostbyname($_[0]); -- cgit v1.2.3