Allow notes to be syndicated to Mastodon
This commit is contained in:
parent
ffe90b9399
commit
72cb4fd7eb
11 changed files with 200 additions and 5 deletions
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
namespace App\Services;
|
||||
|
||||
use App\Jobs\SendWebMentions;
|
||||
use App\Jobs\SyndicateNoteToMastodon;
|
||||
use App\Jobs\SyndicateNoteToTwitter;
|
||||
use App\Models\Media;
|
||||
use App\Models\Note;
|
||||
|
@ -58,6 +59,10 @@ class NoteService
|
|||
dispatch(new SyndicateNoteToTwitter($note));
|
||||
}
|
||||
|
||||
if (in_array('mastodon', $this->getSyndicationTargets($request), true)) {
|
||||
dispatch(new SyndicateNoteToMastodon($note));
|
||||
}
|
||||
|
||||
return $note;
|
||||
}
|
||||
|
||||
|
@ -212,6 +217,9 @@ class NoteService
|
|||
if ($target && $target->service_name === 'Twitter') {
|
||||
$syndication[] = 'twitter';
|
||||
}
|
||||
if ($target && $target->service_name === 'Mastodon') {
|
||||
$syndication[] = 'mastodon';
|
||||
}
|
||||
}
|
||||
|
||||
return $syndication;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue