]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Reply.pm
treewide: update to v3 Tor onions
[public-inbox.git] / lib / PublicInbox / Reply.pm
index 8226fdc3c755e9cecb7cc66ee2fb4eae1fc23026..79dd46a729dd82be103647b0cf842443b3e4fc97 100644 (file)
@@ -9,15 +9,9 @@ use URI::Escape qw/uri_escape_utf8/;
 use PublicInbox::Hval qw(ascii_html obfuscate_addrs mid_href);
 use PublicInbox::Address;
 use PublicInbox::MID qw(mid_clean);
+use PublicInbox::Config;
 
-sub squote_maybe ($) {
-       my ($val) = @_;
-       if ($val =~ m{([^\w@\./,\%\+\-])}) {
-               $val =~ s/(['!])/'\\$1'/g; # '!' for csh
-               return "'$val'";
-       }
-       $val;
-}
+*squote_maybe = \&PublicInbox::Config::squote_maybe;
 
 sub add_addrs {
        my ($to, $cc, @addrs) = @_;
@@ -74,6 +68,7 @@ sub mailto_arg_link {
        my $obfs = $ibx->{obfuscate};
        my $subj = $hdr->header('Subject') || '';
        $subj = "Re: $subj" unless $subj =~ /\bRe:/i;
+       my $subj_raw = $subj;
        my $mid = $hdr->header_raw('Message-ID');
        push @arg, '--in-reply-to='.squote_maybe(mid_clean($mid));
        my $irt = mid_href($mid);
@@ -103,6 +98,8 @@ sub mailto_arg_link {
                }
        }
 
+       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.