-
Notifications
You must be signed in to change notification settings - Fork 240
Description
What is the current behaviour and why should it be changed?
Create the ability to send a broadcast chat message to all connected clients via the JSON-RPC api. This would be a general capability that would allow rpc users to automatically send messages to all connected clients for a variety of use-cases.
Describe possible approaches
Presently this is not possible because all methods on the server object that expose chat functionality are private. Moreover, each either requires a 'source' connection id or prepends the message with the a static literal (in the case of the welcome message).
I propose a rather simple change which would refactor CreateAndSendChatTextForAllConChannels (which would remain private) to split the formatting of the chat from the sending of the chat. The formatting (prepending the sender user name and time) would remain in this method, but the loop to send to all connected clients would be moved to a new public method potentially called CreateAndBroadcastChat().
Note: the refactoring is simply to avoid duplication of the same code in multiple methods. This is optional and the same functionality could be achieved by leaving the existing method "as-is" and creating a new method which contains a duplication of the send loop.
serverrpc would be extended to include a new method "jamulusserver/broadcastChat" (or similar), accepting a chat string as a parameter. This rpc method would then access to the new CreateAndBroadcastChat method on pServer.
Has this feature been discussed and generally agreed?
No
Metadata
Metadata
Assignees
Labels
Type
Projects
Status