small improvements

This commit is contained in:
Matthias Pfefferle 2023-05-24 17:27:46 +02:00
parent 09518ea66b
commit 03f2c24892
6 changed files with 10 additions and 6 deletions

View file

@ -39,7 +39,7 @@ function init() {
Collection\Followers::init(); Collection\Followers::init();
// Configure the REST API route // Configure the REST API route
Rest\User::init(); Rest\Users::init();
Rest\Outbox::init(); Rest\Outbox::init();
Rest\Inbox::init(); Rest\Inbox::init();
Rest\Followers::init(); Rest\Followers::init();

View file

@ -97,6 +97,7 @@ class Activitypub {
return $template; return $template;
} }
} }
return $json_template; return $json_template;
} }

View file

@ -88,4 +88,8 @@ class Blog_User extends User {
return \gmdate( 'Y-m-d\TH:i:s\Z', $time ); return \gmdate( 'Y-m-d\TH:i:s\Z', $time );
} }
public function get_public_key() {
return '';
}
} }

View file

@ -3,6 +3,7 @@ namespace Activitypub\Model;
use WP_Query; use WP_Query;
use WP_Error; use WP_Error;
use Activitypub\Signature;
use Activitypub\Model\User; use Activitypub\Model\User;
use Activitypub\User_Factory; use Activitypub\User_Factory;
@ -121,8 +122,7 @@ class User {
} }
public function get_public_key() { public function get_public_key() {
//return Signature::get_public_key( $this->user_id ); return Signature::get_public_key( $this->user_id );
return null;
} }
/** /**

View file

@ -13,7 +13,7 @@ use Activitypub\User_Factory;
* *
* @see https://www.w3.org/TR/activitypub/#followers * @see https://www.w3.org/TR/activitypub/#followers
*/ */
class User { class Users {
/** /**
* Initialize the class, registering WordPress hooks * Initialize the class, registering WordPress hooks
*/ */

View file

@ -47,7 +47,6 @@ class Webfinger {
*/ */
public static function webfinger( $request ) { public static function webfinger( $request ) {
$resource = $request->get_param( 'resource' ); $resource = $request->get_param( 'resource' );
$user = User_Factory::get_by_resource( $resource ); $user = User_Factory::get_by_resource( $resource );
if ( is_wp_error( $user ) ) { if ( is_wp_error( $user ) ) {