Commit 8f7f5556 authored by les's avatar les
Browse files

test outbox

parent 155079f3
......@@ -13,12 +13,12 @@ module.exports = {
console.error('No user found!')
return
}
Helpers.sendAcceptMessage(body, user, domain, req, res, targetOrigin)
console.error('FOLLOWERS ', user.followers)
if (user.followers.indexOf(body.actor) === -1) {
console.error('ok this is a new follower: ', body.actor)
await user.update({ followers: [...user.followers, body.actor] })
}
return Helpers.sendAcceptMessage(body, user, domain, req, res, targetOrigin)
},
// unfollow request from fediverse
......
......@@ -60,7 +60,16 @@ module.exports = {
first: {
id: `${config.baseurl}/federation/u/${name}/outbox`,
type: 'OrderedCollectionPage',
orderedItems: [{content: 'ciao'}]
orderedItems: [{
id: `${config.baseurl}/federation/m/12341234`,
type: 'Note',
url: `${config.baseurl}/federation/m/12341234`,
published: new Date(),
attributedTo: `${config.baseurl}/federation/u/${name}`,
sensitive: false,
to: ['https://www.w3.org/ns/activitystreams#Public'],
content: 'prova'
}]
}
}
return res.json(ret)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment