1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-07-27 10:18:30 +00:00

fix(space-upgrades): Remove unused helper function

This commit is contained in:
nexy7574 2025-07-19 15:44:49 +01:00 committed by Jade Ellis
parent 57868a008c
commit b2b18002ea
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2

View file

@ -167,33 +167,3 @@ pub async fn user_can_invite(
.await
.is_ok()
}
#[implement(super::Service)]
pub async fn current_power_levels(
&self,
room_id: &RoomId,
) -> Result<RoomPowerLevelsEventContent> {
// fetches the current power levels event content for a room, returning the
// default power levels if no power levels event is found
let pl_event_content = self
.room_state_get_content::<RoomPowerLevelsEventContent>(
room_id,
&StateEventType::RoomPowerLevels,
"",
)
.await;
if let Ok(pl_event_content) = pl_event_content {
Ok(pl_event_content)
} else {
let mut default_power_levels = RoomPowerLevelsEventContent::default();
// set the creator as PL100
let create_event = self
.room_state_get(room_id, &StateEventType::RoomCreate, "")
.await?;
default_power_levels
.users
.insert(create_event.sender().to_owned(), Int::from(100));
Ok(default_power_levels)
}
}