CTCP ACTION messages (/me) were relayed with raw \x01 bytes, rendering as boxed-X characters in OwnCast. Detect the ACTION pattern, extract the body, and format it like traditional IRC clients. Also strip \x01 in irc_format as a safety net for other CTCP leakage. Made-with: Cursor
1.2 KiB
1.2 KiB
IRC ACTION Message Formatting Fix
Task
Fix IRC CTCP ACTION messages (/me commands) displaying as [IRC] <cottongin> ☒ACTION sniffs☒ in OwnCast. The \x01 CTCP delimiters were rendering as boxed X characters, and the ACTION keyword was not being parsed.
Changes Made
src/events.rs: Addedis_action: boolfield toBridgeEvent::ChatMessagevariant.src/irc_task.rs: Addedparse_ctcp_action()function to detect\x01ACTION ...\x01pattern, extract the action body, and setis_action: true. Added 5 unit tests.src/router.rs: Updated formatting for both IRC-to-OwnCast and OwnCast-to-IRC directions to use* username body *format whenis_actionis true.src/irc_format.rs: Added\x01to the stripped control codes as a safety net for any non-ACTION CTCP leakage. Added 2 unit tests.src/webhook.rs: Addedis_action: falseto OwnCast-origin ChatMessage constructor; updated test destructure.src/websocket.rs: Addedis_action: falseto OwnCast-origin ChatMessage constructor.
Result
- Before:
[IRC] <cottongin> ☒ACTION sniffs☒ - After:
[IRC] * cottongin sniffs *
Follow-up
- None identified. All 55 tests pass.