diff options
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/channels-query.c | 7 | ||||
-rw-r--r-- | src/irc/core/irc-chatnets.c | 7 | ||||
-rw-r--r-- | src/irc/core/irc-chatnets.h | 1 | ||||
-rw-r--r-- | src/irc/core/irc-servers-setup.c | 5 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/irc/core/channels-query.c b/src/irc/core/channels-query.c index 857ebaf0..d7dadf04 100644 --- a/src/irc/core/channels-query.c +++ b/src/irc/core/channels-query.c @@ -119,21 +119,22 @@ static void query_remove_all(IRC_CHANNEL_REC *channel) int n; rec = channel->server->chanqueries; + if (rec == NULL) return; /* remove channel from query lists */ for (n = 0; n < CHANNEL_QUERIES; n++) rec->queries[n] = g_slist_remove(rec->queries[n], channel); rec->current_queries = g_slist_remove(rec->current_queries, channel); - query_check(channel->server); + if (!channel->server->disconnected) + query_check(channel->server); } static void sig_channel_destroyed(IRC_CHANNEL_REC *channel) { g_return_if_fail(channel != NULL); - if (IS_IRC_CHANNEL(channel) && !channel->server->disconnected && - !channel->synced) + if (IS_IRC_CHANNEL(channel)) query_remove_all(channel); } diff --git a/src/irc/core/irc-chatnets.c b/src/irc/core/irc-chatnets.c index 0796e0cb..98ce89c3 100644 --- a/src/irc/core/irc-chatnets.c +++ b/src/irc/core/irc-chatnets.c @@ -43,6 +43,9 @@ static void sig_chatnet_read(IRC_CHATNET_REC *rec, CONFIG_NODE *node) value = config_node_get_str(node, "usermode", NULL); rec->usermode = (value != NULL && *value != '\0') ? g_strdup(value) : NULL; + value = config_node_get_str(node, "alternate_nick", NULL); + rec->alternate_nick = (value != NULL && *value != '\0') ? g_strdup(value) : NULL; + rec->max_cmds_at_once = config_node_get_int(node, "cmdmax", 0); rec->cmd_queue_speed = config_node_get_int(node, "cmdspeed", 0); rec->max_query_chans = config_node_get_int(node, "max_query_chans", 0); @@ -65,6 +68,9 @@ static void sig_chatnet_saved(IRC_CHATNET_REC *rec, CONFIG_NODE *node) if (rec->usermode != NULL) iconfig_node_set_str(node, "usermode", rec->usermode); + if (rec->alternate_nick != NULL) + iconfig_node_set_str(node, "alternate_nick", rec->alternate_nick); + if (rec->max_cmds_at_once > 0) iconfig_node_set_int(node, "cmdmax", rec->max_cmds_at_once); if (rec->cmd_queue_speed > 0) @@ -93,6 +99,7 @@ static void sig_chatnet_destroyed(IRC_CHATNET_REC *rec) { if (IS_IRC_CHATNET(rec)) { g_free(rec->usermode); + g_free(rec->alternate_nick); g_free(rec->sasl_mechanism); g_free(rec->sasl_username); g_free(rec->sasl_password); diff --git a/src/irc/core/irc-chatnets.h b/src/irc/core/irc-chatnets.h index 2bb10fa9..3fd44472 100644 --- a/src/irc/core/irc-chatnets.h +++ b/src/irc/core/irc-chatnets.h @@ -18,6 +18,7 @@ struct _IRC_CHATNET_REC { #include "chatnet-rec.h" char *usermode; + char *alternate_nick; char *sasl_mechanism; char *sasl_username; diff --git a/src/irc/core/irc-servers-setup.c b/src/irc/core/irc-servers-setup.c index 6040d3a5..bae7d3b4 100644 --- a/src/irc/core/irc-servers-setup.c +++ b/src/irc/core/irc-servers-setup.c @@ -69,7 +69,10 @@ static void sig_server_setup_fill_chatnet(IRC_SERVER_CONNECT_REC *conn, return; g_return_if_fail(IS_IRCNET(ircnet)); - if (ircnet->nick != NULL) g_free_and_null(conn->alternate_nick); + if (ircnet->alternate_nick != NULL) { + g_free_and_null(conn->alternate_nick); + conn->alternate_nick = g_strdup(ircnet->alternate_nick); + } if (ircnet->usermode != NULL) { g_free_and_null(conn->usermode); conn->usermode = g_strdup(ircnet->usermode); |