Skip to content

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

add display-name option for https://github.com/rustdesk/rustdesk-server-pro/issues/277

rustdesk8621b9343619
diff --git a/libs/hbb_common/src/config.rs b/libs/hbb_common/src/config.rs
index 711d5af37..88a24d1b3 100644
--- a/libs/hbb_common/src/config.rs
+++ b/libs/hbb_common/src/config.rs
@@ -2122,6 +2122,8 @@ pub mod keys {
pub const OPTION_DISABLE_GROUP_PANEL: &str = "disable-group-panel";
pub const OPTION_PRE_ELEVATE_SERVICE: &str = "pre-elevate-service";
+ pub const OPTION_DISPLAY_NAME: &str = "display-name";
+
// proxy settings
// The following options are not real keys, they are just used for custom client advanced settings.
// The real keys are in Config2::socks.
@@ -2185,6 +2187,8 @@ pub mod keys {
OPTION_KEEP_SCREEN_ON,
OPTION_DISABLE_GROUP_PANEL,
OPTION_PRE_ELEVATE_SERVICE,
+ OPTION_DISPLAY_NAME,
+ "remove-preset-password-warning",
];
// DEFAULT_SETTINGS, OVERWRITE_SETTINGS
pub const KEYS_SETTINGS: &[&str] = &[
diff --git a/src/client.rs b/src/client.rs
index c3fe10688..4c3f53b03 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -2019,11 +2019,15 @@ impl LoginConfigHandler {
} else {
(my_id, self.id.clone())
};
+ let mut display_name = LocalConfig::get_option(&config::keys::OPTION_DISPLAY_NAME);
+ if display_name.is_empty() {
+ display_name = crate::username();
+ }
let mut lr = LoginRequest {
username: pure_id,
password: password.into(),
my_id,
- my_name: crate::username(),
+ my_name: display_name,
option: self.get_option_message(true).into(),
session_id: self.session_id,
version: crate::VERSION.to_string(),