add attachment with focalPoint to AP

This commit is contained in:
les
2021-07-19 12:29:35 +02:00
parent 579fd90c2d
commit 33f2507cba
2 changed files with 13 additions and 9 deletions

View File

@@ -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 {