Skip to content
Snippets Groups Projects
Commit a7f7a7e3 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3324] Fix segfault when sending IAX account propertis only

parent dd28d9c6
Branches
No related tags found
No related merge requests found
...@@ -1323,8 +1323,11 @@ void show_account_window (account_t * a) { ...@@ -1323,8 +1323,11 @@ void show_account_window (account_t * a) {
/**************/ /**************/
response = gtk_dialog_run (GTK_DIALOG (dialog)); response = gtk_dialog_run (GTK_DIALOG (dialog));
// Update protocol in case it changed
proto = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox));
// If cancel button is pressed // If cancel button is pressed
if(response != GTK_RESPONSE_ACCEPT) { if(response == GTK_RESPONSE_CANCEL) {
gtk_widget_destroy (GTK_WIDGET(dialog)); gtk_widget_destroy (GTK_WIDGET(dialog));
return; return;
} }
...@@ -1332,9 +1335,7 @@ void show_account_window (account_t * a) { ...@@ -1332,9 +1335,7 @@ void show_account_window (account_t * a) {
// If accept button is // If accept button is
if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_RESOLVE_ONCE),
g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce)) ? "false": "true"));
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_ALIAS), g_strdup(ACCOUNT_ALIAS),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias)))); g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias))));
...@@ -1353,9 +1354,6 @@ void show_account_window (account_t * a) { ...@@ -1353,9 +1354,6 @@ void show_account_window (account_t * a) {
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_MAILBOX), g_strdup(ACCOUNT_MAILBOX),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox)))); g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox))));
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_REGISTRATION_EXPIRE),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(expireSpinBox))));
} }
...@@ -1363,6 +1361,14 @@ void show_account_window (account_t * a) { ...@@ -1363,6 +1361,14 @@ void show_account_window (account_t * a) {
if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_RESOLVE_ONCE),
g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce)) ? "false": "true"));
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_REGISTRATION_EXPIRE),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(expireSpinBox))));
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_ROUTE), g_strdup(ACCOUNT_ROUTE),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryRouteSet)))); g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryRouteSet))));
...@@ -1441,7 +1447,6 @@ void show_account_window (account_t * a) { ...@@ -1441,7 +1447,6 @@ void show_account_window (account_t * a) {
g_strdup(LOCAL_PORT), g_strdup(LOCAL_PORT),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox))));
}
/* Set new credentials if any */ /* Set new credentials if any */
DEBUG("Config: Setting credentials"); DEBUG("Config: Setting credentials");
...@@ -1464,6 +1469,8 @@ void show_account_window (account_t * a) { ...@@ -1464,6 +1469,8 @@ void show_account_window (account_t * a) {
dbus_set_number_of_credential(currentAccount, currentAccount->credential_information->len); dbus_set_number_of_credential(currentAccount, currentAccount->credential_information->len);
} }
} }
}
/** @todo Verify if it's the best condition to check */ /** @todo Verify if it's the best condition to check */
if (g_strcasecmp(currentAccount->accountID, "new") == 0) { if (g_strcasecmp(currentAccount->accountID, "new") == 0) {
dbus_add_account(currentAccount); dbus_add_account(currentAccount);
...@@ -1475,9 +1482,7 @@ void show_account_window (account_t * a) { ...@@ -1475,9 +1482,7 @@ void show_account_window (account_t * a) {
// Perpetuate changes to the deamon // Perpetuate changes to the deamon
codec_list_update_to_daemon (currentAccount); codec_list_update_to_daemon (currentAccount);
gtk_widget_destroy (GTK_WIDGET(dialog)); gtk_widget_destroy (GTK_WIDGET(dialog));
} }
GtkWidget* create_direct_ip_calls_tab (account_t **a) { GtkWidget* create_direct_ip_calls_tab (account_t **a) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment