2021-01-17 08:38:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Models\InstanceActor;
|
|
|
|
use Cache;
|
|
|
|
|
|
|
|
class InstanceActorController extends Controller
|
|
|
|
{
|
|
|
|
public function profile()
|
|
|
|
{
|
|
|
|
$res = Cache::rememberForever(InstanceActor::PROFILE_KEY, function() {
|
|
|
|
$res = (new InstanceActor())->first()->getActor();
|
2021-10-07 06:46:20 +00:00
|
|
|
return json_encode($res, JSON_UNESCAPED_SLASHES);
|
2021-01-17 08:38:01 +00:00
|
|
|
});
|
2022-12-23 14:02:33 +00:00
|
|
|
return response($res)->header('Content-Type', 'application/activity+json');
|
2021-01-17 08:38:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function inbox()
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function outbox()
|
|
|
|
{
|
2022-02-03 00:55:29 +00:00
|
|
|
$res = json_encode([
|
2023-06-26 04:26:04 +00:00
|
|
|
"@context" => [
|
|
|
|
"https://www.w3.org/ns/activitystreams",
|
|
|
|
"https://w3id.org/security/v1",
|
|
|
|
[
|
|
|
|
"manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
|
|
|
|
"toot" => "http://joinmastodon.org/ns#",
|
|
|
|
"featured" => [
|
|
|
|
"@id" => "toot:featured",
|
|
|
|
"@type" => "@id"
|
|
|
|
],
|
|
|
|
"featuredTags" => [
|
|
|
|
"@id" => "toot:featuredTags",
|
|
|
|
"@type" => "@id"
|
|
|
|
],
|
|
|
|
"alsoKnownAs" => [
|
|
|
|
"@id" => "as:alsoKnownAs",
|
|
|
|
"@type" => "@id"
|
|
|
|
],
|
|
|
|
"movedTo" => [
|
|
|
|
"@id" => "as:movedTo",
|
|
|
|
"@type" => "@id"
|
|
|
|
],
|
|
|
|
"schema" => "http://schema.org#",
|
|
|
|
"PropertyValue" => "schema:PropertyValue",
|
|
|
|
"value" => "schema:value",
|
|
|
|
"discoverable" => "toot:discoverable",
|
|
|
|
"Device" => "toot:Device",
|
|
|
|
"Ed25519Signature" => "toot:Ed25519Signature",
|
|
|
|
"Ed25519Key" => "toot:Ed25519Key",
|
|
|
|
"Curve25519Key" => "toot:Curve25519Key",
|
|
|
|
"EncryptedMessage" => "toot:EncryptedMessage",
|
|
|
|
"publicKeyBase64" => "toot:publicKeyBase64",
|
|
|
|
"deviceId" => "toot:deviceId",
|
|
|
|
"claim" => [
|
|
|
|
"@type" => "@id",
|
|
|
|
"@id" => "toot:claim"
|
|
|
|
],
|
|
|
|
"fingerprintKey" => [
|
|
|
|
"@type" => "@id",
|
|
|
|
"@id" => "toot:fingerprintKey"
|
|
|
|
],
|
|
|
|
"identityKey" => [
|
|
|
|
"@type" => "@id",
|
|
|
|
"@id" => "toot:identityKey"
|
|
|
|
],
|
|
|
|
"devices" => [
|
|
|
|
"@type" => "@id",
|
|
|
|
"@id" => "toot:devices"
|
|
|
|
],
|
|
|
|
"messageFranking" => "toot:messageFranking",
|
|
|
|
"messageType" => "toot:messageType",
|
|
|
|
"cipherText" => "toot:cipherText",
|
|
|
|
"suspended" => "toot:suspended"
|
|
|
|
]
|
|
|
|
],
|
2021-01-17 08:38:01 +00:00
|
|
|
'id' => config('app.url') . '/i/actor/outbox',
|
|
|
|
'type' => 'OrderedCollection',
|
|
|
|
'totalItems' => 0,
|
|
|
|
'first' => config('app.url') . '/i/actor/outbox?page=true',
|
|
|
|
'last' => config('app.url') . '/i/actor/outbox?min_id=0page=true'
|
2022-02-03 00:55:29 +00:00
|
|
|
], JSON_UNESCAPED_SLASHES);
|
2022-12-23 14:02:33 +00:00
|
|
|
return response($res)->header('Content-Type', 'application/activity+json');
|
2021-01-17 08:38:01 +00:00
|
|
|
}
|
|
|
|
}
|