diff --git a/lib/pangea/controllers/class_controller.dart b/lib/pangea/controllers/class_controller.dart index b4bc18b87..64a8340ae 100644 --- a/lib/pangea/controllers/class_controller.dart +++ b/lib/pangea/controllers/class_controller.dart @@ -17,7 +17,6 @@ import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:matrix/matrix.dart'; import '../../widgets/matrix.dart'; -import '../utils/bot_name.dart'; import '../utils/firebase_analytics.dart'; import 'base_controller.dart'; @@ -69,41 +68,6 @@ class ClassController extends BaseController { } } - /// if not bot chat return - /// if bot chat, get pangeaClassContext - /// for all classes not in pangeaClassContext, add bot chat to that class - /// PTODO - add analytics bot to all chats and have that do this work - Future> addDirectChatsToClasses(Room room) async { - if (!room.isDirectChat) return []; - final List existingParentsIds = - room.pangeaSpaceParents.map((e) => e.id).toList(); - final List spaces = _pangeaController.matrixState.client.spacesImIn; - - //make sure we have the latest participants - await Future.wait(spaces.map((e) => e.requestParticipants())); - - //get spaces where, - //other chat participant is the bot OR is in the space AND the chat is not - final List spacesToAdd = spaces - .where( - (s) => - (room.directChatMatrixID == BotName.byEnvironment || - s - .getParticipants() - .map( - (u) => u.id, - ) - .contains(room.directChatMatrixID)) && - !existingParentsIds.contains(s.id), - ) - .toList(); - - //set the space child for each space - return Future.wait( - spacesToAdd.map((s) => s.setSpaceChild(room.id, suggested: true)), - ).then((value) => spaces); - } - Future joinClasswithCode(BuildContext context, String classCode) async { try { final QueryPublicRoomsResponse queryPublicRoomsResponse =