From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 75B891FAF5 for ; Tue, 6 Mar 2018 08:42:43 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 18/34] v2writable: generated Message-ID goes first Date: Tue, 6 Mar 2018 08:42:26 +0000 Message-Id: <20180306084242.19988-19-e@80x24.org> In-Reply-To: <20180306084242.19988-1-e@80x24.org> References: <20180306084242.19988-1-e@80x24.org> List-Id: This is to make SearchMsg behave more sanely under NNTP. --- lib/PublicInbox/V2Writable.pm | 2 +- t/v2writable.t | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 6d73827..c73d859 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -142,7 +142,7 @@ sub num_for_harder { } } my @cur = $hdr->header_raw('Message-Id'); - $hdr->header_set('Message-Id', @cur, "<$mid>"); + $hdr->header_set('Message-Id', "<$mid>", @cur); $num; } diff --git a/t/v2writable.t b/t/v2writable.t index 44191c1..f95b2e7 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -53,8 +53,8 @@ ok($im->add($mime), 'ordinary message added'); ok($im->add($mime), 'reused mid ok'); like(join(' ', @warn), qr/reused/, 'warned about reused MID'); my @mids = $mime->header_obj->header_raw('Message-Id'); - is($mids[0], '', 'original mid not changed'); - like($mids[1], qr/\A<\w+\@localhost>\z/, 'new MID added'); + is($mids[1], '', 'original mid not changed'); + like($mids[0], qr/\A<\w+\@localhost>\z/, 'new MID added'); is(scalar(@mids), 2, 'only one new MID added'); @warn = (); @@ -68,8 +68,8 @@ ok($im->add($mime), 'ordinary message added'); ok($im->add($mime), 'random MID made'); like(join(' ', @warn), qr/using random/, 'warned about using random'); @mids = $mime->header_obj->header_raw('Message-Id'); - is($mids[0], '', 'original mid not changed'); - like($mids[1], qr/\A<\w+\@localhost>\z/, 'new MID added'); + is($mids[1], '', 'original mid not changed'); + like($mids[0], qr/\A<\w+\@localhost>\z/, 'new MID added'); is(scalar(@mids), 2, 'only one new MID added'); @warn = (); -- EW