# HG changeset patch # User Paul Boddie # Date 1428252924 -7200 # Node ID c2eae45fba5d50357950e15d971f1d38bbdd644f # Parent 6a210dee68a53bf0ece53934a56e061bc3d857ff Fixed attendance recording in the free/busy details for outgoing messages, properly testing for organiser-only events. diff -r 6a210dee68a5 -r c2eae45fba5d imiptools/handlers/__init__.py --- a/imiptools/handlers/__init__.py Sun Apr 05 18:25:27 2015 +0200 +++ b/imiptools/handlers/__init__.py Sun Apr 05 18:55:24 2015 +0200 @@ -180,10 +180,11 @@ being generated 'for_organiser' or not. """ - # Organisers employ a special transparency. + # Organisers employ a special transparency if not attending. if for_organiser or attr.get("PARTSTAT") != "DECLINED": - self.update_freebusy(freebusy, periods, transp=(for_organiser and "ORG" or None)) + self.update_freebusy(freebusy, periods, transp=( + for_organiser and not attr.get("PARTSTAT") and "ORG" or None)) else: self.remove_from_freebusy(freebusy) diff -r 6a210dee68a5 -r c2eae45fba5d imiptools/handlers/person_outgoing.py --- a/imiptools/handlers/person_outgoing.py Sun Apr 05 18:25:27 2015 +0200 +++ b/imiptools/handlers/person_outgoing.py Sun Apr 05 18:55:24 2015 +0200 @@ -30,12 +30,10 @@ def set_identity(self, from_organiser=True): """ - Set the current user for the current object. Return attributes for the - user if the + Set the current user for the current object. """ self.user, attr = uri_item(self.obj.get_item(from_organiser and "ORGANIZER" or "ATTENDEE")) - return attr def _record(self, from_organiser=True, update_freebusy=False): @@ -45,7 +43,7 @@ free/busy information if 'update_freebusy' is set to a true value. """ - attr = self.set_identity(from_organiser) + self.set_identity(from_organiser) # Check for event using UID. @@ -97,7 +95,10 @@ periods = obj.get_periods_for_freebusy(self.get_tzid(), self.get_window_end()) - self.update_freebusy_for_participant(freebusy, periods, attr, from_organiser) + # Obtain the attendance attributes for this user, if available. + + attendees = uri_dict(self.obj.get_value_map("ATTENDEE")) + self.update_freebusy_for_participant(freebusy, periods, attendees.get(self.user), from_organiser) # Remove either original recurrence or additional recurrence # details depending on whether an additional recurrence or a