about summary refs log tree commit homepage
path: root/lib/PublicInbox/Watch.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-21 07:41:33 +0000
committerEric Wong <e@80x24.org>2021-02-21 08:59:32 +0000
commit9dafc7333ee43a77ad18629d1e30195b4a7ea482 (patch)
tree764810fcacfd989a0984cc77118482bda5fe0cf3 /lib/PublicInbox/Watch.pm
parent707d4aca2256f284718c247ef00db64cd976d244 (diff)
downloadpublic-inbox-9dafc7333ee43a77ad18629d1e30195b4a7ea482.tar.gz
This flexibility should save us some code down-the-line.
Diffstat (limited to 'lib/PublicInbox/Watch.pm')
-rw-r--r--lib/PublicInbox/Watch.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/PublicInbox/Watch.pm b/lib/PublicInbox/Watch.pm
index c64689a1..8d13ea35 100644
--- a/lib/PublicInbox/Watch.pm
+++ b/lib/PublicInbox/Watch.pm
@@ -60,9 +60,9 @@ sub new {
                         if (is_maildir($dir)) {
                                 # skip "new", no MUA has seen it, yet.
                                 $mdmap{"$dir/cur"} = 'watchspam';
-                        } elsif ($url = imap_url($dir)) {
-                                $imap{$url} = 'watchspam';
-                                push @imap, $url;
+                        } elsif (my $uri = imap_uri($dir)) {
+                                $imap{$$uri} = 'watchspam';
+                                push @imap, $uri;
                         } elsif ($url = nntp_url($dir)) {
                                 $nntp{$url} = 'watchspam';
                                 push @nntp, $url;
@@ -92,11 +92,12 @@ sub new {
                                 return if is_watchspam($cur, $cur_dst, $ibx);
                                 push @{$mdmap{$new} //= []}, $ibx;
                                 push @$cur_dst, $ibx;
-                        } elsif ($url = imap_url($watch)) {
+                        } elsif (my $uri = imap_uri($watch)) {
+                                my $url = $$uri;
                                 return if is_watchspam($url, $imap{$url}, $ibx);
                                 compile_watchheaders($ibx);
                                 my $n = push @{$imap{$url} ||= []}, $ibx;
-                                push @imap, $url if $n == 1;
+                                push @imap, $uri if $n == 1;
                         } elsif ($url = nntp_url($watch)) {
                                 return if is_watchspam($url, $nntp{$url}, $ibx);
                                 compile_watchheaders($ibx);