changeset 83:f3f31aa491df

Fix handling of node creation. Announce pubsub#retrieve-items disco feature in ComponentServiceFromItemRetrievalService.
author Ralph Meijer <ralphm@ik.nu>
date Tue, 09 Nov 2004 15:57:23 +0000
parents 758cb81b97ce
children 34be83a0bd2e
files idavoll/pubsub.py
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/idavoll/pubsub.py	Tue Nov 09 14:54:17 2004 +0000
+++ b/idavoll/pubsub.py	Tue Nov 09 15:57:23 2004 +0000
@@ -304,10 +304,11 @@
         return d
 
     def return_create_response(self, result, iq):
-        if iq.pubsub.create["node"] is None:
+        node_id = iq.pubsub.create.getAttribute("node")
+        if not node_id or node_id != result:
             reply = domish.Element((NS_PUBSUB, 'pubsub'))
             entity = reply.addElement('create')
-            entity['node'] = result['node_id']
+            entity['node'] = result
             return [reply]
 
     def onConfigureGet(self, iq):
@@ -355,6 +356,14 @@
     def componentConnected(self, xmlstream):
         xmlstream.addObserver(PUBSUB_ITEMS, self.onItems)
 
+    def get_disco_info(self, node):
+        info = []
+
+        if not node:
+            info.append(disco.Feature(NS_PUBSUB + "#retrieve-items"))
+
+        return defer.succeed(info)
+
     def onItems(self, iq):
         self.handler_wrapper(self._onItems, iq)