diff --git a/src/api/client_server/membership.rs b/src/api/client_server/membership.rs index b953b651b663e4c77e725ee9a97e41673023dc1b..054d151b614b6c39e342a5d7b67ad5973d424ac5 100644 --- a/src/api/client_server/membership.rs +++ b/src/api/client_server/membership.rs @@ -259,7 +259,16 @@ pub async fn ban_user_route(body: Ruma<ban_user::v3::Request>) -> Result<ban_use serde_json::from_str(event.content.get()) .map(|event: RoomMemberEventContent| RoomMemberEventContent { membership: MembershipState::Ban, - reason: event.reason, + displayname: services() + .users + .displayname(&body.user_id) + .unwrap_or_default(), + avatar_url: services() + .users + .avatar_url(&body.user_id) + .unwrap_or_default(), + blurhash: services().users.blurhash(&body.user_id).unwrap_or_default(), + reason: body.reason.clone(), ..event }) .map_err(|_| Error::bad_database("Invalid member event in database."))