mirror of https://github.com/Chocobozzz/PeerTube
Fix moderation notification
parent
8726cd4941
commit
a2eba50b8e
|
@ -28,6 +28,7 @@ import { VideoModel } from '../models/video/video'
|
||||||
import { VideoCommentModel } from '../models/video/video-comment'
|
import { VideoCommentModel } from '../models/video/video-comment'
|
||||||
import { sendAbuse } from './activitypub/send/send-flag'
|
import { sendAbuse } from './activitypub/send/send-flag'
|
||||||
import { Notifier } from './notifier'
|
import { Notifier } from './notifier'
|
||||||
|
import { afterCommitIfTransaction } from '@server/helpers/database-utils'
|
||||||
|
|
||||||
export type AcceptResult = {
|
export type AcceptResult = {
|
||||||
accepted: boolean
|
accepted: boolean
|
||||||
|
@ -225,11 +226,13 @@ async function createAbuse (options: {
|
||||||
const abuseJSON = abuseInstance.toFormattedAdminJSON()
|
const abuseJSON = abuseInstance.toFormattedAdminJSON()
|
||||||
auditLogger.create(reporterAccount.Actor.getIdentifier(), new AbuseAuditView(abuseJSON))
|
auditLogger.create(reporterAccount.Actor.getIdentifier(), new AbuseAuditView(abuseJSON))
|
||||||
|
|
||||||
|
afterCommitIfTransaction(transaction, () => {
|
||||||
Notifier.Instance.notifyOnNewAbuse({
|
Notifier.Instance.notifyOnNewAbuse({
|
||||||
abuse: abuseJSON,
|
abuse: abuseJSON,
|
||||||
abuseInstance,
|
abuseInstance,
|
||||||
reporter: reporterAccount.Actor.getIdentifier()
|
reporter: reporterAccount.Actor.getIdentifier()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
logger.info('Abuse report %d created.', abuseInstance.id)
|
logger.info('Abuse report %d created.', abuseInstance.id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue