Reset timeout count if a PRIVMSG is sent

This commit is contained in:
Yash Karandikar 2022-07-18 21:36:37 -05:00
parent 70f9b42d1b
commit 36c8205a12
Signed by: karx
GPG key ID: A794DA2529474BA5

View file

@ -83,6 +83,15 @@ async fn main() -> anyhow::Result<()> {
format!("{:#?}", channel_users).replace("\n", "\r\n"),
)?;
}
let users = unwrap_or_continue!(channel_users.get_mut(channel));
let user = unwrap_or_continue!(users.get_mut(nick));
*user = match user {
Status::TimeoutCount(count) if *count > conf.timeout_limit.unwrap_or(1) => {
Status::TimeoutCount(0)
}
_ => *user,
};
}
Command::PART(ref channel, Some(ref message)) => {
if message == &conf.quit_message {