Handle CTCP ACTION messages

This commit is contained in:
Yash Karandikar 2022-06-17 18:26:13 +05:30
parent 914f17b68c
commit 8faa4b2729

View file

@ -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;