# HG changeset patch # User Paul Boddie # Date 1444827365 -7200 # Node ID 6e83b9a9a6099de43fed51ae7bf95500b6d14d56 # Parent 2af42e8a59ccdce3b6ab536d3164a5a61f422059 Added initial support for publishing events to their senders' addresses, thus keeping mail/calendar clients updated about SEQUENCE changes. diff -r 2af42e8a59cc -r 6e83b9a9a609 imipweb/resource.py --- a/imipweb/resource.py Wed Oct 14 14:55:02 2015 +0200 +++ b/imipweb/resource.py Wed Oct 14 14:56:05 2015 +0200 @@ -259,12 +259,22 @@ def _send_message(self, sender, recipients, parts): - # Explicitly specify the outgoing BCC recipient since we are sending as - # the generic calendar user. + """ + Send a message, explicitly specifying the 'sender' as an outgoing BCC + recipient since the generic calendar user will be the actual sender. + """ message = self.messenger.make_outgoing_message(parts, recipients, outgoing_bcc=sender) self.messenger.sendmail(recipients, message.as_string(), outgoing_bcc=sender) + def _send_message_to_self(self, parts): + + "Send a message composed of the given 'parts' to the given user." + + sender = get_address(self.user) + message = self.messenger.make_outgoing_message(parts, [sender]) + self.messenger.sendmail([sender], message.as_string()) + # Action methods. def process_declined_counter(self, attendee): @@ -359,6 +369,12 @@ self.send_message("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 + # address. + + self._send_message_to_self([self.obj.to_part("PUBLISH")]) + return True class FormUtilities: