If remote user blocked a user, make user unable to follow
This commit is contained in:
parent
629de2d8b7
commit
8adfdac253
|
@ -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' })
|
||||
|
||||
|
|
Loading…
Reference in New Issue