xep_0048: Ensure Conference jid is of type str when given a JID
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
0139fb291e
commit
9b3874b5df
1 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
See the file LICENSE for copying permission.
|
See the file LICENSE for copying permission.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from slixmpp import JID
|
||||||
from slixmpp.xmlstream import ET, ElementBase, register_stanza_plugin
|
from slixmpp.xmlstream import ET, ElementBase, register_stanza_plugin
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,6 +53,12 @@ class Conference(ElementBase):
|
||||||
if value in ('1', 'true', True):
|
if value in ('1', 'true', True):
|
||||||
self._set_attr('autojoin', 'true')
|
self._set_attr('autojoin', 'true')
|
||||||
|
|
||||||
|
def set_jid(self, value):
|
||||||
|
del self['jid']
|
||||||
|
if isinstance(value, JID):
|
||||||
|
value = value.full
|
||||||
|
self._set_attr('jid', value)
|
||||||
|
|
||||||
|
|
||||||
class URL(ElementBase):
|
class URL(ElementBase):
|
||||||
name = 'url'
|
name = 'url'
|
||||||
|
|
Loading…
Reference in a new issue