[CalendarServer-changes] [3038] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 23 20:12:01 PDT 2008


Revision: 3038
          http://trac.macosforge.org/projects/calendarserver/changeset/3038
Author:   cdaboo at apple.com
Date:     2008-09-23 20:12:01 -0700 (Tue, 23 Sep 2008)
Log Message:
-----------
Allow private comments to be enabled/disabled. Make sure DAV header has compliance string
when enabled.

Modified Paths:
--------------
    CalendarServer/trunk/conf/caldavd-test.plist
    CalendarServer/trunk/conf/caldavd.plist
    CalendarServer/trunk/twistedcaldav/config.py
    CalendarServer/trunk/twistedcaldav/customxml.py
    CalendarServer/trunk/twistedcaldav/resource.py
    CalendarServer/trunk/twistedcaldav/scheduling/itip.py

Modified: CalendarServer/trunk/conf/caldavd-test.plist
===================================================================
--- CalendarServer/trunk/conf/caldavd-test.plist	2008-09-24 02:46:14 UTC (rev 3037)
+++ CalendarServer/trunk/conf/caldavd-test.plist	2008-09-24 03:12:01 UTC (rev 3038)
@@ -455,6 +455,8 @@
         <true/>
         <key>DefaultCalendarProvisioned</key>
         <true/>
+        <key>EnablePrivateComments</key>
+        <true/>
       </dict>
 
       <!-- iSchedule protocol options -->

Modified: CalendarServer/trunk/conf/caldavd.plist
===================================================================
--- CalendarServer/trunk/conf/caldavd.plist	2008-09-24 02:46:14 UTC (rev 3037)
+++ CalendarServer/trunk/conf/caldavd.plist	2008-09-24 03:12:01 UTC (rev 3038)
@@ -343,6 +343,8 @@
         <true/>
         <key>DefaultCalendarProvisioned</key>
         <true/>
+        <key>EnablePrivateComments</key>
+        <true/>
       </dict>
 
       <!-- iSchedule protocol options -->

Modified: CalendarServer/trunk/twistedcaldav/config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/config.py	2008-09-24 02:46:14 UTC (rev 3037)
+++ CalendarServer/trunk/twistedcaldav/config.py	2008-09-24 03:12:01 UTC (rev 3038)
@@ -191,7 +191,8 @@
             "HTTPDomain"                 : "",    # Domain for http calendar user addresses on this server
             "AddressPatterns"            : [],    # Reg-ex patterns to match local calendar user addresses
             "OldDraftCompatability"      : True,  # Whether to maintain compatibility with non-implicit mode
-            "DefaultCalendarProvisioned" : True, # Whether the provisioned default calendar is marked as the scheduling default
+            "DefaultCalendarProvisioned" : True,  # Whether the provisioned default calendar is marked as the scheduling default
+            "EnablePrivateComments"      : True,  # Private comments from attendees to organizer
         },
 
         "iSchedule": {

Modified: CalendarServer/trunk/twistedcaldav/customxml.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/customxml.py	2008-09-24 02:46:14 UTC (rev 3037)
+++ CalendarServer/trunk/twistedcaldav/customxml.py	2008-09-24 03:12:01 UTC (rev 3038)
@@ -43,6 +43,10 @@
     "calendarserver-private-events",
 )
 
+calendarserver_private_comments_compliance = (
+    "calendarserver-private-comments",
+)
+
 class TwistedGUIDProperty (davxml.WebDAVTextElement):
     """
     Contains the GUID value for a directory record corresponding to a principal.

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2008-09-24 02:46:14 UTC (rev 3037)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2008-09-24 03:12:01 UTC (rev 3038)
@@ -78,6 +78,8 @@
             extra_compliance += customxml.calendarserver_proxy_compliance
         if config.EnablePrivateEvents:
             extra_compliance += customxml.calendarserver_private_events_compliance
+        if config.Scheduling["CalDAV"].get("EnablePrivateComments", True):
+            extra_compliance += customxml.calendarserver_private_comments_compliance
         return tuple(super(CalDAVComplianceMixIn, self).davComplianceClasses()) + extra_compliance
 
 

Modified: CalendarServer/trunk/twistedcaldav/scheduling/itip.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/itip.py	2008-09-24 02:46:14 UTC (rev 3037)
+++ CalendarServer/trunk/twistedcaldav/scheduling/itip.py	2008-09-24 03:12:01 UTC (rev 3038)
@@ -303,21 +303,24 @@
             partstat_changed = (oldpartstat != partstat)
             
             # Handle attendee comments
-            
-            # Look for X-CALENDARSERVER-PRIVATE-COMMENT property in iTIP component (State 1 in spec)
-            attendee_comment = tuple(from_component.properties("X-CALENDARSERVER-PRIVATE-COMMENT"))
-            attendee_comment = attendee_comment[0] if len(attendee_comment) else None
-            
-            # Look for matching X-CALENDARSERVER-ATTENDEE-COMMENT property in existing data (State 2 in spec)
-            private_comments = tuple(to_component.properties("X-CALENDARSERVER-ATTENDEE-COMMENT"))
-            for comment in private_comments:
-                params = comment.params()["X-CALENDARSERVER-ATTENDEE-REF"]
-                assert len(params) == 1, "Must be one and only one X-CALENDARSERVER-ATTENDEE-REF parameter in X-CALENDARSERVER-ATTENDEE-COMMENT"
-                param = params[0]
-                if param == attendee.value():
-                    private_comment = comment
-                    break
+            if config.Scheduling["CalDAV"].get("EnablePrivateComments", True):
+                # Look for X-CALENDARSERVER-PRIVATE-COMMENT property in iTIP component (State 1 in spec)
+                attendee_comment = tuple(from_component.properties("X-CALENDARSERVER-PRIVATE-COMMENT"))
+                attendee_comment = attendee_comment[0] if len(attendee_comment) else None
+                
+                # Look for matching X-CALENDARSERVER-ATTENDEE-COMMENT property in existing data (State 2 in spec)
+                private_comments = tuple(to_component.properties("X-CALENDARSERVER-ATTENDEE-COMMENT"))
+                for comment in private_comments:
+                    params = comment.params()["X-CALENDARSERVER-ATTENDEE-REF"]
+                    assert len(params) == 1, "Must be one and only one X-CALENDARSERVER-ATTENDEE-REF parameter in X-CALENDARSERVER-ATTENDEE-COMMENT"
+                    param = params[0]
+                    if param == attendee.value():
+                        private_comment = comment
+                        break
+                else:
+                    private_comment = None
             else:
+                attendee_comment = None
                 private_comment = None
                 
             # Now do update logic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080923/b459dd6d/attachment.html 


More information about the calendarserver-changes mailing list