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