Skip to content

Commit

Permalink
Emit deactivation event on updateSubjectStatus (#2547)
Browse files Browse the repository at this point in the history
* emit account event on updateSubjectSTatus

* changeset

* tidy

* dont double emit

* rerun CI

* rerun CI
  • Loading branch information
dholms authored Jun 4, 2024
1 parent 5441fbd commit d8e2fef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-books-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/pds": patch
---

Emit an account event on updateSubjectStatus.
7 changes: 5 additions & 2 deletions packages/pds/src/api/com/atproto/admin/updateSubjectStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export default function (server: Server, ctx: AppContext) {
if (takedown) {
if (isRepoRef(subject)) {
await ctx.accountManager.takedownAccount(subject.did, takedown)
const status = await ctx.accountManager.getAccountStatus(subject.did)
await ctx.sequencer.sequenceAccountEvt(subject.did, status)
} else if (isStrongRef(subject)) {
const uri = new AtUri(subject.uri)
await ctx.actorStore.transact(uri.hostname, (store) =>
Expand Down Expand Up @@ -46,6 +44,11 @@ export default function (server: Server, ctx: AppContext) {
}
}

if (isRepoRef(subject)) {
const status = await ctx.accountManager.getAccountStatus(subject.did)
await ctx.sequencer.sequenceAccountEvt(subject.did, status)
}

return {
encoding: 'application/json',
body: {
Expand Down

0 comments on commit d8e2fef

Please sign in to comment.