From 9e9410df24b1d88d4760510ab496f5fa36f24a66 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 11 May 2015 21:07:59 -0400 Subject: Add Jabber/XMPP integration --- app/Subscriber/ProjectActivitySubscriber.php | 31 ++++++++-------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'app/Subscriber') 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(); -- cgit v1.2.3