]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/send/send-follow.ts
Add gitlab ci support
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / send / send-follow.ts
index 2c3d02014e9022a35b781f58246872359ed52499..c6e7fe83d81946f8af1f608a238bb1ebbfc9d3cd 100644 (file)
@@ -4,8 +4,9 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
 import { getActorFollowActivityPubUrl } from '../url'
 import { unicastTo } from './utils'
 import { logger } from '../../../helpers/logger'
+import { Transaction } from 'sequelize'
 
-function sendFollow (actorFollow: ActorFollowModel) {
+function sendFollow (actorFollow: ActorFollowModel, t: Transaction) {
   const me = actorFollow.ActorFollower
   const following = actorFollow.ActorFollowing
 
@@ -17,7 +18,7 @@ function sendFollow (actorFollow: ActorFollowModel) {
   const url = getActorFollowActivityPubUrl(me, following)
   const data = buildFollowActivity(url, me, following)
 
-  return unicastTo(data, me, following.inboxUrl)
+  t.afterCommit(() => unicastTo(data, me, following.inboxUrl))
 }
 
 function buildFollowActivity (url: string, byActor: ActorModel, targetActor: ActorModel): ActivityFollow {