refactor msgbox retry

This commit is contained in:
rustdesk
2021-08-11 01:28:53 +08:00
parent 6130792734
commit 4e85841398
4 changed files with 33 additions and 16 deletions

View File

@@ -1144,3 +1144,16 @@ lazy_static::lazy_static! {
("LOCK_SCREEN", Key::ControlKey(ControlKey::LockScreen)),
].iter().cloned().collect();
}
#[inline]
pub fn check_if_retry(msgtype: &str, title: &str, text: &str) -> bool {
msgtype == "error"
&& title == "Connection Error"
&& !text.to_lowercase().contains("offline")
&& !text.to_lowercase().contains("exist")
&& !text.to_lowercase().contains("handshake")
&& !text.to_lowercase().contains("failed")
&& !text.to_lowercase().contains("resolve")
&& !text.to_lowercase().contains("mismatch")
&& !text.to_lowercase().contains("manually")
}