# HG changeset patch # User Ralph Meijer # Date 1100725237 0 # Node ID ea3b2410c01cf127fe3a1c4a1153ce25446469f1 # Parent 878a5b7697f25f40308a068477f09d74aa65dc0c Ignore unsupported configure and option elements. Return pubsub#item-ids feature. diff -r 878a5b7697f2 -r ea3b2410c01c idavoll/pubsub.py --- 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()