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

[#3611] Get previous and current username in configuration panel

parent bf312a82
No related branches found
No related tags found
No related merge requests found
......@@ -1252,6 +1252,9 @@ void show_account_window (account_t * a) {
gchar * local_interface;
gchar * published_address;
gchar *previous_username, *current_username;
gboolean username_changed = FALSE;
currentAccount = a;
if (currentAccount == NULL) {
......@@ -1346,9 +1349,16 @@ void show_account_window (account_t * a) {
return;
}
gchar *key = g_strdup(ACCOUNT_USERNAME);
// Get username at loadtime to determine if it changed. If so, update authentication name accordingly
// if(g_hash_table_lookup_extended(currentAccount->properties, g_strdup(ACCOUNT_USERNAME), NULL, previous_username))
// If accept button is
if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) {
previous_username = (gchar *)g_hash_table_lookup(currentAccount->properties, g_strdup(ACCOUNT_USERNAME));
DEBUG("------------------------------ USERNAME BEFORE %s", previous_username);
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_ALIAS),
......@@ -1368,8 +1378,18 @@ void show_account_window (account_t * a) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_MAILBOX),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox))));
current_username = (gchar *)g_hash_table_lookup(currentAccount->properties, g_strdup(ACCOUNT_USERNAME));
DEBUG("------------------------------ USERNAME AFTER %s", current_username);
}
if(strcmp(previous_username, current_username) != 0)
username_changed = TRUE;
if(username_changed)
DEBUG("--------------------------------- CHANGED");
if (proto && strcmp (proto, "SIP") == 0) {
if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment