[CalendarServer-changes] [13701] CalendarServer/trunk/txdav/caldav/datastore/scheduling/itip.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Jun 27 19:58:15 PDT 2014


Revision: 13701
          http://trac.calendarserver.org//changeset/13701
Author:   cdaboo at apple.com
Date:     2014-06-27 19:58:15 -0700 (Fri, 27 Jun 2014)
Log Message:
-----------
Make sure an attendee's version of a cancelled instance is the last variant they saw.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/caldav/datastore/scheduling/itip.py

Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/itip.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/itip.py	2014-06-28 02:52:12 UTC (rev 13700)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/itip.py	2014-06-28 02:58:15 UTC (rev 13701)
@@ -174,10 +174,17 @@
                         hidden = component.hasProperty(Component.HIDDEN_INSTANCE_PROPERTY)
                         new_component = new_calendar.deriveInstance(rid, allowCancelled=allowCancelled and not hidden)
                         if new_component is not None:
-                            new_calendar.addComponent(new_component)
-                            iTipProcessing.transferItems(calendar, new_component, needs_action_rids, reschedule, valarms, private_comments, transps, completeds, organizer_schedule_status, attendee, attendee_dtstamp, other_props, recipient)
-                            if hidden:
-                                new_component.addProperty(Property(Component.HIDDEN_INSTANCE_PROPERTY, "T"))
+                            # If the new component is not CANCELLED then add the one derived from the new master and
+                            # sync over attendee properties from the existing attendee data. However, if the new
+                            # component is cancelled, we need to preserve the original state of the attendee's
+                            # version as it may differ from the one derived from the new master.
+                            if allowCancelled:
+                                new_calendar.addComponent(component.duplicate())
+                            else:
+                                new_calendar.addComponent(new_component)
+                                iTipProcessing.transferItems(calendar, new_component, needs_action_rids, reschedule, valarms, private_comments, transps, completeds, organizer_schedule_status, attendee, attendee_dtstamp, other_props, recipient)
+                                if hidden:
+                                    new_component.addProperty(Property(Component.HIDDEN_INSTANCE_PROPERTY, "T"))
 
             iTipProcessing.addTranspForNeedsAction(new_calendar.subcomponents(), recipient)
 
@@ -298,7 +305,7 @@
                         overridden.replaceProperty(Property("STATUS", "CANCELLED"))
                         calendar.addComponent(overridden)
                         newseq = component.propertyValue("SEQUENCE")
-                        overridden.replacePropertyInAllComponents(Property("SEQUENCE", newseq))
+                        overridden.replaceProperty(Property("SEQUENCE", newseq))
 
         # If we have any EXDATEs lets add them to the existing calendar object.
         if exdates and calendar_master:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140627/7ad0530e/attachment.html>


More information about the calendarserver-changes mailing list