From 69388acadec7ad93fc7ef599952df3e0ae700c79 Mon Sep 17 00:00:00 2001 From: les Date: Wed, 7 Aug 2019 19:36:10 +0200 Subject: [PATCH] add link and time to AP post --- server/api/models/event.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/api/models/event.js b/server/api/models/event.js index 1199fdb1..876b8a0d 100644 --- a/server/api/models/event.js +++ b/server/api/models/event.js @@ -1,4 +1,5 @@ const config = require('config') +const moment = require('moment') module.exports = (sequelize, DataTypes) => { const event = sequelize.define('event', { @@ -47,7 +48,7 @@ module.exports = (sequelize, DataTypes) => { attributedTo: `${config.baseurl}/federation/u/${username}`, to: 'https://www.w3.org/ns/activitystreams#Public', cc: follower ? follower: [], - content: `${this.title} @${this.place.name}
${this.description.length > 200 ? this.description.substr(0, 200) + '...' : this.description} - ${this.tags.map(t => '#' + t.tag).join(' ')}
${config.baseurl}/event/${this.id}` + content: `${this.title} @${this.place.name} ${moment.unix(this.start_datetime).format('dddd, D MMMM (HH:mm)')}
${this.description.length > 200 ? this.description.substr(0, 200) + '...' : this.description} - ${this.tags.map(t => '#' + t.tag).join(' ')}
` } } }