diff options
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/server-setup.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/irc/core/server-setup.c b/src/irc/core/server-setup.c index c7c39236..603d7142 100644 --- a/src/irc/core/server-setup.c +++ b/src/irc/core/server-setup.c @@ -357,11 +357,16 @@ static void read_servers(void) } } -void servers_setup_init(void) +static void read_settings(void) { + g_free_and_null(source_host_ip); + source_host_ok = FALSE; - source_host_ip = NULL; + get_source_host_ip(); +} +void servers_setup_init(void) +{ settings_add_int("server", "server_reconnect_time", 300); settings_add_str("server", "hostname", ""); settings_add_bool("server", "skip_motd", FALSE); @@ -377,15 +382,22 @@ void servers_setup_init(void) settings_add_str("ircproxy", "proxy_string", "CONNECT %s %d"); init_userinfo(); - read_servers(); + + source_host_ip = NULL; + read_settings(); + + signal_add("setup changed", (SIGNAL_FUNC) read_settings); signal_add("setup reread", (SIGNAL_FUNC) read_servers); } void servers_setup_deinit(void) { + g_free_not_null(source_host_ip); + while (setupservers != NULL) setupserver_destroy(setupservers->data); + signal_remove("setup changed", (SIGNAL_FUNC) read_settings); signal_remove("setup reread", (SIGNAL_FUNC) read_servers); } |