require login for note (#13775)
Some checks failed
CI / ${{ matrix.job.target }} (${{ matrix.job.os }}) (map[os:ubuntu-24.04 target:x86_64-unknown-linux-gnu]) (push) Has been cancelled
Full Flutter CI / run-ci (push) Has been cancelled

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages 2025-12-20 16:51:25 +08:00 committed by GitHub
parent d6463f95b9
commit 4f2aea65ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 46 additions and 2 deletions

View File

@ -566,6 +566,13 @@ class _GeneralState extends State<_General> {
'note-at-conn-end-tip',
kOptionAllowAskForNoteAtEndOfConnection,
isServer: false,
optSetter: (key, value) async {
if (value && !gFFI.userModel.isLogin) {
final res = await loginDialog();
if (res != true) return;
}
await mainSetLocalBoolOption(key, value);
},
));
return _Card(title: 'Other', children: children);
}

View File

@ -790,6 +790,10 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
title: Text(translate('note-at-conn-end-tip')),
initialValue: _allowAskForNoteAtEndOfConnection,
onToggle: (v) async {
if (v && !gFFI.userModel.isLogin) {
final res = await loginDialog();
if (res != true) return;
}
await mainSetLocalBoolOption(
kOptionAllowAskForNoteAtEndOfConnection, v);
final newValue = mainGetLocalBoolOptionSync(

View File

@ -1081,7 +1081,8 @@ class FfiModel with ChangeNotifier {
if (displays.length == 1) {
bind.sessionSetSize(
sessionId: sessionId,
display: pi.currentDisplay == kAllDisplayValue ? 0 : pi.currentDisplay,
display:
pi.currentDisplay == kAllDisplayValue ? 0 : pi.currentDisplay,
width: displays[0].width,
height: displays[0].height,
);
@ -1100,6 +1101,11 @@ class FfiModel with ChangeNotifier {
void _queryAuditGuid(String peerId) async {
try {
if (bind
.sessionGetAuditServerSync(sessionId: sessionId, typ: "conn/active")
.isEmpty) {
return;
}
if (!mainGetLocalBoolOptionSync(
kOptionAllowAskForNoteAtEndOfConnection)) {
return;

View File

@ -539,7 +539,31 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Timeout in minutes", ""),
("auto_disconnect_option_tip", ""),
("Connection failed due to inactivity", ""),
("Check for software update on startupmật", ""),
("Check for software update on startup", ""),
("upgrade_rustdesk_server_pro_to_{}_tip", ""),
("pull_group_failed_tip", ""),
("Filter by intersection", ""),
("Remove wallpaper during incoming sessions", ""),
("Test", ""),
("display_is_plugged_out_msg", ""),
("No displays", ""),
("Open in new window", ""),
("Show displays as individual windows", ""),
("Use all my displays for the remote session", ""),
("selinux_tip", ""),
("Change view", ""),
("Big tiles", ""),
("Small tiles", ""),
("List", ""),
("Virtual display", ""),
("Plug out all", ""),
("True color (4:4:4)", ""),
("Enable blocking user input", ""),
("id_input_tip", ""),
("privacy_mode_impl_mag_tip", ""),
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
("input_source_1_tip", ""),
("input_source_2_tip", ""),

View File

@ -567,6 +567,9 @@ impl<T: InvokeUiSession> Session<T> {
}
pub fn get_audit_server(&self, typ: String) -> String {
if LocalConfig::get_option("access_token").is_empty() {
return "".to_owned();
}
crate::get_audit_server(
Config::get_option("api-server"),
Config::get_option("custom-rendezvous-server"),