..
This commit is contained in:
@@ -9,6 +9,7 @@ const mail = require('../mail')
|
||||
const { user: User, event: Event, tag: Tag, place: Place } = require('../models')
|
||||
const settingsController = require('./settings')
|
||||
const notifier = require('../../notifier')
|
||||
const federation = require('../../federation/helpers')
|
||||
|
||||
const userController = {
|
||||
async login(req, res) {
|
||||
@@ -121,6 +122,8 @@ const userController = {
|
||||
// send response to client
|
||||
res.json(event)
|
||||
|
||||
federation.sendEvent(event, user)
|
||||
|
||||
// send notification (mastodon/email/confirmation)
|
||||
notifier.notifyEvent(event.id)
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user