Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 76bc482

Browse files
committed
Fixed presence channel broadcasting
1 parent 6a23016 commit 76bc482

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Channels/PresenceChannel.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace BeyondCode\LaravelWebSockets\Channels;
44

5+
use BeyondCode\LaravelWebSockets\DashboardLogger;
56
use BeyondCode\LaravelWebSockets\Server\Exceptions\InvalidSignature;
67
use Ratchet\ConnectionInterface;
78
use stdClass;
@@ -19,7 +20,9 @@ class PresenceChannel extends PrivateChannel
1920
*/
2021
public function subscribe(ConnectionInterface $connection, stdClass $payload)
2122
{
22-
parent::subscribe($connection, $payload);
23+
$this->verifySignature($connection, $payload);
24+
25+
$this->saveConnection($connection);
2326

2427
$this->channelManager->userJoinedPresenceChannel(
2528
$connection,
@@ -48,6 +51,11 @@ public function subscribe(ConnectionInterface $connection, stdClass $payload)
4851
(object) $memberAddedPayload, $connection->socketId,
4952
$connection->app->id
5053
);
54+
55+
DashboardLogger::log($connection->app->id, DashboardLogger::TYPE_SUBSCRIBED, [
56+
'socketId' => $connection->socketId,
57+
'channel' => $this->getName(),
58+
]);
5159
}
5260

5361
/**

0 commit comments

Comments
 (0)