From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4801A1F405; Fri, 9 Feb 2024 09:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1707471478; bh=f/los5qfaBhOTENAg6bbvtZu+2PIx53m3cvpchq0YSM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xObQ08JcwrUfCrZIhPWAba/JkYEf6x1GuVjxnycwPpBrqyaCJAptWLYWpxTtEqGly qHNSWoMyBwupQKkEY8+GFaZDq52fSORiTdFdnGq54swae1/cbj/J+76z/Edyn6sipT EwLUQtaZW8Kd2Lyp+/83KSzZ6dUoRCjtHuBbrpW4= Date: Fri, 9 Feb 2024 09:33:01 +0000 From: Eric Wong To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Cc: meta@public-inbox.org Subject: [PATCH v2] view: decode In-Reply-To comments added by some MUAs Message-ID: <20240209093301.M112200@dcvr> References: <20240208000447.3074912-1-e@80x24.org> <20240208104513+0100.315029-stepnem@smrk.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240208104513+0100.315029-stepnem@smrk.net> List-Id: Š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;
 	}