34 lines
853 B
PHP
34 lines
853 B
PHP
<?php
|
|
|
|
namespace Activitypub;
|
|
|
|
use Activitypub\Collection\Followers;
|
|
use Activitypub\Collection\Users;
|
|
|
|
use function Activitypub\is_user_disabled;
|
|
|
|
/**
|
|
* ActivityPub Application Class
|
|
*
|
|
* @author Django Doucet
|
|
*/
|
|
class Application {
|
|
|
|
public static function known_inboxes() {
|
|
$authors = get_users(
|
|
array(
|
|
'capability' => 'publish_posts',
|
|
)
|
|
);
|
|
$follower_inboxes_all = [];
|
|
foreach ( $authors as $user ) {
|
|
$follower_inboxes = Followers::get_inboxes( $user->ID );
|
|
$follower_inboxes_all = array_merge( $follower_inboxes, $follower_inboxes_all );
|
|
}
|
|
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 );
|
|
}
|
|
return array_unique( array_filter( $follower_inboxes_all ) );
|
|
}
|
|
}
|