This commit is contained in:
lesion
2019-07-31 01:43:08 +02:00
parent a25efc9e59
commit a09b567e97
3 changed files with 28 additions and 17 deletions

View File

@@ -37,7 +37,7 @@ module.exports = (sequelize, DataTypes) => {
event.hasMany(models.comment)
}
event.prototype.toAP = function (username) {
event.prototype.toAP = function (username, follower) {
return {
id: `${config.baseurl}/federation/m/c_${this.id}`,
type: 'Create',
@@ -48,6 +48,7 @@ module.exports = (sequelize, DataTypes) => {
published: this.createdAt,
attributedTo: `${config.baseurl}/federation/u/${username}`,
to: 'https://www.w3.org/ns/activitystreams#Public',
cc: [follower],
content: this.title
}
}