Skip to content

Add max_portal_remote_users, optionally refusing to join too big Telegram rooms #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: element-master
Choose a base branch
from

Conversation

tadzik
Copy link

@tadzik tadzik commented Oct 27, 2021

This still (currently) allows them to organically grow beyond the limit later.

Addresses mautrix#672

…gram rooms

This still (currently) allows them to organically grow beyond the limit
later.
@@ -221,6 +221,8 @@ bridge:
# The maximum number of rooms that can be bridged on this instance.
# When the maximum number of rooms has been reached, attempts to create new links will error. Set to -1 to disable.
max_portal_rooms: -1
# The maximum number of Telegram users allowed in a single room
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set to -1 to disable. might be a nice addition to the documentation, like above.

Thought technically, 0 will also disable, which is a bit weird, but I suppose that is how the code is written here in general?

async def get_remote_user_count(self, user: 'u.User') -> int:
entity = await self.get_entity(user)
if not isinstance(entity, (Chat, Channel)):
raise ValueError("Can't get remote user count for Portal that isn't Chat nor Channel")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not catch this as it could crash a bridging attempt? What other entities are there?

@AndrewFerr AndrewFerr requested a review from a team as a code owner September 27, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants