When an OwnCast user sends "/me claps", the bridge now relays it as a proper CTCP ACTION so IRC clients render it natively. The username is bolded with mIRC \x02 for visual attribution. Made-with: Cursor
1.0 KiB
1.0 KiB
OwnCast /me to IRC CTCP ACTION
Task
Detect when OwnCast users type /me does something and relay the message to IRC as a proper CTCP ACTION so IRC clients render it natively as an action, with bold attribution on the username.
Changes Made
src/router.rs: Extractedformat_owncast_to_irc()function. When the body starts with/me, strips the prefix and wraps the outbound string as\x01ACTION {prefix} \x02{username}\x02 {action_body}\x01. Added 5 unit tests covering: action formatting, multi-word actions, normal passthrough, bare/mewithout space, and/memid-message.src/irc_task.rs: Updated outbound handler to detect strings starting with\x01and send them as rawCommand::PRIVMSG(preserving the CTCP wrapper) instead of usingsend_privmsgwhich would double-escape.
Result
- OwnCast user sends:
/me claps - IRC clients see:
* bridge-bot [OC] **viewer42** claps(bold username via mIRC formatting) - Normal messages are unaffected.
Follow-up
- None identified. All 60 tests pass.