[CalendarServer-changes] [1640] CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 2 16:30:53 PDT 2007


Revision: 1640
          http://trac.macosforge.org/projects/calendarserver/changeset/1640
Author:   wsanchez at apple.com
Date:     2007-07-02 16:30:50 -0700 (Mon, 02 Jul 2007)

Log Message:
-----------
Merge r1637 from trunk.

Modified Paths:
--------------
    CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/caldavxml.py
    CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/itip.py
    CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/schedule.py

Modified: CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/caldavxml.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/caldavxml.py	2007-07-02 23:23:30 UTC (rev 1639)
+++ CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/caldavxml.py	2007-07-02 23:30:50 UTC (rev 1640)
@@ -1443,34 +1443,6 @@
 
     allowed_children = { (davxml.dav_namespace, "href"): (0, None) } # NB Minimum is zero because this is a property name
 
-class ScheduleState (CalDAVElement):
-    """
-    A property on a schedule message in a schedule Inbox that indicates whether processing has taken place.
-    (CalDAV-schedule, section x.x.x)
-    """
-    name = "schedule-state"
-    hidden = True
-    protected = True
-
-    allowed_children = {
-        (caldav_namespace, "processed"): (0, 1),
-        (caldav_namespace, "not-processed"): (0, 1)
-    }
-
-class Processed (CalDAVEmptyElement):
-    """
-    Indicates that a schedule message in a schedule Inbox has been processed.
-    (CalDAV-schedule, section x.x.x)
-    """
-    name = "processed"
-
-class NotProcessed (CalDAVEmptyElement):
-    """
-    Indicates that a schedule message in a schedule Inbox has not been processed.
-    (CalDAV-schedule, section x.x.x)
-    """
-    name = "not-processed"
-
 class ScheduleInbox (CalDAVEmptyElement):
     """
     Denotes the resource type of a calendar schedule Inbox.

Modified: CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/itip.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/itip.py	2007-07-02 23:23:30 UTC (rev 1639)
+++ CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/itip.py	2007-07-02 23:30:50 UTC (rev 1640)
@@ -104,6 +104,7 @@
                       2. add to f-b-s calendar
           2. If not,
               1. remove the one we got - its 'stale'
+          3. Delete the request from the Inbox.
     
     @param request: the L{twisted.web2.server.Request} for the current request.
     @param principal: the L{CalendarPrincipalFile} principal resource for the principal we are dealing with.
@@ -246,9 +247,15 @@
             newchild = newchild.getResult()
             newInboxResource(child, newchild)
 
-        # Store CALDAV:schedule-state property
-        assert child.fp.exists()
-        child.writeDeadProperty(caldavxml.ScheduleState(caldavxml.Processed()))
+        # Remove the now processed incoming request.
+        try:
+            d = waitForDeferred(deleteResource(inbox, child.fp.basename()))
+            yield d
+            d.getResult()
+            logging.info("[ITIP]: deleted new iTIP message %s in Inbox because it has been processed." % (child.fp.basename(),))
+        except:
+            log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),))
+            raise iTipException
         yield None
         return
     else:
@@ -286,6 +293,7 @@
       2. Remove existing ones in Inbox.
       3. See if this updates existing ones in free-busy-set calendars.
       4. Remove existing ones in those calendars.
+      5. Remove the incoming request.
 
     NB Removal can be complex as we need to take RECURRENCE-ID into account - i.e a single
     instance may be cancelled. What we need to do for this is:
@@ -383,7 +391,7 @@
             cal = updatecal.iCalendar(calmatch[0])
             info = getSyncInfo(calmatch[0], cal)
             if compareSyncInfo(info, newinfo) < 0:
-                # Re-write existing resource with new one
+                # Delete existing resource which has been cancelled
                 try:
                     d = waitForDeferred(deleteResource(updatecal, calmatch[0],))
                     yield d
@@ -408,13 +416,15 @@
             # Nothing to do
             pass
         
-        # If we get here we have a new iTIP message that we want to process. Any previous ones
-        # have been removed (so we won't run in to problems when we check that there is free time
-        # to book the new one). 
-
-        # Store CALDAV:schedule-state property
-        assert child.fp.exists()
-        child.writeDeadProperty(caldavxml.ScheduleState(caldavxml.Processed()))
+        # Remove the now processed incoming request.
+        try:
+            d = waitForDeferred(deleteResource(inbox, child.fp.basename()))
+            yield d
+            d.getResult()
+            logging.info("[ITIP]: deleted new iTIP message %s in Inbox because it has been processed." % (child.fp.basename(),))
+        except:
+            log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),))
+            raise iTipException
         yield None
         return
     else:
@@ -631,7 +641,7 @@
 
 def newInboxResource(child, newchild):
     """
-    Copy recipient and orgnaizer properties from one iTIP resource, to another,
+    Copy recipient and organizer properties from one iTIP resource, to another,
     switching them as appropriate for a reply, and also set the state.
     
     @param child: the L{CalDAVFile} for the original iTIP message.
@@ -650,9 +660,6 @@
         if orig.children:
             # Store CALDAV:originator property
             newchild.writeDeadProperty(caldavxml.Recipient(davxml.HRef.fromString(str(orig.children[0]))))
-    
-    # Store CALDAV:schedule-state property
-    newchild.writeDeadProperty(caldavxml.ScheduleState(caldavxml.NotProcessed()))
   
 def deleteResource(collection, name):
     """

Modified: CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/schedule.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/schedule.py	2007-07-02 23:23:30 UTC (rev 1639)
+++ CalendarServer/branches/release/CalendarServer-1.0-dev/twistedcaldav/schedule.py	2007-07-02 23:30:50 UTC (rev 1640)
@@ -477,9 +477,6 @@
                         # Store CALDAV:recipient property
                         child.writeDeadProperty(caldavxml.Recipient(davxml.HRef(recipient)))
                     
-                        # Store CALDAV:schedule-state property
-                        child.writeDeadProperty(caldavxml.ScheduleState(caldavxml.NotProcessed()))
-                    
                         # Look for auto-schedule option
                         if principal.autoSchedule():
                             autoresponses.append((principal, inbox, child))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070702/05d3746e/attachment.html


More information about the calendarserver-changes mailing list