From 8e13fa7d09e9925b4559cbba6c5d72c5ff1bd391 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Nov 2017 15:12:23 +0100 Subject: Add video abuse to activity pub --- shared/models/activitypub/activity.ts | 8 +++----- shared/models/activitypub/objects/index.ts | 1 + shared/models/activitypub/objects/video-abuse-object.ts | 5 +++++ shared/models/activitypub/objects/video-channel-object.ts | 2 -- shared/models/videos/video-abuse.model.ts | 4 +++- 5 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 shared/models/activitypub/objects/video-abuse-object.ts (limited to 'shared/models') diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts index 254daf118..506e64eff 100644 --- a/shared/models/activitypub/activity.ts +++ b/shared/models/activitypub/activity.ts @@ -1,8 +1,6 @@ -import { - VideoChannelObject, - VideoTorrentObject -} from './objects' +import { VideoChannelObject, VideoTorrentObject } from './objects' import { ActivityPubSignature } from './activitypub-signature' +import { VideoAbuseObject } from './objects/video-abuse-object' export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | ActivityFlag | ActivityDelete | ActivityFollow | ActivityAccept @@ -21,7 +19,7 @@ export interface BaseActivity { export interface ActivityCreate extends BaseActivity { type: 'Create' - object: VideoChannelObject + object: VideoChannelObject | VideoAbuseObject } export interface ActivityAdd extends BaseActivity { diff --git a/shared/models/activitypub/objects/index.ts b/shared/models/activitypub/objects/index.ts index 8c2e2daca..cd772b28d 100644 --- a/shared/models/activitypub/objects/index.ts +++ b/shared/models/activitypub/objects/index.ts @@ -1,3 +1,4 @@ export * from './common-objects' +export * from './video-abuse-object' export * from './video-channel-object' export * from './video-torrent-object' diff --git a/shared/models/activitypub/objects/video-abuse-object.ts b/shared/models/activitypub/objects/video-abuse-object.ts new file mode 100644 index 000000000..40e7abd57 --- /dev/null +++ b/shared/models/activitypub/objects/video-abuse-object.ts @@ -0,0 +1,5 @@ +export interface VideoAbuseObject { + type: 'Flag', + content: string + object: string +} diff --git a/shared/models/activitypub/objects/video-channel-object.ts b/shared/models/activitypub/objects/video-channel-object.ts index 72efe42b3..de504d84c 100644 --- a/shared/models/activitypub/objects/video-channel-object.ts +++ b/shared/models/activitypub/objects/video-channel-object.ts @@ -1,5 +1,3 @@ -import { ActivityIdentifierObject } from './common-objects' - export interface VideoChannelObject { type: 'VideoChannel' id: string diff --git a/shared/models/videos/video-abuse.model.ts b/shared/models/videos/video-abuse.model.ts index 38041e491..aaedd00d4 100644 --- a/shared/models/videos/video-abuse.model.ts +++ b/shared/models/videos/video-abuse.model.ts @@ -1,8 +1,10 @@ export interface VideoAbuse { id: number - reporterServerHost: string reason: string reporterUsername: string + reporterServerHost: string videoId: number + videoUUID: string + videoName: string createdAt: Date } -- cgit v1.2.3