From a86f7ef7d71a73ac74ae27e1e53eaf47ce4553cf Mon Sep 17 00:00:00 2001 From: Jari Matilainen Date: Thu, 28 Jan 2016 15:05:28 +0100 Subject: [PATCH] Code ended up in wrong place during refactoring --- src/fe-common/core/fe-channels.c | 8 ++------ src/fe-common/core/fe-server.c | 5 ----- src/fe-common/irc/fe-ircnet.c | 13 ++++++------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 9ca1a056..263f44f7 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -250,8 +250,6 @@ static CHANNEL_SETUP_REC *channel_setup_fill_rec(CHANNEL_SETUP_REC *rec, GHashTa { char *botarg, *botcmdarg; - g_return_if_fail(rec != NULL); - botarg = g_hash_table_lookup(optlist, "bots"); botcmdarg = g_hash_table_lookup(optlist, "botcmd"); @@ -302,7 +300,6 @@ static void cmd_channel_add(const char *data) if (*password != '\0' && g_strcmp0(password, "-") != 0) rec->password = g_strdup(password); rec = channel_setup_fill_rec(rec, optlist); - channel_setup_create(rec); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CHANSETUP_ADDED, channel, chatnet); @@ -336,16 +333,15 @@ static void cmd_channel_modify(const char *data) } rec = channel_setup_find(channel, chatnet); - if (rec == NULL) { + if (rec == NULL) printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CHANSETUP_NOT_FOUND, channel, chatnet); - } else { + else { if (g_hash_table_lookup(optlist, "bots")) g_free_and_null(rec->botmasks); if (g_hash_table_lookup(optlist, "botcmd")) g_free_and_null(rec->autosendcmd); if (*password != '\0') g_free_and_null(rec->password); if (*password != '\0' && g_strcmp0(password, "-") != 0) rec->password = g_strdup(password); rec = channel_setup_fill_rec(rec, optlist); - channel_setup_create(rec); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_CHANSETUP_MODIFIED, channel, chatnet); diff --git a/src/fe-common/core/fe-server.c b/src/fe-common/core/fe-server.c index 64e4b842..b1b199d1 100644 --- a/src/fe-common/core/fe-server.c +++ b/src/fe-common/core/fe-server.c @@ -107,7 +107,6 @@ static SERVER_SETUP_REC *create_server_setup(GHashTable *optlist) static SERVER_SETUP_REC *server_setup_fill_rec(SERVER_SETUP_REC *rec, GHashTable *optlist) { - g_return_if_fail(rec != NULL); char *value; if (g_hash_table_lookup(optlist, "6")) @@ -207,9 +206,7 @@ static void cmd_server_add(const char *data) if (*password != '\0' && g_strcmp0(password, "-") != 0) rec->password = g_strdup(password); rec = server_setup_fill_rec(rec, optlist); - signal_emit("server add fill", 2, rec, optlist); - server_setup_add(rec); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_SETUPSERVER_ADDED, addr, port); @@ -251,9 +248,7 @@ static void cmd_server_modify(const char *data) if (*password != '\0' && g_strcmp0(password, "-") != 0) rec->password = g_strdup(password); rec = server_setup_fill_rec(rec, optlist); - signal_emit("server modify fill", 2, rec, optlist); - server_setup_add(rec); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_SETUPSERVER_MODIFIED, addr, port); diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index 7c3ff6f3..10ebc968 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -92,8 +92,6 @@ static IRC_CHATNET_REC *network_setup_fill_rec(IRC_CHATNET_REC *rec, GHashTable { char *value; - g_return_if_fail(rec != NULL); - value = g_hash_table_lookup(optlist, "kicks"); if (value != NULL) rec->max_kicks = atoi(value); value = g_hash_table_lookup(optlist, "msgs"); @@ -170,13 +168,14 @@ static void cmd_network_add(const char *data) g_free_and_null(rec->own_host); rec->own_ip4 = rec->own_ip6 = NULL; } - if (g_hash_table_lookup(optlist, "usermode")) g_free_and_null(rec->usermode); - if (g_hash_table_lookup(optlist, "autosendcmd")) g_free_and_null(rec->autosendcmd); - if (g_hash_table_lookup(optlist, "sasl_mechanism")) g_free_and_null(rec->sasl_mechanism); - if (g_hash_table_lookup(optlist, "sasl_username")) g_free_and_null(rec->sasl_username); - if (g_hash_table_lookup(optlist, "sasl_password")) g_free_and_null(rec->sasl_password); } + if (g_hash_table_lookup(optlist, "usermode")) g_free_and_null(rec->usermode); + if (g_hash_table_lookup(optlist, "autosendcmd")) g_free_and_null(rec->autosendcmd); + if (g_hash_table_lookup(optlist, "sasl_mechanism")) g_free_and_null(rec->sasl_mechanism); + if (g_hash_table_lookup(optlist, "sasl_username")) g_free_and_null(rec->sasl_username); + if (g_hash_table_lookup(optlist, "sasl_password")) g_free_and_null(rec->sasl_password); + rec = network_setup_fill_rec(rec, optlist); ircnet_create(rec);