Add group chat join links to supported embed types (#10454)

This commit is contained in:
DS Boyce
2026-06-04 08:11:50 -07:00
committed by GitHub
parent c79b5bfa08
commit 08cd4e58b0
12 changed files with 434 additions and 22 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
import {AtUri} from '@atproto/api'
import psl from 'psl'
import {parse} from 'psl'
import TLDs from 'tlds'
import {BSKY_SERVICE} from '#/lib/constants'
@@ -178,6 +178,7 @@ export function isBskyStarterPackUrl(url: string): boolean {
return false
}
// Invite codes are 7 alphanumeric characters long, supporting up to 10 here to future-proof.
export const CHAT_INVITE_CODE_REGEX = /^\/c\/([a-zA-Z0-9]{7,10})$/
export function getChatInviteCodeFromUrl(url: string): string | undefined {
@@ -328,7 +329,7 @@ export function isPossiblyAUrl(str: string): boolean {
}
export function splitApexDomain(hostname: string): [string, string] {
const hostnamep = psl.parse(hostname)
const hostnamep = parse(hostname)
if (hostnamep.error || !hostnamep.listed || !hostnamep.domain) {
return ['', hostname]
}