-import { AccountModel } from '../../../models/account/account'
-import { VideoModel } from '../../../models/video/video'
-import { getVideoLikeActivityPubUrl } from '../url'
-import {
- broadcastToFollowers,
- getAccountsInvolvedInVideo,
- getAudience,
- getOriginVideoAudience,
- getObjectFollowersAudience,
- unicastTo
-} from './misc'
-
-async function sendLikeToOrigin (byAccount: AccountModel, video: VideoModel, t: Transaction) {
- const url = getVideoLikeActivityPubUrl(byAccount, video)
-
- const accountsInvolvedInVideo = await getAccountsInvolvedInVideo(video, t)
- const audience = getOriginVideoAudience(video, accountsInvolvedInVideo)
- const data = await likeActivityData(url, byAccount, video, t, audience)
-
- return unicastTo(data, byAccount, video.VideoChannel.Account.sharedInboxUrl, t)
-}
-
-async function sendLikeToVideoFollowers (byAccount: AccountModel, video: VideoModel, t: Transaction) {
- const url = getVideoLikeActivityPubUrl(byAccount, video)
+import { getVideoLikeActivityPubUrlByLocalActor } from '../url'
+import { sendVideoRelatedActivity } from './utils'
+import { audiencify, getAudience } from '../audience'
+import { logger } from '../../../helpers/logger'
+import { MActor, MActorAudience, MVideoAccountLight, MVideoUrl } from '../../../types/models'