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

source_changes at macosforge.org source_changes at macosforge.org
Tue Jul 12 13:18:10 PDT 2011


Revision: 7778
          http://trac.macosforge.org/projects/calendarserver/changeset/7778
Author:   sagen at apple.com
Date:     2011-07-12 13:18:08 -0700 (Tue, 12 Jul 2011)
Log Message:
-----------
Handle non-ascii orgzanizer CN, and non-existent attendee CN in IMIP

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	2011-07-12 19:18:02 UTC (rev 7777)
+++ CalendarServer/trunk/twistedcaldav/mail.py	2011-07-12 20:18:08 UTC (rev 7778)
@@ -854,7 +854,9 @@
         for attendeeProp in calendar.getAllAttendeeProperties():
             cutype = attendeeProp.parameterValue("CUTYPE", "INDIVIDUAL")
             if cutype == "INDIVIDUAL":
-                cn = attendeeProp.parameterValue("CN", None).decode("utf-8")
+                cn = attendeeProp.parameterValue("CN", None)
+                if cn is not None:
+                    cn = cn.decode("utf-8")
                 cuaddr = normalizeCUAddr(attendeeProp.value())
                 if cuaddr.startswith("mailto:"):
                     mailto = cuaddr[7:]
@@ -922,7 +924,7 @@
                 cn = 'Calendar Server'
                 orgCN = orgEmail
             else:
-                orgCN = cn
+                orgCN = cn.decode("utf-8")
             formattedFrom = "%s <%s>" % (cn, fromAddr)
 
             # Reply-to address will be the server+token address

Modified: CalendarServer/trunk/twistedcaldav/test/test_mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_mail.py	2011-07-12 19:18:02 UTC (rev 7777)
+++ CalendarServer/trunk/twistedcaldav/test/test_mail.py	2011-07-12 20:18:08 UTC (rev 7778)
@@ -251,9 +251,10 @@
 DTSTART:20100325T154500Z
 DTEND:20100325T164500Z
 ATTENDEE;CN=Th\xe9 Attendee;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:attendee at example.com
-ATTENDEE;CN=The Organizer;CUTYPE=INDIVIDUAL;EMAIL=organizer at example.com;PARTSTAT=ACCEPTED:urn:uuid:C3B38B00-4166-11DD-B22C-A07C87E02F6A
+ATTENDEE;CN=Th\xe9 Organizer;CUTYPE=INDIVIDUAL;EMAIL=organizer at example.com;PARTSTAT=ACCEPTED:urn:uuid:C3B38B00-4166-11DD-B22C-A07C87E02F6A
 ATTENDEE;CN=An Attendee without CUTYPE;EMAIL=nocutype at example.com;PARTSTAT=ACCEPTED:urn:uuid:4DB528DC-3E60-44FA-9546-2A00FCDCFFAB
-ORGANIZER;CN=The Organizer;EMAIL=organizer at example.com:urn:uuid:C3B38B00-4166-11DD-B22C-A07C87E02F6A
+ATTENDEE;EMAIL=nocn at example.com;PARTSTAT=ACCEPTED:urn:uuid:A592CF8B-4FC8-4E4F-B543-B2F29A7EEB0B
+ORGANIZER;CN=Th\xe9 Organizer;EMAIL=organizer at example.com:urn:uuid:C3B38B00-4166-11DD-B22C-A07C87E02F6A
 SUMMARY:t\xe9sting outbound( )
 END:VEVENT
 END:VCALENDAR
@@ -263,13 +264,14 @@
                 "mailto:attendee at example.com",
                 "new",
                 "organizer at example.com",
-                "The Organizer",
+                u"Th\xe9 Organizer",
                 [
                     (u'Th\xe9 Attendee', u'attendee at example.com'),
-                    (u'The Organizer', u'organizer at example.com'),
+                    (u'Th\xe9 Organizer', u'organizer at example.com'),
                     (u'An Attendee without CUTYPE', u'nocutype at example.com'),
+                    (None, u'nocn at example.com'),
                 ],
-                "The Organizer <organizer at example.com>",
+                "Th\xc3\xa9 Organizer <organizer at example.com>",
                 "attendee at example.com",
             ),
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110712/176fb46a/attachment.html>


More information about the calendarserver-changes mailing list