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