a little bug fix

This commit is contained in:
Ghostie 2025-01-05 22:38:35 -05:00
parent 6b9ec6531c
commit f684d9c68c
6 changed files with 249 additions and 2 deletions

View File

@ -13,7 +13,7 @@
- [ ] Handle Rejection
- [x] Likes
- [x] Comments
- [ ] Boosts
- [x] Boosts
- [x] Tags
- [ ] Pinned Posts
@ -52,3 +52,4 @@
- [ ] Fixes
- [x] Fix that weird json encoding in the object field of an activity
- [ ] The profile attachments are not working, they are not being federalised somehow (the interests thingy)
- [ ] Endpoints for getting notes (/ap/v1/note/{note})

View File

@ -109,6 +109,7 @@ class TypeNote
$note->attributedTo = $request["attributedTo"] ?? null;
$note->content = $request["content"] ?? null;
$note->tag = $request["tag"] ?? null;
$note->created_at = $request["published"] ?? null;
$attachments = $note->attachments ()->get ();
foreach ($attachments as $attachment)

View File

@ -7,6 +7,7 @@
"license": "MIT",
"require": {
"php": "^8.2",
"doctrine/dbal": "^4.2",
"guzzlehttp/guzzle": "^7.9",
"intervention/image": "^3.10",
"laravel/framework": "^11.31",

204
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6a6018401a3aeb6bad801ca5ed105225",
"content-hash": "86986bb5e6245e2f122938332d651d64",
"packages": [
{
"name": "brick/math",
@ -210,6 +210,159 @@
},
"time": "2024-07-08T12:26:09+00:00"
},
{
"name": "doctrine/dbal",
"version": "4.2.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "dadd35300837a3a2184bd47d403333b15d0a9bd0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/dadd35300837a3a2184bd47d403333b15d0a9bd0",
"reference": "dadd35300837a3a2184bd47d403333b15d0a9bd0",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^0.5.3|^1",
"php": "^8.1",
"psr/cache": "^1|^2|^3",
"psr/log": "^1|^2|^3"
},
"require-dev": {
"doctrine/coding-standard": "12.0.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2023.2",
"phpstan/phpstan": "1.12.6",
"phpstan/phpstan-phpunit": "1.4.0",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "10.5.30",
"psalm/plugin-phpunit": "0.19.0",
"slevomat/coding-standard": "8.13.1",
"squizlabs/php_codesniffer": "3.10.2",
"symfony/cache": "^6.3.8|^7.0",
"symfony/console": "^5.4|^6.3|^7.0",
"vimeo/psalm": "5.25.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\DBAL\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.",
"homepage": "https://www.doctrine-project.org/projects/dbal.html",
"keywords": [
"abstraction",
"database",
"db2",
"dbal",
"mariadb",
"mssql",
"mysql",
"oci8",
"oracle",
"pdo",
"pgsql",
"postgresql",
"queryobject",
"sasql",
"sql",
"sqlite",
"sqlserver",
"sqlsrv"
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/4.2.1"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal",
"type": "tidelift"
}
],
"time": "2024-10-10T18:01:27+00:00"
},
{
"name": "doctrine/deprecations",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.4"
},
"time": "2024-12-07T21:18:45+00:00"
},
{
"name": "doctrine/inflector",
"version": "2.0.10",
@ -2877,6 +3030,55 @@
],
"time": "2024-11-21T20:00:02+00:00"
},
{
"name": "psr/cache",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/cache.git",
"reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Cache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for caching libraries",
"keywords": [
"cache",
"psr",
"psr-6"
],
"support": {
"source": "https://github.com/php-fig/cache/tree/3.0.0"
},
"time": "2021-02-03T23:26:27+00:00"
},
{
"name": "psr/clock",
"version": "1.0.0",

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('notes', function (Blueprint $table) {
$table->text ("tag")->nullable ()->change ();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('notes', function (Blueprint $table) {
$table->string ("tag")->nullable ()->change ();
});
}
};

View File

@ -5,7 +5,10 @@ $display_post = null;
if ($post instanceof App\Models\Note)
$display_post = $post;
else if ($post instanceof App\Models\Announcement)
{
$booster = $post->actor ()->first ();
$display_post = $post->note ()->first ();
}
$actor = $display_post->get_actor ()->first ();
@ -44,6 +47,17 @@ else
In response to
<a href="{{ route ('posts.show', [ 'note' => $display_post->get_parent ()->first ()->id ]) }}">this post</a>
</small>
<br>
@endif
@if ($post instanceof App\Models\Announcement)
<small>
<b>
<a href="{{ route ('users.show', [ 'user_name' => $booster->local_actor_id ? $booster->local_actor_id : $booster->name ]) }}">{{ $booster->name }}</a>
Boosted
</b>
</small>
<br>
@endif
<h4>{{ $display_post->summary }}</h4>