From 8de87cc5cc2990318717f66f131a655e0ea80096 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 13 Sep 2017 20:43:32 +0930 Subject: [PATCH] Support cluster setting on backend --- extensions/pusher/src/Listener/PushNewPosts.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extensions/pusher/src/Listener/PushNewPosts.php b/extensions/pusher/src/Listener/PushNewPosts.php index fa398bf48..d443b386c 100644 --- a/extensions/pusher/src/Listener/PushNewPosts.php +++ b/extensions/pusher/src/Listener/PushNewPosts.php @@ -78,10 +78,17 @@ class PushNewPosts */ protected function getPusher() { + $options = []; + + if ($cluster = $this->settings->get('flarum-pusher.app_cluster')) { + $options['cluster'] = $cluster; + } + return new Pusher( $this->settings->get('flarum-pusher.app_key'), $this->settings->get('flarum-pusher.app_secret'), - $this->settings->get('flarum-pusher.app_id') + $this->settings->get('flarum-pusher.app_id'), + $options ); } }