Add more checks in the XEP-0060 stanza building
Try to not append slixmpp stanzas to ElementTree objects.
This commit is contained in:
parent
e691850a2b
commit
b88d2ecd77
1 changed files with 8 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue