diff --git a/example-config.yaml b/example-config.yaml index 82077df0..167fda4b 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -103,6 +103,10 @@ bridge: # will not send any more members. # Defaults to no local limit (-> limited to 10000 by server) max_initial_member_sync: -1 + # Whether or not to sync the member list in channels. + # If no channel admins have logged into the bridge, the bridge won't be able to sync the member + # list regardless of this setting. + sync_channel_members: true # The maximum number of simultaneous Telegram deletions to handle. # A large number of simultaneous redactions could put strain on your homeserver. max_telegram_delete: 10 diff --git a/mautrix_telegram/config.py b/mautrix_telegram/config.py index 49573784..122e49d8 100644 --- a/mautrix_telegram/config.py +++ b/mautrix_telegram/config.py @@ -185,6 +185,7 @@ class Config(DictWithRecursion): copy("bridge.bridge_notices") copy("bridge.bot_messages_as_notices") copy("bridge.max_initial_member_sync") + copy("bridge.sync_channel_members") copy("bridge.max_telegram_delete") copy("bridge.allow_matrix_login") copy("bridge.inline_images") diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index a0488b91..143c93b1 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -543,6 +543,9 @@ class Portal: chat = await user.client(GetFullChatRequest(chat_id=self.tgid)) return chat.users, chat.full_chat.participants.participants elif self.peer_type == "channel": + if not self.megagroup and not config["bridge.sync_channel_members"]: + return [], [] + limit = config["bridge.max_initial_member_sync"] if limit == 0: return [], []