Skip to content

Commit ab34330

Browse files
Hywanstefanceriu
authored andcommitted
fix(base): Do not emit an RoomInfoNotableUpdate with empty reasons.
In case an empty `RoomInfoNotableUpdateReasons` is empty, let's not send a `RoomInfoNotableUpdate`.
1 parent 35e5cca commit ab34330

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crates/matrix-sdk-base/src/rooms/normal.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,11 +1068,13 @@ impl Room {
10681068
) {
10691069
self.inner.set(room_info);
10701070

1071-
// Ignore error if no receiver exists.
1072-
let _ = self.room_info_notable_update_sender.send(RoomInfoNotableUpdate {
1073-
room_id: self.room_id.clone(),
1074-
reasons: room_info_notable_update_reasons,
1075-
});
1071+
if !room_info_notable_update_reasons.is_empty() {
1072+
// Ignore error if no receiver exists.
1073+
let _ = self.room_info_notable_update_sender.send(RoomInfoNotableUpdate {
1074+
room_id: self.room_id.clone(),
1075+
reasons: room_info_notable_update_reasons,
1076+
});
1077+
}
10761078
}
10771079

10781080
/// Get the `RoomMember` with the given `user_id`.

0 commit comments

Comments
 (0)