diff options
author | Nathan Fritz <fritzy@netflint.net> | 2010-05-27 04:58:57 -0700 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2010-05-27 04:58:57 -0700 |
commit | 3a28f9e5d247b9124e0d14c26c2a6e79aaee86ff (patch) | |
tree | 0d0cbd55785b8c06a86268e6de66201924f3dd55 /sleekxmpp/plugins/xep_0060.py | |
parent | 0bda5fd3f28da14478db87c98fb89f647994deaa (diff) | |
download | slixmpp-3a28f9e5d247b9124e0d14c26c2a6e79aaee86ff.tar.gz slixmpp-3a28f9e5d247b9124e0d14c26c2a6e79aaee86ff.tar.bz2 slixmpp-3a28f9e5d247b9124e0d14c26c2a6e79aaee86ff.tar.xz slixmpp-3a28f9e5d247b9124e0d14c26c2a6e79aaee86ff.zip |
added pubsub state stanzas and scheduled events
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') |