X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fmoderation.ts;h=0ace2d0218c84dfa836ffb5ba90da0db34ee251f;hb=6bff8ce23ac9a2de8c6ddcea9df5f7bd2b653156;hp=4fc9cd747609a22d0d612caafc8e6c1fb944b566;hpb=ec903c010ecc54ec2acad0bf2cf10e7fbf6a0fa2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/moderation.ts b/server/lib/moderation.ts index 4fc9cd747..0ace2d021 100644 --- a/server/lib/moderation.ts +++ b/server/lib/moderation.ts @@ -18,9 +18,9 @@ import { MVideoAccountLightBlacklistAllFiles } from '@server/types/models' import { ActivityCreate } from '../../shared/models/activitypub' -import { VideoTorrentObject } from '../../shared/models/activitypub/objects' +import { VideoObject } from '../../shared/models/activitypub/objects' import { VideoCommentObject } from '../../shared/models/activitypub/objects/video-comment-object' -import { VideoCreate, VideoImportCreate } from '../../shared/models/videos' +import { LiveVideoCreate, VideoCreate, VideoImportCreate } from '../../shared/models/videos' import { VideoCommentCreate } from '../../shared/models/videos/video-comment.model' import { UserModel } from '../models/account/user' import { ActorModel } from '../models/activitypub/actor' @@ -43,6 +43,13 @@ function isLocalVideoAccepted (object: { return { accepted: true } } +function isLocalLiveVideoAccepted (object: { + liveVideoBody: LiveVideoCreate + user: UserModel +}): AcceptResult { + return { accepted: true } +} + function isLocalVideoThreadAccepted (_object: { commentBody: VideoCommentCreate video: VideoModel @@ -62,7 +69,7 @@ function isLocalVideoCommentReplyAccepted (_object: { function isRemoteVideoAccepted (_object: { activity: ActivityCreate - videoAP: VideoTorrentObject + videoAP: VideoObject byActor: ActorModel }): AcceptResult { return { accepted: true } @@ -175,6 +182,8 @@ function createAccountAbuse (options: { } export { + isLocalLiveVideoAccepted, + isLocalVideoAccepted, isLocalVideoThreadAccepted, isRemoteVideoAccepted, @@ -213,7 +222,7 @@ async function createAbuse (options: { await sendAbuse(reporterAccount.Actor, abuseInstance, abuseInstance.FlaggedAccount, transaction) } - const abuseJSON = abuseInstance.toFormattedJSON() + const abuseJSON = abuseInstance.toFormattedAdminJSON() auditLogger.create(reporterAccount.Actor.getIdentifier(), new AbuseAuditView(abuseJSON)) Notifier.Instance.notifyOnNewAbuse({