[CalendarServer-changes] [2798] CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Mon Aug 11 13:31:13 PDT 2008


Revision: 2798
          http://trac.macosforge.org/projects/calendarserver/changeset/2798
Author:   cdaboo at apple.com
Date:     2008-08-11 13:31:13 -0700 (Mon, 11 Aug 2008)
Log Message:
-----------
Better handling of ATTENDEE updates to detect valid/invalid changes.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav/ical.py
    CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav/scheduling/icaldiff.py

Modified: CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav/ical.py
===================================================================
--- CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav/ical.py	2008-08-11 20:30:24 UTC (rev 2797)
+++ CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav/ical.py	2008-08-11 20:31:13 UTC (rev 2798)
@@ -1266,6 +1266,19 @@
                 if component.name() == "VTIMEZONE":
                     continue
                 [component.removeProperty(p) for p in tuple(component.properties()) if p.name() not in keep_properties]
+                
+    def removeXProperties(self):
+        """
+        Remove all X- properties.
+        """
+
+        assert self.name() == "VCALENDAR", "Not a calendar: %r" % (self,)
+
+        if self.name() == "VCALENDAR":
+            for component in self.subcomponents():
+                if component.name() == "VTIMEZONE":
+                    continue
+                [component.removeProperty(p) for p in tuple(component.properties()) if p.name().startswith("X-")]
             
 ##
 # Dates and date-times

Modified: CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav/scheduling/icaldiff.py
===================================================================
--- CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav/scheduling/icaldiff.py	2008-08-11 20:30:24 UTC (rev 2797)
+++ CalendarServer/branches/users/cdaboo/implicit-2660/twistedcaldav/scheduling/icaldiff.py	2008-08-11 20:31:13 UTC (rev 2798)
@@ -57,7 +57,7 @@
 
     def attendeeMerge(self, attendee):
         """
-        Merge the ATTENDE specific changes with the organizer's view of the attendee's event.
+        Merge the ATTENDEE specific changes with the organizer's view of the attendee's event.
         This will remove any attempt by the attendee to change things like the time or location.
        
         @param attendee: the value of the ATTENDEE property corresponding to the attendee making the change
@@ -69,10 +69,12 @@
         # Do straight comparison without alarms
         self.calendar1 = self.calendar1.duplicate()
         self.calendar1.removeAlarms()
+        self.calendar1.removeXProperties()
         self.calendar1.attendeesView((attendee,))
 
         self.calendar2 = self.calendar2.duplicate()
         self.calendar2.removeAlarms()
+        self.calendar2.removeXProperties()
 
         if self.calendar1 == self.calendar2:
             return True, True
@@ -188,7 +190,11 @@
         
         # Only accept a change to this attendee's own ATTENDEE property
         propdiff = set(comp1.properties()) ^ set(comp2.properties())
-        for prop in propdiff:
+        for prop in tuple(propdiff):
+            # These ones are OK to change
+            if prop.name() in ("TRANSP", "DTSTAMP", "CREATED", "LAST-MODIFIED",):
+                propdiff.remove(prop)
+                continue
             if prop.name() != "ATTENDEE" or prop.value() != self.attendee:
                 log.debug("Component properties are different: %s" % (propdiff,))
                 return False, False
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080811/4e577af8/attachment.html 


More information about the calendarserver-changes mailing list