diff options
Diffstat (limited to 'server/lib/activitypub/send/send-flag.ts')
-rw-r--r-- | server/lib/activitypub/send/send-flag.ts | 5 |
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' | |||
6 | import { logger } from '../../../helpers/logger' | 6 | import { logger } from '../../../helpers/logger' |
7 | import { ActivityAudience, ActivityFlag } from '../../../../shared/models/activitypub' | 7 | import { ActivityAudience, ActivityFlag } from '../../../../shared/models/activitypub' |
8 | import { audiencify, getAudience } from '../audience' | 8 | import { audiencify, getAudience } from '../audience' |
9 | import { Transaction } from 'sequelize' | ||
9 | 10 | ||
10 | async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel, video: VideoModel) { | 11 | async 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 | ||
24 | function buildFlagActivity (url: string, byActor: ActorModel, videoAbuse: VideoAbuseModel, audience: ActivityAudience): ActivityFlag { | 25 | function buildFlagActivity (url: string, byActor: ActorModel, videoAbuse: VideoAbuseModel, audience: ActivityAudience): ActivityFlag { |