[evolution] Bug 749974 - Use OAuth2 for Google sources
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 749974 - Use OAuth2 for Google sources
- Date: Mon, 21 Sep 2015 13:38:16 +0000 (UTC)
commit ea0f25c5c78f10e749f1ce12c479e0d39d887cec
Author: Milan Crha <mcrha redhat com>
Date: Mon Sep 21 15:38:12 2015 +0200
Bug 749974 - Use OAuth2 for Google sources
libemail-engine/Makefile.am | 2 +
libemail-engine/camel-sasl-oauth2-google.c | 118 ++++++++++++++++++++
libemail-engine/camel-sasl-oauth2-google.h | 65 +++++++++++
libemail-engine/e-mail-session.c | 6 +-
.../evolution-book-config-google.c | 2 +-
modules/cal-config-google/e-cal-config-google.c | 21 +++-
modules/cal-config-google/e-cal-config-gtasks.c | 17 +++-
.../cal-config-google/e-google-chooser-button.c | 26 +++-
modules/mail-config/e-mail-config-google-summary.c | 66 ++++++------
po/POTFILES.in | 1 +
10 files changed, 276 insertions(+), 48 deletions(-)
---
diff --git a/libemail-engine/Makefile.am b/libemail-engine/Makefile.am
index c8ecb91..db6acf2 100644
--- a/libemail-engine/Makefile.am
+++ b/libemail-engine/Makefile.am
@@ -32,6 +32,7 @@ libmailengineincludedir = $(privincludedir)/libemail-engine
libmailengineinclude_HEADERS = \
libemail-engine.h \
camel-null-store.h \
+ camel-sasl-oauth2-google.h \
camel-sasl-xoauth2.h \
e-mail-engine-enums.h \
e-mail-engine-enumtypes.h \
@@ -55,6 +56,7 @@ libmailengineinclude_HEADERS = \
libemail_engine_la_SOURCES = \
$(libmailengineinclude_HEADERS) \
camel-null-store.c \
+ camel-sasl-oauth2-google.c \
camel-sasl-xoauth2.c \
e-mail-engine-enumtypes.c \
e-mail-folder-utils.c \
diff --git a/libemail-engine/camel-sasl-oauth2-google.c b/libemail-engine/camel-sasl-oauth2-google.c
new file mode 100644
index 0000000..1275c62
--- /dev/null
+++ b/libemail-engine/camel-sasl-oauth2-google.c
@@ -0,0 +1,118 @@
+/*
+ * camel-sasl-oauth2-google.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib/gi18n-lib.h>
+
+#include "camel-sasl-oauth2-google.h"
+
+#include <libemail-engine/e-mail-session.h>
+
+static CamelServiceAuthType sasl_oauth2_google_auth_type = {
+ N_("OAuth2 Google"),
+ N_("This option will use an OAuth 2.0 "
+ "access token to connect to the Google server"),
+ "Google",
+ TRUE
+};
+
+G_DEFINE_TYPE (CamelSaslOAuth2Google, camel_sasl_oauth2_google, CAMEL_TYPE_SASL)
+
+static void
+sasl_oauth2_google_append_request (GByteArray *byte_array,
+ const gchar *user,
+ const gchar *access_token)
+{
+ GString *request;
+
+ g_return_if_fail (user != NULL);
+ g_return_if_fail (access_token != NULL);
+
+ /* Compared to OAuth 1.0, this step is trivial. */
+
+ /* The request is easier to assemble with a GString. */
+ request = g_string_sized_new (512);
+
+ g_string_append (request, "user=");
+ g_string_append (request, user);
+ g_string_append_c (request, 1);
+ g_string_append (request, "auth=Bearer ");
+ g_string_append (request, access_token);
+ g_string_append_c (request, 1);
+ g_string_append_c (request, 1);
+
+ /* Copy the GString content to the GByteArray. */
+ g_byte_array_append (
+ byte_array, (guint8 *) request->str, request->len);
+
+ g_string_free (request, TRUE);
+}
+
+static GByteArray *
+sasl_oauth2_google_challenge_sync (CamelSasl *sasl,
+ GByteArray *token,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GByteArray *byte_array = NULL;
+ CamelService *service;
+ CamelSettings *settings;
+ gchar *access_token = NULL;
+
+ service = camel_sasl_get_service (sasl);
+ settings = camel_service_ref_settings (service);
+ access_token = camel_service_dup_password (service);
+
+ if (access_token) {
+ CamelNetworkSettings *network_settings;
+ gchar *user;
+
+ network_settings = CAMEL_NETWORK_SETTINGS (settings);
+ user = camel_network_settings_dup_user (network_settings);
+
+ byte_array = g_byte_array_new ();
+ sasl_oauth2_google_append_request (byte_array, user, access_token);
+
+ g_free (user);
+ }
+
+ g_free (access_token);
+
+ g_object_unref (settings);
+
+ /* IMAP and SMTP services will Base64-encode the request. */
+
+ return byte_array;
+}
+
+static void
+camel_sasl_oauth2_google_class_init (CamelSaslOAuth2GoogleClass *class)
+{
+ CamelSaslClass *sasl_class;
+
+ sasl_class = CAMEL_SASL_CLASS (class);
+ sasl_class->auth_type = &sasl_oauth2_google_auth_type;
+ sasl_class->challenge_sync = sasl_oauth2_google_challenge_sync;
+}
+
+static void
+camel_sasl_oauth2_google_init (CamelSaslOAuth2Google *sasl)
+{
+}
diff --git a/libemail-engine/camel-sasl-oauth2-google.h b/libemail-engine/camel-sasl-oauth2-google.h
new file mode 100644
index 0000000..6765bb4
--- /dev/null
+++ b/libemail-engine/camel-sasl-oauth2-google.h
@@ -0,0 +1,65 @@
+/*
+ * camel-sasl-oauth2-google.h
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if !defined (__LIBEMAIL_ENGINE_H_INSIDE__) && !defined (LIBEMAIL_ENGINE_COMPILATION)
+#error "Only <libemail-engine/libemail-engine.h> should be included directly."
+#endif
+
+#ifndef CAMEL_SASL_OAUTH2_GOOGLE_H
+#define CAMEL_SASL_OAUTH2_GOOGLE_H
+
+#include <camel/camel.h>
+
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_OAUTH2_GOOGLE \
+ (camel_sasl_oauth2_google_get_type ())
+#define CAMEL_SASL_OAUTH2_GOOGLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_SASL_OAUTH2_GOOGLE, CamelSaslOAuth2Google))
+#define CAMEL_SASL_OAUTH2_GOOGLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), CAMEL_TYPE_SASL_OAUTH2_GOOGLE, CamelSaslOAuth2GoogleClass))
+#define CAMEL_IS_SASL_OAUTH2_GOOGLE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_SASL_OAUTH2_GOOGLE))
+#define CAMEL_IS_SASL_OAUTH2_GOOGLE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), CAMEL_TYPE_SASL_OAUTH2_GOOGLE))
+#define CAMEL_SASL_OAUTH2_GOOGLE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_SASL_OAUTH2_GOOGLE, CamelSaslOAuth2GoogleClass))
+
+G_BEGIN_DECLS
+
+typedef struct _CamelSaslOAuth2Google CamelSaslOAuth2Google;
+typedef struct _CamelSaslOAuth2GoogleClass CamelSaslOAuth2GoogleClass;
+typedef struct _CamelSaslOAuth2GooglePrivate CamelSaslOAuth2GooglePrivate;
+
+struct _CamelSaslOAuth2Google {
+ CamelSasl parent;
+ CamelSaslOAuth2GooglePrivate *priv;
+};
+
+struct _CamelSaslOAuth2GoogleClass {
+ CamelSaslClass parent_class;
+};
+
+GType camel_sasl_oauth2_google_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* CAMEL_SASL_OAUTH2_GOOGLE_H */
diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c
index 97d3e81..2277ad6 100644
--- a/libemail-engine/e-mail-session.c
+++ b/libemail-engine/e-mail-session.c
@@ -48,8 +48,9 @@
/* This is our hack, not part of libcamel. */
#include "camel-null-store.h"
-/* This too, though it's less of a hack. */
+/* These too, though it's less of a hack. */
#include "camel-sasl-xoauth2.h"
+#include "camel-sasl-oauth2-google.h"
#include "e-mail-session.h"
#include "e-mail-folder-utils.h"
@@ -1616,8 +1617,9 @@ e_mail_session_class_init (EMailSessionClass *class)
/* Make sure ESourceCamel picks up the "none" provider. */
e_source_camel_generate_subtype ("none", CAMEL_TYPE_SETTINGS);
- /* Make sure CamelSasl picks up the XOAUTH2 mechanism. */
+ /* Make sure CamelSasl picks up our mechanisms. */
g_type_ensure (CAMEL_TYPE_SASL_XOAUTH2);
+ g_type_ensure (CAMEL_TYPE_SASL_OAUTH2_GOOGLE);
}
static void
diff --git a/modules/book-config-google/evolution-book-config-google.c
b/modules/book-config-google/evolution-book-config-google.c
index 13c3963..864e3b1 100644
--- a/modules/book-config-google/evolution-book-config-google.c
+++ b/modules/book-config-google/evolution-book-config-google.c
@@ -105,7 +105,7 @@ book_config_google_commit_changes (ESourceConfigBackend *backend,
!e_source_has_extension (collection_source, E_SOURCE_EXTENSION_GOA) &&
!e_source_has_extension (collection_source, E_SOURCE_EXTENSION_UOA))) {
e_source_authentication_set_host (extension, "www.google.com");
- e_source_authentication_set_method (extension, "ClientLogin");
+ e_source_authentication_set_method (extension, "Google");
}
user = e_source_authentication_get_user (extension);
diff --git a/modules/cal-config-google/e-cal-config-google.c b/modules/cal-config-google/e-cal-config-google.c
index 97fe87f..dce7c17 100644
--- a/modules/cal-config-google/e-cal-config-google.c
+++ b/modules/cal-config-google/e-cal-config-google.c
@@ -102,6 +102,8 @@ cal_config_google_commit_changes (ESourceConfigBackend *backend,
{
ESourceBackend *calendar_extension;
ESourceWebdav *webdav_extension;
+ ESourceAuthentication *authentication_extension;
+ gboolean can_google_auth;
SoupURI *soup_uri;
/* We need to hard-code a few settings. */
@@ -112,12 +114,28 @@ cal_config_google_commit_changes (ESourceConfigBackend *backend,
webdav_extension = e_source_get_extension (
scratch_source, E_SOURCE_EXTENSION_WEBDAV_BACKEND);
+ authentication_extension = e_source_get_extension (
+ scratch_source, E_SOURCE_EXTENSION_AUTHENTICATION);
+
+ can_google_auth = e_source_credentials_google_is_supported () &&
+ g_strcmp0 (e_source_authentication_get_method (authentication_extension), "OAuth2")
!= 0;
+
/* The backend name is actually "caldav" even though the
* ESource is a child of the built-in "Google" source. */
e_source_backend_set_backend_name (calendar_extension, "caldav");
soup_uri = e_source_webdav_dup_soup_uri (webdav_extension);
+ if (can_google_auth || g_strcmp0 (e_source_authentication_get_method (authentication_extension),
"Google") == 0) {
+ /* Prefer 'Google', aka internal OAuth2, authentication method, if available */
+ e_source_authentication_set_method (authentication_extension, "Google");
+
+ /* See https://developers.google.com/google-apps/calendar/caldav/v2/guide */
+ soup_uri_set_host (soup_uri, "apidata.googleusercontent.com");
+ } else {
+ soup_uri_set_host (soup_uri, "www.google.com");
+ }
+
if (!soup_uri->path || !*soup_uri->path || g_strcmp0 (soup_uri->path, "/") == 0) {
ESourceAuthentication *authentication_extension
= e_source_get_extension (scratch_source, E_SOURCE_EXTENSION_AUTHENTICATION);
@@ -127,9 +145,6 @@ cal_config_google_commit_changes (ESourceConfigBackend *backend,
e_source_authentication_get_user (authentication_extension));
}
- /* The host name is fixed, obviously. */
- soup_uri_set_host (soup_uri, "www.google.com");
-
/* Google's CalDAV interface requires a secure connection. */
soup_uri_set_scheme (soup_uri, SOUP_URI_SCHEME_HTTPS);
diff --git a/modules/cal-config-google/e-cal-config-gtasks.c b/modules/cal-config-google/e-cal-config-gtasks.c
index 5de0d17..49e3717 100644
--- a/modules/cal-config-google/e-cal-config-gtasks.c
+++ b/modules/cal-config-google/e-cal-config-gtasks.c
@@ -51,7 +51,10 @@ cal_config_gtasks_allow_creation (ESourceConfigBackend *backend)
return FALSE;
source = e_source_config_get_original_source (config);
- if (!source || !e_source_has_extension (source, E_SOURCE_EXTENSION_TASK_LIST))
+ if (!source && e_source_credentials_google_is_supported ())
+ return TRUE;
+
+ if (!e_source_has_extension (source, E_SOURCE_EXTENSION_TASK_LIST))
return FALSE;
task_list = e_source_get_extension (source, E_SOURCE_EXTENSION_TASK_LIST);
@@ -90,15 +93,25 @@ static void
cal_config_gtasks_commit_changes (ESourceConfigBackend *backend,
ESource *scratch_source)
{
+ ESource *collection_source;
+ ESourceConfig *config;
ESourceAuthentication *extension;
const gchar *extension_name;
const gchar *user;
+ config = e_source_config_backend_get_config (backend);
+ collection_source = e_source_config_get_collection_source (config);
+
extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
extension = e_source_get_extension (scratch_source, extension_name);
e_source_authentication_set_host (extension, "www.google.com");
- e_source_authentication_set_method (extension, "OAuth2");
+
+ if (!collection_source || (
+ !e_source_has_extension (collection_source, E_SOURCE_EXTENSION_GOA) &&
+ !e_source_has_extension (collection_source, E_SOURCE_EXTENSION_UOA))) {
+ e_source_authentication_set_method (extension, "Google");
+ }
user = e_source_authentication_get_user (extension);
g_return_if_fail (user != NULL);
diff --git a/modules/cal-config-google/e-google-chooser-button.c
b/modules/cal-config-google/e-google-chooser-button.c
index f56612a..653bcad 100644
--- a/modules/cal-config-google/e-google-chooser-button.c
+++ b/modules/cal-config-google/e-google-chooser-button.c
@@ -22,8 +22,6 @@
#include <libedataserverui/libedataserverui.h>
-#define CALDAV_EVENTS_PATH_FORMAT "/calendar/dav/%s/events"
-
#define E_GOOGLE_CHOOSER_BUTTON_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_GOOGLE_CHOOSER_BUTTON, EGoogleChooserButtonPrivate))
@@ -183,6 +181,7 @@ google_chooser_button_clicked (GtkButton *button)
GtkDialog *dialog;
gulong handler_id;
guint supports_filter = 0;
+ gboolean can_google_auth;
const gchar *title = NULL;
priv = E_GOOGLE_CHOOSER_BUTTON_GET_PRIVATE (button);
@@ -196,11 +195,23 @@ google_chooser_button_clicked (GtkButton *button)
webdav_extension = e_source_get_extension (priv->source, E_SOURCE_EXTENSION_WEBDAV_BACKEND);
uri = e_source_webdav_dup_soup_uri (webdav_extension);
+ can_google_auth = e_source_credentials_google_is_supported () &&
+ g_strcmp0 (e_source_authentication_get_method (authentication_extension), "OAuth2")
!= 0;
e_google_chooser_button_construct_default_uri (uri, e_source_authentication_get_user
(authentication_extension));
- /* The host name is fixed, obviously. */
- soup_uri_set_host (uri, "www.google.com");
+ if (can_google_auth) {
+ /* Prefer 'Google', aka internal OAuth2, authentication method, if available */
+ e_source_authentication_set_method (authentication_extension, "Google");
+
+ /* See https://developers.google.com/google-apps/calendar/caldav/v2/guide */
+ soup_uri_set_host (uri, "apidata.googleusercontent.com");
+ soup_uri_set_path (uri, "/caldav/v2/");
+ } else {
+ soup_uri_set_host (uri, "www.google.com");
+ /* To find also calendar email, not only calendars */
+ soup_uri_set_path (uri, "/calendar/dav/");
+ }
/* Google's CalDAV interface requires a secure connection. */
soup_uri_set_scheme (uri, SOUP_URI_SCHEME_HTTPS);
@@ -227,8 +238,6 @@ google_chooser_button_clicked (GtkButton *button)
prompter = e_credentials_prompter_new (registry);
e_credentials_prompter_set_auto_prompt (prompter, FALSE);
- /* To find also calendar email, not only calendars */
- soup_uri_set_path (uri, "/calendar/dav/");
base_url = soup_uri_to_string (uri, FALSE);
dialog = e_webdav_discover_dialog_new (parent, title, prompter, priv->source, base_url,
supports_filter);
@@ -436,7 +445,10 @@ e_google_chooser_button_construct_default_uri (SoupURI *soup_uri,
if (!decoded_user)
return;
- path = g_strdup_printf (CALDAV_EVENTS_PATH_FORMAT, decoded_user);
+ if (g_strcmp0 (soup_uri_get_host (soup_uri), "apidata.googleusercontent.com") == 0)
+ path = g_strdup_printf ("/caldav/v2/%s/events", decoded_user);
+ else
+ path = g_strdup_printf ("/calendar/dav/%s/events", decoded_user);
soup_uri_set_user (soup_uri, decoded_user);
soup_uri_set_path (soup_uri, path);
diff --git a/modules/mail-config/e-mail-config-google-summary.c
b/modules/mail-config/e-mail-config-google-summary.c
index 164aae4..cfae7f2 100644
--- a/modules/mail-config/e-mail-config-google-summary.c
+++ b/modules/mail-config/e-mail-config-google-summary.c
@@ -20,6 +20,7 @@
#include <config.h>
#include <glib/gi18n-lib.h>
+#include <libedataserver/libedataserver.h>
#include <mail/e-mail-config-summary-page.h>
#define E_MAIL_CONFIG_GOOGLE_SUMMARY_GET_PRIVATE(obj) \
@@ -29,17 +30,12 @@
#define GOOGLE_HELP_URI \
"http://support.google.com/mail/bin/answer.py?hl=en&answer=77695"
-/* Once EDS will directly support OAUTH2, this can be enabled/removed again */
-/* #define EDS_SUPPORTS_OAUTH2 */
-
struct _EMailConfigGoogleSummaryPrivate {
ESource *collection_source;
/* Widgets (not referenced) */
GtkWidget *calendar_toggle;
-#ifdef EDS_SUPPORTS_OAUTH2
GtkWidget *contacts_toggle;
-#endif
gboolean applicable;
};
@@ -135,12 +131,12 @@ mail_config_google_summary_commit_changes_cb (EMailConfigSummaryPage *page,
toggle_button = GTK_TOGGLE_BUTTON (extension->priv->calendar_toggle);
calendar_active = gtk_toggle_button_get_active (toggle_button);
-#ifdef EDS_SUPPORTS_OAUTH2
- toggle_button = GTK_TOGGLE_BUTTON (extension->priv->contacts_toggle);
- contacts_active = gtk_toggle_button_get_active (toggle_button);
-#else
- contacts_active = FALSE;
-#endif
+ if (e_source_credentials_google_is_supported ()) {
+ toggle_button = GTK_TOGGLE_BUTTON (extension->priv->contacts_toggle);
+ contacts_active = gtk_toggle_button_get_active (toggle_button);
+ } else {
+ contacts_active = FALSE;
+ }
/* If the user declined both Calendar and Contacts, do nothing. */
if (!calendar_active && !contacts_active)
@@ -161,6 +157,12 @@ mail_config_google_summary_commit_changes_cb (EMailConfigSummaryPage *page,
collection_extension = e_source_get_extension (source, extension_name);
e_source_collection_set_identity (collection_extension, user);
+ if (e_source_credentials_google_is_supported ()) {
+ auth_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_AUTHENTICATION);
+ e_source_authentication_set_user (auth_extension, user);
+ e_source_authentication_set_method (auth_extension, "Google");
+ }
+
/* All queued sources become children of the collection source. */
parent_uid = e_source_get_uid (source);
head = g_queue_peek_head_link (source_queue);
@@ -273,24 +275,23 @@ mail_config_google_summary_constructed (GObject *object)
extension->priv->calendar_toggle = widget; /* not referenced */
gtk_widget_show (widget);
-#ifdef EDS_SUPPORTS_OAUTH2
- text = _("Add Google Con_tacts to this account");
- widget = gtk_check_button_new_with_mnemonic (text);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
- gtk_widget_set_margin_left (widget, 12);
- gtk_grid_attach (GTK_GRID (container), widget, 0, 2, 1, 1);
- extension->priv->contacts_toggle = widget; /* not referenced */
- gtk_widget_show (widget);
-#endif
+ if (e_source_credentials_google_is_supported ()) {
+ text = _("Add Google Con_tacts to this account");
+ widget = gtk_check_button_new_with_mnemonic (text);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
+ gtk_widget_set_margin_left (widget, 12);
+ gtk_grid_attach (GTK_GRID (container), widget, 0, 2, 1, 1);
+ extension->priv->contacts_toggle = widget; /* not referenced */
+ gtk_widget_show (widget);
+ }
text = _("You may need to enable IMAP access");
widget = gtk_link_button_new_with_label (GOOGLE_HELP_URI, text);
gtk_widget_set_margin_left (widget, 12);
-#ifdef EDS_SUPPORTS_OAUTH2
- gtk_grid_attach (GTK_GRID (container), widget, 0, 3, 1, 1);
-#else
- gtk_grid_attach (GTK_GRID (container), widget, 0, 2, 1, 1);
-#endif
+ if (e_source_credentials_google_is_supported ())
+ gtk_grid_attach (GTK_GRID (container), widget, 0, 3, 1, 1);
+ else
+ gtk_grid_attach (GTK_GRID (container), widget, 0, 2, 1, 1);
gtk_widget_show (widget);
source = extension->priv->collection_source;
@@ -306,14 +307,13 @@ mail_config_google_summary_constructed (GObject *object)
collection_extension, "calendar-enabled",
G_BINDING_SYNC_CREATE);
-#ifdef EDS_SUPPORTS_OAUTH2
- e_binding_bind_property (
- extension->priv->contacts_toggle, "active",
- collection_extension, "contacts-enabled",
- G_BINDING_SYNC_CREATE);
-#else
- g_object_set (G_OBJECT (collection_extension), "contacts-enabled", FALSE, NULL);
-#endif
+ if (e_source_credentials_google_is_supported ())
+ e_binding_bind_property (
+ extension->priv->contacts_toggle, "active",
+ collection_extension, "contacts-enabled",
+ G_BINDING_SYNC_CREATE);
+ else
+ g_object_set (G_OBJECT (collection_extension), "contacts-enabled", FALSE, NULL);
}
static void
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c27ac9e..596a294 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -314,6 +314,7 @@ e-util/gal-view-instance-save-as-dialog.c
e-util/widgets.error.xml
evolution.appdata.xml.in
libemail-engine/camel-null-store.c
+libemail-engine/camel-sasl-oauth2-google.c
libemail-engine/camel-sasl-xoauth2.c
libemail-engine/e-mail-folder-utils.c
libemail-engine/e-mail-session.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]