2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-09-05 16:55:20 +00:00

Move INITIAL_SALT to Session

This commit is contained in:
Dan
2018-06-28 17:50:37 +02:00
parent 4f4531cf18
commit 2f1d447783
2 changed files with 1 additions and 3 deletions

View File

@@ -25,8 +25,6 @@ from . import AES, KDF
class MTProto:
INITIAL_SALT = 0x616e67656c696361
@staticmethod
def pack(message: Message, salt: int, session_id: bytes, auth_key: bytes, auth_key_id: bytes) -> bytes:
data = Long(salt) + session_id + message.write()

View File

@@ -117,7 +117,7 @@ class Session:
self.net_worker_task = asyncio.ensure_future(self.net_worker())
self.recv_task = asyncio.ensure_future(self.recv())
self.current_salt = FutureSalt(0, 0, MTProto.INITIAL_SALT)
self.current_salt = FutureSalt(0, 0, Session.INITIAL_SALT)
self.current_salt = FutureSalt(0, 0, (await self._send(functions.Ping(0))).new_server_salt)
self.current_salt = (await self._send(functions.GetFutureSalts(1))).salts[0]