| @@ -10,8 +10,9 @@ | ||
| 10 | 10 | use function Activitypub\get_context; |
| 11 | 11 | use function Activitypub\object_to_uri; |
| 12 | 12 | use function Activitypub\url_to_authorid; |
| 13 | 13 | use function Activitypub\get_rest_url_by_path; |
| 14 | +use function Activitypub\get_masked_wp_version; | |
| 14 | 15 | use function Activitypub\extract_recipients_from_activity; |
| 15 | 16 | |
| 16 | 17 | /** |
| 17 | 18 | * ActivityPub Inbox REST-Class |
| @@ -46,9 +47,9 @@ | ||
| 46 | 47 | ); |
| 47 | 48 | |
| 48 | 49 | \register_rest_route( |
| 49 | 50 | ACTIVITYPUB_REST_NAMESPACE, |
| 50 | - '/users/(?P<user_id>[\w\-\.]+)/inbox', | |
| 51 | + '/(users|actors)/(?P<user_id>[\w\-\.]+)/inbox', | |
| 51 | 52 | array( |
| 52 | 53 | array( |
| 53 | 54 | 'methods' => WP_REST_Server::CREATABLE, |
| 54 | 55 | 'callback' => array( self::class, 'user_inbox_post' ), |
| @@ -88,12 +89,12 @@ | ||
| 88 | 89 | |
| 89 | 90 | $json = new \stdClass(); |
| 90 | 91 | |
| 91 | 92 | $json->{'@context'} = get_context(); |
| 92 | - $json->id = get_rest_url_by_path( sprintf( 'users/%d/inbox', $user->get__id() ) ); | |
| 93 | - $json->generator = 'http://wordpress.org/?v=' . \get_bloginfo_rss( 'version' ); | |
| 93 | + $json->id = get_rest_url_by_path( sprintf( 'actors/%d/inbox', $user->get__id() ) ); | |
| 94 | + $json->generator = 'http://wordpress.org/?v=' . get_masked_wp_version(); | |
| 94 | 95 | $json->type = 'OrderedCollectionPage'; |
| 95 | - $json->partOf = get_rest_url_by_path( sprintf( 'users/%d/inbox', $user->get__id() ) ); // phpcs:ignore | |
| 96 | + $json->partOf = get_rest_url_by_path( sprintf( 'actors/%d/inbox', $user->get__id() ) ); // phpcs:ignore | |
| 96 | 97 | $json->totalItems = 0; // phpcs:ignore |
| 97 | 98 | $json->orderedItems = array(); // phpcs:ignore |
| 98 | 99 | $json->first = $json->partOf; // phpcs:ignore |
| 99 | 100 | |