1.1 --- a/imiptools/client.py Mon Oct 02 21:42:42 2017 +0200
1.2 +++ b/imiptools/client.py Tue Oct 03 21:36:04 2017 +0200
1.3 @@ -967,6 +967,18 @@
1.4 parts = [self.object_to_part("CANCEL", obj)]
1.5 return self.make_message_for_self(parts)
1.6
1.7 + def make_response_message(self, recipients, changed=False):
1.8 +
1.9 + """
1.10 + Prepare a response to 'recipients' for the current object with the
1.11 + indicated 'changed' state.
1.12 + """
1.13 +
1.14 + # NOTE: Might need updating to include rescheduled objects.
1.15 +
1.16 + parts = [self.object_to_part(changed and "COUNTER" or "REPLY", self.obj)]
1.17 + return self.make_message(parts, recipients, bcc_sender=True)
1.18 +
1.19 # Action methods.
1.20
1.21 def process_declined_counter(self, attendee):
1.22 @@ -1006,12 +1018,10 @@
1.23 if not self.update_event(changed):
1.24 return False
1.25
1.26 - parts = [self.object_to_part(changed and "COUNTER" or "REPLY", self.obj)]
1.27 -
1.28 # Create and send the response.
1.29
1.30 recipients = self.get_recipients()
1.31 - message = self.make_message(parts, recipients, bcc_sender=True)
1.32 + message = self.make_response_message(recipients, changed)
1.33 self.send_message(message, recipients, bcc_sender=True)
1.34
1.35 return True