Change reply format

This commit is contained in:
Yash Karandikar 2022-01-26 13:18:52 -06:00
parent 377602a0da
commit 5b9fe214be

View file

@ -318,16 +318,19 @@ impl EventHandler for Handler {
.join(' ') .join(' ')
); );
let reply_nick_bytes = reply_nick.len() + 3; let reply_nick_bytes = reply_nick.len() + 3;
let reply_content_limit = 510 - reply_nick_bytes - 5; let reply_content_limit = 510 - reply_nick_bytes - 11;
let to_send = if content.len() > reply_content_limit { let to_send = if content.len() > reply_content_limit {
content.truncate(reply_content_limit); format!("{}...", &content[..reply_content_limit])
format!("> {}...", content)
} else { } else {
format!("> {}", content) content
}; };
send_irc_message(&sender, &channel, &format!("<{}> {}", reply_nick, to_send)) send_irc_message(
.await &sender,
.unwrap(); &channel,
&format!("(reply) <{}> {}", reply_nick, to_send),
)
.await
.unwrap();
} }
for chunk in chunks { for chunk in chunks {
let to_send = String::from_iter(chunk.iter()); let to_send = String::from_iter(chunk.iter());