mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-18 13:55:03 +03:00
fix: non-E2EE show dialog (#15514)
* fix: non-E2EE show dialog Signed-off-by: fufesou <linlong1266@gmail.com> * fix: build web, bridge Signed-off-by: fufesou <linlong1266@gmail.com> * fix: direct IP access, do not snow non-E2EE dialog Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non E2EE dialog, update contents Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE, show dialog, port forward Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE dialog, port forward, ignore direct IP access Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE is_direct_ip_access() Signed-off-by: fufesou <linlong1266@gmail.com> * Simple refactor Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE dialog, port forward, close socket on disconnect Signed-off-by: fufesou <linlong1266@gmail.com> * fix: non-E2EE dialog, incorrect reuse of Data::Close Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -3792,6 +3792,7 @@ pub trait Interface: Send + Clone + 'static + Sized {
|
||||
#[derive(Clone)]
|
||||
pub enum Data {
|
||||
Close,
|
||||
RejectInsecureConnection,
|
||||
Login((String, String, String, bool)),
|
||||
Message(Message),
|
||||
SendFiles((i32, JobType, String, String, i32, bool, bool)),
|
||||
@@ -3815,11 +3816,33 @@ pub enum Data {
|
||||
ElevateWithLogon(String, String),
|
||||
NewVoiceCall,
|
||||
CloseVoiceCall,
|
||||
ContinueInsecureConnection,
|
||||
ResetDecoder(Option<usize>),
|
||||
RenameFile((i32, String, String, bool)),
|
||||
TakeScreenshot((i32, String)),
|
||||
}
|
||||
|
||||
pub async fn confirm_insecure_connection(
|
||||
interface: &impl Interface,
|
||||
receiver: &mut UnboundedReceiver<Data>,
|
||||
) -> bool {
|
||||
interface.msgbox(
|
||||
"insecure-connection-nocancel-hasclose",
|
||||
"Insecure Connection",
|
||||
"conn-e2ee-unavailable-tip",
|
||||
"",
|
||||
);
|
||||
while let Some(data) = receiver.recv().await {
|
||||
match data {
|
||||
Data::ContinueInsecureConnection => return true,
|
||||
Data::RejectInsecureConnection => return false,
|
||||
Data::Close => return false,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
/// Keycode for key events.
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Key {
|
||||
|
||||
Reference in New Issue
Block a user