# HG changeset patch # User Paul Boddie # Date 1445087241 -7200 # Node ID ab46a1372656ac00ad2569fc7fc91300f2b30c53 # Parent 2f6b754ee91c08b7b8857513cdcc1f74162349f7 Removed the method parameter and made the parts parameter obligatory for the send_message method. diff -r 2f6b754ee91c -r ab46a1372656 imipweb/resource.py --- a/imipweb/resource.py Sat Oct 17 01:06:38 2015 +0200 +++ b/imipweb/resource.py Sat Oct 17 15:07:21 2015 +0200 @@ -219,17 +219,15 @@ # Communication methods. - def send_message(self, method, sender, from_organiser, parts=None): + def send_message(self, parts, sender, from_organiser): """ - Create a full calendar object employing the given 'method', and send it - to the appropriate recipients, also sending a copy to the 'sender'. The - 'from_organiser' value indicates whether the organiser is sending this - message (and is thus equivalent to "as organiser"). + Send the given 'parts' to the appropriate recipients, also sending a + copy to the 'sender'. The 'from_organiser' value indicates whether the + organiser is sending this message (and is thus equivalent to "as + organiser"). """ - parts = parts or [self.obj.to_part(method)] - # As organiser, send an invitation to attendees, excluding oneself if # also attending. The updated event will be saved by the outgoing # handler. @@ -318,7 +316,7 @@ self.update_dtstamp() self.update_sequence(False) - self.send_message(changed and "COUNTER" or "REPLY", get_address(self.user), from_organiser=False) + self.send_message([self.obj.to_part(changed and "COUNTER" or "REPLY")], get_address(self.user), from_organiser=False) return True def process_created_request(self, method, to_cancel=None, to_unschedule=None): @@ -361,7 +359,7 @@ # Send the updated event, along with a cancellation for each of the # unscheduled occurrences. - self.send_message("CANCEL", get_address(organiser), from_organiser=True, parts=parts) + self.send_message(parts, get_address(organiser), from_organiser=True) # When cancelling, replace the attendees with those for whom the event # is now cancelled. @@ -372,7 +370,7 @@ # Send a cancellation to all uninvited attendees. - self.send_message("CANCEL", get_address(organiser), from_organiser=True) + self.send_message([self.obj.to_part("CANCEL")], get_address(organiser), from_organiser=True) # Since the organiser can update the SEQUENCE but this can leave any # mail/calendar client lagging, issue a PUBLISH message to the user's