+async function sendCreateViewToVideoFollowers (byAccount: AccountInstance, video: VideoInstance, t: Transaction) {
+ const url = getVideoViewActivityPubUrl(byAccount, video)
+ const viewActivity = createViewActivityData(byAccount, video)
+
+ const audience = { to: [ video.VideoChannel.Account.url + '/followers' ], cc: [] }
+ const data = await createActivityData(url, byAccount, viewActivity, audience)
+
+ const serverAccount = await getServerAccount()
+ const accountsToForwardView = await db.VideoShare.loadAccountsByShare(video.id)
+ accountsToForwardView.push(video.VideoChannel.Account)
+
+ // Don't forward view to server that sent it to us
+ const index = accountsToForwardView.findIndex(a => a.id === byAccount.id)
+ if (index) accountsToForwardView.splice(index, 1)
+
+ const followersException = [ byAccount ]
+ return broadcastToFollowers(data, serverAccount, accountsToForwardView, t, followersException)
+}
+
+async function createActivityData (url: string, byAccount: AccountInstance, object: any, audience?: { to: string[], cc: string[] }) {
+ if (!audience) {
+ audience = await getAudience(byAccount)
+ }