From e15199f953aeb9c15ef70a259225acd793302760 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Mon, 26 Mar 2018 21:21:13 +0100 Subject: [PATCH] Add incident status to RSS feeds --- app/Http/Controllers/FeedController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/FeedController.php b/app/Http/Controllers/FeedController.php index 1cf96e2b7..efb794d05 100644 --- a/app/Http/Controllers/FeedController.php +++ b/app/Http/Controllers/FeedController.php @@ -17,6 +17,7 @@ use GrahamCampbell\Markdown\Facades\Markdown; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\Config; use Illuminate\Support\Str; +use McCool\LaravelAutoPresenter\Facades\AutoPresenter; /** * This is the feed controller. @@ -106,12 +107,17 @@ class FeedController extends Controller */ private function feedAddItem(Incident $incident, $isRss) { + $incident = AutoPresenter::decorate($incident); + $this->feed->add( $incident->name, Config::get('setting.app_name'), Str::canonicalize(cachet_route('incident', [$incident->id])), - $isRss ? $incident->occurred_at->toRssString() : $incident->occurred_at->toAtomString(), - $isRss ? $incident->message : Markdown::convertToHtml($incident->message) + $isRss ? $incident->getWrappedObject()->occurred_at->toRssString() : $incident->getWrappedObject()->occurred_at->toAtomString(), + $isRss ? $incident->message : Markdown::convertToHtml($incident->message), + null, + [], + $isRss ? $incident->human_status : null ); } }