about summary refs log tree commit homepage
path: root/lib/PublicInbox/WatchMaildir.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-18 03:38:46 +0000
committerEric Wong <e@yhbt.net>2020-04-19 08:51:17 +0000
commit0f6b0cac5bf10d036a84dbab732e8991edf56c34 (patch)
tree043acb6313f02f5c3e934cdd48a7730c375defb7 /lib/PublicInbox/WatchMaildir.pm
parentd0147582e289fdd4cdd84e91d8b0f8ae9c230124 (diff)
downloadpublic-inbox-0f6b0cac5bf10d036a84dbab732e8991edf56c34.tar.gz
There's nothing Maildir-specific about the function, so
`maildir_path_load' was a bad name.  So give it a more
appropriate name and use it in our tests.

This save ourselves some code and inconsistency by reusing an
existing internal library routine in more places.  We can drop
the "From_" line in some of our (formerly) mbox sample files.
Diffstat (limited to 'lib/PublicInbox/WatchMaildir.pm')
-rw-r--r--lib/PublicInbox/WatchMaildir.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm
index e2024640..bea2ed2a 100644
--- a/lib/PublicInbox/WatchMaildir.pm
+++ b/lib/PublicInbox/WatchMaildir.pm
@@ -11,7 +11,7 @@ use PublicInbox::InboxWritable;
 use File::Temp 0.19 (); # 0.19 for ->newdir
 use PublicInbox::Filter::Base qw(REJECT);
 use PublicInbox::Spamcheck;
-*maildir_path_load = *PublicInbox::InboxWritable::maildir_path_load;
+*mime_from_path = \&PublicInbox::InboxWritable::mime_from_path;
 
 sub new {
         my ($class, $config) = @_;
@@ -123,7 +123,7 @@ sub _remove_spam {
         my ($self, $path) = @_;
         # path must be marked as (S)een
         $path =~ /:2,[A-R]*S[T-Za-z]*\z/ or return;
-        my $mime = maildir_path_load($path) or return;
+        my $mime = mime_from_path($path) or return;
         $self->{config}->each_inbox(sub {
                 my ($ibx) = @_;
                 eval {
@@ -165,7 +165,7 @@ sub _try_path {
                 $warn_cb->(@_);
         };
         foreach my $ibx (@$inboxes) {
-                my $mime = maildir_path_load($path) or next;
+                my $mime = mime_from_path($path) or next;
                 my $im = _importer_for($self, $ibx);
 
                 # any header match means it's eligible for the inbox: