diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-19 22:52:36 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-19 22:52:36 +0100 |
commit | 89ee7e1a43bca0fc382c23176d1c6aed97b2750b (patch) | |
tree | 313c0fe56d0075010a780475554d00b431a92cb0 /lib/mauve/alert_changed.rb | |
parent | 15a468799b52d34b980a03aa6ef2d6e8f6e87ee1 (diff) |
Added check to make sure reminders are fired at the correct time, as per the "during" statement.
Diffstat (limited to 'lib/mauve/alert_changed.rb')
-rw-r--r-- | lib/mauve/alert_changed.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/mauve/alert_changed.rb b/lib/mauve/alert_changed.rb index a17c32f..ebcbbda 100644 --- a/lib/mauve/alert_changed.rb +++ b/lib/mauve/alert_changed.rb @@ -109,6 +109,7 @@ module Mauve unless alert_group.notifications.nil? alert_group.notifications.each do |notification| + # # Build an array of people that could/should be notified. # @@ -128,7 +129,12 @@ module Mauve # notification_people.sort.uniq.each do |np| if np == self.person - Configuration.current.people[np].remind(alert, level) + # + # Only remind if the time is right. + # + if DuringRunner.new(Time.now, alert, ¬ification.during).now? + Configuration.current.people[np].remind(alert, level) + end self.remind_at = notification.remind_at_next(alert) save saved = true |