From 4cc67e90023f1114d9c7feed7fca2234a7a2f196 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 16 May 2024 19:02:36 +0200 Subject: [PATCH] room list/notification services: don't request the room avatar since it's always provided It's always provided in the `avatar` response in the field, which sliding sync's using by default, so there's no need to request the `m.room.avatar` event too. --- crates/matrix-sdk-ui/src/notification_client.rs | 1 - crates/matrix-sdk-ui/src/room_list_service/mod.rs | 1 - crates/matrix-sdk-ui/tests/integration/notification_client.rs | 2 -- crates/matrix-sdk-ui/tests/integration/room_list_service.rs | 2 -- 4 files changed, 6 deletions(-) diff --git a/crates/matrix-sdk-ui/src/notification_client.rs b/crates/matrix-sdk-ui/src/notification_client.rs index cd0a8e0ba..6a110439c 100644 --- a/crates/matrix-sdk-ui/src/notification_client.rs +++ b/crates/matrix-sdk-ui/src/notification_client.rs @@ -346,7 +346,6 @@ impl NotificationClient { // Room power levels are necessary to build the push context. let required_state = vec![ - (StateEventType::RoomAvatar, "".to_owned()), (StateEventType::RoomEncryption, "".to_owned()), (StateEventType::RoomMember, "$LAZY".to_owned()), (StateEventType::RoomMember, "$ME".to_owned()), 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 b6c05954a..208cd5e1c 100644 --- a/crates/matrix-sdk-ui/src/room_list_service/mod.rs +++ b/crates/matrix-sdk-ui/src/room_list_service/mod.rs @@ -181,7 +181,6 @@ impl RoomListService { ) .timeline_limit(1) .required_state(vec![ - (StateEventType::RoomAvatar, "".to_owned()), (StateEventType::RoomEncryption, "".to_owned()), (StateEventType::RoomMember, "$LAZY".to_owned()), (StateEventType::RoomMember, "$ME".to_owned()), diff --git a/crates/matrix-sdk-ui/tests/integration/notification_client.rs b/crates/matrix-sdk-ui/tests/integration/notification_client.rs index 19c2cb446..2d423e4df 100644 --- a/crates/matrix-sdk-ui/tests/integration/notification_client.rs +++ b/crates/matrix-sdk-ui/tests/integration/notification_client.rs @@ -255,7 +255,6 @@ async fn test_notification_client_sliding_sync() { [0, 16] ], "required_state": [ - ["m.room.avatar", ""], ["m.room.encryption", ""], ["m.room.member", "$LAZY"], ["m.room.member", "$ME"], @@ -275,7 +274,6 @@ async fn test_notification_client_sliding_sync() { "room_subscriptions": { "!a98sd12bjh:example.org": { "required_state": [ - ["m.room.avatar", ""], ["m.room.encryption", ""], ["m.room.member", "$LAZY"], ["m.room.member", "$ME"], 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 d530314ec..0b3b91b4f 100644 --- a/crates/matrix-sdk-ui/tests/integration/room_list_service.rs +++ b/crates/matrix-sdk-ui/tests/integration/room_list_service.rs @@ -269,7 +269,6 @@ async fn test_sync_all_states() -> Result<(), Error> { ALL_ROOMS: { "ranges": [[0, 19]], "required_state": [ - ["m.room.avatar", ""], ["m.room.encryption", ""], ["m.room.member", "$LAZY"], ["m.room.member", "$ME"], @@ -1815,7 +1814,6 @@ async fn test_dynamic_entries_stream_manual_update() -> Result<(), Error> { "lists": { ALL_ROOMS: { "required_state": [ - ["m.room.avatar", ""], ["m.room.encryption", ""], ["m.room.member", "$LAZY"], ["m.room.member", "$ME"],