From 2f1d44778330218e36a65adeac0241fea86b8327 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 28 Jun 2018 17:50:37 +0200 Subject: [PATCH] Move INITIAL_SALT to Session --- pyrogram/crypto/mtproto.py | 2 -- pyrogram/session/session.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyrogram/crypto/mtproto.py b/pyrogram/crypto/mtproto.py index 10839126..539976d6 100644 --- a/pyrogram/crypto/mtproto.py +++ b/pyrogram/crypto/mtproto.py @@ -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() diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index ca12c92b..981e61cd 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -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]