. * * @category Plugin * @package GNUsocial * @author Daniel Supernault * @copyright 2015 Free Software Foundaction, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link https://gnu.io/social */ if (!defined('GNUSOCIAL')) { exit(1); } class ActivityPubActorAction extends ManagedAction { protected $needLogin = false; protected $canPost = true; protected function handle() { $user = User::getByID($this->trimmed('id')); $profile = $user->getProfile(); $res = [ '@context' => ["https://www.w3.org/ns/activitystreams"], 'id' => $profile->profileurl, 'type' => 'Person', 'following' => null, 'followers' => null, 'inbox' => null, 'outbox' => null, 'liked' => null, 'featured' => null, 'preferredUsername' => $user->nickname, 'name' => $user->nickname, 'summary' => $profile->bio, 'url' => $profile->profileurl ]; header('Content-Type: application/json'); echo json_encode($res, JSON_PRETTY_PRINT); } }