diff options
author | Chocobozzz <me@florianbigard.com> | 2020-09-17 13:59:02 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | de6310b2fcbb8a6b79c546b23dfa1920724faaa7 (patch) | |
tree | 57e73811ef2cf0c903782704284c9cbfc1598adb /server/lib/activitypub/process | |
parent | 1ef65f4c034cc53ab5d55417e52d60e1f7fc1ddb (diff) | |
download | PeerTube-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.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/process/process-update.ts | 4 |
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 @@ | |||
1 | import { isRedundancyAccepted } from '@server/lib/redundancy' | 1 | import { isRedundancyAccepted } from '@server/lib/redundancy' |
2 | import { ActivityCreate, CacheFileObject, VideoTorrentObject } from '../../../../shared' | 2 | import { ActivityCreate, CacheFileObject, VideoObject } from '../../../../shared' |
3 | import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' | 3 | import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' |
4 | import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object' | 4 | import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object' |
5 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 5 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
@@ -52,7 +52,7 @@ export { | |||
52 | // --------------------------------------------------------------------------- | 52 | // --------------------------------------------------------------------------- |
53 | 53 | ||
54 | async function processCreateVideo (activity: ActivityCreate, notify: boolean) { | 54 | async 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 @@ | |||
1 | import { ActivityUpdate, CacheFileObject, VideoTorrentObject } from '../../../../shared/models/activitypub' | 1 | import { ActivityUpdate, CacheFileObject, VideoObject } from '../../../../shared/models/activitypub' |
2 | import { ActivityPubActor } from '../../../../shared/models/activitypub/activitypub-actor' | 2 | import { ActivityPubActor } from '../../../../shared/models/activitypub/activitypub-actor' |
3 | import { resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers/database-utils' | 3 | import { resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers/database-utils' |
4 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
@@ -55,7 +55,7 @@ export { | |||
55 | // --------------------------------------------------------------------------- | 55 | // --------------------------------------------------------------------------- |
56 | 56 | ||
57 | async function processUpdateVideo (actor: MActorSignature, activity: ActivityUpdate) { | 57 | async 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 }) |