feat: Support MSC4494 #2297
No reviewers
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
continuwuation/continuwuity!2297
Loading…
Reference in a new issue
No description provided.
Delete branch "nex/feat/msc4494"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds support for MSC4494: Membership-based invite blocking.
Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
@ -112,0 +115,4 @@// Apply other layers of invite blocking first, so that user/server// denies take priority over implicit allows.if content.default_action != Some(InvitePermissionAction::DenyPublic)&& selfnot sure im a fan of doing this after user_filter_level but the alternative is either precalculating private mutual rooms (expensive) or giving user_filter_level some form of database access (complicated and ugly)
1fad34f035b9b883a1f6@ -112,0 +114,4 @@}// Apply other layers of invite blocking first, so that user/server// denies take priority over implicit allows.if content.default_action != Some(InvitePermissionAction::DenyPublic)this check is inverted
wait no it's not, what am I even doing here
@ -111,1 +110,3 @@.user_filter_level(sender_user)let content = stable.unwrap_or_else(|_| unstable.unwrap()).content;let verdict = content.user_filter_level(sender_user);if verdict != FilterLevel::Allow {This doesn't differentiate explicit allows, so a user that is explicitly allowed in this config might still be denied
@ -112,0 +122,4 @@FilterLevel::Block} else {FilterLevel::Allow}Nit but this code shouldn't be in an else block. If a clippy lint is telling you otherwise it's wrong.
@ -112,3 +126,4 @@}}/// Checks that sender and recipient share at least one rule that has a joinTypo!
where?
oh duh
@ -18,6 +18,7 @@ use wildmatch::WildMatch;#[derive(Debug, Clone, Copy, PartialEq, Eq)]pub enum FilterLevel {Allow,ExplicitAllow,Option was right there
I think this is fine but
AllowandExplicitAllowwould be better asDefaultandAllowrespectivelyOption isn't semantically correct
logic looks fine, see my comment above
AllowtoDefaultetc5eb5225128935ddf1d0f