diff --git a/plugins/WebMonetization/WebMonetization.php b/plugins/WebMonetization/WebMonetization.php index 6abff02090..c05f62b5fd 100644 --- a/plugins/WebMonetization/WebMonetization.php +++ b/plugins/WebMonetization/WebMonetization.php @@ -239,4 +239,17 @@ class WebMonetization extends Plugin } return Event::next; } + + public function onActivityPubAddActivityStreamsTwoData(string $type_name, &$type): bool + { + if ($type_name === 'Person') { + $actor = \Plugin\ActivityPub\ActivityPub::getActorByUri($type->getId()); + $wallet = DB::findOneBy(Wallet::class, ['actor_id' => $actor->getId()], return_null: true); + $address = $wallet?->getAddress(); + if ($address) { + $type->set('webmonetizationWallet', $address); + } + } + return Event::next; + } }