aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-16 17:04:19 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:52 +0100
commit21e0727a84734cb0c81c1c9bb22a49b13e46fe5f (patch)
tree088da51cadbffe3ac64414b407e161f58b53bde7 /server/lib/activitypub
parentd7d5611c8a23de9b483f0437ad3469afef7b8805 (diff)
downloadPeerTube-21e0727a84734cb0c81c1c9bb22a49b13e46fe5f.tar.gz
PeerTube-21e0727a84734cb0c81c1c9bb22a49b13e46fe5f.tar.zst
PeerTube-21e0727a84734cb0c81c1c9bb22a49b13e46fe5f.zip
Federate video abuses
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r--server/lib/activitypub/misc.ts6
-rw-r--r--server/lib/activitypub/send-request.ts4
2 files changed, 4 insertions, 6 deletions
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 @@
1import * as magnetUtil from 'magnet-uri' 1import * as magnetUtil from 'magnet-uri'
2import * as Sequelize from 'sequelize'
3import { VideoTorrentObject } from '../../../shared' 2import { VideoTorrentObject } from '../../../shared'
3import { VideoChannelObject } from '../../../shared/models/activitypub/objects/video-channel-object'
4import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos' 4import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos'
5import { database as db } from '../../initializers'
6import { VIDEO_MIMETYPE_EXT } from '../../initializers/constants' 5import { VIDEO_MIMETYPE_EXT } from '../../initializers/constants'
6import { AccountInstance } from '../../models/account/account-interface'
7import { VideoChannelInstance } from '../../models/video/video-channel-interface' 7import { VideoChannelInstance } from '../../models/video/video-channel-interface'
8import { VideoFileAttributes } from '../../models/video/video-file-interface' 8import { VideoFileAttributes } from '../../models/video/video-file-interface'
9import { VideoAttributes, VideoInstance } from '../../models/video/video-interface' 9import { VideoAttributes, VideoInstance } from '../../models/video/video-interface'
10import { VideoChannelObject } from '../../../shared/models/activitypub/objects/video-channel-object'
11import { AccountInstance } from '../../models/account/account-interface'
12 10
13function videoChannelActivityObjectToDBAttributes (videoChannelObject: VideoChannelObject, account: AccountInstance) { 11function videoChannelActivityObjectToDBAttributes (videoChannelObject: VideoChannelObject, account: AccountInstance) {
14 return { 12 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 {
8} from '../../models' 8} from '../../models'
9import { httpRequestJobScheduler } from '../jobs' 9import { httpRequestJobScheduler } from '../jobs'
10import { signObject, activityPubContextify } from '../../helpers' 10import { signObject, activityPubContextify } from '../../helpers'
11import { Activity } from '../../../shared' 11import { Activity, VideoAbuseObject } from '../../../shared'
12import { VideoAbuseInstance } from '../../models/video/video-abuse-interface' 12import { VideoAbuseInstance } from '../../models/video/video-abuse-interface'
13import { getActivityPubUrl } from '../../helpers/activitypub' 13import { getActivityPubUrl } from '../../helpers/activitypub'
14import { logger } from '../../helpers/logger' 14import { logger } from '../../helpers/logger'
@@ -96,7 +96,7 @@ async function sendVideoAbuse (
96 t: Sequelize.Transaction 96 t: Sequelize.Transaction
97) { 97) {
98 const url = getActivityPubUrl('videoAbuse', videoAbuse.id.toString()) 98 const url = getActivityPubUrl('videoAbuse', videoAbuse.id.toString())
99 const data = await createActivityData(url, fromAccount, video.url) 99 const data = await createActivityData(url, fromAccount, videoAbuse.toActivityPubObject())
100 100
101 return unicastTo(data, video.VideoChannel.Account.sharedInboxUrl, t) 101 return unicastTo(data, video.VideoChannel.Account.sharedInboxUrl, t)
102} 102}