Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Peek into world-readable rooms from spotlight #9115

Merged
merged 4 commits into from
Jul 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Specify should_peek
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
  • Loading branch information
SimonBrandner committed Jul 29, 2022
commit 65a9c7349e69d330cad111404f235829d44f33e9
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
}, [results, filter]);

const viewRoom = (
room: {roomId: string, roomAlias?: string, autoJoin?: boolean},
room: { roomId: string, roomAlias?: string, autoJoin?: boolean, shouldPeek?: boolean},
persist = false,
viaKeyboard = false,
) => {
Expand All @@ -511,6 +511,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
room_id: room.roomId,
room_alias: room.roomAlias,
auto_join: room.autoJoin,
t3chguy marked this conversation as resolved.
Show resolved Hide resolved
should_peek: room.shouldPeek,
});
onFinished();
};
Expand Down Expand Up @@ -629,6 +630,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
roomAlias: publicRoom.canonical_alias || publicRoom.aliases?.[0],
roomId: publicRoom.room_id,
autoJoin: !result.publicRoom.world_readable && !cli.isGuest(),
shouldPeek: result.publicRoom.world_readable || cli.isGuest(),
}, true, ev.type !== "click");
};
return (
Expand Down