remove local room aliases and unpublish room when banning a room
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
bc5ecb0c72
commit
4432c06c86
1 changed files with 38 additions and 0 deletions
|
@ -208,6 +208,25 @@ async fn ban_room(
|
|||
}
|
||||
}
|
||||
|
||||
// remove any local aliases, ignore errors
|
||||
for ref local_alias in self
|
||||
.services
|
||||
.rooms
|
||||
.alias
|
||||
.local_aliases_for_room(&room_id)
|
||||
.filter_map(Result::ok)
|
||||
{
|
||||
_ = self
|
||||
.services
|
||||
.rooms
|
||||
.alias
|
||||
.remove_alias(local_alias, &self.services.globals.server_user)
|
||||
.await;
|
||||
}
|
||||
|
||||
// unpublish from room directory, ignore errors
|
||||
_ = self.services.rooms.directory.set_not_public(&room_id);
|
||||
|
||||
if disable_federation {
|
||||
self.services.rooms.metadata.disable_room(&room_id, true)?;
|
||||
return Ok(RoomMessageEventContent::text_plain(
|
||||
|
@ -428,6 +447,25 @@ async fn ban_list_of_rooms(&self, force: bool, disable_federation: bool) -> Resu
|
|||
}
|
||||
}
|
||||
|
||||
// remove any local aliases, ignore errors
|
||||
for ref local_alias in self
|
||||
.services
|
||||
.rooms
|
||||
.alias
|
||||
.local_aliases_for_room(&room_id)
|
||||
.filter_map(Result::ok)
|
||||
{
|
||||
_ = self
|
||||
.services
|
||||
.rooms
|
||||
.alias
|
||||
.remove_alias(local_alias, &self.services.globals.server_user)
|
||||
.await;
|
||||
}
|
||||
|
||||
// unpublish from room directory, ignore errors
|
||||
_ = self.services.rooms.directory.set_not_public(&room_id);
|
||||
|
||||
if disable_federation {
|
||||
self.services.rooms.metadata.disable_room(&room_id, true)?;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue