From 00b57b53faec42b68b257ee3ad9f8cecbd0aff02 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 2 Jun 2015 13:27:59 +0800 Subject: Bug 1168824: stop nagging about massively overdue requests --- extensions/RequestNagger/lib/Constants.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'extensions/RequestNagger/lib') diff --git a/extensions/RequestNagger/lib/Constants.pm b/extensions/RequestNagger/lib/Constants.pm index 66780ad63..9f1b0ba98 100644 --- a/extensions/RequestNagger/lib/Constants.pm +++ b/extensions/RequestNagger/lib/Constants.pm @@ -11,6 +11,8 @@ use strict; use base qw(Exporter); our @EXPORT = qw( + MAX_SETTER_COUNT + MAX_REQUEST_AGE FLAG_TYPES REQUESTEE_NAG_SQL SETTER_NAG_SQL @@ -18,6 +20,14 @@ our @EXPORT = qw( WATCHING_SETTER_NAG_SQL ); +# 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; + +# ignore any request older than this many days in the requestee emails +# massively overdue requests will still be included in the 'watching' emails +use constant MAX_REQUEST_AGE => 90; # about three months + # the order of this array determines the order used in email use constant FLAG_TYPES => ( { @@ -69,6 +79,7 @@ sub REQUESTEE_NAG_SQL { AND flags.status = '?' AND products.nag_interval != 0 AND TIMESTAMPDIFF(HOUR, flags.modification_date, CURRENT_DATE()) >= products.nag_interval + AND TIMESTAMPDIFF(DAY, flags.modification_date, CURRENT_DATE()) <= " . MAX_REQUEST_AGE . " AND (profile_setting.setting_value IS NULL OR profile_setting.setting_value = 'on') AND requestee.disable_mail = 0 AND nag_defer.id IS NULL @@ -110,6 +121,7 @@ sub SETTER_NAG_SQL { AND flags.status = '?' AND products.nag_interval != 0 AND TIMESTAMPDIFF(HOUR, flags.modification_date, CURRENT_DATE()) >= products.nag_interval + AND TIMESTAMPDIFF(DAY, flags.modification_date, CURRENT_DATE()) <= " . MAX_REQUEST_AGE . " AND (profile_setting.setting_value IS NULL OR profile_setting.setting_value = 'on') AND setter.disable_mail = 0 AND nag_defer.id IS NULL -- cgit v1.2.3-24-g4f1b