Verified Commit 33f2507c authored by les's avatar les
Browse files

add attachment with focalPoint to AP

parent 579fd90c
......@@ -86,15 +86,18 @@ Event.prototype.toAPNote = function (username, locale, to = []) {
${tags && tags.map(t => `#${t}`)}
`
// const attachment = []
const attachment = []
if (this.media && this.media.length) {
attachment.push({
type: 'Document',
mediaType: 'image/jpeg',
url: `${config.baseurl}/media/${this.media[0].url}`,
name: this.media[0].name || '',
blurHash: null,
focalPoint: this.media[0].focalPoint || [0, 0]
})
}
// if (this.image_path) {
// attachment.push({
// type: 'Document',
// mediaType: 'image/jpeg',
// url: `${config.baseurl}/media/${this.image_path}`,
// name: null,
// blurHash: null
// })
// }
return {
......
......@@ -97,7 +97,8 @@ const Helpers = {
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1',
{
Hashtag: 'as:Hashtag'
Hashtag: 'as:Hashtag',
focalPoint: { '@container': '@list', '@id': 'toot:focalPoint' }
}]
await Helpers.signAndSend(JSON.stringify(body), sharedInbox)
}
......
Markdown is supported
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