-
Notifications
You must be signed in to change notification settings - Fork 507
Add stable support for MSC4380 invite blocking. #19431
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add stable support for [MSC4380](https://github.com/matrix-org/matrix-spec-proposals/pull/4380) invite blocking. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,7 +109,6 @@ def __init__( | |
| ) | ||
|
|
||
| self._msc4155_enabled = hs.config.experimental.msc4155_enabled | ||
| self._msc4380_enabled = hs.config.experimental.msc4380_enabled | ||
|
|
||
| def get_max_account_data_stream_id(self) -> int: | ||
| """Get the current max stream ID for account data stream | ||
|
|
@@ -573,14 +572,13 @@ async def get_invite_config_for_user(self, user_id: str) -> InviteRulesConfig: | |
| Args: | ||
| user_id: The user whose invite configuration should be returned. | ||
| """ | ||
| if self._msc4380_enabled: | ||
| data = await self.get_global_account_data_by_type_for_user( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It feels like it wouldn't cost much to also read the unstable invite rule here, what's the reasoning for not keeping that? Is this because we'd prefer running a one-time migration?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In short: I'm 👎 on keeping support for the unstable account data. |
||
| user_id, AccountDataTypes.MSC4380_INVITE_PERMISSION_CONFIG | ||
| ) | ||
| # If the user has an MSC4380-style config setting, prioritise that | ||
| # above an MSC4155 one | ||
| if data is not None: | ||
| return MSC4380InviteRulesConfig.from_account_data(data) | ||
| data = await self.get_global_account_data_by_type_for_user( | ||
| user_id, AccountDataTypes.INVITE_PERMISSION_CONFIG | ||
| ) | ||
| # If the user has an MSC4380-style config setting, prioritise that | ||
| # above an MSC4155 one | ||
| if data is not None: | ||
| return MSC4380InviteRulesConfig.from_account_data(data) | ||
|
|
||
| if self._msc4155_enabled: | ||
| data = await self.get_global_account_data_by_type_for_user( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own reference: