+ if (!signatureActor && [ 'Create', 'Announce', 'Like' ].includes(activity.type) === false) {
+ logger.error('Cannot process activity %s (type: %s) without the actor signature.', activity.id, activity.type)
+ continue
+ }
+
+ const actorUrl = getAPId(activity.actor)
+
+ // When we fetch remote data, we don't have signature
+ if (signatureActor && actorUrl !== signatureActor.url) {
+ logger.warn('Signature mismatch between %s and %s, skipping.', actorUrl, signatureActor.url)
+ continue
+ }
+
+ if (outboxUrl && checkUrlsSameHost(outboxUrl, actorUrl) !== true) {
+ logger.warn('Host mismatch between outbox URL %s and actor URL %s, skipping.', outboxUrl, actorUrl)
+ continue
+ }
+
+ const byActor = signatureActor || actorsCache[actorUrl] || await getOrCreateAPActor(actorUrl)
+ actorsCache[actorUrl] = byActor
+