From 3285c4ce222d0e55d88d187656556d246022693d Mon Sep 17 00:00:00 2001 From: IceDBorn Date: Sun, 26 Mar 2023 01:00:20 +0200 Subject: [PATCH] Show text and video rooms in different categories --- src/app/organisms/navigation/Home.jsx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/app/organisms/navigation/Home.jsx b/src/app/organisms/navigation/Home.jsx index a97b2b14..dce4347e 100644 --- a/src/app/organisms/navigation/Home.jsx +++ b/src/app/organisms/navigation/Home.jsx @@ -23,11 +23,24 @@ function Home({ spaceId, jitsiCallId }) { let spaceIds = []; let roomIds = []; let directIds = []; + let videoRoomIds = []; if (spaceId) { const spaceChildIds = roomList.getSpaceChildren(spaceId) ?? []; + const TOPIC_JITSI_CALL = 'd38dd491fefa1cfffc27f9c57f2bdb4a'; spaceIds = spaceChildIds.filter((roomId) => spaces.has(roomId)); - roomIds = spaceChildIds.filter((roomId) => rooms.has(roomId)); + roomIds = spaceChildIds.filter( + (roomId) => + rooms.has(roomId) && + mx.getRoom(roomId).currentState.getStateEvents('m.room.topic')[0]?.getContent().topic !== + TOPIC_JITSI_CALL + ); + videoRoomIds = spaceChildIds.filter( + (roomId) => + rooms.has(roomId) && + mx.getRoom(roomId).currentState.getStateEvents('m.room.topic')[0]?.getContent().topic === + TOPIC_JITSI_CALL + ); directIds = spaceChildIds.filter((roomId) => directs.has(roomId)); } else { spaceIds = roomList.getOrphanSpaces().filter((id) => !accountData.spaceShortcut.has(id)); @@ -78,9 +91,17 @@ function Home({ spaceId, jitsiCallId }) { {roomIds.length !== 0 && ( + )} + + {videoRoomIds.length !== 0 && ( + )}