import { getServerActor } from '@server/models/application/application'
import { ServerBlocklistModel } from '@server/models/server/server-blocklist'
import {
import { getServerActor } from '@server/models/application/application'
import { ServerBlocklistModel } from '@server/models/server/server-blocklist'
import {
this.notifyOfNewAbuseMessage(abuse, message)
.catch(err => {
logger.error('Cannot notify on new abuse %d message.', abuse.id, { err })
this.notifyOfNewAbuseMessage(abuse, message)
.catch(err => {
logger.error('Cannot notify on new abuse %d message.', abuse.id, { err })
const url = this.getAbuseUrl(abuse)
logger.info('Notifying reporter and moderators of new abuse message on %s.', url)
const url = this.getAbuseUrl(abuse)
logger.info('Notifying reporter and moderators of new abuse message on %s.', url)
function settingGetter (user: MUserWithNotificationSetting) {
return user.NotificationSetting.abuseNewMessage
}
function settingGetter (user: MUserWithNotificationSetting) {
return user.NotificationSetting.abuseNewMessage
}
- return Emailer.Instance.addAbuseNewMessageNotification(emails, { target: 'reporter', abuse, message })
+ return Emailer.Instance.addAbuseNewMessageNotification(emails, { target: 'reporter', abuse, message, accountMessage })
- return Emailer.Instance.addAbuseNewMessageNotification(emails, { target: 'moderator', abuse, message })
+ return Emailer.Instance.addAbuseNewMessageNotification(emails, { target: 'moderator', abuse, message, accountMessage })
const reporter = await UserModel.loadByAccountActorId(abuse.ReporterAccount.actorId)
// Don't notify my own message
const reporter = await UserModel.loadByAccountActorId(abuse.ReporterAccount.actorId)
// Don't notify my own message
return { users: [ reporter ], settingGetter, notificationCreator, emailSender: emailSenderReporter }
}
return { users: [ reporter ], settingGetter, notificationCreator, emailSender: emailSenderReporter }
}
// Don't notify my own message
moderators = moderators.filter(m => m.Account.id !== message.accountId)
// Don't notify my own message
moderators = moderators.filter(m => m.Account.id !== message.accountId)
return { users: moderators, settingGetter, notificationCreator, emailSender: emailSenderModerators }
}
return { users: moderators, settingGetter, notificationCreator, emailSender: emailSenderModerators }
}