degesch: connect _after_ starting the UI
This commit is contained in:
parent
6d0fff6a71
commit
b31104784c
11
degesch.c
11
degesch.c
@ -4306,6 +4306,7 @@ end:
|
|||||||
static bool
|
static bool
|
||||||
irc_connect (struct server *s, struct error **e)
|
irc_connect (struct server *s, struct error **e)
|
||||||
{
|
{
|
||||||
|
// TODO: connect asynchronously so that we don't freeze
|
||||||
struct app_context *ctx = s->ctx;
|
struct app_context *ctx = s->ctx;
|
||||||
|
|
||||||
const char *irc_host = get_config_string (ctx, "server.irc_host");
|
const char *irc_host = get_config_string (ctx, "server.irc_host");
|
||||||
@ -4747,14 +4748,8 @@ main (int argc, char *argv[])
|
|||||||
ctx.current_buffer = ctx.server.buffer;
|
ctx.current_buffer = ctx.server.buffer;
|
||||||
refresh_prompt (&ctx);
|
refresh_prompt (&ctx);
|
||||||
|
|
||||||
// TODO: connect asynchronously (first step towards multiple servers)
|
// Connect to the server ASAP
|
||||||
struct error *e = NULL;
|
poller_timer_set (&ctx.server.reconnect_tmr, 0);
|
||||||
if (!irc_connect (&ctx.server, &e))
|
|
||||||
{
|
|
||||||
buffer_send_error (&ctx, ctx.server.buffer, "%s", e->message);
|
|
||||||
error_free (e);
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
rl_startup_hook = init_readline;
|
rl_startup_hook = init_readline;
|
||||||
rl_catch_sigwinch = false;
|
rl_catch_sigwinch = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user