aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mauve/configuration.rb4
-rw-r--r--lib/mauve/notification.rb3
-rw-r--r--lib/mauve/people_list.rb4
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/mauve/configuration.rb b/lib/mauve/configuration.rb
index 3a8f9cc..8a0b982 100644
--- a/lib/mauve/configuration.rb
+++ b/lib/mauve/configuration.rb
@@ -165,5 +165,9 @@ module Mauve
@max_acknowledgement_time = arg
end
+ def calendar=(x)
+ lambda{|at| CalendarInterface.get_attendees(x,at)}
+ end
+
end
end
diff --git a/lib/mauve/notification.rb b/lib/mauve/notification.rb
index 8a5d241..899972b 100644
--- a/lib/mauve/notification.rb
+++ b/lib/mauve/notification.rb
@@ -122,8 +122,9 @@ module Mauve
#
def no_one_in(people_list)
return true unless Configuration.current.people_lists.has_key?(people_list)
+ @test_time = @time if @test_time.nil?
- return Configuration.current.people_lists[people_list].people.empty?
+ return Configuration.current.people_lists[people_list].people(@test_time).empty?
end
# Returns true if the current hour is in the list of hours given.
diff --git a/lib/mauve/people_list.rb b/lib/mauve/people_list.rb
index 0433034..f632f78 100644
--- a/lib/mauve/people_list.rb
+++ b/lib/mauve/people_list.rb
@@ -63,9 +63,9 @@ module Mauve
# Return the array of people
#
# @return [Array]
- def people
+ def people(at = Time.now)
l = list.collect do |name|
- name.is_a?(Proc) ? name.call : name
+ name.is_a?(Proc) ? name.call(at) : name
end.flatten.compact.uniq.collect do |name|
Configuration.current.people[name]
end.compact