[CalendarServer-changes] [1061] CalendarServer/trunk/twistedcaldav/ical.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 18 12:05:09 PST 2007


Revision: 1061
          http://trac.macosforge.org/projects/calendarserver/changeset/1061
Author:   cdaboo at apple.com
Date:     2007-01-18 12:05:09 -0800 (Thu, 18 Jan 2007)

Log Message:
-----------
Fix problem with trailing / issue in principal URIs causing ATTENDEE property to be missing in VFREEBUSY responses.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/ical.py

Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py	2007-01-18 19:59:04 UTC (rev 1060)
+++ CalendarServer/trunk/twistedcaldav/ical.py	2007-01-18 20:05:09 UTC (rev 1061)
@@ -944,8 +944,20 @@
         @param match: a C{list} of calendar user address strings to try and match.
         @return: the string value of the Organizer property, or None
         """
-        # FIXME: match argument is unused (except in recursion...)
         
+        # FIXME: we should really have a URL class and have it manage comparisons
+        # in a sensible fashion.
+        def _normalizeCUAddress(addr):
+            if addr.startswith("/") or addr.startswith("http:") or addr.startswith("https:"):
+                return addr.rstrip("/")
+            else:
+                return addr
+
+        # Need to normalize http/https cu addresses
+        test = set()
+        for item in match:
+           test.add(_normalizeCUAddress(item))
+        
         # Extract appropriate sub-component if this is a VCALENDAR
         if self.name() == "VCALENDAR":
             for component in self.subcomponents():
@@ -955,7 +967,7 @@
             try:
                 # Find the primary subcomponent
                 for p in self.properties("ATTENDEE"):
-                    if p.value() in match:
+                    if _normalizeCUAddress(p.value()) in test:
                         return p
             except:
                 pass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070118/59c86f9b/attachment.html


More information about the calendarserver-changes mailing list