From f7f58dfd7104afa6e0bcf2bb86d30ab71472a515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 12 Dec 2024 10:31:53 +0100 Subject: [PATCH] feat(ui): Add the MemberHints state event type to the required state This state event allows us to correctly calculate the room display name according to MSC4171. MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/4171 --- crates/matrix-sdk-ui/src/room_list_service/mod.rs | 2 ++ crates/matrix-sdk-ui/tests/integration/room_list_service.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/crates/matrix-sdk-ui/src/room_list_service/mod.rs b/crates/matrix-sdk-ui/src/room_list_service/mod.rs index 441c79944..37a36145c 100644 --- a/crates/matrix-sdk-ui/src/room_list_service/mod.rs +++ b/crates/matrix-sdk-ui/src/room_list_service/mod.rs @@ -92,6 +92,8 @@ const DEFAULT_REQUIRED_STATE: &[(StateEventType, &str)] = &[ // Those two events are required to properly compute room previews. (StateEventType::RoomCreate, ""), (StateEventType::RoomHistoryVisibility, ""), + // Required to correctly calculate the room display name. + (StateEventType::MemberHints, ""), ]; /// The default `required_state` constant value for sliding sync room diff --git a/crates/matrix-sdk-ui/tests/integration/room_list_service.rs b/crates/matrix-sdk-ui/tests/integration/room_list_service.rs index b28df20f1..9eb84c7bf 100644 --- a/crates/matrix-sdk-ui/tests/integration/room_list_service.rs +++ b/crates/matrix-sdk-ui/tests/integration/room_list_service.rs @@ -365,6 +365,7 @@ async fn test_sync_all_states() -> Result<(), Error> { ["m.room.join_rules", ""], ["m.room.create", ""], ["m.room.history_visibility", ""], + ["io.element.functional_members", ""], ], "include_heroes": true, "filters": { @@ -2232,6 +2233,7 @@ async fn test_room_subscription() -> Result<(), Error> { ["m.room.join_rules", ""], ["m.room.create", ""], ["m.room.history_visibility", ""], + ["io.element.functional_members", ""], ["m.room.pinned_events", ""], ], "timeline_limit": 20, @@ -2272,6 +2274,7 @@ async fn test_room_subscription() -> Result<(), Error> { ["m.room.join_rules", ""], ["m.room.create", ""], ["m.room.history_visibility", ""], + ["io.element.functional_members", ""], ["m.room.pinned_events", ""], ], "timeline_limit": 20,