Fix archiving bugs

This commit is contained in:
Kelrap 2024-06-18 15:15:30 -04:00
parent 75f64e57d0
commit 1cf0caf48d
2 changed files with 17 additions and 2 deletions

View file

@ -338,6 +338,16 @@ class _SpaceViewState extends State<SpaceView> {
widget.controller.cancelAction();
// #Pangea
if (room == null || room.membership == Membership.leave) return;
if (room.isSpace) {
await room.archiveSpace(
context,
Matrix.of(context).client,
onlyAdmin: false,
);
} else {
widget.controller.toggleSelection(room.id);
await widget.controller.archiveAction();
}
// Pangea#
_refresh();
break;

View file

@ -60,9 +60,14 @@ extension EventsRoomExtension on Room {
future: () async {
final List<Room> children = await getChildRooms();
for (final Room child in children) {
await child.archive();
if (!child.isAnalyticsRoom) {
if (child.membership != Membership.join) {
child.join;
}
await child.archive();
}
}
await archive();
await _archive();
},
);
MatrixState.pangeaController.classController