diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 77df5b07f..58b3f9223 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -815,7 +815,6 @@ class ChatListController extends State && selectedRoomIds .map((id) => Matrix.of(context).client.getRoomById(id)) - // .where((e) => !(e?.isPangeaClass ?? true)) .every((e) => r.canAddAsParentOf(e)), //Pangea# ) diff --git a/lib/pangea/extensions/pangea_room_extension/children_and_parents_extension.dart b/lib/pangea/extensions/pangea_room_extension/children_and_parents_extension.dart index e5e7e6003..b0350853d 100644 --- a/lib/pangea/extensions/pangea_room_extension/children_and_parents_extension.dart +++ b/lib/pangea/extensions/pangea_room_extension/children_and_parents_extension.dart @@ -128,13 +128,15 @@ extension ChildrenAndParentsRoomExtension on Room { return childIds; } - // Checks if can add chat as child - // Or whether potential child space is ancestor of this + // Checks if has permissions to add child to space + // And whether potential child space is ancestor of this bool _canAddAsParentOf(Room? child) { if (child == null || !child.isSpace) { return _canIAddSpaceChild(child); } if (id == child.id) return false; - return !child._allSpaceChildRoomIds.contains(id); + return _isRoomAdmin && + child._isRoomAdmin && + !child._allSpaceChildRoomIds.contains(id); } }