From b88d2ecd77c7a4889aff632365fc20c9750db3f5 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 4 Oct 2016 19:31:49 +0200 Subject: Add more checks in the XEP-0060 stanza building Try to not append slixmpp stanzas to ElementTree objects. --- slixmpp/plugins/xep_0060/stanza/pubsub.py | 10 ++++++++-- 1 file 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): -- cgit v1.2.3