From afeaf8489cc4db5de19ac474dc3b0af3042fb7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C3=A9cureuil?= Date: Mon, 25 Jul 2022 10:34:42 +0200 Subject: [PATCH] Force registration when using xep_0077 plugin The registration is not applyed when we use xep_0077 plugin --- slixmpp/xmlstream/xmlstream.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 18464ccd..1c3b7e07 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -1334,13 +1334,18 @@ def send(self, data: Union[StanzaBase, str], use_filters: bool = True) -> None: passthrough = False if isinstance(data, Iq): + if "plugins" in vars(data) and isinstance(vars(data)["plugins"], dict): + plugings_elt = vars(data)["plugins"] + for keydict in plugings_elt: + if isinstance(keydict, tuple) and "register" in ','.join([str(i) for i in keydict]): + if "" in str(type(plugings_elt[keydict])): + passthrough = True if data.get_plugin('bind', check=True): passthrough = True elif data.get_plugin('session', check=True): passthrough = True elif isinstance(data, Handshake): passthrough = True - if isinstance(data, (RootStanza, str)) and not passthrough: self.__queued_stanzas.append((data, use_filters)) log.debug('NOT SENT: %s %s', type(data), data)