diff options
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 566bf6992..f8f9b80c6 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -1,18 +1,19 @@ | |||
1 | import { isRedundancyAccepted } from '@server/lib/redundancy' | ||
1 | import { ActivityCreate, CacheFileObject, VideoTorrentObject } from '../../../../shared' | 2 | import { ActivityCreate, CacheFileObject, VideoTorrentObject } from '../../../../shared' |
3 | import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' | ||
2 | import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object' | 4 | import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object' |
3 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 5 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
4 | import { logger } from '../../../helpers/logger' | 6 | import { logger } from '../../../helpers/logger' |
5 | import { sequelizeTypescript } from '../../../initializers/database' | 7 | import { sequelizeTypescript } from '../../../initializers/database' |
6 | import { resolveThread } from '../video-comments' | ||
7 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' | ||
8 | import { forwardVideoRelatedActivity } from '../send/utils' | ||
9 | import { createOrUpdateCacheFile } from '../cache-file' | ||
10 | import { Notifier } from '../../notifier' | ||
11 | import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' | ||
12 | import { createOrUpdateVideoPlaylist } from '../playlist' | ||
13 | import { APProcessorOptions } from '../../../typings/activitypub-processor.model' | 8 | import { APProcessorOptions } from '../../../typings/activitypub-processor.model' |
14 | import { MActorSignature, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../../typings/models' | 9 | import { MActorSignature, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../../typings/models' |
15 | import { isRedundancyAccepted } from '@server/lib/redundancy' | 10 | import { Notifier } from '../../notifier' |
11 | import { createOrUpdateCacheFile } from '../cache-file' | ||
12 | import { createOrUpdateVideoPlaylist } from '../playlist' | ||
13 | import { forwardVideoRelatedActivity } from '../send/utils' | ||
14 | import { resolveThread } from '../video-comments' | ||
15 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' | ||
16 | import { isBlockedByServerOrAccount } from '@server/lib/blocklist' | ||
16 | 17 | ||
17 | async function processCreateActivity (options: APProcessorOptions<ActivityCreate>) { | 18 | async function processCreateActivity (options: APProcessorOptions<ActivityCreate>) { |
18 | const { activity, byActor } = options | 19 | const { activity, byActor } = options |
@@ -101,6 +102,12 @@ async function processCreateVideoComment (activity: ActivityCreate, byActor: MAc | |||
101 | return | 102 | return |
102 | } | 103 | } |
103 | 104 | ||
105 | // Try to not forward unwanted commments on our videos | ||
106 | if (video.isOwned() && await isBlockedByServerOrAccount(comment.Account, video.VideoChannel.Account)) { | ||
107 | logger.info('Skip comment forward from blocked account or server %s.', comment.Account.Actor.url) | ||
108 | return | ||
109 | } | ||
110 | |||
104 | if (video.isOwned() && created === true) { | 111 | if (video.isOwned() && created === true) { |
105 | // Don't resend the activity to the sender | 112 | // Don't resend the activity to the sender |
106 | const exceptions = [ byActor ] | 113 | const exceptions = [ byActor ] |