s/toAPNote/toAPEvent/
This commit is contained in:
@@ -71,7 +71,7 @@ Event.belongsTo(Event, { as: 'parent' })
|
||||
|
||||
SequelizeSlugify.slugifyModel(Event, { source: ['title'], overwrite: false })
|
||||
|
||||
Event.prototype.toAPNote = function (username, locale, to = []) {
|
||||
Event.prototype.toAP = function (username, locale, to = []) {
|
||||
const tags = this.tags && this.tags.map(t => t.tag.replace(/[ #]/g, '_'))
|
||||
const plainDescription = htmlToText(this.description && this.description.replace('\n', '').slice(0, 1000))
|
||||
const content = `
|
||||
|
||||
@@ -89,7 +89,7 @@ const Helpers = {
|
||||
to: ['https://www.w3.org/ns/activitystreams#Public'],
|
||||
cc: [...recipients[sharedInbox], `${config.baseurl}/federation/u/${settingsController.settings.instance_name}/followers`],
|
||||
actor: `${config.baseurl}/federation/u/${settingsController.settings.instance_name}`,
|
||||
object: event.toAPNote(settingsController.settings.instance_name,
|
||||
object: event.toAP(settingsController.settings.instance_name,
|
||||
settingsController.settings.instance_locale,
|
||||
recipients[sharedInbox])
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ router.get('/m/:event_id', async (req, res) => {
|
||||
|
||||
const event = await Event.findByPk(req.params.event_id, { include: [User, Tag, Place] })
|
||||
if (!event) { return res.status(404).send('Not found') }
|
||||
return res.json(event.toAPNote(settingsController.settings.instance_name, req.settings.instance_locale))
|
||||
return res.json(event.toAP(settingsController.settings.instance_name, req.settings.instance_locale))
|
||||
})
|
||||
|
||||
// get any message coming from federation
|
||||
|
||||
@@ -132,7 +132,7 @@ module.exports = {
|
||||
cc: [`${config.baseurl}/federation/u/${name}/followers`],
|
||||
published: dayjs(e.createdAt).utc().format(),
|
||||
actor: `${config.baseurl}/federation/u/${name}`,
|
||||
object: e.toAPNote(name, req.settings.instance_locale)
|
||||
object: e.toAP(name, req.settings.instance_locale)
|
||||
}))
|
||||
}
|
||||
})
|
||||
@@ -160,7 +160,7 @@ module.exports = {
|
||||
// cc: [`${config.baseurl}/federation/u/${name}/followers`],
|
||||
// published: dayjs(e.createdAt).utc().format(),
|
||||
// actor: `${config.baseurl}/federation/u/${name}`,
|
||||
// object: e.toAPNote(name, req.settings.locale)
|
||||
// object: e.toAP(name, req.settings.locale)
|
||||
// }))
|
||||
// })
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user