diff --git a/src/admin/user/commands.rs b/src/admin/user/commands.rs index 7b303dc6..b7df11f4 100644 --- a/src/admin/user/commands.rs +++ b/src/admin/user/commands.rs @@ -373,20 +373,12 @@ pub(super) async fn force_leave_room( #[admin_command] pub(super) async fn make_user_admin(&self, user_id: String) -> Result { let user_id = parse_local_user_id(self.services, &user_id)?; - let displayname = self - .services - .users - .displayname(&user_id)? - .unwrap_or_else(|| user_id.to_string()); assert!( self.services.globals.user_is_local(&user_id), "Parsed user_id must be a local user" ); - self.services - .admin - .make_user_admin(&user_id, displayname) - .await?; + self.services.admin.make_user_admin(&user_id).await?; Ok(RoomMessageEventContent::notice_markdown(format!( "{user_id} has been granted admin privileges.", diff --git a/src/api/client/account.rs b/src/api/client/account.rs index f1f330f6..fb010007 100644 --- a/src/api/client/account.rs +++ b/src/api/client/account.rs @@ -347,10 +347,7 @@ pub(crate) async fn register_route( if !is_guest { if let Some(admin_room) = services.admin.get_admin_room()? { if services.rooms.state_cache.room_joined_count(&admin_room)? == Some(1) { - services - .admin - .make_user_admin(&user_id, displayname) - .await?; + services.admin.make_user_admin(&user_id).await?; warn!("Granting {user_id} admin privileges as the first user"); } diff --git a/src/service/admin/grant.rs b/src/service/admin/grant.rs index e0d58600..3fe2441f 100644 --- a/src/service/admin/grant.rs +++ b/src/service/admin/grant.rs @@ -21,7 +21,7 @@ impl super::Service { /// Invite the user to the conduit admin room. /// /// In conduit, this is equivalent to granting admin privileges. - pub async fn make_user_admin(&self, user_id: &UserId, displayname: String) -> Result<()> { + pub async fn make_user_admin(&self, user_id: &UserId) -> Result<()> { let Some(room_id) = self.get_admin_room()? else { return Ok(()); }; @@ -65,7 +65,7 @@ impl super::Service { event_type: TimelineEventType::RoomMember, content: to_raw_value(&RoomMemberEventContent { membership: MembershipState::Join, - displayname: Some(displayname), + displayname: None, avatar_url: None, is_direct: None, third_party_invite: None,