1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-30 06:45:25 +00:00

Don't set the usermode field if blank

Fixes FS#919
This commit is contained in:
LemonBoy 2015-10-02 11:25:30 +02:00
parent fb6375c6f9
commit cfff402fe6
2 changed files with 13 additions and 4 deletions

View File

@ -35,10 +35,13 @@ void ircnet_create(IRC_CHATNET_REC *rec)
static void sig_chatnet_read(IRC_CHATNET_REC *rec, CONFIG_NODE *node)
{
char *value;
if (!IS_IRC_CHATNET(rec))
return;
rec->usermode = g_strdup(config_node_get_str(node, "usermode", NULL));
value = config_node_get_str(node, "usermode", NULL);
rec->usermode = (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);

View File

@ -48,12 +48,18 @@ static void sig_server_setup_fill_reconn(IRC_SERVER_CONNECT_REC *conn,
static void sig_server_setup_fill_connect(IRC_SERVER_CONNECT_REC *conn)
{
const char *value;
if (!IS_IRC_SERVER_CONNECT(conn))
return;
conn->alternate_nick = *settings_get_str("alternate_nick") != '\0' ?
g_strdup(settings_get_str("alternate_nick")) : NULL;
conn->usermode = g_strdup(settings_get_str("usermode"));
value = settings_get_str("alternate_nick");
conn->alternate_nick = (value != NULL && *value != '\0') ?
g_strdup(value) : NULL;
value = settings_get_str("usermode");
conn->usermode = (value != NULL && *value != '\0') ?
g_strdup(value) : NULL;
}
static void sig_server_setup_fill_chatnet(IRC_SERVER_CONNECT_REC *conn,