diff options
author | Thom Nichols <tmnichols@gmail.com> | 2010-06-01 22:40:37 -0400 |
---|---|---|
committer | Thom Nichols <tmnichols@gmail.com> | 2010-06-01 22:40:37 -0400 |
commit | 1780ca900a9a78347745d95e7d8934ffae9d7594 (patch) | |
tree | b65b78a036ac8ec7b63d6c620a73e22ed10f2aed /sleekxmpp/plugins/xep_0060.py | |
parent | 8e95ae2948228ddc6d1b32eca2e64b847c756a71 (diff) | |
parent | e6c2fde2834fafbc35b52da7e523f2b351f53a15 (diff) | |
download | slixmpp-1780ca900a9a78347745d95e7d8934ffae9d7594.tar.gz slixmpp-1780ca900a9a78347745d95e7d8934ffae9d7594.tar.bz2 slixmpp-1780ca900a9a78347745d95e7d8934ffae9d7594.tar.xz slixmpp-1780ca900a9a78347745d95e7d8934ffae9d7594.zip |
merged a lot of fritzy's changes
Diffstat (limited to 'sleekxmpp/plugins/xep_0060.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0060.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sleekxmpp/plugins/xep_0060.py b/sleekxmpp/plugins/xep_0060.py index 44a70e9a..bff158a0 100644 --- a/sleekxmpp/plugins/xep_0060.py +++ b/sleekxmpp/plugins/xep_0060.py @@ -14,12 +14,14 @@ class xep_0060(base.base_plugin): self.xep = '0060' self.description = 'Publish-Subscribe' - def create_node(self, jid, node, config=None, collection=False): + def create_node(self, jid, node, config=None, collection=False, ntype=None): pubsub = ET.Element('{http://jabber.org/protocol/pubsub}pubsub') create = ET.Element('create') create.set('node', node) pubsub.append(create) configure = ET.Element('configure') + if collection: + ntype = 'collection' #if config is None: # submitform = self.xmpp.plugin['xep_0004'].makeForm('submit') #else: @@ -29,11 +31,11 @@ class xep_0060(base.base_plugin): submitform.field['FORM_TYPE'].setValue('http://jabber.org/protocol/pubsub#node_config') else: submitform.addField('FORM_TYPE', 'hidden', value='http://jabber.org/protocol/pubsub#node_config') - if collection: + if ntype: if 'pubsub#node_type' in submitform.field: - submitform.field['pubsub#node_type'].setValue('collection') + submitform.field['pubsub#node_type'].setValue(ntype) else: - submitform.addField('pubsub#node_type', value='collection') + submitform.addField('pubsub#node_type', value=ntype) else: if 'pubsub#node_type' in submitform.field: submitform.field['pubsub#node_type'].setValue('leaf') |