actually test if user is allowed to send a message in the target room and only display target rooms where allowed to send messages

This commit is contained in:
Rye committed 2026-03-07 14:59:11 +01:00
1 parent 503beb0a75
commit 2a148c8a04
1 file changed
+2 -2
@@ -16,7 +16,7 @@ import {
Scroll,
} from 'folds';
import { useAtomValue, useSetAtom } from 'jotai';
import { IContent, MatrixEvent, Room } from '$types/matrix-sdk';
import { MatrixEvent, Room } from '$types/matrix-sdk';
import { useEffect, useMemo, useState } from 'react';
import { allRoomsAtom } from '$state/room-list/roomList';
import { useAllJoinedRoomsSet, useGetRoom } from '$hooks/useGetRoom';
@@ -87,7 +87,7 @@ export function MessageForwardInternal({ room, mEvent, onClose }: MessageForward
.filter((id) => id !== room.roomId)
.filter((id) => {
const target = getRoom(id);
return !!target && !target.isSpaceRoom();
return !!target && !target.isSpaceRoom() && target.maySendMessage();
})
.sort(factoryRoomIdByActivity(mx)),
[allRooms, room.roomId, getRoom, mx]