client-api: RoomSummary::heroes must be OwnedUserIds, in fact

This is imprecise from the spec wording [1], apart from a hint [2], but
these should really be user ids. In practice, this is what Synapse
returns too

[1]https://spec.matrix.org/latest/client-server-api/#_matrixclientv3sync_roomsummary
[2] "The list must never include the client’s own user ID."
This commit is contained in:
Benjamin Bouvier 2024-05-23 19:14:30 +02:00
parent 6cd3af9b86
commit 75e8829bec
2 changed files with 4 additions and 2 deletions

View File

@ -36,6 +36,8 @@ Breaking changes:
It will now return the proper status code and headers depending on the variant
used.
- The http crate had a major version bump to version 1.1
- `RoomSummary::heroes` now properly contains only `UserId` instead of `String`
as before.
Improvements:

View File

@ -10,7 +10,7 @@ use ruma_common::{
metadata,
presence::PresenceState,
serde::Raw,
DeviceKeyAlgorithm, OwnedEventId, OwnedRoomId,
DeviceKeyAlgorithm, OwnedEventId, OwnedRoomId, OwnedUserId,
};
use ruma_events::{
presence::PresenceEvent, AnyGlobalAccountDataEvent, AnyRoomAccountDataEvent,
@ -470,7 +470,7 @@ pub struct RoomSummary {
///
/// Required if room name or canonical aliases are not set or empty.
#[serde(rename = "m.heroes", default, skip_serializing_if = "Vec::is_empty")]
pub heroes: Vec<String>,
pub heroes: Vec<OwnedUserId>,
/// Number of users whose membership status is `join`.
/// Required if field has changed since last sync; otherwise, it may be