summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0060.py
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-06-01 21:45:15 -0700
committerNathan Fritz <nathan@andyet.net>2010-06-01 21:45:15 -0700
commit18e27d65ce47d877d6b2c810979df640aba7d8ba (patch)
tree942ed2d45a54e830d6e7c005e3f872c480477866 /sleekxmpp/plugins/xep_0060.py
parent0c39567f208db4938614e9723901037d8801fb25 (diff)
parentaa916c9ac893a976c8e26ee07ca4a9768a5e1680 (diff)
downloadslixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.gz
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.bz2
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.tar.xz
slixmpp-18e27d65ce47d877d6b2c810979df640aba7d8ba.zip
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
Diffstat (limited to 'sleekxmpp/plugins/xep_0060.py')
-rw-r--r--sleekxmpp/plugins/xep_0060.py10
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')