Skip to content

Commit

Permalink
clean up bsky mod service
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Dec 27, 2023
1 parent 4cae7ef commit 47241d5
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 2,102 deletions.
19 changes: 6 additions & 13 deletions packages/bsky/src/api/app/bsky/actor/getProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,18 @@ const skeleton = async (
params: Params,
ctx: Context,
): Promise<SkeletonState> => {
const { actorService, modService } = ctx
const { actorService } = ctx
const { canViewTakedowns } = params
const actor = await actorService.getActor(params.actor, true)
if (!actor) {
throw new InvalidRequestError('Profile not found')
}
if (!canViewTakedowns && softDeleted(actor)) {
const isSuspended = await modService.isSubjectSuspended(actor.did)
if (isSuspended) {
throw new InvalidRequestError(
'Account has been temporarily suspended',
'AccountTakedown',
)
} else {
throw new InvalidRequestError(
'Account has been taken down',
'AccountTakedown',
)
}
// @TODO throw a different error if the accoutn is suspended
throw new InvalidRequestError(
'Account has been taken down',
'AccountTakedown',
)
}
return { params, actor }
}
Expand Down
125 changes: 0 additions & 125 deletions packages/bsky/src/db/periodic-moderation-event-reversal.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/bsky/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export type { ServerConfigValues } from './config'
export type { MountedAlgos } from './feed-gen/types'
export { ServerConfig } from './config'
export { Database, PrimaryDatabase, DatabaseCoordinator } from './db'
export { PeriodicModerationEventReversal } from './db/periodic-moderation-event-reversal'
export { Redis } from './redis'
export { ViewMaintainer } from './db/views'
export { AppContext } from './context'
Expand All @@ -48,7 +47,6 @@ export { makeAlgos } from './feed-gen'
export * from './daemon'
export * from './indexer'
export * from './ingester'
export { MigrateModerationData } from './migrate-moderation-data'

export class BskyAppView {
public ctx: AppContext
Expand Down
Loading

0 comments on commit 47241d5

Please sign in to comment.