From 7cbae61dbddefb98f1c5b412d8d72bf5ad883ac9 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 29 Mar 2015 13:51:51 -0400 Subject: Add Hipchat integration --- app/Subscriber/ProjectActivitySubscriber.php | 34 +++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'app/Subscriber') diff --git a/app/Subscriber/ProjectActivitySubscriber.php b/app/Subscriber/ProjectActivitySubscriber.php index d2e85166..42314637 100644 --- a/app/Subscriber/ProjectActivitySubscriber.php +++ b/app/Subscriber/ProjectActivitySubscriber.php @@ -42,14 +42,32 @@ class ProjectActivitySubscriber extends Base implements EventSubscriberInterface $values ); - if ($this->config->get('integration_slack_webhook') == 1) { - $this->slackWebhook->notify( - $values['task']['project_id'], - $values['task']['id'], - $event_name, - $values - ); - } + $this->sendSlackNotification($event_name, $values); + $this->sendHipchatNotification($event_name, $values); + } + } + + private function sendSlackNotification($event_name, array $values) + { + if ($this->config->get('integration_slack_webhook') == 1) { + $this->slackWebhook->notify( + $values['task']['project_id'], + $values['task']['id'], + $event_name, + $values + ); + } + } + + private function sendHipchatNotification($event_name, array $values) + { + if ($this->config->get('integration_hipchat') == 1) { + $this->hipchat->notify( + $values['task']['project_id'], + $values['task']['id'], + $event_name, + $values + ); } } -- cgit v1.2.3