about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwAtomStream.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-26 19:33:18 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-27 10:18:45 +0000
commit956abe9ad5f13a0d1755262be412d6a54fda72e9 (patch)
treecda2a73b8e234dbf6e3b1842e541054ab8a4d777 /lib/PublicInbox/WwwAtomStream.pm
parent50f7b8e95db516104cef237bb0a555a566ff150e (diff)
downloadpublic-inbox-956abe9ad5f13a0d1755262be412d6a54fda72e9.tar.gz
Since we need to handle messages with multiple and duplicate
Message-ID headers, our thread skeleton display must account
for that.

Since we have a "preferred" Message-ID in case of conflicts,
use it as the UUID in an Atom feed so readers do not get
confused by conflicts.
Diffstat (limited to 'lib/PublicInbox/WwwAtomStream.pm')
-rw-r--r--lib/PublicInbox/WwwAtomStream.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/PublicInbox/WwwAtomStream.pm b/lib/PublicInbox/WwwAtomStream.pm
index bb574a7c..38eba2a0 100644
--- a/lib/PublicInbox/WwwAtomStream.pm
+++ b/lib/PublicInbox/WwwAtomStream.pm
@@ -33,8 +33,8 @@ sub response {
 sub getline {
         my ($self) = @_;
         if (my $middle = $self->{cb}) {
-                my $mime = $middle->();
-                return feed_entry($self, $mime) if $mime;
+                my $smsg = $middle->();
+                return feed_entry($self, $smsg) if $smsg;
         }
         delete $self->{cb} ? '</feed>' : undef;
 }
@@ -92,10 +92,11 @@ sub mid2uuid ($) {
 
 # returns undef or string
 sub feed_entry {
-        my ($self, $mime) = @_;
+        my ($self, $smsg) = @_;
         my $ctx = $self->{ctx};
+        my $mime = $smsg->{mime};
         my $hdr = $mime->header_obj;
-        my $mid = mid_clean($hdr->header_raw('Message-ID'));
+        my $mid = $smsg->mid;
         my $irt = PublicInbox::View::in_reply_to($hdr);
         my $uuid = mid2uuid($mid);
         my $base = $ctx->{feed_base_url};