[CalendarServer-changes] [12883] CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav /datastore/scheduling
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 14:10:37 PDT 2014
Revision: 12883
http://trac.calendarserver.org//changeset/12883
Author: cdaboo at apple.com
Date: 2014-03-12 14:10:37 -0700 (Wed, 12 Mar 2014)
Log Message:
-----------
Make sure SCHEDULE-AGENT=CLIENT events get properly upgraded to SCHEDULE-AGENT=SERVER when the organizer
adds the attendee to the event.
Modified Paths:
--------------
CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/itip.py
CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/test/test_itip.py
Modified: CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/itip.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/itip.py 2014-03-12 19:59:21 UTC (rev 12882)
+++ CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/itip.py 2014-03-12 21:10:37 UTC (rev 12883)
@@ -109,6 +109,10 @@
# Ignore out of sequence message
return None, None
+ # Special check: if the SCHEDULE-AGENT is being changed throw away all the existing data
+ if calendar.getOrganizerScheduleAgent() != itip_message.getOrganizerScheduleAgent():
+ return (iTipProcessing.processNewRequest(itip_message, recipient, creating=True), {})
+
# Merge Organizer data with Attendee's own changes (VALARMs, Comment only for now).
from txdav.caldav.datastore.scheduling.icaldiff import iCalDiff
rids = iCalDiff(calendar, itip_message, False).whatIsDifferent()
Modified: CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/test/test_itip.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/test/test_itip.py 2014-03-12 19:59:21 UTC (rev 12882)
+++ CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/test/test_itip.py 2014-03-12 21:10:37 UTC (rev 12883)
@@ -238,6 +238,74 @@
self.assertEqual(changed, calendar, msg="Calendar mismatch: %s" % (title,))
+ def test_processRequest_scheduleAgentChange(self):
+ """
+ Test iTIPProcessing.processRequest properly replaces a SCHEDULE-AGENT=CLIENT component with a
+ SCHEDULE-AGENT=SERVER one.
+ """
+
+ data = (
+ (
+ "1.1 Simple Reply - non recurring",
+ """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890-1
+DTSTART:20071114T000000Z
+DURATION:PT1H
+DTSTAMP:20071114T000000Z
+ATTENDEE:mailto:user01 at example.com
+ORGANIZER;SCHEDULE-AGENT=CLIENT:mailto:user01 at example.com
+SUMMARY:Test - original
+END:VEVENT
+END:VCALENDAR
+""",
+ """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+METHOD:REQUEST
+BEGIN:VEVENT
+UID:12345-67890-1
+DTSTART:20071114T000000Z
+DURATION:PT1H
+DTSTAMP:20071114T000000Z
+ATTENDEE:mailto:user01 at example.com
+ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:user02 at example.com
+ORGANIZER:mailto:user01 at example.com
+SUMMARY:Test - update
+END:VEVENT
+END:VCALENDAR
+""",
+ """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890-1
+DTSTART:20071114T000000Z
+DURATION:PT1H
+DTSTAMP:20071114T000000Z
+ATTENDEE:mailto:user01 at example.com
+ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:user02 at example.com
+ORGANIZER:mailto:user01 at example.com
+SUMMARY:Test - update
+TRANSP:TRANSPARENT
+END:VEVENT
+END:VCALENDAR
+""",
+ ),
+ )
+
+ for title, calendar_txt, itip_txt, changed_txt in data:
+ calendar = Component.fromString(calendar_txt)
+ itip = Component.fromString(itip_txt)
+ changed = Component.fromString(changed_txt)
+
+ result, rids = iTipProcessing.processRequest(itip, calendar, "mailto:user02 at example.com")
+ self.assertEqual(len(rids), 0)
+ self.assertEqual(result, changed, msg="Calendar mismatch: %s" % (title,))
+
+
def test_update_attendee_partstat(self):
data = (
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/97cc719f/attachment-0001.html>
More information about the calendarserver-changes
mailing list