+function getOriginVideoAudience (video: VideoInstance, accountsInvolvedInVideo: AccountInstance[]) {
+ return {
+ to: [ video.VideoChannel.Account.url ],
+ cc: accountsInvolvedInVideo.map(a => a.followersUrl)
+ }
+}
+
+function getOriginVideoChannelAudience (videoChannel: VideoChannelInstance, accountsInvolved: AccountInstance[]) {
+ return {
+ to: [ videoChannel.Account.url ],
+ cc: accountsInvolved.map(a => a.followersUrl)
+ }
+}
+
+function getObjectFollowersAudience (accountsInvolvedInObject: AccountInstance[]) {
+ return {
+ to: accountsInvolvedInObject.map(a => a.followersUrl),
+ cc: []
+ }
+}
+
+async function getAccountsInvolvedInVideo (video: VideoInstance, t: Transaction) {
+ const accountsToForwardView = await db.VideoShare.loadAccountsByShare(video.id, t)
+ accountsToForwardView.push(video.VideoChannel.Account)
+
+ return accountsToForwardView
+}
+
+async function getAccountsInvolvedInVideoChannel (videoChannel: VideoChannelInstance, t: Transaction) {
+ const accountsToForwardView = await db.VideoChannelShare.loadAccountsByShare(videoChannel.id, t)
+ accountsToForwardView.push(videoChannel.Account)
+
+ return accountsToForwardView
+}
+
+async function getAudience (accountSender: AccountInstance, t: Transaction, isPublic = true) {
+ const followerInboxUrls = await accountSender.getFollowerSharedInboxUrls(t)