Skip to content

Commit de9705f

Browse files
author
Sam
authored
Fix core types and compiler (#871)
- Add missing ID to FutureSalts - Have vector flags read to None instead of [] for non-existent lists
1 parent c7da4a8 commit de9705f

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

compiler/api/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def start(format: bool = False):
447447
)
448448

449449
read_types += "\n "
450-
read_types += "{} = TLObject.read(b{}) if flags & (1 << {}) else []\n ".format(
450+
read_types += "{} = TLObject.read(b{}) if flags & (1 << {}) else None\n ".format(
451451
arg_name, f", {sub_type.title()}" if sub_type in CORE_TYPES else "", index
452452
)
453453
else:

pyrogram/raw/core/future_salts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def read(data: BytesIO, *args: Any) -> "FutureSalts":
4848

4949
def write(self, *args: Any) -> bytes:
5050
b = BytesIO()
51+
b.write(Int(self.ID, False))
5152

5253
b.write(Long(self.req_msg_id))
5354
b.write(Int(self.now))

0 commit comments

Comments
 (0)