summaryrefslogtreecommitdiff
path: root/app/Subscriber/ProjectActivitySubscriber.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Subscriber/ProjectActivitySubscriber.php')
-rw-r--r--app/Subscriber/ProjectActivitySubscriber.php31
1 files changed, 9 insertions, 22 deletions
diff --git a/app/Subscriber/ProjectActivitySubscriber.php b/app/Subscriber/ProjectActivitySubscriber.php
index 1c20a996..8988d6c1 100644
--- a/app/Subscriber/ProjectActivitySubscriber.php
+++ b/app/Subscriber/ProjectActivitySubscriber.php
@@ -42,31 +42,18 @@ class ProjectActivitySubscriber extends Base implements EventSubscriberInterface
$values
);
- $this->sendSlackNotification($event_name, $values);
- $this->sendHipchatNotification($event_name, $values);
+ // Send notifications to third-party services
+ foreach (array('slackWebhook', 'hipchatWebhook', 'jabber') as $model) {
+ $this->$model->notify(
+ $values['task']['project_id'],
+ $values['task']['id'],
+ $event_name,
+ $values
+ );
+ }
}
}
- private function sendSlackNotification($event_name, array $values)
- {
- $this->slackWebhook->notify(
- $values['task']['project_id'],
- $values['task']['id'],
- $event_name,
- $values
- );
- }
-
- private function sendHipchatNotification($event_name, array $values)
- {
- $this->hipchatWebhook->notify(
- $values['task']['project_id'],
- $values['task']['id'],
- $event_name,
- $values
- );
- }
-
private function getValues(GenericEvent $event)
{
$values = array();