BF presence count
This commit is contained in:
parent
2960c3a3f3
commit
d77e38d6f4
|
|
@ -24,9 +24,8 @@ class OpenPresenceChannel extends Channel
|
|||
{
|
||||
parent::subscribe($connection, $payload);
|
||||
|
||||
$this->channelManager
|
||||
->getLocalConnections()
|
||||
->then(function ($connections) use ($connection) {
|
||||
$connections = $this->getConnections();
|
||||
|
||||
$connection->send(json_encode([
|
||||
'event' => 'presence.subscription_succeeded',
|
||||
'channel' => $this->getName(),
|
||||
|
|
@ -41,7 +40,6 @@ class OpenPresenceChannel extends Channel
|
|||
]));
|
||||
|
||||
$this->informPresence($connection, $connections);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -54,21 +52,11 @@ class OpenPresenceChannel extends Channel
|
|||
*/
|
||||
public function unsubscribe(ConnectionInterface $connection): PromiseInterface
|
||||
{
|
||||
\Log::channel('websocket')->info('Presence unsub');
|
||||
|
||||
$truth = parent::unsubscribe($connection);
|
||||
|
||||
\Log::channel('websocket')->info('Presence unsub 1');
|
||||
$this->informPresence($connection, $this->getConnections(), true);
|
||||
|
||||
return $this->channelManager
|
||||
->getLocalConnections()
|
||||
->then(function ($connections) use ($connection) {
|
||||
\Log::channel('websocket')->info('Presence unsub 2 local conn');
|
||||
$this->informPresence($connection, $connections, true);
|
||||
})
|
||||
->then(function () use ($truth) {
|
||||
return $truth;
|
||||
});
|
||||
}
|
||||
|
||||
public function informPresence(
|
||||
|
|
|
|||
Loading…
Reference in New Issue