summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2022-04-01 21:01:31 +0200
committermathieui <mathieui@mathieui.net>2022-04-01 21:01:31 +0200
commitaca4addb9ceb8b70944c4af76ee6d12cc0a82d64 (patch)
treed848e3f57c2ee08b2e5e0fa610721b102a7d29d2
parent82ff68cfacf55aa1b79aa2f84f085ca346a75a74 (diff)
parent914ce40fd54a0b8b38b556cda37c55cceacf0bfc (diff)
downloadslixmpp-aca4addb9ceb8b70944c4af76ee6d12cc0a82d64.tar.gz
slixmpp-aca4addb9ceb8b70944c4af76ee6d12cc0a82d64.tar.bz2
slixmpp-aca4addb9ceb8b70944c4af76ee6d12cc0a82d64.tar.xz
slixmpp-aca4addb9ceb8b70944c4af76ee6d12cc0a82d64.zip
Merge branch 'fix-old-session' into 'master'
stream features: fix old "session" establishment Closes #3468 See merge request poezio/slixmpp!193
-rw-r--r--slixmpp/xmlstream/xmlstream.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index 9077f23c..2e81c506 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -1318,10 +1318,16 @@ class XMLStream(asyncio.BaseProtocol):
# Avoid circular imports
from slixmpp.stanza.rootstanza import RootStanza
from slixmpp.stanza import Iq, Handshake
- passthrough = (
- (isinstance(data, Iq) and data.get_plugin('bind', check=True))
- or isinstance(data, Handshake)
- )
+
+ passthrough = False
+ if isinstance(data, Iq):
+ 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)