Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

remove special treatment when only use permanent passwrod but no password set (#8566)

21pages8602b036bd6e
diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart
index 35bbd3716..f140a68b0 100644
--- a/flutter/lib/common/widgets/dialog.dart
+++ b/flutter/lib/common/widgets/dialog.dart
@@ -2188,3 +2188,31 @@ void setSharedAbPasswordDialog(String abName, Peer peer) {
);
});
}
+
+void CommonConfirmDialog(OverlayDialogManager dialogManager, String content,
+ VoidCallback onConfirm) {
+ dialogManager.show((setState, close, context) {
+ submit() {
+ close();
+ onConfirm.call();
+ }
+
+ return CustomAlertDialog(
+ content: Row(
+ children: [
+ Expanded(
+ child: Text(content,
+ style: const TextStyle(fontSize: 15),
+ textAlign: TextAlign.start),
+ ),
+ ],
+ ).marginOnly(bottom: 12),
+ actions: [
+ dialogButton(translate("Cancel"), onPressed: close, isOutline: true),
+ dialogButton(translate("OK"), onPressed: submit),
+ ],
+ onSubmit: submit,
+ onCancel: close,
+ );
+ });
+}
diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart
index 54fae3e99..1f53172a5 100644
--- a/flutter/lib/desktop/pages/desktop_home_page.dart
+++ b/flutter/lib/desktop/pages/desktop_home_page.dart
@@ -838,7 +838,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
}
}
-void setPasswordDialog() async {
+void setPasswordDialog({VoidCallback? notEmptyCallback}) async {
final pw = await bind.mainGetPermanentPassword();
final p0 = TextEditingController(text: pw);
final p1 = TextEditingController(text: pw);
@@ -878,6 +878,9 @@ void setPasswordDialog() async {
return;
}
bind.mainSetPermanentPassword(password: pass);
+ if (pass.isNotEmpty) {
+ notEmptyCallback?.call();
+ }
close();
}
diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart
index 0035ef493..7c955e6fb 100644
--- a/flutter/lib/desktop/pages/desktop_setting_page.dart
+++ b/flutter/lib/desktop/pages/desktop_setting_page.dart
@@ -684,10 +684,18 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
RxBool hasBot = bind.mainHasValidBotSync().obs;
update() async {
has2fa.value = bind.mainHasValid2FaSync();
+ setState(() {});
}
onChanged(bool? checked) async {
- change2fa(callback: update);
+ if (checked == false) {
+ CommonConfirmDialog(
+ gFFI.dialogManager, translate('cancel-2fa-confirm-tip'), () {
+ change2fa(callback: update);
+ });
+ } else {
+ change2fa(callback: update);
+ }
}
final tfa = GestureDetector(
@@ -716,10 +724,18 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
}
updateBot() async {
hasBot.value = bind.mainHasValidBotSync();
+ setState(() {});
}
onChangedBot(bool? checked) async {
- changeBot(callback: updateBot);
+ if (checked == false) {
+ CommonConfirmDialog(
+ gFFI.dialogManager, translate('cancel-bot-confirm-tip'), () {
+ changeBot(callback: updateBot);
+ });
+ } else {
+ changeBot(callback: updateBot);
+ }
}
final bot = GestureDetector(
@@ -873,12 +889,22 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
label: value,
onChanged: locked
? null
- : ((value) {
- () async {
+ : ((value) async {
+ callback() async {
await model.setVerificationMethod(
passwordKeys[passwordValues.indexOf(value)]);
await model.updatePasswordModel();
- }();
+ }
+
+ if (value ==
+ passwordValues[passwordKeys
+ .indexOf(kUsePermanentPassword)] &&
+ (await bind.mainGetPermanentPassword())
+ .isEmpty) {
+ setPasswordDialog(notEmptyCallback: callback);
+ } else {
+ await callback();
+ }
}),
))
.toList();
diff --git a/flutter/lib/mobile/pages/server_page.dart b/flutter/lib/mobile/pages/server_page.dart
index 02c416b64..3609564ec 100644
--- a/flutter/lib/mobile/pages/server_page.dart
+++ b/flutter/lib/mobile/pages/server_page.dart
@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+import 'package:flutter_hbb/desktop/pages/desktop_home_page.dart';
import 'package:flutter_hbb/mobile/widgets/dialog.dart';
import 'package:flutter_hbb/models/chat_model.dart';
import 'package:get/get.dart';
@@ -101,18 +102,27 @@ class ServerPage extends StatefulWidget implements PageShape {
),
];
},
- onSelected: (value) {
+ onSelected: (value) async {
if (value == "changeID") {
changeIdDialog();
} else if (value == "setPermanentPassword") {
- setPermanentPasswordDialog(gFFI.dialogManager);
+ setPasswordDialog();
} else if (value == "setTemporaryPasswordLength") {
setTemporaryPasswordLengthDialog(gFFI.dialogManager);
} else if (value == kUsePermanentPassword ||
value == kUseTemporaryPassword ||
value == kUseBothPasswords) {
- bind.mainSetOption(key: kOptionVerificationMethod, value: value);
- gFFI.serverModel.updatePasswordModel();
+ callback() {
+ bind.mainSetOption(key: kOptionVerificationMethod, value: value);
+ gFFI.serverModel.updatePasswordModel();
+ }
+
+ if (value == kUsePermanentPassword &&
+ (await bind.mainGetPermanentPassword()).isEmpty) {
+ setPasswordDialog(notEmptyCallback: callback);
+ } else {
+ callback();
+ }
} else if (value.startsWith("AcceptSessionsVia")) {
value = value.substring("AcceptSessionsVia".length);
if (value == "Password") {
diff --git a/libs/scrap/src/common/codec.rs b/libs/scrap/src/common/codec.rs
index 9fbcae2cd..4ef69181e 100644
--- a/libs/scrap/src/common/codec.rs
+++ b/libs/scrap/src/common/codec.rs
@@ -21,7 +21,7 @@ use crate::{
use hbb_common::{
anyhow::anyhow,
bail,
- config::{keys::OPTION_ENABLE_HWCODEC, option2bool, Config, PeerConfig},
+ config::{option2bool, Config, PeerConfig},
lazy_static, log,
message_proto::{
supported_decoding::PreferCodec, video_frame, Chroma, CodecAbility, EncodedVideoFrames,
@@ -836,6 +836,8 @@ impl Decoder {
#[cfg(any(feature = "hwcodec", feature = "mediacodec"))]
pub fn enable_hwcodec_option() -> bool {
+ use hbb_common::config::keys::OPTION_ENABLE_HWCODEC;
+
if cfg!(windows) || cfg!(target_os = "linux") || cfg!(target_os = "android") {
return option2bool(
OPTION_ENABLE_HWCODEC,
@@ -846,6 +848,8 @@ pub fn enable_hwcodec_option() -> bool {
}
#[cfg(feature = "vram")]
pub fn enable_vram_option(encode: bool) -> bool {
+ use hbb_common::config::keys::OPTION_ENABLE_HWCODEC;
+
if cfg!(windows) {
let enable = option2bool(
OPTION_ENABLE_HWCODEC,
diff --git a/src/lang/ar.rs b/src/lang/ar.rs
index 285df451b..808535f3e 100644
--- a/src/lang/ar.rs
+++ b/src/lang/ar.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/be.rs b/src/lang/be.rs
index 8fa8c535f..c76c20332 100644
--- a/src/lang/be.rs
+++ b/src/lang/be.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/bg.rs b/src/lang/bg.rs
index b2ab8edc8..8283a7dbd 100644
--- a/src/lang/bg.rs
+++ b/src/lang/bg.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ca.rs b/src/lang/ca.rs
index 77289e9a5..adf0975a2 100644
--- a/src/lang/ca.rs
+++ b/src/lang/ca.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/cn.rs b/src/lang/cn.rs
index d53088f94..05ccf7fd1 100644
--- a/src/lang/cn.rs
+++ b/src/lang/cn.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", "确定要取消双重认证吗?"),
+ ("cancel-bot-confirm-tip", "确定要取消 Telegram 机器人吗?"),
].iter().cloned().collect();
}
diff --git a/src/lang/cs.rs b/src/lang/cs.rs
index db7a063b9..be42f514f 100644
--- a/src/lang/cs.rs
+++ b/src/lang/cs.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram bot"),
("enable-bot-tip", "Pokud tuto funkci povolíte, můžete od svého bota obdržet kód 2FA. Může také fungovat jako oznámení o připojení."),
("enable-bot-desc", "1, Otevřete chat s @BotFather.\n2, Pošlete příkaz \"/newbot\". Po dokončení tohoto kroku obdržíte token.\n3, Spusťte chat s nově vytvořeným botem. Pro jeho aktivaci odešlete zprávu začínající lomítkem vpřed (\"/\"), například \"/hello\".\n"),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/da.rs b/src/lang/da.rs
index 4bc91708d..a68258b2f 100644
--- a/src/lang/da.rs
+++ b/src/lang/da.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/de.rs b/src/lang/de.rs
index d41591b61..3ed9a4039 100644
--- a/src/lang/de.rs
+++ b/src/lang/de.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram-Bot"),
("enable-bot-tip", "Wenn Sie diese Funktion aktivieren, können Sie den 2FA-Code von Ihrem Bot erhalten. Er kann auch als Verbindungsbenachrichtigung dienen."),
("enable-bot-desc", "1. Öffnen Sie einen Chat mit @BotFather.\n2. Senden Sie den Befehl \"/newbot\". Sie erhalten ein Token, nachdem Sie diesen Schritt abgeschlossen haben.\n3. Starten Sie einen Chat mit Ihrem neu erstellten Bot. Senden Sie eine Nachricht, die mit einem Schrägstrich (\"/\") beginnt, z. B. \"/hello\", um ihn zu aktivieren.\n"),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/el.rs b/src/lang/el.rs
index 974d5e7df..eab1c7c1b 100644
--- a/src/lang/el.rs
+++ b/src/lang/el.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/en.rs b/src/lang/en.rs
index 414ced371..020557245 100644
--- a/src/lang/en.rs
+++ b/src/lang/en.rs
@@ -229,5 +229,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("floating_window_tip", "It helps to keep RustDesk background service"),
("enable-bot-tip", "If you enable this feature, you can receive the 2FA code from your bot. It can also function as a connection notification."),
("enable-bot-desc", "1, Open a chat with @BotFather.\n2, Send the command \"/newbot\". You will receive a token after completing this step.\n3, Start a chat with your newly created bot. Send a message beginning with a forward slash (\"/\") like \"/hello\" to activate it.\n"),
+ ("cancel-2fa-confirm-tip", "Are you sure you want to cancel 2FA?"),
+ ("cancel-bot-confirm-tip", "Are you sure you want to cancel Telegram bot?"),
].iter().cloned().collect();
}
diff --git a/src/lang/eo.rs b/src/lang/eo.rs
index c99473558..733bc80ba 100644
--- a/src/lang/eo.rs
+++ b/src/lang/eo.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/es.rs b/src/lang/es.rs
index 793f678a0..ca2d99107 100644
--- a/src/lang/es.rs
+++ b/src/lang/es.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/et.rs b/src/lang/et.rs
index b1304bb37..43afea356 100644
--- a/src/lang/et.rs
+++ b/src/lang/et.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/fa.rs b/src/lang/fa.rs
index e69c4c1a0..df6fb7066 100644
--- a/src/lang/fa.rs
+++ b/src/lang/fa.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/fr.rs b/src/lang/fr.rs
index 3db65c93f..8ad0ca28a 100644
--- a/src/lang/fr.rs
+++ b/src/lang/fr.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/he.rs b/src/lang/he.rs
index ca781a6ce..91a1753bd 100644
--- a/src/lang/he.rs
+++ b/src/lang/he.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/hr.rs b/src/lang/hr.rs
index fc7b4756c..2cf6edb94 100644
--- a/src/lang/hr.rs
+++ b/src/lang/hr.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/hu.rs b/src/lang/hu.rs
index c355bba45..1009f2490 100644
--- a/src/lang/hu.rs
+++ b/src/lang/hu.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/id.rs b/src/lang/id.rs
index 46ba8a046..f051231b9 100644
--- a/src/lang/id.rs
+++ b/src/lang/id.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/it.rs b/src/lang/it.rs
index 8dc8c60ba..7f3e9804a 100644
--- a/src/lang/it.rs
+++ b/src/lang/it.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Bot Telgram"),
("enable-bot-tip", "If you enable this feature, you can receive the 2FA code from your bot. It can also function as a connection notification."),
("enable-bot-desc", "1, apri una chat con @BotFather.\n2, Invia il comando \"/newbot\", dopo aver completato questo passaggio riceverai un token.\n3, Avvia una chat con il tuo bot appena creato. Per attivarlo Invia un messaggio che inizia con una barra (\"/\") tipo \"/hello\".\n"),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ja.rs b/src/lang/ja.rs
index d317fa77b..33619dce1 100644
--- a/src/lang/ja.rs
+++ b/src/lang/ja.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ko.rs b/src/lang/ko.rs
index 0c749c5e2..56167b968 100644
--- a/src/lang/ko.rs
+++ b/src/lang/ko.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/kz.rs b/src/lang/kz.rs
index a46791475..f12bbf56a 100644
--- a/src/lang/kz.rs
+++ b/src/lang/kz.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/lt.rs b/src/lang/lt.rs
index 0512eb330..2d902966c 100644
--- a/src/lang/lt.rs
+++ b/src/lang/lt.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/lv.rs b/src/lang/lv.rs
index 0d540c9c2..65384bc93 100644
--- a/src/lang/lv.rs
+++ b/src/lang/lv.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/nb.rs b/src/lang/nb.rs
index 8a9fc90f4..4efdd3416 100644
--- a/src/lang/nb.rs
+++ b/src/lang/nb.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/nl.rs b/src/lang/nl.rs
index 88500aeaf..fce7668a0 100644
--- a/src/lang/nl.rs
+++ b/src/lang/nl.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram bot"),
("enable-bot-tip", "Als u deze functie inschakelt, kunt u een 2FA-code ontvangen van uw bot. Het kan ook fungeren als een verbindingsmelding."),
("enable-bot-desc", "1, Open een chat met @BotFather.\n2, Verzend het commando \"/newbot\". Als deze stap voltooid is, ontvang je een token.\n3, Start een chat met de nieuw aangemaakte bot. Om hem te activeren stuurt u een bericht dat begint met een schuine streep (\"/\"), bijvoorbeeld \"/hello\".\n"),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/pl.rs b/src/lang/pl.rs
index cede4f8b9..71ec07e73 100644
--- a/src/lang/pl.rs
+++ b/src/lang/pl.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs
index 053028376..3266ad2f6 100644
--- a/src/lang/pt_PT.rs
+++ b/src/lang/pt_PT.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs
index 8a9e71b3b..313296bed 100644
--- a/src/lang/ptbr.rs
+++ b/src/lang/ptbr.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ro.rs b/src/lang/ro.rs
index ddd9f5e4b..371c0ed63 100644
--- a/src/lang/ro.rs
+++ b/src/lang/ro.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ru.rs b/src/lang/ru.rs
index 3f8adaa4a..d05145cd2 100644
--- a/src/lang/ru.rs
+++ b/src/lang/ru.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram-бот"),
("enable-bot-tip", "Если включено, можно получать код двухфакторной аутентификации от бота. Он также может выполнять функцию уведомления о подключении."),
("enable-bot-desc", "1) Откройте чат с @BotFather.\n2) Отправьте команду \"/newbot\". После выполнения этого шага вы получите токен.\n3) Начните чат с вашим только что созданным ботом. Отправьте сообщение, начинающееся с прямой косой черты (\"/\"), например, \"/hello\", чтобы его активировать.\n"),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sk.rs b/src/lang/sk.rs
index 0c0bfd689..c7da58433 100644
--- a/src/lang/sk.rs
+++ b/src/lang/sk.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram bot"),
("enable-bot-tip", "Ak túto funkciu povolíte, kód 2FA môžete dostať od svojho bota. Môže fungovať aj ako upozornenie na pripojenie."),
("enable-bot-desc", "1, Otvorte chat s @BotFather.\n2, Odošlite príkaz \"/newbot\". Po dokončení tohto kroku dostanete token.\n3, Spustite chat s novo vytvoreným botom. Odošlite správu začínajúcu lomítkom vpred (\"/\"), napríklad \"/hello\", aby ste ho aktivovali.\n"),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sl.rs b/src/lang/sl.rs
index 450d880c4..6eda0b944 100755
--- a/src/lang/sl.rs
+++ b/src/lang/sl.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sq.rs b/src/lang/sq.rs
index e0f70d430..3767b20dd 100644
--- a/src/lang/sq.rs
+++ b/src/lang/sq.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sr.rs b/src/lang/sr.rs
index 6b15f651c..aee79c365 100644
--- a/src/lang/sr.rs
+++ b/src/lang/sr.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/sv.rs b/src/lang/sv.rs
index 0e456354f..6bbee4b19 100644
--- a/src/lang/sv.rs
+++ b/src/lang/sv.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/template.rs b/src/lang/template.rs
index b725f6322..787cadc01 100644
--- a/src/lang/template.rs
+++ b/src/lang/template.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/th.rs b/src/lang/th.rs
index 1203bc753..05bab55ee 100644
--- a/src/lang/th.rs
+++ b/src/lang/th.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/tr.rs b/src/lang/tr.rs
index 37a8b1f52..e7aab8d1a 100644
--- a/src/lang/tr.rs
+++ b/src/lang/tr.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/tw.rs b/src/lang/tw.rs
index 4e7fab39f..d2bb51b7f 100644
--- a/src/lang/tw.rs
+++ b/src/lang/tw.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/ua.rs b/src/lang/ua.rs
index 508823841..b08afc4b9 100644
--- a/src/lang/ua.rs
+++ b/src/lang/ua.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/lang/vn.rs b/src/lang/vn.rs
index d8a269bc2..daa0171bb 100644
--- a/src/lang/vn.rs
+++ b/src/lang/vn.rs
@@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
+ ("cancel-2fa-confirm-tip", ""),
+ ("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}
diff --git a/src/server/connection.rs b/src/server/connection.rs
index b45da7052..5fac698a1 100644
--- a/src/server/connection.rs
+++ b/src/server/connection.rs
@@ -1,8 +1,8 @@
use super::{input_service::*, *};
-#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
-use crate::clipboard_file::*;
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use crate::clipboard::update_clipboard;
+#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
+use crate::clipboard_file::*;
#[cfg(target_os = "android")]
use crate::keyboard::client::map_key_to_control_key;
#[cfg(target_os = "linux")]
@@ -1745,11 +1745,6 @@ impl Connection {
.await;
}
return true;
- } else if password::approve_mode() == ApproveMode::Password
- && !password::has_valid_password()
- {
- self.send_login_error("Connection not allowed").await;
- return false;
} else if self.is_recent_session(false) {
if err_msg.is_empty() {
#[cfg(target_os = "linux")]