]> Sergey Matveev's repositories - public-inbox.git/commitdiff
hval: use more appropriate hvals for documentation
authorEric Wong <e@80x24.org>
Sat, 9 Jan 2016 09:45:20 +0000 (09:45 +0000)
committerEric Wong <e@80x24.org>
Sat, 9 Jan 2016 09:46:36 +0000 (09:46 +0000)
Not needed, but this is good documentation.  Some of these values
should never have newlines.

lib/PublicInbox/ExtMsg.pm
lib/PublicInbox/SearchView.pm
lib/PublicInbox/View.pm

index a56df335d61adcf3217b9848f9d16944c570c730..98da45cc588d5251c260c98ca4814a3ad0b25674 100644 (file)
@@ -124,7 +124,7 @@ again:
                foreach my $pfx (@partial) {
                        my $u = $pfx->{url};
                        foreach my $m (@{$pfx->{res}}) {
-                               my $p = PublicInbox::Hval->new($m);
+                               my $p = PublicInbox::Hval->new_msgid($m);
                                my $r = $p->as_href;
                                my $t = $p->as_html;
                                $s .= qq{<a\nhref="$u/$r/">$u/$t/</a>\n};
index b3ddcb54cac4d14793b90afebfafdff98e9a1b0f..8f61b4f4be7e72084d0b47600807c02ea997e65b 100644 (file)
@@ -288,7 +288,7 @@ sub qs_html {
                $self = $tmp;
        }
 
-       my $q = PublicInbox::Hval->new($self->{q})->as_href;
+       my $q = PublicInbox::Hval->new_oneline($self->{q})->as_href;
        $q =~ s/%20/+/g; # improve URL readability
        my $qs = "q=$q";
 
index 4fc8ffc38da8592657561ea89b55880548f4a982..829806d86cafc69b278233a7fe0757fa1bcce54d 100644 (file)
@@ -768,8 +768,8 @@ sub _inline_header {
        my $mid = mid_clean($mime->header('Message-ID'));
        my $f = $mime->header('X-PI-From');
        my $d = _msg_date($mime);
-       $f = PublicInbox::Hval->new($f)->as_html;
-       $d = PublicInbox::Hval->new($d)->as_html;
+       $f = PublicInbox::Hval->new_oneline($f)->as_html;
+       $d = PublicInbox::Hval->new_oneline($d)->as_html;
        my $pfx = ' ' . $d . ' ' . indent_for($level);
        my $attr = $f;
        $state->{first_level} ||= $level;
@@ -902,7 +902,7 @@ sub dump_topics {
                my ($level, $subj, $topic) = @$info;
                my $n = delete $subjs->{$topic};
                my ($mid, $ts) = @{delete $latest->{$topic}};
-               $mid = PublicInbox::Hval->new($mid)->as_href;
+               $mid = PublicInbox::Hval->new_msgid($mid)->as_href;
                $subj = PublicInbox::Hval->new($subj)->as_html;
                $pfx = indent_for($level);
                my $nl = $level == $prev ? "\n" : '';