diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-03 19:42:20 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-03 19:42:20 +0100 |
commit | 58f5a950200f5957307a8552b92ce9e92f948b73 (patch) | |
tree | e7e5dbf2178dfd46e88e8e6d60d6665c58b538fa /lib/mauve/people_list.rb | |
parent | 3a008fd3fff00852533d0df1f597595505373c6b (diff) |
* Person and people lists have now become interchangeable, with notifications
only recording the username, rather than the Person/PeopleList. This means
that notifications in alert groups can use default #during clauses and #every
values from people lists and persons.
* Notify clauses can now take an array of persons/people_lists, and people_lists
can refer to other people lists.
* PeopleList names are now in the same namespace as usernames.
* Tests to go with.
Diffstat (limited to 'lib/mauve/people_list.rb')
-rw-r--r-- | lib/mauve/people_list.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/mauve/people_list.rb b/lib/mauve/people_list.rb index f632f78..e6c6c36 100644 --- a/lib/mauve/people_list.rb +++ b/lib/mauve/people_list.rb @@ -78,6 +78,21 @@ module Mauve l end + def resolve_notifications(default_every=nil, default_during=nil, at = nil) + self.people(at).collect do |person| + if self.notifications.empty? + person.resolve_notifications(default_every, default_during, at) + else + self.notifications.collect do |notification| + this_notification = Notification.new(person) + this_notification.every = default_every || notification.every + this_notification.during = default_during || notification.during + this_notification + end + end + end.flatten.compact + end + end end |