diff --git a/src/api/client/profile.rs b/src/api/client/profile.rs index 32f7a723..690d0ad7 100644 --- a/src/api/client/profile.rs +++ b/src/api/client/profile.rs @@ -273,16 +273,22 @@ pub(crate) async fn get_profile_route( return Err(Error::BadRequest(ErrorKind::NotFound, "Profile was not found.")); } + let mut custom_profile_fields: BTreeMap = services + .users + .all_profile_keys(&body.user_id) + .collect() + .await; + + // services.users.timezone will collect the MSC4175 timezone key if it exists + custom_profile_fields.remove("us.cloke.msc4175.tz"); + custom_profile_fields.remove("m.tz"); + Ok(get_profile::v3::Response { avatar_url: services.users.avatar_url(&body.user_id).await.ok(), blurhash: services.users.blurhash(&body.user_id).await.ok(), displayname: services.users.displayname(&body.user_id).await.ok(), tz: services.users.timezone(&body.user_id).await.ok(), - custom_profile_fields: services - .users - .all_profile_keys(&body.user_id) - .collect() - .await, + custom_profile_fields, }) } diff --git a/src/api/server/query.rs b/src/api/server/query.rs index bf515b3c..edbeee77 100644 --- a/src/api/server/query.rs +++ b/src/api/server/query.rs @@ -117,6 +117,10 @@ pub(crate) async fn get_profile_information_route( }, } + // services.users.timezone will collect the MSC4175 timezone key if it exists + custom_profile_fields.remove("us.cloke.msc4175.tz"); + custom_profile_fields.remove("m.tz"); + Ok(get_profile_information::v1::Response { displayname, avatar_url,