From 591e79f5a0162559990ee3b679f6f9fa13d5e926 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 25 May 2022 16:49:59 +0300 Subject: [PATCH] Enable catch_up and sequential_updates by default --- mautrix_telegram/abstract_user.py | 2 ++ mautrix_telegram/config.py | 3 +++ mautrix_telegram/example-config.yaml | 9 +++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mautrix_telegram/abstract_user.py b/mautrix_telegram/abstract_user.py index b4be3f90..4455f920 100644 --- a/mautrix_telegram/abstract_user.py +++ b/mautrix_telegram/abstract_user.py @@ -224,6 +224,8 @@ class AbstractUser(ABC): connection=connection, proxy=proxy, raise_last_call_error=True, + catch_up=self.config["telegram.catch_up"], + sequential_updates=self.config["telegram.sequential_updates"], loop=self.loop, base_logger=base_logger, ) diff --git a/mautrix_telegram/config.py b/mautrix_telegram/config.py index 876b0c1f..e8377261 100644 --- a/mautrix_telegram/config.py +++ b/mautrix_telegram/config.py @@ -228,6 +228,9 @@ class Config(BaseBridgeConfig): copy("telegram.api_hash") copy("telegram.bot_token") + copy("telegram.catch_up") + copy("telegram.sequential_updates") + copy("telegram.connection.timeout") copy("telegram.connection.retries") copy("telegram.connection.retry_delay") diff --git a/mautrix_telegram/example-config.yaml b/mautrix_telegram/example-config.yaml index cfdd6a34..19c52357 100644 --- a/mautrix_telegram/example-config.yaml +++ b/mautrix_telegram/example-config.yaml @@ -156,7 +156,7 @@ bridge: skip_deleted_members: true # Whether or not to automatically synchronize contacts and chats of Matrix users logged into # their Telegram account at startup. - startup_sync: true + startup_sync: false # Number of most recently active dialogs to check when syncing chats. # Set to 0 to remove limit. sync_update_limit: 0 @@ -455,6 +455,11 @@ telegram: # (Optional) Create your own bot at https://t.me/BotFather bot_token: disabled + # Should the bridge request missed updates from Telegram when restarting? + catch_up: true + # Should incoming updates be handled sequentially to make sure order is preserved on Matrix? + sequential_updates: true + # Telethon connection options. connection: # The timeout in seconds to be used when connecting. @@ -480,7 +485,7 @@ telegram: # Device info sent to Telegram. device_info: # "auto" = OS name+version. - device_model: auto + device_model: mautrix-telegram # "auto" = Telethon version. system_version: auto # "auto" = mautrix-telegram version.