1.1 --- a/imiptools/client.py Mon Jul 27 17:05:49 2015 +0200
1.2 +++ b/imiptools/client.py Mon Jul 27 19:50:38 2015 +0200
1.3 @@ -126,32 +126,6 @@
1.4
1.5 # Common operations on calendar data.
1.6
1.7 - def is_participating(self, user, as_organiser=False):
1.8 -
1.9 - """
1.10 - Return whether, subject to the 'user' indicating an identity and the
1.11 - 'as_organiser' status of that identity, the user concerned is actually
1.12 - participating in the current object event.
1.13 - """
1.14 -
1.15 - attr = self.get_attendance(user)
1.16 - return as_organiser or not attr or attr.get("PARTSTAT") != "DECLINED"
1.17 -
1.18 - def get_overriding_transparency(self, user, as_organiser=False):
1.19 -
1.20 - """
1.21 - Return the overriding transparency to be associated with the free/busy
1.22 - records for an event, subject to the 'user' indicating an identity and
1.23 - the 'as_organiser' status of that identity.
1.24 -
1.25 - Where an identity is only an organiser and not attending, "ORG" is
1.26 - returned. Otherwise, no overriding transparency is defined and None is
1.27 - returned.
1.28 - """
1.29 -
1.30 - attr = self.get_attendance(user)
1.31 - return as_organiser and not (attr and attr.get("PARTSTAT")) and "ORG" or None
1.32 -
1.33 def update_participation(self, obj, partstat=None):
1.34
1.35 """
1.36 @@ -311,6 +285,32 @@
1.37 attendees = uri_dict(self.obj.get_value_map("ATTENDEE"))
1.38 return attendees.get(user or self.user) or {}
1.39
1.40 + def is_participating(self, user, as_organiser=False):
1.41 +
1.42 + """
1.43 + Return whether, subject to the 'user' indicating an identity and the
1.44 + 'as_organiser' status of that identity, the user concerned is actually
1.45 + participating in the current object event.
1.46 + """
1.47 +
1.48 + attr = self.get_attendance(user)
1.49 + return as_organiser or not attr or attr.get("PARTSTAT") != "DECLINED"
1.50 +
1.51 + def get_overriding_transparency(self, user, as_organiser=False):
1.52 +
1.53 + """
1.54 + Return the overriding transparency to be associated with the free/busy
1.55 + records for an event, subject to the 'user' indicating an identity and
1.56 + the 'as_organiser' status of that identity.
1.57 +
1.58 + Where an identity is only an organiser and not attending, "ORG" is
1.59 + returned. Otherwise, no overriding transparency is defined and None is
1.60 + returned.
1.61 + """
1.62 +
1.63 + attr = self.get_attendance(user)
1.64 + return as_organiser and not (attr and attr.get("PARTSTAT")) and "ORG" or None
1.65 +
1.66 def is_attendee(self, identity, obj=None):
1.67
1.68 """