[PLUGIN][ActivityPub][Util][Explorer] Simplify fetching Actor by URI

This commit is contained in:
2022-02-25 01:05:28 +00:00
parent 7c80277436
commit f5e92de62d
8 changed files with 110 additions and 138 deletions

View File

@@ -254,7 +254,7 @@ class WebMonetization extends Plugin
public function onActivityPubAddActivityStreamsTwoData(string $type_name, &$type): bool
{
if ($type_name === 'Person') {
$actor = \Plugin\ActivityPub\ActivityPub::getActorByUri($type->getId());
$actor = \Plugin\ActivityPub\Util\Explorer::getOneFromUri($type->getId());
$wallet = DB::findOneBy(Wallet::class, ['actor_id' => $actor->getId()], return_null: true);
if (!\is_null($address = $wallet?->getAddress())) {