From 1efb9d888aff377d795afef05bd32a15700258bd Mon Sep 17 00:00:00 2001 From: Dane Jensen Date: Sat, 7 Mar 2026 17:28:13 -0800 Subject: [PATCH 1/5] Added an option to configure a server without automatically connecting to it on startup. --- crates/tiny/src/config.rs | 4 ++++ crates/tiny/src/main.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/crates/tiny/src/config.rs b/crates/tiny/src/config.rs index b045717b..1acf24cd 100644 --- a/crates/tiny/src/config.rs +++ b/crates/tiny/src/config.rs @@ -59,6 +59,10 @@ pub(crate) struct Server

{ #[serde(default)] pub(crate) pass: Option

, + /// Whether or not to auto-connect to the server + #[serde(default = true)] + pub(crate) autoconn: bool, + /// User name to be used in connection registration /// If it is not specified, the first nick will be used instead #[serde(default)] diff --git a/crates/tiny/src/main.rs b/crates/tiny/src/main.rs index 6cfc1541..13193c51 100644 --- a/crates/tiny/src/main.rs +++ b/crates/tiny/src/main.rs @@ -145,6 +145,10 @@ fn run( let mut clients: Vec = Vec::with_capacity(servers.len()); for server in servers.iter().cloned() { + if server.autoconn == false { + continue; + } + tui.new_server_tab(&server.addr, server.alias); let tls = server.tls; From a67b28117a82cafac439156c1bf72902f6ac589c Mon Sep 17 00:00:00 2001 From: Dane Jensen Date: Sat, 7 Mar 2026 18:02:11 -0800 Subject: [PATCH 2/5] Fixed compiler errors. --- crates/tiny/src/config.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/tiny/src/config.rs b/crates/tiny/src/config.rs index 1acf24cd..9a527eaa 100644 --- a/crates/tiny/src/config.rs +++ b/crates/tiny/src/config.rs @@ -60,7 +60,7 @@ pub(crate) struct Server

{ pub(crate) pass: Option

, /// Whether or not to auto-connect to the server - #[serde(default = true)] + #[serde(default = "true")] pub(crate) autoconn: bool, /// User name to be used in connection registration @@ -328,6 +328,7 @@ impl Config { port, tls, pass, + autoconn, user, realname, nicks, From 239e8c6e3508726eaaefacc34b27df20fdc080c8 Mon Sep 17 00:00:00 2001 From: Dane Jensen Date: Sat, 7 Mar 2026 18:25:38 -0800 Subject: [PATCH 3/5] Added documentation to config.yaml, and fixed compiler errors. --- crates/tiny/config.yml | 3 +++ crates/tiny/src/config.rs | 11 ++++++++--- crates/tiny/src/main.rs | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/tiny/config.yml b/crates/tiny/config.yml index 2ef594b6..8fd89fda 100644 --- a/crates/tiny/config.yml +++ b/crates/tiny/config.yml @@ -9,6 +9,9 @@ servers: realname: yourname nicks: [tiny_user] + # Whether or not to autoconnect to this server on startup. + # autoconnect: true + # Server alias to show in the tab line. # alias: OFTC diff --git a/crates/tiny/src/config.rs b/crates/tiny/src/config.rs index 9a527eaa..1ec774a1 100644 --- a/crates/tiny/src/config.rs +++ b/crates/tiny/src/config.rs @@ -60,8 +60,8 @@ pub(crate) struct Server

{ pub(crate) pass: Option

, /// Whether or not to auto-connect to the server - #[serde(default = "true")] - pub(crate) autoconn: bool, + #[serde(default = "default_true")] + pub(crate) autoconnect: bool, /// User name to be used in connection registration /// If it is not specified, the first nick will be used instead @@ -88,6 +88,10 @@ pub(crate) struct Server

{ pub(crate) sasl_auth: Option>, } +fn default_true() -> bool { + true +} + /// Similar to `Server`, but used when connecting via the `/connect` command. #[derive(Clone, Deserialize)] pub(crate) struct Defaults { @@ -328,7 +332,7 @@ impl Config { port, tls, pass, - autoconn, + autoconnect, user, realname, nicks, @@ -374,6 +378,7 @@ impl Config { port, tls, pass, + autoconnect, user, realname, nicks, diff --git a/crates/tiny/src/main.rs b/crates/tiny/src/main.rs index 13193c51..f0a28fe7 100644 --- a/crates/tiny/src/main.rs +++ b/crates/tiny/src/main.rs @@ -145,7 +145,7 @@ fn run( let mut clients: Vec = Vec::with_capacity(servers.len()); for server in servers.iter().cloned() { - if server.autoconn == false { + if server.autoconnect == false { continue; } From ebd64a6bc14e7c65a3661b71f2e9bbf175c0c436 Mon Sep 17 00:00:00 2001 From: Dane Jensen Date: Sat, 7 Mar 2026 18:41:04 -0800 Subject: [PATCH 4/5] Amended wording, fixed failing test. --- crates/tiny/config.yml | 2 +- crates/tiny/src/config.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/tiny/config.yml b/crates/tiny/config.yml index 8fd89fda..02c07236 100644 --- a/crates/tiny/config.yml +++ b/crates/tiny/config.yml @@ -9,7 +9,7 @@ servers: realname: yourname nicks: [tiny_user] - # Whether or not to autoconnect to this server on startup. + # Whether to auto-connect to this server on startup. # autoconnect: true # Server alias to show in the tab line. diff --git a/crates/tiny/src/config.rs b/crates/tiny/src/config.rs index 1ec774a1..6dbc403c 100644 --- a/crates/tiny/src/config.rs +++ b/crates/tiny/src/config.rs @@ -59,7 +59,7 @@ pub(crate) struct Server

{ #[serde(default)] pub(crate) pass: Option

, - /// Whether or not to auto-connect to the server + /// Whether to auto-connect to the server #[serde(default = "default_true")] pub(crate) autoconnect: bool, @@ -500,6 +500,7 @@ mod tests { port: 123, tls: false, pass: None, + autoconnect: true, user: None, realname: "".to_owned(), nicks: vec!["".to_owned()], From 155217486bb1e2ffe9949bf147acb321a84f89e7 Mon Sep 17 00:00:00 2001 From: Dane Jensen Date: Sat, 7 Mar 2026 19:03:52 -0800 Subject: [PATCH 5/5] Fixed documentation in config.yaml for autoconnect to follow established paradigm. --- crates/tiny/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/tiny/config.yml b/crates/tiny/config.yml index 02c07236..8e2b9777 100644 --- a/crates/tiny/config.yml +++ b/crates/tiny/config.yml @@ -9,8 +9,8 @@ servers: realname: yourname nicks: [tiny_user] - # Whether to auto-connect to this server on startup. - # autoconnect: true + # Whether to auto-connect to this server on startup. Default is true. + # autoconnect: false # Server alias to show in the tab line. # alias: OFTC