X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Factivitypub%2Finbox.ts;h=38d5c51dfbf91386fb418695ac8eb7d05c838183;hb=74dc3bca2b14f5fd3fe80c394dfc34177a46db77;hp=f0e65015bb9796fa3cc6995460db5e1c6cc79bb4;hpb=5c6d985faeef1d6793d3f44ca6374f1a9b722806;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index f0e65015b..38d5c51df 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts @@ -5,8 +5,6 @@ import { logger } from '../../helpers/logger' import { processActivities } from '../../lib/activitypub/process/process' import { asyncMiddleware, checkSignature, localAccountValidator, localVideoChannelValidator, signatureValidator } from '../../middlewares' import { activityPubValidator } from '../../middlewares/validators/activitypub/activity' -import { VideoChannelModel } from '../../models/video/video-channel' -import { AccountModel } from '../../models/account/account' import { queue } from 'async' import { ActorModel } from '../../models/activitypub/actor' @@ -66,12 +64,7 @@ function inboxController (req: express.Request, res: express.Response) { activities = activities.filter(a => isActivityValid(a)) logger.debug('We keep %d activities.', activities.length, { activities }) - let accountOrChannel: VideoChannelModel | AccountModel - if (res.locals.account) { - accountOrChannel = res.locals.account - } else if (res.locals.videoChannel) { - accountOrChannel = res.locals.videoChannel - } + const accountOrChannel = res.locals.account || res.locals.videoChannel logger.info('Receiving inbox requests for %d activities by %s.', activities.length, res.locals.signature.actor.url)