From 76bc4820a034a47cf73408b04541ad1b0dc9cfd2 Mon Sep 17 00:00:00 2001 From: Alex Renoki Date: Fri, 11 Sep 2020 08:34:21 +0300 Subject: [PATCH] Fixed presence channel broadcasting --- src/Channels/PresenceChannel.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Channels/PresenceChannel.php b/src/Channels/PresenceChannel.php index 75808b9..ae22ecd 100644 --- a/src/Channels/PresenceChannel.php +++ b/src/Channels/PresenceChannel.php @@ -2,6 +2,7 @@ namespace BeyondCode\LaravelWebSockets\Channels; +use BeyondCode\LaravelWebSockets\DashboardLogger; use BeyondCode\LaravelWebSockets\Server\Exceptions\InvalidSignature; use Ratchet\ConnectionInterface; use stdClass; @@ -19,7 +20,9 @@ class PresenceChannel extends PrivateChannel */ public function subscribe(ConnectionInterface $connection, stdClass $payload) { - parent::subscribe($connection, $payload); + $this->verifySignature($connection, $payload); + + $this->saveConnection($connection); $this->channelManager->userJoinedPresenceChannel( $connection, @@ -48,6 +51,11 @@ class PresenceChannel extends PrivateChannel (object) $memberAddedPayload, $connection->socketId, $connection->app->id ); + + DashboardLogger::log($connection->app->id, DashboardLogger::TYPE_SUBSCRIBED, [ + 'socketId' => $connection->socketId, + 'channel' => $this->getName(), + ]); } /**