1.1 --- a/imiptools/client.py Mon Sep 07 19:46:39 2015 +0200
1.2 +++ b/imiptools/client.py Mon Sep 07 23:46:13 2015 +0200
1.3 @@ -464,15 +464,15 @@
1.4
1.5 return self.get_stored_object(self.uid, self.recurrenceid)
1.6
1.7 - def get_definitive_object(self, from_organiser):
1.8 + def get_definitive_object(self, as_organiser):
1.9
1.10 """
1.11 Return an object considered definitive for the current transaction,
1.12 - using 'from_organiser' to select the current transaction's object if
1.13 - true, or selecting a stored object if false.
1.14 + using 'as_organiser' to select the current transaction's object if
1.15 + false, or selecting a stored object if true.
1.16 """
1.17
1.18 - return from_organiser and self.obj or self.get_stored_object_version()
1.19 + return not as_organiser and self.obj or self.get_stored_object_version()
1.20
1.21 def get_parent_object(self):
1.22
1.23 @@ -523,13 +523,13 @@
1.24 recurrenceid = self.get_recurrence_start_point(recurrenceid)
1.25 remove_affected_period(freebusy, self.uid, recurrenceid)
1.26
1.27 - def update_freebusy(self, freebusy, user, for_organiser):
1.28 + def update_freebusy(self, freebusy, user, as_organiser):
1.29
1.30 """
1.31 Update the 'freebusy' collection for this event with the periods and
1.32 transparency associated with the current object, subject to the 'user'
1.33 identity and the attendance details provided for them, indicating
1.34 - whether the update is being done 'for_organiser' (for the organiser of
1.35 + whether the update is being done 'as_organiser' (for the organiser of
1.36 an event) or not.
1.37 """
1.38
1.39 @@ -537,7 +537,7 @@
1.40 # organiser. Attendees do not have the opportunity to redefine the
1.41 # periods.
1.42
1.43 - obj = self.get_definitive_object(for_organiser)
1.44 + obj = self.get_definitive_object(as_organiser)
1.45 if not obj:
1.46 return
1.47
1.48 @@ -548,7 +548,7 @@
1.49 # Define an overriding transparency, the indicated event transparency,
1.50 # or the default transparency for the free/busy entry.
1.51
1.52 - transp = self.get_overriding_transparency(user, for_organiser) or \
1.53 + transp = self.get_overriding_transparency(user, as_organiser) or \
1.54 obj.get_value("TRANSP") or \
1.55 "OPAQUE"
1.56
1.57 @@ -573,7 +573,10 @@
1.58 # Remove periods for non-participating attendees.
1.59
1.60 if self.is_participating(user, for_organiser and not updating_other):
1.61 - self.update_freebusy(freebusy, user, for_organiser)
1.62 + self.update_freebusy(freebusy, user,
1.63 + for_organiser and not updating_other or
1.64 + not for_organiser and updating_other
1.65 + )
1.66 else:
1.67 self.remove_from_freebusy(freebusy)
1.68