# HG changeset patch # User Ralph Meijer # Date 1114363533 0 # Node ID 3d77f3808bfac8b8148f10fc57e8158777f4bc9e # Parent 43102fecb14bf9320b058e8f13ea7b8fbde01d5a Follow API change in backend. Work around bug in xish.domish. diff -r 43102fecb14b -r 3d77f3808bfa idavoll/idavoll.py --- a/idavoll/idavoll.py Sun Apr 24 17:24:35 2005 +0000 +++ b/idavoll/idavoll.py Sun Apr 24 17:25:33 2005 +0000 @@ -1,6 +1,5 @@ from twisted.words.protocols.jabber import component from twisted.application import service -from twisted.python import components from twisted.internet import defer import backend import pubsub diff -r 43102fecb14b -r 3d77f3808bfa idavoll/pubsub.py --- a/idavoll/pubsub.py Sun Apr 24 17:24:35 2005 +0000 +++ b/idavoll/pubsub.py Sun Apr 24 17:25:33 2005 +0000 @@ -10,6 +10,13 @@ import disco import data_form +if issubclass(domish.SerializedXML, str): + # Work around bug # in twisted Xish + class SerializedXML(unicode): + """ Marker class for pre-serialized XML in the DOM. """ + + domish.SerializedXML = SerializedXML + NS_COMPONENT = 'jabber:component:accept' NS_PUBSUB = 'http://jabber.org/protocol/pubsub' NS_PUBSUB_EVENT = NS_PUBSUB + '#event' @@ -60,13 +67,13 @@ error_map = { storage.NodeNotFound: ('item-not-found', None), storage.NodeExists: ('conflict', None), - + storage.SubscriptionNotFound: ('not-authorized', + 'not-subscribed'), backend.NotAuthorized: ('not-authorized', None), backend.NoPayloadAllowed: ('bad-request', None), backend.PayloadExpected: ('bad-request', None), backend.NoInstantNodes: ('not-acceptable', None), backend.NotImplemented: ('feature-not-implemented', None), - backend.NotSubscribed: ('not-authorized', 'requestor-not-subscribed'), backend.InvalidConfigurationOption: ('not-acceptable', None), backend.InvalidConfigurationValue: ('not-acceptable', None), } @@ -115,7 +122,6 @@ except: d = defer.fail() - d.addCallback(self.success, iq) d.addErrback(self.error, iq) d.addCallback(self.send) @@ -277,7 +283,7 @@ entity["node"] = result["node"] entity["jid"] = subscriber.full() entity["affiliation"] = result["affiliation"] or 'none' - entity["subscription"] = result["subscription"] + entity["subscription"] = result["state"] return [reply] def onUnsubscribe(self, iq):