Add structured chat messages with channel-scoped client rendering - #295
Open
ann0see wants to merge 1 commit into
Open
Add structured chat messages with channel-scoped client rendering#295ann0see wants to merge 1 commit into
ann0see wants to merge 1 commit into
Conversation
Introduces chat message type 37 carrying semantic chat data (channel id, timestamp, sender name, text) alongside the legacy message 18, negotiated via new REQ_CHAT_TEXT_SUPPORT / CHAT_TEXT_SUPPORTED messages (38/39). The server fans out structured chat to all clients and exposes it over JSON-RPC (jamulusserver/chatMessageReceived, jamulusclient/chatTextReceived). The client renders messages client-side with per-channel colors and safe linkification, escaping user text before any HTML interpretation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the legacy free-text chat wire format (message 18, server-assembled HTML) with a structured, semantic chat protocol while keeping full backward compatibility:
MSG_CHAT_TEXT_CHANNEL) carries structured chat data:channelId,timestamp,senderName,text.REQ_CHAT_TEXT_SUPPORT) / 39 (CHAT_TEXT_SUPPORTED) lets the server detect clients that understand the new format and only send message 37 to them.jamulusserver/chatMessageReceivedandjamulusclient/chatTextReceivednow carry the structured{channelId, timestamp, senderName, text}payload instead of opaque HTML.The old message 18 / server-HTML path is retained for legacy clients.
Tests
tests/chatprotocolQtTest suite: 48 assertions covering round-tripping, reject rules (over-length, truncated, malformed), split/merge of large messages, capability negotiation, theChatMessagedata model, and safe-render security cases (script/img/bold injection, URL linkification).Documentation
docs/JSON-RPC.mdupdated for the structured chat notifications (client and server).docs/design-chat-redesign.mdcaptures the design and decisions.