feat: strip IRC formatting codes from messages sent to Owncast
Add irc_format module that removes mIRC control codes (bold, color, italic, underline, reverse, strikethrough, monospace, reset) before forwarding to Owncast. Color codes with fg/bg digit params are consumed correctly. Multi-byte UTF-8 (emoji, accented chars, CJK) is preserved. Made-with: Cursor
This commit is contained in:
17
chat-summaries/2026-03-12_strip-irc-formatting-summary.md
Normal file
17
chat-summaries/2026-03-12_strip-irc-formatting-summary.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Strip IRC Formatting Codes from Owncast-bound Messages
|
||||
|
||||
**Date:** 2026-03-12
|
||||
|
||||
## Task
|
||||
|
||||
IRC messages forwarded to Owncast contained mIRC formatting control codes (`\x02`, `\x03`, `\x0F`, etc.) that rendered as garbage glyphs since Owncast doesn't support any message styling.
|
||||
|
||||
## Changes
|
||||
|
||||
- **New file: `src/irc_format.rs`** — `strip_formatting()` function that removes all IRC formatting control codes: bold, color (with fg/bg digit parameters), reset, monospace, reverse, italic, strikethrough, and underline. Includes 18 unit tests.
|
||||
- **`src/irc_task.rs`** — Call `strip_formatting()` on the message body before constructing the `BridgeEvent`, so all downstream consumers see clean text.
|
||||
- **`src/main.rs`** — Registered the new `irc_format` module.
|
||||
|
||||
## Follow-up
|
||||
|
||||
- None identified. No new dependencies added.
|
||||
Reference in New Issue
Block a user