aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/alert.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-07-22 16:55:54 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-07-22 16:55:54 +0100
commit25b32914b72a5f709eca773f3511cc89c2e710c2 (patch)
tree4dab9e78e4c6b49220a837b38d463328c05e2983 /lib/mauve/alert.rb
parent3185e5d746abda1b7f42ecdbd74ec14359fda3bc (diff)
parentfd23821950f0562a8995735105cd31fdc6d55933 (diff)
merge
Diffstat (limited to 'lib/mauve/alert.rb')
-rw-r--r--lib/mauve/alert.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb
index 8778892..6bde73a 100644
--- a/lib/mauve/alert.rb
+++ b/lib/mauve/alert.rb
@@ -2,6 +2,7 @@ require 'mauve/proto'
require 'mauve/alert_changed'
require 'mauve/history'
require 'mauve/datamapper'
+require 'mauve/source_list'
require 'sanitize'
module Mauve
@@ -129,6 +130,18 @@ module Mauve
end
#
+ # Pick out the source lists that match this alert by subject.
+ #
+ def source_lists
+ Mauve::Configuration.current.source_lists.select{|label, list| list.includes?(self.subject)}.collect{|sl| sl.first}
+ end
+
+ def in_source_list?(g)
+ list = Mauve::Configuration.current.source_lists[g]
+ list.includes?(self.subject)
+ end
+
+ #
#
#
def level