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/person.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/person.rb')
-rw-r--r-- | lib/mauve/person.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/mauve/person.rb b/lib/mauve/person.rb index 6178fa0..d5e5ea9 100644 --- a/lib/mauve/person.rb +++ b/lib/mauve/person.rb @@ -302,6 +302,15 @@ module Mauve return CalendarInterface.is_user_off_sick?(self.username, at) end + def resolve_notifications(default_every=nil, default_during=nil, at = nil) + self.notifications.collect do |notification| + this_notification = Notification.new(self) + this_notification.every = default_every || notification.every + this_notification.during = default_during || notification.during + this_notification + end.flatten.compact + end + end end |