# HG changeset patch # User Paul Boddie # Date 1414694140 -3600 # Node ID 9dedbc0dddbd81f31fed9366e2f5406ad20751b7 # Parent 0eba4667b645d7906fdcfd5d41cd36fd578361ca Added a new object test for calendar information. diff -r 0eba4667b645 -r 9dedbc0dddbd imiptools/handlers/person_outgoing.py --- a/imiptools/handlers/person_outgoing.py Thu Oct 30 19:08:19 2014 +0100 +++ b/imiptools/handlers/person_outgoing.py Thu Oct 30 19:35:40 2014 +0100 @@ -15,6 +15,11 @@ def _record(self, objtype, from_organiser=True, update_freebusy=False): identity = self.get_value(from_organiser and "ORGANIZER" or "ATTENDEE") + # Check for event using UID. + + if not self.have_new_object(identity, objtype): + return + # Store the object. self.store.set_event(identity, self.uid, to_node( @@ -24,9 +29,15 @@ # Update free/busy information. if update_freebusy: + + # If newer than any old version, discard old details from the + # free/busy record and check for suitability. + periods = self.get_periods() freebusy = self.store.get_freebusy(identity) or [] + self.update_freebusy(freebusy, identity, periods) + if self.publisher: self.publisher.set_freebusy(identity, freebusy)