Make sure a "Reject" event removes "accepted" state (if any)

This commit is contained in:
Niko 2022-02-16 14:54:38 +01:00
parent 8adfdac253
commit 51c29b034b
1 changed files with 4 additions and 2 deletions

View File

@ -39,8 +39,10 @@ module.exports = {
if (msg.object.type === 'Follow') {
const follow = await db.getAPObject(msg.object.id, 'Follow')
if (follow !== null)
await db.table.objects().updateOne({ _id: follow._id },
{ $set: { rejected: true } })
await db.table.objects().updateOne({ _id: follow._id }, {
$set: { rejected: true },
$unset: { accepted: 1 },
})
return true
}
}