From de9705f1268cba58845d07415b3d8081d449decd Mon Sep 17 00:00:00 2001 From: Sam <25792361+sam01101@users.noreply.github.com> Date: Tue, 11 Jan 2022 23:40:37 +0800 Subject: [PATCH] Fix core types and compiler (#871) - Add missing ID to FutureSalts - Have vector flags read to None instead of [] for non-existent lists --- compiler/api/compiler.py | 2 +- pyrogram/raw/core/future_salts.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index 192d6a67..c173a931 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -447,7 +447,7 @@ def start(format: bool = False): ) read_types += "\n " - read_types += "{} = TLObject.read(b{}) if flags & (1 << {}) else []\n ".format( + read_types += "{} = TLObject.read(b{}) if flags & (1 << {}) else None\n ".format( arg_name, f", {sub_type.title()}" if sub_type in CORE_TYPES else "", index ) else: diff --git a/pyrogram/raw/core/future_salts.py b/pyrogram/raw/core/future_salts.py index b0ed3343..31eb16e2 100644 --- a/pyrogram/raw/core/future_salts.py +++ b/pyrogram/raw/core/future_salts.py @@ -48,6 +48,7 @@ class FutureSalts(TLObject): def write(self, *args: Any) -> bytes: b = BytesIO() + b.write(Int(self.ID, False)) b.write(Long(self.req_msg_id)) b.write(Int(self.now))