Fix UpdateShort from socket was not unboxed

This was causing UpdateShorts to be sent to Raw handlers,
which in turn broke things like QR login.

Should fix #3922.
This commit is contained in:
Lonami Exo 2022-09-14 15:52:09 +02:00
parent 935be9dd6e
commit a66df977f7

View File

@ -392,7 +392,9 @@ class MessageBox:
seq_start = getattr(updates, 'seq_start', None) or seq seq_start = getattr(updates, 'seq_start', None) or seq
users = getattr(updates, 'users', None) or [] users = getattr(updates, 'users', None) or []
chats = getattr(updates, 'chats', None) or [] chats = getattr(updates, 'chats', None) or []
updates = getattr(updates, 'updates', None) or [updates]
# updateShort is the only update which cannot be dispatched directly but doesn't have 'updates' field
updates = getattr(updates, 'updates', None) or [updates.update if isinstance(updates, tl.UpdateShort) else updates]
for u in updates: for u in updates:
u._self_outgoing = self_outgoing u._self_outgoing = self_outgoing