]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/send/send-follow.ts
Put activity pub sends inside transactions
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / send / send-follow.ts
index 48d641c22d1f085e9b7a8fb4810054dda1db5890..8fba1b6b57661ca765714091bc2055f36512d19a 100644 (file)
@@ -2,20 +2,20 @@ import { Transaction } from 'sequelize'
 import { ActivityFollow } from '../../../../shared/models/activitypub/activity'
 import { AccountInstance } from '../../../models'
 import { AccountFollowInstance } from '../../../models/account/account-follow-interface'
+import { getAccountFollowActivityPubUrl } from '../url'
 import { unicastTo } from './misc'
-import { getAccountFollowActivityPubUrl } from '../../../helpers/activitypub'
 
-async function sendFollow (accountFollow: AccountFollowInstance, t: Transaction) {
+function sendFollow (accountFollow: AccountFollowInstance, t: Transaction) {
   const me = accountFollow.AccountFollower
   const following = accountFollow.AccountFollowing
 
   const url = getAccountFollowActivityPubUrl(accountFollow)
-  const data = await followActivityData(url, me, following)
+  const data = followActivityData(url, me, following)
 
   return unicastTo(data, me, following.inboxUrl, t)
 }
 
-async function followActivityData (url: string, byAccount: AccountInstance, targetAccount: AccountInstance) {
+function followActivityData (url: string, byAccount: AccountInstance, targetAccount: AccountInstance) {
   const activity: ActivityFollow = {
     type: 'Follow',
     id: url,