more on outbox
This commit is contained in:
@@ -50,28 +50,35 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
outbox (req, res) {
|
outbox (req, res) {
|
||||||
const name = req.params.name
|
const name = req.params.name
|
||||||
|
const page = req.query.page
|
||||||
|
|
||||||
if (!name) return res.status(400).send('Bad request.')
|
if (!name) return res.status(400).send('Bad request.')
|
||||||
|
|
||||||
console.error('Inside outbox, should return all events from this user')
|
console.error('Inside outbox, should return all events from this user')
|
||||||
const ret = {
|
if (!page) {
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
const ret = {
|
||||||
id: `${config.baseurl}/federation/u/${name}/outbox`,
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
type: 'OrderedCollection',
|
|
||||||
totalItems: 1,
|
|
||||||
first: {
|
|
||||||
id: `${config.baseurl}/federation/u/${name}/outbox`,
|
id: `${config.baseurl}/federation/u/${name}/outbox`,
|
||||||
type: 'OrderedCollectionPage',
|
type: 'OrderedCollection',
|
||||||
orderedItems: [{
|
totalItems: 1,
|
||||||
id: `${config.baseurl}/federation/m/12341234`,
|
first: `${config.baseurl}/federation/u/${name}/outbox?page=true`
|
||||||
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)
|
||||||
}
|
}
|
||||||
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'
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user