commit e2b92e8c5713e60315da680b6bfa7d9ef2a31c54
parent 933d12054930eab681cbb22153c2ef6662a77dc9
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Thu, 30 Mar 2023 22:23:16 -0700
only reset keepalive timer on actual text post in chat
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
@@ -383,6 +383,7 @@ impl LeChatPHPClient {
}
} else if oper.index() == oper1 {
if let Ok(post_type_recv) = oper.recv(&rx) {
+ let mut should_reset_keepalive_timer = false;
loop {
let post_type = post_type_recv.clone();
let resp = match client.get(url.clone()).send() {
@@ -416,6 +417,7 @@ impl LeChatPHPClient {
match post_type {
PostType::Post(msg, send_to) => {
+ should_reset_keepalive_timer = true;
params.extend(vec![
("action", "post".to_owned()),
("postid", postid_value.to_owned()),
@@ -537,7 +539,9 @@ impl LeChatPHPClient {
}
break;
}
- last_post_tx.send(true).unwrap();
+ if should_reset_keepalive_timer {
+ last_post_tx.send(true).unwrap();
+ }
}
}
})