From 7f0208bd56a91c7751d371b4be4f4b2468f679a0 Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Mon, 25 Mar 2024 14:31:22 +0000 Subject: [PATCH] Add config to limit size of documents from bots/channels copied to Matrix --- mautrix_telegram/config.py | 2 ++ mautrix_telegram/example-config.yaml | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/mautrix_telegram/config.py b/mautrix_telegram/config.py index ca38c520..14148881 100644 --- a/mautrix_telegram/config.py +++ b/mautrix_telegram/config.py @@ -136,6 +136,8 @@ def do_update(self, helper: ConfigUpdateHelper) -> None: copy("bridge.caption_in_message") copy("bridge.image_as_file_size") copy("bridge.image_as_file_pixels") + copy("bridge.document_as_link_size.bot") + copy("bridge.document_as_link_size.channel") copy("bridge.parallel_file_transfer") copy("bridge.federate_rooms") copy("bridge.always_custom_emoji_reaction") diff --git a/mautrix_telegram/example-config.yaml b/mautrix_telegram/example-config.yaml index 27749d03..b23083e4 100644 --- a/mautrix_telegram/example-config.yaml +++ b/mautrix_telegram/example-config.yaml @@ -222,6 +222,11 @@ bridge: image_as_file_size: 10 # Maximum number of pixels in an image before sending to Telegram as a document. Defaults to 4096x4096 = 16777216. image_as_file_pixels: 16777216 + # Maximum size of Telegram documents before linking to Telegrm instead of bridge + # to Matrix media. + document_as_link_size: + channel: + bot: # Enable experimental parallel file transfer, which makes uploads/downloads much faster by # streaming from/to Matrix and using many connections for Telegram. # Note that generating HQ thumbnails for videos is not possible with streamed transfers.