From 8faa4b272949e1a220642a9a9e3f7131ac9d747e Mon Sep 17 00:00:00 2001 From: Yash Karandikar Date: Fri, 17 Jun 2022 18:26:13 +0530 Subject: [PATCH] Handle CTCP ACTION messages --- src/irc_discord.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/irc_discord.rs b/src/irc_discord.rs index 014088f..d1c2cef 100644 --- a/src/irc_discord.rs +++ b/src/irc_discord.rs @@ -220,6 +220,11 @@ fn irc_to_discord_processing( .into_owned(); computed = { + computed = computed + .strip_prefix("\x01ACTION ") + .and_then(|s| s.strip_suffix('\x01')) + .map(|s| format!("*{}*", s)) + .unwrap_or_else(|| computed); // if any step in the way fails, fall back to using computed let mut new = String::with_capacity(computed.len()); let mut has_opened_bold = false; let mut has_opened_italic = false;