changeset 93:ea3b2410c01c

Ignore unsupported configure and option elements. Return pubsub#item-ids feature.
author Ralph Meijer <ralphm@ik.nu>
date Wed, 17 Nov 2004 21:00:37 +0000
parents 878a5b7697f2
children bbebadd71d35
files idavoll/pubsub.py
diffstat 1 files changed, 8 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/idavoll/pubsub.py	Wed Nov 17 21:00:03 2004 +0000
+++ b/idavoll/pubsub.py	Wed Nov 17 21:00:37 2004 +0000
@@ -46,20 +46,10 @@
     stanza_error = 'feature-not-implemented'
     pubsub_error = 'subscription-options-unavailable'
 
-class SubscriptionOptionsUnavailable(Error):
-    stanza_error = 'not-acceptable'
-    pubsub_error = 'subscription-options-unavailable'
-
 class NodeNotConfigurable(Error):
     stanza_error = 'feature-not-implemented'
     pubsub_error = 'node-not-configurable'
 
-class CreateNodeNotConfigurable(Error):
-    stanza_error = 'not-acceptable'
-    pubsub_error = 'node-not-configurable'
-
-
-
 error_map = {
     backend.NotAuthorized:      ('not-authorized', None),
     backend.NodeNotFound:       ('item-not-found', None),
@@ -185,6 +175,14 @@
     def componentConnected(self, xmlstream):
         xmlstream.addObserver(PUBSUB_PUBLISH, self.onPublish)
 
+    def get_disco_info(self, node):
+        info = []
+
+        if not node:
+            info.append(disco.Feature(NS_PUBSUB + "#item-ids"))
+
+        return defer.succeed(info)
+
     def onPublish(self, iq):
         self.handler_wrapper(self._onPublish, iq)
 
@@ -223,9 +221,6 @@
         self.handler_wrapper(self._onSubscribe, iq)
 
     def _onSubscribe(self, iq):
-        if iq.pubsub.options:
-            raise SubscribeOptionsUnavailable
-
         try:
             node_id = iq.pubsub.subscribe["node"]
             subscriber = jid.JID(iq.pubsub.subscribe["jid"])
@@ -295,9 +290,6 @@
         self.handler_wrapper(self._onCreate, iq)
 
     def _onCreate(self, iq):
-        if iq.pubsub.options:
-            raise CreateNodeNotConfigurable
-
         node = iq.pubsub.create.getAttribute("node")
 
         owner = jid.JID(iq["from"]).userhostJID()