]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/send/send-accept.ts
Convert followers/following in raw SQL queries
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / send / send-accept.ts
index bb387e2c0e2b65ceab254bba2ef48868b180897d..4c9bcbb0b3f99086733be1e4d908f412fee85773 100644 (file)
@@ -1,9 +1,9 @@
-import { ActivityAccept, ActivityFollow } from '../../../../shared/models/activitypub'
+import { ActivityAccept, ActivityFollow } from '@shared/models'
 import { logger } from '../../../helpers/logger'
 import { MActor, MActorFollowActors } from '../../../types/models'
 import { getLocalActorFollowAcceptActivityPubUrl } from '../url'
 import { buildFollowActivity } from './send-follow'
-import { unicastTo } from './utils'
+import { unicastTo } from './shared/send-utils'
 
 function sendAccept (actorFollow: MActorFollowActors) {
   const follower = actorFollow.ActorFollower
@@ -21,7 +21,12 @@ function sendAccept (actorFollow: MActorFollowActors) {
   const url = getLocalActorFollowAcceptActivityPubUrl(actorFollow)
   const data = buildAcceptActivity(url, me, followData)
 
-  return unicastTo(data, me, follower.inboxUrl)
+  return unicastTo({
+    data,
+    byActor: me,
+    toActorUrl: follower.inboxUrl,
+    contextType: 'Accept'
+  })
 }
 
 // ---------------------------------------------------------------------------