summaryrefslogtreecommitdiffstats
path: root/extensions/RequestNagger
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-05-28 08:13:02 +0200
committerByron Jones <glob@mozilla.com>2015-05-28 08:15:35 +0200
commit0b80f6942caf44670ef7c22e074b185720521db5 (patch)
tree790b680097c295bf0bf4e1dccedeeaf0b3b4ea3a /extensions/RequestNagger
parent5a2694b21cf42d26de2c1a39d6d1443c4d1e60c8 (diff)
downloadbugzilla-0b80f6942caf44670ef7c22e074b185720521db5.tar.gz
bugzilla-0b80f6942caf44670ef7c22e074b185720521db5.tar.xz
Bug 1168751: Request nagger sends me ginormous emails because I have a lot of outgoing requests
Diffstat (limited to 'extensions/RequestNagger')
-rwxr-xr-xextensions/RequestNagger/bin/send-request-nags.pl13
1 files changed, 13 insertions, 0 deletions
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} = [];
+ }
}
}
}