Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/appview-v2' into appview-v2-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed Jan 26, 2024
2 parents d0d0ab1 + 6dd9331 commit 0a8525f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/bsky/src/api/app/bsky/actor/getProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,17 @@ const presentation = (input: {
!params.canViewTakedowns &&
ctx.views.actorIsTakendown(skeleton.did, hydration)
) {
throw new InvalidRequestError(
'Account has been taken down',
'AccountTakedown',
)
if (ctx.views.actorIsSuspended(skeleton.did, hydration)) {
throw new InvalidRequestError(
'Account has been temporarily suspended',
'AccountTakedown',
)
} else {
throw new InvalidRequestError(
'Account has been taken down',
'AccountTakedown',
)
}
}
return profile
}
Expand Down
7 changes: 7 additions & 0 deletions packages/bsky/src/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ export class Views {
return !!state.actors?.get(did)?.takedownRef
}

actorIsSuspended(did: string, state: HydrationState): boolean {
return !!state.actors
?.get(did)
?.takedownRef?.toLowerCase()
.includes('suspend')
}

viewerBlockExists(did: string, state: HydrationState): boolean {
const actor = state.profileViewers?.get(did)
if (!actor) return false
Expand Down

0 comments on commit 0a8525f

Please sign in to comment.