]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/lib/moderation.ts
Merge branch 'release/1.4.0' into develop
[github/Chocobozzz/PeerTube.git] / server / lib / moderation.ts
CommitLineData
b4055e1c
C
1import { VideoModel } from '../models/video/video'
2import { VideoCommentModel } from '../models/video/video-comment'
3import { VideoCommentCreate } from '../../shared/models/videos/video-comment.model'
4import { VideoCreate } from '../../shared/models/videos'
5import { UserModel } from '../models/account/user'
6import { VideoTorrentObject } from '../../shared/models/activitypub/objects'
7import { ActivityCreate } from '../../shared/models/activitypub'
8import { ActorModel } from '../models/activitypub/actor'
9import { VideoCommentObject } from '../../shared/models/activitypub/objects/video-comment-object'
10
11export type AcceptResult = {
12 accepted: boolean
13 errorMessage?: string
14}
15
16// Can be filtered by plugins
17function isLocalVideoAccepted (object: {
18 videoBody: VideoCreate,
19 videoFile: Express.Multer.File & { duration?: number },
20 user: UserModel
21}): AcceptResult {
22 return { accepted: true }
23}
24
25function isLocalVideoThreadAccepted (_object: {
26 commentBody: VideoCommentCreate,
27 video: VideoModel,
28 user: UserModel
29}): AcceptResult {
30 return { accepted: true }
31}
32
33function isLocalVideoCommentReplyAccepted (_object: {
34 commentBody: VideoCommentCreate,
35 parentComment: VideoCommentModel,
36 video: VideoModel,
37 user: UserModel
38}): AcceptResult {
39 return { accepted: true }
40}
41
42function isRemoteVideoAccepted (_object: {
43 activity: ActivityCreate,
44 videoAP: VideoTorrentObject,
45 byActor: ActorModel
46}): AcceptResult {
47 return { accepted: true }
48}
49
50function isRemoteVideoCommentAccepted (_object: {
51 activity: ActivityCreate,
52 commentAP: VideoCommentObject,
53 byActor: ActorModel
54}): AcceptResult {
55 return { accepted: true }
56}
57
58export {
59 isLocalVideoAccepted,
60 isLocalVideoThreadAccepted,
61 isRemoteVideoAccepted,
62 isRemoteVideoCommentAccepted,
63 isLocalVideoCommentReplyAccepted
64}