From 21e0727a84734cb0c81c1c9bb22a49b13e46fe5f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 16 Nov 2017 17:04:19 +0100 Subject: Federate video abuses --- server/lib/activitypub/misc.ts | 6 ++---- server/lib/activitypub/send-request.ts | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'server/lib') diff --git a/server/lib/activitypub/misc.ts b/server/lib/activitypub/misc.ts index f853d742e..c07d9f654 100644 --- a/server/lib/activitypub/misc.ts +++ b/server/lib/activitypub/misc.ts @@ -1,14 +1,12 @@ import * as magnetUtil from 'magnet-uri' -import * as Sequelize from 'sequelize' import { VideoTorrentObject } from '../../../shared' +import { VideoChannelObject } from '../../../shared/models/activitypub/objects/video-channel-object' import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos' -import { database as db } from '../../initializers' import { VIDEO_MIMETYPE_EXT } from '../../initializers/constants' +import { AccountInstance } from '../../models/account/account-interface' import { VideoChannelInstance } from '../../models/video/video-channel-interface' import { VideoFileAttributes } from '../../models/video/video-file-interface' import { VideoAttributes, VideoInstance } from '../../models/video/video-interface' -import { VideoChannelObject } from '../../../shared/models/activitypub/objects/video-channel-object' -import { AccountInstance } from '../../models/account/account-interface' function videoChannelActivityObjectToDBAttributes (videoChannelObject: VideoChannelObject, account: AccountInstance) { return { diff --git a/server/lib/activitypub/send-request.ts b/server/lib/activitypub/send-request.ts index d5d07011a..abc1b598d 100644 --- a/server/lib/activitypub/send-request.ts +++ b/server/lib/activitypub/send-request.ts @@ -8,7 +8,7 @@ import { } from '../../models' import { httpRequestJobScheduler } from '../jobs' import { signObject, activityPubContextify } from '../../helpers' -import { Activity } from '../../../shared' +import { Activity, VideoAbuseObject } from '../../../shared' import { VideoAbuseInstance } from '../../models/video/video-abuse-interface' import { getActivityPubUrl } from '../../helpers/activitypub' import { logger } from '../../helpers/logger' @@ -96,7 +96,7 @@ async function sendVideoAbuse ( t: Sequelize.Transaction ) { const url = getActivityPubUrl('videoAbuse', videoAbuse.id.toString()) - const data = await createActivityData(url, fromAccount, video.url) + const data = await createActivityData(url, fromAccount, videoAbuse.toActivityPubObject()) return unicastTo(data, video.VideoChannel.Account.sharedInboxUrl, t) } -- cgit v1.2.3