Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Force registration when using xep_0077 plugin #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion slixmpp/xmlstream/xmlstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<class 'slixmpp.plugins.xep_0077.stanza.Register'>" 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)
Expand Down