Feature request for SignalR: IHubClients.UsersExceptClients()
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
I have the following setup:
When a new browser connects to my SignalR hub, I register it by user id with a custom `IUserIdProvider`.
Then, when a user sends a message in a chat, this hits one of my API endpoints that then calls the SignalR hub to send a message by `hub.Clients.Users(chatParticipants).SendAsync(...)`. This should send a message to all users, including the one that sent the message, because the user could have the chat open on several devices, and this allows their other devices to get the chat message.
The problem is that I'd like to avoid sending the chat message to the specific original client/device that sent the message. Since most chat messages are between two users in the system, this would cut my message send by almost half if I could do this. This could be achieved with a method `IHubClients.UsersExceptClients()`, which would let me specify what users to send to (where each user can have several clients) but to exclude a specific client (and I'd send in the connection id from the client side to the server for this purpose).
Is it possible to add this feature?
Contributor guide
Assessment
This issue has not been assessed yet.