[CalendarServer-changes] [12036] CalendarServer/trunk/txdav/caldav/datastore

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:25:08 PDT 2014


Revision: 12036
          http://trac.calendarserver.org//changeset/12036
Author:   cdaboo at apple.com
Date:     2013-12-04 18:50:05 -0800 (Wed, 04 Dec 2013)
Log Message:
-----------
Make sure iTIP cancel removes a resource when only hidden instances remain.

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

Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/itip.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/itip.py	2013-12-05 02:44:02 UTC (rev 12035)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/itip.py	2013-12-05 02:50:05 UTC (rev 12036)
@@ -309,8 +309,8 @@
             calendar_master.addProperty(Property("EXDATE", exdates))
 
         # See if there are still components in the calendar - we might have deleted the last overridden instance
-        # in which case the calendar object is empty (except for VTIMEZONEs).
-        if calendar.mainType() is None:
+        # in which case the calendar object is empty (except for VTIMEZONEs) or has only hidden components.
+        if calendar.mainType() is None or calendar.hasPropertyValueInAllComponents(Property(Component.HIDDEN_INSTANCE_PROPERTY, "T")):
             # Delete the now empty calendar object
             return True, True, None
         else:

Modified: CalendarServer/trunk/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/sql.py	2013-12-05 02:44:02 UTC (rev 12035)
+++ CalendarServer/trunk/txdav/caldav/datastore/sql.py	2013-12-05 02:50:05 UTC (rev 12036)
@@ -580,6 +580,14 @@
         returnValue(self._cachedCalendarResourcesForUID[uid])
 
 
+    def removedCalendarResource(self, uid):
+        """
+        Clean-up cache when resource is removed.
+        """
+        if hasattr(self, "_cachedCalendarResourcesForUID") and uid in self._cachedCalendarResourcesForUID:
+            del self._cachedCalendarResourcesForUID[uid]
+
+
     @inlineCallbacks
     def calendarObjectWithDropboxID(self, dropboxID):
         """
@@ -1069,6 +1077,12 @@
         returnValue(objectResource)
 
 
+    @inlineCallbacks
+    def removedObjectResource(self, child):
+        yield super(Calendar, self).removedObjectResource(child)
+        self.viewerHome().removedCalendarResource(child.uid())
+
+
     def calendarObjectsInTimeRange(self, start, end, timeZone):
         raise NotImplementedError()
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/5e67f53d/attachment.html>


More information about the calendarserver-changes mailing list