From 3fba3914acf8bb0529a64f010fdedc9db04864ea Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 9 Feb 2024 09:33:01 +0000 Subject: view: decode In-Reply-To comments added by some MUAs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Štěpán Němec wrote: > Eric Wong wrote: > > Subject: [PATCH] view: decode In-Reply-To comments added by Gnus > Or just "some MUAs"? Who knows who else... Yeah, I wouldn't be surprised if there were more... ---8<--- Subject: [PATCH] view: decode In-Reply-To comments added by some MUAs Emacs-based MUAs (e.g. Gnus and rmail) can do it, and maybe some others, too. I noticed it in while scanning for something else. --- lib/PublicInbox/View.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 697535ff..44e1f2a8 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -744,7 +744,11 @@ href="d/">diff)
];
 	}
 	my @irt = $eml->header_raw('In-Reply-To');
 	my $refs;
-	if (!@irt) {
+	if (@irt) { # ("so-and-so's message of $DATE") added by some MUAs
+		for (grep(/=\?/, @irt)) {
+			s/(=\?.*)\z/PublicInbox::Eml::mhdr_decode $1/se;
+		}
+	} else {
 		$refs = references($eml);
 		$irt[0] = pop(@$refs) if scalar @$refs;
 	}
-- 
cgit v1.2.3-24-ge0c7