Automatically send webmentions, move the sending logic into the job

This commit is contained in:
Jonny Barnes 2016-06-21 15:53:05 +01:00
parent b9d30bf063
commit 995140bb95
3 changed files with 44 additions and 55 deletions

View file

@ -5,6 +5,7 @@ namespace App\Services;
use App\Note;
use App\Place;
use Illuminate\Http\Request;
use App\Jobs\SendWebmentions;
use App\Jobs\SyndicateToTwitter;
use Illuminate\Foundation\Bus\DispatchesJobs;
use App\Http\Controllers\WebMentionsController;
@ -45,10 +46,7 @@ class NoteService
}
}
if ($request->input('webmentions')) {
$wmc = new WebMentionsController();
$wmc->send($note);
}
$this->dispatch(new SendWebmentions($note));
if (//micropub request, syndication sent as array
(is_array($request->input('mp-syndicate-to'))