From 06c27593386459b0f6b85fc674460ea5af23f7f1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 1 Jul 2021 16:47:14 +0200 Subject: Fix hooks definition --- server/lib/activitypub/send/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/lib/activitypub/send/utils.ts') diff --git a/server/lib/activitypub/send/utils.ts b/server/lib/activitypub/send/utils.ts index db0e91b71..7cd8030e1 100644 --- a/server/lib/activitypub/send/utils.ts +++ b/server/lib/activitypub/send/utils.ts @@ -22,7 +22,9 @@ async function sendVideoRelatedActivity (activityBuilder: (audience: ActivityAud // Send to origin if (video.isOwned() === false) { - const accountActor = (video as MVideoAccountLight).VideoChannel?.Account?.Actor || await ActorModel.loadAccountActorByVideoId(video.id) + let accountActor: MActorLight = (video as MVideoAccountLight).VideoChannel?.Account?.Actor + + if (!accountActor) accountActor = await ActorModel.loadAccountActorByVideoId(video.id, transaction) const audience = getRemoteVideoAudience(accountActor, actorsInvolvedInVideo) const activity = activityBuilder(audience) -- cgit v1.2.3