Compare commits

...

No commits in common. "c9-beta" and "c8" have entirely different histories.
c9-beta ... c8

9 changed files with 609 additions and 6573 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/gnome-online-accounts-3.40.0.tar.xz
SOURCES/gnome-online-accounts-3.28.2.tar.xz

View File

@ -1 +0,0 @@
547da191a47b8f35ced486fa94145b85ad45c864 SOURCES/gnome-online-accounts-3.40.0.tar.xz

View File

@ -1,286 +0,0 @@
From 0820053ff418bf64db56fa8e63133c3d2e504807 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Fri, 23 Nov 2018 14:07:09 +0100
Subject: [PATCH] Remove Documents support
In theory, online integration for documents is still desired. However,
these days, GNOME Documents is weekly maintained and doesn't receive
much attention from designers and developers. Therefore, it needs to be
withdrawn from the set of core applications until the situation
changes.
https://pagure.io/fedora-workstation/issue/83
---
data/dbus-interfaces.xml | 3 +++
src/goabackend/goabackendenums.h | 2 +-
src/goabackend/goagoogleprovider.c | 12 ------------
src/goabackend/goaobjectskeletonutils.c | 23 -----------------------
src/goabackend/goaobjectskeletonutils.h | 3 ---
src/goabackend/goaowncloudprovider.c | 12 ------------
src/goabackend/goawindowsliveprovider.c | 17 ++---------------
7 files changed, 6 insertions(+), 66 deletions(-)
diff --git a/data/dbus-interfaces.xml b/data/dbus-interfaces.xml
index 21c42c13d003..072d6aaca3b6 100644
--- a/data/dbus-interfaces.xml
+++ b/data/dbus-interfaces.xml
@@ -668,6 +668,9 @@
An account object implements this interface if it provides
documents-like capabilities.
+
+ The #org.gnome.OnlineAccounts.Documents interface is not used
+ by any account.
-->
<interface name="org.gnome.OnlineAccounts.Documents">
</interface>
diff --git a/src/goabackend/goabackendenums.h b/src/goabackend/goabackendenums.h
index 638674aaf4e0..38f46fa8c193 100644
--- a/src/goabackend/goabackendenums.h
+++ b/src/goabackend/goabackendenums.h
@@ -63,7 +63,7 @@ typedef enum
* @GOA_PROVIDER_FEATURE_CALENDAR: Calendaring services (ie. CalDAV).
* @GOA_PROVIDER_FEATURE_CONTACTS: Addressbook services (ie. CardDAV).
* @GOA_PROVIDER_FEATURE_CHAT: Instant messaging services (ie. XMPP, IRC).
- * @GOA_PROVIDER_FEATURE_DOCUMENTS: Documents storage services (ie. Google Documents).
+ * @GOA_PROVIDER_FEATURE_DOCUMENTS: Documents storage services (ie. Google Documents); currently unused.
* @GOA_PROVIDER_FEATURE_PHOTOS: Photos storage services (ie. Flickr).
* @GOA_PROVIDER_FEATURE_FILES: Files storage services (ie. WebDAV).
* @GOA_PROVIDER_FEATURE_TICKETING: Ticketing services (ie. Kerberos).
diff --git a/src/goabackend/goagoogleprovider.c b/src/goabackend/goagoogleprovider.c
index 9e331c110119..9332c0fdca0b 100644
--- a/src/goabackend/goagoogleprovider.c
+++ b/src/goabackend/goagoogleprovider.c
@@ -69,7 +69,6 @@ get_provider_features (GoaProvider *provider)
GOA_PROVIDER_FEATURE_MAIL |
GOA_PROVIDER_FEATURE_CALENDAR |
GOA_PROVIDER_FEATURE_CONTACTS |
- GOA_PROVIDER_FEATURE_DOCUMENTS |
GOA_PROVIDER_FEATURE_PHOTOS |
GOA_PROVIDER_FEATURE_FILES |
GOA_PROVIDER_FEATURE_PRINTERS;
@@ -281,7 +280,6 @@ build_object (GoaProvider *provider,
gboolean mail_enabled;
gboolean calendar_enabled;
gboolean contacts_enabled;
- gboolean documents_enabled;
gboolean files_enabled;
gboolean photos_enabled;
gboolean printers_enabled;
@@ -344,10 +342,6 @@ build_object (GoaProvider *provider,
contacts_enabled,
FALSE);
- /* Documents */
- documents_enabled = g_key_file_get_boolean (key_file, group, "DocumentsEnabled", NULL);
- goa_object_skeleton_attach_documents (object, documents_enabled);
-
/* Photos */
photos_enabled = g_key_file_get_boolean (key_file, group, "PhotosEnabled", NULL);
goa_object_skeleton_attach_photos (object, photos_enabled);
@@ -367,7 +361,6 @@ build_object (GoaProvider *provider,
goa_account_set_mail_disabled (account, !mail_enabled);
goa_account_set_calendar_disabled (account, !calendar_enabled);
goa_account_set_contacts_disabled (account, !contacts_enabled);
- goa_account_set_documents_disabled (account, !documents_enabled);
goa_account_set_photos_disabled (account, !photos_enabled);
goa_account_set_files_disabled (account, !files_enabled);
goa_account_set_printers_disabled (account, !printers_enabled);
@@ -384,10 +377,6 @@ build_object (GoaProvider *provider,
"notify::contacts-disabled",
G_CALLBACK (goa_util_account_notify_property_cb),
(gpointer) "ContactsEnabled");
- g_signal_connect (account,
- "notify::documents-disabled",
- G_CALLBACK (goa_util_account_notify_property_cb),
- (gpointer) "DocumentsEnabled");
g_signal_connect (account,
"notify::photos-disabled",
G_CALLBACK (goa_util_account_notify_property_cb),
@@ -419,7 +408,6 @@ add_account_key_values (GoaOAuth2Provider *oauth2_provider,
g_variant_builder_add (builder, "{ss}", "MailEnabled", "true");
g_variant_builder_add (builder, "{ss}", "CalendarEnabled", "true");
g_variant_builder_add (builder, "{ss}", "ContactsEnabled", "true");
- g_variant_builder_add (builder, "{ss}", "DocumentsEnabled", "true");
g_variant_builder_add (builder, "{ss}", "PhotosEnabled", "true");
g_variant_builder_add (builder, "{ss}", "FilesEnabled", "true");
g_variant_builder_add (builder, "{ss}", "PrintersEnabled", "true");
diff --git a/src/goabackend/goaobjectskeletonutils.c b/src/goabackend/goaobjectskeletonutils.c
index 657bffd712f3..610c6ee26233 100644
--- a/src/goabackend/goaobjectskeletonutils.c
+++ b/src/goabackend/goaobjectskeletonutils.c
@@ -109,29 +109,6 @@ goa_object_skeleton_attach_contacts (GoaObjectSkeleton *object,
g_clear_object (&contacts);
}
-void
-goa_object_skeleton_attach_documents (GoaObjectSkeleton *object,
- gboolean documents_enabled)
-{
- GoaDocuments *documents;
-
- documents = goa_object_get_documents (GOA_OBJECT (object));
- if (documents_enabled)
- {
- if (documents == NULL)
- {
- documents = goa_documents_skeleton_new ();
- goa_object_skeleton_set_documents (object, documents);
- }
- }
- else
- {
- if (documents != NULL)
- goa_object_skeleton_set_documents (object, NULL);
- }
- g_clear_object (&documents);
-}
-
void
goa_object_skeleton_attach_photos (GoaObjectSkeleton *object,
gboolean photos_enabled)
diff --git a/src/goabackend/goaobjectskeletonutils.h b/src/goabackend/goaobjectskeletonutils.h
index 699695285028..6bc413c38f55 100644
--- a/src/goabackend/goaobjectskeletonutils.h
+++ b/src/goabackend/goaobjectskeletonutils.h
@@ -38,9 +38,6 @@ void goa_object_skeleton_attach_contacts (GoaObjectSkeleton *o
gboolean contacts_enabled,
gboolean accept_ssl_errors);
-void goa_object_skeleton_attach_documents (GoaObjectSkeleton *object,
- gboolean documents_enabled);
-
void goa_object_skeleton_attach_files (GoaObjectSkeleton *object,
const gchar *uri,
gboolean files_enabled,
diff --git a/src/goabackend/goaowncloudprovider.c b/src/goabackend/goaowncloudprovider.c
index 29d461a880d8..d1429661fe2e 100644
--- a/src/goabackend/goaowncloudprovider.c
+++ b/src/goabackend/goaowncloudprovider.c
@@ -72,7 +72,6 @@ get_provider_features (GoaProvider *provider)
return GOA_PROVIDER_FEATURE_BRANDED |
GOA_PROVIDER_FEATURE_CALENDAR |
GOA_PROVIDER_FEATURE_CONTACTS |
- GOA_PROVIDER_FEATURE_DOCUMENTS |
GOA_PROVIDER_FEATURE_FILES;
}
@@ -145,7 +144,6 @@ build_object (GoaProvider *provider,
gboolean accept_ssl_errors;
gboolean calendar_enabled;
gboolean contacts_enabled;
- gboolean documents_enabled;
gboolean files_enabled;
gboolean ret = FALSE;
const gchar *identity;
@@ -196,10 +194,6 @@ build_object (GoaProvider *provider,
goa_object_skeleton_attach_contacts (object, uri_carddav, contacts_enabled, accept_ssl_errors);
g_free (uri_carddav);
- /* Documents */
- documents_enabled = g_key_file_get_boolean (key_file, group, "DocumentsEnabled", NULL);
- goa_object_skeleton_attach_documents (object, documents_enabled);
-
/* Files */
files_enabled = g_key_file_get_boolean (key_file, group, "FilesEnabled", NULL);
uri_webdav = get_webdav_uri (uri);
@@ -210,7 +204,6 @@ build_object (GoaProvider *provider,
{
goa_account_set_calendar_disabled (account, !calendar_enabled);
goa_account_set_contacts_disabled (account, !contacts_enabled);
- goa_account_set_documents_disabled (account, !documents_enabled);
goa_account_set_files_disabled (account, !files_enabled);
g_signal_connect (account,
@@ -221,10 +214,6 @@ build_object (GoaProvider *provider,
"notify::contacts-disabled",
G_CALLBACK (goa_util_account_notify_property_cb),
(gpointer) "ContactsEnabled");
- g_signal_connect (account,
- "notify::documents-disabled",
- G_CALLBACK (goa_util_account_notify_property_cb),
- (gpointer) "DocumentsEnabled");
g_signal_connect (account,
"notify::files-disabled",
G_CALLBACK (goa_util_account_notify_property_cb),
@@ -750,7 +739,6 @@ add_account (GoaProvider *provider,
g_variant_builder_init (&details, G_VARIANT_TYPE ("a{ss}"));
g_variant_builder_add (&details, "{ss}", "CalendarEnabled", "true");
g_variant_builder_add (&details, "{ss}", "ContactsEnabled", "true");
- g_variant_builder_add (&details, "{ss}", "DocumentsEnabled", "true");
g_variant_builder_add (&details, "{ss}", "FilesEnabled", "true");
g_variant_builder_add (&details, "{ss}", "Uri", uri);
g_variant_builder_add (&details, "{ss}", "AcceptSslErrors", (accept_ssl_errors) ? "true" : "false");
diff --git a/src/goabackend/goawindowsliveprovider.c b/src/goabackend/goawindowsliveprovider.c
index 10c2dcff4738..be357465230a 100644
--- a/src/goabackend/goawindowsliveprovider.c
+++ b/src/goabackend/goawindowsliveprovider.c
@@ -73,8 +73,7 @@ static GoaProviderFeatures
get_provider_features (GoaProvider *provider)
{
return GOA_PROVIDER_FEATURE_BRANDED |
- GOA_PROVIDER_FEATURE_MAIL |
- GOA_PROVIDER_FEATURE_DOCUMENTS;
+ GOA_PROVIDER_FEATURE_MAIL;
}
static const gchar *
@@ -102,14 +101,13 @@ get_scope (GoaOAuth2Provider *oauth2_provider)
{
return "wl.imap,"
"wl.offline_access,"
- "wl.skydrive_update,"
"wl.emails";
}
static guint
get_credentials_generation (GoaProvider *provider)
{
- return 3;
+ return 4;
}
static const gchar *
@@ -276,7 +274,6 @@ build_object (GoaProvider *provider,
GoaAccount *account = NULL;
GoaMail *mail = NULL;
gboolean mail_enabled;
- gboolean documents_enabled;
gboolean ret = FALSE;
const gchar *email_address;
@@ -323,23 +320,14 @@ build_object (GoaProvider *provider,
goa_object_skeleton_set_mail (object, NULL);
}
- /* Documents */
- documents_enabled = g_key_file_get_boolean (key_file, group, "DocumentsEnabled", NULL);
- goa_object_skeleton_attach_documents (object, documents_enabled);
-
if (just_added)
{
goa_account_set_mail_disabled (account, !mail_enabled);
- goa_account_set_documents_disabled (account, !documents_enabled);
g_signal_connect (account,
"notify::mail-disabled",
G_CALLBACK (goa_util_account_notify_property_cb),
(gpointer) "MailEnabled");
- g_signal_connect (account,
- "notify::documents-disabled",
- G_CALLBACK (goa_util_account_notify_property_cb),
- (gpointer) "DocumentsEnabled");
}
ret = TRUE;
@@ -357,7 +345,6 @@ add_account_key_values (GoaOAuth2Provider *oauth2_provider,
GVariantBuilder *builder)
{
g_variant_builder_add (builder, "{ss}", "MailEnabled", "true");
- g_variant_builder_add (builder, "{ss}", "DocumentsEnabled", "true");
}
/* ---------------------------------------------------------------------------------------------------- */
--
2.30.2

View File

@ -1,86 +0,0 @@
From f17c21fc97e465b86ed27acceeea331624e66cd6 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 22 Apr 2021 01:51:52 +0200
Subject: [PATCH] google: Remove Photos support
In theory, support for photos is still desired. However, right now the
implementation of the Google PicasaWeb API in libgdata no longer works.
Until that's fixed, there's no point in advertising support for photos.
https://gitlab.gnome.org/GNOME/gnome-online-accounts/-/issues/63
https://bugzilla.redhat.com/show_bug.cgi?id=1913641
---
src/goabackend/goagoogleprovider.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/src/goabackend/goagoogleprovider.c b/src/goabackend/goagoogleprovider.c
index 9332c0fdca0b..b3c0f8fdcc66 100644
--- a/src/goabackend/goagoogleprovider.c
+++ b/src/goabackend/goagoogleprovider.c
@@ -69,7 +69,6 @@ get_provider_features (GoaProvider *provider)
GOA_PROVIDER_FEATURE_MAIL |
GOA_PROVIDER_FEATURE_CALENDAR |
GOA_PROVIDER_FEATURE_CONTACTS |
- GOA_PROVIDER_FEATURE_PHOTOS |
GOA_PROVIDER_FEATURE_FILES |
GOA_PROVIDER_FEATURE_PRINTERS;
}
@@ -117,9 +116,6 @@ get_scope (GoaOAuth2Provider *oauth2_provider)
"https://docs.googleusercontent.com/ "
"https://spreadsheets.google.com/feeds/ "
- /* Google PicasaWeb API (GData) */
- "https://picasaweb.google.com/data/ "
-
/* GMail IMAP and SMTP access */
"https://mail.google.com/ "
@@ -281,7 +277,6 @@ build_object (GoaProvider *provider,
gboolean calendar_enabled;
gboolean contacts_enabled;
gboolean files_enabled;
- gboolean photos_enabled;
gboolean printers_enabled;
const gchar *email_address;
@@ -342,10 +337,6 @@ build_object (GoaProvider *provider,
contacts_enabled,
FALSE);
- /* Photos */
- photos_enabled = g_key_file_get_boolean (key_file, group, "PhotosEnabled", NULL);
- goa_object_skeleton_attach_photos (object, photos_enabled);
-
/* Files */
files_enabled = g_key_file_get_boolean (key_file, group, "FilesEnabled", NULL);
uri_drive = g_strconcat ("google-drive://", email_address, "/", NULL);
@@ -361,7 +352,6 @@ build_object (GoaProvider *provider,
goa_account_set_mail_disabled (account, !mail_enabled);
goa_account_set_calendar_disabled (account, !calendar_enabled);
goa_account_set_contacts_disabled (account, !contacts_enabled);
- goa_account_set_photos_disabled (account, !photos_enabled);
goa_account_set_files_disabled (account, !files_enabled);
goa_account_set_printers_disabled (account, !printers_enabled);
@@ -377,10 +367,6 @@ build_object (GoaProvider *provider,
"notify::contacts-disabled",
G_CALLBACK (goa_util_account_notify_property_cb),
(gpointer) "ContactsEnabled");
- g_signal_connect (account,
- "notify::photos-disabled",
- G_CALLBACK (goa_util_account_notify_property_cb),
- (gpointer) "PhotosEnabled");
g_signal_connect (account,
"notify::files-disabled",
G_CALLBACK (goa_util_account_notify_property_cb),
@@ -408,7 +394,6 @@ add_account_key_values (GoaOAuth2Provider *oauth2_provider,
g_variant_builder_add (builder, "{ss}", "MailEnabled", "true");
g_variant_builder_add (builder, "{ss}", "CalendarEnabled", "true");
g_variant_builder_add (builder, "{ss}", "ContactsEnabled", "true");
- g_variant_builder_add (builder, "{ss}", "PhotosEnabled", "true");
g_variant_builder_add (builder, "{ss}", "FilesEnabled", "true");
g_variant_builder_add (builder, "{ss}", "PrintersEnabled", "true");
}
--
2.30.2

View File

@ -0,0 +1,229 @@
diff -up gnome-online-accounts-3.28.2/src/goabackend/goautils.c.mute-debug-prints gnome-online-accounts-3.28.2/src/goabackend/goautils.c
--- gnome-online-accounts-3.28.2/src/goabackend/goautils.c.mute-debug-prints 2019-02-10 20:18:08.000000000 +0100
+++ gnome-online-accounts-3.28.2/src/goabackend/goautils.c 2022-09-02 12:02:45.020910337 +0200
@@ -380,7 +380,7 @@ goa_utils_delete_credentials_for_id_sync
NULL);
if (sec_error != NULL)
{
- g_warning ("secret_password_clear_sync() failed: %s", sec_error->message);
+ g_debug ("secret_password_clear_sync() failed: %s", sec_error->message);
g_set_error_literal (error,
GOA_ERROR,
GOA_ERROR_FAILED, /* TODO: more specific */
@@ -428,7 +428,7 @@ goa_utils_lookup_credentials_sync (GoaPr
NULL);
if (sec_error != NULL)
{
- g_warning ("secret_password_lookup_sync() failed: %s", sec_error->message);
+ g_debug ("secret_password_lookup_sync() failed: %s", sec_error->message);
g_set_error_literal (error,
GOA_ERROR,
GOA_ERROR_FAILED, /* TODO: more specific */
@@ -438,7 +438,7 @@ goa_utils_lookup_credentials_sync (GoaPr
}
else if (password == NULL)
{
- g_warning ("secret_password_lookup_sync() returned NULL");
+ g_debug ("secret_password_lookup_sync() returned NULL");
g_set_error_literal (error,
GOA_ERROR,
GOA_ERROR_FAILED, /* TODO: more specific */
@@ -509,7 +509,7 @@ goa_utils_store_credentials_for_id_sync
"goa-identity", password_key,
NULL))
{
- g_warning ("secret_password_store_sync() failed: %s", sec_error->message);
+ g_debug ("secret_password_store_sync() failed: %s", sec_error->message);
g_set_error_literal (error,
GOA_ERROR,
GOA_ERROR_FAILED, /* TODO: more specific */
@@ -562,11 +562,11 @@ goa_utils_keyfile_copy_group (GKeyFile
keys = g_key_file_get_keys (src_key_file, src_group_name, NULL, &error);
if (error != NULL)
{
- g_warning ("Error getting keys from group %s: %s (%s, %d)",
- src_group_name,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error getting keys from group %s: %s (%s, %d)",
+ src_group_name,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
g_error_free (error);
goto out;
}
@@ -580,12 +580,12 @@ goa_utils_keyfile_copy_group (GKeyFile
src_value = g_key_file_get_value (src_key_file, src_group_name, keys[i], &error);
if (error != NULL)
{
- g_warning ("Error reading key %s from group %s: %s (%s, %d)",
- keys[i],
- src_group_name,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error reading key %s from group %s: %s (%s, %d)",
+ keys[i],
+ src_group_name,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
g_error_free (error);
continue;
}
@@ -597,12 +597,12 @@ goa_utils_keyfile_copy_group (GKeyFile
if (!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)
&& !g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND))
{
- g_warning ("Error reading key %s from group %s: %s (%s, %d)",
- keys[i],
- src_group_name,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error reading key %s from group %s: %s (%s, %d)",
+ keys[i],
+ src_group_name,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
}
g_error_free (error);
@@ -635,12 +635,12 @@ goa_utils_keyfile_get_boolean (GKeyFile
{
if (!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND))
{
- g_warning ("Error reading key %s from group %s in keyfile: %s (%s, %d)",
- key,
- group_name,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error reading key %s from group %s in keyfile: %s (%s, %d)",
+ key,
+ group_name,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
}
g_error_free (error);
@@ -667,11 +667,11 @@ goa_utils_keyfile_remove_key (GoaAccount
G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS,
&error))
{
- g_warning ("Error loading keyfile %s: %s (%s, %d)",
- path,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error loading keyfile %s: %s (%s, %d)",
+ path,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
g_error_free (error);
goto out;
}
@@ -683,7 +683,7 @@ goa_utils_keyfile_remove_key (GoaAccount
if (!g_key_file_save_to_file (key_file, path, &error))
{
g_prefix_error (&error, "Error writing key-value-file %s: ", path);
- g_warning ("%s (%s, %d)", error->message, g_quark_to_string (error->domain), error->code);
+ g_debug ("%s (%s, %d)", error->message, g_quark_to_string (error->domain), error->code);
g_error_free (error);
goto out;
}
@@ -714,11 +714,11 @@ goa_utils_keyfile_set_boolean (GoaAccoun
G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS,
&error))
{
- g_warning ("Error loading keyfile %s: %s (%s, %d)",
- path,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error loading keyfile %s: %s (%s, %d)",
+ path,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
g_error_free (error);
goto out;
}
@@ -727,12 +727,12 @@ goa_utils_keyfile_set_boolean (GoaAccoun
old_value = g_key_file_get_boolean (key_file, group, key, &error);
if (error != NULL)
{
- g_warning ("Error reading key %s from keyfile %s: %s (%s, %d)",
- key,
- path,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error reading key %s from keyfile %s: %s (%s, %d)",
+ key,
+ path,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
needs_update = TRUE;
g_error_free (error);
}
@@ -750,7 +750,7 @@ goa_utils_keyfile_set_boolean (GoaAccoun
if (!g_key_file_save_to_file (key_file, path, &error))
{
g_prefix_error (&error, "Error writing key-value-file %s: ", path);
- g_warning ("%s (%s, %d)", error->message, g_quark_to_string (error->domain), error->code);
+ g_debug ("%s (%s, %d)", error->message, g_quark_to_string (error->domain), error->code);
g_error_free (error);
goto out;
}
@@ -781,11 +781,11 @@ goa_utils_keyfile_set_string (GoaAccount
G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS,
&error))
{
- g_warning ("Error loading keyfile %s: %s (%s, %d)",
- path,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error loading keyfile %s: %s (%s, %d)",
+ path,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
g_error_free (error);
goto out;
}
@@ -794,12 +794,12 @@ goa_utils_keyfile_set_string (GoaAccount
old_value = g_key_file_get_string (key_file, group, key, &error);
if (error != NULL)
{
- g_warning ("Error reading key %s from keyfile %s: %s (%s, %d)",
- key,
- path,
- error->message,
- g_quark_to_string (error->domain),
- error->code);
+ g_debug ("Error reading key %s from keyfile %s: %s (%s, %d)",
+ key,
+ path,
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
needs_update = TRUE;
g_error_free (error);
}
@@ -817,7 +817,7 @@ goa_utils_keyfile_set_string (GoaAccount
if (!g_key_file_save_to_file (key_file, path, &error))
{
g_prefix_error (&error, "Error writing key-value-file %s: ", path);
- g_warning ("%s (%s, %d)", error->message, g_quark_to_string (error->domain), error->code);
+ g_debug ("%s (%s, %d)", error->message, g_quark_to_string (error->domain), error->code);
g_error_free (error);
goto out;
}

View File

@ -1,24 +1,20 @@
diff --git a/configure.ac b/configure.ac
index 332a0bf..70962d6 100644
index ddf98f1..f997d36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,14 +113,6 @@ if test "$enable_backend" != "no"; then
@@ -124,10 +124,6 @@ if test "$enable_backend" != "no"; then
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
- PKG_CHECK_MODULES(JAVASCRIPT_CORE_GTK, [javascriptcoregtk-4.0 >= 2.12.0])
- AC_SUBST(JAVASCRIPT_CORE_GTK_CFLAGS)
- AC_SUBST(JAVASCRIPT_CORE_GTK_LIBS)
-
- PKG_CHECK_MODULES(WEBKIT_GTK, [webkit2gtk-4.0 >= 2.26.0])
- PKG_CHECK_MODULES(WEBKIT_GTK, [webkit2gtk-4.0 >= 2.12.0])
- AC_SUBST(WEBKIT_GTK_CFLAGS)
- AC_SUBST(WEBKIT_GTK_LIBS)
-
PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.42])
AC_SUBST(LIBSOUP_CFLAGS)
AC_SUBST(LIBSOUP_LIBS)
@@ -142,14 +134,6 @@ if test "$enable_backend" != "no"; then
AC_SUBST(LIBXML_LIBS)
@@ -176,14 +172,6 @@ if test "$enable_backend" != "no"; then
fi
fi
-AC_ARG_ENABLE([inspector],
@ -32,7 +28,7 @@ index 332a0bf..70962d6 100644
AC_ARG_WITH(template-file,
[AS_HELP_STRING([--with-template-file], [Path to the template file])],
[],
@@ -275,7 +259,11 @@ AC_DEFINE_UNQUOTED(GOA_GOOGLE_CLIENT_ID, ["$with_google_client_id"], [Google OAu
@@ -271,7 +259,11 @@ AC_DEFINE_UNQUOTED(GOA_GOOGLE_CLIENT_ID, ["$with_google_client_id"], [Google OAu
AC_DEFINE_UNQUOTED(GOA_GOOGLE_CLIENT_SECRET, ["$with_google_client_secret"], [Google OAuth 2.0 client secret])
if test "$enable_google" != "no"; then
AC_DEFINE(GOA_GOOGLE_ENABLED, 1, [Enable Google data provider])
@ -45,16 +41,13 @@ index 332a0bf..70962d6 100644
# IMAP/SMTP
AC_DEFINE(GOA_IMAP_SMTP_NAME, ["imap_smtp"], [ProviderType and extension point name])
diff --git a/data/Makefile.am b/data/Makefile.am
index e3608a1..c3f1009 100644
index 286dcd0..61b69e1 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -19,17 +19,33 @@ endif
service_DATA = $(service_in_files:.service.in=.service)
%.service: %.service.in Makefile
@@ -20,16 +20,30 @@ service_DATA = $(service_in_files:.service.in=.service)
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+
+endif
+
endif
+desktopdir = $(datadir)/applications
+desktop_in_files = org.gnome.OnlineAccounts.OAuth2.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@ -62,14 +55,13 @@ index e3608a1..c3f1009 100644
+ oauth2_schemes=x-scheme-handler/com.googleusercontent.apps.44438659992-7kgjeitenc16ssihbtdjbgguch7ju55s;
+else
+ oauth2_schemes=
endif
+endif
+
+%.desktop: %.desktop.in Makefile
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" -e "s|\@oauth2_schemes\@|$(oauth2_schemes)|" $< > $@
+
+
EXTRA_DIST = \
$(gsettings_schema_files) \
$(gsettings_SCHEMAS) \
dbus-interfaces.xml \
org.gnome.Identity.service.in \
org.gnome.OnlineAccounts.service.in \
@ -78,10 +70,11 @@ index e3608a1..c3f1009 100644
CLEANFILES = \
org.gnome.OnlineAccounts.service \
+ org.gnome.OnlineAccounts.OAuth2.desktop \
org.gnome.Identity.service \
+ org.gnome.OnlineAccounts.OAuth2.desktop \
$(NULL)
clean-local :
diff --git a/data/org.gnome.OnlineAccounts.OAuth2.desktop.in b/data/org.gnome.OnlineAccounts.OAuth2.desktop.in
new file mode 100644
index 0000000..d0478aa
@ -107,10 +100,10 @@ index 0abb53a..a9d45e1 100644
</chapter>
</part>
diff --git a/doc/goa-sections.txt b/doc/goa-sections.txt
index 6f96d69..31a07b5 100644
index 306846e..a27d942 100644
--- a/doc/goa-sections.txt
+++ b/doc/goa-sections.txt
@@ -502,36 +502,6 @@ GoaOAuth2ProviderPrivate
@@ -498,36 +498,6 @@ GoaOAuth2ProviderPrivate
goa_oauth2_provider_get_type
</SECTION>
@ -158,19 +151,19 @@ index 56ba3c4..d8d7325 100644
-goa_oauth_provider_get_type
goa_oauth2_provider_get_type
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 279fb64..e131629 100644
index b65650c..8ee89ae 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -20,7 +20,6 @@ src/goabackend/goaowncloudprovider.c
src/goabackend/goaprovider.c
src/goabackend/goasmtpauth.c
@@ -22,7 +22,6 @@ src/goabackend/goasmtpauth.c
src/goabackend/goatelepathyprovider.c
src/goabackend/goatodoistprovider.c
src/goabackend/goautils.c
-src/goabackend/goawebview.c
src/goabackend/goawindowsliveprovider.c
src/goaidentity/goaidentityservice.c
src/goaidentity/goakerberosidentity.c
diff --git a/src/goabackend/Makefile.am b/src/goabackend/Makefile.am
index 8385237..c7e00a4 100644
index c254594..7f15518 100644
--- a/src/goabackend/Makefile.am
+++ b/src/goabackend/Makefile.am
@@ -19,7 +19,6 @@ AM_CPPFLAGS = \
@ -178,10 +171,10 @@ index 8385237..c7e00a4 100644
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
-DPACKAGE_LIB_DIR=\""$(libdir)"\" \
- -DPACKAGE_WEB_EXTENSIONS_DIR=\""$(libdir)/goa-1.0/web-extensions"\" \
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
$(WARN_CFLAGS) \
$(NULL)
@@ -79,23 +78,18 @@ libgoa_backend_1_0_la_SOURCES = \
@@ -81,17 +80,13 @@ libgoa_backend_1_0_la_SOURCES = \
goasouplogger.h goasouplogger.c \
goamailclient.h goamailclient.c \
goaexchangeprovider.h goaexchangeprovider.c \
@ -198,32 +191,32 @@ index 8385237..c7e00a4 100644
- goaflickrprovider.h goaflickrprovider.c \
goafoursquareprovider.h goafoursquareprovider.c \
goawindowsliveprovider.h goawindowsliveprovider.c \
goalastfmprovider.h goalastfmprovider.c \
goapocketprovider.h goapocketprovider.c \
@@ -99,7 +94,6 @@ libgoa_backend_1_0_la_SOURCES = \
goatodoistprovider.h goatodoistprovider.c \
goaobjectskeletonutils.h goaobjectskeletonutils.c \
goautils.h goautils.c \
- goawebview.h goawebview.c \
nautilus-floating-bar.h nautilus-floating-bar.c \
$(top_builddir)/src/goaidentity/org.gnome.Identity.c \
$(top_srcdir)/src/goaidentity/goaidentitymanagererror.c \
@@ -112,8 +106,6 @@ libgoa_backend_1_0_la_SOURCES += \
@@ -119,7 +113,6 @@ libgoa_backend_1_0_la_SOURCES += \
endif
libgoa_backend_1_0_la_CFLAGS = \
- $(JAVASCRIPT_CORE_GTK_CFLAGS) \
- $(WEBKIT_GTK_CFLAGS) \
$(JSON_GLIB_CFLAGS) \
$(GCR_CFLAGS) \
$(GLIB_CFLAGS) \
@@ -128,8 +120,6 @@ libgoa_backend_1_0_la_CFLAGS = \
@@ -134,7 +127,6 @@ libgoa_backend_1_0_la_CFLAGS = \
libgoa_backend_1_0_la_LIBADD = \
$(top_builddir)/src/goa/libgoa-1.0.la \
- $(JAVASCRIPT_CORE_GTK_LIBS) \
- $(WEBKIT_GTK_LIBS) \
$(JSON_GLIB_LIBS) \
$(GCR_LIBS) \
$(GLIB_LIBS) \
@@ -149,39 +139,29 @@ libgoa_backend_1_0_la_LDFLAGS = \
@@ -154,39 +146,29 @@ libgoa_backend_1_0_la_LDFLAGS = \
# ----------------------------------------------------------------------------------------------------
@ -777,7 +770,7 @@ index c1e4146..def21cb 100644
oauth2_class->add_account_key_values = add_account_key_values;
}
diff --git a/src/goabackend/goagoogleprovider.c b/src/goabackend/goagoogleprovider.c
index b3c0f8f..0fb40c3 100644
index 6e4ace2..6f951e5 100644
--- a/src/goabackend/goagoogleprovider.c
+++ b/src/goabackend/goagoogleprovider.c
@@ -32,6 +32,7 @@
@ -788,7 +781,7 @@ index b3c0f8f..0fb40c3 100644
};
G_DEFINE_TYPE_WITH_CODE (GoaGoogleProvider, goa_google_provider, GOA_TYPE_OAUTH2_PROVIDER,
@@ -76,19 +77,50 @@ get_provider_features (GoaProvider *provider)
@@ -81,19 +82,50 @@ get_provider_features (GoaProvider *provider)
static const gchar *
get_authorization_uri (GoaOAuth2Provider *oauth2_provider)
{
@ -842,7 +835,7 @@ index b3c0f8f..0fb40c3 100644
}
static const gchar *
@@ -228,37 +260,6 @@ get_identity_sync (GoaOAuth2Provider *oauth2_provider,
@@ -241,37 +273,6 @@ get_identity_sync (GoaOAuth2Provider *oauth2_provider,
/* ---------------------------------------------------------------------------------------------------- */
@ -880,7 +873,7 @@ index b3c0f8f..0fb40c3 100644
static gboolean
build_object (GoaProvider *provider,
GoaObjectSkeleton *object,
@@ -400,6 +401,16 @@ add_account_key_values (GoaOAuth2Provider *oauth2_provider,
@@ -446,6 +447,16 @@ add_account_key_values (GoaOAuth2Provider *oauth2_provider,
/* ---------------------------------------------------------------------------------------------------- */
@ -897,7 +890,7 @@ index b3c0f8f..0fb40c3 100644
static void
goa_google_provider_init (GoaGoogleProvider *self)
{
@@ -410,6 +421,10 @@ goa_google_provider_class_init (GoaGoogleProviderClass *klass)
@@ -456,6 +467,10 @@ goa_google_provider_class_init (GoaGoogleProviderClass *klass)
{
GoaProviderClass *provider_class;
GoaOAuth2ProviderClass *oauth2_class;
@ -908,7 +901,7 @@ index b3c0f8f..0fb40c3 100644
provider_class = GOA_PROVIDER_CLASS (klass);
provider_class->get_provider_type = get_provider_type;
@@ -426,7 +441,6 @@ goa_google_provider_class_init (GoaGoogleProviderClass *klass)
@@ -472,7 +487,6 @@ goa_google_provider_class_init (GoaGoogleProviderClass *klass)
oauth2_class->get_identity_sync = get_identity_sync;
oauth2_class->get_redirect_uri = get_redirect_uri;
oauth2_class->get_scope = get_scope;
@ -1229,7 +1222,7 @@ index f2dae5e..0000000
-
-#endif /* __GOA_OAUTH2_PROVIDER_WEB_VIEW_H__ */
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index 3715431..e7d5d2e 100644
index 9092605..1ceacb5 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -22,16 +22,13 @@
@ -1527,7 +1520,7 @@ index 3715431..e7d5d2e 100644
if (fragment != NULL)
{
/* fragment is encoded into a key/value pairs for the token and
@@ -846,57 +692,173 @@ on_web_view_decide_policy (WebKitWebView *web_view,
@@ -846,57 +692,175 @@ on_web_view_decide_policy (WebKitWebView *web_view,
priv->access_token_expires_in = atoi (expires_in_str);
priv->refresh_token = g_strdup (g_hash_table_lookup (key_value_pairs, "refresh_token"));
@ -1661,8 +1654,8 @@ index 3715431..e7d5d2e 100644
+ GoaOAuth2Provider *self)
+{
+ GoaOAuth2ProviderPrivate *priv = goa_oauth2_provider_get_instance_private (self);
+ g_autoptr (SecretService) service = NULL;
+ g_autolist (SecretCollection) collections = NULL;
+ SecretService *service = NULL;
+ GList *collections = NULL;
+
+ service = secret_service_get_finish (result, &priv->error);
+ if (service == NULL)
@ -1708,6 +1701,8 @@ index 3715431..e7d5d2e 100644
+ }
+
+out:
+ g_clear_object (&service);
+ g_list_free_full (collections, g_object_unref);
+ g_main_loop_quit (priv->loop);
+}
+
@ -1724,7 +1719,7 @@ index 3715431..e7d5d2e 100644
}
static gboolean
@@ -906,12 +868,13 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
@@ -906,12 +870,13 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
GtkDialog *dialog,
GtkBox *vbox)
{
@ -1742,7 +1737,7 @@ index 3715431..e7d5d2e 100644
const gchar *scope;
gchar *escaped_redirect_uri = NULL;
gchar *escaped_client_id = NULL;
@@ -923,7 +886,6 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
@@ -923,7 +888,6 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
g_return_val_if_fail (GTK_IS_DIALOG (dialog), FALSE);
g_return_val_if_fail (GTK_IS_BOX (vbox), FALSE);
@ -1750,7 +1745,7 @@ index 3715431..e7d5d2e 100644
g_return_val_if_fail (priv->error == NULL, FALSE);
/* TODO: check with NM whether we're online, if not - return error */
@@ -937,6 +899,8 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
@@ -937,6 +901,8 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
g_clear_pointer (&priv->authorization_code, g_free);
g_clear_pointer (&priv->access_token, g_free);
g_clear_pointer (&priv->refresh_token, g_free);
@ -1759,7 +1754,7 @@ index 3715431..e7d5d2e 100644
/* TODO: use oauth2_proxy_build_login_url_full() */
escaped_redirect_uri = g_uri_escape_string (goa_oauth2_provider_get_redirect_uri (self), NULL, TRUE);
@@ -946,40 +910,71 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
@@ -946,40 +912,71 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
escaped_scope = g_uri_escape_string (goa_oauth2_provider_get_scope (self), NULL, TRUE);
else
escaped_scope = NULL;
@ -1857,7 +1852,7 @@ index 3715431..e7d5d2e 100644
/* We can have either the auth code, with which we'll obtain the token, or
* the token directly if we are using a client side flow, since we don't
@@ -1038,12 +1033,14 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
@@ -1038,12 +1035,14 @@ get_tokens_and_identity (GoaOAuth2Provider *self,
}
ret = TRUE;
@ -1873,7 +1868,7 @@ index 3715431..e7d5d2e 100644
return ret;
}
@@ -1107,6 +1104,7 @@ goa_oauth2_provider_add_account (GoaProvider *provider,
@@ -1131,6 +1130,7 @@ goa_oauth2_provider_add_account (GoaProvider *provider,
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
priv = goa_oauth2_provider_get_instance_private (self);
@ -1881,7 +1876,7 @@ index 3715431..e7d5d2e 100644
if (!get_tokens_and_identity (self, TRUE, NULL, dialog, vbox))
goto out;
@@ -1141,7 +1139,6 @@ goa_oauth2_provider_add_account (GoaProvider *provider,
@@ -1165,7 +1165,6 @@ goa_oauth2_provider_add_account (GoaProvider *provider,
NULL, /* GCancellable* */
(GAsyncReadyCallback) add_account_cb,
self);
@ -1889,7 +1884,7 @@ index 3715431..e7d5d2e 100644
g_main_loop_run (priv->loop);
if (priv->error != NULL)
goto out;
@@ -1191,6 +1188,7 @@ goa_oauth2_provider_refresh_account (GoaProvider *provider,
@@ -1215,6 +1214,7 @@ goa_oauth2_provider_refresh_account (GoaProvider *provider,
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
priv = goa_oauth2_provider_get_instance_private (self);
@ -1897,7 +1892,7 @@ index 3715431..e7d5d2e 100644
dialog = gtk_dialog_new_with_buttons (NULL,
parent,
@@ -1601,6 +1599,8 @@ goa_oauth2_provider_finalize (GObject *object)
@@ -1625,6 +1625,8 @@ goa_oauth2_provider_finalize (GObject *object)
g_free (priv->authorization_code);
g_free (priv->access_token);
g_free (priv->refresh_token);
@ -1906,7 +1901,7 @@ index 3715431..e7d5d2e 100644
G_OBJECT_CLASS (goa_oauth2_provider_parent_class)->finalize (object);
}
@@ -1626,12 +1626,9 @@ goa_oauth2_provider_class_init (GoaOAuth2ProviderClass *klass)
@@ -1650,12 +1652,9 @@ goa_oauth2_provider_class_init (GoaOAuth2ProviderClass *klass)
provider_class->ensure_credentials_sync = goa_oauth2_provider_ensure_credentials_sync;
klass->build_authorization_uri = goa_oauth2_provider_build_authorization_uri_default;
@ -1921,10 +1916,10 @@ index 3715431..e7d5d2e 100644
diff --git a/src/goabackend/goaoauthprovider.c b/src/goabackend/goaoauthprovider.c
deleted file mode 100644
index 0bfab6b..0000000
index 71bcad6..0000000
--- a/src/goabackend/goaoauthprovider.c
+++ /dev/null
@@ -1,1638 +0,0 @@
@@ -1,1662 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/*
- * Copyright © 2011 2017 Red Hat, Inc.
@ -2868,7 +2863,7 @@ index 0bfab6b..0000000
- g_free (url);
-
- g_free (data.oauth_verifier);
- g_clear_pointer (&data.loop, g_main_loop_unref);
- g_clear_pointer (&data.loop, (GDestroyNotify) g_main_loop_unref);
- g_free (data.access_token);
- g_free (data.access_token_secret);
- g_free (escaped_request_token);
@ -2904,6 +2899,30 @@ index 0bfab6b..0000000
- g_main_loop_quit (data->loop);
-}
-
-static gint64
-duration_to_abs_usec (gint duration_sec)
-{
- gint64 ret;
- GTimeVal now;
-
- g_get_current_time (&now);
- ret = ((gint64) now.tv_sec) * 1000L * 1000L + ((gint64) now.tv_usec);
- ret += ((gint64) duration_sec) * 1000L * 1000L;
- return ret;
-}
-
-static gint
-abs_usec_to_duration (gint64 abs_usec)
-{
- gint64 ret;
- GTimeVal now;
-
- g_get_current_time (&now);
- ret = abs_usec - (((gint64) now.tv_sec) * 1000L * 1000L + ((gint64) now.tv_usec));
- ret /= 1000L * 1000L;
- return ret;
-}
-
-static GoaObject *
-goa_oauth_provider_add_account (GoaProvider *_provider,
- GoaClient *client,
@ -2966,12 +2985,12 @@ index 0bfab6b..0000000
- g_variant_builder_add (&credentials, "{sv}", "access_token_secret", g_variant_new_string (access_token_secret));
- if (access_token_expires_in > 0)
- g_variant_builder_add (&credentials, "{sv}", "access_token_expires_at",
- g_variant_new_int64 (goa_utils_convert_duration_sec_to_abs_usec (access_token_expires_in)));
- g_variant_new_int64 (duration_to_abs_usec (access_token_expires_in)));
- if (session_handle != NULL)
- g_variant_builder_add (&credentials, "{sv}", "session_handle", g_variant_new_string (session_handle));
- if (session_handle_expires_in > 0)
- g_variant_builder_add (&credentials, "{sv}", "session_handle_expires_at",
- g_variant_new_int64 (goa_utils_convert_duration_sec_to_abs_usec (session_handle_expires_in)));
- g_variant_new_int64 (duration_to_abs_usec (session_handle_expires_in)));
- if (password != NULL)
- g_variant_builder_add (&credentials, "{sv}", "password", g_variant_new_string (password));
-
@ -3014,7 +3033,7 @@ index 0bfab6b..0000000
- g_free (access_token_secret);
- g_free (session_handle);
- g_free (data.account_object_path);
- g_clear_pointer (&data.loop, g_main_loop_unref);
- g_clear_pointer (&data.loop, (GDestroyNotify) g_main_loop_unref);
- return ret;
-}
-
@ -3103,12 +3122,12 @@ index 0bfab6b..0000000
- g_variant_builder_add (&builder, "{sv}", "access_token_secret", g_variant_new_string (access_token_secret));
- if (access_token_expires_in > 0)
- g_variant_builder_add (&builder, "{sv}", "access_token_expires_at",
- g_variant_new_int64 (goa_utils_convert_duration_sec_to_abs_usec (access_token_expires_in)));
- g_variant_new_int64 (duration_to_abs_usec (access_token_expires_in)));
- if (session_handle != NULL)
- g_variant_builder_add (&builder, "{sv}", "session_handle", g_variant_new_string (session_handle));
- if (session_handle_expires_in > 0)
- g_variant_builder_add (&builder, "{sv}", "session_handle_expires_at",
- g_variant_new_int64 (goa_utils_convert_duration_sec_to_abs_usec (session_handle_expires_in)));
- g_variant_new_int64 (duration_to_abs_usec (session_handle_expires_in)));
- if (password != NULL)
- g_variant_builder_add (&builder, "{sv}", "password", g_variant_new_string (password));
- /* TODO: run in worker thread */
@ -3248,11 +3267,11 @@ index 0bfab6b..0000000
- else if (g_strcmp0 (key, "access_token_secret") == 0)
- access_token_secret = g_variant_dup_string (value, NULL);
- else if (g_strcmp0 (key, "access_token_expires_at") == 0)
- access_token_expires_in = goa_utils_convert_abs_usec_to_duration_sec (g_variant_get_int64 (value));
- access_token_expires_in = abs_usec_to_duration (g_variant_get_int64 (value));
- else if (g_strcmp0 (key, "session_handle") == 0)
- session_handle = g_variant_dup_string (value, NULL);
- else if (g_strcmp0 (key, "session_handle_expires_at") == 0)
- session_handle_expires_in = goa_utils_convert_abs_usec_to_duration_sec (g_variant_get_int64 (value));
- session_handle_expires_in = abs_usec_to_duration (g_variant_get_int64 (value));
- else if (g_strcmp0 (key, "password") == 0)
- password = g_variant_dup_string (value, NULL);
- g_variant_unref (value);
@ -3321,12 +3340,12 @@ index 0bfab6b..0000000
- g_variant_builder_add (&builder, "{sv}", "access_token_secret", g_variant_new_string (access_token_secret));
- if (access_token_expires_in > 0)
- g_variant_builder_add (&builder, "{sv}", "access_token_expires_at",
- g_variant_new_int64 (goa_utils_convert_duration_sec_to_abs_usec (access_token_expires_in)));
- g_variant_new_int64 (duration_to_abs_usec (access_token_expires_in)));
- if (session_handle != NULL)
- g_variant_builder_add (&builder, "{sv}", "session_handle", g_variant_new_string (session_handle));
- if (session_handle_expires_in > 0)
- g_variant_builder_add (&builder, "{sv}", "session_handle_expires_at",
- g_variant_new_int64 (goa_utils_convert_duration_sec_to_abs_usec (session_handle_expires_in)));
- g_variant_new_int64 (duration_to_abs_usec (session_handle_expires_in)));
- if (password != NULL)
- g_variant_builder_add (&builder, "{sv}", "password", g_variant_new_string (password));
-
@ -3366,7 +3385,7 @@ index 0bfab6b..0000000
- g_free (access_token_secret_for_refresh);
- g_free (session_handle_for_refresh);
- g_free (password);
- g_clear_pointer (&credentials, g_variant_unref);
- g_clear_pointer (&credentials, (GDestroyNotify) g_variant_unref);
-
- g_mutex_unlock (lock);
-
@ -3712,34 +3731,201 @@ index d4ffa3c..0000000
-G_END_DECLS
-
-#endif /* __GOA_OAUTH_PROVIDER_H__ */
diff --git a/src/goabackend/goapocketprovider.c b/src/goabackend/goapocketprovider.c
index 38f9863..0d1a8ce 100644
--- a/src/goabackend/goapocketprovider.c
+++ b/src/goabackend/goapocketprovider.c
@@ -185,32 +185,6 @@ build_authorization_uri (GoaOAuth2Provider *oauth2_provider,
return url;
}
-static gboolean
-decide_navigation_policy (GoaOAuth2Provider *oauth2_provider,
- WebKitWebView *web_view,
- WebKitNavigationPolicyDecision *decision)
-{
- GoaPocketProvider *self = GOA_POCKET_PROVIDER (oauth2_provider);
- WebKitNavigationAction *action;
- WebKitURIRequest *request;
- gboolean ret = FALSE;
- const gchar *uri;
-
- action = webkit_navigation_policy_decision_get_navigation_action (decision);
- request = webkit_navigation_action_get_request (action);
- uri = webkit_uri_request_get_uri (request);
- if (!g_str_has_prefix (uri, "https://getpocket.com/a/"))
- goto out;
-
- webkit_uri_request_set_uri (request, self->authorization_uri);
- webkit_web_view_load_request (web_view, request);
-
- ret = TRUE;
-
- out:
- return ret;
-}
-
static gboolean
process_redirect_url (GoaOAuth2Provider *oauth2_provider,
const gchar *redirect_url,
@@ -279,68 +253,6 @@ get_identity_sync (GoaOAuth2Provider *oauth2_provider,
/* ---------------------------------------------------------------------------------------------------- */
-static gboolean
-is_deny_node (GoaOAuth2Provider *oauth2_provider, WebKitDOMNode *node)
-{
- WebKitDOMElement *element;
- gboolean ret = FALSE;
- gchar *id = NULL;
- gchar *class = NULL;
- gchar *text = NULL;
-
- if (!WEBKIT_DOM_IS_ELEMENT (node))
- goto out;
-
- element = WEBKIT_DOM_ELEMENT (node);
-
- /* Desktop version */
- id = webkit_dom_element_get_id (element);
- if (g_strcmp0 (id, "denyButton") == 0)
- {
- ret = TRUE;
- goto out;
- }
-
- /* Mobile version */
- class = webkit_dom_element_get_class_name (element);
- if (g_strcmp0 (class, "toolbarButton") != 0)
- goto out;
-
- /* FIXME: This only seems to work if we don't click on the "Sign Up"
- * button, does the check need to be done again? */
- text = webkit_dom_node_get_text_content (node);
- if (g_strcmp0 (text, "Cancel") != 0)
- goto out;
-
- ret = TRUE;
-
- out:
- g_free (id);
- g_free (class);
- g_free (text);
- return ret;
-}
-
-static gboolean
-is_identity_node (GoaOAuth2Provider *oauth2_provider, WebKitDOMHTMLInputElement *element)
-{
- gboolean ret = FALSE;
- gchar *name;
-
- name = webkit_dom_html_input_element_get_name (element);
- if (g_strcmp0 (name, "feed_id") != 0)
- goto out;
-
- ret = TRUE;
-
-out:
- g_free (name);
- return ret;
-
-}
-
-/* ---------------------------------------------------------------------------------------------------- */
-
static gboolean
build_object (GoaProvider *provider,
GoaObjectSkeleton *object,
@@ -431,15 +343,12 @@ goa_pocket_provider_class_init (GoaPocketProviderClass *klass)
provider_class->build_object = build_object;
oauth2_class->build_authorization_uri = build_authorization_uri;
- oauth2_class->decide_navigation_policy = decide_navigation_policy;
oauth2_class->get_authorization_uri = get_authorization_uri;
oauth2_class->get_token_uri = get_token_uri;
oauth2_class->get_redirect_uri = get_redirect_uri;
oauth2_class->get_client_id = get_client_id;
oauth2_class->get_client_secret = get_client_secret;
oauth2_class->get_identity_sync = get_identity_sync;
- oauth2_class->is_deny_node = is_deny_node;
- oauth2_class->is_identity_node = is_identity_node;
oauth2_class->add_account_key_values = add_account_key_values;
oauth2_class->process_redirect_url = process_redirect_url;
}
diff --git a/src/goabackend/goaprovider.c b/src/goabackend/goaprovider.c
index 9e5bd45..9712cd2 100644
index c8f7f0d..fe8ce22 100644
--- a/src/goabackend/goaprovider.c
+++ b/src/goabackend/goaprovider.c
@@ -27,7 +27,6 @@
@@ -28,7 +28,6 @@
#include "goafacebookprovider.h"
#include "goaimapsmtpprovider.h"
#include "goaowncloudprovider.h"
-#include "goaflickrprovider.h"
#include "goafoursquareprovider.h"
#include "goawindowsliveprovider.h"
#include "goamediaserverprovider.h"
@@ -947,9 +946,6 @@ static struct
#include "goatelepathyfactory.h"
@@ -968,9 +967,6 @@ static struct
#ifdef GOA_WINDOWS_LIVE_ENABLED
{ GOA_WINDOWS_LIVE_NAME, goa_windows_live_provider_get_type },
#endif
-#ifdef GOA_FLICKR_ENABLED
- { GOA_FLICKR_NAME, goa_flickr_provider_get_type },
-#endif
#ifdef GOA_FOURSQUARE_ENABLED
{ GOA_FOURSQUARE_NAME, goa_foursquare_provider_get_type },
#ifdef GOA_POCKET_ENABLED
{ GOA_POCKET_NAME, goa_pocket_provider_get_type },
#endif
diff --git a/src/goabackend/goatodoistprovider.c b/src/goabackend/goatodoistprovider.c
index d97c33c..7f17a59 100644
--- a/src/goabackend/goatodoistprovider.c
+++ b/src/goabackend/goatodoistprovider.c
@@ -133,33 +133,6 @@ build_authorization_uri (GoaOAuth2Provider *oauth2_provider,
/* ---------------------------------------------------------------------------------------------------- */
-static gboolean
-is_identity_node (GoaOAuth2Provider *oauth2_provider, WebKitDOMHTMLInputElement *element)
-{
- gboolean ret = FALSE;
- gchar *element_type = NULL;
- gchar *id = NULL;
- gchar *name = NULL;
-
- g_object_get (element, "type", &element_type, NULL);
- if (g_strcmp0 (element_type, "email") != 0)
- goto out;
-
- id = webkit_dom_element_get_id (WEBKIT_DOM_ELEMENT (element));
- if (g_strcmp0 (id, "email") != 0)
- goto out;
-
- ret = TRUE;
-
- out:
- g_free (element_type);
- g_free (id);
- g_free (name);
- return ret;
-}
-
-/* ---------------------------------------------------------------------------------------------------- */
-
static gchar *
get_identity_sync (GoaOAuth2Provider *oauth2_provider,
const gchar *access_token,
@@ -337,6 +310,5 @@ goa_todoist_provider_class_init (GoaTodoistProviderClass *klass)
oauth2_class->get_client_secret = get_client_secret;
oauth2_class->get_scope = get_scope;
oauth2_class->get_identity_sync = get_identity_sync;
- oauth2_class->is_identity_node = is_identity_node;
oauth2_class->add_account_key_values = add_account_key_values;
}
diff --git a/src/goabackend/goawebextension.c b/src/goabackend/goawebextension.c
deleted file mode 100644
index a17edf2..0000000
index 6a25ab9..0000000
--- a/src/goabackend/goawebextension.c
+++ /dev/null
@@ -1,268 +0,0 @@
@@ -1,273 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/*
- * Copyright © 2015 Damián Nohales
@ -3778,6 +3964,11 @@ index a17edf2..0000000
- gchar *provider_type;
-};
-
-struct _GoaWebExtensionClass
-{
- GObjectClass parent;
-};
-
-enum
-{
- PROP_0,
@ -4010,10 +4201,10 @@ index a17edf2..0000000
-}
diff --git a/src/goabackend/goawebextension.h b/src/goabackend/goawebextension.h
deleted file mode 100644
index 994f43f..0000000
index 4a8cf8f..0000000
--- a/src/goabackend/goawebextension.h
+++ /dev/null
@@ -1,37 +0,0 @@
@@ -1,42 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/*
- * Copyright © 2015 Damián Nohales
@ -4042,8 +4233,13 @@ index 994f43f..0000000
-G_BEGIN_DECLS
-
-#define GOA_TYPE_WEB_EXTENSION (goa_web_extension_get_type())
-G_DECLARE_FINAL_TYPE (GoaWebExtension, goa_web_extension, GOA, WEB_EXTENSION, GObject);
-#define GOA_WEB_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOA_TYPE_WEB_EXTENSION, GoaWebExtension))
-#define GOA_IS_WEB_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOA_TYPE_WEB_EXTENSION))
-
-typedef struct _GoaWebExtension GoaWebExtension;
-typedef struct _GoaWebExtensionClass GoaWebExtensionClass;
-
-GType goa_web_extension_get_type (void);
-GoaWebExtension *goa_web_extension_new (WebKitWebExtension *wk_extension,
- const gchar *provider_type,
- const gchar *existing_identity);
@ -4053,10 +4249,10 @@ index 994f43f..0000000
-#endif /* __GOA_WEB_EXTENSION_H__ */
diff --git a/src/goabackend/goawebextensionmain.c b/src/goabackend/goawebextensionmain.c
deleted file mode 100644
index 061825f..0000000
index 4fc91e5..0000000
--- a/src/goabackend/goawebextensionmain.c
+++ /dev/null
@@ -1,46 +0,0 @@
@@ -1,53 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/*
- * Copyright © 2015 Damián Nohales
@ -4086,9 +4282,16 @@ index 061825f..0000000
-static GoaWebExtension *the_extension;
-
-/* Silence -Wmissing-prototypes */
-void webkit_web_extension_initialize (WebKitWebExtension *wk_extension);
-void webkit_web_extension_initialize_with_user_data (WebKitWebExtension *wk_extension, GVariant *user_data);
-
-G_MODULE_EXPORT void
-webkit_web_extension_initialize (WebKitWebExtension *wk_extension)
-{
- g_warning ("Error initializing web extension: user data not set");
-}
-
-G_MODULE_EXPORT void
-webkit_web_extension_initialize_with_user_data (WebKitWebExtension *wk_extension, GVariant *user_data)
-{
- const gchar *existing_identity;
@ -4105,10 +4308,10 @@ index 061825f..0000000
-}
diff --git a/src/goabackend/goawebview.c b/src/goabackend/goawebview.c
deleted file mode 100644
index 2438e0c..0000000
index b7af122..0000000
--- a/src/goabackend/goawebview.c
+++ /dev/null
@@ -1,515 +0,0 @@
@@ -1,501 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright © 2015 Damián Nohales
@ -4135,7 +4338,7 @@ index 2438e0c..0000000
-
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-#include <jsc/jsc.h>
-#include <JavaScriptCore/JavaScript.h>
-#include <libsoup/soup.h>
-#include <webkit2/webkit2.h>
-
@ -4157,6 +4360,11 @@ index 2438e0c..0000000
- gulong notify_progress_id;
-};
-
-struct _GoaWebViewClass
-{
- GtkOverlayClass parent_class;
-};
-
-enum
-{
- PROP_0,
@ -4350,41 +4558,26 @@ index 2438e0c..0000000
-static void
-web_view_script_message_received_password_submit_cb (GoaWebView *self, WebKitJavascriptResult *js_result)
-{
- JSCValue *jsc_value;
- gchar *password = NULL;
- JSGlobalContextRef js_context;
- JSStringRef js_string;
- JSValueRef js_value;
- gsize max_size;
-
- jsc_value = webkit_javascript_result_get_js_value (js_result);
- password = jsc_value_to_string (jsc_value);
- if (password != NULL && password[0] != '\0')
- g_signal_emit (self, signals[PASSWORD_SUBMIT], 0, password);
- js_value = webkit_javascript_result_get_value (js_result);
- js_context = webkit_javascript_result_get_global_context (js_result);
- js_string = JSValueToStringCopy (js_context, js_value, NULL);
- max_size = JSStringGetMaximumUTF8CStringSize (js_string);
- if (max_size > 0)
- {
- gchar *password;
-
- g_free (password);
-}
- password = g_malloc0 (max_size);
- JSStringGetUTF8CString (js_string, password, max_size);
- g_signal_emit (self, signals[PASSWORD_SUBMIT], 0, password);
- g_free (password);
- }
-
-static void
-goa_web_view_get_preferred_height (GtkWidget *widget, gint *minimum_size, gint *natural_size)
-{
- if (minimum_size != NULL)
- *minimum_size = 200;
-
- if (natural_size != NULL)
- *natural_size = 400;
-}
-
-static void
-goa_web_view_get_preferred_width (GtkWidget *widget, gint *minimum_size, gint *natural_size)
-{
- if (minimum_size != NULL)
- *minimum_size = 300;
-
- if (natural_size != NULL)
- *natural_size = 500;
-}
-
-static GtkSizeRequestMode
-goa_web_view_get_request_mode (GtkWidget *widget)
-{
- return GTK_SIZE_REQUEST_CONSTANT_SIZE;
- JSStringRelease (js_string);
-}
-
-static void
@ -4398,7 +4591,6 @@ index 2438e0c..0000000
- self->context = webkit_web_context_new ();
- language_names = g_get_language_names ();
- webkit_web_context_set_preferred_languages (self->context, language_names);
- webkit_web_context_set_sandbox_enabled (self->context, TRUE);
- g_signal_connect_swapped (self->context,
- "initialize-web-extensions",
- G_CALLBACK (web_view_initialize_web_extensions_cb),
@ -4420,6 +4612,7 @@ index 2438e0c..0000000
- "user-content-manager", self->user_content_manager,
- "web-context", self->context,
- NULL));
- gtk_widget_set_size_request (self->web_view, 500, 400);
- gtk_container_add (GTK_CONTAINER (self), self->web_view);
-
-#ifdef GOA_INSPECTOR_ENABLED
@ -4534,18 +4727,14 @@ index 2438e0c..0000000
-static void
-goa_web_view_class_init (GoaWebViewClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
- object_class->constructed = goa_web_view_constructed;
- object_class->dispose = goa_web_view_dispose;
- object_class->finalize = goa_web_view_finalize;
- object_class->set_property = goa_web_view_set_property;
-
- widget_class->get_preferred_height = goa_web_view_get_preferred_height;
- widget_class->get_preferred_width = goa_web_view_get_preferred_width;
- widget_class->get_request_mode = goa_web_view_get_request_mode;
-
- g_object_class_install_property (object_class,
- PROP_EXISTING_IDENTITY,
- g_param_spec_string ("existing-identity",
@ -4626,10 +4815,10 @@ index 2438e0c..0000000
-}
diff --git a/src/goabackend/goawebview.h b/src/goabackend/goawebview.h
deleted file mode 100644
index 4d5d77f..0000000
index 4b415cd..0000000
--- a/src/goabackend/goawebview.h
+++ /dev/null
@@ -1,38 +0,0 @@
@@ -1,43 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright © 2012 2017 Red Hat, Inc.
@ -4658,8 +4847,13 @@ index 4d5d77f..0000000
-G_BEGIN_DECLS
-
-#define GOA_TYPE_WEB_VIEW (goa_web_view_get_type ())
-G_DECLARE_FINAL_TYPE (GoaWebView, goa_web_view, GOA, WEB_VIEW, GtkOverlay);
-#define GOA_WEB_VIEW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GOA_TYPE_WEB_VIEW, GoaWebView))
-#define GOA_IS_WEB_VIEW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GOA_TYPE_WEB_VIEW))
-
-typedef struct _GoaWebView GoaWebView;
-typedef struct _GoaWebViewClass GoaWebViewClass;
-
-GType goa_web_view_get_type (void) G_GNUC_CONST;
-GtkWidget *goa_web_view_new (GoaProvider *provider,
- const gchar *existing_identity);
-GtkWidget *goa_web_view_get_view (GoaWebView *self);
@ -4669,10 +4863,10 @@ index 4d5d77f..0000000
-
-#endif /* __GOA_WEB_VIEW_H__ */
diff --git a/src/goabackend/goawindowsliveprovider.c b/src/goabackend/goawindowsliveprovider.c
index be35746..0ac5efb 100644
index 10c2dcf..2135fbd 100644
--- a/src/goabackend/goawindowsliveprovider.c
+++ b/src/goabackend/goawindowsliveprovider.c
@@ -93,7 +93,8 @@ get_token_uri (GoaOAuth2Provider *oauth2_provider)
@@ -94,7 +94,8 @@ get_token_uri (GoaOAuth2Provider *oauth2_provider)
static const gchar *
get_redirect_uri (GoaOAuth2Provider *oauth2_provider)
{
@ -4682,7 +4876,7 @@ index be35746..0ac5efb 100644
}
static const gchar *
@@ -232,36 +233,6 @@ get_identity_sync (GoaOAuth2Provider *oauth2_provider,
@@ -234,36 +235,6 @@ get_identity_sync (GoaOAuth2Provider *oauth2_provider,
/* ---------------------------------------------------------------------------------------------------- */
@ -4719,7 +4913,7 @@ index be35746..0ac5efb 100644
static gboolean
build_object (GoaProvider *provider,
GoaObjectSkeleton *object,
@@ -377,6 +348,5 @@ goa_windows_live_provider_class_init (GoaWindowsLiveProviderClass *klass)
@@ -390,6 +361,5 @@ goa_windows_live_provider_class_init (GoaWindowsLiveProviderClass *klass)
oauth2_class->get_client_id = get_client_id;
oauth2_class->get_client_secret = get_client_secret;
oauth2_class->get_identity_sync = get_identity_sync;

View File

@ -1,690 +0,0 @@
diff --git a/data/org.gnome.online-accounts.gschema.xml b/data/org.gnome.online-accounts.gschema.xml
index 46b79b2..4419d61 100644
--- a/data/org.gnome.online-accounts.gschema.xml
+++ b/data/org.gnome.online-accounts.gschema.xml
@@ -6,6 +6,8 @@
<summary>List of providers that are allowed to be loaded</summary>
<description>
A list of strings representing the providers that are allowed to be loaded (default: 'all'). This is only evaluated on startup.
+
+ Deprecated: use goa.conf in the system config directory instead, with a key [providers] enable=all instead. The key is comma-separated list of the provider names.
</description>
</key>
</schema>
diff --git a/src/goabackend/Makefile.am b/src/goabackend/Makefile.am
index c7e00a4..68795f1 100644
--- a/src/goabackend/Makefile.am
+++ b/src/goabackend/Makefile.am
@@ -12,6 +12,7 @@ AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"GoaBackend\" \
-DGOA_BACKEND_COMPILATION \
-DGOA_API_IS_SUBJECT_TO_CHANGE \
+ -DGOA_CONF_FILENAME=\""$(sysconfdir)/goa.conf"\" \
-DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
-DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
-DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \
diff --git a/src/goabackend/goaexchangeprovider.c b/src/goabackend/goaexchangeprovider.c
index 46d4314..826549e 100644
--- a/src/goabackend/goaexchangeprovider.c
+++ b/src/goabackend/goaexchangeprovider.c
@@ -86,6 +86,8 @@ build_object (GoaProvider *provider,
GoaExchange *exchange = NULL;
GoaMail *mail = NULL;
GoaPasswordBased *password_based = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gboolean calendar_enabled;
gboolean contacts_enabled;
gboolean mail_enabled;
@@ -115,11 +117,14 @@ build_object (GoaProvider *provider,
NULL);
}
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
/* Email */
mail = goa_object_get_mail (GOA_OBJECT (object));
- mail_enabled = g_key_file_get_boolean (key_file, group, "MailEnabled", NULL);
+ mail_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_MAIL) &&
+ g_key_file_get_boolean (key_file, group, "MailEnabled", NULL);
if (mail_enabled)
{
if (mail == NULL)
@@ -139,13 +144,17 @@ build_object (GoaProvider *provider,
}
/* Calendar */
- calendar_enabled = g_key_file_get_boolean (key_file, group, "CalendarEnabled", NULL);
+ calendar_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_CALENDAR) &&
+ g_key_file_get_boolean (key_file, group, "CalendarEnabled", NULL);
goa_object_skeleton_attach_calendar (object, NULL, calendar_enabled, FALSE);
/* Contacts */
- contacts_enabled = g_key_file_get_boolean (key_file, group, "ContactsEnabled", NULL);
+ contacts_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_CONTACTS) &&
+ g_key_file_get_boolean (key_file, group, "ContactsEnabled", NULL);
goa_object_skeleton_attach_contacts (object, NULL, contacts_enabled, FALSE);
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
/* Exchange */
exchange = goa_object_get_exchange (GOA_OBJECT (object));
if (exchange == NULL)
diff --git a/src/goabackend/goafacebookprovider.c b/src/goabackend/goafacebookprovider.c
index c1d35d0..80ee5e2 100644
--- a/src/goabackend/goafacebookprovider.c
+++ b/src/goabackend/goafacebookprovider.c
@@ -253,6 +253,8 @@ build_object (GoaProvider *provider,
GError **error)
{
GoaAccount *account = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gboolean photos_enabled;
gboolean maps_enabled;
gboolean ret = FALSE;
@@ -267,10 +269,13 @@ build_object (GoaProvider *provider,
error))
goto out;
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
/* Photos */
- photos_enabled = g_key_file_get_boolean (key_file, group, "PhotosEnabled", NULL);
+ photos_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_PHOTOS) &&
+ g_key_file_get_boolean (key_file, group, "PhotosEnabled", NULL);
goa_object_skeleton_attach_photos (object, photos_enabled);
if (just_added)
@@ -284,9 +289,12 @@ build_object (GoaProvider *provider,
}
/* Maps */
- maps_enabled = g_key_file_get_boolean (key_file, group, "MapsEnabled", NULL);
+ maps_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_MAPS) &&
+ g_key_file_get_boolean (key_file, group, "MapsEnabled", NULL);
goa_object_skeleton_attach_maps (object, maps_enabled);
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
if (just_added)
{
goa_account_set_maps_disabled (account, !maps_enabled);
diff --git a/src/goabackend/goafedoraprovider.c b/src/goabackend/goafedoraprovider.c
index 36cb808..cbc8062 100644
--- a/src/goabackend/goafedoraprovider.c
+++ b/src/goabackend/goafedoraprovider.c
@@ -348,6 +348,8 @@ build_object (GoaProvider *provider,
{
GoaAccount *account;
GoaTicketing *ticketing = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gboolean ticketing_enabled;
gboolean ret = FALSE;
@@ -360,10 +362,15 @@ build_object (GoaProvider *provider,
error))
goto out;
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
ticketing = goa_object_get_ticketing (GOA_OBJECT (object));
- ticketing_enabled = g_key_file_get_boolean (key_file, group, "TicketingEnabled", NULL);
+ ticketing_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_TICKETING) &&
+ g_key_file_get_boolean (key_file, group, "TicketingEnabled", NULL);
+
+ g_clear_pointer (&goa_conf, g_key_file_free);
if (ticketing_enabled)
{
diff --git a/src/goabackend/goafoursquareprovider.c b/src/goabackend/goafoursquareprovider.c
index def21cb..98a5431 100644
--- a/src/goabackend/goafoursquareprovider.c
+++ b/src/goabackend/goafoursquareprovider.c
@@ -261,6 +261,8 @@ build_object (GoaProvider *provider,
GError **error)
{
GoaAccount *account = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gboolean maps_enabled;
gboolean ret = FALSE;
@@ -274,12 +276,17 @@ build_object (GoaProvider *provider,
error))
goto out;
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
/* Maps */
- maps_enabled = g_key_file_get_boolean (key_file, group, "MapsEnabled", NULL);
+ maps_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_MAPS) &&
+ g_key_file_get_boolean (key_file, group, "MapsEnabled", NULL);
goa_object_skeleton_attach_maps (object, maps_enabled);
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
if (just_added)
{
goa_account_set_maps_disabled (account, !maps_enabled);
diff --git a/src/goabackend/goagoogleprovider.c b/src/goabackend/goagoogleprovider.c
index 0fb40c3..7a4a717 100644
--- a/src/goabackend/goagoogleprovider.c
+++ b/src/goabackend/goagoogleprovider.c
@@ -271,6 +271,8 @@ build_object (GoaProvider *provider,
{
GoaAccount *account = NULL;
GoaMail *mail = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gchar *uri_caldav;
gchar *uri_drive;
gboolean ret = FALSE;
@@ -291,12 +293,15 @@ build_object (GoaProvider *provider,
error))
goto out;
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
email_address = goa_account_get_identity (account);
/* Email */
mail = goa_object_get_mail (GOA_OBJECT (object));
- mail_enabled = g_key_file_get_boolean (key_file, group, "MailEnabled", NULL);
+ mail_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_MAIL) &&
+ g_key_file_get_boolean (key_file, group, "MailEnabled", NULL);
if (mail_enabled)
{
if (mail == NULL)
@@ -326,28 +331,34 @@ build_object (GoaProvider *provider,
}
/* Calendar */
- calendar_enabled = g_key_file_get_boolean (key_file, group, "CalendarEnabled", NULL);
+ calendar_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_CALENDAR) &&
+ g_key_file_get_boolean (key_file, group, "CalendarEnabled", NULL);
uri_caldav = g_strconcat ("https://apidata.googleusercontent.com/caldav/v2/", email_address, "/user", NULL);
goa_object_skeleton_attach_calendar (object, uri_caldav, calendar_enabled, FALSE);
g_free (uri_caldav);
/* Contacts */
- contacts_enabled = g_key_file_get_boolean (key_file, group, "ContactsEnabled", NULL);
+ contacts_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_CONTACTS) &&
+ g_key_file_get_boolean (key_file, group, "ContactsEnabled", NULL);
goa_object_skeleton_attach_contacts (object,
"https://www.googleapis.com/.well-known/carddav",
contacts_enabled,
FALSE);
/* Files */
- files_enabled = g_key_file_get_boolean (key_file, group, "FilesEnabled", NULL);
+ files_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_FILES) &&
+ g_key_file_get_boolean (key_file, group, "FilesEnabled", NULL);
uri_drive = g_strconcat ("google-drive://", email_address, "/", NULL);
goa_object_skeleton_attach_files (object, uri_drive, files_enabled, FALSE);
g_free (uri_drive);
/* Printers */
- printers_enabled = g_key_file_get_boolean (key_file, group, "PrintersEnabled", NULL);
+ printers_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_PRINTERS) &&
+ g_key_file_get_boolean (key_file, group, "PrintersEnabled", NULL);
goa_object_skeleton_attach_printers (object, printers_enabled);
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
if (just_added)
{
goa_account_set_mail_disabled (account, !mail_enabled);
diff --git a/src/goabackend/goaimapsmtpprovider.c b/src/goabackend/goaimapsmtpprovider.c
index 811d48c..abaa4d9 100644
--- a/src/goabackend/goaimapsmtpprovider.c
+++ b/src/goabackend/goaimapsmtpprovider.c
@@ -90,6 +90,8 @@ build_object (GoaProvider *provider,
GoaAccount *account = NULL;
GoaMail *mail = NULL;
GoaPasswordBased *password_based = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gboolean enabled;
gboolean imap_accept_ssl_errors;
gboolean imap_use_ssl;
@@ -132,11 +134,17 @@ build_object (GoaProvider *provider,
NULL);
}
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
/* Email */
mail = goa_object_get_mail (GOA_OBJECT (object));
- enabled = g_key_file_get_boolean (key_file, group, "Enabled", NULL);
+ enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_MAIL) &&
+ g_key_file_get_boolean (key_file, group, "Enabled", NULL);
+
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
if (enabled)
{
if (mail == NULL)
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index b3ffc3f..a43dc74 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -380,6 +380,8 @@ build_object (GoaProvider *provider,
{
GoaAccount *account;
GoaTicketing *ticketing = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gboolean ticketing_enabled;
gboolean ret = FALSE;
@@ -392,10 +394,15 @@ build_object (GoaProvider *provider,
error))
goto out;
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
ticketing = goa_object_get_ticketing (GOA_OBJECT (object));
- ticketing_enabled = g_key_file_get_boolean (key_file, group, "TicketingEnabled", NULL);
+ ticketing_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_TICKETING) &&
+ g_key_file_get_boolean (key_file, group, "TicketingEnabled", NULL);
+
+ g_clear_pointer (&goa_conf, g_key_file_free);
if (ticketing_enabled)
{
diff --git a/src/goabackend/goalastfmprovider.c b/src/goabackend/goalastfmprovider.c
index cb9a6f2..1cddadf 100644
--- a/src/goabackend/goalastfmprovider.c
+++ b/src/goabackend/goalastfmprovider.c
@@ -100,6 +100,8 @@ build_object (GoaProvider *provider,
{
GoaAccount *account;
GoaMusic *music = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gboolean music_enabled;
gboolean ret = FALSE;
@@ -115,11 +117,17 @@ build_object (GoaProvider *provider,
error))
goto out;
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
/* Music */
music = goa_object_get_music (GOA_OBJECT (object));
- music_enabled = g_key_file_get_boolean (key_file, group, "MusicEnabled", NULL);
+ music_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_MUSIC) &&
+ g_key_file_get_boolean (key_file, group, "MusicEnabled", NULL);
+
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
if (music_enabled)
{
if (music == NULL)
diff --git a/src/goabackend/goamediaserverprovider.c b/src/goabackend/goamediaserverprovider.c
index 9ffd2a0..7c2d61c 100644
--- a/src/goabackend/goamediaserverprovider.c
+++ b/src/goabackend/goamediaserverprovider.c
@@ -88,6 +88,8 @@ build_object (GoaProvider *provider,
gboolean ret;
GoaAccount *account;
GoaMediaServer *mediaserver;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
const gchar *udn;
gboolean photos_enabled;
@@ -106,13 +108,18 @@ build_object (GoaProvider *provider,
error))
goto out;
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
udn = goa_account_get_identity (account);
/* Photos */
- photos_enabled = g_key_file_get_boolean (key_file, group, "PhotosEnabled", NULL);
+ photos_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_PHOTOS) &&
+ g_key_file_get_boolean (key_file, group, "PhotosEnabled", NULL);
goa_object_skeleton_attach_photos (object, photos_enabled);
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
/* Media Server */
mediaserver = goa_object_get_media_server (GOA_OBJECT (object));
if (mediaserver == NULL)
diff --git a/src/goabackend/goaowncloudprovider.c b/src/goabackend/goaowncloudprovider.c
index d142966..b996e48 100644
--- a/src/goabackend/goaowncloudprovider.c
+++ b/src/goabackend/goaowncloudprovider.c
@@ -136,6 +136,8 @@ build_object (GoaProvider *provider,
GError **error)
{
GoaAccount *account = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gchar *uri_caldav;
gchar *uri_carddav;
gchar *uri_webdav;
@@ -173,6 +175,8 @@ build_object (GoaProvider *provider,
NULL);
}
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
identity = goa_account_get_identity (account);
uri_string = g_key_file_get_string (key_file, group, "Uri", NULL);
@@ -183,23 +187,28 @@ build_object (GoaProvider *provider,
accept_ssl_errors = g_key_file_get_boolean (key_file, group, "AcceptSslErrors", NULL);
/* Calendar */
- calendar_enabled = g_key_file_get_boolean (key_file, group, "CalendarEnabled", NULL);
+ calendar_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_CALENDAR) &&
+ g_key_file_get_boolean (key_file, group, "CalendarEnabled", NULL);
uri_caldav = uri_to_string_with_path (uri, CALDAV_ENDPOINT);
goa_object_skeleton_attach_calendar (object, uri_caldav, calendar_enabled, accept_ssl_errors);
g_free (uri_caldav);
/* Contacts */
- contacts_enabled = g_key_file_get_boolean (key_file, group, "ContactsEnabled", NULL);
+ contacts_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_CONTACTS) &&
+ g_key_file_get_boolean (key_file, group, "ContactsEnabled", NULL);
uri_carddav = uri_to_string_with_path (uri, CARDDAV_ENDPOINT);
goa_object_skeleton_attach_contacts (object, uri_carddav, contacts_enabled, accept_ssl_errors);
g_free (uri_carddav);
/* Files */
- files_enabled = g_key_file_get_boolean (key_file, group, "FilesEnabled", NULL);
+ files_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_FILES) &&
+ g_key_file_get_boolean (key_file, group, "FilesEnabled", NULL);
uri_webdav = get_webdav_uri (uri);
goa_object_skeleton_attach_files (object, uri_webdav, files_enabled, accept_ssl_errors);
g_free (uri_webdav);
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
if (just_added)
{
goa_account_set_calendar_disabled (account, !calendar_enabled);
diff --git a/src/goabackend/goaprovider.c b/src/goabackend/goaprovider.c
index 9712cd2..d178209 100644
--- a/src/goabackend/goaprovider.c
+++ b/src/goabackend/goaprovider.c
@@ -375,6 +375,151 @@ goa_provider_get_provider_group (GoaProvider *self)
return GOA_PROVIDER_GET_CLASS (self)->get_provider_group (self);
}
+static const gchar *
+goa_get_feature_alias (GoaProviderFeatures feature)
+{
+ switch (feature) {
+ case GOA_PROVIDER_FEATURE_MAIL:
+ return "mail";
+ case GOA_PROVIDER_FEATURE_CALENDAR:
+ return "calendar";
+ case GOA_PROVIDER_FEATURE_CONTACTS:
+ return "contacts";
+ case GOA_PROVIDER_FEATURE_CHAT:
+ return "chat";
+ case GOA_PROVIDER_FEATURE_DOCUMENTS:
+ return "documents";
+ case GOA_PROVIDER_FEATURE_PHOTOS:
+ return "photos";
+ case GOA_PROVIDER_FEATURE_FILES:
+ return "files";
+ case GOA_PROVIDER_FEATURE_TICKETING:
+ return "ticketing";
+ case GOA_PROVIDER_FEATURE_READ_LATER:
+ return "read-later";
+ case GOA_PROVIDER_FEATURE_PRINTERS:
+ return "printers";
+ case GOA_PROVIDER_FEATURE_MAPS:
+ return "maps";
+ case GOA_PROVIDER_FEATURE_MUSIC:
+ return "music";
+ case GOA_PROVIDER_FEATURE_TODO:
+ return "todo";
+ case GOA_PROVIDER_FEATURE_BRANDED:
+ case GOA_PROVIDER_FEATURE_INVALID:
+ break;
+ }
+ return NULL;
+}
+
+/*
+ * goa_util_open_goa_conf:
+ *
+ * Reads goa.conf file from the system config directory and
+ * returns it for use for example by goa_util_provider_feature_is_enabled().
+ * It returns %NULL, when the file cannot be opened.
+ *
+ * Free the returned #GKeyFile with g_key_file_free(), when no longer needed.
+ *
+ * Returns: (nullable) (transfer full): a new #GKeyFile containing goa.conf
+ * file, or %NULL, when it cannot be opened.
+ *
+ * Since: 3.40.0-7 / RHEL-40831
+ */
+GKeyFile *
+goa_util_open_goa_conf (void)
+{
+ GKeyFile *goa_conf;
+ GError *error = NULL;
+
+ goa_conf = g_key_file_new ();
+ if (!g_key_file_load_from_file (goa_conf, GOA_CONF_FILENAME, G_KEY_FILE_NONE, &error))
+ {
+ g_debug ("Failed to load '%s': %s", GOA_CONF_FILENAME, error ? error->message : "Unknown error");
+ g_clear_error (&error);
+ g_key_file_free (goa_conf);
+ goa_conf = NULL;
+ }
+
+ return goa_conf;
+}
+
+/*
+ * goa_util_provider_feature_is_enabled:
+ * @goa_conf: (nullable): a #GKeyFile with loaded goa.conf file, or %NULL
+ * @provider_type: a provider type string
+ * @feature: a feature to check, one of %GoaProviderFeatures
+ *
+ * Checks in the @goa_conf, whether the @provider_type can use
+ * the @feature. The @goa_conf is a %GKeyFile returned by
+ * goa_util_open_goa_conf(), it can be %NULL, in which case
+ * the @feature is considered enabled.
+ *
+ * Returns: %TRUE, when the @feature is enabled, %FALSE otherwise
+ *
+ * Since: 3.40.0-7 / RHEL-40831
+ */
+gboolean
+goa_util_provider_feature_is_enabled (GKeyFile *goa_conf,
+ const gchar *provider_type,
+ GoaProviderFeatures feature)
+{
+ GError *error = NULL;
+ const gchar *feature_alias;
+ gboolean enabled;
+
+ if (!goa_conf)
+ return TRUE;
+
+ g_return_val_if_fail (provider_type != NULL, TRUE);
+
+ feature_alias = goa_get_feature_alias (feature);
+ g_return_val_if_fail (feature_alias != NULL, TRUE);
+
+ enabled = g_key_file_get_boolean (goa_conf, provider_type, feature_alias, &error);
+ if (error)
+ {
+ g_clear_error (&error);
+ enabled = g_key_file_get_boolean (goa_conf, "all", feature_alias, &error);
+ if (error)
+ {
+ g_clear_error (&error);
+ enabled = TRUE;
+ }
+ }
+
+ return enabled;
+}
+
+static GoaProviderFeatures
+goa_provider_filter_features (GoaProvider *self,
+ GoaProviderFeatures features)
+{
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
+ guint i;
+
+ goa_conf = goa_util_open_goa_conf ();
+ if (!goa_conf)
+ return features;
+
+ provider_type = goa_provider_get_provider_type (self);
+
+ for (i = 0; provider_features_info[i].property != NULL; i++)
+ {
+ GoaProviderFeatures feature = provider_features_info[i].feature;
+ if ((features & feature) != 0 &&
+ !goa_util_provider_feature_is_enabled (goa_conf, provider_type, feature))
+ {
+ features = features & (~feature);
+ }
+ }
+
+ g_key_file_free (goa_conf);
+
+ return features;
+}
+
/**
* goa_provider_get_provider_features:
* @self: A #GoaProvider.
@@ -391,7 +536,7 @@ goa_provider_get_provider_features (GoaProvider *self)
{
g_return_val_if_fail (GOA_IS_PROVIDER (self), GOA_PROVIDER_FEATURE_INVALID);
g_return_val_if_fail (GOA_PROVIDER_GET_CLASS (self)->get_provider_features != NULL, GOA_PROVIDER_FEATURE_INVALID);
- return GOA_PROVIDER_GET_CLASS (self)->get_provider_features (self);
+ return goa_provider_filter_features (self, GOA_PROVIDER_GET_CLASS (self)->get_provider_features (self));
}
/* ---------------------------------------------------------------------------------------------------- */
@@ -979,14 +1124,35 @@ goa_provider_ensure_builtins_loaded (void)
if (g_once_init_enter (&once_init_value))
{
- GSettings *settings;
- gchar **whitelisted_providers;
+ GKeyFile *goa_conf;
+ gchar **whitelisted_providers = NULL;
guint i;
guint j;
gboolean all = FALSE;
- settings = g_settings_new (GOA_SETTINGS_SCHEMA);
- whitelisted_providers = g_settings_get_strv (settings, GOA_SETTINGS_WHITELISTED_PROVIDERS);
+ goa_conf = goa_util_open_goa_conf ();
+ if (goa_conf)
+ {
+ whitelisted_providers = g_key_file_get_string_list (goa_conf, "providers", "enable", NULL, NULL);
+ /* Let the empty array be like 'all' */
+ if (whitelisted_providers && !*whitelisted_providers)
+ {
+ g_strfreev (whitelisted_providers);
+ whitelisted_providers = g_new0 (gchar *, 2);
+ whitelisted_providers[0] = g_strdup ("all");
+ whitelisted_providers[1] = NULL;
+ }
+ g_clear_pointer (&goa_conf, g_key_file_free);
+ }
+
+ if (!whitelisted_providers)
+ {
+ GSettings *settings;
+
+ settings = g_settings_new (GOA_SETTINGS_SCHEMA);
+ whitelisted_providers = g_settings_get_strv (settings, GOA_SETTINGS_WHITELISTED_PROVIDERS);
+ g_object_unref (settings);
+ }
/* Enable everything if there is 'all'. */
for (i = 0; whitelisted_providers[i] != NULL; i++)
@@ -1025,7 +1191,6 @@ goa_provider_ensure_builtins_loaded (void)
cleanup:
g_strfreev (whitelisted_providers);
- g_object_unref (settings);
g_once_init_leave (&once_init_value, 1);
}
}
diff --git a/src/goabackend/goaprovider.h b/src/goabackend/goaprovider.h
index c4bcf91..e7e8a78 100644
--- a/src/goabackend/goaprovider.h
+++ b/src/goabackend/goaprovider.h
@@ -109,6 +109,11 @@ GtkWidget *goa_util_add_row_switch_from_keyfile_with_blurb (GtkGrid *grid,
const gchar *key,
const gchar *blurb);
+GKeyFile * goa_util_open_goa_conf (void);
+gboolean goa_util_provider_feature_is_enabled (GKeyFile *goa_conf,
+ const gchar *provider_type,
+ GoaProviderFeatures feature);
+
G_END_DECLS
#endif /* __GOA_PROVIDER_H__ */
diff --git a/src/goabackend/goawindowsliveprovider.c b/src/goabackend/goawindowsliveprovider.c
index 0ac5efb..628988d 100644
--- a/src/goabackend/goawindowsliveprovider.c
+++ b/src/goabackend/goawindowsliveprovider.c
@@ -244,6 +244,8 @@ build_object (GoaProvider *provider,
{
GoaAccount *account = NULL;
GoaMail *mail = NULL;
+ GKeyFile *goa_conf;
+ const gchar *provider_type;
gboolean mail_enabled;
gboolean ret = FALSE;
const gchar *email_address;
@@ -258,12 +260,18 @@ build_object (GoaProvider *provider,
error))
goto out;
+ provider_type = goa_provider_get_provider_type (provider);
+ goa_conf = goa_util_open_goa_conf ();
account = goa_object_get_account (GOA_OBJECT (object));
email_address = goa_account_get_presentation_identity (account);
/* Email */
mail = goa_object_get_mail (GOA_OBJECT (object));
- mail_enabled = g_key_file_get_boolean (key_file, group, "MailEnabled", NULL);
+ mail_enabled = goa_util_provider_feature_is_enabled (goa_conf, provider_type, GOA_PROVIDER_FEATURE_MAIL) &&
+ g_key_file_get_boolean (key_file, group, "MailEnabled", NULL);
+
+ g_clear_pointer (&goa_conf, g_key_file_free);
+
if (mail_enabled)
{
if (mail == NULL)

File diff suppressed because it is too large Load Diff

View File

@ -4,26 +4,18 @@
%global libsoup_version 2.42
Name: gnome-online-accounts
Version: 3.40.0
Version: 3.28.2
Release: 7%{?dist}
Summary: Single sign-on framework for GNOME
License: LGPLv2+
URL: https://wiki.gnome.org/Projects/GnomeOnlineAccounts
Source0: https://download.gnome.org/sources/gnome-online-accounts/3.40/%{name}-%{version}.tar.xz
Source0: https://download.gnome.org/sources/gnome-online-accounts/3.28/%{name}-%{version}.tar.xz
# https://pagure.io/fedora-workstation/issue/83
Patch: 0001-Remove-Documents-support.patch
Patch01: 0001-mute-debug-prints.patch
Patch02: 0002-Drop-dependency-on-WebKitGTK-139.patch
# https://gitlab.gnome.org/GNOME/gnome-online-accounts/-/issues/63
# https://bugzilla.redhat.com/show_bug.cgi?id=1913641
Patch: 0001-google-Remove-Photos-support.patch
Patch: kerberos-fixes.patch
Patch: 0003-Drop-dependency-on-WebKitGTK-139.patch
Patch: 0004-Restrict-Services.patch
Obsoletes: gnome-online-accounts-oauth2 < 3.40.0-5
Obsoletes: gnome-online-accounts-oauth2 < 3.28.2-6
BuildRequires: pkgconfig(gcr-3)
BuildRequires: pkgconfig(gio-2.0) >= %{glib2_version}
@ -38,10 +30,11 @@ BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(libsecret-1) >= 0.7
BuildRequires: pkgconfig(libsoup-2.4) >= %{libsoup_version}
BuildRequires: pkgconfig(rest-0.7)
%if ! 0%{?fedora} && 0%{?rhel} <= 7
BuildRequires: pkgconfig(telepathy-glib)
%endif
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: vala
BuildRequires: make
BuildRequires: git
BuildRequires: autoconf
BuildRequires: automake
@ -52,8 +45,8 @@ Requires: libsoup%{?_isa} >= %{libsoup_version}
%description
GNOME Online Accounts provides interfaces so that applications and libraries
in GNOME can access the user's online accounts. It has providers for Google,
Nextcloud, Microsoft Account, Microsoft Exchange, Fedora, IMAP/SMTP and
Kerberos.
ownCloud, Facebook, Foursquare, Microsoft Account, Pocket, Microsoft
Exchange, IMAP/SMTP and Kerberos.
%package devel
Summary: Development files for %{name}
@ -64,13 +57,16 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%autosetup -S git
%setup -q
%patch01 -p1 -b .mute-debug-prints
%patch02 -p1 -b .no-webkitgtk
%build
aclocal -I m4
autoheader
automake
automake --add-missing
libtoolize
#intltoolize --force
autoconf
%configure \
@ -81,15 +77,15 @@ autoconf
--disable-media-server \
--disable-silent-rules \
--disable-static \
--enable-compile-warnings=yes \
--enable-documentation \
--enable-fedora \
--disable-telepathy \
--disable-todoist \
--enable-exchange \
--enable-google \
--enable-gtk-doc \
--enable-imap-smtp \
--enable-kerberos \
--enable-owncloud \
--enable-pocket \
--enable-windows-live
%make_build
@ -99,9 +95,18 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%find_lang %{name}
%if ! 0%{?fedora} && 0%{?rhel} <= 7
%find_lang %{name}-tpaw
%endif
%ldconfig_scriptlets
%if ! 0%{?fedora} && 0%{?rhel} <= 7
%files -f %{name}.lang -f %{name}-tpaw.lang
%else
%files -f %{name}.lang
%endif
%license COPYING
%doc COPYING
%dir %{_libdir}/girepository-1.0
@ -117,10 +122,18 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%{_datadir}/applications/org.gnome.OnlineAccounts.OAuth2.desktop
%{_datadir}/dbus-1/services/org.gnome.OnlineAccounts.service
%{_datadir}/dbus-1/services/org.gnome.Identity.service
%{_datadir}/icons/hicolor/*/apps/goa-*.svg
%{_datadir}/icons/hicolor/*/apps/goa-*.png
%{_datadir}/man/man8/goa-daemon.8*
%{_datadir}/glib-2.0/schemas/org.gnome.online-accounts.gschema.xml
%if ! 0%{?fedora} && 0%{?rhel} <= 7
%{_datadir}/icons/hicolor/*/apps/im-*.png
%{_datadir}/icons/hicolor/*/apps/im-*.svg
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/irc-networks.xml
%endif
%files devel
%{_includedir}/goa-1.0/
%{_libdir}/libgoa-1.0.so
@ -129,130 +142,35 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%{_datadir}/gir-1.0/Goa-1.0.gir
%{_libdir}/pkgconfig/goa-1.0.pc
%{_libdir}/pkgconfig/goa-backend-1.0.pc
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%{_datadir}/gtk-doc/html/goa/
%{_libdir}/goa-1.0/include
%{_datadir}/vala/
%changelog
* Wed Jun 12 2024 Milan Crha <mcrha@redhat.com> - 3.40.0-7
- Resolves: RHEL-40831 (Use /etc/goa.conf to disable features for providers and whole providers)
* Wed Nov 15 2023 Milan Crha <mcrha@redhat.com> - 3.28.2-7
- Related: RHEL-10493 (Add margin around OAuth2 prompt content)
* Wed Nov 15 2023 Milan Crha <mcrha@redhat.com> - 3.40.0-6
- Related: RHEL-10492 (Add margin around OAuth2 prompt content)
* Wed Nov 08 2023 Milan Crha <mcrha@redhat.com> - 3.40.0-5
- Resolves: RHEL-10492 (Move account types that depend on WebKitGTK into separate optional subpackage)
* Thu Nov 09 2023 Milan Crha <mcrha@redhat.com> - 3.28.2-6
- Resolves: RHEL-10493 (Move account types that depend on WebKitGTK into separate optional subpackage)
- backport upstream fix to use external browser for OAuth2
* Wed Oct 11 2023 Milan Crha <mcrha@redhat.com> - 3.40.0-4
- Resolves: RHEL-10492 (Move account types that depend on WebKitGTK into separate optional subpackage)
* Wed Oct 11 2023 Milan Crha <mcrha@redhat.com> - 3.28.2-5
- Resolves: RHEL-10493 (Move account types that depend on WebKitGTK into separate optional subpackage)
* Tue Jun 06 2023 Ray Strode <rstrode@redhat.com> - 3.40.0-3
- Backport various kerberos fixes from upstream
Resolves: #2177765
* Fri Sep 02 2022 Milan Crha <mcrha@redhat.com> - 3.28.2-4
- Resolves: #2068010 (Turn runtime warnings around libsecret into debug prints)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.40.0-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Sat Apr 24 2021 Debarshi Ray <rishi@fedoraproject.org> - 3.28.2-3
- Disable the Facebook and Foursquare providers
Resolves: #1951086, #1952136
* Thu Apr 22 2021 Debarshi Ray <rishi@fedoraproject.org> - 3.40.0-1
- Update to 3.40.0
- Disable the Facebook, Flickr and Foursquare providers
- Remove Photos support from the Google provider
Resolves: #1913641
* Mon Feb 01 2021 Tomas Popela <tpopela@redhat.com> - 3.28.2-2
- Rebuild to fix multilib issues
Resolves: #1765627
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 3.39.92-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Mar 16 2021 Debarshi Ray <rishi@fedoraproject.org> - 3.39.92-1
- Update to 3.39.92
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.38.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Oct 16 2020 Kalev Lember <klember@redhat.com> - 3.38.0-1
- Update to 3.38.0
* Mon Aug 10 2020 Debarshi Ray <rishi@fedoraproject.org> - 3.37.90-1
- Update to 3.37.90
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.36.0-3
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.36.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Mar 10 2020 Kalev Lember <klember@redhat.com> - 3.36.0-1
- Update to 3.36.0
* Tue Feb 11 2020 Kalev Lember <klember@redhat.com> - 3.35.90-1
- Update to 3.35.90
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.35.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Jan 04 2020 Debarshi Ray <rishi@fedoraproject.org> - 3.35.3-1
- Update to 3.35.3
* Tue Oct 15 2019 Debarshi Ray <rishi@fedoraproject.org> - 3.35.1-1
- Update to 3.35.1
* Wed Sep 11 2019 Kalev Lember <klember@redhat.com> - 3.34.0-1
- Update to 3.34.0
* Tue Sep 03 2019 Kalev Lember <klember@redhat.com> - 3.33.92-1
- Update to 3.33.92
* Wed Aug 21 2019 Debarshi Ray <rishi@fedoraproject.org> - 3.33.91-1
- Update to 3.33.91
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.32.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Mar 29 2019 Kalev Lember <klember@redhat.com> - 3.32.0-1
- Update to 3.32.0
* Sat Feb 09 2019 Debarshi Ray <rishi@fedoraproject.org> - 3.31.90-1
- Update to 3.31.90
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.31.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Dec 17 2018 Debarshi Ray <rishi@fedoraproject.org> - 3.31.3-2
- Drop the documents integration (fedora-workstation/issue/83)
* Wed Dec 12 2018 Debarshi Ray <rishi@fedoraproject.org> - 3.31.3-1
- Update to 3.31.3
* Fri Sep 07 2018 Kalev Lember <klember@redhat.com> - 3.30.0-3
- Rebuilt against fixed atk (#1626575)
* Fri Sep 07 2018 Kalev Lember <klember@redhat.com> - 3.30.0-2
- Fix gtk-doc directory ownership
* Mon Sep 03 2018 Debarshi Ray <rishi@fedoraproject.org> - 3.30.0-1
- Update to 3.30.0
- Disable Pocket
* Thu Aug 16 2018 Debarshi Ray <rishi@fedoraproject.org> - 3.29.91-1
- Update to 3.29.91
* Thu Aug 9 2018 Owen Taylor <otaylor@redhat.com> - 3.29.4-2
- Remove Requires: gettext-libs - it is extraneous
- Use a glob for man page, to handle variations in man page compression.
* Wed Jul 18 2018 Debarshi Ray <rishi@fedoraproject.org> - 3.29.4-1
- Update to 3.29.4
* Mon Jul 16 2018 Debarshi Ray <rishi@fedoraproject.org> - 3.29.1-1
- Update to 3.29.1
- Drop RHEL 7 compatibility because Telepathy is no longer supported
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.28.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Nov 05 2019 Debarshi Ray <rishi@fedoraproject.org> - 3.28.2-1
- Update to 3.28.2
Resolves: #1674535
* Thu Mar 15 2018 Kalev Lember <klember@redhat.com> - 3.28.0-1
- Update to 3.28.0