Fix bridging large images to Telegram

This commit is contained in:
Tulir Asokan
2019-02-16 17:08:07 +02:00
parent 7f7dec4e80
commit be255ec7af
+1 -1
View File
@@ -31,7 +31,7 @@ class MautrixTelegramClient(TelegramClient):
) -> Union[InputMediaUploadedDocument, InputMediaUploadedPhoto]:
file_handle = await super().upload_file(file, file_name=file_name, use_cache=False)
if mime_type == "image/png" or mime_type == "image/jpeg":
if (mime_type == "image/png" or mime_type == "image/jpeg") and len(file) < 10 * 1000 ** 2:
return InputMediaUploadedPhoto(file_handle)
else:
attributes = attributes or []