]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
view: decode In-Reply-To comments added by some MUAs
authorEric Wong <e@80x24.org>
Fri, 9 Feb 2024 09:33:01 +0000 (09:33 +0000)
committerEric Wong <e@80x24.org>
Fri, 9 Feb 2024 23:15:19 +0000 (23:15 +0000)
Štěpán Němec <stepnem@smrk.net> 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
<https://yhbt.net/lore/git/xmqqr0ho9oi9.fsf@gitster.g/>
while scanning for something else.

lib/PublicInbox/View.pm

index 697535ff65f8c1959e738a3ba8084db0b98de0c9..44e1f2a8b9ed2a9df677dec384c207aad4e11ef4 100644 (file)
@@ -744,7 +744,11 @@ href="d/">diff</a>)</pre><pre>];
        }
        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;
        }