[evolution] I#44 - Use Thunderbird's autoconfig ISPDB directly, not its copy
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] I#44 - Use Thunderbird's autoconfig ISPDB directly, not its copy
- Date: Fri, 29 Jun 2018 10:03:16 +0000 (UTC)
commit 0273cc29d18cde99f76d07ba41124b0825ee9ecf
Author: Milan Crha <mcrha redhat com>
Date: Fri Jun 29 12:03:59 2018 +0200
I#44 - Use Thunderbird's autoconfig ISPDB directly, not its copy
Closes https://gitlab.gnome.org/GNOME/evolution/issues/44
src/mail/e-mail-autoconfig.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/mail/e-mail-autoconfig.c b/src/mail/e-mail-autoconfig.c
index 1b321c8283..3464936974 100644
--- a/src/mail/e-mail-autoconfig.c
+++ b/src/mail/e-mail-autoconfig.c
@@ -75,8 +75,7 @@
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MAIL_AUTOCONFIG, EMailAutoconfigPrivate))
-#define AUTOCONFIG_BASE_URI \
- "https://api.gnome.org/evolution/autoconfig/1.1/"
+#define AUTOCONFIG_BASE_URI "https://autoconfig.thunderbird.net/v1.1/"
#define ERROR_IS_NOT_FOUND(error) \
(g_error_matches ((error), SOUP_HTTP_ERROR, SOUP_STATUS_NOT_FOUND))
@@ -405,8 +404,23 @@ mail_autoconfig_lookup (EMailAutoconfig *autoconfig,
uri = g_strconcat (AUTOCONFIG_BASE_URI, domain, NULL);
soup_message = soup_message_new (SOUP_METHOD_GET, uri);
+
+ if (!soup_message) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+ _("Invalid URI: ā%sā"), uri);
+
+ g_object_unref (soup_session);
+ g_free (uri);
+
+ return FALSE;
+ }
+
g_free (uri);
+ soup_message_headers_append (
+ soup_message->request_headers,
+ "User-Agent", "Evolution/" VERSION VERSION_SUBSTRING " " VERSION_COMMENT);
+
if (G_IS_CANCELLABLE (cancellable))
cancel_id = g_cancellable_connect (
cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]