aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/alert.rb
diff options
context:
space:
mode:
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