aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/alert_group.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-05-03 18:35:59 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-05-03 18:35:59 +0100
commit442e97f45ca582fdfbdd57f558e9fa82c8dfd4d3 (patch)
tree7655c4c77ef2569e25075a7bd17adb82da7ac180 /lib/mauve/alert_group.rb
parent2b89a1440aae4d4de9d5ffa036df49c5652d64ef (diff)
Notify anyone who has contributed to an alert's history since its last raise,
either by acknowledging, or by being notified about it.
Diffstat (limited to 'lib/mauve/alert_group.rb')
-rw-r--r--lib/mauve/alert_group.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/mauve/alert_group.rb b/lib/mauve/alert_group.rb
index 31d9cc8..05488fd 100644
--- a/lib/mauve/alert_group.rb
+++ b/lib/mauve/alert_group.rb
@@ -212,6 +212,21 @@ module Mauve
sent_to << notification.notify(alert, sent_to, during_runners.shift)
end
+ #
+ # If the alert is ack'd or cleared, notify anyone who has contributed to
+ # its history since it was raised.
+ #
+ alert.extra_people_to_notify.each do |person|
+ person.notifications.each do |n|
+ notification = Mauve::Notification.new(person)
+ notification.level = self.level
+ notification.every = n.every
+ notification.during = n.during
+ notification
+ sent_to << notification.notify(alert, sent_to, DuringRunner.new(at, alert, &notification.during))
+ end
+ end if alert.acknowledged? or alert.cleared?
+
return (sent_to.length > 0)
end