diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-30 14:15:17 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-30 14:15:17 +0100 |
commit | fef2c7164e025b12a64185dbab058ef4129733c6 (patch) | |
tree | c9199f611af4334971dfffc71ea6920870a639c1 /server | |
parent | f00984c0077e9b666fe8005452768e53d1c3f421 (diff) | |
download | PeerTube-fef2c7164e025b12a64185dbab058ef4129733c6.tar.gz PeerTube-fef2c7164e025b12a64185dbab058ef4129733c6.tar.zst PeerTube-fef2c7164e025b12a64185dbab058ef4129733c6.zip |
Fix bad to/cc when undo dislike
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/activitypub/inbox.ts | 2 | ||||
-rw-r--r-- | server/lib/activitypub/send/send-undo.ts | 4 | ||||
-rw-r--r-- | server/middlewares/validators/activitypub/activity.ts | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index 92bd20ddb..88a0834f6 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts | |||
@@ -44,7 +44,7 @@ async function inboxController (req: express.Request, res: express.Response, nex | |||
44 | } | 44 | } |
45 | 45 | ||
46 | // Only keep activities we are able to process | 46 | // Only keep activities we are able to process |
47 | logger.debug('Filtering activities...', { activities }) | 47 | logger.debug('Filtering %d activities...', activities.length) |
48 | activities = activities.filter(a => isActivityValid(a)) | 48 | activities = activities.filter(a => isActivityValid(a)) |
49 | logger.debug('We keep %d activities.', activities.length, { activities }) | 49 | logger.debug('We keep %d activities.', activities.length, { activities }) |
50 | 50 | ||
diff --git a/server/lib/activitypub/send/send-undo.ts b/server/lib/activitypub/send/send-undo.ts index 2f5e6998e..015f02b35 100644 --- a/server/lib/activitypub/send/send-undo.ts +++ b/server/lib/activitypub/send/send-undo.ts | |||
@@ -67,9 +67,9 @@ async function sendUndoDislikeToOrigin (byAccount: AccountInstance, video: Video | |||
67 | const accountsInvolvedInVideo = await getAccountsInvolvedInVideo(video, t) | 67 | const accountsInvolvedInVideo = await getAccountsInvolvedInVideo(video, t) |
68 | const audience = getOriginVideoAudience(video, accountsInvolvedInVideo) | 68 | const audience = getOriginVideoAudience(video, accountsInvolvedInVideo) |
69 | const dislikeActivity = createDislikeActivityData(byAccount, video) | 69 | const dislikeActivity = createDislikeActivityData(byAccount, video) |
70 | const object = await createActivityData(undoUrl, byAccount, dislikeActivity, t, audience) | 70 | const object = await createActivityData(undoUrl, byAccount, dislikeActivity, t) |
71 | 71 | ||
72 | const data = await undoActivityData(undoUrl, byAccount, object, t) | 72 | const data = await undoActivityData(undoUrl, byAccount, object, t, audience) |
73 | 73 | ||
74 | return unicastTo(data, byAccount, video.VideoChannel.Account.sharedInboxUrl, t) | 74 | return unicastTo(data, byAccount, video.VideoChannel.Account.sharedInboxUrl, t) |
75 | } | 75 | } |
diff --git a/server/middlewares/validators/activitypub/activity.ts b/server/middlewares/validators/activitypub/activity.ts index 8aa82298c..c63be5979 100644 --- a/server/middlewares/validators/activitypub/activity.ts +++ b/server/middlewares/validators/activitypub/activity.ts | |||
@@ -7,7 +7,7 @@ const activityPubValidator = [ | |||
7 | body('').custom((value, { req }) => isRootActivityValid(req.body)), | 7 | body('').custom((value, { req }) => isRootActivityValid(req.body)), |
8 | 8 | ||
9 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 9 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
10 | logger.debug('Checking activity pub parameters', { parameters: req.body }) | 10 | logger.debug('Checking activity pub parameters') |
11 | 11 | ||
12 | if (areValidationErrors(req, res)) return | 12 | if (areValidationErrors(req, res)) return |
13 | 13 | ||