2023-10-22 22:20:53 +00:00
|
|
|
<?php
|
|
|
|
namespace Activitypub\Model;
|
|
|
|
|
|
|
|
use WP_Query;
|
|
|
|
use Activitypub\Signature;
|
|
|
|
use Activitypub\Collection\Users;
|
|
|
|
|
|
|
|
use function Activitypub\get_rest_url_by_path;
|
|
|
|
|
|
|
|
class Application_User extends Blog_User {
|
|
|
|
/**
|
|
|
|
* The User-ID
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
protected $_id = Users::APPLICATION_USER_ID; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
|
|
|
|
2024-03-28 09:39:50 +00:00
|
|
|
public function get_type() {
|
|
|
|
return 'Application';
|
|
|
|
}
|
2023-10-22 22:20:53 +00:00
|
|
|
|
2024-03-28 09:39:50 +00:00
|
|
|
public function get_discoverable() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_manually_approves_followers() {
|
|
|
|
return true;
|
|
|
|
}
|
2023-10-22 22:20:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the User-Url.
|
|
|
|
*
|
|
|
|
* @return string The User-Url.
|
|
|
|
*/
|
|
|
|
public function get_url() {
|
|
|
|
return get_rest_url_by_path( 'application' );
|
|
|
|
}
|
|
|
|
|
2024-02-08 12:31:25 +00:00
|
|
|
/**
|
|
|
|
* Returns the User-URL with @-Prefix for the username.
|
|
|
|
*
|
|
|
|
* @return string The User-URL with @-Prefix for the username.
|
|
|
|
*/
|
|
|
|
public function get_alternate_url() {
|
|
|
|
return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_preferred_username() );
|
|
|
|
}
|
|
|
|
|
2023-10-22 22:20:53 +00:00
|
|
|
public function get_name() {
|
|
|
|
return 'application';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_preferred_username() {
|
2024-03-28 09:39:50 +00:00
|
|
|
return $this->get_name();
|
2023-10-22 22:20:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function get_followers() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_following() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_attachment() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_featured() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_moderators() {
|
|
|
|
return null;
|
|
|
|
}
|
2023-12-08 23:23:11 +00:00
|
|
|
|
|
|
|
public function get_indexable() {
|
|
|
|
return false;
|
|
|
|
}
|
2023-10-22 22:20:53 +00:00
|
|
|
}
|