summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0060/stanza
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-08-31 14:55:37 -0700
committerLance Stout <lancestout@gmail.com>2011-08-31 14:55:37 -0700
commit46f23f73482fcd1e1b71eda9ec6d42803f6c7d1a (patch)
treef527f243bf1ca96fd4266b178925ed5ecc276262 /sleekxmpp/plugins/xep_0060/stanza
parent09252baa71819a967ade7370416e9bb9767f69d2 (diff)
downloadslixmpp-46f23f73482fcd1e1b71eda9ec6d42803f6c7d1a.tar.gz
slixmpp-46f23f73482fcd1e1b71eda9ec6d42803f6c7d1a.tar.bz2
slixmpp-46f23f73482fcd1e1b71eda9ec6d42803f6c7d1a.tar.xz
slixmpp-46f23f73482fcd1e1b71eda9ec6d42803f6c7d1a.zip
Test publishng an item with options.
Diffstat (limited to 'sleekxmpp/plugins/xep_0060/stanza')
-rw-r--r--sleekxmpp/plugins/xep_0060/stanza/pubsub.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/xep_0060/stanza/pubsub.py b/sleekxmpp/plugins/xep_0060/stanza/pubsub.py
index 139992e3..6a9a3df9 100644
--- a/sleekxmpp/plugins/xep_0060/stanza/pubsub.py
+++ b/sleekxmpp/plugins/xep_0060/stanza/pubsub.py
@@ -257,12 +257,16 @@ class PublishOptions(ElementBase):
return form
def set_publish_options(self, value):
- self.xml.append(value.getXML())
+ if value is None:
+ del self['publish_options']
+ else:
+ self.xml.append(value.getXML())
return self
def del_publish_options(self):
config = self.xml.find('{jabber:x:data}x')
- self.xml.remove(config)
+ if config is not None:
+ self.xml.remove(config)
registerStanzaPlugin(Pubsub, PublishOptions)