summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-11 06:16:53 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-11 06:16:53 +0200
commit4865f91eb0553ab3880627bf7f49c769591c5f9e (patch)
tree83e2fa11bd6a4748b1a8c5e5f07d26a8ccb7d609
parent8ed93ae03e7d3dd14b97a5f42e949e7fad1ffe77 (diff)
downloadxK-4865f91eb0553ab3880627bf7f49c769591c5f9e.tar.gz
xK-4865f91eb0553ab3880627bf7f49c769591c5f9e.tar.xz
xK-4865f91eb0553ab3880627bf7f49c769591c5f9e.zip
degesch: add "autoconnect" option for servers
-rw-r--r--degesch.c10
1 files 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;
}