[CalendarServer-changes] [6467] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 25 19:02:19 PDT 2010


Revision: 6467
          http://trac.macosforge.org/projects/calendarserver/changeset/6467
Author:   sagen at apple.com
Date:     2010-10-25 19:02:17 -0700 (Mon, 25 Oct 2010)
Log Message:
-----------
If organizer is also an attendee, substitute the token email address within the attendee property as well as within the organizer property

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/mail.py
    CalendarServer/trunk/twistedcaldav/test/test_mail.py

Modified: CalendarServer/trunk/twistedcaldav/mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/mail.py	2010-10-25 20:21:13 UTC (rev 6466)
+++ CalendarServer/trunk/twistedcaldav/mail.py	2010-10-26 02:02:17 UTC (rev 6467)
@@ -883,12 +883,15 @@
             pre, post = serverAddress.split('@')
             addressWithToken = "%s+%s@%s" % (pre, token, post)
 
-            calendar.getOrganizerProperty().setValue("mailto:%s" %
-                (addressWithToken,))
+            organizerProperty = calendar.getOrganizerProperty()
+            organizerValue = organizerProperty.value()
+            organizerProperty.setValue("mailto:%s" % (addressWithToken,))
 
-            originatorAttendee = calendar.getAttendeeProperty([originator])
-            if originatorAttendee is not None:
-                originatorAttendee.setValue("mailto:%s" % (addressWithToken,))
+            # If the organizer is also an attendee, update that attendee value
+            # to match
+            organizerAttendeeProperty = calendar.getAttendeeProperty([organizerValue])
+            if organizerAttendeeProperty is not None:
+                organizerAttendeeProperty.setValue("mailto:%s" % (addressWithToken,))
 
             # The email's From will include the originator's real name email
             # address if available.  Otherwise it will be the server's email

Modified: CalendarServer/trunk/twistedcaldav/test/test_mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_mail.py	2010-10-25 20:21:13 UTC (rev 6466)
+++ CalendarServer/trunk/twistedcaldav/test/test_mail.py	2010-10-26 02:02:17 UTC (rev 6467)
@@ -259,6 +259,15 @@
                 self.assertEquals(actualReplyTo,
                     "server+%s at example.com" % (token,))
 
+                # Make sure attendee property for organizer exists and matches
+                # the CUA of the organizer property
+                orgValue = actualCalendar.getOrganizerProperty().value()
+                self.assertEquals(
+                    orgValue,
+                    actualCalendar.getAttendeeProperty([orgValue]).value()
+                )
+
+
             else: # Reply only -- the attendee is local, and server is sending
                   # reply to remote organizer
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101025/8298b904/attachment-0001.html>


More information about the calendarserver-changes mailing list