diff --git a/src/main.rs b/src/main.rs index 3ba142f..ba83d9b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -281,6 +281,7 @@ async fn irc_loop( lazy_static! { static ref PING_NICK_1: Regex = Regex::new(r"^[\w+]+(:|,)").unwrap(); static ref PING_RE_2: Regex = Regex::new(r"@[^0-9\s]+").unwrap(); + static ref CONTROL_CHAR_RE: Regex = Regex::new(r"\\x1f|\\x02|\\x12|\\x0f|\\x16|\\x03(?:\d{1,2}(?:,\d{1,2})?)?").unwrap(); } client.identify()?; @@ -392,6 +393,8 @@ async fn irc_loop( .to_string(); } + computed = CONTROL_CHAR_RE.replace_all(&computed, "").to_string(); + w.username(nickname); w.content(computed); w