[CalendarServer-changes] [8422] CalendarServer/trunk/twistedcaldav/scheduling
source_changes at macosforge.org
source_changes at macosforge.org
Sun Dec 11 13:49:53 PST 2011
Revision: 8422
http://trac.macosforge.org/projects/calendarserver/changeset/8422
Author: cdaboo at apple.com
Date: 2011-12-11 13:49:51 -0800 (Sun, 11 Dec 2011)
Log Message:
-----------
Restore proper iTIP cancel sequence behavior.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/scheduling/itip.py
CalendarServer/trunk/twistedcaldav/scheduling/test/test_itip.py
Modified: CalendarServer/trunk/twistedcaldav/scheduling/itip.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/itip.py 2011-12-11 17:17:14 UTC (rev 8421)
+++ CalendarServer/trunk/twistedcaldav/scheduling/itip.py 2011-12-11 21:49:51 UTC (rev 8422)
@@ -1,5 +1,5 @@
##
-# Copyright (c) 2006-2009 Apple Inc. All rights reserved.
+# Copyright (c) 2006-2011 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -608,7 +608,9 @@
@staticmethod
def generateCancel(original, attendees, instances=None, full_cancel=False):
"""
- This assumes that SEQUENCE is already at its new value in the original calendar data.
+ This assumes that SEQUENCE is not already at its new value in the original calendar data. This
+ is because the component passed in is the one that originally contained the attendee that is
+ being removed.
"""
itip = Component("VCALENDAR")
@@ -637,7 +639,9 @@
# Add some required properties extracted from the original
comp.addProperty(Property("DTSTAMP", instance.propertyValue("DTSTAMP")))
comp.addProperty(Property("UID", instance.propertyValue("UID")))
- comp.addProperty(Property("SEQUENCE", instance.propertyValue("SEQUENCE") if instance.hasProperty("SEQUENCE") else 0))
+ seq = instance.propertyValue("SEQUENCE")
+ seq = int(seq) + 1 if seq else 1
+ comp.addProperty(Property("SEQUENCE", seq))
comp.addProperty(instance.getOrganizerProperty())
if instance_rid:
comp.addProperty(Property("RECURRENCE-ID", instance_rid.duplicate().adjustToUTC()))
Modified: CalendarServer/trunk/twistedcaldav/scheduling/test/test_itip.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/test/test_itip.py 2011-12-11 17:17:14 UTC (rev 8421)
+++ CalendarServer/trunk/twistedcaldav/scheduling/test/test_itip.py 2011-12-11 21:49:51 UTC (rev 8422)
@@ -1,5 +1,5 @@
##
-# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
+# Copyright (c) 2005-2011 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1739,7 +1739,7 @@
DTSTART:20071114T000000Z
ATTENDEE:mailto:user2 at example.com
ORGANIZER:mailto:user1 at example.com
-SEQUENCE:1
+SEQUENCE:2
END:VEVENT
END:VCALENDAR
""",
@@ -1772,7 +1772,7 @@
ATTENDEE:mailto:user3 at example.com
ATTENDEE:mailto:user2 at example.com
ORGANIZER:mailto:user1 at example.com
-SEQUENCE:2
+SEQUENCE:3
END:VEVENT
END:VCALENDAR
""",
@@ -1805,7 +1805,7 @@
DTSTART:20081114T000000Z
ATTENDEE:mailto:user2 at example.com
ORGANIZER:mailto:user1 at example.com
-SEQUENCE:1
+SEQUENCE:2
END:VEVENT
END:VCALENDAR
""",
@@ -1846,7 +1846,7 @@
DTSTART:20081114T010000Z
ATTENDEE:mailto:user2 at example.com
ORGANIZER:mailto:user1 at example.com
-SEQUENCE:1
+SEQUENCE:2
END:VEVENT
END:VCALENDAR
""",
@@ -1887,7 +1887,7 @@
ATTENDEE:mailto:user2 at example.com
ORGANIZER:mailto:user1 at example.com
RRULE:FREQ=YEARLY
-SEQUENCE:1
+SEQUENCE:2
END:VEVENT
END:VCALENDAR
""",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111211/105ec978/attachment.html>
More information about the calendarserver-changes
mailing list