[CalendarServer-changes] [3099] CalendarServer/trunk/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Thu Oct 2 08:54:33 PDT 2008
Revision: 3099
http://trac.macosforge.org/projects/calendarserver/changeset/3099
Author: cdaboo at apple.com
Date: 2008-10-02 08:54:33 -0700 (Thu, 02 Oct 2008)
Log Message:
-----------
Fix to make sure attendees in overridden components only can be properly cancelled.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/ical.py
CalendarServer/trunk/twistedcaldav/scheduling/implicit.py
CalendarServer/trunk/twistedcaldav/scheduling/itip.py
Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py 2008-10-02 01:09:19 UTC (rev 3098)
+++ CalendarServer/trunk/twistedcaldav/ical.py 2008-10-02 15:54:33 UTC (rev 3099)
@@ -1206,12 +1206,13 @@
Get the attendees matching a value. Works on either a VCALENDAR or on a component.
@param match: a C{list} of calendar user address strings to try and match.
- @return: the string value of the Organizer property, or None
+ @return: the matching Attendee property, or None
"""
# FIXME: we should really have a URL class and have it manage comparisons
# in a sensible fashion.
def _normalizeCUAddress(addr):
+ addr = addr.lower()
if addr.startswith("/") or addr.startswith("http:") or addr.startswith("https:"):
return addr.rstrip("/")
else:
@@ -1226,12 +1227,14 @@
if self.name() == "VCALENDAR":
for component in self.subcomponents():
if component.name() != "VTIMEZONE":
- return component.getAttendeeProperty(match)
+ attendee = component.getAttendeeProperty(match)
+ if attendee is not None:
+ return attendee
else:
# Find the primary subcomponent
- for p in self.properties("ATTENDEE"):
- if _normalizeCUAddress(p.value()) in test:
- return p
+ for attendee in self.properties("ATTENDEE"):
+ if _normalizeCUAddress(attendee.value()) in test:
+ return attendee
return None
Modified: CalendarServer/trunk/twistedcaldav/scheduling/implicit.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/implicit.py 2008-10-02 01:09:19 UTC (rev 3098)
+++ CalendarServer/trunk/twistedcaldav/scheduling/implicit.py 2008-10-02 15:54:33 UTC (rev 3099)
@@ -360,7 +360,7 @@
if None in rids:
# One big CANCEL will do
- itipmsg = iTipGenerator.generateCancel(self.oldcalendar, (attendee,), None)
+ itipmsg = iTipGenerator.generateCancel(self.oldcalendar, (attendee,), None, self.deleting)
else:
# Multiple CANCELs
itipmsg = iTipGenerator.generateCancel(self.oldcalendar, (attendee,), rids)
Modified: CalendarServer/trunk/twistedcaldav/scheduling/itip.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/itip.py 2008-10-02 01:09:19 UTC (rev 3098)
+++ CalendarServer/trunk/twistedcaldav/scheduling/itip.py 2008-10-02 15:54:33 UTC (rev 3099)
@@ -414,7 +414,7 @@
class iTipGenerator(object):
@staticmethod
- def generateCancel(original, attendees, instances=None):
+ def generateCancel(original, attendees, instances=None, full_cancel=False):
itip = Component("VCALENDAR")
itip.addProperty(Property("VERSION", "2.0"))
@@ -465,7 +465,10 @@
# Extract the matching attendee property
for attendee in attendees:
- attendeeProp = instance.getAttendeeProperty((attendee,))
+ if full_cancel:
+ attendeeProp = original.getAttendeeProperty((attendee,))
+ else:
+ attendeeProp = instance.getAttendeeProperty((attendee,))
assert attendeeProp is not None, "Must have matching ATTENDEE property"
comp.addProperty(attendeeProp)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081002/a426f11a/attachment.html
More information about the calendarserver-changes
mailing list