[CalendarServer-changes] [2671] CalendarServer/branches/users/sagen/xmpp/twistedcaldav/notify.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Jul 9 11:41:34 PDT 2008
Revision: 2671
http://trac.macosforge.org/projects/calendarserver/changeset/2671
Author: sagen at apple.com
Date: 2008-07-09 11:41:34 -0700 (Wed, 09 Jul 2008)
Log Message:
-----------
A more flexible way to specify node config
Modified Paths:
--------------
CalendarServer/branches/users/sagen/xmpp/twistedcaldav/notify.py
Modified: CalendarServer/branches/users/sagen/xmpp/twistedcaldav/notify.py
===================================================================
--- CalendarServer/branches/users/sagen/xmpp/twistedcaldav/notify.py 2008-07-09 17:40:34 UTC (rev 2670)
+++ CalendarServer/branches/users/sagen/xmpp/twistedcaldav/notify.py 2008-07-09 18:41:34 UTC (rev 2671)
@@ -425,6 +425,10 @@
pubsubNS = 'http://jabber.org/protocol/pubsub'
nodeNameFormat = '/Public/CalDAV/%s/%s'
+ nodeConfiguration = {
+ 'pubsub#deliver_payloads' : '0',
+ 'pubsub#persist_items' : '0',
+ }
def __init__(self, settings, reactor=None):
self.xmlStream = None
@@ -522,14 +526,12 @@
for field in formElement.elements():
if field.name == 'field':
- if field['var'] == 'pubsub#deliver_payloads':
- value = self._getChild(field, 'value')
- value.children = []
- value.addContent('0')
- elif field['var'] == 'pubsub#persist_items':
- value = self._getChild(field, 'value')
- value.children = []
- value.addContent('0')
+ value = self.nodeConfiguration.get(field['var'],
+ None)
+ if value is not None:
+ valueElement = self._getChild(field, 'value')
+ valueElement.children = []
+ valueElement.addContent(value)
filledForm.addChild(field)
filledIq.addCallback(self.responseFromConfiguration,
nodeName)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080709/cb58d428/attachment.html
More information about the calendarserver-changes
mailing list