X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FCGI%2FBugreport.pm;h=8d3452db06985287f465c8fa63580bd821e6b640;hb=5e94d2b493225b6e149a73da9e44bfdc46f6c4fc;hp=d4800cd3c7df1f0440962f20c49d457eec8d491a;hpb=948b8e160cac1b36c6099feeb61ae2fe91271b61;p=debbugs.git diff --git a/Debbugs/CGI/Bugreport.pm b/Debbugs/CGI/Bugreport.pm index d4800cd..8d3452d 100644 --- a/Debbugs/CGI/Bugreport.pm +++ b/Debbugs/CGI/Bugreport.pm @@ -113,6 +113,9 @@ sub display_entity { trim_headers => {type => BOOLEAN, default => 1, }, + avatars => {type => BOOLEAN, + default => 1, + }, } ); @@ -142,10 +145,10 @@ sub display_entity { my $head_field = $head->get($_); next unless defined $head_field and $head_field ne ''; chomp $head_field; - if ($_ eq 'From') { + if ($_ eq 'From' and $param{avatars}) { my $libravatar_url = __libravatar_url(decode_rfc1522($head_field)); if (defined $libravatar_url and length $libravatar_url) { - push @headers,q(\n); + push @headers,q(\n); } } push @headers, qq(

$_: ) . html_escape(decode_rfc1522($head_field))."

\n"; @@ -221,6 +224,7 @@ sub display_entity { terse => $param{terse}, exists $param{msg}?(msg=>$param{msg}):(), exists $param{att}?(att=>$param{att}):(), + exists $param{avatars}?(avatars=>$param{avatars}):(), ); # print {$output} "\n"; } @@ -240,6 +244,7 @@ sub display_entity { terse => $param{terse}, exists $param{msg}?(msg=>$param{msg}):(), exists $param{att}?(att=>$param{att}):(), + exists $param{avatars}?(avatars=>$param{avatars}):(), ); # print {$output} "\n"; } @@ -319,6 +324,7 @@ sub handle_email_message{ exists $param{msg}?(msg=>$param{msg}):(), exists $param{att}?(att=>$param{att}):(), exists $param{trim_headers}?(trim_headers=>$param{trim_headers}):(), + exists $param{avatars}?(avatars=>$param{avatars}):(), ); return decode_utf8($output); } @@ -334,7 +340,7 @@ should be output to the browser. =cut sub handle_record{ - my ($record,$bug_number,$msg_number,$seen_msg_ids) = @_; + my ($record,$bug_number,$msg_number,$seen_msg_ids,%param) = @_; # output needs to have the is_utf8 flag on to avoid double # encoding @@ -397,6 +403,7 @@ sub handle_record{ $output .= handle_email_message($record->{text}, ref => $bug_number, msg_num => $msg_number, + %param, ); } elsif (/autocheck/) { @@ -424,6 +431,7 @@ sub handle_record{ $output .= handle_email_message($record->{text}, ref => $bug_number, msg_num => $msg_number, + %param, ); } else { @@ -439,7 +447,7 @@ sub __libravatar_url { return undef; } ($email) = get_addresses($email); - return $config{libravatar_uri}.md5_hex(lc($email)).($config{libravatar_uri_options}//''); + return $config{libravatar_uri}.$email.($config{libravatar_uri_options}//''); }