import { Transaction } from 'sequelize'
+import { getServerActor } from '@server/models/application/application'
+import { ContextType } from '@shared/models/activitypub/context'
import { Activity, ActivityAudience } from '../../../../shared/models/activitypub'
+import { afterCommitIfTransaction } from '../../../helpers/database-utils'
import { logger } from '../../../helpers/logger'
-import { ActorModel } from '../../../models/activitypub/actor'
-import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
+import { ActorModel } from '../../../models/actor/actor'
+import { ActorFollowModel } from '../../../models/actor/actor-follow'
+import { MActor, MActorId, MActorLight, MActorWithInboxes, MVideoAccountLight, MVideoId, MVideoImmutable } from '../../../types/models'
import { JobQueue } from '../../job-queue'
import { getActorsInvolvedInVideo, getAudienceFromFollowersOf, getRemoteVideoAudience } from '../audience'
-import { getServerActor } from '../../../helpers/utils'
-import { afterCommitIfTransaction } from '../../../helpers/database-utils'
-import { MActor, MActorId, MActorLight, MActorWithInboxes, MVideoAccountLight, MVideoId, MVideoImmutable } from '../../../typings/models'
-import { ContextType } from '@server/helpers/activitypub'
async function sendVideoRelatedActivity (activityBuilder: (audience: ActivityAudience) => Activity, options: {
byActor: MActorLight
async function forwardVideoRelatedActivity (
activity: Activity,
t: Transaction,
- followersException: MActorWithInboxes[] = [],
+ followersException: MActorWithInboxes[],
video: MVideoId
) {
// Mastodon does not add our announces in audience, so we forward to them manually
const result = await ActorFollowModel.listAcceptedFollowerSharedInboxUrls(toActorFollowerIds, t)
const sharedInboxesException = await buildSharedInboxesException(actorsException)
- return result.data.filter(sharedInbox => sharedInboxesException.indexOf(sharedInbox) === -1)
+ return result.data.filter(sharedInbox => sharedInboxesException.includes(sharedInbox) === false)
}
async function computeUris (toActors: MActor[], actorsException: MActorWithInboxes[] = []) {
const sharedInboxesException = await buildSharedInboxesException(actorsException)
return Array.from(toActorSharedInboxesSet)
- .filter(sharedInbox => sharedInboxesException.indexOf(sharedInbox) === -1)
+ .filter(sharedInbox => sharedInboxesException.includes(sharedInbox) === false)
}
async function buildSharedInboxesException (actorsException: MActorWithInboxes[]) {