X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Factivitypub%2Finbox.ts;h=8b42478ee254a159982fb51640458a18881587b3;hb=053aed43fb255b4ae4324a845534f2f562c3b6cc;hp=3b8fb34a844aaf1ae443d71924e7fe8499c3c488;hpb=338eb9d33af690db716805fd2277bf68f473b58f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index 3b8fb34a8..8b42478ee 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts @@ -6,7 +6,7 @@ import { processActivities } from '../../lib/activitypub/process/process' import { asyncMiddleware, checkSignature, localAccountValidator, localVideoChannelValidator, signatureValidator } from '../../middlewares' import { activityPubValidator } from '../../middlewares/validators/activitypub/activity' import { queue } from 'async' -import { MActorDefault, MActorSignature } from '../../typings/models' +import { MActorDefault, MActorSignature } from '../../types/models' const inboxRouter = express.Router() @@ -56,9 +56,9 @@ function inboxController (req: express.Request, res: express.Response) { const rootActivity: RootActivity = req.body let activities: Activity[] - if ([ 'Collection', 'CollectionPage' ].indexOf(rootActivity.type) !== -1) { + if ([ 'Collection', 'CollectionPage' ].includes(rootActivity.type)) { activities = (rootActivity as ActivityPubCollection).items - } else if ([ 'OrderedCollection', 'OrderedCollectionPage' ].indexOf(rootActivity.type) !== -1) { + } else if ([ 'OrderedCollection', 'OrderedCollectionPage' ].includes(rootActivity.type)) { activities = (rootActivity as ActivityPubOrderedCollection).orderedItems } else { activities = [ rootActivity as Activity ]