aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/send/send-flag.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/send/send-flag.ts')
-rw-r--r--server/lib/activitypub/send/send-flag.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/activitypub/send/send-flag.ts b/server/lib/activitypub/send/send-flag.ts
index 96a7311b9..61ee389a6 100644
--- a/server/lib/activitypub/send/send-flag.ts
+++ b/server/lib/activitypub/send/send-flag.ts
@@ -6,8 +6,9 @@ import { unicastTo } from './utils'
6import { logger } from '../../../helpers/logger' 6import { logger } from '../../../helpers/logger'
7import { ActivityAudience, ActivityFlag } from '../../../../shared/models/activitypub' 7import { ActivityAudience, ActivityFlag } from '../../../../shared/models/activitypub'
8import { audiencify, getAudience } from '../audience' 8import { audiencify, getAudience } from '../audience'
9import { Transaction } from 'sequelize'
9 10
10async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel, video: VideoModel) { 11async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel, video: VideoModel, t: Transaction) {
11 if (!video.VideoChannel.Account.Actor.serverId) return // Local user 12 if (!video.VideoChannel.Account.Actor.serverId) return // Local user
12 13
13 const url = getVideoAbuseActivityPubUrl(videoAbuse) 14 const url = getVideoAbuseActivityPubUrl(videoAbuse)
@@ -18,7 +19,7 @@ async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel,
18 const audience = { to: [ video.VideoChannel.Account.Actor.url ], cc: [] } 19 const audience = { to: [ video.VideoChannel.Account.Actor.url ], cc: [] }
19 const flagActivity = buildFlagActivity(url, byActor, videoAbuse, audience) 20 const flagActivity = buildFlagActivity(url, byActor, videoAbuse, audience)
20 21
21 return unicastTo(flagActivity, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl) 22 t.afterCommit(() => unicastTo(flagActivity, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl))
22} 23}
23 24
24function buildFlagActivity (url: string, byActor: ActorModel, videoAbuse: VideoAbuseModel, audience: ActivityAudience): ActivityFlag { 25function buildFlagActivity (url: string, byActor: ActorModel, videoAbuse: VideoAbuseModel, audience: ActivityAudience): ActivityFlag {