Skip to content

Commit

Permalink
also allow for current clientId=data.clientId
Browse files Browse the repository at this point in the history
  • Loading branch information
Badgerati committed Oct 18, 2021
1 parent 2e3945b commit 46c8bcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Private/PodeServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ function Start-PodeWebServer
Name = $null
}
Route = $null
ClientId = $context.WebSocket.ClientId
Timestamp = $context.Timestamp
Streamed = $true
}
Expand Down
4 changes: 2 additions & 2 deletions src/Public/Responses.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1455,13 +1455,13 @@ function Send-PodeSignal
$Path = $SignalEvent.Data.ClientId
}

if (($Mode -ieq 'Auto') -and ($SignalEvent.Data.Direct)) {
if (($Mode -ieq 'Auto') -and ($SignalEvent.Data.Direct -or ($SignalEvent.ClientId -ieq $SignalEvent.Data.ClientId))) {
$Mode = 'Direct'
}
}

# broadcast or direct?
if ($Mode -iin @('Auto', 'Broadcast')) { # $broadcast) {
if ($Mode -iin @('Auto', 'Broadcast')) {
$PodeContext.Server.WebSockets.Listener.AddServerSignal($Value, $Path, $ClientId)
}
else {
Expand Down

0 comments on commit 46c8bcf

Please sign in to comment.