aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/alert.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-07-22 16:55:01 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-07-22 16:55:01 +0100
commitfd23821950f0562a8995735105cd31fdc6d55933 (patch)
tree967df2f5647803a6c46f4d52003b2231c1de72cb /lib/mauve/alert.rb
parentd3a3cfef9650b08f62db62bd7e86b673f9d77d0b (diff)
* Rejigged configuration
* Added --test and --verbose flags for the server config * Started proper test suite * Config parsing now gives more sensible errors + backtrace * Rejigged people and source lists
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