import {
MActorLight,
MCommentOwnerVideo,
+ MLocalVideoViewerWithWatchSections,
MVideoAccountLight,
MVideoAP,
MVideoPlaylistFull,
getActorsInvolvedInVideo,
getAudienceFromFollowersOf,
getVideoCommentAudience,
+ sendVideoActivityToOrigin,
sendVideoRelatedActivity,
unicastTo
} from './shared'
})
}
+async function sendCreateWatchAction (stats: MLocalVideoViewerWithWatchSections, transaction: Transaction) {
+ logger.info('Creating job to send create watch action %s.', stats.url, lTags(stats.uuid))
+
+ const byActor = await getServerActor()
+
+ const activityBuilder = (audience: ActivityAudience) => {
+ return buildCreateActivity(stats.url, byActor, stats.toActivityPubObject(), audience)
+ }
+
+ return sendVideoActivityToOrigin(activityBuilder, { byActor, video: stats.Video, transaction, contextType: 'WatchAction' })
+}
+
async function sendCreateVideoPlaylist (playlist: MVideoPlaylistFull, transaction: Transaction) {
if (playlist.privacy === VideoPlaylistPrivacy.PRIVATE) return undefined
buildCreateActivity,
sendCreateVideoComment,
sendCreateVideoPlaylist,
- sendCreateCacheFile
+ sendCreateCacheFile,
+ sendCreateWatchAction
}
// ---------------------------------------------------------------------------