Avoid packing more than 1024 messages in a single container

This commit is contained in:
Lonami Exo
2018-11-19 08:29:44 +01:00
parent f90dd76f4c
commit 207d5ebdcb
2 changed files with 8 additions and 2 deletions

View File

@@ -15,6 +15,11 @@ class MessageContainer(TLObject):
# The overhead of the container itself is subtracted.
MAXIMUM_SIZE = 1044456 - 8
# Maximum amount of messages that can't be sent inside a single
# container, inclusive. Beyond this limit Telegram will respond
# with BAD_MESSAGE 64 (invalid container).
MAXIMUM_LENGTH = 1024
def __init__(self, messages):
self.messages = messages