diff --git a/extensions/pusher/js/admin/dist/extension.js b/extensions/pusher/js/admin/dist/extension.js
index e9b4393e3..30f6a86fb 100644
--- a/extensions/pusher/js/admin/dist/extension.js
+++ b/extensions/pusher/js/admin/dist/extension.js
@@ -55,6 +55,15 @@ System.register('flarum/pusher/components/PusherSettingsModal', ['flarum/compone
app.translator.trans('flarum-pusher.admin.pusher_settings.app_secret_label')
),
m('input', { className: 'FormControl', bidi: this.setting('flarum-pusher.app_secret') })
+ ), m(
+ 'div',
+ { className: 'Form-group' },
+ m(
+ 'label',
+ null,
+ app.translator.trans('flarum-pusher.admin.pusher_settings.app_cluster_label')
+ ),
+ m('input', { className: 'FormControl', bidi: this.setting('flarum-pusher.app_cluster') })
)];
}
}]);
diff --git a/extensions/pusher/js/admin/src/components/PusherSettingsModal.js b/extensions/pusher/js/admin/src/components/PusherSettingsModal.js
index 9dbf2421e..5d4a1a04d 100644
--- a/extensions/pusher/js/admin/src/components/PusherSettingsModal.js
+++ b/extensions/pusher/js/admin/src/components/PusherSettingsModal.js
@@ -24,6 +24,11 @@ export default class PusherSettingsModal extends SettingsModal {
+
,
+
+
+
+
];
}
diff --git a/extensions/pusher/js/forum/dist/extension.js b/extensions/pusher/js/forum/dist/extension.js
index d27870bcd..c47b6d2c8 100644
--- a/extensions/pusher/js/forum/dist/extension.js
+++ b/extensions/pusher/js/forum/dist/extension.js
@@ -26,6 +26,7 @@ System.register('flarum/pusher/main', ['flarum/extend', 'flarum/app', 'flarum/co
$.getScript('//js.pusher.com/3.0/pusher.min.js', function () {
var socket = new Pusher(app.forum.attribute('pusherKey'), {
authEndpoint: app.forum.attribute('apiUrl') + '/pusher/auth',
+ cluster: app.forum.attribute('pusherCluster'),
auth: {
headers: {
'X-CSRF-Token': app.session.csrfToken
diff --git a/extensions/pusher/js/forum/src/main.js b/extensions/pusher/js/forum/src/main.js
index f6d9a92e4..837f14836 100644
--- a/extensions/pusher/js/forum/src/main.js
+++ b/extensions/pusher/js/forum/src/main.js
@@ -13,6 +13,7 @@ app.initializers.add('flarum-pusher', () => {
$.getScript('//js.pusher.com/3.0/pusher.min.js', () => {
const socket = new Pusher(app.forum.attribute('pusherKey'), {
authEndpoint: app.forum.attribute('apiUrl') + '/pusher/auth',
+ cluster: app.forum.attribute('pusherCluster'),
auth: {
headers: {
'X-CSRF-Token': app.session.csrfToken
diff --git a/extensions/pusher/src/Listener/AddPusherApi.php b/extensions/pusher/src/Listener/AddPusherApi.php
index 0106b0f94..9d9f93245 100755
--- a/extensions/pusher/src/Listener/AddPusherApi.php
+++ b/extensions/pusher/src/Listener/AddPusherApi.php
@@ -49,6 +49,7 @@ class AddPusherApi
{
if ($event->isSerializer(ForumSerializer::class)) {
$event->attributes['pusherKey'] = $this->settings->get('flarum-pusher.app_key');
+ $event->attributes['pusherCluster'] = $this->settings->get('flarum-pusher.app_cluster', 'us');
}
}