From 1d59d57c2eba623ca45377308cb85826b75e67fe Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 30 Nov 2024 15:30:07 +0000 Subject: [PATCH] Fix showing author like on a note --- database/seeders/WebMentionsTableSeeder.php | 9 +++++++++ resources/views/notes/show.blade.php | 2 +- tests/Feature/MicropubMediaTest.php | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/database/seeders/WebMentionsTableSeeder.php b/database/seeders/WebMentionsTableSeeder.php index afd1ffb7..b7118343 100644 --- a/database/seeders/WebMentionsTableSeeder.php +++ b/database/seeders/WebMentionsTableSeeder.php @@ -41,5 +41,14 @@ class WebMentionsTableSeeder extends Seeder 'type' => 'repost-of', 'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"url": ["https://barryfrost.com/reposts/1"], "name": ["Kagi is the best"], "author": [{"type": ["h-card"], "value": "Barry Frost", "properties": {"url": ["https://barryfrost.com/"], "name": ["Barry Frost"], "photo": ["https://barryfrost.com/barryfrost.jpg"]}}], "content": [{"html": "Kagi is the Best", "value": "Kagi is the Best"}], "published": ["' . date(DATE_W3C) . '"], "u-repost-of": ["' . config('app.url') . '/notes/C"]}}]}', ]); + // WebMention like from Bluesky + WebMention::create([ + 'source' => 'https://brid.gy/like/bluesky/did:plc:n3jhgiq2ykctnpgzlm6p6b25/at%253A%252F%252Fdid%253Aplc%253An3jhgiq2ykctnpgzlm6p6b25%252Fapp.bsky.feed.post%252F3lalppbcyuc2w/did%253Aplc%253Aia23nh3t37r2lydmmqsixrps', + 'target' => config('app.url') . '/notes/B', + 'commentable_id' => '11', + 'commentable_type' => 'App\Models\Note', + 'type' => 'like-of', + 'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"uid": ["tag:bsky.app,2013:at://did:plc:n3jhgiq2ykctnpgzlm6p6b25/app.bsky.feed.post/3lalppbcyuc2w_liked_by_did:plc:ia23nh3t37r2lydmmqsixrps"], "url": ["https://bsky.app/profile/jonnybarnes.uk/post/3lalppbcyuc2w#liked_by_did:plc:ia23nh3t37r2lydmmqsixrps"], "name": [""], "author": [{"type": ["h-card"], "value": "bsky.app/profile/little... littledawg13.bsky.social", "properties": {"uid": ["tag:bsky.app,2013:did:plc:ia23nh3t37r2lydmmqsixrps"], "url": ["https://bsky.app/profile/littledawg13.bsky.social", "https://bsky.app/profile/did:plc:ia23nh3t37r2lydmmqsixrps"], "photo": [{"alt": "", "value": "https://cdn.bsky.app/img/avatar/plain/did:plc:ia23nh3t37r2lydmmqsixrps/bafkreifh7ydbyq7qe4maorornocksfnahijxqgx2i5zvvyq6y4i4mydfau@jpeg"}], "nickname": ["littledawg13.bsky.social"]}}], "like-of": ["https://bsky.app/profile/jonnybarnes.uk/post/3lalppbcyuc2w", "http://jonnybarnes.localhost/notes/B"]}}], "rel-urls": []}', + ]); } } diff --git a/resources/views/notes/show.blade.php b/resources/views/notes/show.blade.php index de7aa93b..73de4216 100644 --- a/resources/views/notes/show.blade.php +++ b/resources/views/notes/show.blade.php @@ -33,7 +33,7 @@ return ($webmention->type === 'like-of'); }) as $like) - + @endforeach diff --git a/tests/Feature/MicropubMediaTest.php b/tests/Feature/MicropubMediaTest.php index abdb2619..527116cf 100644 --- a/tests/Feature/MicropubMediaTest.php +++ b/tests/Feature/MicropubMediaTest.php @@ -261,7 +261,6 @@ class MicropubMediaTest extends TestCase ); $path = parse_url($response->headers->get('Location'), PHP_URL_PATH); - dump($path); $filename = Str::chopStart($path, '/storage/'); Queue::assertPushed(ProcessMedia::class); Storage::disk('local')->assertExists($filename);