--- a/configure.ac Fri Apr 09 23:53:08 2021 -0500
+++ b/configure.ac Fri Apr 09 23:53:13 2021 -0500
@@ -355,7 +355,7 @@
AC_ARG_ENABLE(gevolution,
[AC_HELP_STRING([--enable-gevolution],
[compile with the Evolution plugin])],
- enable_gevolution="$enableval", enable_gevolution="no")
+ enable_gevolution="$enableval", enable_gevolution="yes") [AC_HELP_STRING([--enable-cap],
[compile with Contact Availability Prediction plugin])],
@@ -529,18 +529,10 @@
dnl # Check for stuff needed by the Evolution integration plugin.
dnl #######################################################################
if test "x$enable_gevolution" = "xyes"; then
- evo_deps="libebook-1.2 libedata-book-1.2 evolution-data-server-1.2 < 3.6"
+ evo_deps="libebook-1.2 libedata-book-1.2 evolution-data-server-1.2 >= 3.6" PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, , [
- if test "x$enable_gevolution" = "xno"; then
- evo_deps="libebook-1.0 libedata-book-1.0"
- PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, [
- enable_gevolution="yes"
if test "x$enable_gevolution" = "xyes"; then
AC_DEFINE(HAVE_EVOLUTION_ADDRESSBOOK, 1, [Define if we're using evolution addressbook.])
AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
@@ -548,7 +540,7 @@
if test "x$force_deps" = "xyes" ; then
-Evolution development headers not found (libebook, libedata-book, evolution-data-server < 3.6).
+Evolution development headers not found (libebook, libedata-book, evolution-data-server >= 3.6). Use --disable-gevolution if you do not need it.
--- a/pidgin/plugins/gevolution/add_buddy_dialog.c Fri Apr 09 23:53:08 2021 -0500
+++ b/pidgin/plugins/gevolution/add_buddy_dialog.c Fri Apr 09 23:53:13 2021 -0500
@@ -227,8 +227,7 @@
-populate_treeview(GevoAddBuddyDialog *dialog, const gchar *uri)
+populate_treeview(GevoAddBuddyDialog *dialog, const gchar *uid) { @@ -250,8 +249,7 @@
gtk_list_store_clear(dialog->model);
- if (!gevo_load_addressbook(uri, &book, &err))
+ if(!gevo_load_addressbook(uid, &book, &err)) { purple_debug_error("evolution",
"Error retrieving default addressbook: %s\n", err->message);
@@ -328,16 +326,17 @@
addrbook_change_cb(GtkComboBox *combo, GevoAddBuddyDialog *dialog)
- const char *esource_uri;
+ const char *esource_uid; - if (!gtk_combo_box_get_active_iter(combo, &iter))
+ if(!gtk_combo_box_get_active_iter(combo, &iter)) { gtk_tree_model_get(GTK_TREE_MODEL(dialog->addrbooks), &iter,
- ADDRBOOK_COLUMN_URI, &esource_uri,
+ ADDRBOOK_COLUMN_UID, &esource_uid, - populate_treeview(dialog, esource_uri);
+ populate_treeview(dialog, esource_uid); --- a/pidgin/plugins/gevolution/assoc-buddy.c Fri Apr 09 23:53:08 2021 -0500
+++ b/pidgin/plugins/gevolution/assoc-buddy.c Fri Apr 09 23:53:13 2021 -0500
@@ -130,8 +130,7 @@
-populate_treeview(GevoAssociateBuddyDialog *dialog, const gchar *uri)
+populate_treeview(GevoAssociateBuddyDialog *dialog, const gchar *uid) { @@ -154,8 +153,7 @@
gtk_list_store_clear(dialog->model);
- if (!gevo_load_addressbook(uri, &book, &err))
+ if(!gevo_load_addressbook(uid, &book, &err)) { purple_debug_error("evolution",
"Error retrieving addressbook: %s\n", err->message);
@@ -241,16 +239,17 @@
addrbook_change_cb(GtkComboBox *combo, GevoAssociateBuddyDialog *dialog)
- const char *esource_uri;
+ const char *esource_uid; - if (!gtk_combo_box_get_active_iter(combo, &iter))
+ if(!gtk_combo_box_get_active_iter(combo, &iter)) { gtk_tree_model_get(GTK_TREE_MODEL(dialog->addrbooks), &iter,
- ADDRBOOK_COLUMN_URI, &esource_uri,
+ ADDRBOOK_COLUMN_UID, &esource_uid, - populate_treeview(dialog, esource_uri);
+ populate_treeview(dialog, esource_uid); --- a/pidgin/plugins/gevolution/eds-utils.c Fri Apr 09 23:53:08 2021 -0500
+++ b/pidgin/plugins/gevolution/eds-utils.c Fri Apr 09 23:53:13 2021 -0500
@@ -52,9 +52,9 @@
gevo_addrbooks_model_populate(GtkTreeModel *model)
- ESourceList *addressbooks;
+ ESourceRegistry *registry;
@@ -63,89 +63,81 @@
list = GTK_LIST_STORE(model);
- if (!e_book_get_addressbooks(&addressbooks, &err))
+ registry = e_source_registry_new_sync(NULL, &err); purple_debug_error("evolution",
- "Unable to fetch list of address books.\n");
+ "Unable to fetch list of address books.\n"); gtk_list_store_append(list, &iter);
gtk_list_store_set(list, &iter,
- ADDRBOOK_COLUMN_NAME, _("None"),
- ADDRBOOK_COLUMN_URI, NULL,
+ ADDRBOOK_COLUMN_NAME, _("None"), + ADDRBOOK_COLUMN_UID, NULL, - groups = e_source_list_peek_groups(addressbooks);
- gtk_list_store_append(list, &iter);
- gtk_list_store_set(list, &iter,
- ADDRBOOK_COLUMN_NAME, _("None"),
- ADDRBOOK_COLUMN_URI, NULL,
- for (g = groups; g != NULL; g = g->next)
- sources = e_source_group_peek_sources(g->data);
+ sources = e_source_registry_list_sources(registry, + E_SOURCE_EXTENSION_ADDRESS_BOOK); - for (s = sources; s != NULL; s = s->next)
- ESource *source = E_SOURCE(s->data);
+ g_object_unref(registry); + gtk_list_store_append(list, &iter); + gtk_list_store_set(list, &iter, + ADDRBOOK_COLUMN_NAME, _("None"), + ADDRBOOK_COLUMN_UID, NULL, - gtk_list_store_append(list, &iter);
- gtk_list_store_set(list, &iter,
- ADDRBOOK_COLUMN_NAME, e_source_peek_name(source),
- ADDRBOOK_COLUMN_URI, e_source_get_uri(source),
- g_object_unref(addressbooks);
+ for(s = sources; s != NULL; s = s->next) { + ESource *source = E_SOURCE(s->data); + gtk_list_store_append(list, &iter); + gtk_list_store_set(list, &iter, + ADDRBOOK_COLUMN_NAME, e_source_get_display_name(source), + ADDRBOOK_COLUMN_UID, e_source_get_uid(source), + g_object_unref(registry); + g_list_free_full(sources, g_object_unref); -gevo_run_query_in_uri(const gchar *uri, EBookQuery *query)
+gevo_run_query_in_source(ESource *source, EBookQuery *query) { - if (!gevo_load_addressbook(uri, &book, &err))
+ if(!gevo_load_addressbook_from_source(source, &book, &err)) { purple_debug_error("evolution",
- "Error retrieving addressbook: %s\n", err->message);
+ "Error retrieving addressbook: %s\n", err->message); status = e_book_get_contacts(book, query, &cards, NULL);
purple_debug_error("evolution", "Error %d in getting card list\n",
EContact *contact = E_CONTACT(cards->data);
GList *cards2 = cards->next;
/* Break off the first contact and free the rest. */
@@ -172,75 +164,63 @@
gevo_search_buddy_in_contacts(PurpleBuddy *buddy, EBookQuery *query)
- ESourceList *addressbooks;
+ ESourceRegistry *registry;
EContactField protocol_field = gevo_prpl_get_field(buddy->account, buddy);
- if (protocol_field == 0)
+ if(protocol_field == 0) {
queries[1] = e_book_query_field_test(protocol_field, E_BOOK_QUERY_IS, buddy->name);
- if (queries[1] == NULL)
+ if(queries[1] == NULL) { purple_debug_error("evolution", "Error in creating protocol query\n");
e_book_query_unref(query);
full_query = e_book_query_and(2, queries, TRUE);
full_query = e_book_query_field_test(protocol_field, E_BOOK_QUERY_IS, buddy->name);
- if (full_query == NULL)
+ if(full_query == NULL) { purple_debug_error("evolution", "Error in creating protocol query\n");
- if (!e_book_get_addressbooks(&addressbooks, &err))
+ registry = e_source_registry_new_sync(NULL, &err); purple_debug_error("evolution",
- "Unable to fetch list of address books.\n");
+ "Unable to fetch list of address books.\n"); e_book_query_unref(full_query);
- groups = e_source_list_peek_groups(addressbooks);
- g_object_unref(addressbooks);
- e_book_query_unref(full_query);
- for (g = groups; g != NULL; g = g->next)
- sources = e_source_group_peek_sources(g->data);
- for (s = sources; s != NULL; s = s->next)
- result = gevo_run_query_in_uri(e_source_get_uri(E_SOURCE(s->data)), full_query);
- g_object_unref(addressbooks);
- e_book_query_unref(full_query);
+ sources = e_source_registry_list_sources(registry, E_SOURCE_EXTENSION_ADDRESS_BOOK); + for(s = sources; s != NULL; s = s->next) { + result = gevo_run_query_in_source(E_SOURCE(s->data), full_query); + g_object_unref(registry); + g_list_free_full(sources, g_object_unref); + e_book_query_unref(full_query); - g_object_unref(addressbooks);
+ g_object_unref(registry); + g_list_free_full(sources, g_object_unref); e_book_query_unref(full_query);
--- a/pidgin/plugins/gevolution/gevo-util.c Fri Apr 09 23:53:08 2021 -0500
+++ b/pidgin/plugins/gevolution/gevo-util.c Fri Apr 09 23:53:13 2021 -0500
@@ -120,26 +120,51 @@
-gevo_load_addressbook(const gchar* uri, EBook **book, GError **error)
+gevo_load_addressbook(const gchar* uid, EBook **book, GError **error) { + ESourceRegistry *registry; g_return_val_if_fail(book != NULL, FALSE);
- *book = e_book_new_system_addressbook(error);
- *book = e_book_new_from_uri(uri, error);
+ registry = e_source_registry_new_sync(NULL, error); + source = e_source_registry_ref_default_address_book(registry); + source = e_source_registry_ref_source(registry, uid); + g_object_unref(registry); + result = gevo_load_addressbook_from_source(source, book, error);
+ g_object_unref(source); +gevo_load_addressbook_from_source(ESource *source, EBook **book, + gboolean result = FALSE; + *book = e_book_new(source, error); result = e_book_open(*book, FALSE, error);
- if (!result && *book != NULL)
+ if(!result && *book != NULL) { --- a/pidgin/plugins/gevolution/gevolution.h Fri Apr 09 23:53:08 2021 -0500
+++ b/pidgin/plugins/gevolution/gevolution.h Fri Apr 09 23:53:13 2021 -0500
@@ -25,12 +25,12 @@
-#include <libebook/e-book.h>
+#include <libebook/libebook.h>
@@ -123,7 +123,8 @@
EContactField gevo_prpl_get_field(PurpleAccount *account, PurpleBuddy *buddy);
gboolean gevo_prpl_is_supported(PurpleAccount *account, PurpleBuddy *buddy);
-gboolean gevo_load_addressbook(const gchar *uri, EBook **book, GError **error);
+gboolean gevo_load_addressbook(const gchar *uid, EBook **book, GError **error); +gboolean gevo_load_addressbook_from_source(ESource *source, EBook **book, GError **error); char *gevo_get_email_for_buddy(PurpleBuddy *buddy);
GevoAssociateBuddyDialog *gevo_associate_buddy_dialog_new(PurpleBuddy *buddy);