Live video on the AT Protocol

Merge pull request #392 from streamplace/natb/facet-livestream-post-titles

golive: correctly resolve facets on bluesky post

authored by

natalie and committed by
GitHub
d9f53d4f 76e2c185

+12 -4
+12 -4
js/components/src/streamplace-store/stream.tsx
··· 78 78 } 79 79 } 80 80 81 - function buildGoLivePost( 81 + async function buildGoLivePost( 82 82 text: string, 83 83 url: URL, 84 84 profile: ProfileViewDetailed, 85 85 params: URLSearchParams, 86 86 thumbnail: BlobRef | undefined, 87 - ): AppBskyFeedPost.Record { 87 + agent: StreamplaceAgent, 88 + ): Promise<AppBskyFeedPost.Record> { 88 89 const now = new Date(); 89 90 const linkUrl = `${url.protocol}//${url.host}/${profile.handle}?${params.toString()}`; 90 91 const prefix = `🔴 LIVE `; ··· 93 94 const content = prefix + textUrl + suffix; 94 95 95 96 const rt = new RichText({ text: content }); 96 - rt.detectFacetsWithoutResolution(); 97 + await rt.detectFacets(agent); 97 98 const record: AppBskyFeedPost.Record = { 98 99 $type: "app.bsky.feed.post", 99 100 text: content, ··· 197 198 time: new Date().toISOString(), 198 199 }); 199 200 200 - let post = buildGoLivePost(title, u, profile.data, params, thumbnail); 201 + let post = await buildGoLivePost( 202 + title, 203 + u, 204 + profile.data, 205 + params, 206 + thumbnail, 207 + agent, 208 + ); 201 209 202 210 newPost = await createNewPost(agent, post); 203 211