Fix joining public rooms without aliases in search dialog (#10437)

Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
This commit is contained in:
Michael Telatynski 2023-03-27 08:39:34 +01:00 committed by GitHub
parent 45525480ef
commit 1c039fcd38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 2 deletions

View file

@ -492,7 +492,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
}, [results, filter]);
const viewRoom = (
room: { roomId: string; roomAlias?: string; autoJoin?: boolean; shouldPeek?: boolean },
room: { roomId: string; roomAlias?: string; autoJoin?: boolean; shouldPeek?: boolean; viaServers?: string[] },
persist = false,
viaKeyboard = false,
): void => {
@ -518,6 +518,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
room_alias: room.roomAlias,
auto_join: room.autoJoin,
should_peek: room.shouldPeek,
via_servers: room.viaServers,
});
onFinished();
};
@ -634,6 +635,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
roomId: publicRoom.room_id,
autoJoin: !result.publicRoom.world_readable && !cli.isGuest(),
shouldPeek: result.publicRoom.world_readable || cli.isGuest(),
viaServers: [config.roomServer],
},
true,
ev.type !== "click",