Fixed presence channel broadcasting
This commit is contained in:
parent
6a23016f98
commit
76bc4820a0
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace BeyondCode\LaravelWebSockets\Channels;
|
namespace BeyondCode\LaravelWebSockets\Channels;
|
||||||
|
|
||||||
|
use BeyondCode\LaravelWebSockets\DashboardLogger;
|
||||||
use BeyondCode\LaravelWebSockets\Server\Exceptions\InvalidSignature;
|
use BeyondCode\LaravelWebSockets\Server\Exceptions\InvalidSignature;
|
||||||
use Ratchet\ConnectionInterface;
|
use Ratchet\ConnectionInterface;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
@ -19,7 +20,9 @@ class PresenceChannel extends PrivateChannel
|
||||||
*/
|
*/
|
||||||
public function subscribe(ConnectionInterface $connection, stdClass $payload)
|
public function subscribe(ConnectionInterface $connection, stdClass $payload)
|
||||||
{
|
{
|
||||||
parent::subscribe($connection, $payload);
|
$this->verifySignature($connection, $payload);
|
||||||
|
|
||||||
|
$this->saveConnection($connection);
|
||||||
|
|
||||||
$this->channelManager->userJoinedPresenceChannel(
|
$this->channelManager->userJoinedPresenceChannel(
|
||||||
$connection,
|
$connection,
|
||||||
|
|
@ -48,6 +51,11 @@ class PresenceChannel extends PrivateChannel
|
||||||
(object) $memberAddedPayload, $connection->socketId,
|
(object) $memberAddedPayload, $connection->socketId,
|
||||||
$connection->app->id
|
$connection->app->id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
DashboardLogger::log($connection->app->id, DashboardLogger::TYPE_SUBSCRIBED, [
|
||||||
|
'socketId' => $connection->socketId,
|
||||||
|
'channel' => $this->getName(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue