From 906884e434d99b78b79391269d4f2c1f5d1ccb04 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Wed, 3 Jun 2026 10:10:25 -0400 Subject: [PATCH] feat: QR code in invite modal; fix CSP to allow api.qrserver.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit InviteUserPrompt: add QR code toggle button (Icons.BlockCode) in header. When toggled, shows a 180x180 QR code image (api.qrserver.com) and the raw invite URL below it, between the header and the search form. inviteUrl computed once and shared between Copy Link and QR display. Server: added https://api.qrserver.com to img-src in CSP header on LXC 106 (/etc/nginx/sites-available/cinny) — nginx reloaded. Co-Authored-By: Claude Sonnet 4.6 --- .../invite-user-prompt/InviteUserPrompt.tsx | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/src/app/components/invite-user-prompt/InviteUserPrompt.tsx b/src/app/components/invite-user-prompt/InviteUserPrompt.tsx index 3a6d69bdd..7153a7205 100644 --- a/src/app/components/invite-user-prompt/InviteUserPrompt.tsx +++ b/src/app/components/invite-user-prompt/InviteUserPrompt.tsx @@ -68,11 +68,16 @@ export function InviteUserPrompt({ room, requestClose }: InviteUserProps) { const mx = useMatrixClient(); const alive = useAlive(); const [linkCopied, setLinkCopied] = useState(false); + const [showQr, setShowQr] = useState(false); - const handleCopyLink = () => { + const inviteUrl = (() => { const roomIdOrAlias = getCanonicalAliasOrRoomId(mx, room.roomId); const viaServers = isRoomAlias(roomIdOrAlias) ? undefined : getViaServers(room); - copyToClipboard(getMatrixToRoom(roomIdOrAlias, viaServers)); + return getMatrixToRoom(roomIdOrAlias, viaServers); + })(); + + const handleCopyLink = () => { + copyToClipboard(inviteUrl); setLinkCopied(true); setTimeout(() => setLinkCopied(false), 2000); }; @@ -202,11 +207,47 @@ export function InviteUserPrompt({ room, requestClose }: InviteUserProps) { > {linkCopied ? 'Copied!' : 'Copy Link'} + setShowQr((v) => !v)} + > + + + {showQr && ( + + QR code for room invite link + + {inviteUrl} + + + )}