import { Transaction } from 'sequelize'
-import { VideoPrivacy } from '../../../shared/models/videos'
-import { getServerActor } from '../../helpers/utils'
import { VideoShareModel } from '../../models/video/video-share'
import { sendUndoAnnounce, sendVideoAnnounce } from './send'
import { getVideoAnnounceActivityPubUrl } from './url'
import { logger } from '../../helpers/logger'
import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers/constants'
import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
-import { MChannelActor, MChannelActorLight, MVideo, MVideoAccountLight, MVideoId } from '../../typings/models/video'
+import { MChannelActorLight, MVideo, MVideoAccountLight, MVideoId } from '../../typings/models/video'
+import { getServerActor } from '@server/models/application/application'
async function shareVideoByServerAndChannel (video: MVideoAccountLight, t: Transaction) {
- if (video.privacy === VideoPrivacy.PRIVATE) return undefined
+ if (!video.hasPrivacyForFederation()) return undefined
return Promise.all([
shareByServer(video, t),
await Bluebird.map(shareUrls, async shareUrl => {
try {
// Fetch url
- const { body } = await doRequest({
+ const { body } = await doRequest<any>({
uri: shareUrl,
json: true,
activityPub: true