diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2013-05-16 12:33:23 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2013-05-16 12:33:23 +0100 |
commit | 72723a723ef7c6bf368b472c32fca3c7c397616a (patch) | |
tree | f6f010226ca4d4857e89c7f707f4a20b1ff39f62 /lib | |
parent | 0119cfa4314a96409f3b0551904aa2af6e443e13 (diff) |
Tweaked level-based suppression condition for notifications (to work)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mauve/person.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/mauve/person.rb b/lib/mauve/person.rb index eb6e28b..8ce0952 100644 --- a/lib/mauve/person.rb +++ b/lib/mauve/person.rb @@ -168,10 +168,11 @@ module Mauve return true if !AlertGroup::LEVELS.include?(level) or AlertGroup::LEVELS.index(level) == 0 # - # Suppress this notification if all of the preceeding notifications were of the same or higher level. + # Suppress this notification if all the last N of the preceeding + # notifications were of a equal or higher level. # - return previous_notifications.alerts.all? do |a| - AlertGroup::LEVELS.index(a.level) >= AlertGroup::LEVELS.index(level) + return previous_notifications.first(number).alerts.all? do |a| + AlertGroup::LEVELS.index(a.level) >= AlertGroup::LEVELS.index(level) end end |