Skip to content

Commit

Permalink
Merge pull request #2965 from CachetHQ/rss-category
Browse files Browse the repository at this point in the history
Add incident status to RSS feeds
  • Loading branch information
jbrooksuk committed Mar 27, 2018
2 parents 20b83f2 + e15199f commit e05c6f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/Http/Controllers/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Str;
use McCool\LaravelAutoPresenter\Facades\AutoPresenter;

/**
* This is the feed controller.
Expand Down Expand Up @@ -106,12 +107,17 @@ private function feedAction(ComponentGroup &$group, $isRss)
*/
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
);
}
}

0 comments on commit e05c6f9

Please sign in to comment.