From d971c0292082823182f333a412207a9a8f6ad008 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 17 Jun 2017 17:01:42 +0200 Subject: Allow the user to clear the sasl-related fields There was no easy way for the user to disable the SASL authentication or to clear the username/password once the network was created. Closes #718 --- src/fe-common/irc/fe-ircnet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fe-common/irc') diff --git a/src/fe-common/irc/fe-ircnet.c b/src/fe-common/irc/fe-ircnet.c index b70a9ea7..24dad63f 100644 --- a/src/fe-common/irc/fe-ircnet.c +++ b/src/fe-common/irc/fe-ircnet.c @@ -163,11 +163,11 @@ static void cmd_network_add_modify(const char *data, gboolean add) /* the validity of the parameters is checked in sig_server_setup_fill_chatnet */ value = g_hash_table_lookup(optlist, "sasl_mechanism"); - if (value != NULL && *value != '\0') rec->sasl_mechanism = g_strdup(value); + if (value != NULL) rec->sasl_mechanism = *value != '\0' ? g_strdup(value) : NULL; value = g_hash_table_lookup(optlist, "sasl_username"); - if (value != NULL && *value != '\0') rec->sasl_username = g_strdup(value); + if (value != NULL) rec->sasl_username = *value != '\0' ? g_strdup(value) : NULL; value = g_hash_table_lookup(optlist, "sasl_password"); - if (value != NULL && *value != '\0') rec->sasl_password = g_strdup(value); + if (value != NULL) rec->sasl_password = *value != '\0' ? g_strdup(value) : NULL; ircnet_create(rec); printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, IRCTXT_NETWORK_ADDED, name); -- cgit v1.2.3