mirror of
https://github.com/irssi/irssi.git
synced 2026-08-22 18:12:12 +02:00
refactoring
This commit is contained in:
parent
ea9e256954
commit
252829a9ad
1 changed files with 6 additions and 11 deletions
|
|
@ -121,6 +121,12 @@ static IRC_CHATNET_REC *network_setup_fill_rec(IRC_CHATNET_REC *rec, GHashTable
|
|||
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);
|
||||
|
||||
value = g_hash_table_lookup(optlist, "usermode");
|
||||
if (value != NULL && *value != '\0') rec->usermode = g_strdup(value);
|
||||
value = g_hash_table_lookup(optlist, "autosendcmd");
|
||||
|
|
@ -170,12 +176,6 @@ static void cmd_network_add(const char *data)
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
@ -214,11 +214,6 @@ static void cmd_network_modify(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);
|
||||
|
||||
rec = network_setup_fill_rec(rec, optlist);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue