# HG changeset patch # User Paul Boddie # Date 1445699699 -7200 # Node ID ef84998441fd46c0ffc157b12e92b76ddd50e1e0 # Parent 656236368d8a1e233f5ea0500f02a64849ebd543 Regard NEEDS-ACTION as not participating in an event. Hold requests where attendees do not indicate participation. diff -r 656236368d8a -r ef84998441fd imiptools/client.py --- a/imiptools/client.py Sat Oct 24 16:12:06 2015 +0200 +++ b/imiptools/client.py Sat Oct 24 17:14:59 2015 +0200 @@ -787,8 +787,19 @@ # Use any attendee property information for an organiser, not the # organiser property attributes. - attr = self.get_attendance(user, obj=obj) - return as_organiser or attr is not None and not attr or attr and attr.get("PARTSTAT") != "DECLINED" + attr = self.get_attendance(user, obj) + return as_organiser or attr is not None and not attr or attr and attr.get("PARTSTAT") not in ("DECLINED", "NEEDS-ACTION") + + def has_indicated_attendance(self, user=None, obj=None): + + """ + Return whether the given 'user' (or the current user if not specified) + has indicated attendance in the given 'obj' (or the current object if + not specified). + """ + + attr = self.get_attendance(user, obj) + return attr and attr.get("PARTSTAT") not in (None, "NEEDS-ACTION") def get_overriding_transparency(self, user, as_organiser=False): diff -r 656236368d8a -r ef84998441fd imiptools/handlers/person_outgoing.py --- a/imiptools/handlers/person_outgoing.py Sat Oct 24 16:12:06 2015 +0200 +++ b/imiptools/handlers/person_outgoing.py Sat Oct 24 17:14:59 2015 +0200 @@ -128,7 +128,8 @@ # Remove any associated request. - self.store.dequeue_request(self.user, self.uid, self.recurrenceid) + if from_organiser or self.has_indicated_attendance(): + self.store.dequeue_request(self.user, self.uid, self.recurrenceid) self.store.remove_counters(self.user, self.uid, self.recurrenceid) # Update free/busy information. diff -r 656236368d8a -r ef84998441fd imipweb/event.py --- a/imipweb/event.py Sat Oct 24 16:12:06 2015 +0200 +++ b/imipweb/event.py Sat Oct 24 17:14:59 2015 +0200 @@ -877,7 +877,8 @@ # Process the object and remove it from the list of requests. if reply and self.process_received_request(changed): - self.remove_request() + if self.has_indicated_attendance(): + self.remove_request() elif self.is_organiser() and (invite or cancel):