Commit 1d4761aa authored by les's avatar les
Browse files

more on outbox

parent 8f7f5556
......@@ -50,28 +50,35 @@ module.exports = {
},
outbox (req, res) {
const name = req.params.name
const page = req.query.page
if (!name) return res.status(400).send('Bad request.')
console.error('Inside outbox, should return all events from this user')
const ret = {
'@context': 'https://www.w3.org/ns/activitystreams',
id: `${config.baseurl}/federation/u/${name}/outbox`,
type: 'OrderedCollection',
totalItems: 1,
first: {
if (!page) {
const ret = {
'@context': 'https://www.w3.org/ns/activitystreams',
id: `${config.baseurl}/federation/u/${name}/outbox`,
type: 'OrderedCollectionPage',
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'
}]
type: 'OrderedCollection',
totalItems: 1,
first: `${config.baseurl}/federation/u/${name}/outbox?page=true`
}
return res.json(ret)
}
return res.json(ret)
const ret = {
'@context': 'https://www.w3.org/ns/activitystreams',
id: `${config.baseurl}/federation/u/${name}/outbox?page=true`,
type: 'OrderedCollectionPage',
partOf: `${config.baseurl}/federation/u/${name}/outbox`,
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'
}]
}
}
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