Mercurial > libervia-pubsub
diff idavoll/pubsub.py @ 130:3d77f3808bfa
Follow API change in backend.
Work around bug in xish.domish.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Sun, 24 Apr 2005 17:25:33 +0000 |
parents | 8527bce09862 |
children | 46453af6b0c3 |
line wrap: on
line diff
--- 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):