summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-11-11 14:00:19 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2019-11-11 14:00:19 +0100
commit9b3874b5dfecdbfa4170430f826413a19a336d7f (patch)
tree510298c48865b62c1f810d197f6886f7aa95af2f
parent0139fb291ef4a1c5b462eaf8196cd277d12bb627 (diff)
downloadslixmpp-9b3874b5dfecdbfa4170430f826413a19a336d7f.tar.gz
slixmpp-9b3874b5dfecdbfa4170430f826413a19a336d7f.tar.bz2
slixmpp-9b3874b5dfecdbfa4170430f826413a19a336d7f.tar.xz
slixmpp-9b3874b5dfecdbfa4170430f826413a19a336d7f.zip
xep_0048: Ensure Conference jid is of type str when given a JID
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--slixmpp/plugins/xep_0048/stanza.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0048/stanza.py b/slixmpp/plugins/xep_0048/stanza.py
index ddcc8841..7a2af4ee 100644
--- a/slixmpp/plugins/xep_0048/stanza.py
+++ b/slixmpp/plugins/xep_0048/stanza.py
@@ -6,6 +6,7 @@
See the file LICENSE for copying permission.
"""
+from slixmpp import JID
from slixmpp.xmlstream import ET, ElementBase, register_stanza_plugin
@@ -52,6 +53,12 @@ class Conference(ElementBase):
if value in ('1', 'true', 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):
name = 'url'