From 4865f91eb0553ab3880627bf7f49c769591c5f9e Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Sat, 11 Jul 2015 06:16:53 +0200
Subject: degesch: add "autoconnect" option for servers
---
degesch.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/degesch.c b/degesch.c
index 93ee71a..b4a1384 100644
--- a/degesch.c
+++ b/degesch.c
@@ -1538,6 +1538,10 @@ static struct config_schema g_config_server[] =
.comment = "OpenSSL CA bundle path",
.type = CONFIG_ITEM_STRING },
+ { .name = "autoconnect",
+ .comment = "Connect automatically on startup",
+ .type = CONFIG_ITEM_BOOLEAN,
+ .default_ = "on" },
{ .name = "autojoin",
.comment = "Channels to join on start",
.type = CONFIG_ITEM_STRING_ARRAY,
@@ -6451,9 +6455,9 @@ server_add (struct app_context *ctx,
config_schema_apply_to_object (g_config_server, subtree, s);
config_schema_call_changed (subtree);
- // Connect to the server ASAP
- // TODO: make this configurable ("autoconnect")
- poller_timer_set (&s->reconnect_tmr, 0);
+ if (get_config_boolean (s->config, "autoconnect"))
+ // Connect to the server ASAP
+ poller_timer_set (&s->reconnect_tmr, 0);
return s;
}
--
cgit v1.2.3-70-g09d2