diff options
Diffstat (limited to 'sleekxmpp/plugins/xep_0060.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0060.py | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/sleekxmpp/plugins/xep_0060.py b/sleekxmpp/plugins/xep_0060.py index 68c391f6..734dd3da 100644 --- a/sleekxmpp/plugins/xep_0060.py +++ b/sleekxmpp/plugins/xep_0060.py @@ -18,25 +18,26 @@ class xep_0060(base.base_plugin): create.set('node', node) pubsub.append(create) configure = ET.Element('configure') - if config is None: - submitform = self.xmpp.plugin['xep_0004'].makeForm('submit') - else: + #if config is None: + # submitform = self.xmpp.plugin['xep_0004'].makeForm('submit') + #else: + if config is not None: submitform = config - if 'FORM_TYPE' in submitform.field: - 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 'pubsub#node_type' in submitform.field: - submitform.field['pubsub#node_type'].setValue('collection') + if 'FORM_TYPE' in submitform.field: + submitform.field['FORM_TYPE'].setValue('http://jabber.org/protocol/pubsub#node_config') else: - submitform.addField('pubsub#node_type', value='collection') - else: - if 'pubsub#node_type' in submitform.field: - submitform.field['pubsub#node_type'].setValue('leaf') + submitform.addField('FORM_TYPE', 'hidden', value='http://jabber.org/protocol/pubsub#node_config') + if collection: + if 'pubsub#node_type' in submitform.field: + submitform.field['pubsub#node_type'].setValue('collection') + else: + submitform.addField('pubsub#node_type', value='collection') else: - submitform.addField('pubsub#node_type', value='leaf') - configure.append(submitform.getXML('submit')) + if 'pubsub#node_type' in submitform.field: + submitform.field['pubsub#node_type'].setValue('leaf') + else: + submitform.addField('pubsub#node_type', value='leaf') + configure.append(submitform.getXML('submit')) pubsub.append(configure) iq = self.xmpp.makeIqSet(pubsub) iq.attrib['to'] = jid |