diff options
Diffstat (limited to 'server/lib/activitypub/send/send-create.ts')
-rw-r--r-- | server/lib/activitypub/send/send-create.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.ts index 28f18595b..9c21149f2 100644 --- a/server/lib/activitypub/send/send-create.ts +++ b/server/lib/activitypub/send/send-create.ts | |||
@@ -11,6 +11,7 @@ import { VideoRedundancyModel } from '../../../models/redundancy/video-redundanc | |||
11 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' | 11 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' |
12 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' | 12 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' |
13 | import { getServerActor } from '../../../helpers/utils' | 13 | import { getServerActor } from '../../../helpers/utils' |
14 | import * as Bluebird from 'bluebird' | ||
14 | 15 | ||
15 | async function sendCreateVideo (video: VideoModel, t: Transaction) { | 16 | async function sendCreateVideo (video: VideoModel, t: Transaction) { |
16 | if (video.privacy === VideoPrivacy.PRIVATE) return undefined | 17 | if (video.privacy === VideoPrivacy.PRIVATE) return undefined |
@@ -82,7 +83,7 @@ async function sendCreateVideoComment (comment: VideoCommentModel, t: Transactio | |||
82 | 83 | ||
83 | // This was a reply, send it to the parent actors | 84 | // This was a reply, send it to the parent actors |
84 | const actorsException = [ byActor ] | 85 | const actorsException = [ byActor ] |
85 | await broadcastToActors(createActivity, byActor, parentsCommentActors, actorsException) | 86 | await broadcastToActors(createActivity, byActor, parentsCommentActors, t, actorsException) |
86 | 87 | ||
87 | // Broadcast to our followers | 88 | // Broadcast to our followers |
88 | await broadcastToFollowers(createActivity, byActor, [ byActor ], t) | 89 | await broadcastToFollowers(createActivity, byActor, [ byActor ], t) |
@@ -91,7 +92,7 @@ async function sendCreateVideoComment (comment: VideoCommentModel, t: Transactio | |||
91 | if (isOrigin) return broadcastToFollowers(createActivity, byActor, actorsInvolvedInComment, t, actorsException) | 92 | if (isOrigin) return broadcastToFollowers(createActivity, byActor, actorsInvolvedInComment, t, actorsException) |
92 | 93 | ||
93 | // Send to origin | 94 | // Send to origin |
94 | return unicastTo(createActivity, byActor, comment.Video.VideoChannel.Account.Actor.sharedInboxUrl) | 95 | t.afterCommit(() => unicastTo(createActivity, byActor, comment.Video.VideoChannel.Account.Actor.sharedInboxUrl)) |
95 | } | 96 | } |
96 | 97 | ||
97 | function buildCreateActivity (url: string, byActor: ActorModel, object: any, audience?: ActivityAudience): ActivityCreate { | 98 | function buildCreateActivity (url: string, byActor: ActorModel, object: any, audience?: ActivityAudience): ActivityCreate { |