Skip to content

Commit

Permalink
feat(sliding_sync): Add m.room.join_rules to the required state
Browse files Browse the repository at this point in the history
We need the join rules state event to prevent the SDK from assuming a room with an unknown (as in, not loaded) join rule is public.
jmartinesp committed Nov 8, 2024
1 parent ca8c635 commit 204e6e4
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/matrix-sdk-ui/src/room_list_service/mod.rs
Original file line number Diff line number Diff line change
@@ -88,6 +88,7 @@ const DEFAULT_REQUIRED_STATE: &[(StateEventType, &str)] = &[
(StateEventType::RoomCanonicalAlias, ""),
(StateEventType::RoomPowerLevels, ""),
(StateEventType::CallMember, "*"),
(StateEventType::RoomJoinRules, ""),
];

/// The default `required_state` constant value for sliding sync room
3 changes: 3 additions & 0 deletions crates/matrix-sdk-ui/tests/integration/room_list_service.rs
Original file line number Diff line number Diff line change
@@ -357,6 +357,7 @@ async fn test_sync_all_states() -> Result<(), Error> {
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
],
"include_heroes": true,
"filters": {
@@ -2220,6 +2221,7 @@ async fn test_room_subscription() -> Result<(), Error> {
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.create", ""],
["m.room.pinned_events", ""],
],
@@ -2258,6 +2260,7 @@ async fn test_room_subscription() -> Result<(), Error> {
["m.room.canonical_alias", ""],
["m.room.power_levels", ""],
["org.matrix.msc3401.call.member", "*"],
["m.room.join_rules", ""],
["m.room.create", ""],
["m.room.pinned_events", ""],
],

0 comments on commit 204e6e4

Please sign in to comment.