From 75ba887d10eacb9cd1392e62f68617c7643c9add Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 Jan 2020 15:17:42 +0100 Subject: Don't log error on actor delete signature error --- server/controllers/activitypub/client.ts | 12 ++++++------ server/controllers/activitypub/inbox.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'server/controllers/activitypub') diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index 62412cd62..95c2a26a6 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts @@ -14,7 +14,7 @@ import { videosCustomGetValidator, videosShareValidator } from '../../middlewares' -import { getAccountVideoRateValidator, videoCommentGetValidator } from '../../middlewares/validators' +import { getAccountVideoRateValidatorFactory, videoCommentGetValidator } from '../../middlewares/validators' import { AccountModel } from '../../models/account/account' import { ActorFollowModel } from '../../models/activitypub/actor-follow' import { VideoModel } from '../../models/video/video' @@ -63,13 +63,13 @@ activityPubClientRouter.get('/accounts?/:name/playlists', ) activityPubClientRouter.get('/accounts?/:name/likes/:videoId', executeIfActivityPub, - asyncMiddleware(getAccountVideoRateValidator('like')), - getAccountVideoRate('like') + asyncMiddleware(getAccountVideoRateValidatorFactory('like')), + getAccountVideoRateFactory('like') ) activityPubClientRouter.get('/accounts?/:name/dislikes/:videoId', executeIfActivityPub, - asyncMiddleware(getAccountVideoRateValidator('dislike')), - getAccountVideoRate('dislike') + asyncMiddleware(getAccountVideoRateValidatorFactory('dislike')), + getAccountVideoRateFactory('dislike') ) activityPubClientRouter.get('/videos/watch/:id', @@ -192,7 +192,7 @@ async function accountPlaylistsController (req: express.Request, res: express.Re return activityPubResponse(activityPubContextify(activityPubResult), res) } -function getAccountVideoRate (rateType: VideoRateType) { +function getAccountVideoRateFactory (rateType: VideoRateType) { return (req: express.Request, res: express.Response) => { const accountVideoRate = res.locals.accountVideoRate diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index ca42106b8..4fb180003 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts @@ -50,7 +50,7 @@ const inboxQueue = queue((task, cb) => { function inboxController (req: express.Request, res: express.Response) { const rootActivity: RootActivity = req.body - let activities: Activity[] = [] + let activities: Activity[] if ([ 'Collection', 'CollectionPage' ].indexOf(rootActivity.type) !== -1) { activities = (rootActivity as ActivityPubCollection).items -- cgit v1.2.3