I keep copy-pasting the addresses provided,
I keep writing my plaintext reply in a file,
and I keep forgetting to add a subject
(because I am "just" writing a plaintext file)
Teach `git-send-email-reply` to append a `--subject` line.
[ew: avoid URI-encoded subject on command-line, adjust t/reply.t]
Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
my $obfs = $ibx->{obfuscate};
my $subj = $hdr->header('Subject') || '';
$subj = "Re: $subj" unless $subj =~ /\bRe:/i;
my $obfs = $ibx->{obfuscate};
my $subj = $hdr->header('Subject') || '';
$subj = "Re: $subj" unless $subj =~ /\bRe:/i;
my $mid = $hdr->header_raw('Message-ID');
push @arg, '--in-reply-to='.squote_maybe(mid_clean($mid));
my $irt = mid_href($mid);
my $mid = $hdr->header_raw('Message-ID');
push @arg, '--in-reply-to='.squote_maybe(mid_clean($mid));
my $irt = mid_href($mid);
+ push @arg, "--subject=".squote_maybe($subj_raw);
+
# I'm not sure if address obfuscation and mailto: links can
# be made compatible; and address obfuscation is misguided,
# anyways.
# I'm not sure if address obfuscation and mailto: links can
# be made compatible; and address obfuscation is misguided,
# anyways.
'--in-reply-to=blah@example.com',
'--to=from@example.com',
'--cc=cc@example.com',
'--in-reply-to=blah@example.com',
'--to=from@example.com',
'--cc=cc@example.com',
+ '--cc=to@example.com',
+ "--subject='Re: hihi'"
];
is_deeply($arg, $exp, 'default reply is to :all');
];
is_deeply($arg, $exp, 'default reply is to :all');
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
is_deeply($arg, $exp, '":all" also works');
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
is_deeply($arg, $exp, '":all" also works');
-$exp = [ '--in-reply-to=blah@example.com', '--to=primary@example.com' ];
+$exp = [ '--in-reply-to=blah@example.com', '--to=primary@example.com',
+ "--subject='Re: hihi'" ];
$ibx->{replyto} = ':list';
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
is_deeply($arg, $exp, '":list" works for centralized lists');
$ibx->{replyto} = ':list';
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
is_deeply($arg, $exp, '":list" works for centralized lists');
'--in-reply-to=blah@example.com',
'--to=primary@example.com',
'--cc=cc@example.com',
'--in-reply-to=blah@example.com',
'--to=primary@example.com',
'--cc=cc@example.com',
+ '--cc=to@example.com',
+ "--subject='Re: hihi'"
];
$ibx->{replyto} = ':list,Cc,To';
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
];
$ibx->{replyto} = ':list,Cc,To';
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
$ibx->{replyto} = 'new@example.com';
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
$ibx->{replyto} = 'new@example.com';
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
-$exp = [ '--in-reply-to=blah@example.com', '--to=new@example.com' ];
+$exp = [ '--in-reply-to=blah@example.com', '--to=new@example.com',
+ "--subject='Re: hihi'"
+];
is_deeply($arg, $exp, 'explicit address works, too');
$ibx->{replyto} = ':all';
is_deeply($arg, $exp, 'explicit address works, too');
$ibx->{replyto} = ':all';
'--in-reply-to=blah@example.com',
'--to=from@example$(echo .)com',
'--cc=cc@example$(echo .)com',
'--in-reply-to=blah@example.com',
'--to=from@example$(echo .)com',
'--cc=cc@example$(echo .)com',
- '--cc=to@example$(echo .)com'
+ '--cc=to@example$(echo .)com',
+ "--subject='Re: hihi'"
];
is_deeply($arg, $exp, 'address obfuscation works');
is($link, '', 'no mailto: link given');
];
is_deeply($arg, $exp, 'address obfuscation works');
is($link, '', 'no mailto: link given');