diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-05-17 01:38:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-16 15:38:34 -0700 |
commit | 1cdbfc709235ed1933ba51403d941762f384690b (patch) | |
tree | f55aa9a16f05645bcc5c2d63839113725b1ca308 /src/components/live/temp.ts | |
parent | 75ffb3d243a5415d173f2bca8a5334b70451a1f4 (diff) | |
download | voidsky-1cdbfc709235ed1933ba51403d941762f384690b.tar.zst |
Live via service config (#8378)
* add config (with temp config) * only allow whitelisted domains in form * move config to generic config * use array-based config * update deps * rm expect-error
Diffstat (limited to 'src/components/live/temp.ts')
-rw-r--r-- | src/components/live/temp.ts | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/components/live/temp.ts b/src/components/live/temp.ts deleted file mode 100644 index fb26b8c06..000000000 --- a/src/components/live/temp.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {type AppBskyActorDefs, AppBskyEmbedExternal} from '@atproto/api' - -import {DISCOVER_DEBUG_DIDS} from '#/lib/constants' -import type * as bsky from '#/types/bsky' - -export const LIVE_DIDS: Record<string, true> = { - 'did:plc:7sfnardo5xxznxc6esxc5ooe': true, // nba.com - 'did:plc:gx6fyi3jcfxd7ammq2t7mzp2': true, // rtgame.bsky.social -} - -export const LIVE_SOURCES: Record<string, true> = { - 'nba.com': true, - 'twitch.tv': true, -} - -// TEMP: dumb gating -export function temp__canBeLive(profile: bsky.profile.AnyProfileView) { - if (__DEV__) - return !!DISCOVER_DEBUG_DIDS[profile.did] || !!LIVE_DIDS[profile.did] - return !!LIVE_DIDS[profile.did] -} - -export function temp__canGoLive(profile: bsky.profile.AnyProfileView) { - if (__DEV__) return true - return !!LIVE_DIDS[profile.did] -} - -// status must have a embed, and the embed must be an approved host for the status to be valid -export function temp__isStatusValid(status: AppBskyActorDefs.StatusView) { - if (status.status !== 'app.bsky.actor.status#live') return false - try { - if (AppBskyEmbedExternal.isView(status.embed)) { - const url = new URL(status.embed.external.uri) - return !!LIVE_SOURCES[url.hostname] - } else { - return false - } - } catch { - return false - } -} |