Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Nov 24, 2023
1 parent 829b954 commit 6b7c9f0
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/Channels/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,17 @@ public function subscribed(Connection $connection): bool
public function broadcast(array $payload, Connection $except = null): void
{
foreach ($this->connections() as $connection) {
if ($except && $except->id() === $connection->connection()->id()) {
return;
}
// if ($except && $except->id() === $connection->connection()->id()) {
// return;
// }

if (isset($payload['except']) && $payload['except'] === $connection->connection()->id()) {
return;
}
// if (isset($payload['except']) && $payload['except'] === $connection->connection()->id()) {
// return;
// }

try {
$connection->send(
json_encode(
Arr::except($payload, 'except')
)
json_encode($payload, 'except')
);
} catch (Exception $e) {
// Output::error('Broadcasting to '.$connection->id().' resulted in an error');
Expand Down

0 comments on commit 6b7c9f0

Please sign in to comment.