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,6 +206,9 @@ class Options(ElementBase):
return form
def set_options(self, value):
if isinstance(value, ElementBase):
self.xml.append(value.xml)
else:
self.xml.append(value)
return self
@ -237,6 +240,9 @@ class PublishOptions(ElementBase):
def set_publish_options(self, value):
if value is None:
self.del_publish_options()
else:
if isinstance(value, ElementBase):
self.xml.append(value.xml)
else:
self.xml.append(value)
return self