]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: generated Message-ID goes first
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Sat, 3 Mar 2018 07:31:54 +0000 (07:31 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Sat, 3 Mar 2018 07:31:54 +0000 (07:31 +0000)
This is to make SearchMsg behave more sanely under NNTP.

lib/PublicInbox/V2Writable.pm
t/v2writable.t

index 6d7382780b6607acae8818d2ec2d399f944707ec..c73d859b8fb880e835fc35ef0457eec8a94bec04 100644 (file)
@@ -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;
 }
 
index 44191c136026aa590ebd172eb148eeaa7053f965..f95b2e7419200fb43cf25d6a1f0db09088ff3775 100644 (file)
@@ -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], '<a-mid@b>', 'original mid not changed');
-       like($mids[1], qr/\A<\w+\@localhost>\z/, 'new MID added');
+       is($mids[1], '<a-mid@b>', '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], '<a-mid@b>', 'original mid not changed');
-       like($mids[1], qr/\A<\w+\@localhost>\z/, 'new MID added');
+       is($mids[1], '<a-mid@b>', '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 = ();