From 3623a7a16ab36bfc5f0a9c8e74dd38d9c94b4246 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 31 Aug 2011 14:05:29 -0700 Subject: More pubsub unit tests! --- sleekxmpp/plugins/xep_0060/pubsub.py | 7 +++++-- sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py | 10 ++-------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'sleekxmpp/plugins') diff --git a/sleekxmpp/plugins/xep_0060/pubsub.py b/sleekxmpp/plugins/xep_0060/pubsub.py index a891573e..cb6cbacd 100644 --- a/sleekxmpp/plugins/xep_0060/pubsub.py +++ b/sleekxmpp/plugins/xep_0060/pubsub.py @@ -206,7 +206,10 @@ class xep_0060(base_plugin): be executed when a reply stanza is received. """ iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='get') - iq['pubsub_owner']['default']['node'] = node + if node is None: + iq['pubsub_owner']['default'] + else: + iq['pubsub_owner']['configure']['node'] = node return iq.send(block=block, callback=callback, timeout=timeout) def get_node_subscriptions(self, jid, node, ifrom=None, block=True, @@ -276,7 +279,7 @@ class xep_0060(base_plugin): callback=None, timeout=None): iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='set') iq['pubsub_owner']['configure']['node'] = node - iq['pubsub_owner']['configure']['config'] = config + iq['pubsub_owner']['configure']['form'].values = config.values return iq.send(block=block, callback=callback, timeout=timeout) def publish(self, jid, node, item_id=None, payload=None, items=None, diff --git a/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py b/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py index 55dd59d1..570c9c4a 100644 --- a/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py +++ b/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py @@ -63,18 +63,12 @@ class OwnerConfigure(Configure): name = 'configure' plugin_attrib = 'configure' namespace = 'http://jabber.org/protocol/pubsub#owner' - interfaces = set(('node', 'config')) + interfaces = set(('node',)) plugin_attrib_map = {} plugin_tag_map = {} - def getConfig(self): - return self['form'] - - def setConfig(self, value): - self['form'].setStanzaValues(value.getStanzaValues()) - return self - registerStanzaPlugin(PubsubOwner, OwnerConfigure) +registerStanzaPlugin(OwnerConfigure, xep_0004.Form) class OwnerDefault(OwnerConfigure): namespace = 'http://jabber.org/protocol/pubsub#owner' -- cgit v1.2.3