Fixes to cluster setting

- Use the cluster setting when connecting to Pusher from the server-side
- Remove incorrect default value for the setting as it is serialized
This commit is contained in:
Toby Zerner 2016-03-11 12:34:50 +10:30
parent 159847fec0
commit a51f94deda
2 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,8 @@ class AuthController implements ControllerInterface
$pusher = 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'),
['cluster' => $this->settings->get('flarum-pusher.app_cluster')]
);
$payload = json_decode($pusher->socket_auth($userChannel, array_get($body, 'socket_id')), true);

View File

@ -49,7 +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');
$event->attributes['pusherCluster'] = $this->settings->get('flarum-pusher.app_cluster');
}
}