-
Notifications
You must be signed in to change notification settings - Fork 336
Add support for MSC4155 Invite filtering #18288
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
Add support for MSC4155 Invite filtering #18288
Conversation
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.
This is a good start! Apologies for the long turn-around time on reviews.
Could you also write some Complement tests for this? Given it's related to an MSC, it'd be good to have homeserver-level integration tests for it, assuming it eventually passes FCP.
""" | ||
Get the invite configuration for the current user. | ||
|
||
If experimental MSC3391 support is enabled, any entries with an empty | ||
content body are excluded; as this means they have been deleted. | ||
|
||
Args: | ||
user_id: The user to get the account_data for. | ||
|
||
Returns: | ||
The global account_data. | ||
""" |
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.
This docstring needs to be updated.
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.
How strict are we on providing args and returns here. Both are fairly self explanatory?
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.
Currently we do it even for self-explanatory arguments, though we'll write:
Args:
user_id:
whether that's necessary is another conversation, but that's the current convention.
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.
Done and done for public APIs
a248274
to
729567f
Compare
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.
drive-by SCT review of the implementation
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.
A few more things, but we're getting close now! Thanks for being persistent with this one.
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.
This LGTM now, thanks!
Edit: Sytest failures appear to be unrelated to this PR.
@anoadragon453 just FYI you'll be clicking merge because I lack perms :) |
@@ -137,6 +137,9 @@ class Codes(str, Enum): | |||
PROFILE_TOO_LARGE = "M_PROFILE_TOO_LARGE" | |||
KEY_TOO_LARGE = "M_KEY_TOO_LARGE" | |||
|
|||
# Part of MSC4155 | |||
INVITE_BLOCKED = "ORG.MATRIX.MSC4155.M_INVITE_BLOCKED" |
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.
Noting last minute introduction of error code as per spec change. https://github.com/matrix-org/matrix-spec-proposals/pull/4155/files#diff-fc221ff9830147ac4cac04ecf91ccdde962f4706c40cbd700fb99859b28afc54R62
This implements matrix-org/matrix-spec-proposals#4155, which adds support for a new account data type that blocks an invite based on some conditions in the event contents.
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)