diff options
author | Nathan Fritz <fritzy@netflint.net> | 2010-05-27 19:58:57 +0800 |
---|---|---|
committer | Thom Nichols <tmnichols@gmail.com> | 2010-06-01 22:07:52 +0800 |
commit | 194e6bcb5149f145c389fa8837dbe902557d9215 (patch) | |
tree | 9833402892ca0d1f738fc321cfb3c084da590854 /sleekxmpp/plugins/xep_0060.py | |
parent | 2e7024419a98e0dc69493010faf24b4a2c88d37e (diff) | |
download | slixmpp-194e6bcb5149f145c389fa8837dbe902557d9215.tar.gz slixmpp-194e6bcb5149f145c389fa8837dbe902557d9215.tar.bz2 slixmpp-194e6bcb5149f145c389fa8837dbe902557d9215.tar.xz slixmpp-194e6bcb5149f145c389fa8837dbe902557d9215.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') |