forked from GNUsocial/gnu-social
[PLUGINS[WebMonetization] Basic activityPub support
This commit is contained in:
parent
148dd6db50
commit
06d11d8337
@ -239,4 +239,17 @@ class WebMonetization extends Plugin
|
|||||||
}
|
}
|
||||||
return Event::next;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user