fix: when leaving space, do not leave analytics rooms (#1973)

pull/1688/head
ggurdin 8 months ago committed by GitHub
parent e9bfcbe88a
commit 8400c42f01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2,10 +2,15 @@ part of "pangea_room_extension.dart";
extension EventsRoomExtension on Room {
Future<void> leaveSpace() async {
if (!isSpace) {
debugPrint("room is not a space!");
return;
}
for (final child in spaceChildren) {
if (child.roomId == null) continue;
final Room? room = client.getRoomById(child.roomId!);
if (room == null) continue;
if (room == null || room.isAnalyticsRoom) continue;
try {
await room.leave();
} catch (e, s) {

Loading…
Cancel
Save