Remove activity stream functionality from controllers and providers.

- Remove activity stream related code and files
- Update configuration for HtmlSanitizer and RetryGuzzle
- Add `paginate` macro for `Collection`
- Remove unused code for `Codebird`
- Simplify `FrontPageController` and `NotesController` methods
This commit is contained in:
Jonny Barnes 2023-05-12 15:30:05 +01:00
parent e105887e3f
commit 86ac67698e
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
5 changed files with 0 additions and 136 deletions

View file

@ -1,59 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Services;
use App\Models\Note;
use Illuminate\Http\Response;
class ActivityStreamsService
{
/**
* Return the relevant data to an AS2.0 request to the root path.
*/
public function siteOwnerResponse(): Response
{
$data = json_encode([
'@context' => 'https://www.w3.org/ns/activitystreams',
'id' => config('app.url'),
'type' => 'Person',
'name' => config('user.displayname'),
'preferredUsername' => config('user.username'),
]);
return response($data)->header('Content-Type', 'application/activity+json');
}
/**
* Return the relevant data to an AS2.0 request for a particular note.
*/
public function singleNoteResponse(Note $note): Response
{
$data = json_encode([
'@context' => 'https://www.w3.org/ns/activitystreams',
'summary' => strtok(config('user.displayname'), ' ') . ' added a note to their microblog',
'type' => 'Add',
'published' => $note->updated_at->toW3cString(),
'actor' => [
'type' => 'Person',
'id' => config('app.url'),
'name' => config('app.display_name'),
'url' => config('app.url'),
'image' => [
'type' => 'Link',
'href' => config('app.url') . '/assets/img/profile.jpg',
'mediaType' => '/image/jpeg',
],
],
'object' => [
'id' => $note->longurl,
'type' => 'Note',
'url' => $note->longurl,
'name' => strip_tags($note->note),
],
]);
return response($data)->header('Content-Type', 'application/activity+json');
}
}