From f179296ec80b48af3ac9f0fa344a993af990446f Mon Sep 17 00:00:00 2001 From: selikhov Date: Sun, 4 Oct 2026 03:33:50 +0300 Subject: [PATCH] Never save a server with an empty nickname With the address alone enough, a server added where there is neither an imported identity's nickname nor a user name (Android has no USER) got an empty nickname, which servers refuse; the form used to demand one. It falls back to "Voelin user" now, editable under Advanced. Co-Authored-By: Claude Opus 5.5 --- crates/voelin-ui/src/servers.rs | 4 +++- docs/ui.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/voelin-ui/src/servers.rs b/crates/voelin-ui/src/servers.rs index 7df7241..14107db 100644 --- a/crates/voelin-ui/src/servers.rs +++ b/crates/voelin-ui/src/servers.rs @@ -113,7 +113,9 @@ impl App { .contains(&name.as_str()) }) .or_else(|| std::env::var("USER").or_else(|_| std::env::var("USERNAME")).ok()) - .unwrap_or_default() + // Servers refuse an empty nickname (Android has no user name). + .filter(|name| !name.trim().is_empty()) + .unwrap_or_else(|| "Voelin user".to_owned()) } /// Look up the gateway of a server that has none in DNS diff --git a/docs/ui.md b/docs/ui.md index 77e6784..6b570b8 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -209,7 +209,7 @@ an optional server password. *Advanced* (open when editing) has the rest, and empty fields there are filled in: the name is the address until the first connection, then the server's own name (`adopt_server_name`); the nickname is the default identity's (one imported from TeamSpeak keeps its -nickname there), else the system user's; the identity is the default one, +nickname there), else the system user's, else "Voelin user"; the identity is the default one, there is no default channel; the gateway is looked up in DNS when the server is saved without one and when it connects ([gateway-admin.md](gateway-admin.md#letting-voelin-find-the-gateway)),