summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0060.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2009-10-29 02:34:23 +0000
committerNathan Fritz <fritzy@netflint.net>2009-10-29 02:34:23 +0000
commit44aa52663579bcd1a56d2f13cdc91b1ca2c2b542 (patch)
tree9466bb338e3fe20fb259a8cf3187dbf3e68488aa /sleekxmpp/plugins/xep_0060.py
parent8dbf53594bc9ea0aec1ecd81092d806d001a7b6c (diff)
downloadslixmpp-44aa52663579bcd1a56d2f13cdc91b1ca2c2b542.tar.gz
slixmpp-44aa52663579bcd1a56d2f13cdc91b1ca2c2b542.tar.bz2
slixmpp-44aa52663579bcd1a56d2f13cdc91b1ca2c2b542.tar.xz
slixmpp-44aa52663579bcd1a56d2f13cdc91b1ca2c2b542.zip
* fixed bugs with XEP 50 for components
* configuration-less nodes
Diffstat (limited to 'sleekxmpp/plugins/xep_0060.py')
-rw-r--r--sleekxmpp/plugins/xep_0060.py33
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