mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 21:24:35 +03:00
Fix unboxed serialization including constructor ID
This only affected FutureSalts, but it's useful that it behaves the way it should. cc @JuanPotato for spotting the bug.
This commit is contained in:
parent
fac6b2348b
commit
bb0d29bdd5
|
@ -466,6 +466,12 @@ def _write_arg_to_bytes(builder, arg, args, name=None):
|
||||||
# Else it may be a custom type
|
# Else it may be a custom type
|
||||||
builder.write('bytes({})', name)
|
builder.write('bytes({})', name)
|
||||||
|
|
||||||
|
# If the type is not boxed (i.e. starts with lowercase) we should
|
||||||
|
# not serialize the constructor ID (so remove its first 4 bytes).
|
||||||
|
boxed = arg.type[arg.type.find('.') + 1].isupper()
|
||||||
|
if not boxed:
|
||||||
|
builder.write('[4:]')
|
||||||
|
|
||||||
if arg.is_flag:
|
if arg.is_flag:
|
||||||
builder.write(')')
|
builder.write(')')
|
||||||
if arg.is_vector:
|
if arg.is_vector:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user