[CalendarServer-changes] [4071] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu Apr 23 12:53:23 PDT 2009
Revision: 4071
http://trac.macosforge.org/projects/calendarserver/changeset/4071
Author: cdaboo at apple.com
Date: 2009-04-23 12:53:23 -0700 (Thu, 23 Apr 2009)
Log Message:
-----------
Remove duplicate ATTENDEE properties when scheduling.
Modified Paths:
--------------
CalendarServer/trunk/run
CalendarServer/trunk/twistedcaldav/ical.py
CalendarServer/trunk/twistedcaldav/scheduling/implicit.py
Modified: CalendarServer/trunk/run
===================================================================
--- CalendarServer/trunk/run 2009-04-23 19:45:46 UTC (rev 4070)
+++ CalendarServer/trunk/run 2009-04-23 19:53:23 UTC (rev 4071)
@@ -724,7 +724,7 @@
caldavtester="${top}/CalDAVTester";
-svn_get "CalDAVTester" "${caldavtester}" "${svn_uri_base}/CalDAVTester/trunk" 4068;
+svn_get "CalDAVTester" "${caldavtester}" "${svn_uri_base}/CalDAVTester/trunk" 4070;
#
# PyFlakes
Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py 2009-04-23 19:45:46 UTC (rev 4070)
+++ CalendarServer/trunk/twistedcaldav/ical.py 2009-04-23 19:53:23 UTC (rev 4071)
@@ -1431,7 +1431,7 @@
def getAttendees(self):
"""
- Get the organizer value. Works on either a VCALENDAR or on a component.
+ Get the attendee 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: a C{list} of the string values of the Attendee property, or None
@@ -1448,10 +1448,12 @@
return None
- def getAttendeesByInstance(self):
+ def getAttendeesByInstance(self, makeUnique=False):
"""
- Get the organizer value for each instance.
+ Get the attendee values for each instance. Optionally remove duplicates.
+ @param makeUnique: if C{True} remove duplicate ATTENDEEs in each component
+ @type makeUnique: C{bool}
@return: a list of tuples of (organizer value, recurrence-id)
"""
@@ -1460,13 +1462,19 @@
result = ()
for component in self.subcomponents():
if component.name() != "VTIMEZONE":
- result += component.getAttendeesByInstance()
+ result += component.getAttendeesByInstance(makeUnique)
return result
else:
result = ()
+ attendees = set()
rid = self.getRecurrenceIDUTC()
- for attendee in self.properties("ATTENDEE"):
- result += ((attendee.value(), rid),)
+ for attendee in tuple(self.properties("ATTENDEE")):
+ cuaddr = attendee.value()
+ if makeUnique and cuaddr in attendees:
+ self.removeProperty(attendee)
+ else:
+ result += ((cuaddr, rid),)
+ attendees.add(cuaddr)
return result
def getAttendeeProperty(self, match):
Modified: CalendarServer/trunk/twistedcaldav/scheduling/implicit.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/implicit.py 2009-04-23 19:45:46 UTC (rev 4070)
+++ CalendarServer/trunk/twistedcaldav/scheduling/implicit.py 2009-04-23 19:53:23 UTC (rev 4071)
@@ -319,7 +319,7 @@
raise HTTPError(ErrorResponse(responsecode.FORBIDDEN, (caldav_namespace, "single-organizer")))
# Get the ATTENDEEs
- self.attendeesByInstance = self.calendar.getAttendeesByInstance()
+ self.attendeesByInstance = self.calendar.getAttendeesByInstance(True)
self.attendees = set()
for attendee, _ignore in self.attendeesByInstance:
self.attendees.add(attendee)
@@ -707,7 +707,7 @@
self.oldcalendar = None
# Determine whether the current change is allowed
- changeAllowed, doITipReply, changedRids, newCalendar = self.isAttendeeChangeInsignificant()
+ changeAllowed, doITipReply, _ignore_changedRids, newCalendar = self.isAttendeeChangeInsignificant()
if changeAllowed:
self.return_calendar = self.calendar = newCalendar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090423/a6e58abc/attachment.html>
More information about the calendarserver-changes
mailing list