use sharedInbox to send events, fix #19

This commit is contained in:
les
2019-09-13 10:17:44 +02:00
parent 1d28267f6d
commit fcc616ee2a
5 changed files with 52 additions and 30 deletions

View File

@@ -10,7 +10,7 @@ module.exports = {
const body = req.body
if (typeof body.object !== 'string') { return }
const username = body.object.replace(`${config.baseurl}/federation/u/`, '')
const user = await User.findOne({ where: { username }, include: [ FedUsers ] })
const user = await User.findOne({ where: { username }, include: { model: FedUsers, as: 'followers' }})
if (!user) { return res.status(404).send('User not found') }
// check for duplicate