From 47957c2a6a31030072f68af84b0ce6fa397e9bc4 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 3 Jul 2023 19:52:54 +0200 Subject: [PATCH] fix code --- includes/class-scheduler.php | 2 +- includes/rest/class-outbox.php | 6 +++--- includes/rest/class-users.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/class-scheduler.php b/includes/class-scheduler.php index 7603441..271c4b6 100644 --- a/includes/class-scheduler.php +++ b/includes/class-scheduler.php @@ -4,7 +4,7 @@ namespace Activitypub; use Activitypub\Collection\Users; use Activitypub\Collection\Followers; -use \Activitypub\Transformer\Post; +use Activitypub\Transformer\Post; /** * ActivityPub Scheduler Class diff --git a/includes/rest/class-outbox.php b/includes/rest/class-outbox.php index a8708e5..8485647 100644 --- a/includes/rest/class-outbox.php +++ b/includes/rest/class-outbox.php @@ -5,9 +5,9 @@ use stdClass; use WP_Error; use WP_REST_Server; use WP_REST_Response; -use Activitypub\Collection\Users; use Activitypub\Transformer\Post; use Activitypub\Activity\Activity; +use Activitypub\Collection\Users as User_Collection; use function Activitypub\get_context; use function Activitypub\get_rest_url_by_path; @@ -53,7 +53,7 @@ class Outbox { */ public static function user_outbox_get( $request ) { $user_id = $request->get_param( 'user_id' ); - $user = Users::get_by_various( $user_id ); + $user = User_Collection::get_by_various( $user_id ); if ( is_wp_error( $user ) ) { return $user; @@ -73,7 +73,7 @@ class Outbox { $json->{'@context'} = get_context(); $json->id = \home_url( \add_query_arg( null, null ) ); $json->generator = 'http://wordpress.org/?v=' . \get_bloginfo_rss( 'version' ); - //$json->actor = $user->get_id(); + $json->actor = $user->get_id(); $json->type = 'OrderedCollectionPage'; $json->partOf = get_rest_url_by_path( sprintf( 'users/%d/outbox', $user_id ) ); // phpcs:ignore $json->totalItems = 0; // phpcs:ignore diff --git a/includes/rest/class-users.php b/includes/rest/class-users.php index 2017036..b4f85fe 100644 --- a/includes/rest/class-users.php +++ b/includes/rest/class-users.php @@ -4,7 +4,7 @@ namespace Activitypub\Rest; use WP_Error; use WP_REST_Server; use WP_REST_Response; -use \Activitypub\Activity\Activity; +use Activitypub\Activity\Activity; use Activitypub\Collection\Users as User_Collection; use function Activitypub\is_activitypub_request;