diff options
author | Lance Stout <lancestout@gmail.com> | 2011-08-31 10:43:33 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-08-31 10:43:33 -0700 |
commit | 2500a0649ba10c0109a1ed021a051284c104391f (patch) | |
tree | bc7378a2b410a869afaa816701d2fcbd4f7ac160 /sleekxmpp/plugins/xep_0060 | |
parent | 5ec4e4a026a5f3a3ec9c2cb6efd3dc1a4ccf580f (diff) | |
download | slixmpp-2500a0649ba10c0109a1ed021a051284c104391f.tar.gz slixmpp-2500a0649ba10c0109a1ed021a051284c104391f.tar.bz2 slixmpp-2500a0649ba10c0109a1ed021a051284c104391f.tar.xz slixmpp-2500a0649ba10c0109a1ed021a051284c104391f.zip |
Fix requesting pubsub node configuration, and add tests.
- <default /> doesn't have a type attribute in the XEP
- <configure /> isn't used anymore for requesting default configuration
Diffstat (limited to 'sleekxmpp/plugins/xep_0060')
-rw-r--r-- | sleekxmpp/plugins/xep_0060/pubsub.py | 6 | ||||
-rw-r--r-- | sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py | 9 |
2 files changed, 3 insertions, 12 deletions
diff --git a/sleekxmpp/plugins/xep_0060/pubsub.py b/sleekxmpp/plugins/xep_0060/pubsub.py index 9ce643d9..5a17dd56 100644 --- a/sleekxmpp/plugins/xep_0060/pubsub.py +++ b/sleekxmpp/plugins/xep_0060/pubsub.py @@ -206,11 +206,7 @@ class xep_0060(base_plugin): be executed when a reply stanza is received. """ iq = self.xmpp.Iq(sto=jid, sfrom=ifrom, stype='get') - - if node is None: - iq['pubsub_owner']['default'] - else: - iq['pubsub_owner']['configure']['node'] = node + iq['pubsub_owner']['default']['node'] = node return iq.send(block=block, callback=callback, timeout=timeout) def get_node_subscriptions(self, jid, node, ifrom=None, block=True, diff --git a/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py b/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py index 201dc909..55dd59d1 100644 --- a/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py +++ b/sleekxmpp/plugins/xep_0060/stanza/pubsub_owner.py @@ -22,18 +22,13 @@ class DefaultConfig(ElementBase): namespace = 'http://jabber.org/protocol/pubsub#owner' name = 'default' plugin_attrib = 'default' - interfaces = set(('node', 'type', 'config')) + interfaces = set(('node', 'config')) plugin_attrib_map = {} plugin_tag_map = {} def __init__(self, *args, **kwargs): ElementBase.__init__(self, *args, **kwargs) - def getType(self): - t = self._getAttr('type') - if not t: t = 'leaf' - return t - def getConfig(self): return self['form'] @@ -71,7 +66,7 @@ class OwnerConfigure(Configure): interfaces = set(('node', 'config')) plugin_attrib_map = {} plugin_tag_map = {} - + def getConfig(self): return self['form'] |