Add more checks in the XEP-0060 stanza building

Try to not append slixmpp stanzas to ElementTree objects.
This commit is contained in:
mathieui 2016-10-04 19:31:49 +02:00
parent e691850a2b
commit b88d2ecd77

View file

@ -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):