diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-22 18:40:33 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-22 18:40:56 +0100 |
commit | 6be84cbcea99518e8eca58c76259effd0dd992fd (patch) | |
tree | c2b4b22c8b60528025b172013d72c12f8ba06192 /server/lib/activitypub/process/process.ts | |
parent | 9e841674da612b68bf84a427a8710a44347083f5 (diff) | |
download | PeerTube-6be84cbcea99518e8eca58c76259effd0dd992fd.tar.gz PeerTube-6be84cbcea99518e8eca58c76259effd0dd992fd.tar.zst PeerTube-6be84cbcea99518e8eca58c76259effd0dd992fd.zip |
Improve activity pub actors implementation
Diffstat (limited to 'server/lib/activitypub/process/process.ts')
-rw-r--r-- | server/lib/activitypub/process/process.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/lib/activitypub/process/process.ts b/server/lib/activitypub/process/process.ts index 094219489..10d8ba189 100644 --- a/server/lib/activitypub/process/process.ts +++ b/server/lib/activitypub/process/process.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { Activity, ActivityType } from '../../../../shared/models/activitypub' | 1 | import { Activity, ActivityType } from '../../../../shared/models/activitypub' |
2 | import { getActorUrl } from '../../../helpers/activitypub' | ||
2 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
3 | import { ActorModel } from '../../../models/activitypub/actor' | 4 | import { ActorModel } from '../../../models/activitypub/actor' |
4 | import { processAcceptActivity } from './process-accept' | 5 | import { processAcceptActivity } from './process-accept' |
@@ -25,9 +26,11 @@ const processActivity: { [ P in ActivityType ]: (activity: Activity, inboxActor? | |||
25 | 26 | ||
26 | async function processActivities (activities: Activity[], signatureActor?: ActorModel, inboxActor?: ActorModel) { | 27 | async function processActivities (activities: Activity[], signatureActor?: ActorModel, inboxActor?: ActorModel) { |
27 | for (const activity of activities) { | 28 | for (const activity of activities) { |
29 | const actorUrl = getActorUrl(activity.actor) | ||
30 | |||
28 | // When we fetch remote data, we don't have signature | 31 | // When we fetch remote data, we don't have signature |
29 | if (signatureActor && activity.actor !== signatureActor.url) { | 32 | if (signatureActor && actorUrl !== signatureActor.url) { |
30 | logger.warn('Signature mismatch between %s and %s.', activity.actor, signatureActor.url) | 33 | logger.warn('Signature mismatch between %s and %s.', actorUrl, signatureActor.url) |
31 | continue | 34 | continue |
32 | } | 35 | } |
33 | 36 | ||