diff options
author | Sivaiah Nallagatla <snallagatla@novell.com> | 2004-05-26 18:32:44 +0800 |
---|---|---|
committer | Sivaiah Nallagatla <siva@src.gnome.org> | 2004-05-26 18:32:44 +0800 |
commit | 59fa5f51171e9954647acd1af23cd268d6d3c55d (patch) | |
tree | 5ab5d3b7a2562aaa243d7dd97c3694e8966f14fd /camel | |
parent | d45880ec8e75c015b7796bb9c8a4ee243677b738 (diff) | |
download | gsoc2013-evolution-59fa5f51171e9954647acd1af23cd268d6d3c55d.tar.gz gsoc2013-evolution-59fa5f51171e9954647acd1af23cd268d6d3c55d.tar.zst gsoc2013-evolution-59fa5f51171e9954647acd1af23cd268d6d3c55d.zip |
return NULL when there is no existing gw account with same uid
2004-05-25 Sivaiah Nallagatla <snallagatla@novell.com>
* providers/groupwise/camel-gw-listener.c (lookup_account_info):
return NULL when there is no existing gw account with same uid
svn path=/trunk/; revision=26099
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 5 | ||||
-rw-r--r-- | camel/providers/groupwise/camel-gw-listener.c | 21 |
2 files changed, 17 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 89e2fbd073..a6fa3c160d 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2004-05-25 Sivaiah Nallagatla <snallagatla@novell.com> + + * providers/groupwise/camel-gw-listener.c (lookup_account_info): + return NULL when there is no existing gw account with same uid + 2004-05-25 Not Zed <NotZed@Ximian.com> * camel-store.c (camel_folder_info_build_path): removed. diff --git a/camel/providers/groupwise/camel-gw-listener.c b/camel/providers/groupwise/camel-gw-listener.c index af1acdfa59..a88b70ffcd 100644 --- a/camel/providers/groupwise/camel-gw-listener.c +++ b/camel/providers/groupwise/camel-gw-listener.c @@ -146,12 +146,13 @@ lookup_account_info (const char *key) for (list = g_list_first (groupwise_accounts); list; list = g_list_next (list)) { info = (GwAccountInfo *) (list->data); - found = strcmp (info->uid, key) == 0; + found = (strcmp (info->uid, key) == 0); if (found) break; } - - return info; + if (found) + return info; + return NULL; } @@ -608,8 +609,9 @@ account_changed (EAccountList *account_listener, EAccount *account) GwAccountInfo *existing_account_info; is_gw_account = is_groupwise_account (account); + existing_account_info = lookup_account_info (account->uid); - + if (existing_account_info == NULL && is_gw_account) { /* some account of other type is changed to Groupwise */ account_added (account_listener, account); @@ -628,16 +630,16 @@ account_changed (EAccountList *account_listener, EAccount *account) } else if ( existing_account_info != NULL && is_gw_account ) { /* some info of groupwise account is changed . update the sources with new info if required */ + url = camel_url_new (existing_account_info->source_url, NULL); + old_relative_uri = g_strdup_printf ("%s@%s/", url->user, url->host); + camel_url_free (url); + url = camel_url_new (account->source->url, NULL); soap_port = camel_url_get_param (url, "soap_port"); if (!soap_port || strlen (soap_port) == 0) soap_port = "7181"; relative_uri = g_strdup_printf ("%s@%s/", url->user, url->host); - camel_url_free (url); - url = camel_url_new (existing_account_info->source_url, NULL); - old_relative_uri = g_strdup_printf ("%s@%s/", url->user, url->host); - camel_url_free (url); - + if (strcmp (existing_account_info->name, account->name) != 0 || strcmp (relative_uri, old_relative_uri) != 0) { @@ -652,6 +654,7 @@ account_changed (EAccountList *account_listener, EAccount *account) g_free (old_relative_uri); } + camel_url_free (url); } |