Send Brrr push notifications for new webmentions
Dispatches a queued job to POST to a configured Brrr webhook whenever a brand-new webmention is saved, so replies/likes/reposts show up as push notifications instead of requiring a manual check of the site.
This commit is contained in:
parent
31c49ac3fc
commit
f9f2744fad
6 changed files with 138 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
namespace Tests\Unit\Jobs;
|
||||
|
||||
use App\Exceptions\RemoteContentNotFoundException;
|
||||
use App\Jobs\NotifyBrrrOfWebMention;
|
||||
use App\Jobs\ProcessWebMention;
|
||||
use App\Jobs\SaveProfileImage;
|
||||
use App\Models\Note;
|
||||
|
|
@ -71,6 +72,7 @@ class ProcessWebMentionJobTest extends TestCase
|
|||
$job->handle($parser);
|
||||
|
||||
Queue::assertPushed(SaveProfileImage::class);
|
||||
Queue::assertPushed(NotifyBrrrOfWebMention::class);
|
||||
$this->assertDatabaseHas('webmentions', [
|
||||
'source' => $source,
|
||||
'type' => 'like-of',
|
||||
|
|
@ -104,6 +106,7 @@ class ProcessWebMentionJobTest extends TestCase
|
|||
$job->handle($parser);
|
||||
|
||||
Queue::assertPushed(SaveProfileImage::class);
|
||||
Queue::assertNotPushed(NotifyBrrrOfWebMention::class);
|
||||
$this->assertDatabaseHas('webmentions', [
|
||||
'source' => $source,
|
||||
'type' => 'in-reply-to',
|
||||
|
|
@ -206,6 +209,7 @@ class ProcessWebMentionJobTest extends TestCase
|
|||
$job = new ProcessWebMention($note, $source);
|
||||
$job->handle($parser);
|
||||
|
||||
Queue::assertPushed(NotifyBrrrOfWebMention::class);
|
||||
$this->assertGreaterThan(255, strlen($source));
|
||||
$this->assertDatabaseHas('webmentions', [
|
||||
'source' => $source,
|
||||
|
|
|
|||
Loading…
Reference in a new issue