summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-10-04 19:31:49 +0200
committermathieui <mathieui@mathieui.net>2016-10-04 19:31:49 +0200
commitb88d2ecd77c7a4889aff632365fc20c9750db3f5 (patch)
treef522c843d17b38e4fc4c0b1a7c7be51538458a50
parente691850a2b1831bdb63ef2254c41b4a481370858 (diff)
downloadslixmpp-b88d2ecd77c7a4889aff632365fc20c9750db3f5.tar.gz
slixmpp-b88d2ecd77c7a4889aff632365fc20c9750db3f5.tar.bz2
slixmpp-b88d2ecd77c7a4889aff632365fc20c9750db3f5.tar.xz
slixmpp-b88d2ecd77c7a4889aff632365fc20c9750db3f5.zip
Add more checks in the XEP-0060 stanza building
Try to not append slixmpp stanzas to ElementTree objects.
-rw-r--r--slixmpp/plugins/xep_0060/stanza/pubsub.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0060/stanza/pubsub.py b/slixmpp/plugins/xep_0060/stanza/pubsub.py
index 5e060150..3f6f2719 100644
--- a/slixmpp/plugins/xep_0060/stanza/pubsub.py
+++ b/slixmpp/plugins/xep_0060/stanza/pubsub.py
@@ -206,7 +206,10 @@ class Options(ElementBase):
return form
def set_options(self, value):
- self.xml.append(value)
+ if isinstance(value, ElementBase):
+ self.xml.append(value.xml)
+ else:
+ self.xml.append(value)
return self
def del_options(self):
@@ -238,7 +241,10 @@ class PublishOptions(ElementBase):
if value is None:
self.del_publish_options()
else:
- self.xml.append(value)
+ if isinstance(value, ElementBase):
+ self.xml.append(value.xml)
+ else:
+ self.xml.append(value)
return self
def del_publish_options(self):