Skip to content

Commit

Permalink
Merge branch 'main' into dev/new_features
Browse files Browse the repository at this point in the history
  • Loading branch information
melroy89 committed Nov 8, 2024
2 parents 77b9631 + 944fa5f commit cf72318
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Service/DeliverManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

use App\Entity\Traits\ActivityPubActorTrait;
use App\Message\ActivityPub\Outbox\DeliverMessage;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\MessageBusInterface;

readonly class DeliverManager
{
public function __construct(
private SettingsManager $settingsManager,
private MessageBusInterface $bus,
private LoggerInterface $logger,
) {
}

Expand All @@ -32,6 +34,11 @@ public function deliver(array $inboxes, array $activity): void
continue;
}

if ($this->settingsManager->isLocalUrl($inboxUrl)) {
$this->logger->warning('tried delivering to a local url, {payload}', ['payload' => $activity]);
continue;
}

$this->bus->dispatch(new DeliverMessage($inboxUrl, $activity));
}
}
Expand Down

0 comments on commit cf72318

Please sign in to comment.