From d0d926bfb00caa189462c74f055588aff5c7c73b Mon Sep 17 00:00:00 2001 From: 21pages Date: Sat, 28 Jan 2023 12:02:14 +0800 Subject: [PATCH] opt connection close Signed-off-by: 21pages --- src/client.rs | 1 + src/lang/ca.rs | 3 ++- src/lang/cn.rs | 3 ++- src/lang/cs.rs | 3 ++- src/lang/da.rs | 3 ++- src/lang/de.rs | 3 ++- src/lang/eo.rs | 3 ++- src/lang/es.rs | 3 ++- src/lang/fa.rs | 3 ++- src/lang/fr.rs | 3 ++- src/lang/gr.rs | 3 ++- src/lang/hu.rs | 3 ++- src/lang/id.rs | 3 ++- src/lang/it.rs | 3 ++- src/lang/ja.rs | 3 ++- src/lang/ko.rs | 3 ++- src/lang/kz.rs | 3 ++- src/lang/pl.rs | 3 ++- src/lang/pt_PT.rs | 3 ++- src/lang/ptbr.rs | 3 ++- src/lang/ro.rs | 45 ++++++++++++++++++++++++++++++++++++---- src/lang/ru.rs | 3 ++- src/lang/sk.rs | 3 ++- src/lang/sl.rs | 3 ++- src/lang/sq.rs | 3 ++- src/lang/sr.rs | 3 ++- src/lang/sv.rs | 3 ++- src/lang/template.rs | 3 ++- src/lang/th.rs | 3 ++- src/lang/tr.rs | 3 ++- src/lang/tw.rs | 3 ++- src/lang/ua.rs | 3 ++- src/lang/vn.rs | 3 ++- src/server/connection.rs | 35 +++++++++++++++++-------------- 34 files changed, 124 insertions(+), 50 deletions(-) diff --git a/src/client.rs b/src/client.rs index e9b8edf39..a6df6dbec 100644 --- a/src/client.rs +++ b/src/client.rs @@ -2083,6 +2083,7 @@ pub fn check_if_retry(msgtype: &str, title: &str, text: &str, retry_for_relay: b && !text.to_lowercase().contains("mismatch") && !text.to_lowercase().contains("manually") && !text.to_lowercase().contains("not allowed") + && !text.to_lowercase().contains("as expected") && !text.to_lowercase().contains("reset by the peer"))) } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 72f55b44b..3c8df31b4 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 14e8a463d..537313e97 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "添加到地址簿"), ("Group", "小组"), ("Search", "搜索"), - ("Closed manually by the web console", "被web控制台手动关闭"), + ("Closed manually by web console", "被web控制台手动关闭"), ("Local keyboard type", "本地键盘类型"), ("Select local keyboard type", "请选择本地键盘类型"), ("software_render_tip", "如果你使用英伟达显卡, 并且远程窗口在会话建立后会立刻关闭, 那么安装nouveau驱动并且选择使用软件渲染可能会有帮助。重启软件后生效。"), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "强"), ("Switch Sides", "反转访问方向"), ("Please confirm if you want to share your desktop?", "请确认要让对方访问你的桌面?"), + ("Closed as expected", "正常关闭"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index e2935770c..d5a65cdbb 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 937990ea8..eda3b8a58 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index a567877a2..774cac7e6 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Zum Adressbuch hinzufügen"), ("Group", "Gruppe"), ("Search", "Suchen"), - ("Closed manually by the web console", "Manuell über die Webkonsole beendet"), + ("Closed manually by web console", "Manuell über die Webkonsole beendet"), ("Local keyboard type", "Lokaler Tastaturtyp"), ("Select local keyboard type", "Lokalen Tastaturtyp auswählen"), ("software_render_tip", "Wenn Sie eine Nvidia-Grafikkarte haben und sich das entfernte Fenster sofort nach dem Herstellen der Verbindung schließt, kann es helfen, den Nouveau-Treiber zu installieren und Software-Rendering zu verwenden. Ein Neustart der Software ist erforderlich."), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "Stark"), ("Switch Sides", "Seiten wechseln"), ("Please confirm if you want to share your desktop?", "Bitte bestätigen Sie, ob Sie Ihren Desktop freigeben möchten."), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 839c69bbb..872cb30ec 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 2b109c18f..b7cb52804 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Añadir a la libreta de direcciones"), ("Group", "Grupo"), ("Search", "Búsqueda"), - ("Closed manually by the web console", "Cerrado manualmente por la consola web"), + ("Closed manually by web console", "Cerrado manualmente por la consola web"), ("Local keyboard type", "Tipo de teclado local"), ("Select local keyboard type", "Seleccionar tipo de teclado local"), ("software_render_tip", "Si tienes una gráfica Nvidia y la ventana remota se cierra inmediatamente, instalar el driver nouveau y elegir renderizado por software podría ayudar. Se requiere reiniciar la aplicación."), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "Fuerte"), ("Switch Sides", "Intercambiar lados"), ("Please confirm if you want to share your desktop?", "Por favor, confirma si quieres compartir tu escritorio"), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index da354579b..52ccf3786 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "افزودن به دفترچه آدرس"), ("Group", "گروه"), ("Search", "جستجو"), - ("Closed manually by the web console", "به صورت دستی توسط کنسول وب بسته شد"), + ("Closed manually by web console", "به صورت دستی توسط کنسول وب بسته شد"), ("Local keyboard type", "نوع صفحه کلید محلی"), ("Select local keyboard type", "نوع صفحه کلید محلی را انتخاب کنید"), ("software_render_tip", "اگر کارت گرافیک Nvidia دارید و پنجره راه دور بلافاصله پس از اتصال بسته می شود، درایور nouveau را نصب نمایید و انتخاب گزینه استفاده از رندر نرم افزار می تواند کمک کننده باشد. راه اندازی مجدد نرم افزار مورد نیاز است."), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "قوی"), ("Switch Sides", "طرفین را عوض کنید"), ("Please confirm if you want to share your desktop?", "لطفاً تأیید کنید که آیا می خواهید دسکتاپ خود را به اشتراک بگذارید؟"), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 9f1f23205..2feb026ff 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Ajouter au carnet d'adresses"), ("Group", "Groupe"), ("Search", "Rechercher"), - ("Closed manually by the web console", "Fermé manuellement par la console Web"), + ("Closed manually by web console", "Fermé manuellement par la console Web"), ("Local keyboard type", "Disposition du clavier local"), ("Select local keyboard type", "Selectionner la disposition du clavier local"), ("software_render_tip", "Si vous avez une carte graphique NVIDIA et que la fenêtre distante se ferme immédiatement après la connexion, l'installation du pilote Nouveau et le choix d'utiliser le rendu du logiciel peuvent aider. Un redémarrage du logiciel est requis."), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "Fort"), ("Switch Sides", "Inverser la prise de contrôle"), ("Please confirm if you want to share your desktop?", "Veuillez confirmer le partager de votre bureau ?"), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/gr.rs b/src/lang/gr.rs index 6ec1152cd..8398fb72a 100644 --- a/src/lang/gr.rs +++ b/src/lang/gr.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Προσθήκη στο Βιβλίο Διευθύνσεων"), ("Group", "Ομάδα"), ("Search", "Αναζήτηση"), - ("Closed manually by the web console", "Κλειστό χειροκίνητα από την κονσόλα web"), + ("Closed manually by web console", "Κλειστό χειροκίνητα από την κονσόλα web"), ("Local keyboard type", "Τύπος τοπικού πληκτρολογίου"), ("Select local keyboard type", "Επιλογή τύπου τοπικού πληκτρολογίου"), ("software_render_tip", "Εάν έχετε κάρτα γραφικών Nvidia και το παράθυρο σύνδεσης κλείνει αμέσως μετά τη σύνδεση, η εγκατάσταση του προγράμματος οδήγησης nouveau και η επιλογή χρήσης της επιτάχυνσης γραφικών μέσω λογισμικού μπορεί να βοηθήσει. Απαιτείται επανεκκίνηση."), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "Δυνατό"), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 295104a67..96eb63656 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index 5604a0c52..b966b7af9 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", "Pencarian"), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 7b979aff0..c144d7863 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Aggiungi alla rubrica"), ("Group", "Gruppo"), ("Search", "Cerca"), - ("Closed manually by the web console", "Chiudi manualmente dalla console Web"), + ("Closed manually by web console", "Chiudi manualmente dalla console Web"), ("Local keyboard type", "Tipo di tastiera locale"), ("Select local keyboard type", "Seleziona il tipo di tastiera locale"), ("software_render_tip", "Se si dispone di una scheda grafica Nvidia e la finestra remota si chiude immediatamente dopo la connessione, l'installazione del driver nouveau e la scelta di utilizzare il rendering software possono aiutare. È necessario un riavvio del software."), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "Forte"), ("Switch Sides", "Cambia lato"), ("Please confirm if you want to share your desktop?", "Vuoi condividere il tuo desktop?"), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index a280940c7..0466c48a9 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 1cdf529ce..c0d0bec8a 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 59d26135f..fd8b520f4 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index ee4b45334..8853afe5a 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Dodaj do Książki Adresowej"), ("Group", "Grypy"), ("Search", "Szukaj"), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 66373a5e9..4a391c3fb 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 5a137f391..b4a46c599 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index c5a9b529c..148723a5b 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -39,6 +39,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Change ID", "Schimbă ID"), ("Website", "Site web"), ("About", "Despre"), + ("Slogan_tip", ""), + ("Privacy Statement", ""), ("Mute", "Fără sunet"), ("Audio Input", "Intrare audio"), ("Enhancements", "Îmbunătățiri"), @@ -116,7 +118,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Good image quality", "Calitate bună a imaginii"), ("Balanced", "Calitate normală a imaginii"), ("Optimize reaction time", "Optimizează timpul de reacție"), - ("Custom", "Personalizare"), + ("Custom", "Personalizat"), ("Show remote cursor", "Afișează cursor la distanță"), ("Show quality monitor", "Afișează indicator de calitate"), ("Disable clipboard", "Dezactivează clipboard"), @@ -208,6 +210,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Always connect via relay", "Se conectează mereu prin retransmisie"), ("whitelist_tip", "Doar adresele IP autorizate pot accesa acest dispozitiv"), ("Login", "Conectare"), + ("Verify", ""), + ("Remember me", ""), + ("Trust this device", ""), + ("Verification code", ""), + ("verification_tip", ""), ("Logout", "Deconectare"), ("Tags", "Etichetare"), ("Search ID", "Caută după ID"), @@ -332,7 +339,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Scale adaptive", "Scală adaptivă"), ("General", "General"), ("Security", "Securitate"), - ("Account", "Cont"), ("Theme", "Temă"), ("Dark Theme", "Temă întunecată"), ("Dark", "Întunecat"), @@ -345,7 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Server", "Server"), ("Direct IP Access", "Acces direct IP"), ("Proxy", "Proxy"), - ("Port", "Port"), ("Apply", "Aplică"), ("Disconnect all devices?", "Vrei să deconectezi toate dispozitivele?"), ("Clear", "Golește"), @@ -374,7 +379,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Other", "Altele"), ("Confirm before closing multiple tabs", "Confirmă înainte de a închide mai multe file"), ("Keyboard Settings", "Configurare tastatură"), - ("Custom", "Personalizat"), ("Full Access", "Acces total"), ("Screen Share", "Partajare ecran"), ("Wayland requires Ubuntu 21.04 or higher version.", "Wayland necesită Ubuntu 21.04 sau o versiune superioară."), @@ -397,5 +401,38 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request access to your device", "Solicită acces la dispozitivul tău"), ("Hide connection management window", "Ascunde fereastra de gestionare a conexiunilor"), ("hide_cm_tip", "Permite ascunderea ferestrei de gestionare doar dacă accepți începerea sesiunilor folosind parola permanentă"), + ("wayland_experiment_tip", ""), + ("Right click to select tabs", ""), + ("Skipped", ""), + ("Add to Address Book", ""), + ("Group", ""), + ("Search", ""), + ("Closed manually by web console", ""), + ("Local keyboard type", ""), + ("Select local keyboard type", ""), + ("software_render_tip", ""), + ("Always use software rendering", ""), + ("config_input", ""), + ("request_elevation_tip", ""), + ("Wait", ""), + ("Elevation Error", ""), + ("Ask the remote user for authentication", ""), + ("Choose this if the remote account is administrator", ""), + ("Transmit the username and password of administrator", ""), + ("still_click_uac_tip", ""), + ("Request Elevation", ""), + ("wait_accept_uac_tip", ""), + ("Elevate successfully", ""), + ("uppercase", ""), + ("lowercase", ""), + ("digit", ""), + ("special character", ""), + ("length>=8", ""), + ("Weak", ""), + ("Medium", ""), + ("Strong", ""), + ("Switch Sides", ""), + ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 8103ae3a3..8e4411cb1 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Добавить в адресную книгу"), ("Group", "Группа"), ("Search", "Поиск"), - ("Closed manually by the web console", "Закрыто вручную через веб-консоль"), + ("Closed manually by web console", "Закрыто вручную через веб-консоль"), ("Local keyboard type", "Тип локальной клавиатуры"), ("Select local keyboard type", "Выберите тип локальной клавиатуры"), ("software_render_tip", "Если у вас видеокарта Nvidia и удалённое окно закрывается сразу после подключения, может помочь установка драйвера Nouveau и выбор использования программной визуализации. Потребуется перезапуск."), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "Стойкий"), ("Switch Sides", "Переключить стороны"), ("Please confirm if you want to share your desktop?", "Подтвердите, что хотите поделиться своим рабочим столом?"), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index c735cb28c..582cb58ae 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 6a17cc906..cc35e3f3f 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Dodaj v adresar"), ("Group", "Skupina"), ("Search", "Iskanje"), - ("Closed manually by the web console", "Ročno zaprto iz spletne konzole"), + ("Closed manually by web console", "Ročno zaprto iz spletne konzole"), ("Local keyboard type", "Lokalna vrsta tipkovnice"), ("Select local keyboard type", "Izberite lokalno vrsto tipkovnice"), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index ebb43f6b7..3f11d72e1 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index d9463318d..96ffa4d84 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Dodaj u adresar"), ("Group", "Grupa"), ("Search", "Pretraga"), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 146e60f9a..2069826ee 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 729932973..26bc8ef51 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index a78509e59..726bd8a9d 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "เพิ่มไปยังสมุดรายชื่อ"), ("Group", "กลุ่ม"), ("Search", "ค้นหา"), - ("Closed manually by the web console", "ถูกปิดโดยเว็บคอนโซล"), + ("Closed manually by web console", "ถูกปิดโดยเว็บคอนโซล"), ("Local keyboard type", "ประเภทคีย์บอร์ด"), ("Select local keyboard type", "เลือกประเภทคีย์บอร์ด"), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 483ee67e3..c7eb27205 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 459c517ff..e6d2dcb61 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "添加到地址簿"), ("Group", "小組"), ("Search", "搜索"), - ("Closed manually by the web console", "被web控制台手動關閉"), + ("Closed manually by web console", "被web控制台手動關閉"), ("Local keyboard type", "本地鍵盤類型"), ("Select local keyboard type", "請選擇本地鍵盤類型"), ("software_render_tip", "如果你使用英偉達顯卡, 並且遠程窗口在會話建立後會立刻關閉, 那麼安裝nouveau驅動並且選擇使用軟件渲染可能會有幫助。重啟軟件後生效。"), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", "強"), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", "正常關閉"), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index ca99be12e..9276b184e 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", "Додати IP до Адресної книги"), ("Group", "Група"), ("Search", "Пошук"), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 53de4e67c..6649fbaa3 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -407,7 +407,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Add to Address Book", ""), ("Group", ""), ("Search", ""), - ("Closed manually by the web console", ""), + ("Closed manually by web console", ""), ("Local keyboard type", ""), ("Select local keyboard type", ""), ("software_render_tip", ""), @@ -433,5 +433,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Strong", ""), ("Switch Sides", ""), ("Please confirm if you want to share your desktop?", ""), + ("Closed as expected", ""), ].iter().cloned().collect(); } diff --git a/src/server/connection.rs b/src/server/connection.rs index d3f7ac149..c259d54cf 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -101,7 +101,6 @@ pub struct Connection { lr: LoginRequest, last_recv_time: Arc>, chat_unanswered: bool, - close_manually: bool, #[allow(unused)] elevation_requested: bool, from_switch: bool, @@ -200,7 +199,6 @@ impl Connection { lr: Default::default(), last_recv_time: Arc::new(Mutex::new(Instant::now())), chat_unanswered: false, - close_manually: false, elevation_requested: false, from_switch: false, }; @@ -271,7 +269,9 @@ impl Connection { } } ipc::Data::Close => { - conn.on_close_manually("connection manager", "peer").await; + conn.chat_unanswered = false; // seen + conn.send_close_reason_no_retry("").await; + conn.on_close("connection manager", true).await; break; } ipc::Data::ChatMessage{text} => { @@ -411,7 +411,8 @@ impl Connection { } Ok(conns) = hbbs_rx.recv() => { if conns.contains(&id) { - conn.on_close_manually("web console", "web console").await; + conn.send_close_reason_no_retry("Closed manually by web console").await; + conn.on_close("web console", true).await; break; } } @@ -441,7 +442,8 @@ impl Connection { Some(message::Union::Misc(m)) => { match &m.union { Some(misc::Union::StopService(_)) => { - conn.on_close_manually("stop service", "peer").await; + conn.send_close_reason_no_retry("").await; + conn.on_close("stop service", true).await; break; } _ => {}, @@ -540,6 +542,9 @@ impl Connection { "action": "close", })); ALIVE_CONNS.lock().unwrap().retain(|&c| c != id); + if let Some(s) = conn.server.upgrade() { + s.write().unwrap().remove_connection(&conn.inner); + } log::info!("#{} connection loop exited", id); } @@ -1583,7 +1588,8 @@ impl Connection { uuid.to_string().as_ref(), ]) .ok(); - self.on_close_manually("switch sides", "peer"); + self.send_close_reason_no_retry("Closed as expected"); + self.on_close("switch sides", false); return false; } } @@ -1757,16 +1763,13 @@ impl Connection { } async fn on_close(&mut self, reason: &str, lock: bool) { - if let Some(s) = self.server.upgrade() { - s.write().unwrap().remove_connection(&self.inner); - } log::info!("#{} Connection closed: {}", self.inner.id(), reason); if lock && self.lock_after_session_end && self.keyboard { #[cfg(not(any(target_os = "android", target_os = "ios")))] lock_screen().await; } #[cfg(not(any(target_os = "android", target_os = "ios")))] - let data = if self.chat_unanswered && !self.close_manually { + let data = if self.chat_unanswered { ipc::Data::Disconnected } else { ipc::Data::Close @@ -1777,15 +1780,17 @@ impl Connection { self.port_forward_socket.take(); } - async fn on_close_manually(&mut self, close_from: &str, close_by: &str) { - self.close_manually = true; + // The `reason` should be consistent with `check_if_retry` if not empty + async fn send_close_reason_no_retry(&mut self, reason: &str) { let mut misc = Misc::new(); - misc.set_close_reason(format!("Closed manually by the {}", close_by)); + if reason.is_empty() { + misc.set_close_reason("Closed manually by the peer".to_string()); + } else { + misc.set_close_reason(reason.to_string()); + } let mut msg_out = Message::new(); msg_out.set_misc(misc); self.send(msg_out).await; - self.on_close(&format!("Close requested from {}", close_from), false) - .await; SESSIONS.lock().unwrap().remove(&self.lr.my_id); }