diff options
author | Eric Wong <e@80x24.org> | 2023-03-13 19:38:26 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-03-14 20:51:01 +0000 |
commit | 4e6e53f81be65deb261dad0ab7574acbd27cbc7d (patch) | |
tree | 1914622d3c0f70c210af3b35afdba6f02b169712 /lib/PublicInbox/Spamcheck.pm | |
parent | 3a2c46e6f7bf650e69cf7c7b9e3d62843e6deab9 (diff) | |
download | public-inbox-4e6e53f81be65deb261dad0ab7574acbd27cbc7d.tar.gz |
No problems with `unicode_strings' in these modules. We can also shave our LoC count in a few places.
Diffstat (limited to 'lib/PublicInbox/Spamcheck.pm')
-rw-r--r-- | lib/PublicInbox/Spamcheck.pm | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/PublicInbox/Spamcheck.pm b/lib/PublicInbox/Spamcheck.pm index d8fa80c8..fbf9355d 100644 --- a/lib/PublicInbox/Spamcheck.pm +++ b/lib/PublicInbox/Spamcheck.pm @@ -1,21 +1,17 @@ -# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # Spamchecking used by -watch and -mda tools package PublicInbox::Spamcheck; -use strict; -use warnings; +use v5.12; sub get { my ($cfg, $key, $default) = @_; - my $spamcheck = $cfg->{$key}; - $spamcheck = $default unless $spamcheck; + my $spamcheck = $cfg->{$key} || $default; return if !$spamcheck || $spamcheck eq 'none'; - if ($spamcheck eq 'spamc') { - $spamcheck = 'PublicInbox::Spamcheck::Spamc'; - } + $spamcheck = 'PublicInbox::Spamcheck::Spamc' if $spamcheck eq 'spamc'; if ($spamcheck =~ /::/) { eval "require $spamcheck"; return $spamcheck->new; |