Add option to disable channel member list syncing

This commit is contained in:
Tulir Asokan
2018-08-05 22:07:12 +03:00
parent 704e00540e
commit 9b0be2dd55
3 changed files with 8 additions and 0 deletions
+4
View File
@@ -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
+1
View File
@@ -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")
+3
View File
@@ -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 [], []