[CalendarServer-changes] [14014] CalendarServer/branches/release/CalendarServer-6.0-dev/ twistedcaldav/storebridge.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Sep 25 13:32:56 PDT 2014
Revision: 14014
http://trac.calendarserver.org//changeset/14014
Author: sagen at apple.com
Date: 2014-09-25 13:32:56 -0700 (Thu, 25 Sep 2014)
Log Message:
-----------
Handle old notification format
Modified Paths:
--------------
CalendarServer/branches/release/CalendarServer-6.0-dev/twistedcaldav/storebridge.py
Modified: CalendarServer/branches/release/CalendarServer-6.0-dev/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-6.0-dev/twistedcaldav/storebridge.py 2014-09-25 20:29:01 UTC (rev 14013)
+++ CalendarServer/branches/release/CalendarServer-6.0-dev/twistedcaldav/storebridge.py 2014-09-25 20:32:56 UTC (rev 14014)
@@ -3914,6 +3914,14 @@
if qname == customxml.NotificationType.qname():
jsontype = self._newStoreObject.notificationType()
+
+ # FIXME: notificationType( ) does not always return json; it can
+ # currently return a utf-8 encoded str of XML
+ if isinstance(jsontype, str):
+ returnValue(
+ davxml.WebDAVDocument.fromString(jsontype).root_element
+ )
+
if jsontype["notification-type"] == "invite-notification":
typeAttr = {"shared-type": jsontype["shared-type"]}
xmltype = customxml.InviteNotification(**typeAttr)
@@ -3938,6 +3946,12 @@
def text(self, ignored=None):
assert ignored is None, "This is a notification object, not a notification"
jsondata = (yield self._newStoreObject.notificationData())
+
+ # FIXME: notificationData( ) does not always return json; it can
+ # currently return a utf-8 encoded str of XML
+ if isinstance(jsondata, str):
+ returnValue(jsondata)
+
if jsondata["notification-type"] == "invite-notification":
ownerPrincipal = yield self.principalForUID(jsondata["owner"])
ownerCN = ownerPrincipal.displayName()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140925/7b00feef/attachment-0001.html>
More information about the calendarserver-changes
mailing list