Use MTProto 2.0 instead of 1.0

This commit is contained in:
Dan 2017-12-09 02:24:21 +01:00
parent 42f9a2d699
commit a3e5ba8862

View File

@ -264,7 +264,7 @@ class Session:
def unpack_dispatch_and_ack(self, packet: bytes): def unpack_dispatch_and_ack(self, packet: bytes):
# TODO: A better dispatcher # TODO: A better dispatcher
data = self.unpack(BytesIO(packet)) data = self.unpack2(BytesIO(packet))
messages = ( messages = (
data.body.messages data.body.messages
@ -394,7 +394,7 @@ class Session:
if wait_response: if wait_response:
self.results[msg_id] = Result() self.results[msg_id] = Result()
payload = self.pack(message) payload = self.pack2(message)
try: try:
self.connection.send(payload) self.connection.send(payload)