# HG changeset patch # User Paul Boddie # Date 1441662373 -7200 # Node ID abf2cd4a427b64ec748622dabc90b9a276d71649 # Parent c8e05079d35c26d76f31710e5169c32887f78920 Changed names to use more accurate or clearer terminology, fixing free/busy updates in certain circumstances where the current object is to be used, as opposed to any stored object (which may not yet be stored). diff -r c8e05079d35c -r abf2cd4a427b imiptools/client.py --- a/imiptools/client.py Mon Sep 07 19:46:39 2015 +0200 +++ b/imiptools/client.py Mon Sep 07 23:46:13 2015 +0200 @@ -464,15 +464,15 @@ return self.get_stored_object(self.uid, self.recurrenceid) - def get_definitive_object(self, from_organiser): + def get_definitive_object(self, as_organiser): """ Return an object considered definitive for the current transaction, - using 'from_organiser' to select the current transaction's object if - true, or selecting a stored object if false. + using 'as_organiser' to select the current transaction's object if + false, or selecting a stored object if true. """ - return from_organiser and self.obj or self.get_stored_object_version() + return not as_organiser and self.obj or self.get_stored_object_version() def get_parent_object(self): @@ -523,13 +523,13 @@ recurrenceid = self.get_recurrence_start_point(recurrenceid) remove_affected_period(freebusy, self.uid, recurrenceid) - def update_freebusy(self, freebusy, user, for_organiser): + def update_freebusy(self, freebusy, user, as_organiser): """ Update the 'freebusy' collection for this event with the periods and transparency associated with the current object, subject to the 'user' identity and the attendance details provided for them, indicating - whether the update is being done 'for_organiser' (for the organiser of + whether the update is being done 'as_organiser' (for the organiser of an event) or not. """ @@ -537,7 +537,7 @@ # organiser. Attendees do not have the opportunity to redefine the # periods. - obj = self.get_definitive_object(for_organiser) + obj = self.get_definitive_object(as_organiser) if not obj: return @@ -548,7 +548,7 @@ # Define an overriding transparency, the indicated event transparency, # or the default transparency for the free/busy entry. - transp = self.get_overriding_transparency(user, for_organiser) or \ + transp = self.get_overriding_transparency(user, as_organiser) or \ obj.get_value("TRANSP") or \ "OPAQUE" @@ -573,7 +573,10 @@ # Remove periods for non-participating attendees. if self.is_participating(user, for_organiser and not updating_other): - self.update_freebusy(freebusy, user, for_organiser) + self.update_freebusy(freebusy, user, + for_organiser and not updating_other or + not for_organiser and updating_other + ) else: self.remove_from_freebusy(freebusy)