1.1 --- a/imiptools/handlers/person.py Wed Jan 28 01:04:24 2015 +0100
1.2 +++ b/imiptools/handlers/person.py Wed Jan 28 01:17:02 2015 +0100
1.3 @@ -20,7 +20,7 @@
1.4 """
1.5
1.6 from imiptools.content import Handler, get_address, get_uri, to_part, uri_dict, uri_items
1.7 -from imiptools.handlers.common import CommonFreebusy
1.8 +from imiptools.handlers.common import CommonFreebusy, SupportFreebusy
1.9 from imiptools.profile import Preferences
1.10 from vCalendar import to_node
1.11
1.12 @@ -124,7 +124,7 @@
1.13 for sender, sender_attr in uri_items(self.get_items(from_organiser and "ORGANIZER" or "ATTENDEE")):
1.14 self.store.set_freebusy_for_other(get_uri(self.recipient), freebusy, sender)
1.15
1.16 -class Event(PersonHandler):
1.17 +class Event(PersonHandler, SupportFreebusy):
1.18
1.19 "An event handler."
1.20
1.21 @@ -179,7 +179,18 @@
1.22 "Hold requests and notify the recipient."
1.23
1.24 self._record_and_deliver("VEVENT", from_organiser=True, queue=True)
1.25 - return self.wrap("A request has been received.")
1.26 +
1.27 + # Produce free/busy information if configured to do so.
1.28 +
1.29 + preferences = Preferences(get_uri(self.recipient))
1.30 + if preferences.get("freebusy_sharing") == "share" and \
1.31 + preferences.get("freebusy_bundling") == "always":
1.32 +
1.33 + freebusy = self.make_freebusy_to_publish(from_organiser=False)
1.34 + else:
1.35 + freebusy = []
1.36 +
1.37 + return self.wrap("A request has been received.") + freebusy
1.38
1.39 class Freebusy(PersonHandler, CommonFreebusy):
1.40