Send Bluesky feeds and suggested follows more data (#3695)
* WIP * Fix constructors * Clean up * Tweak * Rm extra assignment * Narrow down the argument --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import {AtUri} from '@atproto/api'
|
||||
|
||||
import {BSKY_FEED_OWNER_DIDS} from '#/lib/constants'
|
||||
import {UsePreferencesQueryResponse} from '#/state/queries/preferences'
|
||||
|
||||
export function createBskyTopicsHeader(userInterests?: string) {
|
||||
return {
|
||||
'X-Bsky-Topics': userInterests || '',
|
||||
}
|
||||
}
|
||||
|
||||
export function aggregateUserInterests(
|
||||
preferences?: UsePreferencesQueryResponse,
|
||||
) {
|
||||
return preferences?.interests?.tags?.join(',') || ''
|
||||
}
|
||||
|
||||
export function isBlueskyOwnedFeed(feedUri: string) {
|
||||
const uri = new AtUri(feedUri)
|
||||
return BSKY_FEED_OWNER_DIDS.includes(uri.host)
|
||||
}
|
||||
Reference in New Issue
Block a user