Files
owncast-IRC-bridge/chat-summaries/2026-03-12_16-45-summary.md

21 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

# 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`**: Added `is_action: bool` field to `BridgeEvent::ChatMessage` variant.
- **`src/irc_task.rs`**: Added `parse_ctcp_action()` function to detect `\x01ACTION ...\x01` pattern, extract the action body, and set `is_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 when `is_action` is true.
- **`src/irc_format.rs`**: Added `\x01` to the stripped control codes as a safety net for any non-ACTION CTCP leakage. Added 2 unit tests.
- **`src/webhook.rs`**: Added `is_action: false` to OwnCast-origin ChatMessage constructor; updated test destructure.
- **`src/websocket.rs`**: Added `is_action: false` to OwnCast-origin ChatMessage constructor.
## Result
- Before: `[IRC] <cottongin> ☒ACTION sniffs☒`
- After: `[IRC] * cottongin sniffs *`
## Follow-up
- None identified. All 55 tests pass.