updated plugin ActivityPub
version 5.8.0
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user