From 894d18f8f1cc113c74d7c5c5937fbf51b1ea0237 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sun, 22 Oct 2006 17:23:42 -0700 Subject: [PATCH 1/1] Allow for useless messages to be hidden --- cgi/bugreport.cgi | 45 +++++++++++++++++++++++++++++++++------------ cgi/bugs.css | 10 ++++++++++ 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index 182d2b8..a401f7c 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -374,6 +374,7 @@ sub handle_record{ my $output = ''; local $_ = $record->{type}; if (/html/) { + my $class = $record->{text} =~ /^(?:Acknowledgement|Reply|Information|Report|Notification)/ ? 'infmessage':'msgreceived'; $output .= decode_rfc1522($record->{text}); # Link to forwarded http:// urls in the midst of the report # (even though these links already exist at the top) @@ -392,7 +393,7 @@ sub handle_record{ $output .= 'Full text and rfc822 format available.'; - $output = qq(\n"; + $output = qq(\n"; } elsif (/recips/) { my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im; @@ -402,7 +403,7 @@ sub handle_record{ elsif (defined $msg_id) { $$seen_msg_ids{$msg_id} = 1; } - $output .= qq(\n); + $output .= qq(
\n); $output .= 'View this message in rfc822 format'; $output .= handle_email_message($record->{text}, ref => $bug_number, @@ -422,7 +423,7 @@ sub handle_record{ } # Incomming Mail Message my ($received,$hostname) = $record->{text} =~ m/Received: \(at (\S+)\) by (\S+)\;/; - $output .= qq|

Message received at |. + $output .= qq|


Message received at |. htmlsanit("$received\@$hostname") . q| (full text'.q|, mbox)'.":

\n"; $output .= handle_email_message($record->{text}, ref => $bug_number, @@ -526,7 +527,7 @@ else { } @log = reverse @log if $reverse; -$log = join('
',@log); +$log = join("\n",@log); print "Content-Type: text/html; charset=utf-8\n\n"; @@ -536,13 +537,33 @@ my $title = htmlsanit($status{subject}); my $dummy2 = $debbugs::gWebHostBugDir; print "\n"; -print "\n" . - "$short - $title - $debbugs::gProject $debbugs::gBug report logs\n" . - ''. - "" . - "\n" . - '' . - "\n"; +print < +$short - $title - $debbugs::gProject $debbugs::gBug report logs + + + + + +END print "

" . "$debbugs::gProject $debbugs::gBug report logs - $short" . "
" . $title . "

\n"; @@ -550,12 +571,12 @@ print "$descriptivehead\n"; print qq(

Reply ), qq(or subscribe ), qq(to this bug.

\n); +print qq(

Show useless messages

); printf qq(

View this report as an mbox folder, ). qq(status mbox, maintainer mbox

\n), html_escape(bug_url($ref, mbox=>'yes')), html_escape(bug_url($ref, mbox=>'yes',mboxstatus=>'yes')), html_escape(bug_url($ref, mbox=>'yes',mboxmaint=>'yes')); -print "
"; print "$log"; print "
"; print "

Send a report that this bug log contains spam.

\n
\n"; diff --git a/cgi/bugs.css b/cgi/bugs.css index 1f38134..ed42581 100644 --- a/cgi/bugs.css +++ b/cgi/bugs.css @@ -104,6 +104,16 @@ pre.mime { color: #797979; } +/* This must be separate from the other CSS to make the showing of + unimportant messages work in bugreport.cgi. */ +.infmessage { display: none; } + +.infmessage { + font-family: sans-serif; + font-size: 90%; + color: #686868; +} + .msgreceived { font-family: sans-serif; font-size: 90%; -- 2.39.2