Skip to content

Commit

Permalink
Add display name to chat messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed May 3, 2020
1 parent 248af54 commit 088c180
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Server/Services/BrowserHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public Task Chat(string message, string[] deviceIDs)
deviceIDs = DataService.FilterDeviceIDsByUserPermission(deviceIDs, RemotelyUser);
var connections = GetActiveClientConnections(deviceIDs);
var organizationName = DataService.GetOrganizationName(RemotelyUser.UserName);
return DeviceHubContext.Clients.Clients(connections.Select(x => x.Key).ToList()).SendAsync("Chat", $"{RemotelyUser.UserName}: {message}", organizationName, Context.ConnectionId);
return DeviceHubContext.Clients.Clients(connections.Select(x => x.Key).ToList()).SendAsync("Chat",
$"{RemotelyUser.DisplayName ?? RemotelyUser.UserName}: {message}",
organizationName,
Context.ConnectionId);
}

public Task DeployScript(string fileID, string mode, string[] deviceIDs)
Expand Down

0 comments on commit 088c180

Please sign in to comment.