updated plugin ActivityPub version 5.8.0

This commit is contained in:
2025-04-29 21:19:06 +00:00
committed by Gitium
parent 19dfd317cc
commit fdfbf76539
166 changed files with 14119 additions and 7163 deletions

View File

@ -8,7 +8,7 @@
namespace Activitypub;
use WP_Error;
use Activitypub\Collection\Users;
use Activitypub\Collection\Actors;
/**
* ActivityPub WebFinger Class.
@ -26,7 +26,7 @@ class Webfinger {
* @return string The user-resource.
*/
public static function get_user_resource( $user_id ) {
$user = Users::get_by_id( $user_id );
$user = Actors::get_by_id( $user_id );
if ( ! $user || is_wp_error( $user ) ) {
return '';
}
@ -62,6 +62,7 @@ class Webfinger {
foreach ( $data['links'] as $link ) {
if (
'self' === $link['rel'] &&
isset( $link['type'] ) &&
(
'application/activity+json' === $link['type'] ||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' === $link['type']
@ -84,6 +85,8 @@ class Webfinger {
/**
* Transform a URI to an acct <identifier>@<host>.
*
* @see https://swicg.github.io/activitypub-webfinger/#reverse-discovery
*
* @param string $uri The URI (acct:, mailto:, http:, https:).
*
* @return string|WP_Error Error or acct URI.