diff --git a/src/api/bluesky_api.ts b/src/api/bluesky_api.ts index 9a0fccd..8d4fcdb 100644 --- a/src/api/bluesky_api.ts +++ b/src/api/bluesky_api.ts @@ -7,6 +7,8 @@ import { parseBlueskyPostURL } from '../router.js'; export { APIError }; +export const blueskyLabellerDID = 'did:plc:ar7c4by46qjdydhdevvrndac'; + /** * Thrown when the response is technically a "success" one, but the returned data is not what it should be. */ @@ -126,6 +128,14 @@ export class BlueskyAPI extends Minisky { return await this.getRequest('app.bsky.feed.searchPosts', params); } + async checkIfProfileHasNeedsReview(did: string): Promise { + let profile = await this.getRequest('app.bsky.actor.getProfile', { actor: did }, + { headers: { 'atproto-accept-labelers': blueskyLabellerDID }} + ); + + return profile.labels?.some((x: json) => (x.src == blueskyLabellerDID && x.val == 'needs-review')); + } + async loadHiddenReplyURIs(post: Post): Promise { let [constellationReplies, blueReplies] = await Promise.all([ constellationAPI.getReplies(post.uri), diff --git a/src/components/posts/HiddenRepliesLink.svelte b/src/components/posts/HiddenRepliesLink.svelte index 6f25c93..7abbd23 100644 --- a/src/components/posts/HiddenRepliesLink.svelte +++ b/src/components/posts/HiddenRepliesLink.svelte @@ -1,5 +1,5 @@