diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-05-11 21:07:59 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-05-11 21:07:59 -0400 |
commit | 9e9410df24b1d88d4760510ab496f5fa36f24a66 (patch) | |
tree | 99ec17ed40c52618a2bbb90d72e6da272eacb38b /app/Subscriber | |
parent | a845e3f47891eca6cdfd8082cdfddbbef0eeecd1 (diff) |
Add Jabber/XMPP integration
Diffstat (limited to 'app/Subscriber')
-rw-r--r-- | app/Subscriber/ProjectActivitySubscriber.php | 31 |
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(); |