diff options
Diffstat (limited to 'server/lib/activitypub/process/process-create.ts')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 99a5f6f9c..38dacf772 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -9,10 +9,9 @@ import { ActorModel } from '../../../models/activitypub/actor' | |||
9 | import { VideoAbuseModel } from '../../../models/video/video-abuse' | 9 | import { VideoAbuseModel } from '../../../models/video/video-abuse' |
10 | import { VideoCommentModel } from '../../../models/video/video-comment' | 10 | import { VideoCommentModel } from '../../../models/video/video-comment' |
11 | import { getOrCreateActorAndServerAndModel } from '../actor' | 11 | import { getOrCreateActorAndServerAndModel } from '../actor' |
12 | import { getActorsInvolvedInVideo } from '../audience' | ||
13 | import { resolveThread } from '../video-comments' | 12 | import { resolveThread } from '../video-comments' |
14 | import { getOrCreateAccountAndVideoAndChannel } from '../videos' | 13 | import { getOrCreateAccountAndVideoAndChannel } from '../videos' |
15 | import { forwardActivity } from '../send/utils' | 14 | import { forwardActivity, forwardVideoRelatedActivity } from '../send/utils' |
16 | 15 | ||
17 | async function processCreateActivity (activity: ActivityCreate) { | 16 | async function processCreateActivity (activity: ActivityCreate) { |
18 | const activityObject = activity.object | 17 | const activityObject = activity.object |
@@ -87,7 +86,8 @@ async function createVideoDislike (byActor: ActorModel, activity: ActivityCreate | |||
87 | if (video.isOwned() && created === true) { | 86 | if (video.isOwned() && created === true) { |
88 | // Don't resend the activity to the sender | 87 | // Don't resend the activity to the sender |
89 | const exceptions = [ byActor ] | 88 | const exceptions = [ byActor ] |
90 | await forwardActivity(activity, t, exceptions) | 89 | |
90 | await forwardVideoRelatedActivity(activity, t, exceptions, video) | ||
91 | } | 91 | } |
92 | }) | 92 | }) |
93 | } | 93 | } |
@@ -190,11 +190,7 @@ async function createVideoComment (byActor: ActorModel, activity: ActivityCreate | |||
190 | // Don't resend the activity to the sender | 190 | // Don't resend the activity to the sender |
191 | const exceptions = [ byActor ] | 191 | const exceptions = [ byActor ] |
192 | 192 | ||
193 | // Mastodon does not add our announces in audience, so we forward to them manually | 193 | await forwardVideoRelatedActivity(activity, t, exceptions, video) |
194 | const additionalActors = await getActorsInvolvedInVideo(video, t) | ||
195 | const additionalFollowerUrls = additionalActors.map(a => a.followersUrl) | ||
196 | |||
197 | await forwardActivity(activity, t, exceptions, additionalFollowerUrls) | ||
198 | } | 194 | } |
199 | }) | 195 | }) |
200 | } | 196 | } |