From 9b3874b5dfecdbfa4170430f826413a19a336d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 11 Nov 2019 14:00:19 +0100 Subject: xep_0048: Ensure Conference jid is of type str when given a JID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/plugins/xep_0048/stanza.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'slixmpp') 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' -- cgit v1.2.3