2023-11-08 20:36:03 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Activitypub;
|
|
|
|
|
2023-11-10 16:25:14 +01:00
|
|
|
use Activitypub\Collection\Followers;
|
|
|
|
use Activitypub\Collection\Users;
|
|
|
|
|
|
|
|
use function Activitypub\is_user_disabled;
|
|
|
|
|
2023-11-08 20:36:03 +01:00
|
|
|
/**
|
|
|
|
* ActivityPub Server Class
|
|
|
|
*
|
|
|
|
* @author Django Doucet
|
|
|
|
*/
|
|
|
|
class Server {
|
|
|
|
|
2023-11-11 01:41:56 +01:00
|
|
|
public static function known_inboxes() {
|
2023-11-08 20:58:04 +01:00
|
|
|
$authors = get_users(
|
|
|
|
array(
|
|
|
|
'capability' => 'publish_posts',
|
|
|
|
)
|
|
|
|
);
|
2023-11-08 20:36:03 +01:00
|
|
|
$follower_inboxes_all = [];
|
|
|
|
foreach ( $authors as $user ) {
|
|
|
|
$follower_inboxes = Followers::get_inboxes( $user->ID );
|
|
|
|
$follower_inboxes_all = array_merge( $follower_inboxes, $follower_inboxes_all );
|
|
|
|
}
|
2023-11-10 16:25:14 +01:00
|
|
|
if ( ! is_user_disabled( Users::BLOG_USER_ID ) ) {
|
|
|
|
$follower_inboxes = Followers::get_inboxes( Users::BLOG_USER_ID );
|
|
|
|
$follower_inboxes_all = array_merge( $follower_inboxes, $follower_inboxes_all );
|
|
|
|
}
|
2023-11-08 20:36:03 +01:00
|
|
|
return array_unique( array_filter( $follower_inboxes_all ) );
|
|
|
|
}
|
|
|
|
}
|