From 94adc5ef62521524e0cf0239ad18bf42b57d39cc Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 2 Jun 2000 22:55:20 +0000 Subject: /SET hostname didn't affect until restart. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@282 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/server-setup.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3