Skip to content

Commit

Permalink
Fix follows
Browse files Browse the repository at this point in the history
  • Loading branch information
gabboman committed Jan 21, 2025
1 parent d2aafca commit 44d1bc2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/backend/atproto/workers/processFirehoseWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,16 @@ async function processFirehose(job: Job) {
case 'app.bsky.graph.follow': {
const userFollowed = await getAtprotoUser(record.subject, (await adminUser) as Model<any, any>)
if (userFollowed) {
let tmp = await Follows.create({
followedId: userFollowed.id,
followerId: remoteUser.id,
bskyPath: operation.path,
accepted: true
let tmp = await Follows.findOrCreate({
where: {
followedId: userFollowed.id,
followerId: remoteUser.id
}
})
const follow = tmp[0]
follow.bskyPath = operation.path
follow.accepted = true
await follow.save()
}
break
}
Expand Down

0 comments on commit 44d1bc2

Please sign in to comment.