aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-09-29 06:48:31 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-09-29 06:48:31 +0800
commite023c17d5c4585474511f657bd3fcac1ee8963e3 (patch)
tree8e4558185bf0aad97cfc692ae14d9f09dc7c0f24
parentdf8634ddc8aedeeb471e1e1a6171a8ea102db61d (diff)
downloadgsoc2013-evolution-e023c17d5c4585474511f657bd3fcac1ee8963e3.tar.gz
gsoc2013-evolution-e023c17d5c4585474511f657bd3fcac1ee8963e3.tar.zst
gsoc2013-evolution-e023c17d5c4585474511f657bd3fcac1ee8963e3.zip
Use Camel to compare the urls rather than using e_url_equal which does all
2001-09-28 Jeffrey Stedfast <fejj@ximian.com> * mail-config.c (mail_config_get_account_by_transport_url): Use Camel to compare the urls rather than using e_url_equal which does all sorts of funky shit that may not work in every case. svn path=/trunk/; revision=13239
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-config.c35
2 files changed, 34 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 4d80c8986a..b297f0614e 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,11 @@
2001-09-28 Jeffrey Stedfast <fejj@ximian.com>
+ * mail-config.c (mail_config_get_account_by_transport_url): Use
+ Camel to compare the urls rather than using e_url_equal which does
+ all sorts of funky shit that may not work in every case.
+
+2001-09-28 Jeffrey Stedfast <fejj@ximian.com>
+
* mail-local.c (mail_local_provider_init): Setup the url_hash and
url_equal functions for the local provider.
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 512a760034..7372f664e3 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -1466,22 +1466,43 @@ const MailConfigAccount *
mail_config_get_account_by_transport_url (const char *transport_url)
{
const MailConfigAccount *account;
+ CamelProvider *provider;
+ CamelURL *transport;
GSList *l;
-
+
g_return_val_if_fail (transport_url != NULL, NULL);
-
+
+ provider = camel_session_get_provider (session, transport_url, NULL);
+ if (!provider)
+ return NULL;
+
+ transport = camel_url_new (transport_url, NULL);
+ if (!transport)
+ return NULL;
+
l = config->accounts;
while (l) {
account = l->data;
- if (account
- && account->transport
- && account->transport->url
- && e_url_equal (account->transport->url, transport_url))
- return account;
+
+ if (account && account->transport && account->transport->url) {
+ CamelURL *url;
+
+ url = camel_url_new (account->transport->url, NULL);
+ if (url && provider->url_equal (url, transport)) {
+ camel_url_free (url);
+ camel_url_free (transport);
+ return account;
+ }
+
+ if (url)
+ camel_url_free (url);
+ }
l = l->next;
}
+ camel_url_free (transport);
+
return NULL;
}