From 4c99233f3b3112cd2be5ab6fd5d6e7c1c344406b Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Tue, 17 Apr 2012 21:26:49 +0100 Subject: * The notification buffer is now used to store Alerts/AlertChangeds and times to notify about, rather than notifications to be sent. * Fixed up the debug notifier a bit more. * Using the debug notifier extras more now. --- lib/mauve/notifier.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/mauve/notifier.rb') diff --git a/lib/mauve/notifier.rb b/lib/mauve/notifier.rb index bf36162..8a26b2c 100644 --- a/lib/mauve/notifier.rb +++ b/lib/mauve/notifier.rb @@ -86,14 +86,12 @@ module Mauve # Empty the buffer, one notification at a time. # sz.times do - person, *args = Server.notification_pop - - # - # Nil person.. that's craaazy too! - # - next if person.nil? - - person.send_alert(*args) + alert, at = Server.notification_pop + if alert.alert_group.nil? + logger.warn "Could not notify for #{alert} since there are no matching alert groups" + else + alert.alert_group.notify(alert, at) + end end end -- cgit v1.2.1