1.1 --- a/imiptools/handlers/person.py Tue Jan 27 18:48:58 2015 +0100
1.2 +++ b/imiptools/handlers/person.py Tue Jan 27 19:03:20 2015 +0100
1.3 @@ -221,19 +221,25 @@
1.4
1.5 "Register free/busy information."
1.6
1.7 - # NOTE: This could be configured to not produce a message.
1.8 + self._record_freebusy(from_organiser=True)
1.9 +
1.10 + # Produce a message if configured to do so.
1.11
1.12 - self._record_freebusy(from_organiser=True)
1.13 - return self.wrap("PUBLISH", "A free/busy update has been received.", from_organiser=True, link=False)
1.14 + preferences = Preferences(get_uri(self.recipient))
1.15 + if preferences.get("freebusy_messages") == "notify":
1.16 + return self.wrap("PUBLISH", "A free/busy update has been received.", from_organiser=True, link=False)
1.17
1.18 def reply(self):
1.19
1.20 "Record replies and notify the recipient."
1.21
1.22 - # NOTE: This could be configured to not produce a message.
1.23 + self._record_freebusy(from_organiser=False)
1.24 +
1.25 + # Produce a message if configured to do so.
1.26
1.27 - self._record_freebusy(from_organiser=False)
1.28 - return self.wrap("REPLY", "A reply has been received.", from_organiser=False, link=False)
1.29 + preferences = Preferences(get_uri(self.recipient))
1.30 + if preferences.get("freebusy_messages") == "notify":
1.31 + return self.wrap("REPLY", "A reply to a free/busy request has been received.", from_organiser=False, link=False)
1.32
1.33 def request(self):
1.34
1.35 @@ -242,9 +248,11 @@
1.36 information for each indicated attendee.
1.37 """
1.38
1.39 - # NOTE: This should be subject to policy/preferences.
1.40 + # Produce a reply if configured to do so.
1.41
1.42 - return CommonFreebusy.request(self)
1.43 + preferences = Preferences(get_uri(self.recipient))
1.44 + if preferences.get("freebusy_sharing") == "share":
1.45 + return CommonFreebusy.request(self)
1.46
1.47 class Journal(PersonHandler):
1.48