mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
Create and use a new GzipPacked class, also when sending
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from . import TLObject
|
||||
from . import TLObject, GzipPacked
|
||||
from ..extensions import BinaryWriter
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ class MessageContainer(TLObject):
|
||||
writer.write_int(
|
||||
self.session.generate_sequence(x.content_related)
|
||||
)
|
||||
packet = x.to_bytes()
|
||||
|
||||
packet = GzipPacked.gzip_if_smaller(x)
|
||||
writer.write_int(len(packet))
|
||||
writer.write(packet)
|
||||
|
||||
|
Reference in New Issue
Block a user