diff --git a/ruma-client-api/CHANGELOG.md b/ruma-client-api/CHANGELOG.md index b99e6d6c..68b91b6f 100644 --- a/ruma-client-api/CHANGELOG.md +++ b/ruma-client-api/CHANGELOG.md @@ -67,6 +67,17 @@ Breaking changes: * `r0::session::login::Request::new` takes only `login_info: LoginInfo` as a param * Change `ruma_events::AnyEvent` to `ruma_events::AnySyncRoomEvent` in `push::get_notifications::Notification` +* Use `ruma_identifiers::MxcUri` instead of `String` for `avatar_url` fields in the following + endpoints: + ```rust + r0::{ + directory, + media::create_content, + membership::joined_members, + profile::{get_avatar_url, get_profile, set_avatar_url}, + search::{search_events, search_users} + } + ``` Improvements: diff --git a/ruma-client-api/src/r0/profile/get_profile.rs b/ruma-client-api/src/r0/profile/get_profile.rs index 502e8080..57705df9 100644 --- a/ruma-client-api/src/r0/profile/get_profile.rs +++ b/ruma-client-api/src/r0/profile/get_profile.rs @@ -1,7 +1,7 @@ //! [GET /_matrix/client/r0/profile/{userId}](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-profile-userid) use ruma_api::ruma_api; -use ruma_identifiers::UserId; +use ruma_identifiers::{MxcUri, UserId}; ruma_api! { metadata: { @@ -30,7 +30,7 @@ ruma_api! { feature = "compat", serde(default, deserialize_with = "ruma_serde::empty_string_as_none") )] - pub avatar_url: Option, + pub avatar_url: Option, /// The user's display name, if set. #[serde(skip_serializing_if = "Option::is_none")] @@ -49,7 +49,7 @@ impl<'a> Request<'a> { impl Response { /// Creates a new `Response` with the given avatar URL and display name. - pub fn new(avatar_url: Option, displayname: Option) -> Self { + pub fn new(avatar_url: Option, displayname: Option) -> Self { Self { avatar_url, displayname } } }