diff options
| author | 2016-02-14 02:11:51 +0000 | |
|---|---|---|
| committer | 2016-02-14 02:11:51 +0000 | |
| commit | 81e6f71199f062a54e6f663f48921c8d763ab4e2 (patch) | |
| tree | 70788211363453a9106df6f236aaecca26cb3b96 /lib/ASM/Util.pm | |
| parent | 2ef56bf45f2fb3726bb84773dbc692174c1fbd39 (diff) | |
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.
Diffstat (limited to 'lib/ASM/Util.pm')
| -rw-r--r-- | lib/ASM/Util.pm | 9 |
1 files changed, 9 insertions, 0 deletions
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]); |
