diff --git a/api/src/api/accounts.js b/api/src/api/accounts.js index ae3aeab..eeb25d7 100644 --- a/api/src/api/accounts.js +++ b/api/src/api/accounts.js @@ -31,6 +31,14 @@ module.exports = { if (!utils.isURLValid(req.query.url)) return res.json({ error: 'invalid_url' }) + const block = await db.table.objects().findOne({ + object: apID(res.locals.user.username), + actor: req.query.url, + type: 'Block', + }) + if (block !== null) + return res.json({ error: 'user_blocked_you' }) + if (await getRejectedTimes(req, res) >= REJECT_TIMES_MAX) return res.json({ error: 'follow_rejected_max' })