Merge pull request #2318 from CachetHQ/silent-component-changes

Component notifications can be silenced
This commit is contained in:
James Brooks
2017-02-06 19:02:37 +00:00
committed by GitHub
8 changed files with 44 additions and 9 deletions
@@ -50,7 +50,7 @@ class UpdateComponentCommandHandler
$component = $command->component;
$originalStatus = $component->status;
event(new ComponentStatusWasUpdatedEvent($this->auth->user(), $component, $originalStatus, $command->status));
event(new ComponentStatusWasUpdatedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
$component->update($this->filter($command));
@@ -111,7 +111,8 @@ class ReportIncidentCommandHandler
null,
null,
null,
null
null,
false
));
}
@@ -48,6 +48,11 @@ class SendComponentUpdateEmailNotificationHandler
{
$component = $event->component;
// If we're silent, then don't send this.
if ($event->silent) {
return;
}
// Don't email anything if the status hasn't changed.
if ($event->original_status === $event->new_status) {
return;