From 8d4f78ecaf523ebcf7e9b043b1d9fb469f6e5d4e Mon Sep 17 00:00:00 2001 From: Priyanshubhartistm Date: Wed, 8 Apr 2026 17:49:36 +0530 Subject: [PATCH] feat(links): detect invite links in previews --- src/app/components/ContentLinkBlock.svelte | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/components/ContentLinkBlock.svelte b/src/app/components/ContentLinkBlock.svelte index ec981015..f82e2b73 100644 --- a/src/app/components/ContentLinkBlock.svelte +++ b/src/app/components/ContentLinkBlock.svelte @@ -6,7 +6,13 @@ import ContentLinkDetail from "@app/components/ContentLinkDetail.svelte" import ContentLinkBlockImage from "@app/components/ContentLinkBlockImage.svelte" import {pushModal} from "@app/util/modal" - import {dufflepud, PLATFORM_URL, IMAGE_CONTENT_TYPES, VIDEO_CONTENT_TYPES} from "@app/core/state" + import { + dufflepud, + PLATFORM_URL, + IMAGE_CONTENT_TYPES, + VIDEO_CONTENT_TYPES, + parseInviteLink, + } from "@app/core/state" import {makeSpacePath} from "@app/util/routes" const {value, event} = $props() @@ -14,6 +20,7 @@ let hideImage = $state(false) const url = value.url.toString() + const inviteData = parseInviteLink(url) const fileType = getTagValue("file-type", event.tags) || "" const [href, external] = call(() => { if (isRelayUrl(url)) return [makeSpacePath(url), false] @@ -49,6 +56,10 @@ + {:else if inviteData} +
+ {displayUrl(inviteData.url)} +
{:else} {#await loadPreview()}