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:
parent
57868a008c
commit
b2b18002ea
1 changed files with 0 additions and 30 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue