summaryrefslogtreecommitdiff
path: root/app/Subscriber
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-03-29 13:51:51 -0400
committerFrederic Guillot <fred@kanboard.net>2015-03-29 13:51:51 -0400
commit7cbae61dbddefb98f1c5b412d8d72bf5ad883ac9 (patch)
tree52b93d5d6b44746b378e458978ffefb65a5a17a3 /app/Subscriber
parent5536f6c6ce591ba05a169d2e33b6fb240378d8a4 (diff)
Add Hipchat integration
Diffstat (limited to 'app/Subscriber')
-rw-r--r--app/Subscriber/ProjectActivitySubscriber.php34
1 files changed, 26 insertions, 8 deletions
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
+ );
}
}