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