From 0b80f6942caf44670ef7c22e074b185720521db5 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 28 May 2015 14:13:02 +0800 Subject: Bug 1168751: Request nagger sends me ginormous emails because I have a lot of outgoing requests --- extensions/RequestNagger/bin/send-request-nags.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'extensions/RequestNagger') diff --git a/extensions/RequestNagger/bin/send-request-nags.pl b/extensions/RequestNagger/bin/send-request-nags.pl index 7ad0bbb32..e2d746f78 100755 --- a/extensions/RequestNagger/bin/send-request-nags.pl +++ b/extensions/RequestNagger/bin/send-request-nags.pl @@ -13,6 +13,10 @@ use warnings; use FindBin qw($RealBin); use lib "$RealBin/../../.."; +# if there are more than this many requests that a user is waiting on, show a +# summary and a link instead. +use constant MAX_SETTER_COUNT => 7; + use Bugzilla; BEGIN { Bugzilla->extensions() } @@ -115,6 +119,15 @@ sub send_nags { map { scalar(@{ $rh->{$report}->{$_} }) . ' ' . $_ } @{ $rh->{types}->{$report} } ); + + # remove links to reports with too many items to display + my $total = 0; + foreach my $type (@{ $rh->{types}->{$report} }) { + $total += scalar(@{ $rh->{$report}->{$type} }); + } + if ($total > MAX_SETTER_COUNT) { + $rh->{types}->{$report} = []; + } } } } -- cgit v1.2.3-24-g4f1b