aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/process
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-09-17 13:59:02 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commitde6310b2fcbb8a6b79c546b23dfa1920724faaa7 (patch)
tree57e73811ef2cf0c903782704284c9cbfc1598adb /server/lib/activitypub/process
parent1ef65f4c034cc53ab5d55417e52d60e1f7fc1ddb (diff)
downloadPeerTube-de6310b2fcbb8a6b79c546b23dfa1920724faaa7.tar.gz
PeerTube-de6310b2fcbb8a6b79c546b23dfa1920724faaa7.tar.zst
PeerTube-de6310b2fcbb8a6b79c546b23dfa1920724faaa7.zip
Handle live federation
Diffstat (limited to 'server/lib/activitypub/process')
-rw-r--r--server/lib/activitypub/process/process-create.ts4
-rw-r--r--server/lib/activitypub/process/process-update.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts
index 74f1032e2..f84992489 100644
--- a/server/lib/activitypub/process/process-create.ts
+++ b/server/lib/activitypub/process/process-create.ts
@@ -1,5 +1,5 @@
1import { isRedundancyAccepted } from '@server/lib/redundancy' 1import { isRedundancyAccepted } from '@server/lib/redundancy'
2import { ActivityCreate, CacheFileObject, VideoTorrentObject } from '../../../../shared' 2import { ActivityCreate, CacheFileObject, VideoObject } from '../../../../shared'
3import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' 3import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object'
4import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object' 4import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object'
5import { retryTransactionWrapper } from '../../../helpers/database-utils' 5import { retryTransactionWrapper } from '../../../helpers/database-utils'
@@ -52,7 +52,7 @@ export {
52// --------------------------------------------------------------------------- 52// ---------------------------------------------------------------------------
53 53
54async function processCreateVideo (activity: ActivityCreate, notify: boolean) { 54async function processCreateVideo (activity: ActivityCreate, notify: boolean) {
55 const videoToCreateData = activity.object as VideoTorrentObject 55 const videoToCreateData = activity.object as VideoObject
56 56
57 const syncParam = { likes: false, dislikes: false, shares: false, comments: false, thumbnail: true, refreshVideo: false } 57 const syncParam = { likes: false, dislikes: false, shares: false, comments: false, thumbnail: true, refreshVideo: false }
58 const { video, created } = await getOrCreateVideoAndAccountAndChannel({ videoObject: videoToCreateData, syncParam }) 58 const { video, created } = await getOrCreateVideoAndAccountAndChannel({ videoObject: videoToCreateData, syncParam })
diff --git a/server/lib/activitypub/process/process-update.ts b/server/lib/activitypub/process/process-update.ts
index 1bdf23d6f..6d2fff3fe 100644
--- a/server/lib/activitypub/process/process-update.ts
+++ b/server/lib/activitypub/process/process-update.ts
@@ -1,4 +1,4 @@
1import { ActivityUpdate, CacheFileObject, VideoTorrentObject } from '../../../../shared/models/activitypub' 1import { ActivityUpdate, CacheFileObject, VideoObject } from '../../../../shared/models/activitypub'
2import { ActivityPubActor } from '../../../../shared/models/activitypub/activitypub-actor' 2import { ActivityPubActor } from '../../../../shared/models/activitypub/activitypub-actor'
3import { resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers/database-utils' 3import { resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers/database-utils'
4import { logger } from '../../../helpers/logger' 4import { logger } from '../../../helpers/logger'
@@ -55,7 +55,7 @@ export {
55// --------------------------------------------------------------------------- 55// ---------------------------------------------------------------------------
56 56
57async function processUpdateVideo (actor: MActorSignature, activity: ActivityUpdate) { 57async function processUpdateVideo (actor: MActorSignature, activity: ActivityUpdate) {
58 const videoObject = activity.object as VideoTorrentObject 58 const videoObject = activity.object as VideoObject
59 59
60 if (sanitizeAndCheckVideoTorrentObject(videoObject) === false) { 60 if (sanitizeAndCheckVideoTorrentObject(videoObject) === false) {
61 logger.debug('Video sent by update is not valid.', { videoObject }) 61 logger.debug('Video sent by update is not valid.', { videoObject })