/* edsf-persona-store.c generated by valac 0.35.3.10-6b27, the Vala compiler
 * generated from edsf-persona-store.vala, do not modify */

/*
 * Copyright (C) 2011 Collabora Ltd.
 * Copyright (C) 2013, 2016 Philip Withnall
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *       Travis Reitter <travis.reitter@collabora.co.uk>
 *       Philip Withnall <philip.withnall@collabora.co.uk>
 *       Marco Barisione <marco.barisione@collabora.co.uk>
 *       Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <libedataserver/libedataserver.h>
#include <folks/folks.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <libebook/libebook.h>
#include <libebook-contacts/libebook-contacts.h>
#include <glib/gi18n-lib.h>
#include <folks/small-set.h>
#include <folks-internal.h>
#include <folks/small-set-internal.h>
#include <gobject/gvaluecollector.h>


#define EDSF_TYPE_PERSONA_STORE (edsf_persona_store_get_type ())
#define EDSF_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore))
#define EDSF_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_TYPE_PERSONA_STORE, EdsfPersonaStoreClass))
#define EDSF_IS_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_TYPE_PERSONA_STORE))
#define EDSF_IS_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_TYPE_PERSONA_STORE))
#define EDSF_PERSONA_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_TYPE_PERSONA_STORE, EdsfPersonaStoreClass))

typedef struct _EdsfPersonaStore EdsfPersonaStore;
typedef struct _EdsfPersonaStoreClass EdsfPersonaStoreClass;
typedef struct _EdsfPersonaStorePrivate EdsfPersonaStorePrivate;

#define EDSF_TYPE_PERSONA (edsf_persona_get_type ())
#define EDSF_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_TYPE_PERSONA, EdsfPersona))
#define EDSF_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_TYPE_PERSONA, EdsfPersonaClass))
#define EDSF_IS_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_TYPE_PERSONA))
#define EDSF_IS_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_TYPE_PERSONA))
#define EDSF_PERSONA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_TYPE_PERSONA, EdsfPersonaClass))

typedef struct _EdsfPersona EdsfPersona;
typedef struct _EdsfPersonaClass EdsfPersonaClass;

#define EDSF_PERSONA_STORE_TYPE_IDLE_TASK (edsf_persona_store_idle_task_get_type ())
#define EDSF_PERSONA_STORE_IDLE_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_PERSONA_STORE_TYPE_IDLE_TASK, EdsfPersonaStoreIdleTask))
#define EDSF_PERSONA_STORE_IDLE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_PERSONA_STORE_TYPE_IDLE_TASK, EdsfPersonaStoreIdleTaskClass))
#define EDSF_PERSONA_STORE_IS_IDLE_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_PERSONA_STORE_TYPE_IDLE_TASK))
#define EDSF_PERSONA_STORE_IS_IDLE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_PERSONA_STORE_TYPE_IDLE_TASK))
#define EDSF_PERSONA_STORE_IDLE_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_PERSONA_STORE_TYPE_IDLE_TASK, EdsfPersonaStoreIdleTaskClass))

typedef struct _EdsfPersonaStoreIdleTask EdsfPersonaStoreIdleTask;
typedef struct _EdsfPersonaStoreIdleTaskClass EdsfPersonaStoreIdleTaskClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _EdsfPersonaStoreCreateAddressBookData EdsfPersonaStoreCreateAddressBookData;
typedef struct _EdsfPersonaStoreRemoveAddressBookData EdsfPersonaStoreRemoveAddressBookData;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _EdsfPersonaStoreAddPersonaFromDetailsData EdsfPersonaStoreAddPersonaFromDetailsData;
typedef struct _EdsfPersonaStoreRemovePersonaData EdsfPersonaStoreRemovePersonaData;
typedef struct _EdsfPersonaStorePrepareData EdsfPersonaStorePrepareData;
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
typedef struct _EdsfPersonaStoreAddContactData EdsfPersonaStoreAddContactData;
typedef struct _Block4Data Block4Data;
typedef struct _Block5Data Block5Data;
typedef struct _EdsfPersonaStoreCommitModifiedPropertyData EdsfPersonaStoreCommitModifiedPropertyData;
typedef struct _EdsfPersonaStoreSetAvatarData EdsfPersonaStoreSetAvatarData;
typedef struct _EdsfPersonaStoreSetWebServiceAddressesData EdsfPersonaStoreSetWebServiceAddressesData;
#define __vala_EVCardAttributeParam_free0(var) ((var == NULL) ? NULL : (var = (_vala_EVCardAttributeParam_free (var), NULL)))
#define __vala_EVCardAttribute_free0(var) ((var == NULL) ? NULL : (var = (_vala_EVCardAttribute_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetUrlsData EdsfPersonaStoreSetUrlsData;

#define EDSF_PERSONA_TYPE_URL_TYPE_MAPPING (edsf_persona_url_type_mapping_get_type ())
typedef struct _EdsfPersonaUrlTypeMapping EdsfPersonaUrlTypeMapping;
typedef struct _EdsfPersonaStoreSetLocalIdsData EdsfPersonaStoreSetLocalIdsData;
typedef struct _EdsfPersonaStoreSetIsFavouriteData EdsfPersonaStoreSetIsFavouriteData;
#define __vala_EContactPhoto_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactPhoto_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetContactAvatarData EdsfPersonaStoreSetContactAvatarData;
typedef struct _EdsfPersonaStoreSetEmailsData EdsfPersonaStoreSetEmailsData;
typedef struct _EdsfPersonaStoreChangeExtendedFieldData EdsfPersonaStoreChangeExtendedFieldData;
typedef struct _EdsfPersonaStoreRemoveExtendedFieldData EdsfPersonaStoreRemoveExtendedFieldData;
typedef struct _EdsfPersonaStoreSetPhonesData EdsfPersonaStoreSetPhonesData;
typedef struct _EdsfPersonaStoreSetPostalAddressesData EdsfPersonaStoreSetPostalAddressesData;
#define __g_list_free___vala_EVCardAttribute_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free___vala_EVCardAttribute_free0_ (var), NULL)))
typedef struct _EdsfPersonaStoreSetFullNameData EdsfPersonaStoreSetFullNameData;
typedef struct _EdsfPersonaStoreSetNicknameData EdsfPersonaStoreSetNicknameData;
typedef struct _EdsfPersonaStoreSetNotesData EdsfPersonaStoreSetNotesData;
typedef struct _EdsfPersonaStoreSetBirthdayData EdsfPersonaStoreSetBirthdayData;
#define __vala_EContactDate_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactDate_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetRolesData EdsfPersonaStoreSetRolesData;
typedef struct _EdsfPersonaStoreSetStructuredNameData EdsfPersonaStoreSetStructuredNameData;
#define __vala_EContactName_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactName_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetImFdsData EdsfPersonaStoreSetImFdsData;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetGroupsData EdsfPersonaStoreSetGroupsData;
typedef struct _EdsfPersonaStoreSetSystemGroupsData EdsfPersonaStoreSetSystemGroupsData;
#define __g_list_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_free0_ (var), NULL)))
typedef struct _EdsfPersonaStoreSetGenderData EdsfPersonaStoreSetGenderData;
typedef struct _EdsfPersonaStoreSetAntiLinksData EdsfPersonaStoreSetAntiLinksData;
typedef struct _EdsfPersonaStoreSetLocationData EdsfPersonaStoreSetLocationData;
#define __vala_EContactGeo_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactGeo_free (var), NULL)))
typedef struct _EdsfPersonaStoreIdleTaskPrivate EdsfPersonaStoreIdleTaskPrivate;
#define _edsf_persona_store_idle_task_unref0(var) ((var == NULL) ? NULL : (var = (edsf_persona_store_idle_task_unref (var), NULL)))
typedef struct _Block6Data Block6Data;
typedef struct _Block7Data Block7Data;
typedef struct _Block8Data Block8Data;
typedef struct _Block9Data Block9Data;
typedef struct _EdsfPersonaStoreParamSpecIdleTask EdsfPersonaStoreParamSpecIdleTask;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _EdsfPersonaStore {
	FolksPersonaStore parent_instance;
	EdsfPersonaStorePrivate * priv;
};

struct _EdsfPersonaStoreClass {
	FolksPersonaStoreClass parent_class;
};

struct _EdsfPersonaStorePrivate {
	GeeHashMap* _personas;
	GeeMap* _personas_ro;
	gboolean _is_prepared;
	gboolean _prepare_pending;
	gboolean _is_quiescent;
	GeeHashSet* _pending_personas;
	EBookClient* _addressbook;
	EBookClientView* _ebookview;
	ESourceRegistry* _source_registry;
	gchar* _query_str;
	gchar** _always_writeable_properties;
	gint _always_writeable_properties_length1;
	gint __always_writeable_properties_size_;
	ESource* _source;
	GeeQueue* _idle_tasks;
	guint _idle_handle;
};

struct _EdsfPersonaStoreCreateAddressBookData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	gchar* id;
	const gchar* _tmp0_;
	ESource* new_source;
	const gchar* _tmp1_;
	ESource* _tmp2_;
	ESource* _tmp3_;
	ESource* _tmp4_;
	const gchar* _tmp5_;
	ESourceAddressBook* ab_extension;
	ESource* _tmp6_;
	ESourceExtension* _tmp7_;
	ESourceAddressBook* _tmp8_;
	ESourceAddressBook* _tmp9_;
	ESourceRegistry* registry;
	ESourceRegistry* _tmp10_;
	ESourceRegistry* _tmp11_;
	ESource* _tmp12_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreRemoveAddressBookData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* store;
	EdsfPersonaStore* _tmp0_;
	ESource* _tmp1_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreAddPersonaFromDetailsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	GHashTable* details;
	FolksPersona* result;
	gboolean _tmp0_;
	GError* _tmp1_;
	EContact* contact;
	EContact* _tmp2_;
	GHashTableIter iter;
	GHashTable* _tmp3_;
	const gchar* k;
	GValue* _v;
	gboolean is_fav;
	GeeSet* groups;
	FolksSmallSet* _tmp4_;
	gconstpointer _tmp5_;
	gconstpointer _tmp6_;
	gboolean _tmp7_;
	GValue* _tmp8_;
	GValue v;
	GValue* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* full_name;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gboolean _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	EContact* _tmp17_;
	EContactField _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gchar* nickname;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gboolean _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	EContact* _tmp27_;
	EContactField _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	GeeSet* email_addresses;
	GObject* _tmp32_;
	GeeSet* _tmp33_;
	EContact* _tmp34_;
	GeeSet* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	GLoadableIcon* avatar;
	GObject* _tmp38_;
	GLoadableIcon* _tmp39_;
	EContact* _tmp40_;
	GLoadableIcon* _tmp41_;
	GError* e1;
	GError* _tmp42_;
	const gchar* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	GeeMultiMap* im_fds;
	GObject* _tmp46_;
	GeeMultiMap* _tmp47_;
	EContact* _tmp48_;
	GeeMultiMap* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	GeeSet* phone_numbers;
	GObject* _tmp52_;
	GeeSet* _tmp53_;
	EContact* _tmp54_;
	GeeSet* _tmp55_;
	const gchar* _tmp56_;
	const gchar* _tmp57_;
	GeeSet* postal_fds;
	GObject* _tmp58_;
	GeeSet* _tmp59_;
	EContact* _tmp60_;
	GeeSet* _tmp61_;
	const gchar* _tmp62_;
	const gchar* _tmp63_;
	FolksStructuredName* sname;
	GObject* _tmp64_;
	FolksStructuredName* _tmp65_;
	EContact* _tmp66_;
	FolksStructuredName* _tmp67_;
	const gchar* _tmp68_;
	const gchar* _tmp69_;
	GeeSet* local_ids;
	GObject* _tmp70_;
	GeeSet* _tmp71_;
	EContact* _tmp72_;
	GeeSet* _tmp73_;
	const gchar* _tmp74_;
	const gchar* _tmp75_;
	FolksLocation* location;
	GObject* _tmp76_;
	FolksLocation* _tmp77_;
	EContact* _tmp78_;
	FolksLocation* _tmp79_;
	const gchar* _tmp80_;
	const gchar* _tmp81_;
	GeeHashMultiMap* web_service_addresses;
	GObject* _tmp82_;
	GeeHashMultiMap* _tmp83_;
	EContact* _tmp84_;
	GeeHashMultiMap* _tmp85_;
	const gchar* _tmp86_;
	const gchar* _tmp87_;
	GeeSet* notes;
	GObject* _tmp88_;
	GeeSet* _tmp89_;
	EContact* _tmp90_;
	GeeSet* _tmp91_;
	const gchar* _tmp92_;
	const gchar* _tmp93_;
	FolksGender gender;
	gint _tmp94_;
	EContact* _tmp95_;
	FolksGender _tmp96_;
	const gchar* _tmp97_;
	const gchar* _tmp98_;
	GeeSet* urls;
	GObject* _tmp99_;
	GeeSet* _tmp100_;
	EContact* _tmp101_;
	GeeSet* _tmp102_;
	const gchar* _tmp103_;
	const gchar* _tmp104_;
	GDateTime* birthday;
	void* _tmp105_;
	GDateTime* _tmp106_;
	EContact* _tmp107_;
	GDateTime* _tmp108_;
	const gchar* _tmp109_;
	const gchar* _tmp110_;
	GeeSet* roles;
	GObject* _tmp111_;
	GeeSet* _tmp112_;
	EContact* _tmp113_;
	GeeSet* _tmp114_;
	const gchar* _tmp115_;
	const gchar* _tmp116_;
	GObject* _tmp117_;
	GeeSet* _tmp118_;
	EContact* _tmp119_;
	GeeSet* _tmp120_;
	gboolean _tmp121_;
	const gchar* _tmp122_;
	const gchar* _tmp123_;
	gboolean _tmp124_;
	EContact* _tmp125_;
	gboolean _tmp126_;
	EContact* _tmp127_;
	GeeSet* _tmp128_;
	gboolean _tmp129_;
	gchar* added_uid;
	EContact* _tmp130_;
	gchar* _tmp131_;
	gchar* iid;
	const gchar* _tmp132_;
	const gchar* _tmp133_;
	gchar* _tmp134_;
	EdsfPersona* _persona;
	GeeHashMap* _tmp135_;
	const gchar* _tmp136_;
	gpointer _tmp137_;
	EdsfPersona* _tmp138_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreRemovePersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	FolksPersona* persona;
	gboolean _tmp0_;
	GError* _tmp1_;
	EBookClient* _tmp2_;
	FolksPersona* _tmp3_;
	EContact* _tmp4_;
	EContact* _tmp5_;
	GError* e;
	GError* _tmp6_;
	GError* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	GError* _tmp11_;
	GError* _tmp12_;
	GError* _tmp13_;
	GError* _tmp14_;
	GError* _tmp15_;
	GQuark _tmp16_;
	GQuark _tmp17_;
	GError* _tmp18_;
	gint _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	FolksPersona* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	GError* _tmp25_;
	FolksPersona* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	GError* _tmp29_;
	const gchar* _tmp30_;
	GError* _tmp31_;
	GError* _tmp32_;
	const gchar* _tmp33_;
	GError* _tmp34_;
	FolksPersona* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	GError* _tmp38_;
	const gchar* _tmp39_;
	GError* _tmp40_;
	GError * _inner_error_;
};

struct _EdsfPersonaStorePrepareData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	ESourceRegistry* _tmp5_;
	ESourceRegistry* _tmp6_;
	ESourceRegistry* _tmp7_;
	ESourceRegistry* _tmp8_;
	ESourceRegistry* _tmp9_;
	ESourceRegistry* _tmp10_;
	EBookClient* _tmp11_;
	ESource* _tmp12_;
	EBookClient* _tmp13_;
	EBookClient* _tmp14_;
	EBookClient* _tmp15_;
	EBookClient* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	GError* e1;
	GError* _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp23_;
	gboolean _tmp24_;
	gboolean _tmp25_;
	GError* _tmp26_;
	GError* _tmp27_;
	GError* _tmp28_;
	GError* _tmp29_;
	GError* _tmp30_;
	GError* _tmp31_;
	GQuark _tmp32_;
	GQuark _tmp33_;
	GError* _tmp34_;
	gint _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	GError* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	GError* _tmp41_;
	const gchar* _tmp42_;
	GError* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	GError* _tmp46_;
	const gchar* _tmp47_;
	GError* _tmp48_;
	gchar* supported_fields;
	EBookClient* _tmp49_;
	gchar* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	FolksSmallSet* prop_set;
	FolksSmallSet* _tmp53_;
	const gchar* _tmp54_;
	gchar** fields;
	const gchar* _tmp55_;
	gchar** _tmp56_;
	gchar** _tmp57_;
	gint fields_length1;
	gint _fields_size_;
	FolksSmallSet* _tmp58_;
	const gchar* _tmp59_;
	FolksSmallSet* _tmp60_;
	const gchar* _tmp61_;
	FolksSmallSet* _tmp62_;
	const gchar* _tmp63_;
	FolksSmallSet* _tmp64_;
	const gchar* _tmp65_;
	FolksSmallSet* _tmp66_;
	const gchar* _tmp67_;
	FolksSmallSet* _tmp68_;
	const gchar* _tmp69_;
	gchar** _tmp70_;
	gint _tmp70__length1;
	gchar** field_collection;
	gint field_collection_length1;
	gint _field_collection_size_;
	gint field_it;
	const gchar* field;
	gchar* prop;
	const gchar* _tmp71_;
	FolksPersonaDetail _tmp72_;
	const gchar* _tmp73_;
	gchar* _tmp74_;
	const gchar* _tmp75_;
	FolksSmallSet* _tmp76_;
	gchar* _tmp77_;
	gchar* _tmp78_;
	FolksSmallSet* _tmp79_;
	gint _tmp80_;
	gint _tmp81_;
	gchar** _tmp82_;
	guint i;
	FolksSmallSet* _final_prop_list;
	FolksSmallSet* _tmp83_;
	FolksSmallSet* _tmp84_;
	gint _final_prop_size;
	FolksSmallSet* _tmp85_;
	gint _tmp86_;
	gint _tmp87_;
	gint _final_prop_index;
	gint _tmp88_;
	gint _tmp89_;
	gint _tmp90_;
	gchar* final_prop;
	FolksSmallSet* _tmp91_;
	gint _tmp92_;
	gconstpointer _tmp93_;
	gchar* _tmp94_;
	gchar** _tmp95_;
	gint _tmp95__length1;
	guint _tmp96_;
	const gchar* _tmp97_;
	gchar* _tmp98_;
	gchar* _tmp99_;
	GError* e2;
	GError* _tmp100_;
	const gchar* _tmp101_;
	GError* _tmp102_;
	gboolean do_initial_query;
	gchar* capabilities;
	EBookClient* _tmp103_;
	gchar* _tmp104_;
	const gchar* _tmp105_;
	const gchar* _tmp106_;
	const gchar* _tmp107_;
	gchar** caps;
	const gchar* _tmp108_;
	gchar** _tmp109_;
	gchar** _tmp110_;
	gint caps_length1;
	gint _caps_size_;
	gchar** _tmp111_;
	gint _tmp111__length1;
	GError* e4;
	GError* _tmp112_;
	const gchar* _tmp113_;
	GError* _tmp114_;
	gboolean got_view;
	gboolean _tmp115_;
	EBookClient* _tmp116_;
	const gchar* _tmp117_;
	EBookClientView* _tmp118_;
	gboolean _tmp119_;
	const gchar* _tmp120_;
	const gchar* _tmp121_;
	gboolean _tmp122_;
	const gchar* _tmp123_;
	const gchar* _tmp124_;
	GError* _tmp125_;
	EBookClientView* _tmp126_;
	EBookClientView* _tmp127_;
	EBookClientView* _tmp128_;
	EBookClientView* _tmp129_;
	EBookClientView* _tmp130_;
	GError* e3;
	GError* _tmp131_;
	gboolean _tmp132_;
	gboolean _tmp133_;
	gboolean _tmp134_;
	gboolean _tmp135_;
	GError* _tmp136_;
	GError* _tmp137_;
	GError* _tmp138_;
	GError* _tmp139_;
	GError* _tmp140_;
	GError* _tmp141_;
	GQuark _tmp142_;
	GQuark _tmp143_;
	GError* _tmp144_;
	gint _tmp145_;
	const gchar* _tmp146_;
	const gchar* _tmp147_;
	GError* _tmp148_;
	const gchar* _tmp149_;
	const gchar* _tmp150_;
	GError* _tmp151_;
	const gchar* _tmp152_;
	GError* _tmp153_;
	const gchar* _tmp154_;
	const gchar* _tmp155_;
	GError* _tmp156_;
	const gchar* _tmp157_;
	GError* _tmp158_;
	gboolean _tmp159_;
	gboolean _tmp160_;
	gboolean _tmp161_;
	GeeHashSet* _tmp162_;
	GError * _inner_error_;
};

struct _Block1Data {
	int _ref_count_;
	EdsfPersonaStore* self;
	gchar* added_uid;
	FolksSmallSet* added_uids;
	gpointer _async_data_;
};

struct _Block2Data {
	int _ref_count_;
	Block1Data * _data1_;
	gboolean received_notification;
	gboolean has_yielded;
};

struct _Block3Data {
	int _ref_count_;
	Block2Data * _data2_;
	EContact* c;
};

struct _EdsfPersonaStoreAddContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	gchar* result;
	Block1Data* _data1_;
	EBookClient* _tmp0_;
	FolksDebug* debug_obj;
	FolksDebug* _tmp1_;
	FolksDebug* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	EContact* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	EContact* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gulong signal_id;
	guint timeout_id;
	gchar* _tmp12_;
	FolksSmallSet* _tmp13_;
	Block2Data* _data2_;
	EBookClientView* _tmp14_;
	gulong _tmp15_;
	EBookClient* _tmp16_;
	EContact* _tmp17_;
	gchar* _tmp18_;
	const gchar* _tmp19_;
	guint _tmp20_;
	FolksSmallSet* _tmp21_;
	const gchar* _tmp22_;
	gboolean _tmp23_;
	gboolean _tmp24_;
	const gchar* _tmp25_;
	gboolean _tmp26_;
	const gchar* _tmp27_;
	gboolean _tmp28_;
	gboolean _tmp29_;
	GError* _tmp30_;
	gboolean _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	gulong _tmp36_;
	EBookClientView* _tmp37_;
	gulong _tmp38_;
	guint _tmp39_;
	guint _tmp40_;
	GError* e;
	GError* _tmp41_;
	GError* _tmp42_;
	gulong _tmp43_;
	EBookClientView* _tmp44_;
	gulong _tmp45_;
	guint _tmp46_;
	guint _tmp47_;
	GError * _inner_error_;
};

struct _Block4Data {
	int _ref_count_;
	EdsfPersonaStore* self;
	gpointer _async_data_;
};

struct _Block5Data {
	int _ref_count_;
	Block4Data * _data4_;
	gboolean received_notification;
	gboolean has_yielded;
};

struct _EdsfPersonaStoreCommitModifiedPropertyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	gchar* property_name;
	Block4Data* _data4_;
	EBookClient* _tmp0_;
	FolksDebug* debug_obj;
	FolksDebug* _tmp1_;
	FolksDebug* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	const gchar* _tmp5_;
	EdsfPersona* _tmp6_;
	EdsfPersona* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	EdsfPersona* _tmp10_;
	EContact* _tmp11_;
	EContact* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	EContact* contact;
	EdsfPersona* _tmp15_;
	EContact* _tmp16_;
	EContact* _tmp17_;
	EContact* _tmp18_;
	gulong signal_id;
	guint timeout_id;
	Block5Data* _data5_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gchar* signal_name;
	gchar* _tmp21_;
	EdsfPersona* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gulong _tmp25_;
	EBookClient* _tmp26_;
	EContact* _tmp27_;
	guint _tmp28_;
	gboolean _tmp29_;
	const gchar* _tmp30_;
	gboolean _tmp31_;
	const gchar* _tmp32_;
	gboolean _tmp33_;
	gboolean _tmp34_;
	const gchar* _tmp35_;
	GError* _tmp36_;
	GError* e;
	const gchar* _tmp37_;
	GError* _tmp38_;
	GError* _tmp39_;
	gulong _tmp40_;
	EdsfPersona* _tmp41_;
	gulong _tmp42_;
	guint _tmp43_;
	guint _tmp44_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetAvatarData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GLoadableIcon* avatar;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	EdsfPersona* _tmp4_;
	GLoadableIcon* _tmp5_;
	GLoadableIcon* _tmp6_;
	GLoadableIcon* _tmp7_;
	gboolean _tmp8_;
	EdsfPersona* _tmp9_;
	GLoadableIcon* _tmp10_;
	GLoadableIcon* _tmp11_;
	EdsfPersona* _tmp12_;
	GLoadableIcon* _tmp13_;
	GLoadableIcon* _tmp14_;
	GLoadableIcon* _tmp15_;
	gboolean _tmp16_;
	EdsfPersona* _tmp17_;
	EContact* _tmp18_;
	EContact* _tmp19_;
	GLoadableIcon* _tmp20_;
	EdsfPersona* _tmp21_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetWebServiceAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeMultiMap* web_service_addresses;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeMultiMap* _tmp3_;
	GeeMultiMap* _tmp4_;
	GeeMultiMap* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeMultiMap* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetUrlsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* urls;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaUrlTypeMapping {
	gchar* vcard_field_name;
	gchar* folks_type;
};

struct _EdsfPersonaStoreSetLocalIdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* local_ids;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetIsFavouriteData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	gboolean is_favourite;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	gboolean _tmp2_;
	EdsfPersona* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	EdsfPersona* _tmp6_;
	EContact* _tmp7_;
	EContact* _tmp8_;
	gboolean _tmp9_;
	EdsfPersona* _tmp10_;
	EContact* _tmp11_;
	EContact* _tmp12_;
	EdsfPersona* _tmp13_;
	GeeSet* _tmp14_;
	GeeSet* _tmp15_;
	gboolean _tmp16_;
	EdsfPersona* _tmp17_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetContactAvatarData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GLoadableIcon* avatar;
	GLoadableIcon* _tmp0_;
	EContact* _tmp1_;
	EContactPhoto* cp;
	EContactPhoto* _tmp2_;
	EContactPhoto* _tmp3_;
	GInputStream* input_s;
	GLoadableIcon* _tmp4_;
	GInputStream* _tmp5_;
	guint8* image_data;
	guint8* _tmp6_;
	gint image_data_length1;
	gint _image_data_size_;
	guint8* buffer;
	guint8* _tmp7_;
	gint buffer_length1;
	gint _buffer_size_;
	gssize size_read;
	GInputStream* _tmp8_;
	guint8* _tmp9_;
	gint _tmp9__length1;
	gssize _tmp10_;
	gssize _tmp11_;
	gint read_cur;
	guint8* _tmp12_;
	gint _tmp12__length1;
	gint _tmp13_;
	gssize _tmp14_;
	gint _tmp15_;
	guint8* _tmp16_;
	gint _tmp16__length1;
	gint _tmp17_;
	guint8* _tmp18_;
	gint _tmp18__length1;
	gssize _tmp19_;
	EContactPhoto* _tmp20_;
	guint8* _tmp21_;
	gint _tmp21__length1;
	gboolean uncertain;
	gchar* mime_type;
	guint8* _tmp22_;
	gint _tmp22__length1;
	gboolean _tmp23_;
	gchar* _tmp24_;
	gboolean _tmp25_;
	EContactPhoto* _tmp26_;
	const gchar* _tmp27_;
	EContact* _tmp28_;
	EContactPhoto* _tmp29_;
	GError* e1;
	GError* _tmp30_;
	const gchar* _tmp31_;
	GError* _tmp32_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetEmailsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* emails;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreChangeExtendedFieldData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	gchar* name;
	FolksExtendedFieldDetails* details;
	EVCard* vcard;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EVCard* _tmp3_;
	EVCardAttribute* prev_attr;
	EVCard* _tmp4_;
	const gchar* _tmp5_;
	EVCardAttribute* _tmp6_;
	EVCardAttribute* _tmp7_;
	EVCard* _tmp8_;
	EVCardAttribute* _tmp9_;
	EVCardAttribute* _tmp10_;
	EVCardAttribute* new_attr;
	const gchar* _tmp11_;
	EVCardAttribute* _tmp12_;
	FolksExtendedFieldDetails* _tmp13_;
	gconstpointer _tmp14_;
	const gchar* _tmp15_;
	EVCard* _tmp16_;
	EVCardAttribute* _tmp17_;
	EdsfPersona* _tmp18_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreRemoveExtendedFieldData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	gchar* name;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	const gchar* _tmp3_;
	EdsfPersona* _tmp4_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetPhonesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* phones;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetPostalAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* postal_fds;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

typedef void (*EdsfPersonaStoreFieldToAttribute) (EVCardAttribute* attr, gconstpointer value, void* user_data);
struct _EdsfPersonaStoreSetFullNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	gchar* full_name;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	gchar* _full_name;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	EdsfPersona* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	EdsfPersona* _tmp9_;
	EContact* _tmp10_;
	EContact* _tmp11_;
	EContactField _tmp12_;
	const gchar* _tmp13_;
	EdsfPersona* _tmp14_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetNicknameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	gchar* nickname;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	gchar* _nickname;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	EdsfPersona* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	EdsfPersona* _tmp9_;
	EContact* _tmp10_;
	EContact* _tmp11_;
	EContactField _tmp12_;
	const gchar* _tmp13_;
	EdsfPersona* _tmp14_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetNotesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* notes;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetBirthdayData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GDateTime* bday;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	EdsfPersona* _tmp4_;
	GDateTime* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	EdsfPersona* _tmp8_;
	GDateTime* _tmp9_;
	GDateTime* _tmp10_;
	GDateTime* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	EdsfPersona* _tmp14_;
	GDateTime* _tmp15_;
	GDateTime* _tmp16_;
	GDateTime* _tmp17_;
	EdsfPersona* _tmp18_;
	EContact* _tmp19_;
	EContact* _tmp20_;
	GDateTime* _tmp21_;
	EdsfPersona* _tmp22_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetRolesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* roles;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetStructuredNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	FolksStructuredName* sname;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	EdsfPersona* _tmp4_;
	FolksStructuredName* _tmp5_;
	FolksStructuredName* _tmp6_;
	FolksStructuredName* _tmp7_;
	EdsfPersona* _tmp8_;
	FolksStructuredName* _tmp9_;
	FolksStructuredName* _tmp10_;
	FolksStructuredName* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	EdsfPersona* _tmp14_;
	FolksStructuredName* _tmp15_;
	FolksStructuredName* _tmp16_;
	FolksStructuredName* _tmp17_;
	EdsfPersona* _tmp18_;
	EContact* _tmp19_;
	EContact* _tmp20_;
	FolksStructuredName* _tmp21_;
	EdsfPersona* _tmp22_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetImFdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeMultiMap* im_fds;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeMultiMap* _tmp3_;
	GeeMultiMap* _tmp4_;
	GeeMultiMap* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeMultiMap* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetGroupsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* groups;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	EdsfPersona* _tmp14_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetSystemGroupsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* system_groups;
	gboolean _tmp0_;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetGenderData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	FolksGender gender;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	FolksGender _tmp2_;
	EdsfPersona* _tmp3_;
	FolksGender _tmp4_;
	FolksGender _tmp5_;
	EdsfPersona* _tmp6_;
	EContact* _tmp7_;
	EContact* _tmp8_;
	FolksGender _tmp9_;
	EdsfPersona* _tmp10_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetAntiLinksData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* anti_links;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	GeeSet* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	gboolean _tmp6_;
	EdsfPersona* _tmp7_;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GeeSet* _tmp10_;
	EdsfPersona* _tmp11_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetLocationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	FolksLocation* location;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _tmp1_;
	EdsfPersona* _tmp2_;
	EContact* _tmp3_;
	EContact* _tmp4_;
	FolksLocation* _tmp5_;
	EdsfPersona* _tmp6_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreIdleTask {
	GTypeInstance parent_instance;
	volatile int ref_count;
	EdsfPersonaStoreIdleTaskPrivate * priv;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
};

struct _EdsfPersonaStoreIdleTaskClass {
	GTypeClass parent_class;
	void (*finalize) (EdsfPersonaStoreIdleTask *self);
};

struct _Block6Data {
	int _ref_count_;
	EdsfPersonaStore* self;
	GeeLinkedList* copy;
};

struct _Block7Data {
	int _ref_count_;
	EdsfPersonaStore* self;
	GeeLinkedList* copy;
};

struct _Block8Data {
	int _ref_count_;
	EdsfPersonaStore* self;
	GeeLinkedList* copy;
};

struct _Block9Data {
	int _ref_count_;
	EdsfPersonaStore* self;
	GError* err;
};

struct _EdsfPersonaStoreParamSpecIdleTask {
	GParamSpec parent_instance;
};


static gpointer edsf_persona_store_parent_class = NULL;
static gchar** edsf_persona_store__always_writeable_properties_empty;
static gint edsf_persona_store__always_writeable_properties_empty_length1;
static gchar** edsf_persona_store__always_writeable_properties_empty = NULL;
static gint edsf_persona_store__always_writeable_properties_empty_length1 = 0;
static gint _edsf_persona_store__always_writeable_properties_empty_size_ = 0;
static gpointer edsf_persona_store_idle_task_parent_class = NULL;

void e_source_registry_new (GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
ESourceRegistry* e_source_registry_new_finish (GAsyncResult* _res_, GError** error);
GType edsf_persona_store_get_type (void) G_GNUC_CONST;
GType edsf_persona_get_type (void) G_GNUC_CONST;
static gpointer edsf_persona_store_idle_task_ref (gpointer instance);
static void edsf_persona_store_idle_task_unref (gpointer instance);
static GParamSpec* edsf_persona_store_param_spec_idle_task (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void edsf_persona_store_value_set_idle_task (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void edsf_persona_store_value_take_idle_task (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer edsf_persona_store_value_get_idle_task (const GValue* value) G_GNUC_UNUSED;
static GType edsf_persona_store_idle_task_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define EDSF_PERSONA_STORE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EDSF_TYPE_PERSONA_STORE, EdsfPersonaStorePrivate))
enum  {
	EDSF_PERSONA_STORE_DUMMY_PROPERTY,
	EDSF_PERSONA_STORE_TYPE_ID,
	EDSF_PERSONA_STORE_CAN_ADD_PERSONAS,
	EDSF_PERSONA_STORE_CAN_ALIAS_PERSONAS,
	EDSF_PERSONA_STORE_CAN_GROUP_PERSONAS,
	EDSF_PERSONA_STORE_CAN_REMOVE_PERSONAS,
	EDSF_PERSONA_STORE_IS_PREPARED,
	EDSF_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES,
	EDSF_PERSONA_STORE_IS_QUIESCENT,
	EDSF_PERSONA_STORE_PERSONAS,
	EDSF_PERSONA_STORE_SOURCE
};
static void _edsf_persona_store_contacts_added_cb (EdsfPersonaStore* self, GList* contacts);
static void __edsf_persona_store_contacts_added_cb_e_book_client_view_objects_added (EBookClientView* _sender, GList* object, gpointer self);
static void _edsf_persona_store_contacts_removed_cb (EdsfPersonaStore* self, GList* contacts_ids);
static void __edsf_persona_store_contacts_removed_cb_e_book_client_view_objects_removed (EBookClientView* _sender, GList* object, gpointer self);
static void _edsf_persona_store_contacts_changed_cb (EdsfPersonaStore* self, GList* contacts);
static void __edsf_persona_store_contacts_changed_cb_e_book_client_view_objects_modified (EBookClientView* _sender, GList* object, gpointer self);
static void _edsf_persona_store_contacts_complete_cb (EdsfPersonaStore* self, GError* err);
static void __edsf_persona_store_contacts_complete_cb_e_book_client_view_complete (EBookClientView* _sender, GError* _error_, gpointer self);
static void _edsf_persona_store_address_book_notify_read_only_cb (EdsfPersonaStore* self, GObject* address_book, GParamSpec* pspec);
static void __edsf_persona_store_address_book_notify_read_only_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _edsf_persona_store_source_registry_changed_cb (EdsfPersonaStore* self, ESource* list);
static void __edsf_persona_store_source_registry_changed_cb_e_source_registry_source_removed (ESourceRegistry* _sender, ESource* source, gpointer self);
static void __edsf_persona_store_source_registry_changed_cb_e_source_registry_source_disabled (ESourceRegistry* _sender, ESource* source, gpointer self);
#define EDSF_PERSONA_STORE__property_change_timeout ((guint) 30)
#define EDSF_PERSONA_STORE__new_contact_timeout ((guint) 30)
#define EDSF_PERSONA_STORE_android_favourite_group_name N_ ("Starred in Android")
#define EDSF_PERSONA_STORE_anti_links_attribute_name "X-FOLKS-ANTI-LINKS"
static void edsf_persona_store_create_address_book_data_free (gpointer _data);
void edsf_persona_store_create_address_book (const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_);
void edsf_persona_store_create_address_book_finish (GAsyncResult* _res_, GError** error);
static gboolean edsf_persona_store_create_address_book_co (EdsfPersonaStoreCreateAddressBookData* _data_);
static void edsf_persona_store_create_address_book_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_store_remove_address_book_data_free (gpointer _data);
void edsf_persona_store_remove_address_book (EdsfPersonaStore* store, GAsyncReadyCallback _callback_, gpointer _user_data_);
void edsf_persona_store_remove_address_book_finish (GAsyncResult* _res_, GError** error);
static gboolean edsf_persona_store_remove_address_book_co (EdsfPersonaStoreRemoveAddressBookData* _data_);
ESource* edsf_persona_store_get_source (EdsfPersonaStore* self);
static void edsf_persona_store_remove_address_book_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_update_trust_level (EdsfPersonaStore* self);
EdsfPersonaStore* edsf_persona_store_new (ESource* s) G_GNUC_DEPRECATED;
EdsfPersonaStore* edsf_persona_store_construct (GType object_type, ESource* s) G_GNUC_DEPRECATED;
EdsfPersonaStore* edsf_persona_store_new_with_source_registry (ESourceRegistry* r, ESource* s);
EdsfPersonaStore* edsf_persona_store_construct_with_source_registry (GType object_type, ESourceRegistry* r, ESource* s);
static void edsf_persona_store_real_add_persona_from_details_data_free (gpointer _data);
static void edsf_persona_store_real_add_persona_from_details (FolksPersonaStore* base, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_store_real_add_persona_from_details_co (EdsfPersonaStoreAddPersonaFromDetailsData* _data_);
static void _edsf_persona_store_set_contact_attributes_string (EdsfPersonaStore* self, EContact* contact, GeeSet* new_attributes, const gchar* attrib_name, EContactField field_id);
static void _edsf_persona_store_set_contact_avatar (EdsfPersonaStore* self, EContact* contact, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_avatar_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_store_add_persona_from_details_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_im_fds (EdsfPersonaStore* self, EContact* contact, GeeMultiMap* im_fds);
static void _edsf_persona_store_set_contact_postal_addresses (EdsfPersonaStore* self, EContact* contact, GeeSet* postal_fds);
static void _edsf_persona_store_set_contact_name (EdsfPersonaStore* self, EContact* contact, FolksStructuredName* _sname);
static void _edsf_persona_store_set_contact_local_ids (EdsfPersonaStore* self, EContact* contact, GeeSet* local_ids);
static void _edsf_persona_store_set_contact_location (EdsfPersonaStore* self, EContact* contact, FolksLocation* location);
static void _edsf_persona_store_set_contact_web_service_addresses (EdsfPersonaStore* self, EContact* contact, GeeMultiMap* web_service_addresses);
static void _edsf_persona_store_set_contact_notes (EdsfPersonaStore* self, EContact* contact, GeeSet* notes);
static void _edsf_persona_store_set_contact_gender (EdsfPersonaStore* self, EContact* contact, FolksGender gender);
static void _edsf_persona_store_set_contact_urls (EdsfPersonaStore* self, EContact* contact, GeeSet* urls);
static void _edsf_persona_store_set_contact_birthday (EdsfPersonaStore* self, EContact* contact, GDateTime* _bday);
static void _edsf_persona_store_set_contact_roles (EdsfPersonaStore* self, EContact* contact, GeeSet* roles);
static void _edsf_persona_store_set_contact_groups (EdsfPersonaStore* self, EContact* contact, GeeSet* groups, gboolean is_favourite);
static void _edsf_persona_store_set_contact_is_favourite (EdsfPersonaStore* self, EContact* contact, gboolean is_favourite);
static void _edsf_persona_store_add_contact (EdsfPersonaStore* self, EContact* contact, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _edsf_persona_store_add_contact_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
gchar* edsf_persona_build_iid (const gchar* store_id, const gchar* contact_id);
static void edsf_persona_store_real_remove_persona_data_free (gpointer _data);
static void edsf_persona_store_real_remove_persona (FolksPersonaStore* base, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_store_real_remove_persona_co (EdsfPersonaStoreRemovePersonaData* _data_);
EContact* edsf_persona_get_contact (EdsfPersona* self);
static void edsf_persona_store_remove_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_store_real_prepare_data_free (gpointer _data);
static void edsf_persona_store_real_prepare (FolksPersonaStore* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_store_real_prepare_co (EdsfPersonaStorePrepareData* _data_);
static void edsf_persona_store_prepare_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_notify_if_default (EdsfPersonaStore* self);
static FolksPersonaDetail _edsf_persona_store_eds_field_name_to_folks_persona_detail (EdsfPersonaStore* self, const gchar* eds_field_name);
static gboolean _vala_string_array_contains (gchar* * stack, int stack_length, gchar* needle);
static void _edsf_persona_store_add_contact_data_free (gpointer _data);
static gboolean _edsf_persona_store_add_contact_co (EdsfPersonaStoreAddContactData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void ___lambda6_ (Block2Data* _data2_, GList* _contacts);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void _edsf_persona_store_idle_queue (EdsfPersonaStore* self, GSourceFunc callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static gboolean ____lambda7_ (Block3Data* _data3_);
static gboolean _____lambda7__gsource_func (gpointer self);
static void ____lambda6__e_book_client_view_objects_added (EBookClientView* _sender, GList* object, gpointer self);
static void _edsf_persona_store_add_contact_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gboolean ___lambda8_ (Block2Data* _data2_);
static gboolean ____lambda8__gsource_func (gpointer self);
static GError* edsf_persona_store_e_client_error_to_persona_store_error (EdsfPersonaStore* self, GError* error_in);
static void _edsf_persona_store_commit_modified_property_data_free (gpointer _data);
static void _edsf_persona_store_commit_modified_property (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* property_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_commit_modified_property_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_commit_modified_property_co (EdsfPersonaStoreCommitModifiedPropertyData* _data_);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void ___lambda12_ (Block5Data* _data5_, GObject* obj, GParamSpec* pspec);
static void ____lambda12__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _edsf_persona_store_commit_modified_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gboolean ___lambda13_ (Block5Data* _data5_);
static gboolean ____lambda13__gsource_func (gpointer self);
static GError* edsf_persona_store_e_client_error_to_property_error (EdsfPersonaStore* self, const gchar* property_name, GError* error_in);
static void _edsf_persona_store_remove_attribute (EdsfPersonaStore* self, EContact* contact, const gchar* attr_name);
static void _edsf_persona_store_set_avatar_data_free (gpointer _data);
void _edsf_persona_store_set_avatar (EdsfPersonaStore* self, EdsfPersona* persona, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_avatar_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_avatar_co (EdsfPersonaStoreSetAvatarData* _data_);
static void _edsf_persona_store_set_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_web_service_addresses_data_free (gpointer _data);
void _edsf_persona_store_set_web_service_addresses (EdsfPersonaStore* self, EdsfPersona* persona, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_web_service_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_web_service_addresses_co (EdsfPersonaStoreSetWebServiceAddressesData* _data_);
static void _edsf_persona_store_set_web_service_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static EVCardAttributeParam* _vala_EVCardAttributeParam_copy (EVCardAttributeParam* self);
static void _vala_EVCardAttributeParam_free (EVCardAttributeParam* self);
static void _vala_EVCardAttribute_free (EVCardAttribute* self);
static void _edsf_persona_store_set_urls_data_free (gpointer _data);
void _edsf_persona_store_set_urls (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_urls_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_urls_co (EdsfPersonaStoreSetUrlsData* _data_);
static void _edsf_persona_store_set_urls_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static GType edsf_persona_url_type_mapping_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static EdsfPersonaUrlTypeMapping* edsf_persona_url_type_mapping_dup (const EdsfPersonaUrlTypeMapping* self);
static void edsf_persona_url_type_mapping_free (EdsfPersonaUrlTypeMapping* self);
static void edsf_persona_url_type_mapping_copy (const EdsfPersonaUrlTypeMapping* self, EdsfPersonaUrlTypeMapping* dest);
static void edsf_persona_url_type_mapping_destroy (EdsfPersonaUrlTypeMapping* self);
static void _edsf_persona_store_set_local_ids_data_free (gpointer _data);
void _edsf_persona_store_set_local_ids (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_local_ids_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_local_ids_co (EdsfPersonaStoreSetLocalIdsData* _data_);
static void _edsf_persona_store_set_local_ids_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_is_favourite_data_free (gpointer _data);
void _edsf_persona_store_set_is_favourite (EdsfPersonaStore* self, EdsfPersona* persona, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_is_favourite_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_is_favourite_co (EdsfPersonaStoreSetIsFavouriteData* _data_);
static void _edsf_persona_store_set_is_favourite_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_avatar_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_avatar_co (EdsfPersonaStoreSetContactAvatarData* _data_);
static void _edsf_persona_store_set_contact_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _vala_EContactPhoto_free (EContactPhoto* self);
static void _edsf_persona_store_set_emails_data_free (gpointer _data);
void _edsf_persona_store_set_emails (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* emails, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_emails_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_emails_co (EdsfPersonaStoreSetEmailsData* _data_);
static void _edsf_persona_store_set_emails_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
FolksExtendedFieldDetails* _edsf_persona_store_get_extended_field (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* name);
static void _edsf_persona_store_change_extended_field_data_free (gpointer _data);
void _edsf_persona_store_change_extended_field (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* name, FolksExtendedFieldDetails* details, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_change_extended_field_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_change_extended_field_co (EdsfPersonaStoreChangeExtendedFieldData* _data_);
static EVCardAttribute* _vala_EVCardAttribute_copy (EVCardAttribute* self);
static void _edsf_persona_store_change_extended_field_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_remove_extended_field_data_free (gpointer _data);
void _edsf_persona_store_remove_extended_field (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* name, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_remove_extended_field_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_remove_extended_field_co (EdsfPersonaStoreRemoveExtendedFieldData* _data_);
static void _edsf_persona_store_remove_extended_field_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_phones_data_free (gpointer _data);
void _edsf_persona_store_set_phones (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* phones, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_phones_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_phones_co (EdsfPersonaStoreSetPhonesData* _data_);
static void _edsf_persona_store_set_phones_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_postal_addresses_data_free (gpointer _data);
void _edsf_persona_store_set_postal_addresses (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* postal_fds, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_postal_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_postal_addresses_co (EdsfPersonaStoreSetPostalAddressesData* _data_);
static void _edsf_persona_store_set_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_attributes (EdsfPersonaStore* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, EContact* contact, GeeSet* new_attributes, EdsfPersonaStoreFieldToAttribute fill_attribute, void* fill_attribute_target, const gchar* attrib_name, EContactField field_id);
static void __lambda5_ (EdsfPersonaStore* self, EVCardAttribute* attr, FolksPostalAddress* address);
static void ___lambda5__edsf_persona_store_field_to_attribute (EVCardAttribute* attr, gconstpointer value, gpointer self);
static void __vala_EVCardAttribute_free0_ (gpointer var);
static void _g_list_free___vala_EVCardAttribute_free0_ (GList* self);
static void __lambda4_ (EdsfPersonaStore* self, EVCardAttribute* attr, const gchar* value);
static void ___lambda4__edsf_persona_store_field_to_attribute (EVCardAttribute* attr, gconstpointer value, gpointer self);
static void _edsf_persona_store_set_full_name_data_free (gpointer _data);
void _edsf_persona_store_set_full_name (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_full_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_full_name_co (EdsfPersonaStoreSetFullNameData* _data_);
static void _edsf_persona_store_set_full_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_nickname_data_free (gpointer _data);
void _edsf_persona_store_set_nickname (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_nickname_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_nickname_co (EdsfPersonaStoreSetNicknameData* _data_);
static void _edsf_persona_store_set_nickname_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_notes_data_free (gpointer _data);
void _edsf_persona_store_set_notes (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_notes_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_notes_co (EdsfPersonaStoreSetNotesData* _data_);
static void _edsf_persona_store_set_notes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_birthday_data_free (gpointer _data);
void _edsf_persona_store_set_birthday (EdsfPersonaStore* self, EdsfPersona* persona, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_birthday_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_birthday_co (EdsfPersonaStoreSetBirthdayData* _data_);
static void _edsf_persona_store_set_birthday_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _vala_EContactDate_free (EContactDate* self);
static EContactDate* _vala_EContactDate_copy (EContactDate* self);
static void _edsf_persona_store_set_roles_data_free (gpointer _data);
void _edsf_persona_store_set_roles (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_roles_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_roles_co (EdsfPersonaStoreSetRolesData* _data_);
static void _edsf_persona_store_set_roles_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_structured_name_data_free (gpointer _data);
void _edsf_persona_store_set_structured_name (EdsfPersonaStore* self, EdsfPersona* persona, FolksStructuredName* sname, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_structured_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_structured_name_co (EdsfPersonaStoreSetStructuredNameData* _data_);
static void _edsf_persona_store_set_structured_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _vala_EContactName_free (EContactName* self);
static void _edsf_persona_store_set_im_fds_data_free (gpointer _data);
void _edsf_persona_store_set_im_fds (EdsfPersonaStore* self, EdsfPersona* persona, GeeMultiMap* im_fds, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_im_fds_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_im_fds_co (EdsfPersonaStoreSetImFdsData* _data_);
static void _edsf_persona_store_set_im_fds_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
GHashTable* _edsf_persona_get_im_eds_map (void);
static void _edsf_persona_store_set_groups_data_free (gpointer _data);
void _edsf_persona_store_set_groups (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_groups_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_groups_co (EdsfPersonaStoreSetGroupsData* _data_);
static void _edsf_persona_store_set_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_system_groups_data_free (gpointer _data);
void _edsf_persona_store_set_system_groups (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* system_groups, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_system_groups_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_system_groups_co (EdsfPersonaStoreSetSystemGroupsData* _data_);
gboolean _edsf_persona_store_is_google_contacts_address_book (EdsfPersonaStore* self);
GeeSet* edsf_persona_get_system_groups (EdsfPersona* self);
static void _edsf_persona_store_set_contact_system_groups (EdsfPersonaStore* self, EContact* contact, GeeSet* system_groups);
static void _edsf_persona_store_set_system_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _g_free0_ (gpointer var);
static void _g_list_free__g_free0_ (GList* self);
static void _edsf_persona_store_set_gender_data_free (gpointer _data);
void _edsf_persona_store_set_gender (EdsfPersonaStore* self, EdsfPersona* persona, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_gender_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_gender_co (EdsfPersonaStoreSetGenderData* _data_);
static void _edsf_persona_store_set_gender_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
#define EDSF_PERSONA_gender_attribute_name "X-GENDER"
#define EDSF_PERSONA_gender_male "M"
#define EDSF_PERSONA_gender_female "F"
static void _edsf_persona_store_set_anti_links_data_free (gpointer _data);
void _edsf_persona_store_set_anti_links (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* anti_links, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_anti_links_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_anti_links_co (EdsfPersonaStoreSetAntiLinksData* _data_);
static void _edsf_persona_store_set_contact_anti_links (EdsfPersonaStore* self, EContact* contact, GeeSet* anti_links);
static void _edsf_persona_store_set_anti_links_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_location_data_free (gpointer _data);
void _edsf_persona_store_set_location (EdsfPersonaStore* self, EdsfPersona* persona, FolksLocation* location, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_location_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static gboolean _edsf_persona_store_set_location_co (EdsfPersonaStoreSetLocationData* _data_);
static void _edsf_persona_store_set_location_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _vala_EContactGeo_free (EContactGeo* self);
static EdsfPersonaStoreIdleTask* edsf_persona_store_idle_task_new (void);
static EdsfPersonaStoreIdleTask* edsf_persona_store_idle_task_construct (GType object_type);
static gboolean _edsf_persona_store_idle_process (EdsfPersonaStore* self);
static gboolean __edsf_persona_store_idle_process_gsource_func (gpointer self);
static GeeLinkedList* _edsf_persona_store_copy_contacts (EdsfPersonaStore* self, GList* contacts);
static GeeLinkedList* _edsf_persona_store_copy_contacts_ids (EdsfPersonaStore* self, GList* contacts_ids);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static gboolean __lambda9_ (Block6Data* _data6_);
static gboolean _edsf_persona_store_contacts_added_idle (EdsfPersonaStore* self, GeeList* contacts);
static gboolean ___lambda9__gsource_func (gpointer self);
gchar* edsf_persona_build_iid_from_contact (const gchar* store_id, EContact* contact);
EdsfPersona* edsf_persona_new (EdsfPersonaStore* store, EContact* contact);
EdsfPersona* edsf_persona_construct (GType object_type, EdsfPersonaStore* store, EContact* contact);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static gboolean __lambda11_ (Block7Data* _data7_);
static gboolean _edsf_persona_store_contacts_changed_idle (EdsfPersonaStore* self, GeeList* contacts);
static gboolean ___lambda11__gsource_func (gpointer self);
void _edsf_persona_update (EdsfPersona* self, EContact* updated_contact);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static gboolean __lambda10_ (Block8Data* _data8_);
static gboolean _edsf_persona_store_contacts_removed_idle (EdsfPersonaStore* self, GeeList* contacts_ids);
static gboolean ___lambda10__gsource_func (gpointer self);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
static gboolean __lambda14_ (Block9Data* _data9_);
static gboolean _edsf_persona_store_contacts_complete_idle_cb (EdsfPersonaStore* self, GError* err);
static gboolean ___lambda14__gsource_func (gpointer self);
static gboolean _edsf_persona_store_backend_name_matches (EdsfPersonaStore* self, const gchar* backend_name);
static gboolean _edsf_persona_store_is_in_source_registry (EdsfPersonaStore* self);
static void _edsf_persona_store_source_changed_cb (EdsfPersonaStore* self);
static void edsf_persona_store_set_source (EdsfPersonaStore* self, ESource* value);
static GObject * edsf_persona_store_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void __edsf_persona_store_source_changed_cb_e_source_changed (ESource* _sender, gpointer self);
enum  {
	EDSF_PERSONA_STORE_IDLE_TASK_DUMMY_PROPERTY
};
static void edsf_persona_store_idle_task_finalize (EdsfPersonaStoreIdleTask * obj);
static void edsf_persona_store_finalize (GObject * obj);
static void _vala_edsf_persona_store_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_edsf_persona_store_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

extern const EdsfPersonaUrlTypeMapping EDSF_PERSONA__url_properties[4];

static void __edsf_persona_store_contacts_added_cb_e_book_client_view_objects_added (EBookClientView* _sender, GList* object, gpointer self) {
	_edsf_persona_store_contacts_added_cb ((EdsfPersonaStore*) self, object);
}


static void __edsf_persona_store_contacts_removed_cb_e_book_client_view_objects_removed (EBookClientView* _sender, GList* object, gpointer self) {
	_edsf_persona_store_contacts_removed_cb ((EdsfPersonaStore*) self, object);
}


static void __edsf_persona_store_contacts_changed_cb_e_book_client_view_objects_modified (EBookClientView* _sender, GList* object, gpointer self) {
	_edsf_persona_store_contacts_changed_cb ((EdsfPersonaStore*) self, object);
}


static void __edsf_persona_store_contacts_complete_cb_e_book_client_view_complete (EBookClientView* _sender, GError* _error_, gpointer self) {
	_edsf_persona_store_contacts_complete_cb ((EdsfPersonaStore*) self, _error_);
}


static void __edsf_persona_store_address_book_notify_read_only_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_edsf_persona_store_address_book_notify_read_only_cb ((EdsfPersonaStore*) self, _sender, pspec);
}


static void __edsf_persona_store_source_registry_changed_cb_e_source_registry_source_removed (ESourceRegistry* _sender, ESource* source, gpointer self) {
	_edsf_persona_store_source_registry_changed_cb ((EdsfPersonaStore*) self, source);
}


static void __edsf_persona_store_source_registry_changed_cb_e_source_registry_source_disabled (ESourceRegistry* _sender, ESource* source, gpointer self) {
	_edsf_persona_store_source_registry_changed_cb ((EdsfPersonaStore*) self, source);
}


static void edsf_persona_store_create_address_book_data_free (gpointer _data) {
	EdsfPersonaStoreCreateAddressBookData* _data_;
	_data_ = _data;
	_g_free0 (_data_->id);
	g_slice_free (EdsfPersonaStoreCreateAddressBookData, _data_);
}


void edsf_persona_store_create_address_book (const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreCreateAddressBookData* _data_;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	_data_ = g_slice_new0 (EdsfPersonaStoreCreateAddressBookData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, edsf_persona_store_create_address_book);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_store_create_address_book_data_free);
	_tmp0_ = id;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (_data_->id);
	_data_->id = _tmp1_;
	edsf_persona_store_create_address_book_co (_data_);
}


void edsf_persona_store_create_address_book_finish (GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreCreateAddressBookData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


/**
   * Create a new address book with the given ID.
   *
   * A new Address Book will be created with the given ID and the EDS
   * SourceRegistry will notice the new Address Book source and will emit
   * source_added with the new {@link E.Source} object which
   * {@link Folks.Backends.Eds.Backend} will then create a new
   * {@link Edsf.PersonaStore} from.
   *
   * @param id the name and id for the new address book
   * @throws GLib.Error if an error occurred while creating or committing to
   * the {@link E.SourceRegistry}
   *
   * @since 0.9.0
   */
static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void edsf_persona_store_create_address_book_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreCreateAddressBookData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_store_create_address_book_co (_data_);
}


static gboolean edsf_persona_store_create_address_book_co (EdsfPersonaStoreCreateAddressBookData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->id;
	g_debug ("edsf-persona-store.vala:99: Creating addressbook %s", _data_->_tmp0_);
	_data_->_tmp1_ = _data_->id;
	_data_->_tmp2_ = e_source_new_with_uid (_data_->_tmp1_, NULL, &_data_->_inner_error_);
	_data_->new_source = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->new_source;
	e_source_set_parent (_data_->_tmp3_, "local-stub");
	_data_->_tmp4_ = _data_->new_source;
	_data_->_tmp5_ = _data_->id;
	e_source_set_display_name (_data_->_tmp4_, _data_->_tmp5_);
	_data_->_tmp6_ = _data_->new_source;
	_data_->_tmp7_ = e_source_get_extension (_data_->_tmp6_, "Address Book");
	_data_->_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp7_, e_source_address_book_get_type (), ESourceAddressBook));
	_data_->ab_extension = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->ab_extension;
	e_source_backend_set_backend_name ((ESourceBackend*) _data_->_tmp9_, "local");
	_data_->_state_ = 1;
	e_source_registry_new (NULL, edsf_persona_store_create_address_book_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp10_ = e_source_registry_new_finish (_data_->_res_, &_data_->_inner_error_);
	_data_->registry = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
		_g_object_unref0 (_data_->ab_extension);
		_g_object_unref0 (_data_->new_source);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->registry;
	_data_->_tmp12_ = _data_->new_source;
	_data_->_state_ = 2;
	e_source_registry_commit_source (_data_->_tmp11_, _data_->_tmp12_, NULL, edsf_persona_store_create_address_book_ready, _data_);
	return FALSE;
	_state_2:
	e_source_registry_commit_source_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
		_g_object_unref0 (_data_->registry);
		_g_object_unref0 (_data_->ab_extension);
		_g_object_unref0 (_data_->new_source);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->registry);
	_g_object_unref0 (_data_->ab_extension);
	_g_object_unref0 (_data_->new_source);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_store_remove_address_book_data_free (gpointer _data) {
	EdsfPersonaStoreRemoveAddressBookData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->store);
	g_slice_free (EdsfPersonaStoreRemoveAddressBookData, _data_);
}


void edsf_persona_store_remove_address_book (EdsfPersonaStore* store, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreRemoveAddressBookData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersonaStore* _tmp1_;
	_data_ = g_slice_new0 (EdsfPersonaStoreRemoveAddressBookData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, edsf_persona_store_remove_address_book);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_store_remove_address_book_data_free);
	_tmp0_ = store;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data_->store);
	_data_->store = _tmp1_;
	edsf_persona_store_remove_address_book_co (_data_);
}


void edsf_persona_store_remove_address_book_finish (GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreRemoveAddressBookData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


/**
   * Remove a persona store's address book permamently.
   *
   * This is a utility function to remove an {@link Edsf.PersonaStore}'s address
   * book from the disk permanently.  This simply wraps the EDS API to do
   * the same.
   *
   * @param store the PersonaStore to delete the address book for.
   * @throws GLib.Error if an error occurred in {@link E.Source.remove}
   *
   * @since 0.9.0
   */
static void edsf_persona_store_remove_address_book_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreRemoveAddressBookData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_store_remove_address_book_co (_data_);
}


static gboolean edsf_persona_store_remove_address_book_co (EdsfPersonaStoreRemoveAddressBookData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->store;
	_data_->_tmp1_ = _data_->_tmp0_->priv->_source;
	_data_->_state_ = 1;
	e_source_remove (_data_->_tmp1_, NULL, edsf_persona_store_remove_address_book_ready, _data_);
	return FALSE;
	_state_1:
	e_source_remove_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_address_book_notify_read_only_cb (EdsfPersonaStore* self, GObject* address_book, GParamSpec* pspec) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (address_book != NULL);
	g_return_if_fail (pspec != NULL);
	_edsf_persona_store_update_trust_level (self);
	g_object_notify ((GObject*) self, "can-add-personas");
	g_object_notify ((GObject*) self, "can-remove-personas");
}


/**
   * Create a new PersonaStore.
   *
   * Create a new persona store to store the {@link Persona}s for the contacts
   *
   * @param s the e-d-s source being represented by the persona store
   *
   * @since 0.6.0
   */
EdsfPersonaStore* edsf_persona_store_construct (GType object_type, ESource* s) {
	EdsfPersonaStore * self = NULL;
	gchar* eds_uid;
	ESource* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* eds_name;
	ESource* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	ESource* _tmp6_;
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = s;
	_tmp1_ = e_source_get_uid (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	eds_uid = _tmp2_;
	_tmp3_ = s;
	_tmp4_ = e_source_get_display_name (_tmp3_);
	_tmp5_ = g_strdup (_tmp4_);
	eds_name = _tmp5_;
	_tmp6_ = s;
	self = (EdsfPersonaStore*) g_object_new (object_type, "id", eds_uid, "display-name", eds_name, "source", _tmp6_, NULL);
	_g_object_unref0 (self->priv->_source_registry);
	self->priv->_source_registry = NULL;
	_g_free0 (eds_name);
	_g_free0 (eds_uid);
	return self;
}


EdsfPersonaStore* edsf_persona_store_new (ESource* s) {
	return edsf_persona_store_construct (EDSF_TYPE_PERSONA_STORE, s);
}


/**
   * Create a new PersonaStore.
   *
   * Create a new persona store to store the {@link Persona}s for the contacts
   * in ``s``. Passing a re-used source registry to the constructor (compared to
   * the old {@link Edsf.PersonaStore} constructor) saves a lot of time and
   * D-Bus round trips.
   *
   * @param r the EDS source registry giving access to all EDS sources
   * @param s the EDS source being represented by the persona store
   *
   * @since 0.7.2
   */
EdsfPersonaStore* edsf_persona_store_construct_with_source_registry (GType object_type, ESourceRegistry* r, ESource* s) {
	EdsfPersonaStore * self = NULL;
	gchar* eds_uid;
	ESource* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* eds_name;
	ESource* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	ESource* _tmp6_;
	ESourceRegistry* _tmp7_;
	ESourceRegistry* _tmp8_;
	g_return_val_if_fail (r != NULL, NULL);
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = s;
	_tmp1_ = e_source_get_uid (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	eds_uid = _tmp2_;
	_tmp3_ = s;
	_tmp4_ = e_source_get_display_name (_tmp3_);
	_tmp5_ = g_strdup (_tmp4_);
	eds_name = _tmp5_;
	_tmp6_ = s;
	self = (EdsfPersonaStore*) g_object_new (object_type, "id", eds_uid, "display-name", eds_name, "source", _tmp6_, NULL);
	_tmp7_ = r;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	_g_object_unref0 (self->priv->_source_registry);
	self->priv->_source_registry = _tmp8_;
	_g_free0 (eds_name);
	_g_free0 (eds_uid);
	return self;
}


EdsfPersonaStore* edsf_persona_store_new_with_source_registry (ESourceRegistry* r, ESource* s) {
	return edsf_persona_store_construct_with_source_registry (EDSF_TYPE_PERSONA_STORE, r, s);
}


static void edsf_persona_store_real_add_persona_from_details_data_free (gpointer _data) {
	EdsfPersonaStoreAddPersonaFromDetailsData* _data_;
	_data_ = _data;
	_g_hash_table_unref0 (_data_->details);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreAddPersonaFromDetailsData, _data_);
}


static gpointer _g_hash_table_ref0 (gpointer self) {
	return self ? g_hash_table_ref (self) : NULL;
}


static void edsf_persona_store_real_add_persona_from_details (FolksPersonaStore* base, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStore * self;
	EdsfPersonaStoreAddPersonaFromDetailsData* _data_;
	EdsfPersonaStore* _tmp0_;
	GHashTable* _tmp1_;
	GHashTable* _tmp2_;
	self = (EdsfPersonaStore*) base;
	_data_ = g_slice_new0 (EdsfPersonaStoreAddPersonaFromDetailsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_store_real_add_persona_from_details);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_store_real_add_persona_from_details_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = details;
	_tmp2_ = _g_hash_table_ref0 (_tmp1_);
	_g_hash_table_unref0 (_data_->details);
	_data_->details = _tmp2_;
	edsf_persona_store_real_add_persona_from_details_co (_data_);
}


static FolksPersona* edsf_persona_store_real_add_persona_from_details_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	FolksPersona* result;
	EdsfPersonaStoreAddPersonaFromDetailsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


/**
   * Add a new {@link Persona} to the PersonaStore.
   *
   * Accepted keys for ``details`` are:
   * - PersonaStore.detail_key (PersonaDetail.AVATAR)
   * - PersonaStore.detail_key (PersonaDetail.BIRTHDAY)
   * - PersonaStore.detail_key (PersonaDetail.EMAIL_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.FULL_NAME)
   * - PersonaStore.detail_key (PersonaDetail.GENDER)
   * - PersonaStore.detail_key (PersonaDetail.IM_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.IS_FAVOURITE)
   * - PersonaStore.detail_key (PersonaDetail.NICKNAME)
   * - PersonaStore.detail_key (PersonaDetail.PHONE_NUMBERS)
   * - PersonaStore.detail_key (PersonaDetail.POSTAL_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.ROLES)
   * - PersonaStore.detail_key (PersonaDetail.STRUCTURED_NAME)
   * - PersonaStore.detail_key (PersonaDetail.LOCAL_IDS)
   * - PersonaStore.detail_key (PersonaDetail.LOCATION)
   * - PersonaStore.detail_key (PersonaDetail.WEB_SERVICE_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.NOTES)
   * - PersonaStore.detail_key (PersonaDetail.URLS)
   * - PersonaStore.detail_key (PersonaDetail.GROUPS)
   *
   * See {@link Folks.PersonaStore.add_persona_from_details}.
   *
   * @throws Folks.PersonaStoreError.STORE_OFFLINE if the store hasn’t been
   * prepared
   * @throws Folks.PersonaStoreError.CREATE_FAILED if creating the persona in
   * the EDS store failed
   *
   * @since 0.6.0
   */
static void edsf_persona_store_add_persona_from_details_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreAddPersonaFromDetailsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_store_real_add_persona_from_details_co (_data_);
}


static gpointer _g_date_time_ref0 (gpointer self) {
	return self ? g_date_time_ref (self) : NULL;
}


static gboolean edsf_persona_store_real_add_persona_from_details_co (EdsfPersonaStoreAddPersonaFromDetailsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_is_prepared;
	if (!_data_->_tmp0_) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, "Persona store has not yet been prepared.");
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = e_contact_new ();
	_data_->contact = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->details;
	g_hash_table_iter_init (&_data_->iter, _data_->_tmp3_);
	_data_->is_fav = FALSE;
	_data_->_tmp4_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->groups = (GeeSet*) _data_->_tmp4_;
	while (TRUE) {
		_data_->_tmp5_ = NULL;
		_data_->_tmp6_ = NULL;
		_data_->_tmp7_ = g_hash_table_iter_next (&_data_->iter, (gpointer*) (&_data_->_tmp5_), (gpointer*) (&_data_->_tmp6_));
		_data_->k = _data_->_tmp5_;
		_data_->_v = _data_->_tmp6_;
		if (!(_data_->_tmp7_ == TRUE)) {
			break;
		}
		_data_->_tmp8_ = _data_->_v;
		if (_data_->_tmp8_ == NULL) {
			continue;
		}
		_data_->_tmp9_ = _data_->_v;
		_data_->v = (GValue) (*_data_->_tmp9_);
		_data_->_tmp10_ = _data_->k;
		_data_->_tmp11_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_FULL_NAME);
		if (g_strcmp0 (_data_->_tmp10_, _data_->_tmp11_) == 0) {
			_data_->_tmp12_ = g_value_get_string (&_data_->v);
			_data_->_tmp13_ = g_strdup (_data_->_tmp12_);
			_data_->full_name = _data_->_tmp13_;
			_data_->_tmp15_ = _data_->full_name;
			if (_data_->_tmp15_ != NULL) {
				_data_->_tmp16_ = _data_->full_name;
				_data_->_tmp14_ = g_strcmp0 ((const gchar*) _data_->_tmp16_, "") == 0;
			} else {
				_data_->_tmp14_ = FALSE;
			}
			if (_data_->_tmp14_) {
				_g_free0 (_data_->full_name);
				_data_->full_name = NULL;
			}
			_data_->_tmp17_ = _data_->contact;
			_data_->_tmp18_ = e_contact_field_id ("full_name");
			_data_->_tmp19_ = _data_->full_name;
			e_contact_set (_data_->_tmp17_, _data_->_tmp18_, _data_->_tmp19_);
			_g_free0 (_data_->full_name);
		} else {
			_data_->_tmp20_ = _data_->k;
			_data_->_tmp21_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_NICKNAME);
			if (g_strcmp0 (_data_->_tmp20_, _data_->_tmp21_) == 0) {
				_data_->_tmp22_ = g_value_get_string (&_data_->v);
				_data_->_tmp23_ = g_strdup (_data_->_tmp22_);
				_data_->nickname = _data_->_tmp23_;
				_data_->_tmp25_ = _data_->nickname;
				if (_data_->_tmp25_ != NULL) {
					_data_->_tmp26_ = _data_->nickname;
					_data_->_tmp24_ = g_strcmp0 ((const gchar*) _data_->_tmp26_, "") == 0;
				} else {
					_data_->_tmp24_ = FALSE;
				}
				if (_data_->_tmp24_) {
					_g_free0 (_data_->nickname);
					_data_->nickname = NULL;
				}
				_data_->_tmp27_ = _data_->contact;
				_data_->_tmp28_ = e_contact_field_id ("nickname");
				_data_->_tmp29_ = _data_->nickname;
				e_contact_set (_data_->_tmp27_, _data_->_tmp28_, _data_->_tmp29_);
				_g_free0 (_data_->nickname);
			} else {
				_data_->_tmp30_ = _data_->k;
				_data_->_tmp31_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_EMAIL_ADDRESSES);
				if (g_strcmp0 (_data_->_tmp30_, _data_->_tmp31_) == 0) {
					_data_->_tmp32_ = g_value_get_object (&_data_->v);
					_data_->_tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp32_, GEE_TYPE_SET, GeeSet));
					_data_->email_addresses = _data_->_tmp33_;
					_data_->_tmp34_ = _data_->contact;
					_data_->_tmp35_ = _data_->email_addresses;
					_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp34_, _data_->_tmp35_, "EMAIL", E_CONTACT_EMAIL);
					_g_object_unref0 (_data_->email_addresses);
				} else {
					_data_->_tmp36_ = _data_->k;
					_data_->_tmp37_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_AVATAR);
					if (g_strcmp0 (_data_->_tmp36_, _data_->_tmp37_) == 0) {
						{
							_data_->_tmp38_ = g_value_get_object (&_data_->v);
							_data_->_tmp39_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp38_, g_loadable_icon_get_type (), GLoadableIcon));
							_data_->avatar = _data_->_tmp39_;
							_data_->_tmp40_ = _data_->contact;
							_data_->_tmp41_ = _data_->avatar;
							_data_->_state_ = 1;
							_edsf_persona_store_set_contact_avatar (_data_->self, _data_->_tmp40_, _data_->_tmp41_, edsf_persona_store_add_persona_from_details_ready, _data_);
							return FALSE;
							_state_1:
							_edsf_persona_store_set_contact_avatar_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
							if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
								_g_object_unref0 (_data_->avatar);
								if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
									goto __catch3_folks_property_error;
								}
								_g_object_unref0 (_data_->avatar);
								_g_object_unref0 (_data_->groups);
								_g_object_unref0 (_data_->contact);
								g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
								g_clear_error (&_data_->_inner_error_);
								return FALSE;
							}
							_g_object_unref0 (_data_->avatar);
						}
						goto __finally3;
						__catch3_folks_property_error:
						{
							_data_->e1 = _data_->_inner_error_;
							_data_->_inner_error_ = NULL;
							_data_->_tmp42_ = _data_->e1;
							_data_->_tmp43_ = _data_->_tmp42_->message;
							g_warning ("edsf-persona-store.vala:477: Couldn't set avatar on the EContact: %s", _data_->_tmp43_);
							_g_error_free0 (_data_->e1);
						}
						__finally3:
						if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
							if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
								g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
								_g_object_unref0 (_data_->groups);
								_g_object_unref0 (_data_->contact);
								if (_data_->_state_ == 0) {
									g_simple_async_result_complete_in_idle (_data_->_async_result);
								} else {
									g_simple_async_result_complete (_data_->_async_result);
								}
								g_object_unref (_data_->_async_result);
								return FALSE;
							} else {
								_g_object_unref0 (_data_->groups);
								_g_object_unref0 (_data_->contact);
								g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
								g_clear_error (&_data_->_inner_error_);
								return FALSE;
							}
						}
					} else {
						_data_->_tmp44_ = _data_->k;
						_data_->_tmp45_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IM_ADDRESSES);
						if (g_strcmp0 (_data_->_tmp44_, _data_->_tmp45_) == 0) {
							_data_->_tmp46_ = g_value_get_object (&_data_->v);
							_data_->_tmp47_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp46_, GEE_TYPE_MULTI_MAP, GeeMultiMap));
							_data_->im_fds = _data_->_tmp47_;
							_data_->_tmp48_ = _data_->contact;
							_data_->_tmp49_ = _data_->im_fds;
							_edsf_persona_store_set_contact_im_fds (_data_->self, _data_->_tmp48_, _data_->_tmp49_);
							_g_object_unref0 (_data_->im_fds);
						} else {
							_data_->_tmp50_ = _data_->k;
							_data_->_tmp51_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_PHONE_NUMBERS);
							if (g_strcmp0 (_data_->_tmp50_, _data_->_tmp51_) == 0) {
								_data_->_tmp52_ = g_value_get_object (&_data_->v);
								_data_->_tmp53_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp52_, GEE_TYPE_SET, GeeSet));
								_data_->phone_numbers = _data_->_tmp53_;
								_data_->_tmp54_ = _data_->contact;
								_data_->_tmp55_ = _data_->phone_numbers;
								_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp54_, _data_->_tmp55_, "TEL", E_CONTACT_TEL);
								_g_object_unref0 (_data_->phone_numbers);
							} else {
								_data_->_tmp56_ = _data_->k;
								_data_->_tmp57_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_POSTAL_ADDRESSES);
								if (g_strcmp0 (_data_->_tmp56_, _data_->_tmp57_) == 0) {
									_data_->_tmp58_ = g_value_get_object (&_data_->v);
									_data_->_tmp59_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp58_, GEE_TYPE_SET, GeeSet));
									_data_->postal_fds = _data_->_tmp59_;
									_data_->_tmp60_ = _data_->contact;
									_data_->_tmp61_ = _data_->postal_fds;
									_edsf_persona_store_set_contact_postal_addresses (_data_->self, _data_->_tmp60_, _data_->_tmp61_);
									_g_object_unref0 (_data_->postal_fds);
								} else {
									_data_->_tmp62_ = _data_->k;
									_data_->_tmp63_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_STRUCTURED_NAME);
									if (g_strcmp0 (_data_->_tmp62_, _data_->_tmp63_) == 0) {
										_data_->_tmp64_ = g_value_get_object (&_data_->v);
										_data_->_tmp65_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp64_, FOLKS_TYPE_STRUCTURED_NAME, FolksStructuredName));
										_data_->sname = _data_->_tmp65_;
										_data_->_tmp66_ = _data_->contact;
										_data_->_tmp67_ = _data_->sname;
										_edsf_persona_store_set_contact_name (_data_->self, _data_->_tmp66_, _data_->_tmp67_);
										_g_object_unref0 (_data_->sname);
									} else {
										_data_->_tmp68_ = _data_->k;
										_data_->_tmp69_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_LOCAL_IDS);
										if (g_strcmp0 (_data_->_tmp68_, _data_->_tmp69_) == 0) {
											_data_->_tmp70_ = g_value_get_object (&_data_->v);
											_data_->_tmp71_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp70_, GEE_TYPE_SET, GeeSet));
											_data_->local_ids = _data_->_tmp71_;
											_data_->_tmp72_ = _data_->contact;
											_data_->_tmp73_ = _data_->local_ids;
											_edsf_persona_store_set_contact_local_ids (_data_->self, _data_->_tmp72_, _data_->_tmp73_);
											_g_object_unref0 (_data_->local_ids);
										} else {
											_data_->_tmp74_ = _data_->k;
											_data_->_tmp75_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_LOCATION);
											if (g_strcmp0 (_data_->_tmp74_, _data_->_tmp75_) == 0) {
												_data_->_tmp76_ = g_value_get_object (&_data_->v);
												_data_->_tmp77_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp76_, FOLKS_TYPE_LOCATION, FolksLocation));
												_data_->location = _data_->_tmp77_;
												_data_->_tmp78_ = _data_->contact;
												_data_->_tmp79_ = _data_->location;
												_edsf_persona_store_set_contact_location (_data_->self, _data_->_tmp78_, _data_->_tmp79_);
												_g_object_unref0 (_data_->location);
											} else {
												_data_->_tmp80_ = _data_->k;
												_data_->_tmp81_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_WEB_SERVICE_ADDRESSES);
												if (g_strcmp0 (_data_->_tmp80_, _data_->_tmp81_) == 0) {
													_data_->_tmp82_ = g_value_get_object (&_data_->v);
													_data_->_tmp83_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp82_, GEE_TYPE_HASH_MULTI_MAP, GeeHashMultiMap));
													_data_->web_service_addresses = _data_->_tmp83_;
													_data_->_tmp84_ = _data_->contact;
													_data_->_tmp85_ = _data_->web_service_addresses;
													_edsf_persona_store_set_contact_web_service_addresses (_data_->self, _data_->_tmp84_, (GeeMultiMap*) _data_->_tmp85_);
													_g_object_unref0 (_data_->web_service_addresses);
												} else {
													_data_->_tmp86_ = _data_->k;
													_data_->_tmp87_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_NOTES);
													if (g_strcmp0 (_data_->_tmp86_, _data_->_tmp87_) == 0) {
														_data_->_tmp88_ = g_value_get_object (&_data_->v);
														_data_->_tmp89_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp88_, GEE_TYPE_SET, GeeSet));
														_data_->notes = _data_->_tmp89_;
														_data_->_tmp90_ = _data_->contact;
														_data_->_tmp91_ = _data_->notes;
														_edsf_persona_store_set_contact_notes (_data_->self, _data_->_tmp90_, _data_->_tmp91_);
														_g_object_unref0 (_data_->notes);
													} else {
														_data_->_tmp92_ = _data_->k;
														_data_->_tmp93_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_GENDER);
														if (g_strcmp0 (_data_->_tmp92_, _data_->_tmp93_) == 0) {
															_data_->_tmp94_ = g_value_get_enum (&_data_->v);
															_data_->gender = (FolksGender) _data_->_tmp94_;
															_data_->_tmp95_ = _data_->contact;
															_data_->_tmp96_ = _data_->gender;
															_edsf_persona_store_set_contact_gender (_data_->self, _data_->_tmp95_, _data_->_tmp96_);
														} else {
															_data_->_tmp97_ = _data_->k;
															_data_->_tmp98_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_URLS);
															if (g_strcmp0 (_data_->_tmp97_, _data_->_tmp98_) == 0) {
																_data_->_tmp99_ = g_value_get_object (&_data_->v);
																_data_->_tmp100_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp99_, GEE_TYPE_SET, GeeSet));
																_data_->urls = _data_->_tmp100_;
																_data_->_tmp101_ = _data_->contact;
																_data_->_tmp102_ = _data_->urls;
																_edsf_persona_store_set_contact_urls (_data_->self, _data_->_tmp101_, _data_->_tmp102_);
																_g_object_unref0 (_data_->urls);
															} else {
																_data_->_tmp103_ = _data_->k;
																_data_->_tmp104_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_BIRTHDAY);
																if (g_strcmp0 (_data_->_tmp103_, _data_->_tmp104_) == 0) {
																	_data_->_tmp105_ = g_value_get_boxed (&_data_->v);
																	_data_->_tmp106_ = _g_date_time_ref0 ((GDateTime*) _data_->_tmp105_);
																	_data_->birthday = _data_->_tmp106_;
																	_data_->_tmp107_ = _data_->contact;
																	_data_->_tmp108_ = _data_->birthday;
																	_edsf_persona_store_set_contact_birthday (_data_->self, _data_->_tmp107_, _data_->_tmp108_);
																	_g_date_time_unref0 (_data_->birthday);
																} else {
																	_data_->_tmp109_ = _data_->k;
																	_data_->_tmp110_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_ROLES);
																	if (g_strcmp0 (_data_->_tmp109_, _data_->_tmp110_) == 0) {
																		_data_->_tmp111_ = g_value_get_object (&_data_->v);
																		_data_->_tmp112_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp111_, GEE_TYPE_SET, GeeSet));
																		_data_->roles = _data_->_tmp112_;
																		_data_->_tmp113_ = _data_->contact;
																		_data_->_tmp114_ = _data_->roles;
																		_edsf_persona_store_set_contact_roles (_data_->self, _data_->_tmp113_, _data_->_tmp114_);
																		_g_object_unref0 (_data_->roles);
																	} else {
																		_data_->_tmp115_ = _data_->k;
																		_data_->_tmp116_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_GROUPS);
																		if (g_strcmp0 (_data_->_tmp115_, _data_->_tmp116_) == 0) {
																			_data_->_tmp117_ = g_value_get_object (&_data_->v);
																			_data_->_tmp118_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp117_, GEE_TYPE_SET, GeeSet));
																			_g_object_unref0 (_data_->groups);
																			_data_->groups = _data_->_tmp118_;
																			_data_->_tmp119_ = _data_->contact;
																			_data_->_tmp120_ = _data_->groups;
																			_data_->_tmp121_ = _data_->is_fav;
																			_edsf_persona_store_set_contact_groups (_data_->self, _data_->_tmp119_, _data_->_tmp120_, _data_->_tmp121_);
																		} else {
																			_data_->_tmp122_ = _data_->k;
																			_data_->_tmp123_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IS_FAVOURITE);
																			if (g_strcmp0 (_data_->_tmp122_, _data_->_tmp123_) == 0) {
																				_data_->_tmp124_ = g_value_get_boolean (&_data_->v);
																				_data_->is_fav = _data_->_tmp124_;
																				_data_->_tmp125_ = _data_->contact;
																				_data_->_tmp126_ = _data_->is_fav;
																				_edsf_persona_store_set_contact_is_favourite (_data_->self, _data_->_tmp125_, _data_->_tmp126_);
																				_data_->_tmp127_ = _data_->contact;
																				_data_->_tmp128_ = _data_->groups;
																				_data_->_tmp129_ = _data_->is_fav;
																				_edsf_persona_store_set_contact_groups (_data_->self, _data_->_tmp127_, _data_->_tmp128_, _data_->_tmp129_);
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	_data_->_tmp130_ = _data_->contact;
	_data_->_state_ = 2;
	_edsf_persona_store_add_contact (_data_->self, _data_->_tmp130_, edsf_persona_store_add_persona_from_details_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp131_ = _edsf_persona_store_add_contact_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	_data_->added_uid = _data_->_tmp131_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			_g_object_unref0 (_data_->groups);
			_g_object_unref0 (_data_->contact);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->groups);
			_g_object_unref0 (_data_->contact);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	g_debug ("edsf-persona-store.vala:574: Created contact with UID: %s", _data_->added_uid);
	_data_->_tmp132_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
	_data_->_tmp133_ = _data_->_tmp132_;
	_data_->_tmp134_ = edsf_persona_build_iid (_data_->_tmp133_, _data_->added_uid);
	_data_->iid = _data_->_tmp134_;
	_data_->_tmp135_ = _data_->self->priv->_personas;
	_data_->_tmp136_ = _data_->iid;
	_data_->_tmp137_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp135_, _data_->_tmp136_);
	_data_->_persona = (EdsfPersona*) _data_->_tmp137_;
	_data_->_tmp138_ = _data_->_persona;
	_vala_assert (_data_->_tmp138_ != NULL, "_persona != null");
	_data_->result = (FolksPersona*) _data_->_persona;
	_g_free0 (_data_->iid);
	_g_free0 (_data_->added_uid);
	_g_object_unref0 (_data_->groups);
	_g_object_unref0 (_data_->contact);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->_persona);
	_g_free0 (_data_->iid);
	_g_free0 (_data_->added_uid);
	_g_object_unref0 (_data_->groups);
	_g_object_unref0 (_data_->contact);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_store_real_remove_persona_data_free (gpointer _data) {
	EdsfPersonaStoreRemovePersonaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreRemovePersonaData, _data_);
}


static void edsf_persona_store_real_remove_persona (FolksPersonaStore* base, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStore * self;
	EdsfPersonaStoreRemovePersonaData* _data_;
	EdsfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	self = (EdsfPersonaStore*) base;
	_data_ = g_slice_new0 (EdsfPersonaStoreRemovePersonaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_store_real_remove_persona);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_store_real_remove_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	edsf_persona_store_real_remove_persona_co (_data_);
}


static void edsf_persona_store_real_remove_persona_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreRemovePersonaData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


/**
   * Remove a {@link Persona} from the PersonaStore.
   *
   * See {@link Folks.PersonaStore.remove_persona}.
   *
   * @param persona the persona that should be removed
   * @throws Folks.PersonaStoreError.STORE_OFFLINE if the store hasn’t been
   * prepared or has gone offline
   * @throws Folks.PersonaStoreError.PERMISSION_DENIED if the store denied
   * permission to delete the contact
   * @throws Folks.PersonaStoreError.READ_ONLY if the store is read only
   * @throws Folks.PersonaStoreError.REMOVE_FAILED if any other errors happened
   * in the store
   *
   * @since 0.6.0
   */
static void edsf_persona_store_remove_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreRemovePersonaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_store_real_remove_persona_co (_data_);
}


static gboolean edsf_persona_store_real_remove_persona_co (EdsfPersonaStoreRemovePersonaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_is_prepared;
	if (!_data_->_tmp0_) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, "Persona store has not yet been prepared.");
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	{
		_data_->_tmp2_ = _data_->self->priv->_addressbook;
		_data_->_tmp3_ = _data_->persona;
		_data_->_tmp4_ = edsf_persona_get_contact (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp3_, EDSF_TYPE_PERSONA, EdsfPersona));
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_state_ = 1;
		e_book_client_remove_contact (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, e_book_client_get_type (), EBookClient), _data_->_tmp5_, NULL, edsf_persona_store_remove_persona_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_remove_contact_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, e_book_client_get_type (), EBookClient), _data_->_res_, &_data_->_inner_error_);
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			goto __catch4_g_error;
		}
	}
	goto __finally4;
	__catch4_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp6_ = _data_->e;
		if (_data_->_tmp6_->domain == E_BOOK_CLIENT_ERROR) {
			_data_->_tmp7_ = _data_->e;
			if (g_error_matches (_data_->_tmp7_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_NOT_FOUND)) {
				_g_error_free0 (_data_->e);
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp11_ = _data_->e;
			if (g_error_matches (_data_->_tmp11_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK)) {
				_data_->_tmp10_ = TRUE;
			} else {
				_data_->_tmp12_ = _data_->e;
				_data_->_tmp10_ = g_error_matches (_data_->_tmp12_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS);
			}
			if (_data_->_tmp10_) {
				_data_->_tmp9_ = TRUE;
			} else {
				_data_->_tmp13_ = _data_->e;
				_data_->_tmp9_ = g_error_matches (_data_->_tmp13_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE);
			}
			if (_data_->_tmp9_) {
				_data_->_tmp8_ = TRUE;
			} else {
				_data_->_tmp14_ = _data_->e;
				_data_->_tmp8_ = g_error_matches (_data_->_tmp14_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SPACE);
			}
			if (_data_->_tmp8_) {
			}
		} else {
			_data_->_tmp15_ = _data_->e;
			_data_->_tmp16_ = _data_->_tmp15_->domain;
			_data_->_tmp17_ = e_client_error_quark ();
			if (_data_->_tmp16_ == _data_->_tmp17_) {
				_data_->_tmp18_ = _data_->e;
				_data_->_tmp19_ = _data_->_tmp18_->code;
				switch ((EClientError) _data_->_tmp19_) {
					case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
					{
						_data_->_tmp20_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
						_data_->_tmp21_ = _data_->_tmp20_;
						_data_->_tmp22_ = _data_->persona;
						_data_->_tmp23_ = folks_persona_get_uid (_data_->_tmp22_);
						_data_->_tmp24_ = _data_->_tmp23_;
						_data_->_tmp25_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _ ("Address book ‘%s’ is offline, so contact ‘%s’ cannot be removed."), _data_->_tmp21_, _data_->_tmp24_);
						_data_->_inner_error_ = _data_->_tmp25_;
						_g_error_free0 (_data_->e);
						goto __finally4;
					}
					case E_CLIENT_ERROR_PERMISSION_DENIED:
					{
						_data_->_tmp26_ = _data_->persona;
						_data_->_tmp27_ = folks_persona_get_uid (_data_->_tmp26_);
						_data_->_tmp28_ = _data_->_tmp27_;
						_data_->_tmp29_ = _data_->e;
						_data_->_tmp30_ = _data_->_tmp29_->message;
						_data_->_tmp31_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _ ("Permission denied to remove contact ‘%s’: %s"), _data_->_tmp28_, _data_->_tmp30_);
						_data_->_inner_error_ = _data_->_tmp31_;
						_g_error_free0 (_data_->e);
						goto __finally4;
					}
					case E_CLIENT_ERROR_NOT_SUPPORTED:
					{
						_data_->_tmp32_ = _data_->e;
						_data_->_tmp33_ = _data_->_tmp32_->message;
						_data_->_tmp34_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_READ_ONLY, _ ("Removing contacts isn’t supported by this persona store: %s"), _data_->_tmp33_);
						_data_->_inner_error_ = _data_->_tmp34_;
						_g_error_free0 (_data_->e);
						goto __finally4;
					}
					default:
					case E_CLIENT_ERROR_AUTHENTICATION_REQUIRED:
					case E_CLIENT_ERROR_INVALID_ARG:
					case E_CLIENT_ERROR_BUSY:
					case E_CLIENT_ERROR_DBUS_ERROR:
					case E_CLIENT_ERROR_OTHER_ERROR:
					case E_CLIENT_ERROR_COULD_NOT_CANCEL:
					case E_CLIENT_ERROR_AUTHENTICATION_FAILED:
					case E_CLIENT_ERROR_TLS_NOT_AVAILABLE:
					case E_CLIENT_ERROR_OFFLINE_UNAVAILABLE:
					case E_CLIENT_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD:
					case E_CLIENT_ERROR_SEARCH_SIZE_LIMIT_EXCEEDED:
					case E_CLIENT_ERROR_SEARCH_TIME_LIMIT_EXCEEDED:
					case E_CLIENT_ERROR_INVALID_QUERY:
					case E_CLIENT_ERROR_QUERY_REFUSED:
					{
						break;
					}
				}
			}
		}
		_data_->_tmp35_ = _data_->persona;
		_data_->_tmp36_ = folks_persona_get_uid (_data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		_data_->_tmp38_ = _data_->e;
		_data_->_tmp39_ = _data_->_tmp38_->message;
		_data_->_tmp40_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_REMOVE_FAILED, _ ("Can’t remove contact ‘%s’: %s"), _data_->_tmp37_, _data_->_tmp39_);
		_data_->_inner_error_ = _data_->_tmp40_;
		_g_error_free0 (_data_->e);
		goto __finally4;
	}
	__finally4:
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_store_real_prepare_data_free (gpointer _data) {
	EdsfPersonaStorePrepareData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStorePrepareData, _data_);
}


static void edsf_persona_store_real_prepare (FolksPersonaStore* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStore * self;
	EdsfPersonaStorePrepareData* _data_;
	EdsfPersonaStore* _tmp0_;
	self = (EdsfPersonaStore*) base;
	_data_ = g_slice_new0 (EdsfPersonaStorePrepareData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_store_real_prepare);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_store_real_prepare_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	edsf_persona_store_real_prepare_co (_data_);
}


static void edsf_persona_store_real_prepare_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStorePrepareData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


/**
   * Prepare the PersonaStore for use.
   *
   * See {@link Folks.PersonaStore.prepare}.
   *
   * @throws Folks.PersonaStoreError.STORE_OFFLINE if the EDS store is offline
   * @throws Folks.PersonaStoreError.PERMISSION_DENIED if permission was denied
   * to open the EDS store
   * @throws Folks.PersonaStoreError.INVALID_ARGUMENT if any other error
   * occurred in the EDS store
   *
   * @since 0.6.0
   */
static void edsf_persona_store_prepare_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStorePrepareData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_store_real_prepare_co (_data_);
}


static gboolean _vala_string_array_contains (gchar* * stack, int stack_length, gchar* needle) {
	int i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}


static gboolean edsf_persona_store_real_prepare_co (EdsfPersonaStorePrepareData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	folks_internal_profiling_start ("preparing Edsf.PersonaStore (ID: %s)", _data_->_tmp1_, NULL);
	_data_->_tmp3_ = _data_->self->priv->_is_prepared;
	if (_data_->_tmp3_ == TRUE) {
		_data_->_tmp2_ = TRUE;
	} else {
		_data_->_tmp4_ = _data_->self->priv->_prepare_pending;
		_data_->_tmp2_ = _data_->_tmp4_ == TRUE;
	}
	if (_data_->_tmp2_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->self->priv->_prepare_pending = TRUE;
		{
			_data_->_tmp5_ = _data_->self->priv->_source_registry;
			if (_data_->_tmp5_ == NULL) {
				_data_->_state_ = 1;
				e_source_registry_new (NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_1:
				_data_->_tmp7_ = e_source_registry_new_finish (_data_->_res_, &_data_->_inner_error_);
				_data_->_tmp6_ = _data_->_tmp7_;
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					goto __catch6_g_error;
				}
				_data_->_tmp8_ = _data_->_tmp6_;
				_data_->_tmp6_ = NULL;
				_g_object_unref0 (_data_->self->priv->_source_registry);
				_data_->self->priv->_source_registry = _data_->_tmp8_;
				_g_object_unref0 (_data_->_tmp6_);
			}
			_data_->_tmp9_ = _data_->self->priv->_source_registry;
			g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp9_, e_source_registry_get_type (), ESourceRegistry), "source-removed", (GCallback) __edsf_persona_store_source_registry_changed_cb_e_source_registry_source_removed, _data_->self, 0);
			_data_->_tmp10_ = _data_->self->priv->_source_registry;
			g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, e_source_registry_get_type (), ESourceRegistry), "source-disabled", (GCallback) __edsf_persona_store_source_registry_changed_cb_e_source_registry_source_disabled, _data_->self, 0);
			_data_->_tmp12_ = _data_->self->priv->_source;
			_data_->_state_ = 2;
			e_book_client_connect (_data_->_tmp12_, (guint32) 1, NULL, edsf_persona_store_prepare_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp13_ = e_book_client_connect_finish (_data_->_res_, &_data_->_inner_error_);
			_data_->_tmp11_ = _data_->_tmp13_;
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				goto __catch6_g_error;
			}
			_data_->_tmp14_ = _data_->_tmp11_;
			_data_->_tmp11_ = NULL;
			_g_object_unref0 (_data_->self->priv->_addressbook);
			_data_->self->priv->_addressbook = _data_->_tmp14_;
			_data_->_tmp15_ = _data_->self->priv->_addressbook;
			g_signal_connect_object ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp15_, e_book_client_get_type (), EBookClient), "notify::readonly", (GCallback) __edsf_persona_store_address_book_notify_read_only_cb_g_object_notify, _data_->self, 0);
			_data_->_tmp16_ = _data_->self->priv->_addressbook;
			_data_->_tmp17_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp18_ = _data_->_tmp17_;
			g_debug ("Successfully finished opening address book %p for " "persona store ‘%s’ (%p).", _data_->_tmp16_, _data_->_tmp18_, _data_->self);
			_data_->_tmp19_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp20_ = _data_->_tmp19_;
			folks_internal_profiling_point ("opened address book in " "Edsf.PersonaStore (ID: %s)", _data_->_tmp20_);
			_edsf_persona_store_notify_if_default (_data_->self);
			_edsf_persona_store_update_trust_level (_data_->self);
			_g_object_unref0 (_data_->_tmp11_);
		}
		goto __finally6;
		__catch6_g_error:
		{
			_data_->e1 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
			_data_->_tmp21_ = _data_->e1;
			if (_data_->_tmp21_->domain == E_BOOK_CLIENT_ERROR) {
				_data_->_tmp26_ = _data_->e1;
				if (g_error_matches (_data_->_tmp26_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK)) {
					_data_->_tmp25_ = TRUE;
				} else {
					_data_->_tmp27_ = _data_->e1;
					_data_->_tmp25_ = g_error_matches (_data_->_tmp27_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE);
				}
				if (_data_->_tmp25_) {
					_data_->_tmp24_ = TRUE;
				} else {
					_data_->_tmp28_ = _data_->e1;
					_data_->_tmp24_ = g_error_matches (_data_->_tmp28_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_NOT_FOUND);
				}
				if (_data_->_tmp24_) {
					_data_->_tmp23_ = TRUE;
				} else {
					_data_->_tmp29_ = _data_->e1;
					_data_->_tmp23_ = g_error_matches (_data_->_tmp29_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS);
				}
				if (_data_->_tmp23_) {
					_data_->_tmp22_ = TRUE;
				} else {
					_data_->_tmp30_ = _data_->e1;
					_data_->_tmp22_ = g_error_matches (_data_->_tmp30_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SPACE);
				}
				if (_data_->_tmp22_) {
				}
			} else {
				_data_->_tmp31_ = _data_->e1;
				_data_->_tmp32_ = _data_->_tmp31_->domain;
				_data_->_tmp33_ = e_client_error_quark ();
				if (_data_->_tmp32_ == _data_->_tmp33_) {
					_data_->_tmp34_ = _data_->e1;
					_data_->_tmp35_ = _data_->_tmp34_->code;
					switch ((EClientError) _data_->_tmp35_) {
						case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
						{
							_data_->_tmp36_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
							_data_->_tmp37_ = _data_->_tmp36_;
							_data_->_tmp38_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _ ("Address book ‘%s’ is offline."), _data_->_tmp37_);
							_data_->_inner_error_ = _data_->_tmp38_;
							_g_error_free0 (_data_->e1);
							goto __finally6;
						}
						case E_CLIENT_ERROR_PERMISSION_DENIED:
						{
							_data_->_tmp39_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
							_data_->_tmp40_ = _data_->_tmp39_;
							_data_->_tmp41_ = _data_->e1;
							_data_->_tmp42_ = _data_->_tmp41_->message;
							_data_->_tmp43_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _ ("Permission denied to open address book ‘%s’: %s"), _data_->_tmp40_, _data_->_tmp42_);
							_data_->_inner_error_ = _data_->_tmp43_;
							_g_error_free0 (_data_->e1);
							goto __finally6;
						}
						default:
						case E_CLIENT_ERROR_AUTHENTICATION_REQUIRED:
						case E_CLIENT_ERROR_NOT_SUPPORTED:
						case E_CLIENT_ERROR_INVALID_ARG:
						case E_CLIENT_ERROR_BUSY:
						case E_CLIENT_ERROR_DBUS_ERROR:
						case E_CLIENT_ERROR_OTHER_ERROR:
						case E_CLIENT_ERROR_COULD_NOT_CANCEL:
						case E_CLIENT_ERROR_AUTHENTICATION_FAILED:
						case E_CLIENT_ERROR_TLS_NOT_AVAILABLE:
						case E_CLIENT_ERROR_OFFLINE_UNAVAILABLE:
						case E_CLIENT_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD:
						case E_CLIENT_ERROR_SEARCH_SIZE_LIMIT_EXCEEDED:
						case E_CLIENT_ERROR_SEARCH_TIME_LIMIT_EXCEEDED:
						case E_CLIENT_ERROR_INVALID_QUERY:
						case E_CLIENT_ERROR_QUERY_REFUSED:
						{
							break;
						}
					}
				}
			}
			_data_->_tmp44_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp45_ = _data_->_tmp44_;
			_data_->_tmp46_ = _data_->e1;
			_data_->_tmp47_ = _data_->_tmp46_->message;
			_data_->_tmp48_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _ ("Couldn’t open address book ‘%s’: %s"), _data_->_tmp45_, _data_->_tmp47_);
			_data_->_inner_error_ = _data_->_tmp48_;
			_g_error_free0 (_data_->e1);
			goto __finally6;
		}
		__finally6:
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			goto __finally5;
		}
		{
			_data_->supported_fields = NULL;
			_data_->_tmp49_ = _data_->self->priv->_addressbook;
			_data_->_tmp50_ = NULL;
			_data_->_state_ = 3;
			e_client_get_backend_property ((EClient*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp49_, e_book_client_get_type (), EBookClient), "supported-fields", NULL, edsf_persona_store_prepare_ready, _data_);
			return FALSE;
			_state_3:
			e_client_get_backend_property_finish ((EClient*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp49_, e_book_client_get_type (), EBookClient), _data_->_res_, &_data_->_tmp50_, &_data_->_inner_error_);
			_g_free0 (_data_->supported_fields);
			_data_->supported_fields = _data_->_tmp50_;
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				_g_free0 (_data_->supported_fields);
				goto __catch7_g_error;
			}
			_data_->_tmp51_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp52_ = _data_->_tmp51_;
			folks_internal_profiling_point ("got supported fields in " "Edsf.PersonaStore (ID: %s)", _data_->_tmp52_);
			_data_->_tmp53_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
			_data_->prop_set = _data_->_tmp53_;
			_data_->_tmp54_ = _data_->supported_fields;
			if (_data_->_tmp54_ != NULL) {
				_data_->_tmp55_ = _data_->supported_fields;
				_data_->_tmp57_ = _data_->_tmp56_ = g_strsplit ((const gchar*) _data_->_tmp55_, ",", 0);
				_data_->fields = _data_->_tmp57_;
				_data_->fields_length1 = _vala_array_length (_data_->_tmp56_);
				_data_->_fields_size_ = _data_->fields_length1;
				_data_->_tmp58_ = _data_->prop_set;
				_data_->_tmp59_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_LOCAL_IDS);
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp58_, (const gchar*) _data_->_tmp59_);
				_data_->_tmp60_ = _data_->prop_set;
				_data_->_tmp61_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_WEB_SERVICE_ADDRESSES);
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp60_, (const gchar*) _data_->_tmp61_);
				_data_->_tmp62_ = _data_->prop_set;
				_data_->_tmp63_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_GENDER);
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp62_, (const gchar*) _data_->_tmp63_);
				_data_->_tmp64_ = _data_->prop_set;
				_data_->_tmp65_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IS_FAVOURITE);
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp64_, (const gchar*) _data_->_tmp65_);
				_data_->_tmp66_ = _data_->prop_set;
				_data_->_tmp67_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_ANTI_LINKS);
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp66_, (const gchar*) _data_->_tmp67_);
				_data_->_tmp68_ = _data_->prop_set;
				_data_->_tmp69_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_EXTENDED_INFO);
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp68_, (const gchar*) _data_->_tmp69_);
				_data_->_tmp70_ = _data_->fields;
				_data_->_tmp70__length1 = _data_->fields_length1;
				{
					_data_->field_collection_length1 = 0;
					_data_->_field_collection_size_ = 0;
					_data_->field_collection = _data_->_tmp70_;
					_data_->field_collection_length1 = _data_->_tmp70__length1;
					for (_data_->field_it = 0; _data_->field_it < _data_->_tmp70__length1; _data_->field_it = _data_->field_it + 1) {
						_data_->field = _data_->field_collection[_data_->field_it];
						{
							_data_->_tmp71_ = _data_->field;
							_data_->_tmp72_ = _edsf_persona_store_eds_field_name_to_folks_persona_detail (_data_->self, _data_->_tmp71_);
							_data_->_tmp73_ = folks_persona_store_detail_key (_data_->_tmp72_);
							_data_->_tmp74_ = g_strdup (_data_->_tmp73_);
							_data_->prop = _data_->_tmp74_;
							_data_->_tmp75_ = _data_->prop;
							if (_data_->_tmp75_ != NULL) {
								_data_->_tmp76_ = _data_->prop_set;
								_data_->_tmp77_ = _data_->prop;
								_data_->prop = NULL;
								_data_->_tmp78_ = (gchar*) _data_->_tmp77_;
								gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp76_, _data_->_tmp78_);
								_g_free0 (_data_->_tmp78_);
							}
							_g_free0 (_data_->prop);
						}
					}
				}
				_data_->fields = (_vala_array_free (_data_->fields, _data_->fields_length1, (GDestroyNotify) g_free), NULL);
			}
			_data_->_tmp79_ = _data_->prop_set;
			_data_->_tmp80_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp79_);
			_data_->_tmp81_ = _data_->_tmp80_;
			_data_->_tmp82_ = g_new0 (gchar*, _data_->_tmp81_ + 1);
			_data_->self->priv->_always_writeable_properties = (_vala_array_free (_data_->self->priv->_always_writeable_properties, _data_->self->priv->_always_writeable_properties_length1, (GDestroyNotify) g_free), NULL);
			_data_->self->priv->_always_writeable_properties = _data_->_tmp82_;
			_data_->self->priv->_always_writeable_properties_length1 = _data_->_tmp81_;
			_data_->self->priv->__always_writeable_properties_size_ = _data_->self->priv->_always_writeable_properties_length1;
			_data_->i = (guint) 0;
			{
				_data_->_tmp83_ = _data_->prop_set;
				_data_->_tmp84_ = _g_object_ref0 (_data_->_tmp83_);
				_data_->_final_prop_list = _data_->_tmp84_;
				_data_->_tmp85_ = _data_->_final_prop_list;
				_data_->_tmp86_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp85_);
				_data_->_tmp87_ = _data_->_tmp86_;
				_data_->_final_prop_size = _data_->_tmp87_;
				_data_->_final_prop_index = -1;
				while (TRUE) {
					_data_->_tmp88_ = _data_->_final_prop_index;
					_data_->_final_prop_index = _data_->_tmp88_ + 1;
					_data_->_tmp89_ = _data_->_final_prop_index;
					_data_->_tmp90_ = _data_->_final_prop_size;
					if (!(_data_->_tmp89_ < _data_->_tmp90_)) {
						break;
					}
					_data_->_tmp91_ = _data_->_final_prop_list;
					_data_->_tmp92_ = _data_->_final_prop_index;
					_data_->_tmp93_ = folks_small_set_get (_data_->_tmp91_, _data_->_tmp92_);
					_data_->_tmp94_ = g_strdup ((const gchar*) _data_->_tmp93_);
					_data_->final_prop = _data_->_tmp94_;
					_data_->_tmp95_ = _data_->self->priv->_always_writeable_properties;
					_data_->_tmp95__length1 = _data_->self->priv->_always_writeable_properties_length1;
					_data_->_tmp96_ = _data_->i;
					_data_->i = _data_->_tmp96_ + 1;
					_data_->_tmp97_ = _data_->final_prop;
					_data_->_tmp98_ = g_strdup (_data_->_tmp97_);
					_g_free0 (_data_->_tmp95_[_data_->_tmp96_]);
					_data_->_tmp95_[_data_->_tmp96_] = _data_->_tmp98_;
					_data_->_tmp99_ = _data_->_tmp95_[_data_->_tmp96_];
					_g_free0 (_data_->final_prop);
				}
				_g_object_unref0 (_data_->_final_prop_list);
			}
			_g_object_unref0 (_data_->prop_set);
			_g_free0 (_data_->supported_fields);
		}
		goto __finally7;
		__catch7_g_error:
		{
			_data_->e2 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
			_data_->_tmp100_ = _data_->e2;
			_data_->_tmp101_ = _data_->_tmp100_->message;
			_data_->_tmp102_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _ ("Couldn’t get address book capabilities: %s"), _data_->_tmp101_);
			_data_->_inner_error_ = _data_->_tmp102_;
			_g_error_free0 (_data_->e2);
			goto __finally7;
		}
		__finally7:
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			goto __finally5;
		}
		_data_->do_initial_query = FALSE;
		{
			_data_->capabilities = NULL;
			_data_->_tmp103_ = _data_->self->priv->_addressbook;
			_data_->_tmp104_ = NULL;
			_data_->_state_ = 4;
			e_client_get_backend_property ((EClient*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp103_, e_book_client_get_type (), EBookClient), "capabilities", NULL, edsf_persona_store_prepare_ready, _data_);
			return FALSE;
			_state_4:
			e_client_get_backend_property_finish ((EClient*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp103_, e_book_client_get_type (), EBookClient), _data_->_res_, &_data_->_tmp104_, &_data_->_inner_error_);
			_g_free0 (_data_->capabilities);
			_data_->capabilities = _data_->_tmp104_;
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				_g_free0 (_data_->capabilities);
				goto __catch8_g_error;
			}
			_data_->_tmp105_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp106_ = _data_->_tmp105_;
			folks_internal_profiling_point ("got capabilities in " "Edsf.PersonaStore (ID: %s)", _data_->_tmp106_);
			_data_->_tmp107_ = _data_->capabilities;
			if (_data_->_tmp107_ != NULL) {
				_data_->_tmp108_ = _data_->capabilities;
				_data_->_tmp110_ = _data_->_tmp109_ = g_strsplit ((const gchar*) _data_->_tmp108_, ",", 0);
				_data_->caps = _data_->_tmp110_;
				_data_->caps_length1 = _vala_array_length (_data_->_tmp109_);
				_data_->_caps_size_ = _data_->caps_length1;
				_data_->_tmp111_ = _data_->caps;
				_data_->_tmp111__length1 = _data_->caps_length1;
				_data_->do_initial_query = _vala_string_array_contains (_data_->_tmp111_, _data_->_tmp111__length1, "do-initial-query");
				_data_->caps = (_vala_array_free (_data_->caps, _data_->caps_length1, (GDestroyNotify) g_free), NULL);
			}
			_g_free0 (_data_->capabilities);
		}
		goto __finally8;
		__catch8_g_error:
		{
			_data_->e4 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
			_data_->_tmp112_ = _data_->e4;
			_data_->_tmp113_ = _data_->_tmp112_->message;
			_data_->_tmp114_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _ ("Couldn’t get address book capabilities: %s"), _data_->_tmp113_);
			_data_->_inner_error_ = _data_->_tmp114_;
			_g_error_free0 (_data_->e4);
			goto __finally8;
		}
		__finally8:
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			goto __finally5;
		}
		_data_->got_view = FALSE;
		{
			_data_->_tmp116_ = _data_->self->priv->_addressbook;
			_data_->_tmp117_ = _data_->self->priv->_query_str;
			_data_->_tmp118_ = NULL;
			_data_->_state_ = 5;
			e_book_client_get_view (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp116_, e_book_client_get_type (), EBookClient), _data_->_tmp117_, NULL, edsf_persona_store_prepare_ready, _data_);
			return FALSE;
			_state_5:
			_data_->_tmp119_ = e_book_client_get_view_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp116_, e_book_client_get_type (), EBookClient), _data_->_res_, &_data_->_tmp118_, &_data_->_inner_error_);
			_g_object_unref0 (_data_->self->priv->_ebookview);
			_data_->self->priv->_ebookview = _data_->_tmp118_;
			_data_->_tmp115_ = _data_->_tmp119_;
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				goto __catch9_g_error;
			}
			_data_->got_view = _data_->_tmp115_;
			_data_->_tmp120_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp121_ = _data_->_tmp120_;
			folks_internal_profiling_point ("opened book view in " "Edsf.PersonaStore (ID: %s)", _data_->_tmp121_);
			_data_->_tmp122_ = _data_->got_view;
			if (_data_->_tmp122_ == FALSE) {
				_data_->_tmp123_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
				_data_->_tmp124_ = _data_->_tmp123_;
				_data_->_tmp125_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _ ("Couldn’t get view for address book ‘%s’."), _data_->_tmp124_);
				_data_->_inner_error_ = _data_->_tmp125_;
				goto __catch9_g_error;
			}
			_data_->_tmp126_ = _data_->self->priv->_ebookview;
			g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp126_, e_book_client_view_get_type (), EBookClientView), "objects-added", (GCallback) __edsf_persona_store_contacts_added_cb_e_book_client_view_objects_added, _data_->self, 0);
			_data_->_tmp127_ = _data_->self->priv->_ebookview;
			g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp127_, e_book_client_view_get_type (), EBookClientView), "objects-removed", (GCallback) __edsf_persona_store_contacts_removed_cb_e_book_client_view_objects_removed, _data_->self, 0);
			_data_->_tmp128_ = _data_->self->priv->_ebookview;
			g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp128_, e_book_client_view_get_type (), EBookClientView), "objects-modified", (GCallback) __edsf_persona_store_contacts_changed_cb_e_book_client_view_objects_modified, _data_->self, 0);
			_data_->_tmp129_ = _data_->self->priv->_ebookview;
			g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp129_, e_book_client_view_get_type (), EBookClientView), "complete", (GCallback) __edsf_persona_store_contacts_complete_cb_e_book_client_view_complete, _data_->self, 0);
			_data_->_tmp130_ = _data_->self->priv->_ebookview;
			e_book_client_view_start (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp130_, e_book_client_view_get_type (), EBookClientView), &_data_->_inner_error_);
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				goto __catch9_g_error;
			}
		}
		goto __finally9;
		__catch9_g_error:
		{
			_data_->e3 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
			_data_->_tmp131_ = _data_->e3;
			if (_data_->_tmp131_->domain == E_BOOK_CLIENT_ERROR) {
				_data_->_tmp136_ = _data_->e3;
				if (g_error_matches (_data_->_tmp136_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK)) {
					_data_->_tmp135_ = TRUE;
				} else {
					_data_->_tmp137_ = _data_->e3;
					_data_->_tmp135_ = g_error_matches (_data_->_tmp137_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE);
				}
				if (_data_->_tmp135_) {
					_data_->_tmp134_ = TRUE;
				} else {
					_data_->_tmp138_ = _data_->e3;
					_data_->_tmp134_ = g_error_matches (_data_->_tmp138_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_NOT_FOUND);
				}
				if (_data_->_tmp134_) {
					_data_->_tmp133_ = TRUE;
				} else {
					_data_->_tmp139_ = _data_->e3;
					_data_->_tmp133_ = g_error_matches (_data_->_tmp139_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS);
				}
				if (_data_->_tmp133_) {
					_data_->_tmp132_ = TRUE;
				} else {
					_data_->_tmp140_ = _data_->e3;
					_data_->_tmp132_ = g_error_matches (_data_->_tmp140_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SPACE);
				}
				if (_data_->_tmp132_) {
				}
			} else {
				_data_->_tmp141_ = _data_->e3;
				_data_->_tmp142_ = _data_->_tmp141_->domain;
				_data_->_tmp143_ = e_client_error_quark ();
				if (_data_->_tmp142_ == _data_->_tmp143_) {
					_data_->_tmp144_ = _data_->e3;
					_data_->_tmp145_ = _data_->_tmp144_->code;
					switch ((EClientError) _data_->_tmp145_) {
						case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
						{
							_data_->_tmp146_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
							_data_->_tmp147_ = _data_->_tmp146_;
							_data_->_tmp148_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _ ("Address book ‘%s’ is offline."), _data_->_tmp147_);
							_data_->_inner_error_ = _data_->_tmp148_;
							_g_error_free0 (_data_->e3);
							goto __finally9;
						}
						case E_CLIENT_ERROR_PERMISSION_DENIED:
						{
							_data_->_tmp149_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
							_data_->_tmp150_ = _data_->_tmp149_;
							_data_->_tmp151_ = _data_->e3;
							_data_->_tmp152_ = _data_->_tmp151_->message;
							_data_->_tmp153_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _ ("Permission denied to open address book ‘%s’: %s"), _data_->_tmp150_, _data_->_tmp152_);
							_data_->_inner_error_ = _data_->_tmp153_;
							_g_error_free0 (_data_->e3);
							goto __finally9;
						}
						default:
						case E_CLIENT_ERROR_AUTHENTICATION_REQUIRED:
						case E_CLIENT_ERROR_NOT_SUPPORTED:
						case E_CLIENT_ERROR_INVALID_ARG:
						case E_CLIENT_ERROR_BUSY:
						case E_CLIENT_ERROR_DBUS_ERROR:
						case E_CLIENT_ERROR_OTHER_ERROR:
						case E_CLIENT_ERROR_SEARCH_SIZE_LIMIT_EXCEEDED:
						case E_CLIENT_ERROR_SEARCH_TIME_LIMIT_EXCEEDED:
						case E_CLIENT_ERROR_QUERY_REFUSED:
						case E_CLIENT_ERROR_COULD_NOT_CANCEL:
						case E_CLIENT_ERROR_AUTHENTICATION_FAILED:
						case E_CLIENT_ERROR_TLS_NOT_AVAILABLE:
						case E_CLIENT_ERROR_OFFLINE_UNAVAILABLE:
						case E_CLIENT_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD:
						case E_CLIENT_ERROR_INVALID_QUERY:
						{
							break;
						}
					}
				}
			}
			_data_->_tmp154_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp155_ = _data_->_tmp154_;
			_data_->_tmp156_ = _data_->e3;
			_data_->_tmp157_ = _data_->_tmp156_->message;
			_data_->_tmp158_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _ ("Couldn’t get view for address book ‘%s’: %s"), _data_->_tmp155_, _data_->_tmp157_);
			_data_->_inner_error_ = _data_->_tmp158_;
			_g_error_free0 (_data_->e3);
			goto __finally9;
		}
		__finally9:
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			goto __finally5;
		}
		_data_->self->priv->_is_prepared = TRUE;
		g_object_notify ((GObject*) _data_->self, "is-prepared");
		_data_->_tmp160_ = _data_->do_initial_query;
		if (_data_->_tmp160_ == FALSE) {
			_data_->_tmp161_ = _data_->self->priv->_is_quiescent;
			_data_->_tmp159_ = _data_->_tmp161_ == FALSE;
		} else {
			_data_->_tmp159_ = FALSE;
		}
		if (_data_->_tmp159_) {
			_data_->_tmp162_ = _data_->self->priv->_pending_personas;
			_vala_assert (_data_->_tmp162_ == NULL, "this._pending_personas == null");
			_data_->self->priv->_is_quiescent = TRUE;
			g_object_notify ((GObject*) _data_->self, "is-quiescent");
		}
	}
	__finally5:
	{
		_data_->self->priv->_prepare_pending = FALSE;
	}
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	folks_internal_profiling_end ("preparing Edsf.PersonaStore", NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static FolksPersonaDetail _edsf_persona_store_eds_field_name_to_folks_persona_detail (EdsfPersonaStore* self, const gchar* eds_field_name) {
	FolksPersonaDetail result = 0;
	EContactField eds_field_id;
	const gchar* _tmp0_;
	EContactField _tmp1_;
	EContactField _tmp2_;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (eds_field_name != NULL, 0);
	_tmp0_ = eds_field_name;
	_tmp1_ = e_contact_field_id (_tmp0_);
	eds_field_id = _tmp1_;
	_tmp2_ = eds_field_id;
	switch (_tmp2_) {
		case E_CONTACT_FULL_NAME:
		{
			result = FOLKS_PERSONA_DETAIL_FULL_NAME;
			return result;
		}
		case E_CONTACT_GIVEN_NAME:
		case E_CONTACT_FAMILY_NAME:
		case E_CONTACT_NAME:
		{
			result = FOLKS_PERSONA_DETAIL_STRUCTURED_NAME;
			return result;
		}
		case E_CONTACT_GEO:
		{
			result = FOLKS_PERSONA_DETAIL_LOCATION;
			return result;
		}
		case E_CONTACT_NICKNAME:
		{
			result = FOLKS_PERSONA_DETAIL_NICKNAME;
			return result;
		}
		case E_CONTACT_EMAIL_1:
		case E_CONTACT_EMAIL_2:
		case E_CONTACT_EMAIL_3:
		case E_CONTACT_EMAIL_4:
		case E_CONTACT_EMAIL:
		{
			result = FOLKS_PERSONA_DETAIL_EMAIL_ADDRESSES;
			return result;
		}
		case E_CONTACT_ADDRESS_LABEL_HOME:
		case E_CONTACT_ADDRESS_LABEL_WORK:
		case E_CONTACT_ADDRESS_LABEL_OTHER:
		case E_CONTACT_ADDRESS:
		case E_CONTACT_ADDRESS_HOME:
		case E_CONTACT_ADDRESS_WORK:
		case E_CONTACT_ADDRESS_OTHER:
		{
			result = FOLKS_PERSONA_DETAIL_POSTAL_ADDRESSES;
			return result;
		}
		case E_CONTACT_PHONE_ASSISTANT:
		case E_CONTACT_PHONE_BUSINESS:
		case E_CONTACT_PHONE_BUSINESS_2:
		case E_CONTACT_PHONE_BUSINESS_FAX:
		case E_CONTACT_PHONE_CALLBACK:
		case E_CONTACT_PHONE_CAR:
		case E_CONTACT_PHONE_COMPANY:
		case E_CONTACT_PHONE_HOME:
		case E_CONTACT_PHONE_HOME_2:
		case E_CONTACT_PHONE_HOME_FAX:
		case E_CONTACT_PHONE_ISDN:
		case E_CONTACT_PHONE_MOBILE:
		case E_CONTACT_PHONE_OTHER:
		case E_CONTACT_PHONE_OTHER_FAX:
		case E_CONTACT_PHONE_PAGER:
		case E_CONTACT_PHONE_PRIMARY:
		case E_CONTACT_PHONE_RADIO:
		case E_CONTACT_PHONE_TELEX:
		case E_CONTACT_PHONE_TTYTDD:
		case E_CONTACT_TEL:
		case E_CONTACT_SIP:
		{
			result = FOLKS_PERSONA_DETAIL_PHONE_NUMBERS;
			return result;
		}
		case E_CONTACT_ORG:
		case E_CONTACT_ORG_UNIT:
		case E_CONTACT_OFFICE:
		case E_CONTACT_TITLE:
		case E_CONTACT_ROLE:
		case E_CONTACT_MANAGER:
		case E_CONTACT_ASSISTANT:
		{
			result = FOLKS_PERSONA_DETAIL_ROLES;
			return result;
		}
		case E_CONTACT_HOMEPAGE_URL:
		case E_CONTACT_BLOG_URL:
		case E_CONTACT_FREEBUSY_URL:
		case E_CONTACT_VIDEO_URL:
		{
			result = FOLKS_PERSONA_DETAIL_URLS;
			return result;
		}
		case E_CONTACT_CATEGORIES:
		case E_CONTACT_CATEGORY_LIST:
		{
			result = FOLKS_PERSONA_DETAIL_GROUPS;
			return result;
		}
		case E_CONTACT_NOTE:
		{
			result = FOLKS_PERSONA_DETAIL_NOTES;
			return result;
		}
		case E_CONTACT_IM_AIM_HOME_1:
		case E_CONTACT_IM_AIM_HOME_2:
		case E_CONTACT_IM_AIM_HOME_3:
		case E_CONTACT_IM_AIM_WORK_1:
		case E_CONTACT_IM_AIM_WORK_2:
		case E_CONTACT_IM_AIM_WORK_3:
		case E_CONTACT_IM_GROUPWISE_HOME_1:
		case E_CONTACT_IM_GROUPWISE_HOME_2:
		case E_CONTACT_IM_GROUPWISE_HOME_3:
		case E_CONTACT_IM_GROUPWISE_WORK_1:
		case E_CONTACT_IM_GROUPWISE_WORK_2:
		case E_CONTACT_IM_GROUPWISE_WORK_3:
		case E_CONTACT_IM_JABBER_HOME_1:
		case E_CONTACT_IM_JABBER_HOME_2:
		case E_CONTACT_IM_JABBER_HOME_3:
		case E_CONTACT_IM_JABBER_WORK_1:
		case E_CONTACT_IM_JABBER_WORK_2:
		case E_CONTACT_IM_JABBER_WORK_3:
		case E_CONTACT_IM_YAHOO_HOME_1:
		case E_CONTACT_IM_YAHOO_HOME_2:
		case E_CONTACT_IM_YAHOO_HOME_3:
		case E_CONTACT_IM_YAHOO_WORK_1:
		case E_CONTACT_IM_YAHOO_WORK_2:
		case E_CONTACT_IM_YAHOO_WORK_3:
		case E_CONTACT_IM_MSN_HOME_1:
		case E_CONTACT_IM_MSN_HOME_2:
		case E_CONTACT_IM_MSN_HOME_3:
		case E_CONTACT_IM_MSN_WORK_1:
		case E_CONTACT_IM_MSN_WORK_2:
		case E_CONTACT_IM_MSN_WORK_3:
		case E_CONTACT_IM_ICQ_HOME_1:
		case E_CONTACT_IM_ICQ_HOME_2:
		case E_CONTACT_IM_ICQ_HOME_3:
		case E_CONTACT_IM_ICQ_WORK_1:
		case E_CONTACT_IM_ICQ_WORK_2:
		case E_CONTACT_IM_ICQ_WORK_3:
		case E_CONTACT_IM_AIM:
		case E_CONTACT_IM_GROUPWISE:
		case E_CONTACT_IM_JABBER:
		case E_CONTACT_IM_YAHOO:
		case E_CONTACT_IM_MSN:
		case E_CONTACT_IM_ICQ:
		case E_CONTACT_IM_GADUGADU_HOME_1:
		case E_CONTACT_IM_GADUGADU_HOME_2:
		case E_CONTACT_IM_GADUGADU_HOME_3:
		case E_CONTACT_IM_GADUGADU_WORK_1:
		case E_CONTACT_IM_GADUGADU_WORK_2:
		case E_CONTACT_IM_GADUGADU_WORK_3:
		case E_CONTACT_IM_GADUGADU:
		case E_CONTACT_IM_SKYPE_HOME_1:
		case E_CONTACT_IM_SKYPE_HOME_2:
		case E_CONTACT_IM_SKYPE_HOME_3:
		case E_CONTACT_IM_SKYPE_WORK_1:
		case E_CONTACT_IM_SKYPE_WORK_2:
		case E_CONTACT_IM_SKYPE_WORK_3:
		case E_CONTACT_IM_SKYPE:
		case E_CONTACT_IM_GOOGLE_TALK_HOME_1:
		case E_CONTACT_IM_GOOGLE_TALK_HOME_2:
		case E_CONTACT_IM_GOOGLE_TALK_HOME_3:
		case E_CONTACT_IM_GOOGLE_TALK_WORK_1:
		case E_CONTACT_IM_GOOGLE_TALK_WORK_2:
		case E_CONTACT_IM_GOOGLE_TALK_WORK_3:
		case E_CONTACT_IM_GOOGLE_TALK:
		{
			result = FOLKS_PERSONA_DETAIL_IM_ADDRESSES;
			return result;
		}
		case E_CONTACT_PHOTO:
		{
			result = FOLKS_PERSONA_DETAIL_AVATAR;
			return result;
		}
		case E_CONTACT_BIRTH_DATE:
		{
			result = FOLKS_PERSONA_DETAIL_BIRTHDAY;
			return result;
		}
		case E_CONTACT_UID:
		case E_CONTACT_REV:
		case E_CONTACT_BOOK_UID:
		case E_CONTACT_NAME_OR_ORG:
		{
			result = FOLKS_PERSONA_DETAIL_INVALID;
			return result;
		}
		default:
		case E_CONTACT_FILE_AS:
		case E_CONTACT_MAILER:
		case E_CONTACT_CALENDAR_URI:
		case E_CONTACT_ICS_CALENDAR:
		case E_CONTACT_SPOUSE:
		case E_CONTACT_LOGO:
		case E_CONTACT_WANTS_HTML:
		case E_CONTACT_IS_LIST:
		case E_CONTACT_LIST_SHOW_ADDRESSES:
		case E_CONTACT_ANNIVERSARY:
		case E_CONTACT_X509_CERT:
		{
			const gchar* _tmp3_;
			_tmp3_ = eds_field_name;
			g_debug ("edsf-persona-store.vala:1185: Unsupported/Unknown EDS field name '%s'.", _tmp3_);
			result = FOLKS_PERSONA_DETAIL_INVALID;
			return result;
		}
	}
}


static void _edsf_persona_store_add_contact_data_free (gpointer _data) {
	EdsfPersonaStoreAddContactData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreAddContactData, _data_);
}


static void _edsf_persona_store_add_contact (EdsfPersonaStore* self, EContact* contact, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreAddContactData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	_data_ = g_slice_new0 (EdsfPersonaStoreAddContactData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_add_contact);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_add_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->contact);
	_data_->contact = _tmp2_;
	_edsf_persona_store_add_contact_co (_data_);
}


static gchar* _edsf_persona_store_add_contact_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	gchar* result;
	EdsfPersonaStoreAddContactData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->added_uids);
		_g_free0 (_data1_->added_uid);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data2_->_data1_->self;
		block1_data_unref (_data2_->_data1_);
		_data2_->_data1_ = NULL;
		g_slice_free (Block2Data, _data2_);
	}
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (void * _userdata_) {
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data3_->_data2_->_data1_->self;
		_g_object_unref0 (_data3_->c);
		block2_data_unref (_data3_->_data2_);
		_data3_->_data2_ = NULL;
		g_slice_free (Block3Data, _data3_);
	}
}


static gboolean ____lambda7_ (Block3Data* _data3_) {
	Block2Data* _data2_;
	Block1Data* _data1_;
	EdsfPersonaStore* self;
	gboolean result = FALSE;
	EContact* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	FolksSmallSet* _tmp4_;
	EContact* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	FolksSmallSet* _tmp9_;
	const gchar* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	_data2_ = _data3_->_data2_;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	_tmp0_ = _data3_->c;
	g_object_get (_tmp0_, "id", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	g_debug ("edsf-persona-store.vala:1238: Received new contact %s from EDS.", _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = _data1_->added_uids;
	_tmp5_ = _data3_->c;
	g_object_get (_tmp5_, "id", &_tmp6_, NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = _data1_->added_uids;
	_tmp10_ = _data1_->added_uid;
	_tmp11_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp9_, _tmp10_);
	_data2_->received_notification = _tmp11_;
	_tmp12_ = _data2_->received_notification;
	if (_tmp12_) {
		gboolean _tmp13_;
		_tmp13_ = _data2_->has_yielded;
		if (_tmp13_ == TRUE) {
			_data2_->has_yielded = FALSE;
			_edsf_persona_store_add_contact_co (_data1_->_async_data_);
		}
	}
	result = FALSE;
	return result;
}


static gboolean _____lambda7__gsource_func (gpointer self) {
	gboolean result;
	result = ____lambda7_ (self);
	return result;
}


static void ___lambda6_ (Block2Data* _data2_, GList* _contacts) {
	Block1Data* _data1_;
	EdsfPersonaStore* self;
	GList* contacts;
	GList* _tmp0_;
	GList* _tmp1_;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	_tmp0_ = _contacts;
	contacts = (GList*) _tmp0_;
	_tmp1_ = contacts;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp1_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			EContact* _tmp2_;
			EContact* c = NULL;
			_tmp2_ = _g_object_ref0 ((EContact*) c_it->data);
			c = _tmp2_;
			{
				Block3Data* _data3_;
				_data3_ = g_slice_new0 (Block3Data);
				_data3_->_ref_count_ = 1;
				_data3_->_data2_ = block2_data_ref (_data2_);
				_data3_->c = c;
				_edsf_persona_store_idle_queue (self, _____lambda7__gsource_func, block3_data_ref (_data3_), block3_data_unref);
				block3_data_unref (_data3_);
				_data3_ = NULL;
				return;
			}
		}
	}
}


static void ____lambda6__e_book_client_view_objects_added (EBookClientView* _sender, GList* object, gpointer self) {
	___lambda6_ (self, object);
}


static void _edsf_persona_store_add_contact_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreAddContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_add_contact_co (_data_);
}


static gboolean ___lambda8_ (Block2Data* _data2_) {
	Block1Data* _data1_;
	EdsfPersonaStore* self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	_tmp0_ = _data2_->has_yielded;
	if (_tmp0_ == TRUE) {
		_data2_->has_yielded = FALSE;
		_edsf_persona_store_add_contact_co (_data1_->_async_data_);
	}
	result = FALSE;
	return result;
}


static gboolean ____lambda8__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda8_ (self);
	return result;
}


static gboolean _edsf_persona_store_add_contact_co (EdsfPersonaStoreAddContactData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->self = g_object_ref (_data_->self);
	_data_->_data1_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->_addressbook;
	_vala_assert (_data_->_tmp0_ != NULL, "this._addressbook != null");
	_data_->_tmp1_ = folks_debug_dup ();
	_data_->debug_obj = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->debug_obj;
	_data_->_tmp3_ = folks_debug_get_debug_output_enabled (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (_data_->_tmp4_ == TRUE) {
		_data_->_tmp5_ = _data_->contact;
		g_object_get (_data_->_tmp5_, "id", &_data_->_tmp6_, NULL);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->_tmp7_;
		g_debug ("edsf-persona-store.vala:1202: Adding new contact (UID: %s) to address " \
"book.", _data_->_tmp8_);
		_g_free0 (_data_->_tmp8_);
		_data_->_tmp9_ = _data_->contact;
		_data_->_tmp10_ = e_vcard_to_string ((EVCard*) _data_->_tmp9_, EVC_FORMAT_VCARD_30);
		_data_->_tmp11_ = _data_->_tmp10_;
		g_debug ("edsf-persona-store.vala:1203: New vCard: %s", _data_->_tmp11_);
		_g_free0 (_data_->_tmp11_);
	}
	_data_->signal_id = (gulong) 0;
	_data_->timeout_id = (guint) 0;
	_data_->_tmp12_ = g_strdup ("");
	_data_->_data1_->added_uid = _data_->_tmp12_;
	_data_->_tmp13_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->_data1_->added_uids = _data_->_tmp13_;
	{
		_data_->_data2_ = g_slice_new0 (Block2Data);
		_data_->_data2_->_ref_count_ = 1;
		_data_->_data2_->_data1_ = block1_data_ref (_data_->_data1_);
		_data_->_data2_->received_notification = FALSE;
		_data_->_data2_->has_yielded = FALSE;
		_data_->_tmp14_ = _data_->self->priv->_ebookview;
		_data_->_tmp15_ = g_signal_connect_data (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp14_, e_book_client_view_get_type (), EBookClientView), "objects-added", (GCallback) ____lambda6__e_book_client_view_objects_added, block2_data_ref (_data_->_data2_), (GClosureNotify) block2_data_unref, 0);
		_data_->signal_id = _data_->_tmp15_;
		_data_->_tmp16_ = _data_->self->priv->_addressbook;
		_data_->_tmp17_ = _data_->contact;
		_data_->_tmp18_ = NULL;
		_data_->_state_ = 1;
		e_book_client_add_contact (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, e_book_client_get_type (), EBookClient), _data_->_tmp17_, NULL, _edsf_persona_store_add_contact_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_add_contact_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, e_book_client_get_type (), EBookClient), _data_->_res_, &_data_->_tmp18_, &_data_->_inner_error_);
		_g_free0 (_data_->_data1_->added_uid);
		_data_->_data1_->added_uid = _data_->_tmp18_;
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			goto __catch10_g_error;
		}
		_data_->_tmp19_ = _data_->_data1_->added_uid;
		g_debug ("edsf-persona-store.vala:1264: Finished sending new contact to EDS; rec" \
"eived UID %s.", _data_->_tmp19_);
		_data_->_tmp20_ = g_timeout_add_seconds_full (G_PRIORITY_LOW, EDSF_PERSONA_STORE__new_contact_timeout, ____lambda8__gsource_func, block2_data_ref (_data_->_data2_), block2_data_unref);
		_data_->timeout_id = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->_data1_->added_uids;
		_data_->_tmp22_ = _data_->_data1_->added_uid;
		_data_->_tmp23_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _data_->_tmp21_, _data_->_tmp22_);
		_data_->_data2_->received_notification = _data_->_tmp23_;
		_data_->_tmp24_ = _data_->_data2_->received_notification;
		if (_data_->_tmp24_ == FALSE) {
			g_debug ("edsf-persona-store.vala:1291: Yielding.");
			_data_->_data2_->has_yielded = TRUE;
			_data_->_state_ = 2;
			return FALSE;
			_state_2:
			;
		}
		_data_->_tmp26_ = _data_->_data2_->received_notification;
		if (_data_->_tmp26_) {
			_data_->_tmp25_ = "yes";
		} else {
			_data_->_tmp25_ = "no";
		}
		_data_->_tmp28_ = _data_->_data2_->has_yielded;
		if (_data_->_tmp28_) {
			_data_->_tmp27_ = "yes";
		} else {
			_data_->_tmp27_ = "no";
		}
		g_debug ("edsf-persona-store.vala:1296: Finished: received_notification = %s, ha" \
"s_yielded = %s", _data_->_tmp25_, _data_->_tmp27_);
		_data_->_tmp29_ = _data_->_data2_->received_notification;
		if (_data_->_tmp29_ == FALSE) {
			_data_->_tmp30_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_UNKNOWN_ERROR, _ ("Creating a new contact failed due to reaching the timeout."));
			_data_->_inner_error_ = _data_->_tmp30_;
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			goto __catch10_g_error;
		}
		_data_->_tmp32_ = _data_->_data1_->added_uid;
		if (_data_->_tmp32_ != NULL) {
			_data_->_tmp33_ = _data_->_data1_->added_uid;
			_data_->_tmp31_ = g_strcmp0 (_data_->_tmp33_, "") != 0;
		} else {
			_data_->_tmp31_ = FALSE;
		}
		_vala_assert (_data_->_tmp31_, "added_uid != null && added_uid != \"\"");
		_data_->_tmp34_ = _data_->_data1_->added_uid;
		_data_->_tmp35_ = g_strdup (_data_->_tmp34_);
		_data_->result = _data_->_tmp35_;
		block2_data_unref (_data_->_data2_);
		_data_->_data2_ = NULL;
		{
			_data_->_tmp36_ = _data_->signal_id;
			if (_data_->_tmp36_ != ((gulong) 0)) {
				_data_->_tmp37_ = _data_->self->priv->_ebookview;
				_data_->_tmp38_ = _data_->signal_id;
				g_signal_handler_disconnect ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp37_, e_book_client_view_get_type (), EBookClientView), _data_->_tmp38_);
			}
			_data_->_tmp39_ = _data_->timeout_id;
			if (_data_->_tmp39_ != ((guint) 0)) {
				_data_->_tmp40_ = _data_->timeout_id;
				g_source_remove (_data_->_tmp40_);
			}
		}
		_g_object_unref0 (_data_->debug_obj);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	goto __finally10;
	__catch10_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp41_ = _data_->e;
		_data_->_tmp42_ = edsf_persona_store_e_client_error_to_persona_store_error (_data_->self, _data_->_tmp41_);
		_data_->_inner_error_ = _data_->_tmp42_;
		_g_error_free0 (_data_->e);
		goto __finally10;
	}
	__finally10:
	{
		_data_->_tmp43_ = _data_->signal_id;
		if (_data_->_tmp43_ != ((gulong) 0)) {
			_data_->_tmp44_ = _data_->self->priv->_ebookview;
			_data_->_tmp45_ = _data_->signal_id;
			g_signal_handler_disconnect ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp44_, e_book_client_view_get_type (), EBookClientView), _data_->_tmp45_);
		}
		_data_->_tmp46_ = _data_->timeout_id;
		if (_data_->_tmp46_ != ((guint) 0)) {
			_data_->_tmp47_ = _data_->timeout_id;
			g_source_remove (_data_->_tmp47_);
		}
	}
	if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
		g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
		_g_object_unref0 (_data_->debug_obj);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		_g_object_unref0 (_data_->debug_obj);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_g_object_unref0 (_data_->debug_obj);
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_commit_modified_property_data_free (gpointer _data) {
	EdsfPersonaStoreCommitModifiedPropertyData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->property_name);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreCommitModifiedPropertyData, _data_);
}


static void _edsf_persona_store_commit_modified_property (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* property_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreCommitModifiedPropertyData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreCommitModifiedPropertyData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_commit_modified_property);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_commit_modified_property_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = property_name;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (_data_->property_name);
	_data_->property_name = _tmp4_;
	_edsf_persona_store_commit_modified_property_co (_data_);
}


static void _edsf_persona_store_commit_modified_property_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreCommitModifiedPropertyData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static Block4Data* block4_data_ref (Block4Data* _data4_) {
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}


static void block4_data_unref (void * _userdata_) {
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data4_->self;
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}


static Block5Data* block5_data_ref (Block5Data* _data5_) {
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}


static void block5_data_unref (void * _userdata_) {
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data5_->_data4_->self;
		block4_data_unref (_data5_->_data4_);
		_data5_->_data4_ = NULL;
		g_slice_free (Block5Data, _data5_);
	}
}


static void ___lambda12_ (Block5Data* _data5_, GObject* obj, GParamSpec* pspec) {
	Block4Data* _data4_;
	EdsfPersonaStore* self;
	gboolean _tmp0_;
	_data4_ = _data5_->_data4_;
	self = _data4_->self;
	g_return_if_fail (obj != NULL);
	g_return_if_fail (pspec != NULL);
	_data5_->received_notification = TRUE;
	_tmp0_ = _data5_->has_yielded;
	if (_tmp0_ == TRUE) {
		_edsf_persona_store_commit_modified_property_co (_data4_->_async_data_);
	}
}


static void ____lambda12__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	___lambda12_ (self, _sender, pspec);
}


static void _edsf_persona_store_commit_modified_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreCommitModifiedPropertyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_commit_modified_property_co (_data_);
}


static gboolean ___lambda13_ (Block5Data* _data5_) {
	Block4Data* _data4_;
	EdsfPersonaStore* self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	_data4_ = _data5_->_data4_;
	self = _data4_->self;
	_tmp0_ = _data5_->has_yielded;
	if (_tmp0_ == TRUE) {
		_edsf_persona_store_commit_modified_property_co (_data4_->_async_data_);
	}
	result = FALSE;
	return result;
}


static gboolean ____lambda13__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda13_ (self);
	return result;
}


static gboolean _edsf_persona_store_commit_modified_property_co (EdsfPersonaStoreCommitModifiedPropertyData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data4_ = g_slice_new0 (Block4Data);
	_data_->_data4_->_ref_count_ = 1;
	_data_->_data4_->self = g_object_ref (_data_->self);
	_data_->_data4_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->_addressbook;
	_vala_assert (_data_->_tmp0_ != NULL, "this._addressbook != null");
	_data_->_tmp1_ = folks_debug_dup ();
	_data_->debug_obj = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->debug_obj;
	_data_->_tmp3_ = folks_debug_get_debug_output_enabled (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (_data_->_tmp4_ == TRUE) {
		_data_->_tmp5_ = _data_->property_name;
		_data_->_tmp6_ = _data_->persona;
		_data_->_tmp7_ = _data_->persona;
		_data_->_tmp8_ = folks_persona_get_uid ((FolksPersona*) _data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		g_debug ("edsf-persona-store.vala:1349: Committing modified property ‘%s’ to per" \
"sona %p (UID: %s).", _data_->_tmp5_, _data_->_tmp6_, _data_->_tmp9_);
		_data_->_tmp10_ = _data_->persona;
		_data_->_tmp11_ = edsf_persona_get_contact (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = e_vcard_to_string ((EVCard*) _data_->_tmp12_, EVC_FORMAT_VCARD_30);
		_data_->_tmp14_ = _data_->_tmp13_;
		g_debug ("edsf-persona-store.vala:1352: Modified vCard: %s", _data_->_tmp14_);
		_g_free0 (_data_->_tmp14_);
	}
	_data_->_tmp15_ = _data_->persona;
	_data_->_tmp16_ = edsf_persona_get_contact (_data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	_data_->_tmp18_ = _g_object_ref0 (_data_->_tmp17_);
	_data_->contact = _data_->_tmp18_;
	_data_->signal_id = (gulong) 0;
	_data_->timeout_id = (guint) 0;
	{
		_data_->_data5_ = g_slice_new0 (Block5Data);
		_data_->_data5_->_ref_count_ = 1;
		_data_->_data5_->_data4_ = block4_data_ref (_data_->_data4_);
		_data_->_data5_->received_notification = FALSE;
		_data_->_data5_->has_yielded = FALSE;
		_data_->_tmp20_ = _data_->property_name;
		_data_->_tmp19_ = _data_->_tmp20_;
		if (_data_->_tmp19_ == NULL) {
			_data_->_tmp19_ = "contact";
		}
		_data_->_tmp21_ = g_strdup (_data_->_tmp19_);
		_data_->signal_name = _data_->_tmp21_;
		_data_->_tmp22_ = _data_->persona;
		_data_->_tmp23_ = _data_->signal_name;
		_data_->_tmp24_ = g_strconcat ("notify::", _data_->_tmp23_, NULL);
		_data_->_tmp25_ = g_signal_connect_data ((GObject*) _data_->_tmp22_, _data_->_tmp24_, (GCallback) ____lambda12__g_object_notify, block5_data_ref (_data_->_data5_), (GClosureNotify) block5_data_unref, 0);
		_data_->signal_id = _data_->_tmp25_;
		_g_free0 (_data_->_tmp24_);
		_data_->_tmp26_ = _data_->self->priv->_addressbook;
		_data_->_tmp27_ = _data_->contact;
		_data_->_state_ = 1;
		e_book_client_modify_contact (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp26_, e_book_client_get_type (), EBookClient), _data_->_tmp27_, NULL, _edsf_persona_store_commit_modified_property_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_modify_contact_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp26_, e_book_client_get_type (), EBookClient), _data_->_res_, &_data_->_inner_error_);
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			_g_free0 (_data_->signal_name);
			block5_data_unref (_data_->_data5_);
			_data_->_data5_ = NULL;
			goto __catch11_g_error;
		}
		_data_->_tmp28_ = g_timeout_add_seconds_full (G_PRIORITY_LOW, EDSF_PERSONA_STORE__property_change_timeout, ____lambda13__gsource_func, block5_data_ref (_data_->_data5_), block5_data_unref);
		_data_->timeout_id = _data_->_tmp28_;
		_data_->_tmp29_ = _data_->_data5_->received_notification;
		if (_data_->_tmp29_ == FALSE) {
			g_debug ("edsf-persona-store.vala:1402: Yielding.");
			_data_->_data5_->has_yielded = TRUE;
			_data_->_state_ = 2;
			return FALSE;
			_state_2:
			;
		}
		_data_->_tmp31_ = _data_->_data5_->received_notification;
		if (_data_->_tmp31_) {
			_data_->_tmp30_ = "yes";
		} else {
			_data_->_tmp30_ = "no";
		}
		_data_->_tmp33_ = _data_->_data5_->has_yielded;
		if (_data_->_tmp33_) {
			_data_->_tmp32_ = "yes";
		} else {
			_data_->_tmp32_ = "no";
		}
		g_debug ("edsf-persona-store.vala:1407: Finished: received_notification = %s, ha" \
"s_yielded = %s", _data_->_tmp30_, _data_->_tmp32_);
		_data_->_tmp34_ = _data_->_data5_->received_notification;
		if (_data_->_tmp34_ == FALSE) {
			_data_->_tmp35_ = _data_->property_name;
			_data_->_tmp36_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_UNKNOWN_ERROR, _ ("Changing the ‘%s’ property failed due to reaching the timeout."), _data_->_tmp35_);
			_data_->_inner_error_ = _data_->_tmp36_;
			_g_free0 (_data_->signal_name);
			block5_data_unref (_data_->_data5_);
			_data_->_data5_ = NULL;
			goto __catch11_g_error;
		}
		_g_free0 (_data_->signal_name);
		block5_data_unref (_data_->_data5_);
		_data_->_data5_ = NULL;
	}
	goto __finally11;
	__catch11_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp37_ = _data_->property_name;
		_data_->_tmp38_ = _data_->e;
		_data_->_tmp39_ = edsf_persona_store_e_client_error_to_property_error (_data_->self, _data_->_tmp37_, _data_->_tmp38_);
		_data_->_inner_error_ = _data_->_tmp39_;
		_g_error_free0 (_data_->e);
		goto __finally11;
	}
	__finally11:
	{
		_data_->_tmp40_ = _data_->signal_id;
		if (_data_->_tmp40_ != ((gulong) 0)) {
			_data_->_tmp41_ = _data_->persona;
			_data_->_tmp42_ = _data_->signal_id;
			g_signal_handler_disconnect ((GObject*) _data_->_tmp41_, _data_->_tmp42_);
		}
		_data_->_tmp43_ = _data_->timeout_id;
		if (_data_->_tmp43_ != ((guint) 0)) {
			_data_->_tmp44_ = _data_->timeout_id;
			g_source_remove (_data_->_tmp44_);
		}
	}
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			_g_object_unref0 (_data_->contact);
			_g_object_unref0 (_data_->debug_obj);
			block4_data_unref (_data_->_data4_);
			_data_->_data4_ = NULL;
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->contact);
			_g_object_unref0 (_data_->debug_obj);
			block4_data_unref (_data_->_data4_);
			_data_->_data4_ = NULL;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->debug_obj);
	block4_data_unref (_data_->_data4_);
	_data_->_data4_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_remove_attribute (EdsfPersonaStore* self, EContact* contact, const gchar* attr_name) {
	EContact* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (attr_name != NULL);
	_tmp0_ = contact;
	_tmp1_ = attr_name;
	e_vcard_remove_attributes ((EVCard*) _tmp0_, NULL, _tmp1_);
}


static void _edsf_persona_store_set_avatar_data_free (gpointer _data) {
	EdsfPersonaStoreSetAvatarData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->avatar);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetAvatarData, _data_);
}


void _edsf_persona_store_set_avatar (EdsfPersonaStore* self, EdsfPersona* persona, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetAvatarData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GLoadableIcon* _tmp3_;
	GLoadableIcon* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetAvatarData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_avatar);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_avatar_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = avatar;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->avatar);
	_data_->avatar = _tmp4_;
	_edsf_persona_store_set_avatar_co (_data_);
}


void _edsf_persona_store_set_avatar_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetAvatarData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetAvatarData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_avatar_co (_data_);
}


static gboolean _edsf_persona_store_set_avatar_co (EdsfPersonaStoreSetAvatarData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "avatar")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Avatar is not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp4_ = _data_->persona;
	_data_->_tmp5_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	if (_data_->_tmp6_ == NULL) {
		_data_->_tmp7_ = _data_->avatar;
		_data_->_tmp3_ = _data_->_tmp7_ == NULL;
	} else {
		_data_->_tmp3_ = FALSE;
	}
	if (_data_->_tmp3_) {
		_data_->_tmp2_ = TRUE;
	} else {
		_data_->_tmp9_ = _data_->persona;
		_data_->_tmp10_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp9_);
		_data_->_tmp11_ = _data_->_tmp10_;
		if (_data_->_tmp11_ != NULL) {
			_data_->_tmp12_ = _data_->persona;
			_data_->_tmp13_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp12_);
			_data_->_tmp14_ = _data_->_tmp13_;
			_data_->_tmp15_ = _data_->avatar;
			_data_->_tmp16_ = g_icon_equal ((GIcon*) G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp14_, g_loadable_icon_get_type (), GLoadableIcon), (GIcon*) _data_->_tmp15_);
			_data_->_tmp8_ = _data_->_tmp16_;
		} else {
			_data_->_tmp8_ = FALSE;
		}
		_data_->_tmp2_ = _data_->_tmp8_;
	}
	if (_data_->_tmp2_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp17_ = _data_->persona;
	_data_->_tmp18_ = edsf_persona_get_contact (_data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = _data_->avatar;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_avatar (_data_->self, _data_->_tmp19_, _data_->_tmp20_, _edsf_persona_store_set_avatar_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_avatar_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp21_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp21_, "avatar", _edsf_persona_store_set_avatar_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_web_service_addresses_data_free (gpointer _data) {
	EdsfPersonaStoreSetWebServiceAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->web_service_addresses);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetWebServiceAddressesData, _data_);
}


void _edsf_persona_store_set_web_service_addresses (EdsfPersonaStore* self, EdsfPersona* persona, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetWebServiceAddressesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeMultiMap* _tmp3_;
	GeeMultiMap* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetWebServiceAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_web_service_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_web_service_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = web_service_addresses;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->web_service_addresses);
	_data_->web_service_addresses = _tmp4_;
	_edsf_persona_store_set_web_service_addresses_co (_data_);
}


void _edsf_persona_store_set_web_service_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetWebServiceAddressesData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_web_service_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetWebServiceAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_web_service_addresses_co (_data_);
}


static gboolean _edsf_persona_store_set_web_service_addresses_co (EdsfPersonaStoreSetWebServiceAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "web-service-addresses")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Web service addresses are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->persona;
	_data_->_tmp3_ = folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->web_service_addresses;
	_data_->_tmp6_ = folks_utils_multi_map_str_afd_equal (_data_->_tmp4_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->web_service_addresses;
	_edsf_persona_store_set_contact_web_service_addresses (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "web-service-addresses", _edsf_persona_store_set_web_service_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static EVCardAttributeParam* _vala_EVCardAttributeParam_copy (EVCardAttributeParam* self) {
	return g_boxed_copy (e_vcard_attribute_param_get_type (), self);
}


static gpointer __vala_EVCardAttributeParam_copy0 (gpointer self) {
	return self ? _vala_EVCardAttributeParam_copy (self) : NULL;
}


static void _vala_EVCardAttributeParam_free (EVCardAttributeParam* self) {
	g_boxed_free (e_vcard_attribute_param_get_type (), self);
}


static void _vala_EVCardAttribute_free (EVCardAttribute* self) {
	g_boxed_free (e_vcard_attribute_get_type (), self);
}


static void _edsf_persona_store_set_contact_web_service_addresses (EdsfPersonaStore* self, EContact* contact, GeeMultiMap* web_service_addresses) {
	EContact* _tmp0_;
	EVCardAttribute* attr_n;
	EVCardAttribute* _tmp1_;
	EContact* _tmp30_;
	EVCardAttribute* _tmp31_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (web_service_addresses != NULL);
	_tmp0_ = contact;
	_edsf_persona_store_remove_attribute (self, _tmp0_, "X-FOLKS-WEB-SERVICES-IDS");
	_tmp1_ = e_vcard_attribute_new (NULL, "X-FOLKS-WEB-SERVICES-IDS");
	attr_n = _tmp1_;
	{
		GeeIterator* _service_it;
		GeeMultiMap* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp2_ = web_service_addresses;
		_tmp3_ = gee_multi_map_get_keys (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_service_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			gboolean _tmp8_;
			gchar* service;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			EVCardAttributeParam* param;
			const gchar* _tmp11_;
			EVCardAttributeParam* _tmp12_;
			EVCardAttribute* _tmp27_;
			EVCardAttributeParam* _tmp28_;
			EVCardAttributeParam* _tmp29_;
			_tmp7_ = _service_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _service_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			service = (gchar*) _tmp10_;
			_tmp11_ = service;
			_tmp12_ = e_vcard_attribute_param_new (_tmp11_);
			param = _tmp12_;
			{
				GeeIterator* _ws_fd_it;
				GeeMultiMap* _tmp13_;
				const gchar* _tmp14_;
				GeeCollection* _tmp15_;
				GeeCollection* _tmp16_;
				GeeIterator* _tmp17_;
				GeeIterator* _tmp18_;
				_tmp13_ = web_service_addresses;
				_tmp14_ = service;
				_tmp15_ = gee_multi_map_get (_tmp13_, _tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = gee_iterable_iterator ((GeeIterable*) _tmp16_);
				_tmp18_ = _tmp17_;
				_g_object_unref0 (_tmp16_);
				_ws_fd_it = _tmp18_;
				while (TRUE) {
					GeeIterator* _tmp19_;
					gboolean _tmp20_;
					FolksWebServiceFieldDetails* ws_fd;
					GeeIterator* _tmp21_;
					gpointer _tmp22_;
					EVCardAttributeParam* _tmp23_;
					FolksWebServiceFieldDetails* _tmp24_;
					gconstpointer _tmp25_;
					const gchar* _tmp26_;
					_tmp19_ = _ws_fd_it;
					_tmp20_ = gee_iterator_next (_tmp19_);
					if (!_tmp20_) {
						break;
					}
					_tmp21_ = _ws_fd_it;
					_tmp22_ = gee_iterator_get (_tmp21_);
					ws_fd = (FolksWebServiceFieldDetails*) _tmp22_;
					_tmp23_ = param;
					_tmp24_ = ws_fd;
					_tmp25_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp24_);
					_tmp26_ = _tmp25_;
					e_vcard_attribute_param_add_value (_tmp23_, (const gchar*) _tmp26_);
					_g_object_unref0 (ws_fd);
				}
				_g_object_unref0 (_ws_fd_it);
			}
			_tmp27_ = attr_n;
			_tmp28_ = param;
			_tmp29_ = __vala_EVCardAttributeParam_copy0 (_tmp28_);
			e_vcard_attribute_add_param (_tmp27_, _tmp29_);
			__vala_EVCardAttributeParam_free0 (param);
			_g_free0 (service);
		}
		_g_object_unref0 (_service_it);
	}
	_tmp30_ = contact;
	_tmp31_ = attr_n;
	attr_n = NULL;
	e_vcard_add_attribute ((EVCard*) _tmp30_, _tmp31_);
	__vala_EVCardAttribute_free0 (attr_n);
}


static void _edsf_persona_store_set_urls_data_free (gpointer _data) {
	EdsfPersonaStoreSetUrlsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->urls);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetUrlsData, _data_);
}


void _edsf_persona_store_set_urls (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetUrlsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetUrlsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_urls);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_urls_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = urls;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->urls);
	_data_->urls = _tmp4_;
	_edsf_persona_store_set_urls_co (_data_);
}


void _edsf_persona_store_set_urls_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetUrlsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_urls_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetUrlsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_urls_co (_data_);
}


static gboolean _edsf_persona_store_set_urls_co (EdsfPersonaStoreSetUrlsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "urls")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("URLs are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->persona;
	_data_->_tmp3_ = folks_url_details_get_urls ((FolksUrlDetails*) _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->urls;
	_data_->_tmp6_ = folks_utils_set_afd_equal (_data_->_tmp4_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->urls;
	_edsf_persona_store_set_contact_urls (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "urls", _edsf_persona_store_set_urls_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_contact_urls (EdsfPersonaStore* self, EContact* contact, GeeSet* urls) {
	EVCard* vcard;
	EContact* _tmp0_;
	EVCard* _tmp1_;
	EVCard* _tmp2_;
	EContact* _tmp3_;
	EContact* _tmp4_;
	EContact* _tmp5_;
	EContact* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (urls != NULL);
	_tmp0_ = contact;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, e_vcard_get_type (), EVCard));
	vcard = _tmp1_;
	_tmp2_ = vcard;
	e_vcard_remove_attributes (_tmp2_, NULL, "X-URIS");
	_tmp3_ = contact;
	e_contact_set (_tmp3_, E_CONTACT_HOMEPAGE_URL, NULL);
	_tmp4_ = contact;
	e_contact_set (_tmp4_, E_CONTACT_VIDEO_URL, NULL);
	_tmp5_ = contact;
	e_contact_set (_tmp5_, E_CONTACT_BLOG_URL, NULL);
	_tmp6_ = contact;
	e_contact_set (_tmp6_, E_CONTACT_FREEBUSY_URL, NULL);
	{
		GeeIterator* _u_it;
		GeeSet* _tmp7_;
		GeeIterator* _tmp8_;
		_tmp7_ = urls;
		_tmp8_ = gee_iterable_iterator ((GeeIterable*) _tmp7_);
		_u_it = _tmp8_;
		while (TRUE) {
			GeeIterator* _tmp9_;
			gboolean _tmp10_;
			FolksUrlFieldDetails* u;
			GeeIterator* _tmp11_;
			gpointer _tmp12_;
			gboolean set_attr_already;
			EVCardAttribute* attr;
			EVCardAttribute* _tmp13_;
			EVCardAttribute* _tmp14_;
			FolksUrlFieldDetails* _tmp15_;
			gconstpointer _tmp16_;
			const gchar* _tmp17_;
			gboolean _tmp67_;
			EContact* _tmp68_;
			EVCardAttribute* _tmp69_;
			_tmp9_ = _u_it;
			_tmp10_ = gee_iterator_next (_tmp9_);
			if (!_tmp10_) {
				break;
			}
			_tmp11_ = _u_it;
			_tmp12_ = gee_iterator_get (_tmp11_);
			u = (FolksUrlFieldDetails*) _tmp12_;
			set_attr_already = FALSE;
			_tmp13_ = e_vcard_attribute_new (NULL, "X-URIS");
			attr = _tmp13_;
			_tmp14_ = attr;
			_tmp15_ = u;
			_tmp16_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp15_);
			_tmp17_ = _tmp16_;
			e_vcard_attribute_add_value (_tmp14_, (const gchar*) _tmp17_);
			{
				GeeIterator* _param_name_it;
				FolksUrlFieldDetails* _tmp18_;
				GeeMultiMap* _tmp19_;
				GeeMultiMap* _tmp20_;
				GeeSet* _tmp21_;
				GeeSet* _tmp22_;
				GeeIterator* _tmp23_;
				GeeIterator* _tmp24_;
				_tmp18_ = u;
				_tmp19_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = gee_multi_map_get_keys (_tmp20_);
				_tmp22_ = _tmp21_;
				_tmp23_ = gee_iterable_iterator ((GeeIterable*) _tmp22_);
				_tmp24_ = _tmp23_;
				_g_object_unref0 (_tmp22_);
				_param_name_it = _tmp24_;
				while (TRUE) {
					GeeIterator* _tmp25_;
					gboolean _tmp26_;
					gchar* param_name;
					GeeIterator* _tmp27_;
					gpointer _tmp28_;
					EVCardAttributeParam* param;
					const gchar* _tmp29_;
					gchar* _tmp30_;
					gchar* _tmp31_;
					EVCardAttributeParam* _tmp32_;
					EVCardAttributeParam* _tmp33_;
					gboolean _tmp63_;
					EVCardAttribute* _tmp64_;
					EVCardAttributeParam* _tmp65_;
					EVCardAttributeParam* _tmp66_;
					_tmp25_ = _param_name_it;
					_tmp26_ = gee_iterator_next (_tmp25_);
					if (!_tmp26_) {
						break;
					}
					_tmp27_ = _param_name_it;
					_tmp28_ = gee_iterator_get (_tmp27_);
					param_name = (gchar*) _tmp28_;
					_tmp29_ = param_name;
					_tmp30_ = g_utf8_strup (_tmp29_, (gssize) -1);
					_tmp31_ = _tmp30_;
					_tmp32_ = e_vcard_attribute_param_new (_tmp31_);
					_tmp33_ = _tmp32_;
					_g_free0 (_tmp31_);
					param = _tmp33_;
					{
						GeeIterator* _param_val_it;
						FolksUrlFieldDetails* _tmp34_;
						GeeMultiMap* _tmp35_;
						GeeMultiMap* _tmp36_;
						const gchar* _tmp37_;
						GeeCollection* _tmp38_;
						GeeCollection* _tmp39_;
						GeeIterator* _tmp40_;
						GeeIterator* _tmp41_;
						_tmp34_ = u;
						_tmp35_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _tmp34_);
						_tmp36_ = _tmp35_;
						_tmp37_ = param_name;
						_tmp38_ = gee_multi_map_get (_tmp36_, _tmp37_);
						_tmp39_ = _tmp38_;
						_tmp40_ = gee_iterable_iterator ((GeeIterable*) _tmp39_);
						_tmp41_ = _tmp40_;
						_g_object_unref0 (_tmp39_);
						_param_val_it = _tmp41_;
						while (TRUE) {
							GeeIterator* _tmp42_;
							gboolean _tmp43_;
							gchar* param_val;
							GeeIterator* _tmp44_;
							gpointer _tmp45_;
							const gchar* _tmp46_;
							gboolean _tmp60_;
							EVCardAttributeParam* _tmp61_;
							const gchar* _tmp62_;
							_tmp42_ = _param_val_it;
							_tmp43_ = gee_iterator_next (_tmp42_);
							if (!_tmp43_) {
								break;
							}
							_tmp44_ = _param_val_it;
							_tmp45_ = gee_iterator_get (_tmp44_);
							param_val = (gchar*) _tmp45_;
							_tmp46_ = param_name;
							if (g_strcmp0 (_tmp46_, FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE) == 0) {
								{
									EdsfPersonaUrlTypeMapping* mapping_collection = NULL;
									gint mapping_collection_length1 = 0;
									gint _mapping_collection_size_ = 0;
									gint mapping_it = 0;
									mapping_collection = EDSF_PERSONA__url_properties;
									mapping_collection_length1 = G_N_ELEMENTS (EDSF_PERSONA__url_properties);
									for (mapping_it = 0; mapping_it < G_N_ELEMENTS (EDSF_PERSONA__url_properties); mapping_it = mapping_it + 1) {
										EdsfPersonaUrlTypeMapping mapping = {0};
										mapping = mapping_collection[mapping_it];
										{
											const gchar* _tmp47_;
											gchar* _tmp48_;
											gchar* _tmp49_;
											EdsfPersonaUrlTypeMapping _tmp50_;
											const gchar* _tmp51_;
											gboolean _tmp52_;
											_tmp47_ = param_val;
											_tmp48_ = g_utf8_strdown (_tmp47_, (gssize) -1);
											_tmp49_ = _tmp48_;
											_tmp50_ = mapping;
											_tmp51_ = _tmp50_.folks_type;
											_tmp52_ = g_strcmp0 (_tmp49_, _tmp51_) == 0;
											_g_free0 (_tmp49_);
											if (_tmp52_) {
												EContact* _tmp53_;
												EdsfPersonaUrlTypeMapping _tmp54_;
												const gchar* _tmp55_;
												EContactField _tmp56_;
												FolksUrlFieldDetails* _tmp57_;
												gconstpointer _tmp58_;
												const gchar* _tmp59_;
												_tmp53_ = contact;
												_tmp54_ = mapping;
												_tmp55_ = _tmp54_.vcard_field_name;
												_tmp56_ = e_contact_field_id (_tmp55_);
												_tmp57_ = u;
												_tmp58_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp57_);
												_tmp59_ = _tmp58_;
												e_contact_set (_tmp53_, _tmp56_, (const gchar*) _tmp59_);
												set_attr_already = TRUE;
												break;
											}
										}
									}
								}
							}
							_tmp60_ = set_attr_already;
							if (_tmp60_ == TRUE) {
								_g_free0 (param_val);
								break;
							}
							_tmp61_ = param;
							_tmp62_ = param_val;
							e_vcard_attribute_param_add_value (_tmp61_, _tmp62_);
							_g_free0 (param_val);
						}
						_g_object_unref0 (_param_val_it);
					}
					_tmp63_ = set_attr_already;
					if (_tmp63_ == TRUE) {
						__vala_EVCardAttributeParam_free0 (param);
						_g_free0 (param_name);
						break;
					}
					_tmp64_ = attr;
					_tmp65_ = param;
					_tmp66_ = __vala_EVCardAttributeParam_copy0 (_tmp65_);
					e_vcard_attribute_add_param (_tmp64_, _tmp66_);
					__vala_EVCardAttributeParam_free0 (param);
					_g_free0 (param_name);
				}
				_g_object_unref0 (_param_name_it);
			}
			_tmp67_ = set_attr_already;
			if (_tmp67_ == TRUE) {
				__vala_EVCardAttribute_free0 (attr);
				_g_object_unref0 (u);
				continue;
			}
			_tmp68_ = contact;
			_tmp69_ = attr;
			attr = NULL;
			e_vcard_add_attribute ((EVCard*) _tmp68_, _tmp69_);
			__vala_EVCardAttribute_free0 (attr);
			_g_object_unref0 (u);
		}
		_g_object_unref0 (_u_it);
	}
	_g_object_unref0 (vcard);
}


static void _edsf_persona_store_set_local_ids_data_free (gpointer _data) {
	EdsfPersonaStoreSetLocalIdsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->local_ids);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetLocalIdsData, _data_);
}


void _edsf_persona_store_set_local_ids (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetLocalIdsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetLocalIdsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_local_ids);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_local_ids_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = local_ids;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->local_ids);
	_data_->local_ids = _tmp4_;
	_edsf_persona_store_set_local_ids_co (_data_);
}


void _edsf_persona_store_set_local_ids_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetLocalIdsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_local_ids_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetLocalIdsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_local_ids_co (_data_);
}


static gboolean _edsf_persona_store_set_local_ids_co (EdsfPersonaStoreSetLocalIdsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "local-ids")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Local IDs are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->local_ids;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_internal_equal_sets (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->local_ids;
	_edsf_persona_store_set_contact_local_ids (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "local-ids", _edsf_persona_store_set_local_ids_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_contact_local_ids (EdsfPersonaStore* self, EContact* contact, GeeSet* local_ids) {
	EContact* _tmp0_;
	EVCardAttribute* new_attr;
	EVCardAttribute* _tmp1_;
	EContact* _tmp10_;
	EVCardAttribute* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (local_ids != NULL);
	_tmp0_ = contact;
	_edsf_persona_store_remove_attribute (self, _tmp0_, "X-FOLKS-CONTACTS-IDS");
	_tmp1_ = e_vcard_attribute_new (NULL, "X-FOLKS-CONTACTS-IDS");
	new_attr = _tmp1_;
	{
		GeeIterator* _local_id_it;
		GeeSet* _tmp2_;
		GeeIterator* _tmp3_;
		_tmp2_ = local_ids;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_local_id_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_;
			gboolean _tmp5_;
			gchar* local_id;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			EVCardAttribute* _tmp8_;
			const gchar* _tmp9_;
			_tmp4_ = _local_id_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _local_id_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			local_id = (gchar*) _tmp7_;
			_tmp8_ = new_attr;
			_tmp9_ = local_id;
			e_vcard_attribute_add_value (_tmp8_, _tmp9_);
			_g_free0 (local_id);
		}
		_g_object_unref0 (_local_id_it);
	}
	_tmp10_ = contact;
	_tmp11_ = new_attr;
	new_attr = NULL;
	e_vcard_add_attribute ((EVCard*) _tmp10_, _tmp11_);
	__vala_EVCardAttribute_free0 (new_attr);
}


static void _edsf_persona_store_set_is_favourite_data_free (gpointer _data) {
	EdsfPersonaStoreSetIsFavouriteData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetIsFavouriteData, _data_);
}


void _edsf_persona_store_set_is_favourite (EdsfPersonaStore* self, EdsfPersona* persona, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetIsFavouriteData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	gboolean _tmp3_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetIsFavouriteData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_is_favourite);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_is_favourite_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = is_favourite;
	_data_->is_favourite = _tmp3_;
	_edsf_persona_store_set_is_favourite_co (_data_);
}


void _edsf_persona_store_set_is_favourite_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetIsFavouriteData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_is_favourite_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetIsFavouriteData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_is_favourite_co (_data_);
}


static gboolean _edsf_persona_store_set_is_favourite_co (EdsfPersonaStoreSetIsFavouriteData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "is-favourite")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("The contact cannot be marked as favourite."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->is_favourite;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_favourite_details_get_is_favourite ((FolksFavouriteDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	if (_data_->_tmp2_ == _data_->_tmp5_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _data_->persona;
	_data_->_tmp7_ = edsf_persona_get_contact (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->is_favourite;
	_edsf_persona_store_set_contact_is_favourite (_data_->self, _data_->_tmp8_, _data_->_tmp9_);
	_data_->_tmp10_ = _data_->persona;
	_data_->_tmp11_ = edsf_persona_get_contact (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->persona;
	_data_->_tmp14_ = folks_group_details_get_groups ((FolksGroupDetails*) _data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = _data_->is_favourite;
	_edsf_persona_store_set_contact_groups (_data_->self, _data_->_tmp12_, _data_->_tmp15_, _data_->_tmp16_);
	_data_->_tmp17_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp17_, "is-favourite", _edsf_persona_store_set_is_favourite_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_contact_is_favourite (EdsfPersonaStore* self, EContact* contact, gboolean is_favourite) {
	EContact* _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	_tmp0_ = contact;
	_edsf_persona_store_remove_attribute (self, _tmp0_, "X-FOLKS-FAVOURITE");
	_tmp1_ = is_favourite;
	if (_tmp1_) {
		EVCardAttribute* new_attr;
		EVCardAttribute* _tmp2_;
		EVCardAttribute* _tmp3_;
		EContact* _tmp4_;
		EVCardAttribute* _tmp5_;
		_tmp2_ = e_vcard_attribute_new (NULL, "X-FOLKS-FAVOURITE");
		new_attr = _tmp2_;
		_tmp3_ = new_attr;
		e_vcard_attribute_add_value (_tmp3_, "true");
		_tmp4_ = contact;
		_tmp5_ = new_attr;
		new_attr = NULL;
		e_vcard_add_attribute ((EVCard*) _tmp4_, _tmp5_);
		__vala_EVCardAttribute_free0 (new_attr);
	}
}


static void _edsf_persona_store_set_contact_avatar_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactAvatarData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->avatar);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactAvatarData, _data_);
}


static void _edsf_persona_store_set_contact_avatar (EdsfPersonaStore* self, EContact* contact, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactAvatarData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GLoadableIcon* _tmp3_;
	GLoadableIcon* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactAvatarData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_avatar);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_avatar_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->contact);
	_data_->contact = _tmp2_;
	_tmp3_ = avatar;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->avatar);
	_data_->avatar = _tmp4_;
	_edsf_persona_store_set_contact_avatar_co (_data_);
}


static void _edsf_persona_store_set_contact_avatar_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetContactAvatarData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_contact_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactAvatarData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_contact_avatar_co (_data_);
}


static void _vala_EContactPhoto_free (EContactPhoto* self) {
	g_boxed_free (e_contact_photo_get_type (), self);
}


static gboolean _edsf_persona_store_set_contact_avatar_co (EdsfPersonaStoreSetContactAvatarData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->avatar;
	if (_data_->_tmp0_ == NULL) {
		_data_->_tmp1_ = _data_->contact;
		_edsf_persona_store_remove_attribute (_data_->self, _data_->_tmp1_, "PHOTO");
	} else {
		{
			_data_->_tmp2_ = e_contact_photo_new ();
			_data_->cp = _data_->_tmp2_;
			_data_->_tmp3_ = _data_->cp;
			_data_->_tmp3_->type = E_CONTACT_PHOTO_TYPE_INLINED;
			_data_->_tmp4_ = _data_->avatar;
			_data_->_state_ = 1;
			g_loadable_icon_load_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, g_loadable_icon_get_type (), GLoadableIcon), -1, NULL, _edsf_persona_store_set_contact_avatar_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp5_ = g_loadable_icon_load_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, g_loadable_icon_get_type (), GLoadableIcon), _data_->_res_, NULL, &_data_->_inner_error_);
			_data_->input_s = _data_->_tmp5_;
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				__vala_EContactPhoto_free0 (_data_->cp);
				goto __catch12_g_error;
			}
			_data_->_tmp6_ = g_new0 (guint8, 0);
			_data_->image_data = _data_->_tmp6_;
			_data_->image_data_length1 = 0;
			_data_->_image_data_size_ = _data_->image_data_length1;
			_data_->_tmp7_ = g_new0 (guint8, 4096);
			_data_->buffer = _data_->_tmp7_;
			_data_->buffer_length1 = 4096;
			_data_->_buffer_size_ = _data_->buffer_length1;
			while (TRUE) {
				_data_->_tmp8_ = _data_->input_s;
				_data_->_tmp9_ = _data_->buffer;
				_data_->_tmp9__length1 = _data_->buffer_length1;
				_data_->_state_ = 2;
				g_input_stream_read_async (_data_->_tmp8_, _data_->_tmp9_, (gsize) _data_->_tmp9__length1, G_PRIORITY_DEFAULT, NULL, _edsf_persona_store_set_contact_avatar_ready, _data_);
				return FALSE;
				_state_2:
				_data_->_tmp10_ = g_input_stream_read_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
				_data_->size_read = _data_->_tmp10_;
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					_data_->buffer = (g_free (_data_->buffer), NULL);
					_data_->image_data = (g_free (_data_->image_data), NULL);
					_g_object_unref0 (_data_->input_s);
					__vala_EContactPhoto_free0 (_data_->cp);
					goto __catch12_g_error;
				}
				_data_->_tmp11_ = _data_->size_read;
				if (_data_->_tmp11_ <= ((gssize) 0)) {
					break;
				}
				_data_->_tmp12_ = _data_->image_data;
				_data_->_tmp12__length1 = _data_->image_data_length1;
				_data_->read_cur = _data_->_tmp12__length1;
				_data_->_tmp13_ = _data_->read_cur;
				_data_->_tmp14_ = _data_->size_read;
				_data_->_tmp15_ = _data_->_tmp13_ + ((gint) _data_->_tmp14_);
				_data_->image_data = g_renew (guint8, _data_->image_data, _data_->_tmp13_ + ((gint) _data_->_tmp14_));
				(_data_->_tmp15_ > _data_->image_data_length1) ? memset (_data_->image_data + _data_->image_data_length1, 0, sizeof (guint8) * (_data_->_tmp15_ - _data_->image_data_length1)) : NULL;
				_data_->image_data_length1 = _data_->_tmp15_;
				_data_->_image_data_size_ = _data_->_tmp15_;
				_data_->_tmp16_ = _data_->image_data;
				_data_->_tmp16__length1 = _data_->image_data_length1;
				_data_->_tmp17_ = _data_->read_cur;
				_data_->_tmp18_ = _data_->buffer;
				_data_->_tmp18__length1 = _data_->buffer_length1;
				_data_->_tmp19_ = _data_->size_read;
				memcpy (&_data_->_tmp16_[_data_->_tmp17_], _data_->_tmp18_, (gsize) _data_->_tmp19_);
			}
			_data_->_tmp20_ = _data_->cp;
			_data_->_tmp21_ = _data_->image_data;
			_data_->_tmp21__length1 = _data_->image_data_length1;
			e_contact_photo_set_inlined (_data_->_tmp20_, _data_->_tmp21_, (gsize) _data_->_tmp21__length1);
			_data_->uncertain = FALSE;
			_data_->_tmp22_ = _data_->image_data;
			_data_->_tmp22__length1 = _data_->image_data_length1;
			_data_->_tmp23_ = FALSE;
			_data_->_tmp24_ = g_content_type_guess (NULL, _data_->_tmp22_, (gsize) _data_->_tmp22__length1, &_data_->_tmp23_);
			_data_->uncertain = _data_->_tmp23_;
			_data_->mime_type = _data_->_tmp24_;
			_data_->_tmp25_ = _data_->uncertain;
			if (!_data_->_tmp25_) {
				_data_->_tmp26_ = _data_->cp;
				_data_->_tmp27_ = _data_->mime_type;
				e_contact_photo_set_mime_type (_data_->_tmp26_, _data_->_tmp27_);
			}
			_data_->_tmp28_ = _data_->contact;
			_data_->_tmp29_ = _data_->cp;
			e_contact_set (_data_->_tmp28_, E_CONTACT_PHOTO, _data_->_tmp29_);
			_g_free0 (_data_->mime_type);
			_data_->buffer = (g_free (_data_->buffer), NULL);
			_data_->image_data = (g_free (_data_->image_data), NULL);
			_g_object_unref0 (_data_->input_s);
			__vala_EContactPhoto_free0 (_data_->cp);
		}
		goto __finally12;
		__catch12_g_error:
		{
			_data_->e1 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			_data_->_tmp30_ = _data_->e1;
			_data_->_tmp31_ = _data_->_tmp30_->message;
			_data_->_tmp32_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_INVALID_VALUE, _ ("Can’t update avatar: %s"), _data_->_tmp31_);
			_data_->_inner_error_ = _data_->_tmp32_;
			_g_error_free0 (_data_->e1);
			goto __finally12;
		}
		__finally12:
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
				g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
				g_clear_error (&_data_->_inner_error_);
				return FALSE;
			}
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_emails_data_free (gpointer _data) {
	EdsfPersonaStoreSetEmailsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->emails);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetEmailsData, _data_);
}


void _edsf_persona_store_set_emails (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* emails, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetEmailsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetEmailsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_emails);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_emails_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = emails;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->emails);
	_data_->emails = _tmp4_;
	_edsf_persona_store_set_emails_co (_data_);
}


void _edsf_persona_store_set_emails_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetEmailsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_emails_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetEmailsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_emails_co (_data_);
}


static gboolean _edsf_persona_store_set_emails_co (EdsfPersonaStoreSetEmailsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "email-addresses")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("E-mail addresses are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->emails;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_internal_equal_sets (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, _data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->emails;
	_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp9_, _data_->_tmp10_, "EMAIL", E_CONTACT_EMAIL);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "email-addresses", _edsf_persona_store_set_emails_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


FolksExtendedFieldDetails* _edsf_persona_store_get_extended_field (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* name) {
	FolksExtendedFieldDetails* result = NULL;
	EVCardAttribute* attr;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	const gchar* _tmp3_;
	EVCardAttribute* _tmp4_;
	EVCardAttribute* _tmp5_;
	FolksExtendedFieldDetails* details;
	EVCardAttribute* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	FolksExtendedFieldDetails* _tmp9_;
	FolksExtendedFieldDetails* _tmp10_;
	EVCardAttribute* _tmp11_;
	GList* _tmp12_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (persona != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = persona;
	_tmp1_ = edsf_persona_get_contact (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = name;
	_tmp4_ = e_vcard_get_attribute ((EVCard*) _tmp2_, _tmp3_);
	attr = _tmp4_;
	_tmp5_ = attr;
	if (_tmp5_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp6_ = attr;
	_tmp7_ = e_vcard_attribute_get_value (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = folks_extended_field_details_new (_tmp8_, NULL);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	details = _tmp10_;
	_tmp11_ = attr;
	_tmp12_ = e_vcard_attribute_get_params (_tmp11_);
	{
		GList* param_collection = NULL;
		GList* param_it = NULL;
		param_collection = _tmp12_;
		for (param_it = param_collection; param_it != NULL; param_it = param_it->next) {
			EVCardAttributeParam* param = NULL;
			param = (EVCardAttributeParam*) param_it->data;
			{
				const gchar* param_name;
				EVCardAttributeParam* _tmp13_;
				const gchar* _tmp14_;
				EVCardAttributeParam* _tmp15_;
				GList* _tmp16_;
				_tmp13_ = param;
				_tmp14_ = e_vcard_attribute_param_get_name (_tmp13_);
				param_name = _tmp14_;
				_tmp15_ = param;
				_tmp16_ = e_vcard_attribute_param_get_values (_tmp15_);
				{
					GList* param_value_collection = NULL;
					GList* param_value_it = NULL;
					param_value_collection = _tmp16_;
					for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
						const gchar* param_value = NULL;
						param_value = (const gchar*) param_value_it->data;
						{
							FolksExtendedFieldDetails* _tmp17_;
							const gchar* _tmp18_;
							const gchar* _tmp19_;
							_tmp17_ = details;
							_tmp18_ = param_name;
							_tmp19_ = param_value;
							folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp17_, _tmp18_, _tmp19_);
						}
					}
				}
			}
		}
	}
	result = details;
	return result;
}


static void _edsf_persona_store_change_extended_field_data_free (gpointer _data) {
	EdsfPersonaStoreChangeExtendedFieldData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->details);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreChangeExtendedFieldData, _data_);
}


void _edsf_persona_store_change_extended_field (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* name, FolksExtendedFieldDetails* details, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreChangeExtendedFieldData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	FolksExtendedFieldDetails* _tmp5_;
	FolksExtendedFieldDetails* _tmp6_;
	_data_ = g_slice_new0 (EdsfPersonaStoreChangeExtendedFieldData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_change_extended_field);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_change_extended_field_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = name;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (_data_->name);
	_data_->name = _tmp4_;
	_tmp5_ = details;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	_g_object_unref0 (_data_->details);
	_data_->details = _tmp6_;
	_edsf_persona_store_change_extended_field_co (_data_);
}


void _edsf_persona_store_change_extended_field_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreChangeExtendedFieldData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static EVCardAttribute* _vala_EVCardAttribute_copy (EVCardAttribute* self) {
	return g_boxed_copy (e_vcard_attribute_get_type (), self);
}


static gpointer __vala_EVCardAttribute_copy0 (gpointer self) {
	return self ? _vala_EVCardAttribute_copy (self) : NULL;
}


static void _edsf_persona_store_change_extended_field_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreChangeExtendedFieldData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_change_extended_field_co (_data_);
}


static gboolean _edsf_persona_store_change_extended_field_co (EdsfPersonaStoreChangeExtendedFieldData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = edsf_persona_get_contact (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp2_, e_vcard_get_type (), EVCard));
	_data_->vcard = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->vcard;
	_data_->_tmp5_ = _data_->name;
	_data_->_tmp6_ = e_vcard_get_attribute (_data_->_tmp4_, _data_->_tmp5_);
	_data_->prev_attr = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->prev_attr;
	if (_data_->_tmp7_ != NULL) {
		_data_->_tmp8_ = _data_->vcard;
		_data_->_tmp9_ = _data_->prev_attr;
		_data_->_tmp10_ = __vala_EVCardAttribute_copy0 (_data_->_tmp9_);
		e_vcard_remove_attribute (_data_->_tmp8_, _data_->_tmp10_);
	}
	_data_->_tmp11_ = _data_->name;
	_data_->_tmp12_ = e_vcard_attribute_new (NULL, _data_->_tmp11_);
	_data_->new_attr = _data_->_tmp12_;
	_data_->_tmp13_ = _data_->details;
	_data_->_tmp14_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	e_vcard_attribute_add_value (_data_->new_attr, (const gchar*) _data_->_tmp15_);
	_data_->_tmp16_ = _data_->vcard;
	_data_->_tmp17_ = __vala_EVCardAttribute_copy0 (_data_->new_attr);
	e_vcard_add_attribute (_data_->_tmp16_, _data_->_tmp17_);
	_data_->_tmp18_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp18_, NULL, _edsf_persona_store_change_extended_field_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			__vala_EVCardAttribute_free0 (_data_->new_attr);
			_g_object_unref0 (_data_->vcard);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			__vala_EVCardAttribute_free0 (_data_->new_attr);
			_g_object_unref0 (_data_->vcard);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	__vala_EVCardAttribute_free0 (_data_->new_attr);
	_g_object_unref0 (_data_->vcard);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_remove_extended_field_data_free (gpointer _data) {
	EdsfPersonaStoreRemoveExtendedFieldData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreRemoveExtendedFieldData, _data_);
}


void _edsf_persona_store_remove_extended_field (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreRemoveExtendedFieldData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreRemoveExtendedFieldData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_remove_extended_field);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_remove_extended_field_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = name;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (_data_->name);
	_data_->name = _tmp4_;
	_edsf_persona_store_remove_extended_field_co (_data_);
}


void _edsf_persona_store_remove_extended_field_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreRemoveExtendedFieldData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_remove_extended_field_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreRemoveExtendedFieldData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_remove_extended_field_co (_data_);
}


static gboolean _edsf_persona_store_remove_extended_field_co (EdsfPersonaStoreRemoveExtendedFieldData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = edsf_persona_get_contact (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->name;
	e_vcard_remove_attributes ((EVCard*) _data_->_tmp2_, "", _data_->_tmp3_);
	_data_->_tmp4_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp4_, NULL, _edsf_persona_store_remove_extended_field_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_phones_data_free (gpointer _data) {
	EdsfPersonaStoreSetPhonesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->phones);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetPhonesData, _data_);
}


void _edsf_persona_store_set_phones (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* phones, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetPhonesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetPhonesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_phones);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_phones_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = phones;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->phones);
	_data_->phones = _tmp4_;
	_edsf_persona_store_set_phones_co (_data_);
}


void _edsf_persona_store_set_phones_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetPhonesData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_phones_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetPhonesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_phones_co (_data_);
}


static gboolean _edsf_persona_store_set_phones_co (EdsfPersonaStoreSetPhonesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "phone-numbers")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Phone numbers are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->phones;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_phone_details_get_phone_numbers ((FolksPhoneDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_utils_set_string_afd_equal (_data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->phones;
	_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp9_, _data_->_tmp10_, "TEL", E_CONTACT_TEL);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "phone-numbers", _edsf_persona_store_set_phones_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_postal_addresses_data_free (gpointer _data) {
	EdsfPersonaStoreSetPostalAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->postal_fds);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetPostalAddressesData, _data_);
}


void _edsf_persona_store_set_postal_addresses (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* postal_fds, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetPostalAddressesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetPostalAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_postal_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_postal_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = postal_fds;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->postal_fds);
	_data_->postal_fds = _tmp4_;
	_edsf_persona_store_set_postal_addresses_co (_data_);
}


void _edsf_persona_store_set_postal_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetPostalAddressesData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetPostalAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_postal_addresses_co (_data_);
}


static gboolean _edsf_persona_store_set_postal_addresses_co (EdsfPersonaStoreSetPostalAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "postal-addresses")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Postal addresses are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->postal_fds;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_postal_address_details_get_postal_addresses ((FolksPostalAddressDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_internal_equal_sets (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, _data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->postal_fds;
	_edsf_persona_store_set_contact_postal_addresses (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "postal-addresses", _edsf_persona_store_set_postal_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void __lambda5_ (EdsfPersonaStore* self, EVCardAttribute* attr, FolksPostalAddress* address) {
	EVCardAttribute* _tmp0_;
	FolksPostalAddress* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	EVCardAttribute* _tmp4_;
	FolksPostalAddress* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	EVCardAttribute* _tmp8_;
	FolksPostalAddress* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	EVCardAttribute* _tmp12_;
	FolksPostalAddress* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	EVCardAttribute* _tmp16_;
	FolksPostalAddress* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	EVCardAttribute* _tmp20_;
	FolksPostalAddress* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	EVCardAttribute* _tmp24_;
	FolksPostalAddress* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	g_return_if_fail (attr != NULL);
	g_return_if_fail (address != NULL);
	_tmp0_ = attr;
	_tmp1_ = address;
	_tmp2_ = folks_postal_address_get_po_box (_tmp1_);
	_tmp3_ = _tmp2_;
	e_vcard_attribute_add_value (_tmp0_, _tmp3_);
	_tmp4_ = attr;
	_tmp5_ = address;
	_tmp6_ = folks_postal_address_get_extension (_tmp5_);
	_tmp7_ = _tmp6_;
	e_vcard_attribute_add_value (_tmp4_, _tmp7_);
	_tmp8_ = attr;
	_tmp9_ = address;
	_tmp10_ = folks_postal_address_get_street (_tmp9_);
	_tmp11_ = _tmp10_;
	e_vcard_attribute_add_value (_tmp8_, _tmp11_);
	_tmp12_ = attr;
	_tmp13_ = address;
	_tmp14_ = folks_postal_address_get_locality (_tmp13_);
	_tmp15_ = _tmp14_;
	e_vcard_attribute_add_value (_tmp12_, _tmp15_);
	_tmp16_ = attr;
	_tmp17_ = address;
	_tmp18_ = folks_postal_address_get_region (_tmp17_);
	_tmp19_ = _tmp18_;
	e_vcard_attribute_add_value (_tmp16_, _tmp19_);
	_tmp20_ = attr;
	_tmp21_ = address;
	_tmp22_ = folks_postal_address_get_postal_code (_tmp21_);
	_tmp23_ = _tmp22_;
	e_vcard_attribute_add_value (_tmp20_, _tmp23_);
	_tmp24_ = attr;
	_tmp25_ = address;
	_tmp26_ = folks_postal_address_get_country (_tmp25_);
	_tmp27_ = _tmp26_;
	e_vcard_attribute_add_value (_tmp24_, _tmp27_);
}


static void ___lambda5__edsf_persona_store_field_to_attribute (EVCardAttribute* attr, gconstpointer value, gpointer self) {
	__lambda5_ ((EdsfPersonaStore*) self, attr, (FolksPostalAddress*) value);
}


static void _edsf_persona_store_set_contact_postal_addresses (EdsfPersonaStore* self, EContact* contact, GeeSet* postal_fds) {
	EContact* _tmp0_;
	GeeSet* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (postal_fds != NULL);
	_tmp0_ = contact;
	_tmp1_ = postal_fds;
	_edsf_persona_store_set_contact_attributes (self, FOLKS_TYPE_POSTAL_ADDRESS, (GBoxedCopyFunc) g_object_ref, g_object_unref, _tmp0_, _tmp1_, ___lambda5__edsf_persona_store_field_to_attribute, self, "ADR", E_CONTACT_ADDRESS);
}


static void __vala_EVCardAttribute_free0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (_vala_EVCardAttribute_free (var), NULL));
}


static void _g_list_free___vala_EVCardAttribute_free0_ (GList* self) {
	g_list_foreach (self, (GFunc) __vala_EVCardAttribute_free0_, NULL);
	g_list_free (self);
}


static void _edsf_persona_store_set_contact_attributes (EdsfPersonaStore* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, EContact* contact, GeeSet* new_attributes, EdsfPersonaStoreFieldToAttribute fill_attribute, void* fill_attribute_target, const gchar* attrib_name, EContactField field_id) {
	GList* attributes;
	EContact* _tmp47_;
	EContactField _tmp48_;
	GList* _tmp49_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (new_attributes != NULL);
	g_return_if_fail (attrib_name != NULL);
	attributes = NULL;
	{
		GeeIterator* _e_it;
		GeeSet* _tmp0_;
		GeeIterator* _tmp1_;
		_tmp0_ = new_attributes;
		_tmp1_ = gee_iterable_iterator ((GeeIterable*) _tmp0_);
		_e_it = _tmp1_;
		while (TRUE) {
			GeeIterator* _tmp2_;
			gboolean _tmp3_;
			FolksAbstractFieldDetails* e;
			GeeIterator* _tmp4_;
			gpointer _tmp5_;
			EVCardAttribute* attr;
			const gchar* _tmp6_;
			EVCardAttribute* _tmp7_;
			EdsfPersonaStoreFieldToAttribute _tmp8_;
			void* _tmp8__target;
			EVCardAttribute* _tmp9_;
			FolksAbstractFieldDetails* _tmp10_;
			gconstpointer _tmp11_;
			gconstpointer _tmp12_;
			EVCardAttribute* _tmp46_;
			_tmp2_ = _e_it;
			_tmp3_ = gee_iterator_next (_tmp2_);
			if (!_tmp3_) {
				break;
			}
			_tmp4_ = _e_it;
			_tmp5_ = gee_iterator_get (_tmp4_);
			e = (FolksAbstractFieldDetails*) _tmp5_;
			_tmp6_ = attrib_name;
			_tmp7_ = e_vcard_attribute_new (NULL, _tmp6_);
			attr = _tmp7_;
			_tmp8_ = fill_attribute;
			_tmp8__target = fill_attribute_target;
			_tmp9_ = attr;
			_tmp10_ = e;
			_tmp11_ = folks_abstract_field_details_get_value (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp8_ (_tmp9_, _tmp12_, _tmp8__target);
			{
				GeeIterator* _param_name_it;
				FolksAbstractFieldDetails* _tmp13_;
				GeeMultiMap* _tmp14_;
				GeeMultiMap* _tmp15_;
				GeeSet* _tmp16_;
				GeeSet* _tmp17_;
				GeeIterator* _tmp18_;
				GeeIterator* _tmp19_;
				_tmp13_ = e;
				_tmp14_ = folks_abstract_field_details_get_parameters (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = gee_multi_map_get_keys (_tmp15_);
				_tmp17_ = _tmp16_;
				_tmp18_ = gee_iterable_iterator ((GeeIterable*) _tmp17_);
				_tmp19_ = _tmp18_;
				_g_object_unref0 (_tmp17_);
				_param_name_it = _tmp19_;
				while (TRUE) {
					GeeIterator* _tmp20_;
					gboolean _tmp21_;
					gchar* param_name;
					GeeIterator* _tmp22_;
					gpointer _tmp23_;
					EVCardAttributeParam* param;
					const gchar* _tmp24_;
					gchar* _tmp25_;
					gchar* _tmp26_;
					EVCardAttributeParam* _tmp27_;
					EVCardAttributeParam* _tmp28_;
					EVCardAttribute* _tmp43_;
					EVCardAttributeParam* _tmp44_;
					EVCardAttributeParam* _tmp45_;
					_tmp20_ = _param_name_it;
					_tmp21_ = gee_iterator_next (_tmp20_);
					if (!_tmp21_) {
						break;
					}
					_tmp22_ = _param_name_it;
					_tmp23_ = gee_iterator_get (_tmp22_);
					param_name = (gchar*) _tmp23_;
					_tmp24_ = param_name;
					_tmp25_ = g_utf8_strup (_tmp24_, (gssize) -1);
					_tmp26_ = _tmp25_;
					_tmp27_ = e_vcard_attribute_param_new (_tmp26_);
					_tmp28_ = _tmp27_;
					_g_free0 (_tmp26_);
					param = _tmp28_;
					{
						GeeIterator* _param_val_it;
						FolksAbstractFieldDetails* _tmp29_;
						GeeMultiMap* _tmp30_;
						GeeMultiMap* _tmp31_;
						const gchar* _tmp32_;
						GeeCollection* _tmp33_;
						GeeCollection* _tmp34_;
						GeeIterator* _tmp35_;
						GeeIterator* _tmp36_;
						_tmp29_ = e;
						_tmp30_ = folks_abstract_field_details_get_parameters (_tmp29_);
						_tmp31_ = _tmp30_;
						_tmp32_ = param_name;
						_tmp33_ = gee_multi_map_get (_tmp31_, _tmp32_);
						_tmp34_ = _tmp33_;
						_tmp35_ = gee_iterable_iterator ((GeeIterable*) _tmp34_);
						_tmp36_ = _tmp35_;
						_g_object_unref0 (_tmp34_);
						_param_val_it = _tmp36_;
						while (TRUE) {
							GeeIterator* _tmp37_;
							gboolean _tmp38_;
							gchar* param_val;
							GeeIterator* _tmp39_;
							gpointer _tmp40_;
							EVCardAttributeParam* _tmp41_;
							const gchar* _tmp42_;
							_tmp37_ = _param_val_it;
							_tmp38_ = gee_iterator_next (_tmp37_);
							if (!_tmp38_) {
								break;
							}
							_tmp39_ = _param_val_it;
							_tmp40_ = gee_iterator_get (_tmp39_);
							param_val = (gchar*) _tmp40_;
							_tmp41_ = param;
							_tmp42_ = param_val;
							e_vcard_attribute_param_add_value (_tmp41_, _tmp42_);
							_g_free0 (param_val);
						}
						_g_object_unref0 (_param_val_it);
					}
					_tmp43_ = attr;
					_tmp44_ = param;
					_tmp45_ = __vala_EVCardAttributeParam_copy0 (_tmp44_);
					e_vcard_attribute_add_param (_tmp43_, _tmp45_);
					__vala_EVCardAttributeParam_free0 (param);
					_g_free0 (param_name);
				}
				_g_object_unref0 (_param_name_it);
			}
			_tmp46_ = attr;
			attr = NULL;
			attributes = g_list_prepend (attributes, _tmp46_);
			__vala_EVCardAttribute_free0 (attr);
			_g_object_unref0 (e);
		}
		_g_object_unref0 (_e_it);
	}
	_tmp47_ = contact;
	_tmp48_ = field_id;
	_tmp49_ = attributes;
	e_contact_set_attributes (_tmp47_, _tmp48_, _tmp49_);
	__g_list_free___vala_EVCardAttribute_free0_0 (attributes);
}


static void __lambda4_ (EdsfPersonaStore* self, EVCardAttribute* attr, const gchar* value) {
	EVCardAttribute* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (attr != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = attr;
	_tmp1_ = value;
	e_vcard_attribute_add_value (_tmp0_, _tmp1_);
}


static void ___lambda4__edsf_persona_store_field_to_attribute (EVCardAttribute* attr, gconstpointer value, gpointer self) {
	__lambda4_ ((EdsfPersonaStore*) self, attr, (const gchar*) value);
}


static void _edsf_persona_store_set_contact_attributes_string (EdsfPersonaStore* self, EContact* contact, GeeSet* new_attributes, const gchar* attrib_name, EContactField field_id) {
	EContact* _tmp0_;
	GeeSet* _tmp1_;
	const gchar* _tmp2_;
	EContactField _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (new_attributes != NULL);
	g_return_if_fail (attrib_name != NULL);
	_tmp0_ = contact;
	_tmp1_ = new_attributes;
	_tmp2_ = attrib_name;
	_tmp3_ = field_id;
	_edsf_persona_store_set_contact_attributes (self, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp0_, _tmp1_, ___lambda4__edsf_persona_store_field_to_attribute, self, _tmp2_, _tmp3_);
}


static void _edsf_persona_store_set_full_name_data_free (gpointer _data) {
	EdsfPersonaStoreSetFullNameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->full_name);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetFullNameData, _data_);
}


void _edsf_persona_store_set_full_name (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetFullNameData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetFullNameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_full_name);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_full_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = full_name;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (_data_->full_name);
	_data_->full_name = _tmp4_;
	_edsf_persona_store_set_full_name_co (_data_);
}


void _edsf_persona_store_set_full_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetFullNameData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_full_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetFullNameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_full_name_co (_data_);
}


static gboolean _edsf_persona_store_set_full_name_co (EdsfPersonaStoreSetFullNameData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "full-name")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Full name is not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->full_name;
	_data_->_tmp3_ = g_strdup (_data_->_tmp2_);
	_data_->_full_name = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->full_name;
	if (g_strcmp0 (_data_->_tmp4_, "") == 0) {
		_g_free0 (_data_->_full_name);
		_data_->_full_name = NULL;
	}
	_data_->_tmp5_ = _data_->persona;
	_data_->_tmp6_ = folks_name_details_get_full_name ((FolksNameDetails*) _data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_full_name;
	if (g_strcmp0 (_data_->_tmp7_, _data_->_tmp8_) == 0) {
		_g_free0 (_data_->_full_name);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->persona;
	_data_->_tmp10_ = edsf_persona_get_contact (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = e_contact_field_id ("full_name");
	_data_->_tmp13_ = _data_->_full_name;
	e_contact_set (_data_->_tmp11_, _data_->_tmp12_, _data_->_tmp13_);
	_data_->_tmp14_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp14_, "full-name", _edsf_persona_store_set_full_name_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			_g_free0 (_data_->_full_name);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->_full_name);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_g_free0 (_data_->_full_name);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_nickname_data_free (gpointer _data) {
	EdsfPersonaStoreSetNicknameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->nickname);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetNicknameData, _data_);
}


void _edsf_persona_store_set_nickname (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetNicknameData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetNicknameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_nickname);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_nickname_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = nickname;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (_data_->nickname);
	_data_->nickname = _tmp4_;
	_edsf_persona_store_set_nickname_co (_data_);
}


void _edsf_persona_store_set_nickname_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetNicknameData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_nickname_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetNicknameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_nickname_co (_data_);
}


static gboolean _edsf_persona_store_set_nickname_co (EdsfPersonaStoreSetNicknameData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "nickname")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Nickname is not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->nickname;
	_data_->_tmp3_ = g_strdup (_data_->_tmp2_);
	_data_->_nickname = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->nickname;
	if (g_strcmp0 (_data_->_tmp4_, "") == 0) {
		_g_free0 (_data_->_nickname);
		_data_->_nickname = NULL;
	}
	_data_->_tmp5_ = _data_->persona;
	_data_->_tmp6_ = folks_name_details_get_nickname ((FolksNameDetails*) _data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_nickname;
	if (g_strcmp0 (_data_->_tmp7_, _data_->_tmp8_) == 0) {
		_g_free0 (_data_->_nickname);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->persona;
	_data_->_tmp10_ = edsf_persona_get_contact (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = e_contact_field_id ("nickname");
	_data_->_tmp13_ = _data_->_nickname;
	e_contact_set (_data_->_tmp11_, _data_->_tmp12_, _data_->_tmp13_);
	_data_->_tmp14_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp14_, "nickname", _edsf_persona_store_set_nickname_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			_g_free0 (_data_->_nickname);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->_nickname);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_g_free0 (_data_->_nickname);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_notes_data_free (gpointer _data) {
	EdsfPersonaStoreSetNotesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->notes);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetNotesData, _data_);
}


void _edsf_persona_store_set_notes (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetNotesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetNotesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_notes);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_notes_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = notes;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->notes);
	_data_->notes = _tmp4_;
	_edsf_persona_store_set_notes_co (_data_);
}


void _edsf_persona_store_set_notes_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetNotesData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_notes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetNotesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_notes_co (_data_);
}


static gboolean _edsf_persona_store_set_notes_co (EdsfPersonaStoreSetNotesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "notes")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Notes are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->notes;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_note_details_get_notes ((FolksNoteDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_internal_equal_sets (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, _data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->notes;
	_edsf_persona_store_set_contact_notes (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "notes", _edsf_persona_store_set_notes_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_contact_notes (EdsfPersonaStore* self, EContact* contact, GeeSet* notes) {
	gchar* note_str;
	gchar* _tmp0_;
	EContact* _tmp15_;
	EContactField _tmp16_;
	const gchar* _tmp17_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (notes != NULL);
	_tmp0_ = g_strdup ("");
	note_str = _tmp0_;
	{
		GeeIterator* _note_it;
		GeeSet* _tmp1_;
		GeeIterator* _tmp2_;
		_tmp1_ = notes;
		_tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_);
		_note_it = _tmp2_;
		while (TRUE) {
			GeeIterator* _tmp3_;
			gboolean _tmp4_;
			FolksNoteFieldDetails* note;
			GeeIterator* _tmp5_;
			gpointer _tmp6_;
			const gchar* _tmp7_;
			const gchar* _tmp10_;
			FolksNoteFieldDetails* _tmp11_;
			gconstpointer _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp3_ = _note_it;
			_tmp4_ = gee_iterator_next (_tmp3_);
			if (!_tmp4_) {
				break;
			}
			_tmp5_ = _note_it;
			_tmp6_ = gee_iterator_get (_tmp5_);
			note = (FolksNoteFieldDetails*) _tmp6_;
			_tmp7_ = note_str;
			if (g_strcmp0 (_tmp7_, "") != 0) {
				const gchar* _tmp8_;
				gchar* _tmp9_;
				_tmp8_ = note_str;
				_tmp9_ = g_strconcat (_tmp8_, ". ", NULL);
				_g_free0 (note_str);
				note_str = _tmp9_;
			}
			_tmp10_ = note_str;
			_tmp11_ = note;
			_tmp12_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = g_strconcat (_tmp10_, (const gchar*) _tmp13_, NULL);
			_g_free0 (note_str);
			note_str = _tmp14_;
			_g_object_unref0 (note);
		}
		_g_object_unref0 (_note_it);
	}
	_tmp15_ = contact;
	_tmp16_ = e_contact_field_id ("note");
	_tmp17_ = note_str;
	e_contact_set (_tmp15_, _tmp16_, _tmp17_);
	_g_free0 (note_str);
}


static void _edsf_persona_store_set_birthday_data_free (gpointer _data) {
	EdsfPersonaStoreSetBirthdayData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_date_time_unref0 (_data_->bday);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetBirthdayData, _data_);
}


void _edsf_persona_store_set_birthday (EdsfPersonaStore* self, EdsfPersona* persona, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetBirthdayData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetBirthdayData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_birthday);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_birthday_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = bday;
	_tmp4_ = _g_date_time_ref0 (_tmp3_);
	_g_date_time_unref0 (_data_->bday);
	_data_->bday = _tmp4_;
	_edsf_persona_store_set_birthday_co (_data_);
}


void _edsf_persona_store_set_birthday_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetBirthdayData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_birthday_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetBirthdayData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_birthday_co (_data_);
}


static gboolean _edsf_persona_store_set_birthday_co (EdsfPersonaStoreSetBirthdayData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "birthday")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Birthday is not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp4_ = _data_->persona;
	_data_->_tmp5_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp7_ = _data_->bday;
		_data_->_tmp3_ = _data_->_tmp7_ != NULL;
	} else {
		_data_->_tmp3_ = FALSE;
	}
	if (_data_->_tmp3_) {
		_data_->_tmp8_ = _data_->persona;
		_data_->_tmp9_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->bday;
		_data_->_tmp12_ = g_date_time_equal ((GDateTime*) _data_->_tmp10_, (GDateTime*) _data_->_tmp11_);
		_data_->_tmp2_ = _data_->_tmp12_;
	} else {
		_data_->_tmp2_ = FALSE;
	}
	if (_data_->_tmp2_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp14_ = _data_->persona;
	_data_->_tmp15_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _data_->_tmp14_);
	_data_->_tmp16_ = _data_->_tmp15_;
	if (_data_->_tmp16_ == NULL) {
		_data_->_tmp17_ = _data_->bday;
		_data_->_tmp13_ = _data_->_tmp17_ == NULL;
	} else {
		_data_->_tmp13_ = FALSE;
	}
	if (_data_->_tmp13_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp18_ = _data_->persona;
	_data_->_tmp19_ = edsf_persona_get_contact (_data_->_tmp18_);
	_data_->_tmp20_ = _data_->_tmp19_;
	_data_->_tmp21_ = _data_->bday;
	_edsf_persona_store_set_contact_birthday (_data_->self, _data_->_tmp20_, _data_->_tmp21_);
	_data_->_tmp22_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp22_, "birthday", _edsf_persona_store_set_birthday_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _vala_EContactDate_free (EContactDate* self) {
	g_boxed_free (e_contact_date_get_type (), self);
}


static EContactDate* _vala_EContactDate_copy (EContactDate* self) {
	return g_boxed_copy (e_contact_date_get_type (), self);
}


static gpointer __vala_EContactDate_copy0 (gpointer self) {
	return self ? _vala_EContactDate_copy (self) : NULL;
}


static void _edsf_persona_store_set_contact_birthday (EdsfPersonaStore* self, EContact* contact, GDateTime* _bday) {
	EContactDate* _contact_bday;
	GDateTime* _tmp0_;
	EContact* _tmp17_;
	EContactField _tmp18_;
	EContactDate* _tmp19_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	_contact_bday = NULL;
	_tmp0_ = _bday;
	if (_tmp0_ != NULL) {
		GDateTime* bday;
		GDateTime* _tmp1_;
		GDateTime* _tmp2_;
		GDateTime* bdaylocal;
		GDateTime* _tmp3_;
		GDateTime* _tmp4_;
		EContactDate* contact_bday = NULL;
		EContactDate* _tmp5_;
		EContactDate* _tmp6_;
		GDateTime* _tmp7_;
		gint _tmp8_;
		EContactDate* _tmp9_;
		GDateTime* _tmp10_;
		gint _tmp11_;
		EContactDate* _tmp12_;
		GDateTime* _tmp13_;
		gint _tmp14_;
		EContactDate* _tmp15_;
		EContactDate* _tmp16_;
		_tmp1_ = _bday;
		_tmp2_ = _g_date_time_ref0 ((GDateTime*) _tmp1_);
		bday = _tmp2_;
		_tmp3_ = bday;
		_tmp4_ = g_date_time_to_local (_tmp3_);
		bdaylocal = _tmp4_;
		_tmp5_ = e_contact_date_new ();
		__vala_EContactDate_free0 (contact_bday);
		contact_bday = _tmp5_;
		_tmp6_ = contact_bday;
		_tmp7_ = bdaylocal;
		_tmp8_ = g_date_time_get_year (_tmp7_);
		_tmp6_->year = (guint) _tmp8_;
		_tmp9_ = contact_bday;
		_tmp10_ = bdaylocal;
		_tmp11_ = g_date_time_get_month (_tmp10_);
		_tmp9_->month = (guint) _tmp11_;
		_tmp12_ = contact_bday;
		_tmp13_ = bdaylocal;
		_tmp14_ = g_date_time_get_day_of_month (_tmp13_);
		_tmp12_->day = (guint) _tmp14_;
		_tmp15_ = contact_bday;
		_tmp16_ = __vala_EContactDate_copy0 (_tmp15_);
		__vala_EContactDate_free0 (_contact_bday);
		_contact_bday = _tmp16_;
		__vala_EContactDate_free0 (contact_bday);
		_g_date_time_unref0 (bdaylocal);
		_g_date_time_unref0 (bday);
	}
	_tmp17_ = contact;
	_tmp18_ = e_contact_field_id ("birth_date");
	_tmp19_ = _contact_bday;
	e_contact_set (_tmp17_, _tmp18_, _tmp19_);
	__vala_EContactDate_free0 (_contact_bday);
}


static void _edsf_persona_store_set_roles_data_free (gpointer _data) {
	EdsfPersonaStoreSetRolesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->roles);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetRolesData, _data_);
}


void _edsf_persona_store_set_roles (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetRolesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetRolesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_roles);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_roles_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = roles;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->roles);
	_data_->roles = _tmp4_;
	_edsf_persona_store_set_roles_co (_data_);
}


void _edsf_persona_store_set_roles_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetRolesData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_roles_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetRolesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_roles_co (_data_);
}


static gboolean _edsf_persona_store_set_roles_co (EdsfPersonaStoreSetRolesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "roles")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Roles are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->roles;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_role_details_get_roles ((FolksRoleDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_internal_equal_sets (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, _data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->roles;
	_edsf_persona_store_set_contact_roles (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "roles", _edsf_persona_store_set_roles_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_contact_roles (EdsfPersonaStore* self, EContact* contact, GeeSet* roles) {
	EVCard* vcard;
	EContact* _tmp0_;
	EVCard* _tmp1_;
	EVCard* _tmp2_;
	gchar* org;
	gchar* org_unit;
	gchar* office;
	gchar* title;
	gchar* role;
	gchar* manager;
	gchar* assistant;
	gint count;
	EContact* _tmp143_;
	EContactField _tmp144_;
	const gchar* _tmp145_;
	EContact* _tmp146_;
	EContactField _tmp147_;
	const gchar* _tmp148_;
	EContact* _tmp149_;
	EContactField _tmp150_;
	const gchar* _tmp151_;
	EContact* _tmp152_;
	EContactField _tmp153_;
	const gchar* _tmp154_;
	EContact* _tmp155_;
	EContactField _tmp156_;
	const gchar* _tmp157_;
	EContact* _tmp158_;
	EContactField _tmp159_;
	const gchar* _tmp160_;
	EContact* _tmp161_;
	EContactField _tmp162_;
	const gchar* _tmp163_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (roles != NULL);
	_tmp0_ = contact;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, e_vcard_get_type (), EVCard));
	vcard = _tmp1_;
	_tmp2_ = vcard;
	e_vcard_remove_attributes (_tmp2_, NULL, "X-ROLES");
	org = NULL;
	org_unit = NULL;
	office = NULL;
	title = NULL;
	role = NULL;
	manager = NULL;
	assistant = NULL;
	count = 0;
	{
		GeeIterator* _role_fd_it;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp3_ = roles;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_role_fd_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			gboolean _tmp6_;
			FolksRoleFieldDetails* role_fd;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			gint _tmp9_;
			gint _tmp142_;
			_tmp5_ = _role_fd_it;
			_tmp6_ = gee_iterator_next (_tmp5_);
			if (!_tmp6_) {
				break;
			}
			_tmp7_ = _role_fd_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			role_fd = (FolksRoleFieldDetails*) _tmp8_;
			_tmp9_ = count;
			if (_tmp9_ == 0) {
				FolksRoleFieldDetails* _tmp10_;
				gconstpointer _tmp11_;
				FolksRole* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				FolksRoleFieldDetails* _tmp16_;
				gconstpointer _tmp17_;
				FolksRole* _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				gchar* _tmp21_;
				FolksRoleFieldDetails* _tmp22_;
				gconstpointer _tmp23_;
				FolksRole* _tmp24_;
				const gchar* _tmp25_;
				const gchar* _tmp26_;
				gchar* _tmp27_;
				GeeCollection* org_unit_values;
				FolksRoleFieldDetails* _tmp28_;
				GeeCollection* _tmp29_;
				gboolean _tmp30_ = FALSE;
				GeeCollection* _tmp31_;
				GeeCollection* office_values;
				FolksRoleFieldDetails* _tmp41_;
				GeeCollection* _tmp42_;
				gboolean _tmp43_ = FALSE;
				GeeCollection* _tmp44_;
				GeeCollection* manager_values;
				FolksRoleFieldDetails* _tmp54_;
				GeeCollection* _tmp55_;
				gboolean _tmp56_ = FALSE;
				GeeCollection* _tmp57_;
				GeeCollection* assistant_values;
				FolksRoleFieldDetails* _tmp67_;
				GeeCollection* _tmp68_;
				gboolean _tmp69_ = FALSE;
				GeeCollection* _tmp70_;
				_tmp10_ = role_fd;
				_tmp11_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = folks_role_get_organisation_name ((FolksRole*) _tmp12_);
				_tmp14_ = _tmp13_;
				_tmp15_ = g_strdup (_tmp14_);
				_g_free0 (org);
				org = _tmp15_;
				_tmp16_ = role_fd;
				_tmp17_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = folks_role_get_title ((FolksRole*) _tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = g_strdup (_tmp20_);
				_g_free0 (title);
				title = _tmp21_;
				_tmp22_ = role_fd;
				_tmp23_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp22_);
				_tmp24_ = _tmp23_;
				_tmp25_ = folks_role_get_role ((FolksRole*) _tmp24_);
				_tmp26_ = _tmp25_;
				_tmp27_ = g_strdup (_tmp26_);
				_g_free0 (role);
				role = _tmp27_;
				_tmp28_ = role_fd;
				_tmp29_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _tmp28_, "org_unit");
				org_unit_values = _tmp29_;
				_tmp31_ = org_unit_values;
				if (_tmp31_ != NULL) {
					GeeCollection* _tmp32_;
					gint _tmp33_;
					gint _tmp34_;
					_tmp32_ = org_unit_values;
					_tmp33_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_TYPE_COLLECTION, GeeCollection));
					_tmp34_ = _tmp33_;
					_tmp30_ = _tmp34_ > 0;
				} else {
					_tmp30_ = FALSE;
				}
				if (_tmp30_) {
					GeeCollection* _tmp35_;
					gint _tmp36_;
					gpointer* _tmp37_;
					gchar** _tmp38_;
					gint _tmp38__length1;
					const gchar* _tmp39_;
					gchar* _tmp40_;
					_tmp35_ = org_unit_values;
					_tmp37_ = gee_collection_to_array (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, GEE_TYPE_COLLECTION, GeeCollection), &_tmp36_);
					_tmp38_ = _tmp37_;
					_tmp38__length1 = _tmp36_;
					_tmp39_ = _tmp38_[0];
					_tmp40_ = g_strdup (_tmp39_);
					_g_free0 (org_unit);
					org_unit = _tmp40_;
					_tmp38_ = (_vala_array_free (_tmp38_, _tmp38__length1, (GDestroyNotify) g_free), NULL);
				}
				_tmp41_ = role_fd;
				_tmp42_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _tmp41_, "office");
				office_values = _tmp42_;
				_tmp44_ = office_values;
				if (_tmp44_ != NULL) {
					GeeCollection* _tmp45_;
					gint _tmp46_;
					gint _tmp47_;
					_tmp45_ = office_values;
					_tmp46_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, GEE_TYPE_COLLECTION, GeeCollection));
					_tmp47_ = _tmp46_;
					_tmp43_ = _tmp47_ > 0;
				} else {
					_tmp43_ = FALSE;
				}
				if (_tmp43_) {
					GeeCollection* _tmp48_;
					gint _tmp49_;
					gpointer* _tmp50_;
					gchar** _tmp51_;
					gint _tmp51__length1;
					const gchar* _tmp52_;
					gchar* _tmp53_;
					_tmp48_ = office_values;
					_tmp50_ = gee_collection_to_array (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, GEE_TYPE_COLLECTION, GeeCollection), &_tmp49_);
					_tmp51_ = _tmp50_;
					_tmp51__length1 = _tmp49_;
					_tmp52_ = _tmp51_[0];
					_tmp53_ = g_strdup (_tmp52_);
					_g_free0 (office);
					office = _tmp53_;
					_tmp51_ = (_vala_array_free (_tmp51_, _tmp51__length1, (GDestroyNotify) g_free), NULL);
				}
				_tmp54_ = role_fd;
				_tmp55_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _tmp54_, "manager");
				manager_values = _tmp55_;
				_tmp57_ = manager_values;
				if (_tmp57_ != NULL) {
					GeeCollection* _tmp58_;
					gint _tmp59_;
					gint _tmp60_;
					_tmp58_ = manager_values;
					_tmp59_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, GEE_TYPE_COLLECTION, GeeCollection));
					_tmp60_ = _tmp59_;
					_tmp56_ = _tmp60_ > 0;
				} else {
					_tmp56_ = FALSE;
				}
				if (_tmp56_) {
					GeeCollection* _tmp61_;
					gint _tmp62_;
					gpointer* _tmp63_;
					gchar** _tmp64_;
					gint _tmp64__length1;
					const gchar* _tmp65_;
					gchar* _tmp66_;
					_tmp61_ = manager_values;
					_tmp63_ = gee_collection_to_array (G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, GEE_TYPE_COLLECTION, GeeCollection), &_tmp62_);
					_tmp64_ = _tmp63_;
					_tmp64__length1 = _tmp62_;
					_tmp65_ = _tmp64_[0];
					_tmp66_ = g_strdup (_tmp65_);
					_g_free0 (manager);
					manager = _tmp66_;
					_tmp64_ = (_vala_array_free (_tmp64_, _tmp64__length1, (GDestroyNotify) g_free), NULL);
				}
				_tmp67_ = role_fd;
				_tmp68_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _tmp67_, "assistant");
				assistant_values = _tmp68_;
				_tmp70_ = assistant_values;
				if (_tmp70_ != NULL) {
					GeeCollection* _tmp71_;
					gint _tmp72_;
					gint _tmp73_;
					_tmp71_ = assistant_values;
					_tmp72_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, GEE_TYPE_COLLECTION, GeeCollection));
					_tmp73_ = _tmp72_;
					_tmp69_ = _tmp73_ > 0;
				} else {
					_tmp69_ = FALSE;
				}
				if (_tmp69_) {
					GeeCollection* _tmp74_;
					gint _tmp75_;
					gpointer* _tmp76_;
					gchar** _tmp77_;
					gint _tmp77__length1;
					const gchar* _tmp78_;
					gchar* _tmp79_;
					_tmp74_ = assistant_values;
					_tmp76_ = gee_collection_to_array (G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, GEE_TYPE_COLLECTION, GeeCollection), &_tmp75_);
					_tmp77_ = _tmp76_;
					_tmp77__length1 = _tmp75_;
					_tmp78_ = _tmp77_[0];
					_tmp79_ = g_strdup (_tmp78_);
					_g_free0 (assistant);
					assistant = _tmp79_;
					_tmp77_ = (_vala_array_free (_tmp77_, _tmp77__length1, (GDestroyNotify) g_free), NULL);
				}
				_g_object_unref0 (assistant_values);
				_g_object_unref0 (manager_values);
				_g_object_unref0 (office_values);
				_g_object_unref0 (org_unit_values);
			} else {
				EVCardAttribute* attr;
				EVCardAttribute* _tmp80_;
				EVCardAttribute* _tmp81_;
				FolksRoleFieldDetails* _tmp82_;
				gconstpointer _tmp83_;
				FolksRole* _tmp84_;
				const gchar* _tmp85_;
				const gchar* _tmp86_;
				EVCardAttributeParam* param1;
				EVCardAttributeParam* _tmp87_;
				EVCardAttributeParam* _tmp88_;
				FolksRoleFieldDetails* _tmp89_;
				gconstpointer _tmp90_;
				FolksRole* _tmp91_;
				const gchar* _tmp92_;
				const gchar* _tmp93_;
				EVCardAttribute* _tmp94_;
				EVCardAttributeParam* _tmp95_;
				EVCardAttributeParam* _tmp96_;
				EVCardAttributeParam* param2;
				EVCardAttributeParam* _tmp97_;
				EVCardAttributeParam* _tmp98_;
				FolksRoleFieldDetails* _tmp99_;
				gconstpointer _tmp100_;
				FolksRole* _tmp101_;
				const gchar* _tmp102_;
				const gchar* _tmp103_;
				EVCardAttribute* _tmp104_;
				EVCardAttributeParam* _tmp105_;
				EVCardAttributeParam* _tmp106_;
				EContact* _tmp140_;
				EVCardAttribute* _tmp141_;
				_tmp80_ = e_vcard_attribute_new (NULL, "X-ROLES");
				attr = _tmp80_;
				_tmp81_ = attr;
				_tmp82_ = role_fd;
				_tmp83_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp82_);
				_tmp84_ = _tmp83_;
				_tmp85_ = folks_role_get_role ((FolksRole*) _tmp84_);
				_tmp86_ = _tmp85_;
				e_vcard_attribute_add_value (_tmp81_, _tmp86_);
				_tmp87_ = e_vcard_attribute_param_new ("organisation_name");
				param1 = _tmp87_;
				_tmp88_ = param1;
				_tmp89_ = role_fd;
				_tmp90_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp89_);
				_tmp91_ = _tmp90_;
				_tmp92_ = folks_role_get_organisation_name ((FolksRole*) _tmp91_);
				_tmp93_ = _tmp92_;
				e_vcard_attribute_param_add_value (_tmp88_, _tmp93_);
				_tmp94_ = attr;
				_tmp95_ = param1;
				_tmp96_ = __vala_EVCardAttributeParam_copy0 (_tmp95_);
				e_vcard_attribute_add_param (_tmp94_, _tmp96_);
				_tmp97_ = e_vcard_attribute_param_new ("title");
				param2 = _tmp97_;
				_tmp98_ = param2;
				_tmp99_ = role_fd;
				_tmp100_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp99_);
				_tmp101_ = _tmp100_;
				_tmp102_ = folks_role_get_title ((FolksRole*) _tmp101_);
				_tmp103_ = _tmp102_;
				e_vcard_attribute_param_add_value (_tmp98_, _tmp103_);
				_tmp104_ = attr;
				_tmp105_ = param2;
				_tmp106_ = __vala_EVCardAttributeParam_copy0 (_tmp105_);
				e_vcard_attribute_add_param (_tmp104_, _tmp106_);
				{
					GeeIterator* _param_name_it;
					FolksRoleFieldDetails* _tmp107_;
					GeeMultiMap* _tmp108_;
					GeeMultiMap* _tmp109_;
					GeeSet* _tmp110_;
					GeeSet* _tmp111_;
					GeeIterator* _tmp112_;
					GeeIterator* _tmp113_;
					_tmp107_ = role_fd;
					_tmp108_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _tmp107_);
					_tmp109_ = _tmp108_;
					_tmp110_ = gee_multi_map_get_keys (_tmp109_);
					_tmp111_ = _tmp110_;
					_tmp112_ = gee_iterable_iterator ((GeeIterable*) _tmp111_);
					_tmp113_ = _tmp112_;
					_g_object_unref0 (_tmp111_);
					_param_name_it = _tmp113_;
					while (TRUE) {
						GeeIterator* _tmp114_;
						gboolean _tmp115_;
						gchar* param_name;
						GeeIterator* _tmp116_;
						gpointer _tmp117_;
						EVCardAttributeParam* param3;
						const gchar* _tmp118_;
						gchar* _tmp119_;
						gchar* _tmp120_;
						EVCardAttributeParam* _tmp121_;
						EVCardAttributeParam* _tmp122_;
						EVCardAttribute* _tmp137_;
						EVCardAttributeParam* _tmp138_;
						EVCardAttributeParam* _tmp139_;
						_tmp114_ = _param_name_it;
						_tmp115_ = gee_iterator_next (_tmp114_);
						if (!_tmp115_) {
							break;
						}
						_tmp116_ = _param_name_it;
						_tmp117_ = gee_iterator_get (_tmp116_);
						param_name = (gchar*) _tmp117_;
						_tmp118_ = param_name;
						_tmp119_ = g_utf8_strup (_tmp118_, (gssize) -1);
						_tmp120_ = _tmp119_;
						_tmp121_ = e_vcard_attribute_param_new (_tmp120_);
						_tmp122_ = _tmp121_;
						_g_free0 (_tmp120_);
						param3 = _tmp122_;
						{
							GeeIterator* _param_val_it;
							FolksRoleFieldDetails* _tmp123_;
							GeeMultiMap* _tmp124_;
							GeeMultiMap* _tmp125_;
							const gchar* _tmp126_;
							GeeCollection* _tmp127_;
							GeeCollection* _tmp128_;
							GeeIterator* _tmp129_;
							GeeIterator* _tmp130_;
							_tmp123_ = role_fd;
							_tmp124_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _tmp123_);
							_tmp125_ = _tmp124_;
							_tmp126_ = param_name;
							_tmp127_ = gee_multi_map_get (_tmp125_, _tmp126_);
							_tmp128_ = _tmp127_;
							_tmp129_ = gee_iterable_iterator ((GeeIterable*) _tmp128_);
							_tmp130_ = _tmp129_;
							_g_object_unref0 (_tmp128_);
							_param_val_it = _tmp130_;
							while (TRUE) {
								GeeIterator* _tmp131_;
								gboolean _tmp132_;
								gchar* param_val;
								GeeIterator* _tmp133_;
								gpointer _tmp134_;
								EVCardAttributeParam* _tmp135_;
								const gchar* _tmp136_;
								_tmp131_ = _param_val_it;
								_tmp132_ = gee_iterator_next (_tmp131_);
								if (!_tmp132_) {
									break;
								}
								_tmp133_ = _param_val_it;
								_tmp134_ = gee_iterator_get (_tmp133_);
								param_val = (gchar*) _tmp134_;
								_tmp135_ = param3;
								_tmp136_ = param_val;
								e_vcard_attribute_param_add_value (_tmp135_, _tmp136_);
								_g_free0 (param_val);
							}
							_g_object_unref0 (_param_val_it);
						}
						_tmp137_ = attr;
						_tmp138_ = param3;
						_tmp139_ = __vala_EVCardAttributeParam_copy0 (_tmp138_);
						e_vcard_attribute_add_param (_tmp137_, _tmp139_);
						__vala_EVCardAttributeParam_free0 (param3);
						_g_free0 (param_name);
					}
					_g_object_unref0 (_param_name_it);
				}
				_tmp140_ = contact;
				_tmp141_ = attr;
				attr = NULL;
				e_vcard_add_attribute ((EVCard*) _tmp140_, _tmp141_);
				__vala_EVCardAttributeParam_free0 (param2);
				__vala_EVCardAttributeParam_free0 (param1);
				__vala_EVCardAttribute_free0 (attr);
			}
			_tmp142_ = count;
			count = _tmp142_ + 1;
			_g_object_unref0 (role_fd);
		}
		_g_object_unref0 (_role_fd_it);
	}
	_tmp143_ = contact;
	_tmp144_ = e_contact_field_id ("org");
	_tmp145_ = org;
	e_contact_set (_tmp143_, _tmp144_, _tmp145_);
	_tmp146_ = contact;
	_tmp147_ = e_contact_field_id ("org_unit");
	_tmp148_ = org_unit;
	e_contact_set (_tmp146_, _tmp147_, _tmp148_);
	_tmp149_ = contact;
	_tmp150_ = e_contact_field_id ("office");
	_tmp151_ = office;
	e_contact_set (_tmp149_, _tmp150_, _tmp151_);
	_tmp152_ = contact;
	_tmp153_ = e_contact_field_id ("title");
	_tmp154_ = title;
	e_contact_set (_tmp152_, _tmp153_, _tmp154_);
	_tmp155_ = contact;
	_tmp156_ = e_contact_field_id ("role");
	_tmp157_ = role;
	e_contact_set (_tmp155_, _tmp156_, _tmp157_);
	_tmp158_ = contact;
	_tmp159_ = e_contact_field_id ("manager");
	_tmp160_ = manager;
	e_contact_set (_tmp158_, _tmp159_, _tmp160_);
	_tmp161_ = contact;
	_tmp162_ = e_contact_field_id ("assistant");
	_tmp163_ = assistant;
	e_contact_set (_tmp161_, _tmp162_, _tmp163_);
	_g_free0 (assistant);
	_g_free0 (manager);
	_g_free0 (role);
	_g_free0 (title);
	_g_free0 (office);
	_g_free0 (org_unit);
	_g_free0 (org);
	_g_object_unref0 (vcard);
}


static void _edsf_persona_store_set_structured_name_data_free (gpointer _data) {
	EdsfPersonaStoreSetStructuredNameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->sname);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetStructuredNameData, _data_);
}


void _edsf_persona_store_set_structured_name (EdsfPersonaStore* self, EdsfPersona* persona, FolksStructuredName* sname, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetStructuredNameData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	FolksStructuredName* _tmp3_;
	FolksStructuredName* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetStructuredNameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_structured_name);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_structured_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = sname;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->sname);
	_data_->sname = _tmp4_;
	_edsf_persona_store_set_structured_name_co (_data_);
}


void _edsf_persona_store_set_structured_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetStructuredNameData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_structured_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetStructuredNameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_structured_name_co (_data_);
}


static gboolean _edsf_persona_store_set_structured_name_co (EdsfPersonaStoreSetStructuredNameData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "structured-name")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Structured name is not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp4_ = _data_->persona;
	_data_->_tmp5_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp7_ = _data_->sname;
		_data_->_tmp3_ = _data_->_tmp7_ != NULL;
	} else {
		_data_->_tmp3_ = FALSE;
	}
	if (_data_->_tmp3_) {
		_data_->_tmp8_ = _data_->persona;
		_data_->_tmp9_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->sname;
		_data_->_tmp12_ = folks_structured_name_equal (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, FOLKS_TYPE_STRUCTURED_NAME, FolksStructuredName), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, FOLKS_TYPE_STRUCTURED_NAME, FolksStructuredName));
		_data_->_tmp2_ = _data_->_tmp12_;
	} else {
		_data_->_tmp2_ = FALSE;
	}
	if (_data_->_tmp2_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp14_ = _data_->persona;
	_data_->_tmp15_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp14_);
	_data_->_tmp16_ = _data_->_tmp15_;
	if (_data_->_tmp16_ == NULL) {
		_data_->_tmp17_ = _data_->sname;
		_data_->_tmp13_ = _data_->_tmp17_ == NULL;
	} else {
		_data_->_tmp13_ = FALSE;
	}
	if (_data_->_tmp13_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp18_ = _data_->persona;
	_data_->_tmp19_ = edsf_persona_get_contact (_data_->_tmp18_);
	_data_->_tmp20_ = _data_->_tmp19_;
	_data_->_tmp21_ = _data_->sname;
	_edsf_persona_store_set_contact_name (_data_->self, _data_->_tmp20_, _data_->_tmp21_);
	_data_->_tmp22_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp22_, "structured-name", _edsf_persona_store_set_structured_name_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _vala_EContactName_free (EContactName* self) {
	g_boxed_free (e_contact_name_get_type (), self);
}


static void _edsf_persona_store_set_contact_name (EdsfPersonaStore* self, EContact* contact, FolksStructuredName* _sname) {
	EContactName* contact_name;
	EContactName* _tmp0_;
	FolksStructuredName* _tmp1_;
	EContact* _tmp29_;
	EContactField _tmp30_;
	EContactName* _tmp31_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	_tmp0_ = e_contact_name_new ();
	contact_name = _tmp0_;
	_tmp1_ = _sname;
	if (_tmp1_ != NULL) {
		FolksStructuredName* sname;
		FolksStructuredName* _tmp2_;
		FolksStructuredName* _tmp3_;
		EContactName* _tmp4_;
		FolksStructuredName* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		EContactName* _tmp9_;
		FolksStructuredName* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		EContactName* _tmp14_;
		FolksStructuredName* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		gchar* _tmp18_;
		EContactName* _tmp19_;
		FolksStructuredName* _tmp20_;
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		gchar* _tmp23_;
		EContactName* _tmp24_;
		FolksStructuredName* _tmp25_;
		const gchar* _tmp26_;
		const gchar* _tmp27_;
		gchar* _tmp28_;
		_tmp2_ = _sname;
		_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, FOLKS_TYPE_STRUCTURED_NAME, FolksStructuredName));
		sname = _tmp3_;
		_tmp4_ = contact_name;
		_tmp5_ = sname;
		_tmp6_ = folks_structured_name_get_family_name (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_strdup (_tmp7_);
		_g_free0 (_tmp4_->family);
		_tmp4_->family = _tmp8_;
		_tmp9_ = contact_name;
		_tmp10_ = sname;
		_tmp11_ = folks_structured_name_get_given_name (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_strdup (_tmp12_);
		_g_free0 (_tmp9_->given);
		_tmp9_->given = _tmp13_;
		_tmp14_ = contact_name;
		_tmp15_ = sname;
		_tmp16_ = folks_structured_name_get_additional_names (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = g_strdup (_tmp17_);
		_g_free0 (_tmp14_->additional);
		_tmp14_->additional = _tmp18_;
		_tmp19_ = contact_name;
		_tmp20_ = sname;
		_tmp21_ = folks_structured_name_get_suffixes (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = g_strdup (_tmp22_);
		_g_free0 (_tmp19_->suffixes);
		_tmp19_->suffixes = _tmp23_;
		_tmp24_ = contact_name;
		_tmp25_ = sname;
		_tmp26_ = folks_structured_name_get_prefixes (_tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = g_strdup (_tmp27_);
		_g_free0 (_tmp24_->prefixes);
		_tmp24_->prefixes = _tmp28_;
		_g_object_unref0 (sname);
	}
	_tmp29_ = contact;
	_tmp30_ = e_contact_field_id ("name");
	_tmp31_ = contact_name;
	e_contact_set (_tmp29_, _tmp30_, _tmp31_);
	__vala_EContactName_free0 (contact_name);
}


static void _edsf_persona_store_set_im_fds_data_free (gpointer _data) {
	EdsfPersonaStoreSetImFdsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->im_fds);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetImFdsData, _data_);
}


void _edsf_persona_store_set_im_fds (EdsfPersonaStore* self, EdsfPersona* persona, GeeMultiMap* im_fds, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetImFdsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeMultiMap* _tmp3_;
	GeeMultiMap* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetImFdsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_im_fds);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_im_fds_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = im_fds;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->im_fds);
	_data_->im_fds = _tmp4_;
	_edsf_persona_store_set_im_fds_co (_data_);
}


void _edsf_persona_store_set_im_fds_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetImFdsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_im_fds_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetImFdsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_im_fds_co (_data_);
}


static gboolean _edsf_persona_store_set_im_fds_co (EdsfPersonaStoreSetImFdsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "im-addresses")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("IM addresses are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->persona;
	_data_->_tmp3_ = folks_im_details_get_im_addresses ((FolksImDetails*) _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->im_fds;
	_data_->_tmp6_ = folks_utils_multi_map_str_afd_equal (_data_->_tmp4_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->im_fds;
	_edsf_persona_store_set_contact_im_fds (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "im-addresses", _edsf_persona_store_set_im_fds_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_contact_im_fds (EdsfPersonaStore* self, EContact* contact, GeeMultiMap* im_fds) {
	GHashTable* im_eds_map;
	GHashTable* _tmp0_;
	GHashTable* _tmp1_;
	GList* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (im_fds != NULL);
	_tmp0_ = _edsf_persona_get_im_eds_map ();
	im_eds_map = _tmp0_;
	_tmp1_ = im_eds_map;
	_tmp2_ = g_hash_table_get_values (_tmp1_);
	{
		GList* field_id_collection = NULL;
		GList* field_id_it = NULL;
		field_id_collection = _tmp2_;
		for (field_id_it = field_id_collection; field_id_it != NULL; field_id_it = field_id_it->next) {
			EContactField field_id = 0;
			field_id = (EContactField) ((gintptr) field_id_it->data);
			{
				EContact* _tmp3_;
				EContactField _tmp4_;
				const gchar* _tmp5_;
				_tmp3_ = contact;
				_tmp4_ = field_id;
				_tmp5_ = e_contact_vcard_attribute (_tmp4_);
				e_vcard_remove_attributes ((EVCard*) _tmp3_, NULL, _tmp5_);
			}
		}
		_g_list_free0 (field_id_collection);
	}
	{
		GeeIterator* _proto_it;
		GeeMultiMap* _tmp6_;
		GeeSet* _tmp7_;
		GeeSet* _tmp8_;
		GeeIterator* _tmp9_;
		GeeIterator* _tmp10_;
		_tmp6_ = im_fds;
		_tmp7_ = gee_multi_map_get_keys (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_);
		_tmp10_ = _tmp9_;
		_g_object_unref0 (_tmp8_);
		_proto_it = _tmp10_;
		while (TRUE) {
			GeeIterator* _tmp11_;
			gboolean _tmp12_;
			gchar* proto;
			GeeIterator* _tmp13_;
			gpointer _tmp14_;
			GList* attributes;
			gchar* attrib_name;
			const gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			gboolean added;
			gboolean _tmp37_;
			_tmp11_ = _proto_it;
			_tmp12_ = gee_iterator_next (_tmp11_);
			if (!_tmp12_) {
				break;
			}
			_tmp13_ = _proto_it;
			_tmp14_ = gee_iterator_get (_tmp13_);
			proto = (gchar*) _tmp14_;
			attributes = NULL;
			_tmp15_ = proto;
			_tmp16_ = g_strconcat ("X-", _tmp15_, NULL);
			_tmp17_ = _tmp16_;
			_tmp18_ = g_utf8_strup (_tmp17_, (gssize) -1);
			_tmp19_ = _tmp18_;
			_g_free0 (_tmp17_);
			attrib_name = _tmp19_;
			added = FALSE;
			{
				GeeIterator* _im_fd_it;
				GeeMultiMap* _tmp20_;
				const gchar* _tmp21_;
				GeeCollection* _tmp22_;
				GeeCollection* _tmp23_;
				GeeIterator* _tmp24_;
				GeeIterator* _tmp25_;
				_tmp20_ = im_fds;
				_tmp21_ = proto;
				_tmp22_ = gee_multi_map_get (_tmp20_, _tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = gee_iterable_iterator ((GeeIterable*) _tmp23_);
				_tmp25_ = _tmp24_;
				_g_object_unref0 (_tmp23_);
				_im_fd_it = _tmp25_;
				while (TRUE) {
					GeeIterator* _tmp26_;
					gboolean _tmp27_;
					FolksImFieldDetails* im_fd;
					GeeIterator* _tmp28_;
					gpointer _tmp29_;
					EVCardAttribute* attr_n;
					const gchar* _tmp30_;
					EVCardAttribute* _tmp31_;
					EVCardAttribute* _tmp32_;
					FolksImFieldDetails* _tmp33_;
					gconstpointer _tmp34_;
					const gchar* _tmp35_;
					EVCardAttribute* _tmp36_;
					_tmp26_ = _im_fd_it;
					_tmp27_ = gee_iterator_next (_tmp26_);
					if (!_tmp27_) {
						break;
					}
					_tmp28_ = _im_fd_it;
					_tmp29_ = gee_iterator_get (_tmp28_);
					im_fd = (FolksImFieldDetails*) _tmp29_;
					_tmp30_ = attrib_name;
					_tmp31_ = e_vcard_attribute_new (NULL, _tmp30_);
					attr_n = _tmp31_;
					_tmp32_ = attr_n;
					_tmp33_ = im_fd;
					_tmp34_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp33_);
					_tmp35_ = _tmp34_;
					e_vcard_attribute_add_value (_tmp32_, (const gchar*) _tmp35_);
					_tmp36_ = attr_n;
					attr_n = NULL;
					attributes = g_list_prepend (attributes, _tmp36_);
					added = TRUE;
					__vala_EVCardAttribute_free0 (attr_n);
					_g_object_unref0 (im_fd);
				}
				_g_object_unref0 (_im_fd_it);
			}
			_tmp37_ = added;
			if (_tmp37_) {
				EContactField field_id_t;
				GHashTable* _tmp38_;
				const gchar* _tmp39_;
				gconstpointer _tmp40_;
				EContact* _tmp41_;
				EContactField _tmp42_;
				GList* _tmp43_;
				_tmp38_ = im_eds_map;
				_tmp39_ = proto;
				_tmp40_ = g_hash_table_lookup (_tmp38_, _tmp39_);
				field_id_t = (EContactField) ((gintptr) _tmp40_);
				_tmp41_ = contact;
				_tmp42_ = field_id_t;
				_tmp43_ = attributes;
				e_contact_set_attributes (_tmp41_, _tmp42_, _tmp43_);
			}
			_g_free0 (attrib_name);
			__g_list_free___vala_EVCardAttribute_free0_0 (attributes);
			_g_free0 (proto);
		}
		_g_object_unref0 (_proto_it);
	}
	_g_hash_table_unref0 (im_eds_map);
}


static void _edsf_persona_store_set_groups_data_free (gpointer _data) {
	EdsfPersonaStoreSetGroupsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->groups);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetGroupsData, _data_);
}


void _edsf_persona_store_set_groups (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetGroupsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetGroupsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_groups);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_groups_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = groups;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->groups);
	_data_->groups = _tmp4_;
	_edsf_persona_store_set_groups_co (_data_);
}


void _edsf_persona_store_set_groups_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetGroupsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetGroupsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_groups_co (_data_);
}


static gboolean _edsf_persona_store_set_groups_co (EdsfPersonaStoreSetGroupsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "groups")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Groups are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->groups;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_group_details_get_groups ((FolksGroupDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_internal_equal_sets (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->groups;
	_data_->_tmp11_ = _data_->persona;
	_data_->_tmp12_ = folks_favourite_details_get_is_favourite ((FolksFavouriteDetails*) _data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_edsf_persona_store_set_contact_groups (_data_->self, _data_->_tmp9_, _data_->_tmp10_, _data_->_tmp13_);
	_data_->_tmp14_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp14_, "groups", _edsf_persona_store_set_groups_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_system_groups_data_free (gpointer _data) {
	EdsfPersonaStoreSetSystemGroupsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->system_groups);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetSystemGroupsData, _data_);
}


void _edsf_persona_store_set_system_groups (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* system_groups, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetSystemGroupsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetSystemGroupsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_system_groups);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_system_groups_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = system_groups;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->system_groups);
	_data_->system_groups = _tmp4_;
	_edsf_persona_store_set_system_groups_co (_data_);
}


void _edsf_persona_store_set_system_groups_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetSystemGroupsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_system_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetSystemGroupsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_system_groups_co (_data_);
}


static gboolean _edsf_persona_store_set_system_groups_co (EdsfPersonaStoreSetSystemGroupsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _edsf_persona_store_is_google_contacts_address_book (_data_->self);
	if (!_data_->_tmp0_) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("My Contacts is only available for Google Contacts"));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->system_groups;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_system_groups (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_internal_equal_sets (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->system_groups;
	_edsf_persona_store_set_contact_system_groups (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "system-groups", _edsf_persona_store_set_system_groups_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static void _g_list_free__g_free0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_free0_, NULL);
	g_list_free (self);
}


static void _edsf_persona_store_set_contact_groups (EdsfPersonaStore* self, EContact* contact, GeeSet* groups, gboolean is_favourite) {
	GList* categories;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_;
	EContact* _tmp16_;
	GList* _tmp17_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (groups != NULL);
	categories = NULL;
	{
		GeeIterator* _group_it;
		GeeSet* _tmp0_;
		GeeIterator* _tmp1_;
		_tmp0_ = groups;
		_tmp1_ = gee_iterable_iterator ((GeeIterable*) _tmp0_);
		_group_it = _tmp1_;
		while (TRUE) {
			GeeIterator* _tmp2_;
			gboolean _tmp3_;
			gchar* group;
			GeeIterator* _tmp4_;
			gpointer _tmp5_;
			const gchar* _tmp6_;
			const gchar* _tmp10_;
			gchar* _tmp11_;
			_tmp2_ = _group_it;
			_tmp3_ = gee_iterator_next (_tmp2_);
			if (!_tmp3_) {
				break;
			}
			_tmp4_ = _group_it;
			_tmp5_ = gee_iterator_get (_tmp4_);
			group = (gchar*) _tmp5_;
			_tmp6_ = group;
			if (g_strcmp0 (_tmp6_, "") == 0) {
				_g_free0 (group);
				continue;
			} else {
				gboolean _tmp7_ = FALSE;
				gboolean _tmp8_;
				_tmp8_ = _edsf_persona_store_is_google_contacts_address_book (self);
				if (_tmp8_) {
					const gchar* _tmp9_;
					_tmp9_ = group;
					_tmp7_ = g_strcmp0 (_tmp9_, EDSF_PERSONA_STORE_android_favourite_group_name) == 0;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_g_free0 (group);
					continue;
				}
			}
			_tmp10_ = group;
			_tmp11_ = g_strdup (_tmp10_);
			categories = g_list_prepend (categories, _tmp11_);
			_g_free0 (group);
		}
		_g_object_unref0 (_group_it);
	}
	_tmp13_ = is_favourite;
	if (_tmp13_) {
		gboolean _tmp14_;
		_tmp14_ = _edsf_persona_store_is_google_contacts_address_book (self);
		_tmp12_ = _tmp14_;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		gchar* _tmp15_;
		_tmp15_ = g_strdup (EDSF_PERSONA_STORE_android_favourite_group_name);
		categories = g_list_prepend (categories, _tmp15_);
	}
	_tmp16_ = contact;
	_tmp17_ = categories;
	e_contact_set (_tmp16_, E_CONTACT_CATEGORY_LIST, _tmp17_);
	__g_list_free__g_free0_0 (categories);
}


static void _edsf_persona_store_set_contact_system_groups (EdsfPersonaStore* self, EContact* contact, GeeSet* system_groups) {
	gchar* group_ids_str;
	gchar* _tmp0_;
	EVCard* vcard;
	EContact* _tmp1_;
	EVCard* _tmp2_;
	EVCardAttribute* prev_attr;
	EVCard* _tmp3_;
	const gchar* _tmp4_;
	EVCardAttribute* _tmp5_;
	EVCardAttribute* _tmp6_;
	EVCardAttribute* new_attr;
	const gchar* _tmp9_;
	EVCardAttribute* _tmp10_;
	EVCard* _tmp22_;
	EVCardAttribute* _tmp23_;
	EVCardAttribute* _tmp24_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (system_groups != NULL);
	_tmp0_ = g_strdup ("X-GOOGLE-SYSTEM-GROUP-IDS");
	group_ids_str = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, e_vcard_get_type (), EVCard));
	vcard = _tmp2_;
	_tmp3_ = vcard;
	_tmp4_ = group_ids_str;
	_tmp5_ = e_vcard_get_attribute (_tmp3_, _tmp4_);
	prev_attr = _tmp5_;
	_tmp6_ = prev_attr;
	if (_tmp6_ != NULL) {
		EContact* _tmp7_;
		const gchar* _tmp8_;
		_tmp7_ = contact;
		_tmp8_ = group_ids_str;
		e_vcard_remove_attributes ((EVCard*) _tmp7_, NULL, _tmp8_);
	}
	_tmp9_ = group_ids_str;
	_tmp10_ = e_vcard_attribute_new (NULL, _tmp9_);
	new_attr = _tmp10_;
	{
		GeeIterator* _group_it;
		GeeSet* _tmp11_;
		GeeIterator* _tmp12_;
		_tmp11_ = system_groups;
		_tmp12_ = gee_iterable_iterator ((GeeIterable*) _tmp11_);
		_group_it = _tmp12_;
		while (TRUE) {
			GeeIterator* _tmp13_;
			gboolean _tmp14_;
			gchar* group;
			GeeIterator* _tmp15_;
			gpointer _tmp16_;
			gboolean _tmp17_ = FALSE;
			const gchar* _tmp18_;
			EVCardAttribute* _tmp20_;
			const gchar* _tmp21_;
			_tmp13_ = _group_it;
			_tmp14_ = gee_iterator_next (_tmp13_);
			if (!_tmp14_) {
				break;
			}
			_tmp15_ = _group_it;
			_tmp16_ = gee_iterator_get (_tmp15_);
			group = (gchar*) _tmp16_;
			_tmp18_ = group;
			if (_tmp18_ == NULL) {
				_tmp17_ = TRUE;
			} else {
				const gchar* _tmp19_;
				_tmp19_ = group;
				_tmp17_ = g_strcmp0 (_tmp19_, "") == 0;
			}
			if (_tmp17_) {
				_g_free0 (group);
				continue;
			}
			_tmp20_ = new_attr;
			_tmp21_ = group;
			e_vcard_attribute_add_value (_tmp20_, _tmp21_);
			_g_free0 (group);
		}
		_g_object_unref0 (_group_it);
	}
	_tmp22_ = vcard;
	_tmp23_ = new_attr;
	_tmp24_ = __vala_EVCardAttribute_copy0 (_tmp23_);
	e_vcard_add_attribute (_tmp22_, _tmp24_);
	__vala_EVCardAttribute_free0 (new_attr);
	_g_object_unref0 (vcard);
	_g_free0 (group_ids_str);
}


static void _edsf_persona_store_set_gender_data_free (gpointer _data) {
	EdsfPersonaStoreSetGenderData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetGenderData, _data_);
}


void _edsf_persona_store_set_gender (EdsfPersonaStore* self, EdsfPersona* persona, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetGenderData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	FolksGender _tmp3_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetGenderData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_gender);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_gender_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = gender;
	_data_->gender = _tmp3_;
	_edsf_persona_store_set_gender_co (_data_);
}


void _edsf_persona_store_set_gender_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetGenderData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_gender_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetGenderData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_gender_co (_data_);
}


static gboolean _edsf_persona_store_set_gender_co (EdsfPersonaStoreSetGenderData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "gender")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Gender is not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->gender;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_gender_details_get_gender ((FolksGenderDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	if (_data_->_tmp2_ == _data_->_tmp5_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _data_->persona;
	_data_->_tmp7_ = edsf_persona_get_contact (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->gender;
	_edsf_persona_store_set_contact_gender (_data_->self, _data_->_tmp8_, _data_->_tmp9_);
	_data_->_tmp10_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp10_, "gender", _edsf_persona_store_set_gender_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_contact_gender (EdsfPersonaStore* self, EContact* contact, FolksGender gender) {
	EContact* _tmp0_;
	EVCardAttribute* new_attr;
	EVCardAttribute* _tmp1_;
	FolksGender _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	_tmp0_ = contact;
	_edsf_persona_store_remove_attribute (self, _tmp0_, EDSF_PERSONA_gender_attribute_name);
	_tmp1_ = e_vcard_attribute_new (NULL, EDSF_PERSONA_gender_attribute_name);
	new_attr = _tmp1_;
	_tmp2_ = gender;
	switch (_tmp2_) {
		case FOLKS_GENDER_UNSPECIFIED:
		{
			break;
		}
		case FOLKS_GENDER_MALE:
		{
			EVCardAttribute* _tmp3_;
			EContact* _tmp4_;
			EVCardAttribute* _tmp5_;
			_tmp3_ = new_attr;
			e_vcard_attribute_add_value (_tmp3_, EDSF_PERSONA_gender_male);
			_tmp4_ = contact;
			_tmp5_ = new_attr;
			new_attr = NULL;
			e_vcard_add_attribute ((EVCard*) _tmp4_, _tmp5_);
			break;
		}
		case FOLKS_GENDER_FEMALE:
		{
			EVCardAttribute* _tmp6_;
			EContact* _tmp7_;
			EVCardAttribute* _tmp8_;
			_tmp6_ = new_attr;
			e_vcard_attribute_add_value (_tmp6_, EDSF_PERSONA_gender_female);
			_tmp7_ = contact;
			_tmp8_ = new_attr;
			new_attr = NULL;
			e_vcard_add_attribute ((EVCard*) _tmp7_, _tmp8_);
			break;
		}
		default:
		break;
	}
	__vala_EVCardAttribute_free0 (new_attr);
}


static void _edsf_persona_store_set_anti_links_data_free (gpointer _data) {
	EdsfPersonaStoreSetAntiLinksData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->anti_links);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetAntiLinksData, _data_);
}


void _edsf_persona_store_set_anti_links (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* anti_links, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetAntiLinksData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetAntiLinksData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_anti_links);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_anti_links_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = anti_links;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->anti_links);
	_data_->anti_links = _tmp4_;
	_edsf_persona_store_set_anti_links_co (_data_);
}


void _edsf_persona_store_set_anti_links_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetAntiLinksData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_anti_links_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetAntiLinksData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_anti_links_co (_data_);
}


static gboolean _edsf_persona_store_set_anti_links_co (EdsfPersonaStoreSetAntiLinksData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "anti-links")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Anti-links are not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->anti_links;
	_data_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_anti_linkable_get_anti_links ((FolksAntiLinkable*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_internal_equal_sets (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _data_->_tmp2_, _data_->_tmp5_);
	if (_data_->_tmp6_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->persona;
	_data_->_tmp8_ = edsf_persona_get_contact (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = _data_->anti_links;
	_edsf_persona_store_set_contact_anti_links (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
	_data_->_tmp11_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp11_, "anti-links", _edsf_persona_store_set_anti_links_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _edsf_persona_store_set_contact_anti_links (EdsfPersonaStore* self, EContact* contact, GeeSet* anti_links) {
	EVCard* vcard;
	EContact* _tmp0_;
	EVCard* _tmp1_;
	EVCard* _tmp2_;
	gchar* persona_uid;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	EContact* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (anti_links != NULL);
	_tmp0_ = contact;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, e_vcard_get_type (), EVCard));
	vcard = _tmp1_;
	_tmp2_ = vcard;
	e_vcard_remove_attributes (_tmp2_, NULL, EDSF_PERSONA_STORE_anti_links_attribute_name);
	_tmp3_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = contact;
	g_object_get (_tmp5_, "id", &_tmp6_, NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp9_ = folks_persona_build_uid (BACKEND_NAME, _tmp4_, _tmp8_);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	persona_uid = _tmp10_;
	{
		GeeIterator* _anti_link_uid_it;
		GeeSet* _tmp11_;
		GeeIterator* _tmp12_;
		_tmp11_ = anti_links;
		_tmp12_ = gee_iterable_iterator ((GeeIterable*) _tmp11_);
		_anti_link_uid_it = _tmp12_;
		while (TRUE) {
			GeeIterator* _tmp13_;
			gboolean _tmp14_;
			gchar* anti_link_uid;
			GeeIterator* _tmp15_;
			gpointer _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			EVCardAttribute* attr;
			EVCardAttribute* _tmp19_;
			EVCardAttribute* _tmp20_;
			const gchar* _tmp21_;
			EContact* _tmp22_;
			EVCardAttribute* _tmp23_;
			_tmp13_ = _anti_link_uid_it;
			_tmp14_ = gee_iterator_next (_tmp13_);
			if (!_tmp14_) {
				break;
			}
			_tmp15_ = _anti_link_uid_it;
			_tmp16_ = gee_iterator_get (_tmp15_);
			anti_link_uid = (gchar*) _tmp16_;
			_tmp17_ = anti_link_uid;
			_tmp18_ = persona_uid;
			if (g_strcmp0 (_tmp17_, _tmp18_) == 0) {
				_g_free0 (anti_link_uid);
				continue;
			}
			_tmp19_ = e_vcard_attribute_new (NULL, EDSF_PERSONA_STORE_anti_links_attribute_name);
			attr = _tmp19_;
			_tmp20_ = attr;
			_tmp21_ = anti_link_uid;
			e_vcard_attribute_add_value (_tmp20_, _tmp21_);
			_tmp22_ = contact;
			_tmp23_ = attr;
			attr = NULL;
			e_vcard_add_attribute ((EVCard*) _tmp22_, _tmp23_);
			__vala_EVCardAttribute_free0 (attr);
			_g_free0 (anti_link_uid);
		}
		_g_object_unref0 (_anti_link_uid_it);
	}
	_g_free0 (persona_uid);
	_g_object_unref0 (vcard);
}


static void _edsf_persona_store_set_location_data_free (gpointer _data) {
	EdsfPersonaStoreSetLocationData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->location);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetLocationData, _data_);
}


void _edsf_persona_store_set_location (EdsfPersonaStore* self, EdsfPersona* persona, FolksLocation* location, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetLocationData* _data_;
	EdsfPersonaStore* _tmp0_;
	EdsfPersona* _tmp1_;
	EdsfPersona* _tmp2_;
	FolksLocation* _tmp3_;
	FolksLocation* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetLocationData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_location);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_location_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	_tmp3_ = location;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->location);
	_data_->location = _tmp4_;
	_edsf_persona_store_set_location_co (_data_);
}


void _edsf_persona_store_set_location_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreSetLocationData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _edsf_persona_store_set_location_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetLocationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_location_co (_data_);
}


static gboolean _edsf_persona_store_set_location_co (EdsfPersonaStoreSetLocationData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_always_writeable_properties;
	_data_->_tmp0__length1 = _data_->self->priv->_always_writeable_properties_length1;
	if (!_vala_string_array_contains (_data_->_tmp0_, _data_->_tmp0__length1, "location")) {
		_data_->_tmp1_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Location is not writeable on this contact."));
		_data_->_inner_error_ = _data_->_tmp1_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->persona;
	_data_->_tmp3_ = edsf_persona_get_contact (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->location;
	_edsf_persona_store_set_contact_location (_data_->self, _data_->_tmp4_, _data_->_tmp5_);
	_data_->_tmp6_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp6_, "location", _edsf_persona_store_set_location_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _vala_EContactGeo_free (EContactGeo* self) {
	g_boxed_free (e_contact_geo_get_type (), self);
}


static void _edsf_persona_store_set_contact_location (EdsfPersonaStore* self, EContact* contact, FolksLocation* location) {
	FolksLocation* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	_tmp0_ = location;
	if (_tmp0_ == NULL) {
		EContact* _tmp1_;
		_tmp1_ = contact;
		_edsf_persona_store_remove_attribute (self, _tmp1_, "GEO");
	} else {
		EContactGeo* geo;
		EContactGeo* _tmp2_;
		EContactGeo* _tmp3_;
		FolksLocation* _tmp4_;
		gdouble _tmp5_;
		EContactGeo* _tmp6_;
		FolksLocation* _tmp7_;
		gdouble _tmp8_;
		EContact* _tmp9_;
		EContactGeo* _tmp10_;
		_tmp2_ = e_contact_geo_new ();
		geo = _tmp2_;
		_tmp3_ = geo;
		_tmp4_ = location;
		_tmp5_ = _tmp4_->latitude;
		_tmp3_->latitude = _tmp5_;
		_tmp6_ = geo;
		_tmp7_ = location;
		_tmp8_ = _tmp7_->longitude;
		_tmp6_->longitude = _tmp8_;
		_tmp9_ = contact;
		_tmp10_ = geo;
		e_contact_set (_tmp9_, E_CONTACT_GEO, _tmp10_);
		__vala_EContactGeo_free0 (geo);
	}
}


static gboolean __edsf_persona_store_idle_process_gsource_func (gpointer self) {
	gboolean result;
	result = _edsf_persona_store_idle_process ((EdsfPersonaStore*) self);
	return result;
}


static void _edsf_persona_store_idle_queue (EdsfPersonaStore* self, GSourceFunc callback, void* callback_target, GDestroyNotify callback_target_destroy_notify) {
	EdsfPersonaStoreIdleTask* task;
	EdsfPersonaStoreIdleTask* _tmp0_;
	EdsfPersonaStoreIdleTask* _tmp1_;
	GSourceFunc _tmp2_;
	void* _tmp2__target;
	GDestroyNotify _tmp2__target_destroy_notify;
	GeeQueue* _tmp3_;
	EdsfPersonaStoreIdleTask* _tmp4_;
	guint _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = edsf_persona_store_idle_task_new ();
	task = _tmp0_;
	_tmp1_ = task;
	_tmp2_ = callback;
	_tmp2__target = callback_target;
	_tmp2__target_destroy_notify = callback_target_destroy_notify;
	callback_target_destroy_notify = NULL;
	(_tmp1_->callback_target_destroy_notify == NULL) ? NULL : (_tmp1_->callback_target_destroy_notify (_tmp1_->callback_target), NULL);
	_tmp1_->callback = NULL;
	_tmp1_->callback_target = NULL;
	_tmp1_->callback_target_destroy_notify = NULL;
	_tmp1_->callback = _tmp2_;
	_tmp1_->callback_target = _tmp2__target;
	_tmp1_->callback_target_destroy_notify = _tmp2__target_destroy_notify;
	_tmp3_ = self->priv->_idle_tasks;
	_tmp4_ = task;
	gee_collection_add ((GeeCollection*) _tmp3_, _tmp4_);
	_tmp5_ = self->priv->_idle_handle;
	if (_tmp5_ == ((guint) 0)) {
		guint _tmp6_;
		_tmp6_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __edsf_persona_store_idle_process_gsource_func, g_object_ref (self), g_object_unref);
		self->priv->_idle_handle = _tmp6_;
	}
	_edsf_persona_store_idle_task_unref0 (task);
	(callback_target_destroy_notify == NULL) ? NULL : (callback_target_destroy_notify (callback_target), NULL);
	callback = NULL;
	callback_target = NULL;
	callback_target_destroy_notify = NULL;
}


static gboolean _edsf_persona_store_idle_process (EdsfPersonaStore* self) {
	gboolean result = FALSE;
	EdsfPersonaStoreIdleTask* task;
	GeeQueue* _tmp0_;
	gpointer _tmp1_;
	EdsfPersonaStoreIdleTask* _tmp2_;
	GeeQueue* _tmp9_;
	gpointer _tmp10_;
	EdsfPersonaStoreIdleTask* _tmp11_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_idle_tasks;
	_tmp1_ = gee_queue_peek (_tmp0_);
	task = (EdsfPersonaStoreIdleTask*) _tmp1_;
	_tmp2_ = task;
	if (_tmp2_ != NULL) {
		EdsfPersonaStoreIdleTask* _tmp3_;
		GSourceFunc _tmp4_;
		void* _tmp4__target;
		gboolean _tmp5_;
		GeeQueue* _tmp6_;
		gpointer _tmp7_;
		EdsfPersonaStoreIdleTask* _tmp8_;
		_tmp3_ = task;
		_tmp4_ = _tmp3_->callback;
		_tmp4__target = _tmp3_->callback_target;
		_tmp5_ = _tmp4_ (_tmp4__target);
		if (_tmp5_) {
			result = TRUE;
			_edsf_persona_store_idle_task_unref0 (task);
			return result;
		}
		_tmp6_ = self->priv->_idle_tasks;
		_tmp7_ = gee_queue_poll (_tmp6_);
		_tmp8_ = (EdsfPersonaStoreIdleTask*) _tmp7_;
		_edsf_persona_store_idle_task_unref0 (_tmp8_);
	}
	_tmp9_ = self->priv->_idle_tasks;
	_tmp10_ = gee_queue_peek (_tmp9_);
	_edsf_persona_store_idle_task_unref0 (task);
	task = (EdsfPersonaStoreIdleTask*) _tmp10_;
	_tmp11_ = task;
	if (_tmp11_ == NULL) {
		self->priv->_idle_handle = (guint) 0;
		result = FALSE;
		_edsf_persona_store_idle_task_unref0 (task);
		return result;
	} else {
		result = TRUE;
		_edsf_persona_store_idle_task_unref0 (task);
		return result;
	}
	_edsf_persona_store_idle_task_unref0 (task);
}


static GeeLinkedList* _edsf_persona_store_copy_contacts (EdsfPersonaStore* self, GList* contacts) {
	GeeLinkedList* result = NULL;
	GeeLinkedList* copy;
	GeeLinkedList* _tmp0_;
	GList* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_linked_list_new (e_contact_get_type (), (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	copy = _tmp0_;
	_tmp1_ = contacts;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp1_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			EContact* _tmp2_;
			EContact* c = NULL;
			_tmp2_ = _g_object_ref0 ((EContact*) c_it->data);
			c = _tmp2_;
			{
				GeeLinkedList* _tmp3_;
				EContact* _tmp4_;
				_tmp3_ = copy;
				_tmp4_ = c;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, _tmp4_);
				_g_object_unref0 (c);
			}
		}
	}
	result = copy;
	return result;
}


static GeeLinkedList* _edsf_persona_store_copy_contacts_ids (EdsfPersonaStore* self, GList* contacts_ids) {
	GeeLinkedList* result = NULL;
	GeeLinkedList* copy;
	GeeLinkedList* _tmp0_;
	GList* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
	copy = _tmp0_;
	_tmp1_ = contacts_ids;
	{
		GList* s_collection = NULL;
		GList* s_it = NULL;
		s_collection = _tmp1_;
		for (s_it = s_collection; s_it != NULL; s_it = s_it->next) {
			const gchar* s = NULL;
			s = (const gchar*) s_it->data;
			{
				GeeLinkedList* _tmp2_;
				const gchar* _tmp3_;
				_tmp2_ = copy;
				_tmp3_ = s;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp2_, _tmp3_);
			}
		}
	}
	result = copy;
	return result;
}


static Block6Data* block6_data_ref (Block6Data* _data6_) {
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}


static void block6_data_unref (void * _userdata_) {
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->copy);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}


static gboolean __lambda9_ (Block6Data* _data6_) {
	EdsfPersonaStore* self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	self = _data6_->self;
	_tmp0_ = _edsf_persona_store_contacts_added_idle (self, (GeeList*) _data6_->copy);
	result = _tmp0_;
	return result;
}


static gboolean ___lambda9__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda9_ (self);
	return result;
}


static void _edsf_persona_store_contacts_added_cb (EdsfPersonaStore* self, GList* contacts) {
	Block6Data* _data6_;
	GList* _tmp0_;
	GeeLinkedList* _tmp1_;
	g_return_if_fail (self != NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	_tmp0_ = contacts;
	_tmp1_ = _edsf_persona_store_copy_contacts (self, _tmp0_);
	_data6_->copy = _tmp1_;
	_edsf_persona_store_idle_queue (self, ___lambda9__gsource_func, block6_data_ref (_data6_), block6_data_unref);
	block6_data_unref (_data6_);
	_data6_ = NULL;
}


static gboolean _edsf_persona_store_contacts_added_idle (EdsfPersonaStore* self, GeeList* contacts) {
	gboolean result = FALSE;
	GeeHashSet* added_personas = NULL;
	GeeHashSet* removed_personas = NULL;
	gboolean _tmp0_;
	GeeHashSet* _tmp6_;
	gboolean _tmp48_ = FALSE;
	GeeHashSet* _tmp49_;
	gint _tmp50_;
	gint _tmp51_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (contacts != NULL, FALSE);
	_tmp0_ = self->priv->_is_quiescent;
	if (_tmp0_ == FALSE) {
		GeeHashSet* _tmp1_;
		GeeHashSet* _tmp3_;
		GeeHashSet* _tmp4_;
		_tmp1_ = self->priv->_pending_personas;
		if (_tmp1_ == NULL) {
			GeeHashSet* _tmp2_;
			_tmp2_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
			_g_object_unref0 (self->priv->_pending_personas);
			self->priv->_pending_personas = _tmp2_;
		}
		_tmp3_ = self->priv->_pending_personas;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		_g_object_unref0 (added_personas);
		added_personas = _tmp4_;
	} else {
		GeeHashSet* _tmp5_;
		_tmp5_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
		_g_object_unref0 (added_personas);
		added_personas = _tmp5_;
	}
	_tmp6_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (removed_personas);
	removed_personas = _tmp6_;
	{
		GeeList* _c_list;
		GeeList* _tmp7_;
		GeeList* _tmp8_;
		gint _c_size;
		GeeList* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gint _c_index;
		_tmp7_ = contacts;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_c_list = _tmp8_;
		_tmp9_ = _c_list;
		_tmp10_ = gee_collection_get_size ((GeeCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_c_size = _tmp11_;
		_c_index = -1;
		while (TRUE) {
			gint _tmp12_;
			gint _tmp13_;
			gint _tmp14_;
			EContact* c;
			GeeList* _tmp15_;
			gint _tmp16_;
			gpointer _tmp17_;
			gchar* _iid;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			EContact* _tmp20_;
			gchar* _tmp21_;
			const gchar* _tmp22_;
			gchar* iid;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			EdsfPersona* old_persona;
			GeeHashMap* _tmp26_;
			const gchar* _tmp27_;
			gpointer _tmp28_;
			EdsfPersona* new_persona;
			EContact* _tmp29_;
			EdsfPersona* _tmp30_;
			EdsfPersona* _tmp31_;
			EdsfPersona* _tmp39_;
			const gchar* _tmp40_;
			GeeHashMap* _tmp41_;
			EdsfPersona* _tmp42_;
			const gchar* _tmp43_;
			const gchar* _tmp44_;
			EdsfPersona* _tmp45_;
			GeeHashSet* _tmp46_;
			EdsfPersona* _tmp47_;
			_tmp12_ = _c_index;
			_c_index = _tmp12_ + 1;
			_tmp13_ = _c_index;
			_tmp14_ = _c_size;
			if (!(_tmp13_ < _tmp14_)) {
				break;
			}
			_tmp15_ = _c_list;
			_tmp16_ = _c_index;
			_tmp17_ = gee_list_get (_tmp15_, _tmp16_);
			c = (EContact*) _tmp17_;
			_tmp18_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
			_tmp19_ = _tmp18_;
			_tmp20_ = c;
			_tmp21_ = edsf_persona_build_iid_from_contact (_tmp19_, _tmp20_);
			_iid = _tmp21_;
			_tmp22_ = _iid;
			if (_tmp22_ == NULL) {
				EContact* _tmp23_;
				_tmp23_ = c;
				g_debug ("edsf-persona-store.vala:2496: Ignoring contact %p as UID is not set", _tmp23_);
				_g_free0 (_iid);
				_g_object_unref0 (c);
				continue;
			}
			_tmp24_ = _iid;
			_tmp25_ = g_strdup ((const gchar*) _tmp24_);
			iid = _tmp25_;
			_tmp26_ = self->priv->_personas;
			_tmp27_ = iid;
			_tmp28_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp26_, _tmp27_);
			old_persona = (EdsfPersona*) _tmp28_;
			_tmp29_ = c;
			_tmp30_ = edsf_persona_new (self, _tmp29_);
			new_persona = _tmp30_;
			_tmp31_ = old_persona;
			if (_tmp31_ != NULL) {
				EdsfPersona* _tmp32_;
				const gchar* _tmp33_;
				GeeHashSet* _tmp34_;
				EdsfPersona* _tmp35_;
				GeeHashSet* _tmp36_;
				_tmp32_ = old_persona;
				_tmp33_ = iid;
				g_debug ("edsf-persona-store.vala:2506: Removing old persona %p from contact %s.", _tmp32_, _tmp33_);
				_tmp34_ = removed_personas;
				_tmp35_ = old_persona;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp34_, _tmp35_);
				_tmp36_ = self->priv->_pending_personas;
				if (_tmp36_ != NULL) {
					GeeHashSet* _tmp37_;
					EdsfPersona* _tmp38_;
					_tmp37_ = self->priv->_pending_personas;
					_tmp38_ = old_persona;
					gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp37_, _tmp38_);
				}
			}
			_tmp39_ = new_persona;
			_tmp40_ = iid;
			g_debug ("edsf-persona-store.vala:2518: Adding persona %p from contact %s.", _tmp39_, _tmp40_);
			_tmp41_ = self->priv->_personas;
			_tmp42_ = new_persona;
			_tmp43_ = folks_persona_get_iid ((FolksPersona*) _tmp42_);
			_tmp44_ = _tmp43_;
			_tmp45_ = new_persona;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp41_, _tmp44_, _tmp45_);
			_tmp46_ = added_personas;
			_tmp47_ = new_persona;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp46_, _tmp47_);
			_g_object_unref0 (new_persona);
			_g_object_unref0 (old_persona);
			_g_free0 (iid);
			_g_free0 (_iid);
			_g_object_unref0 (c);
		}
		_g_object_unref0 (_c_list);
	}
	_tmp49_ = added_personas;
	_tmp50_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp49_);
	_tmp51_ = _tmp50_;
	if (_tmp51_ > 0) {
		gboolean _tmp52_;
		_tmp52_ = self->priv->_is_quiescent;
		_tmp48_ = _tmp52_ == TRUE;
	} else {
		_tmp48_ = FALSE;
	}
	if (_tmp48_) {
		GeeHashSet* _tmp53_;
		GeeHashSet* _tmp54_;
		_tmp53_ = added_personas;
		_tmp54_ = removed_personas;
		_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) self, (GeeSet*) _tmp53_, (GeeSet*) _tmp54_, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
	}
	result = FALSE;
	_g_object_unref0 (removed_personas);
	_g_object_unref0 (added_personas);
	return result;
}


static Block7Data* block7_data_ref (Block7Data* _data7_) {
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}


static void block7_data_unref (void * _userdata_) {
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->copy);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}


static gboolean __lambda11_ (Block7Data* _data7_) {
	EdsfPersonaStore* self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	self = _data7_->self;
	_tmp0_ = _edsf_persona_store_contacts_changed_idle (self, (GeeList*) _data7_->copy);
	result = _tmp0_;
	return result;
}


static gboolean ___lambda11__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda11_ (self);
	return result;
}


static void _edsf_persona_store_contacts_changed_cb (EdsfPersonaStore* self, GList* contacts) {
	Block7Data* _data7_;
	GList* _tmp0_;
	GeeLinkedList* _tmp1_;
	g_return_if_fail (self != NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp0_ = contacts;
	_tmp1_ = _edsf_persona_store_copy_contacts (self, _tmp0_);
	_data7_->copy = _tmp1_;
	_edsf_persona_store_idle_queue (self, ___lambda11__gsource_func, block7_data_ref (_data7_), block7_data_unref);
	block7_data_unref (_data7_);
	_data7_ = NULL;
}


static gboolean _edsf_persona_store_contacts_changed_idle (EdsfPersonaStore* self, GeeList* contacts) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (contacts != NULL, FALSE);
	{
		GeeList* _c_list;
		GeeList* _tmp0_;
		GeeList* _tmp1_;
		gint _c_size;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _c_index;
		_tmp0_ = contacts;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_c_list = _tmp1_;
		_tmp2_ = _c_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_c_size = _tmp4_;
		_c_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			EContact* c;
			GeeList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_;
			gchar* _iid;
			const gchar* _tmp11_;
			const gchar* _tmp12_;
			EContact* _tmp13_;
			gchar* _tmp14_;
			const gchar* _tmp15_;
			gchar* iid;
			const gchar* _tmp17_;
			gchar* _tmp18_;
			EdsfPersona* persona;
			GeeHashMap* _tmp19_;
			const gchar* _tmp20_;
			gpointer _tmp21_;
			EdsfPersona* _tmp22_;
			_tmp5_ = _c_index;
			_c_index = _tmp5_ + 1;
			_tmp6_ = _c_index;
			_tmp7_ = _c_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _c_list;
			_tmp9_ = _c_index;
			_tmp10_ = gee_list_get (_tmp8_, _tmp9_);
			c = (EContact*) _tmp10_;
			_tmp11_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
			_tmp12_ = _tmp11_;
			_tmp13_ = c;
			_tmp14_ = edsf_persona_build_iid_from_contact (_tmp12_, _tmp13_);
			_iid = _tmp14_;
			_tmp15_ = _iid;
			if (_tmp15_ == NULL) {
				EContact* _tmp16_;
				_tmp16_ = c;
				g_debug ("edsf-persona-store.vala:2547: Ignoring contact %p as UID is not set", _tmp16_);
				_g_free0 (_iid);
				_g_object_unref0 (c);
				continue;
			}
			_tmp17_ = _iid;
			_tmp18_ = g_strdup ((const gchar*) _tmp17_);
			iid = _tmp18_;
			_tmp19_ = self->priv->_personas;
			_tmp20_ = iid;
			_tmp21_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp19_, _tmp20_);
			persona = (EdsfPersona*) _tmp21_;
			_tmp22_ = persona;
			if (_tmp22_ != NULL) {
				EdsfPersona* _tmp23_;
				EContact* _tmp24_;
				_tmp23_ = persona;
				_tmp24_ = c;
				_edsf_persona_update (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, EDSF_TYPE_PERSONA, EdsfPersona), _tmp24_);
			}
			_g_object_unref0 (persona);
			_g_free0 (iid);
			_g_free0 (_iid);
			_g_object_unref0 (c);
		}
		_g_object_unref0 (_c_list);
	}
	result = FALSE;
	return result;
}


static Block8Data* block8_data_ref (Block8Data* _data8_) {
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}


static void block8_data_unref (void * _userdata_) {
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data8_->self;
		_g_object_unref0 (_data8_->copy);
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}


static gboolean __lambda10_ (Block8Data* _data8_) {
	EdsfPersonaStore* self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	self = _data8_->self;
	_tmp0_ = _edsf_persona_store_contacts_removed_idle (self, (GeeList*) _data8_->copy);
	result = _tmp0_;
	return result;
}


static gboolean ___lambda10__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda10_ (self);
	return result;
}


static void _edsf_persona_store_contacts_removed_cb (EdsfPersonaStore* self, GList* contacts_ids) {
	Block8Data* _data8_;
	GList* _tmp0_;
	GeeLinkedList* _tmp1_;
	g_return_if_fail (self != NULL);
	_data8_ = g_slice_new0 (Block8Data);
	_data8_->_ref_count_ = 1;
	_data8_->self = g_object_ref (self);
	_tmp0_ = contacts_ids;
	_tmp1_ = _edsf_persona_store_copy_contacts_ids (self, _tmp0_);
	_data8_->copy = _tmp1_;
	_edsf_persona_store_idle_queue (self, ___lambda10__gsource_func, block8_data_ref (_data8_), block8_data_unref);
	block8_data_unref (_data8_);
	_data8_ = NULL;
}


static gboolean _edsf_persona_store_contacts_removed_idle (EdsfPersonaStore* self, GeeList* contacts_ids) {
	gboolean result = FALSE;
	GeeHashSet* removed_personas;
	GeeHashSet* _tmp0_;
	GeeHashSet* _tmp30_;
	gint _tmp31_;
	gint _tmp32_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (contacts_ids != NULL, FALSE);
	_tmp0_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	removed_personas = _tmp0_;
	{
		GeeList* _contact_id_list;
		GeeList* _tmp1_;
		GeeList* _tmp2_;
		gint _contact_id_size;
		GeeList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _contact_id_index;
		_tmp1_ = contacts_ids;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		_contact_id_list = _tmp2_;
		_tmp3_ = _contact_id_list;
		_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_contact_id_size = _tmp5_;
		_contact_id_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			gint _tmp8_;
			gchar* contact_id;
			GeeList* _tmp9_;
			gint _tmp10_;
			gpointer _tmp11_;
			const gchar* _tmp12_;
			gchar* iid;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			const gchar* _tmp15_;
			gchar* _tmp16_;
			EdsfPersona* persona;
			GeeHashMap* _tmp17_;
			const gchar* _tmp18_;
			gpointer _tmp19_;
			EdsfPersona* _tmp20_;
			_tmp6_ = _contact_id_index;
			_contact_id_index = _tmp6_ + 1;
			_tmp7_ = _contact_id_index;
			_tmp8_ = _contact_id_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _contact_id_list;
			_tmp10_ = _contact_id_index;
			_tmp11_ = gee_list_get (_tmp9_, _tmp10_);
			contact_id = (gchar*) _tmp11_;
			_tmp12_ = contact_id;
			if (g_strcmp0 (_tmp12_, "") == 0) {
				_g_free0 (contact_id);
				continue;
			}
			_tmp13_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
			_tmp14_ = _tmp13_;
			_tmp15_ = contact_id;
			_tmp16_ = edsf_persona_build_iid (_tmp14_, _tmp15_);
			iid = _tmp16_;
			_tmp17_ = self->priv->_personas;
			_tmp18_ = iid;
			_tmp19_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp17_, _tmp18_);
			persona = (EdsfPersona*) _tmp19_;
			_tmp20_ = persona;
			if (_tmp20_ != NULL) {
				GeeHashSet* _tmp21_;
				EdsfPersona* _tmp22_;
				GeeHashMap* _tmp23_;
				EdsfPersona* _tmp24_;
				const gchar* _tmp25_;
				const gchar* _tmp26_;
				GeeHashSet* _tmp27_;
				_tmp21_ = removed_personas;
				_tmp22_ = persona;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp21_, G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, EDSF_TYPE_PERSONA, EdsfPersona));
				_tmp23_ = self->priv->_personas;
				_tmp24_ = persona;
				_tmp25_ = folks_persona_get_iid ((FolksPersona*) G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, EDSF_TYPE_PERSONA, EdsfPersona));
				_tmp26_ = _tmp25_;
				gee_abstract_map_unset ((GeeAbstractMap*) _tmp23_, _tmp26_, NULL);
				_tmp27_ = self->priv->_pending_personas;
				if (_tmp27_ != NULL) {
					GeeHashSet* _tmp28_;
					EdsfPersona* _tmp29_;
					_tmp28_ = self->priv->_pending_personas;
					_tmp29_ = persona;
					gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp28_, G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, EDSF_TYPE_PERSONA, EdsfPersona));
				}
			}
			_g_object_unref0 (persona);
			_g_free0 (iid);
			_g_free0 (contact_id);
		}
		_g_object_unref0 (_contact_id_list);
	}
	_tmp30_ = removed_personas;
	_tmp31_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp30_);
	_tmp32_ = _tmp31_;
	if (_tmp32_ > 0) {
		GeeHashSet* _tmp33_;
		_tmp33_ = removed_personas;
		_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) self, NULL, (GeeSet*) _tmp33_, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
	}
	result = FALSE;
	_g_object_unref0 (removed_personas);
	return result;
}


static gpointer _g_error_copy0 (gpointer self) {
	return self ? g_error_copy (self) : NULL;
}


static Block9Data* block9_data_ref (Block9Data* _data9_) {
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}


static void block9_data_unref (void * _userdata_) {
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		EdsfPersonaStore* self;
		self = _data9_->self;
		_g_error_free0 (_data9_->err);
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}


static gboolean __lambda14_ (Block9Data* _data9_) {
	EdsfPersonaStore* self;
	gboolean result = FALSE;
	GError* _tmp0_;
	gboolean _tmp1_;
	self = _data9_->self;
	_tmp0_ = _data9_->err;
	_tmp1_ = _edsf_persona_store_contacts_complete_idle_cb (self, _tmp0_);
	result = _tmp1_;
	return result;
}


static gboolean ___lambda14__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda14_ (self);
	return result;
}


static void _edsf_persona_store_contacts_complete_cb (EdsfPersonaStore* self, GError* err) {
	Block9Data* _data9_;
	GError* _tmp0_;
	GError* _tmp1_;
	GError* _tmp2_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	_data9_ = g_slice_new0 (Block9Data);
	_data9_->_ref_count_ = 1;
	_data9_->self = g_object_ref (self);
	_tmp0_ = err;
	_tmp1_ = _g_error_copy0 (_tmp0_);
	_g_error_free0 (_data9_->err);
	_data9_->err = _tmp1_;
	_tmp2_ = _data9_->err;
	if (_tmp2_ != NULL) {
		GError* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = _data9_->err;
		_tmp4_ = _tmp3_->message;
		g_warning ("edsf-persona-store.vala:2609: Error in address book view query: %s", _tmp4_);
	}
	_tmp5_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
	_tmp6_ = _tmp5_;
	folks_internal_profiling_point ("initial query complete in " "Edsf.PersonaStore (ID: %s)", _tmp6_);
	_edsf_persona_store_idle_queue (self, ___lambda14__gsource_func, block9_data_ref (_data9_), block9_data_unref);
	block9_data_unref (_data9_);
	_data9_ = NULL;
}


static gboolean _edsf_persona_store_contacts_complete_idle_cb (EdsfPersonaStore* self, GError* err) {
	gboolean result = FALSE;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_quiescent;
	if (_tmp0_ == FALSE) {
		GError* _tmp1_;
		GeeHashSet* _tmp2_;
		_tmp1_ = err;
		if (_tmp1_ != NULL) {
			g_warning ("edsf-persona-store.vala:2629: %s", "Error is considered unrecoverable. " "Removing persona store.");
			g_signal_emit_by_name ((FolksPersonaStore*) self, "removed");
			result = FALSE;
			return result;
		}
		_tmp2_ = self->priv->_pending_personas;
		if (_tmp2_ != NULL) {
			GeeHashSet* _tmp3_;
			_tmp3_ = self->priv->_pending_personas;
			_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) self, (GeeSet*) _tmp3_, NULL, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
			_g_object_unref0 (self->priv->_pending_personas);
			self->priv->_pending_personas = NULL;
		}
		self->priv->_is_quiescent = TRUE;
		g_object_notify ((GObject*) self, "is-quiescent");
	}
	result = FALSE;
	return result;
}


static GError* edsf_persona_store_e_client_error_to_persona_store_error (EdsfPersonaStore* self, GError* error_in) {
	GError* result = NULL;
	GError* _tmp0_;
	GError* _tmp27_;
	const gchar* _tmp28_;
	GError* _tmp29_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = error_in;
	if (_tmp0_->domain == E_BOOK_CLIENT_ERROR) {
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_ = FALSE;
		gboolean _tmp3_ = FALSE;
		gboolean _tmp4_ = FALSE;
		GError* _tmp5_;
		_tmp5_ = error_in;
		if (g_error_matches (_tmp5_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_NOT_FOUND)) {
			_tmp4_ = TRUE;
		} else {
			GError* _tmp6_;
			_tmp6_ = error_in;
			_tmp4_ = g_error_matches (_tmp6_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK);
		}
		if (_tmp4_) {
			_tmp3_ = TRUE;
		} else {
			GError* _tmp7_;
			_tmp7_ = error_in;
			_tmp3_ = g_error_matches (_tmp7_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS);
		}
		if (_tmp3_) {
			_tmp2_ = TRUE;
		} else {
			GError* _tmp8_;
			_tmp8_ = error_in;
			_tmp2_ = g_error_matches (_tmp8_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE);
		}
		if (_tmp2_) {
			_tmp1_ = TRUE;
		} else {
			GError* _tmp9_;
			_tmp9_ = error_in;
			_tmp1_ = g_error_matches (_tmp9_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SPACE);
		}
		if (_tmp1_) {
		}
	} else {
		GError* _tmp10_;
		GQuark _tmp11_;
		GQuark _tmp12_;
		_tmp10_ = error_in;
		_tmp11_ = _tmp10_->domain;
		_tmp12_ = e_client_error_quark ();
		if (_tmp11_ == _tmp12_) {
			GError* _tmp13_;
			gint _tmp14_;
			_tmp13_ = error_in;
			_tmp14_ = _tmp13_->code;
			switch ((EClientError) _tmp14_) {
				case E_CLIENT_ERROR_PERMISSION_DENIED:
				{
					GError* _tmp15_;
					const gchar* _tmp16_;
					GError* _tmp17_;
					_tmp15_ = error_in;
					_tmp16_ = _tmp15_->message;
					_tmp17_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _ ("Permission denied when creating new contact: %s"), _tmp16_);
					result = _tmp17_;
					return result;
				}
				case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
				{
					GError* _tmp18_;
					const gchar* _tmp19_;
					GError* _tmp20_;
					_tmp18_ = error_in;
					_tmp19_ = _tmp18_->message;
					_tmp20_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _ ("Address book is offline and a new contact cannot be " "created: %s"), _tmp19_);
					result = _tmp20_;
					return result;
				}
				case E_CLIENT_ERROR_NOT_SUPPORTED:
				case E_CLIENT_ERROR_AUTHENTICATION_REQUIRED:
				{
					GError* _tmp21_;
					const gchar* _tmp22_;
					GError* _tmp23_;
					_tmp21_ = error_in;
					_tmp22_ = _tmp21_->message;
					_tmp23_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_CREATE_FAILED, _ ("New contact is not writeable: %s"), _tmp22_);
					result = _tmp23_;
					return result;
				}
				case E_CLIENT_ERROR_INVALID_ARG:
				{
					GError* _tmp24_;
					const gchar* _tmp25_;
					GError* _tmp26_;
					_tmp24_ = error_in;
					_tmp25_ = _tmp24_->message;
					_tmp26_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _ ("Invalid value in contact: %s"), _tmp25_);
					result = _tmp26_;
					return result;
				}
				default:
				case E_CLIENT_ERROR_BUSY:
				case E_CLIENT_ERROR_DBUS_ERROR:
				case E_CLIENT_ERROR_OTHER_ERROR:
				case E_CLIENT_ERROR_COULD_NOT_CANCEL:
				case E_CLIENT_ERROR_AUTHENTICATION_FAILED:
				case E_CLIENT_ERROR_TLS_NOT_AVAILABLE:
				case E_CLIENT_ERROR_OFFLINE_UNAVAILABLE:
				case E_CLIENT_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD:
				case E_CLIENT_ERROR_SEARCH_SIZE_LIMIT_EXCEEDED:
				case E_CLIENT_ERROR_SEARCH_TIME_LIMIT_EXCEEDED:
				case E_CLIENT_ERROR_INVALID_QUERY:
				case E_CLIENT_ERROR_QUERY_REFUSED:
				{
					break;
				}
			}
		}
	}
	_tmp27_ = error_in;
	_tmp28_ = _tmp27_->message;
	_tmp29_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_CREATE_FAILED, _ ("Unknown error adding contact: %s"), _tmp28_);
	result = _tmp29_;
	return result;
}


static GError* edsf_persona_store_e_client_error_to_property_error (EdsfPersonaStore* self, const gchar* property_name, GError* error_in) {
	GError* result = NULL;
	GError* _tmp0_;
	const gchar* _tmp23_;
	GError* _tmp24_;
	const gchar* _tmp25_;
	GError* _tmp26_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (property_name != NULL, NULL);
	_tmp0_ = error_in;
	if (_tmp0_->domain == E_BOOK_CLIENT_ERROR) {
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_ = FALSE;
		gboolean _tmp3_ = FALSE;
		gboolean _tmp4_ = FALSE;
		GError* _tmp5_;
		_tmp5_ = error_in;
		if (g_error_matches (_tmp5_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_NOT_FOUND)) {
			_tmp4_ = TRUE;
		} else {
			GError* _tmp6_;
			_tmp6_ = error_in;
			_tmp4_ = g_error_matches (_tmp6_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK);
		}
		if (_tmp4_) {
			_tmp3_ = TRUE;
		} else {
			GError* _tmp7_;
			_tmp7_ = error_in;
			_tmp3_ = g_error_matches (_tmp7_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS);
		}
		if (_tmp3_) {
			_tmp2_ = TRUE;
		} else {
			GError* _tmp8_;
			_tmp8_ = error_in;
			_tmp2_ = g_error_matches (_tmp8_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE);
		}
		if (_tmp2_) {
			_tmp1_ = TRUE;
		} else {
			GError* _tmp9_;
			_tmp9_ = error_in;
			_tmp1_ = g_error_matches (_tmp9_, E_BOOK_CLIENT_ERROR, E_BOOK_CLIENT_ERROR_NO_SPACE);
		}
		if (_tmp1_) {
		}
	} else {
		GError* _tmp10_;
		GQuark _tmp11_;
		GQuark _tmp12_;
		_tmp10_ = error_in;
		_tmp11_ = _tmp10_->domain;
		_tmp12_ = e_client_error_quark ();
		if (_tmp11_ == _tmp12_) {
			GError* _tmp13_;
			gint _tmp14_;
			_tmp13_ = error_in;
			_tmp14_ = _tmp13_->code;
			switch ((EClientError) _tmp14_) {
				case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
				case E_CLIENT_ERROR_PERMISSION_DENIED:
				case E_CLIENT_ERROR_NOT_SUPPORTED:
				case E_CLIENT_ERROR_AUTHENTICATION_REQUIRED:
				{
					const gchar* _tmp15_;
					GError* _tmp16_;
					const gchar* _tmp17_;
					GError* _tmp18_;
					_tmp15_ = property_name;
					_tmp16_ = error_in;
					_tmp17_ = _tmp16_->message;
					_tmp18_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _ ("Property ‘%s’ is not writeable: %s"), _tmp15_, _tmp17_);
					result = _tmp18_;
					return result;
				}
				case E_CLIENT_ERROR_INVALID_ARG:
				{
					const gchar* _tmp19_;
					GError* _tmp20_;
					const gchar* _tmp21_;
					GError* _tmp22_;
					_tmp19_ = property_name;
					_tmp20_ = error_in;
					_tmp21_ = _tmp20_->message;
					_tmp22_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_INVALID_VALUE, _ ("Invalid value for property ‘%s’: %s"), _tmp19_, _tmp21_);
					result = _tmp22_;
					return result;
				}
				default:
				case E_CLIENT_ERROR_BUSY:
				case E_CLIENT_ERROR_DBUS_ERROR:
				case E_CLIENT_ERROR_OTHER_ERROR:
				case E_CLIENT_ERROR_COULD_NOT_CANCEL:
				case E_CLIENT_ERROR_AUTHENTICATION_FAILED:
				case E_CLIENT_ERROR_TLS_NOT_AVAILABLE:
				case E_CLIENT_ERROR_OFFLINE_UNAVAILABLE:
				case E_CLIENT_ERROR_UNSUPPORTED_AUTHENTICATION_METHOD:
				case E_CLIENT_ERROR_SEARCH_SIZE_LIMIT_EXCEEDED:
				case E_CLIENT_ERROR_SEARCH_TIME_LIMIT_EXCEEDED:
				case E_CLIENT_ERROR_INVALID_QUERY:
				case E_CLIENT_ERROR_QUERY_REFUSED:
				{
					break;
				}
			}
		}
	}
	_tmp23_ = property_name;
	_tmp24_ = error_in;
	_tmp25_ = _tmp24_->message;
	_tmp26_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_UNKNOWN_ERROR, _ ("Unknown error setting property ‘%s’: %s"), _tmp23_, _tmp25_);
	result = _tmp26_;
	return result;
}


static gboolean _edsf_persona_store_backend_name_matches (EdsfPersonaStore* self, const gchar* backend_name) {
	gboolean result = FALSE;
	ESource* _tmp0_;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (backend_name != NULL, FALSE);
	_tmp0_ = self->priv->_source;
	_tmp1_ = e_source_has_extension (_tmp0_, E_SOURCE_EXTENSION_ADDRESS_BOOK);
	if (_tmp1_) {
		ESourceAddressBook* extension;
		ESource* _tmp2_;
		ESourceExtension* _tmp3_;
		ESourceAddressBook* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp2_ = self->priv->_source;
		_tmp3_ = e_source_get_extension (_tmp2_, E_SOURCE_EXTENSION_ADDRESS_BOOK);
		extension = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, e_source_address_book_get_type (), ESourceAddressBook);
		_tmp4_ = extension;
		_tmp5_ = e_source_backend_get_backend_name ((ESourceBackend*) _tmp4_);
		_tmp6_ = backend_name;
		result = g_strcmp0 (_tmp5_, _tmp6_) == 0;
		return result;
	}
	result = FALSE;
	return result;
}


gboolean _edsf_persona_store_is_google_contacts_address_book (EdsfPersonaStore* self) {
	gboolean result = FALSE;
	ESourceRegistry* _tmp0_;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_source_registry;
	_vala_assert (_tmp0_ != NULL, "this._source_registry != null");
	_tmp1_ = _edsf_persona_store_backend_name_matches (self, "google");
	result = _tmp1_;
	return result;
}


static gboolean _edsf_persona_store_is_in_source_registry (EdsfPersonaStore* self) {
	gboolean result = FALSE;
	ESourceRegistry* _tmp0_;
	ESource* needle;
	ESourceRegistry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	ESource* _tmp4_;
	gboolean _tmp5_ = FALSE;
	ESource* _tmp6_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_source_registry;
	_vala_assert (_tmp0_ != NULL, "this._source_registry != null");
	_tmp1_ = self->priv->_source_registry;
	_tmp2_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = e_source_registry_ref_source (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, e_source_registry_get_type (), ESourceRegistry), _tmp3_);
	needle = _tmp4_;
	_tmp6_ = needle;
	if (_tmp6_ != NULL) {
		ESource* _tmp7_;
		gboolean _tmp8_;
		_tmp7_ = needle;
		_tmp8_ = e_source_has_extension (_tmp7_, E_SOURCE_EXTENSION_ADDRESS_BOOK);
		_tmp5_ = _tmp8_;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		ESourceRegistry* _tmp9_;
		ESource* _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = self->priv->_source_registry;
		_tmp10_ = needle;
		_tmp11_ = e_source_registry_check_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, e_source_registry_get_type (), ESourceRegistry), _tmp10_);
		result = _tmp11_;
		_g_object_unref0 (needle);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (needle);
	return result;
}


static void _edsf_persona_store_source_registry_changed_cb (EdsfPersonaStore* self, ESource* list) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (list != NULL);
	_tmp0_ = _edsf_persona_store_is_in_source_registry (self);
	if (_tmp0_ == FALSE) {
		GeeHashSet* removed_personas;
		GeeHashSet* _tmp1_;
		GeeMapIterator* iter;
		GeeHashMap* _tmp2_;
		GeeMapIterator* _tmp3_;
		GeeHashSet* _tmp10_;
		_tmp1_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
		removed_personas = _tmp1_;
		_tmp2_ = self->priv->_personas;
		_tmp3_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) _tmp2_);
		iter = _tmp3_;
		while (TRUE) {
			GeeMapIterator* _tmp4_;
			gboolean _tmp5_;
			GeeHashSet* _tmp6_;
			GeeMapIterator* _tmp7_;
			gpointer _tmp8_;
			EdsfPersona* _tmp9_;
			_tmp4_ = iter;
			_tmp5_ = gee_map_iterator_next (_tmp4_);
			if (!(_tmp5_ == TRUE)) {
				break;
			}
			_tmp6_ = removed_personas;
			_tmp7_ = iter;
			_tmp8_ = gee_map_iterator_get_value (_tmp7_);
			_tmp9_ = (EdsfPersona*) _tmp8_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp9_);
			_g_object_unref0 (_tmp9_);
		}
		_tmp10_ = removed_personas;
		_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) self, NULL, (GeeSet*) _tmp10_, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
		g_signal_emit_by_name ((FolksPersonaStore*) self, "removed");
		_g_object_unref0 (iter);
		_g_object_unref0 (removed_personas);
	}
}


static void _edsf_persona_store_update_trust_level (EdsfPersonaStore* self) {
	ESourceRegistry* _tmp0_;
	EBookClient* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	EBookClient* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_source_registry;
	_vala_assert (_tmp0_ != NULL, "this._source_registry != null");
	_tmp1_ = self->priv->_addressbook;
	_vala_assert (_tmp1_ != NULL, "this._addressbook != null");
	_tmp2_ = _edsf_persona_store_backend_name_matches (self, "ldap");
	if (_tmp2_) {
		folks_persona_store_set_trust_level ((FolksPersonaStore*) self, FOLKS_PERSONA_STORE_TRUST_PARTIAL);
		return;
	}
	_tmp3_ = _edsf_persona_store_is_google_contacts_address_book (self);
	if (_tmp3_) {
		folks_persona_store_set_trust_level ((FolksPersonaStore*) self, FOLKS_PERSONA_STORE_TRUST_FULL);
	}
	_tmp4_ = self->priv->_addressbook;
	g_object_get ((EClient*) G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, e_book_client_get_type (), EBookClient), "readonly", &_tmp5_, NULL);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		folks_persona_store_set_trust_level ((FolksPersonaStore*) self, FOLKS_PERSONA_STORE_TRUST_PARTIAL);
	} else {
		folks_persona_store_set_trust_level ((FolksPersonaStore*) self, FOLKS_PERSONA_STORE_TRUST_FULL);
	}
}


static void _edsf_persona_store_source_changed_cb (EdsfPersonaStore* self) {
	g_return_if_fail (self != NULL);
	_edsf_persona_store_notify_if_default (self);
}


static void _edsf_persona_store_notify_if_default (EdsfPersonaStore* self) {
	gboolean is_default;
	ESourceRegistry* _tmp0_;
	g_return_if_fail (self != NULL);
	is_default = FALSE;
	_tmp0_ = self->priv->_source_registry;
	if (_tmp0_ != NULL) {
		ESource* default_source;
		ESourceRegistry* _tmp1_;
		ESource* _tmp2_;
		gboolean _tmp3_ = FALSE;
		ESource* _tmp4_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp1_ = self->priv->_source_registry;
		_tmp2_ = e_source_registry_ref_default_address_book (_tmp1_);
		default_source = _tmp2_;
		_tmp4_ = default_source;
		if (_tmp4_ != NULL) {
			ESource* _tmp5_;
			const gchar* _tmp6_;
			ESource* _tmp7_;
			const gchar* _tmp8_;
			_tmp5_ = self->priv->_source;
			_tmp6_ = e_source_get_uid (_tmp5_);
			_tmp7_ = default_source;
			_tmp8_ = e_source_get_uid (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, e_source_get_type (), ESource));
			_tmp3_ = g_strcmp0 (_tmp6_, _tmp8_) == 0;
		} else {
			_tmp3_ = FALSE;
		}
		if (_tmp3_) {
			is_default = TRUE;
		}
		_tmp9_ = is_default;
		_tmp10_ = folks_persona_store_get_is_user_set_default ((FolksPersonaStore*) self);
		_tmp11_ = _tmp10_;
		if (_tmp9_ != _tmp11_) {
			gboolean _tmp12_;
			_tmp12_ = is_default;
			folks_persona_store_set_is_user_set_default ((FolksPersonaStore*) self, _tmp12_);
		}
		_g_object_unref0 (default_source);
	}
}


static const gchar* edsf_persona_store_real_get_type_id (FolksPersonaStore* base) {
	const gchar* result;
	EdsfPersonaStore* self;
	self = (EdsfPersonaStore*) base;
	result = BACKEND_NAME;
	return result;
}


static FolksMaybeBool edsf_persona_store_real_get_can_add_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	EdsfPersonaStore* self;
	EBookClient* _tmp0_;
	FolksMaybeBool _tmp1_ = 0;
	EBookClient* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = (EdsfPersonaStore*) base;
	_tmp0_ = self->priv->_addressbook;
	if (_tmp0_ == NULL) {
		result = FOLKS_MAYBE_BOOL_FALSE;
		return result;
	}
	_tmp2_ = self->priv->_addressbook;
	g_object_get ((EClient*) G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, e_book_client_get_type (), EBookClient), "readonly", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		_tmp1_ = FOLKS_MAYBE_BOOL_FALSE;
	} else {
		_tmp1_ = FOLKS_MAYBE_BOOL_TRUE;
	}
	result = _tmp1_;
	return result;
}


static FolksMaybeBool edsf_persona_store_real_get_can_alias_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	EdsfPersonaStore* self;
	self = (EdsfPersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_FALSE;
	return result;
}


static FolksMaybeBool edsf_persona_store_real_get_can_group_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	EdsfPersonaStore* self;
	FolksMaybeBool _tmp0_ = 0;
	gchar** _tmp1_;
	gint _tmp1__length1;
	self = (EdsfPersonaStore*) base;
	_tmp1_ = self->priv->_always_writeable_properties;
	_tmp1__length1 = self->priv->_always_writeable_properties_length1;
	if (_vala_string_array_contains (_tmp1_, _tmp1__length1, "groups")) {
		_tmp0_ = FOLKS_MAYBE_BOOL_TRUE;
	} else {
		_tmp0_ = FOLKS_MAYBE_BOOL_FALSE;
	}
	result = _tmp0_;
	return result;
}


static FolksMaybeBool edsf_persona_store_real_get_can_remove_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	EdsfPersonaStore* self;
	EBookClient* _tmp0_;
	FolksMaybeBool _tmp1_ = 0;
	EBookClient* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	self = (EdsfPersonaStore*) base;
	_tmp0_ = self->priv->_addressbook;
	if (_tmp0_ == NULL) {
		result = FOLKS_MAYBE_BOOL_FALSE;
		return result;
	}
	_tmp2_ = self->priv->_addressbook;
	g_object_get ((EClient*) G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, e_book_client_get_type (), EBookClient), "readonly", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		_tmp1_ = FOLKS_MAYBE_BOOL_FALSE;
	} else {
		_tmp1_ = FOLKS_MAYBE_BOOL_TRUE;
	}
	result = _tmp1_;
	return result;
}


static gboolean edsf_persona_store_real_get_is_prepared (FolksPersonaStore* base) {
	gboolean result;
	EdsfPersonaStore* self;
	gboolean _tmp0_;
	self = (EdsfPersonaStore*) base;
	_tmp0_ = self->priv->_is_prepared;
	result = _tmp0_;
	return result;
}


static gchar** edsf_persona_store_real_get_always_writeable_properties (FolksPersonaStore* base, int* result_length1) {
	gchar** result;
	EdsfPersonaStore* self;
	gboolean _tmp0_ = FALSE;
	EBookClient* _tmp1_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gchar** _tmp8_;
	gint _tmp8__length1;
	self = (EdsfPersonaStore*) base;
	_tmp1_ = self->priv->_addressbook;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		EBookClient* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->_addressbook;
		g_object_get ((EClient*) G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, e_book_client_get_type (), EBookClient), "readonly", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ == TRUE;
	}
	if (_tmp0_) {
		gchar** _tmp5_;
		gint _tmp5__length1;
		gchar** _tmp6_;
		gint _tmp6__length1;
		_tmp5_ = edsf_persona_store__always_writeable_properties_empty;
		_tmp5__length1 = edsf_persona_store__always_writeable_properties_empty_length1;
		_tmp6_ = _tmp5_;
		_tmp6__length1 = _tmp5__length1;
		if (result_length1) {
			*result_length1 = _tmp6__length1;
		}
		result = _tmp6_;
		return result;
	}
	_tmp7_ = self->priv->_always_writeable_properties;
	_tmp7__length1 = self->priv->_always_writeable_properties_length1;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = _tmp7__length1;
	if (result_length1) {
		*result_length1 = _tmp8__length1;
	}
	result = _tmp8_;
	return result;
}


static gboolean edsf_persona_store_real_get_is_quiescent (FolksPersonaStore* base) {
	gboolean result;
	EdsfPersonaStore* self;
	gboolean _tmp0_;
	self = (EdsfPersonaStore*) base;
	_tmp0_ = self->priv->_is_quiescent;
	result = _tmp0_;
	return result;
}


static GeeMap* edsf_persona_store_real_get_personas (FolksPersonaStore* base) {
	GeeMap* result;
	EdsfPersonaStore* self;
	GeeMap* _tmp0_;
	self = (EdsfPersonaStore*) base;
	_tmp0_ = self->priv->_personas_ro;
	result = _tmp0_;
	return result;
}


ESource* edsf_persona_store_get_source (EdsfPersonaStore* self) {
	ESource* result;
	ESource* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source;
	result = _tmp0_;
	return result;
}


static void edsf_persona_store_set_source (EdsfPersonaStore* self, ESource* value) {
	g_return_if_fail (self != NULL);
	if (edsf_persona_store_get_source (self) != value) {
		ESource* _tmp0_;
		ESource* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (self->priv->_source);
		self->priv->_source = _tmp1_;
		g_object_notify ((GObject *) self, "source");
	}
}


static void __edsf_persona_store_source_changed_cb_e_source_changed (ESource* _sender, gpointer self) {
	_edsf_persona_store_source_changed_cb ((EdsfPersonaStore*) self);
}


static GObject * edsf_persona_store_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	EdsfPersonaStore * self;
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeMap* _tmp2_;
	GeeMap* _tmp3_;
	gchar* _tmp4_;
	ESource* _tmp5_;
	parent_class = G_OBJECT_CLASS (edsf_persona_store_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->_personas);
	self->priv->_personas = _tmp0_;
	_tmp1_ = self->priv->_personas;
	_tmp2_ = gee_abstract_map_get_read_only_view ((GeeAbstractMap*) _tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (self->priv->_personas_ro);
	self->priv->_personas_ro = _tmp3_;
	_tmp4_ = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
	_g_free0 (self->priv->_query_str);
	self->priv->_query_str = _tmp4_;
	_tmp5_ = self->priv->_source;
	g_signal_connect_object (_tmp5_, "changed", (GCallback) __edsf_persona_store_source_changed_cb_e_source_changed, self, 0);
	return obj;
}


static EdsfPersonaStoreIdleTask* edsf_persona_store_idle_task_construct (GType object_type) {
	EdsfPersonaStoreIdleTask* self = NULL;
	self = (EdsfPersonaStoreIdleTask*) g_type_create_instance (object_type);
	return self;
}


static EdsfPersonaStoreIdleTask* edsf_persona_store_idle_task_new (void) {
	return edsf_persona_store_idle_task_construct (EDSF_PERSONA_STORE_TYPE_IDLE_TASK);
}


static void edsf_persona_store_value_idle_task_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void edsf_persona_store_value_idle_task_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		edsf_persona_store_idle_task_unref (value->data[0].v_pointer);
	}
}


static void edsf_persona_store_value_idle_task_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = edsf_persona_store_idle_task_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer edsf_persona_store_value_idle_task_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* edsf_persona_store_value_idle_task_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		EdsfPersonaStoreIdleTask * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = edsf_persona_store_idle_task_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* edsf_persona_store_value_idle_task_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	EdsfPersonaStoreIdleTask ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = edsf_persona_store_idle_task_ref (value->data[0].v_pointer);
	}
	return NULL;
}


static GParamSpec* edsf_persona_store_param_spec_idle_task (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	EdsfPersonaStoreParamSpecIdleTask* spec;
	g_return_val_if_fail (g_type_is_a (object_type, EDSF_PERSONA_STORE_TYPE_IDLE_TASK), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


static gpointer edsf_persona_store_value_get_idle_task (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EDSF_PERSONA_STORE_TYPE_IDLE_TASK), NULL);
	return value->data[0].v_pointer;
}


static void edsf_persona_store_value_set_idle_task (GValue* value, gpointer v_object) {
	EdsfPersonaStoreIdleTask * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EDSF_PERSONA_STORE_TYPE_IDLE_TASK));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EDSF_PERSONA_STORE_TYPE_IDLE_TASK));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		edsf_persona_store_idle_task_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		edsf_persona_store_idle_task_unref (old);
	}
}


static void edsf_persona_store_value_take_idle_task (GValue* value, gpointer v_object) {
	EdsfPersonaStoreIdleTask * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EDSF_PERSONA_STORE_TYPE_IDLE_TASK));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EDSF_PERSONA_STORE_TYPE_IDLE_TASK));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		edsf_persona_store_idle_task_unref (old);
	}
}


static void edsf_persona_store_idle_task_class_init (EdsfPersonaStoreIdleTaskClass * klass) {
	edsf_persona_store_idle_task_parent_class = g_type_class_peek_parent (klass);
	((EdsfPersonaStoreIdleTaskClass *) klass)->finalize = edsf_persona_store_idle_task_finalize;
}


static void edsf_persona_store_idle_task_instance_init (EdsfPersonaStoreIdleTask * self) {
	self->ref_count = 1;
}


static void edsf_persona_store_idle_task_finalize (EdsfPersonaStoreIdleTask * obj) {
	EdsfPersonaStoreIdleTask * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EDSF_PERSONA_STORE_TYPE_IDLE_TASK, EdsfPersonaStoreIdleTask);
	g_signal_handlers_destroy (self);
	(self->callback_target_destroy_notify == NULL) ? NULL : (self->callback_target_destroy_notify (self->callback_target), NULL);
	self->callback = NULL;
	self->callback_target = NULL;
	self->callback_target_destroy_notify = NULL;
}


static GType edsf_persona_store_idle_task_get_type (void) {
	static volatile gsize edsf_persona_store_idle_task_type_id__volatile = 0;
	if (g_once_init_enter (&edsf_persona_store_idle_task_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { edsf_persona_store_value_idle_task_init, edsf_persona_store_value_idle_task_free_value, edsf_persona_store_value_idle_task_copy_value, edsf_persona_store_value_idle_task_peek_pointer, "p", edsf_persona_store_value_idle_task_collect_value, "p", edsf_persona_store_value_idle_task_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (EdsfPersonaStoreIdleTaskClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) edsf_persona_store_idle_task_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EdsfPersonaStoreIdleTask), 0, (GInstanceInitFunc) edsf_persona_store_idle_task_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType edsf_persona_store_idle_task_type_id;
		edsf_persona_store_idle_task_type_id = g_type_register_fundamental (g_type_fundamental_next (), "EdsfPersonaStoreIdleTask", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&edsf_persona_store_idle_task_type_id__volatile, edsf_persona_store_idle_task_type_id);
	}
	return edsf_persona_store_idle_task_type_id__volatile;
}


static gpointer edsf_persona_store_idle_task_ref (gpointer instance) {
	EdsfPersonaStoreIdleTask * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


static void edsf_persona_store_idle_task_unref (gpointer instance) {
	EdsfPersonaStoreIdleTask * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		EDSF_PERSONA_STORE_IDLE_TASK_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void edsf_persona_store_class_init (EdsfPersonaStoreClass * klass) {
	gchar** _tmp0_;
	edsf_persona_store_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (EdsfPersonaStorePrivate));
	((FolksPersonaStoreClass *) klass)->add_persona_from_details = edsf_persona_store_real_add_persona_from_details;
	((FolksPersonaStoreClass *) klass)->add_persona_from_details_finish = edsf_persona_store_real_add_persona_from_details_finish;
	((FolksPersonaStoreClass *) klass)->remove_persona = edsf_persona_store_real_remove_persona;
	((FolksPersonaStoreClass *) klass)->remove_persona_finish = edsf_persona_store_real_remove_persona_finish;
	((FolksPersonaStoreClass *) klass)->prepare = edsf_persona_store_real_prepare;
	((FolksPersonaStoreClass *) klass)->prepare_finish = edsf_persona_store_real_prepare_finish;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_type_id = edsf_persona_store_real_get_type_id;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_add_personas = edsf_persona_store_real_get_can_add_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_alias_personas = edsf_persona_store_real_get_can_alias_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_group_personas = edsf_persona_store_real_get_can_group_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_remove_personas = edsf_persona_store_real_get_can_remove_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_is_prepared = edsf_persona_store_real_get_is_prepared;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_always_writeable_properties = edsf_persona_store_real_get_always_writeable_properties;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_is_quiescent = edsf_persona_store_real_get_is_quiescent;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_personas = edsf_persona_store_real_get_personas;
	G_OBJECT_CLASS (klass)->get_property = _vala_edsf_persona_store_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_edsf_persona_store_set_property;
	G_OBJECT_CLASS (klass)->constructor = edsf_persona_store_constructor;
	G_OBJECT_CLASS (klass)->finalize = edsf_persona_store_finalize;
	/**
	   * The type of persona store this is.
	   *
	   * See {@link Folks.PersonaStore.type_id}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_TYPE_ID, g_param_spec_string ("type-id", "type-id", "type-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * Whether this PersonaStore can add {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_add_personas}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_CAN_ADD_PERSONAS, g_param_spec_enum ("can-add-personas", "can-add-personas", "can-add-personas", FOLKS_TYPE_MAYBE_BOOL, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * Whether this PersonaStore can set the alias of {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_alias_personas}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_CAN_ALIAS_PERSONAS, g_param_spec_enum ("can-alias-personas", "can-alias-personas", "can-alias-personas", FOLKS_TYPE_MAYBE_BOOL, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * Whether this PersonaStore can set the groups of {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_group_personas}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_CAN_GROUP_PERSONAS, g_param_spec_enum ("can-group-personas", "can-group-personas", "can-group-personas", FOLKS_TYPE_MAYBE_BOOL, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * Whether this PersonaStore can remove {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_remove_personas}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_CAN_REMOVE_PERSONAS, g_param_spec_enum ("can-remove-personas", "can-remove-personas", "can-remove-personas", FOLKS_TYPE_MAYBE_BOOL, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * Whether this PersonaStore has been prepared.
	   *
	   * See {@link Folks.PersonaStore.is_prepared}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_IS_PREPARED, g_param_spec_boolean ("is-prepared", "is-prepared", "is-prepared", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.2
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES, g_param_spec_boxed ("always-writeable-properties", "always-writeable-properties", "always-writeable-properties", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_IS_QUIESCENT, g_param_spec_boolean ("is-quiescent", "is-quiescent", "is-quiescent", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * The {@link Persona}s exposed by this PersonaStore.
	   *
	   * See {@link Folks.PersonaStore.personas}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_PERSONAS, g_param_spec_object ("personas", "personas", "personas", GEE_TYPE_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * The EDS {@link E.Source} associated with this persona store.
	   *
	   * @since 0.6.6
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_SOURCE, g_param_spec_object ("source", "source", "source", e_source_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	edsf_persona_store__always_writeable_properties_empty = _tmp0_;
	edsf_persona_store__always_writeable_properties_empty_length1 = 0;
}


static void edsf_persona_store_instance_init (EdsfPersonaStore * self) {
	gchar** _tmp0_;
	GeeLinkedList* _tmp1_;
	self->priv = EDSF_PERSONA_STORE_GET_PRIVATE (self);
	self->priv->_is_prepared = FALSE;
	self->priv->_prepare_pending = FALSE;
	self->priv->_is_quiescent = FALSE;
	self->priv->_pending_personas = NULL;
	self->priv->_addressbook = NULL;
	self->priv->_ebookview = NULL;
	self->priv->_source_registry = NULL;
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	self->priv->_always_writeable_properties = _tmp0_;
	self->priv->_always_writeable_properties_length1 = 0;
	self->priv->__always_writeable_properties_size_ = self->priv->_always_writeable_properties_length1;
	_tmp1_ = gee_linked_list_new (EDSF_PERSONA_STORE_TYPE_IDLE_TASK, (GBoxedCopyFunc) edsf_persona_store_idle_task_ref, edsf_persona_store_idle_task_unref, NULL, NULL, NULL);
	self->priv->_idle_tasks = (GeeQueue*) _tmp1_;
	self->priv->_idle_handle = (guint) 0;
}


static void edsf_persona_store_finalize (GObject * obj) {
	EdsfPersonaStore * self;
	GError * _inner_error_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore);
	{
		EBookClientView* _tmp0_;
		EBookClient* _tmp10_;
		ESourceRegistry* _tmp14_;
		_tmp0_ = self->priv->_ebookview;
		if (_tmp0_ != NULL) {
			EBookClientView* _tmp1_;
			guint _tmp2_;
			EBookClientView* _tmp3_;
			guint _tmp4_;
			EBookClientView* _tmp5_;
			guint _tmp6_;
			EBookClientView* _tmp7_;
			guint _tmp8_;
			EBookClientView* _tmp9_;
			_tmp1_ = self->priv->_ebookview;
			g_signal_parse_name ("objects-added", e_book_client_view_get_type (), &_tmp2_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, e_book_client_view_get_type (), EBookClientView), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) __edsf_persona_store_contacts_added_cb_e_book_client_view_objects_added, self);
			_tmp3_ = self->priv->_ebookview;
			g_signal_parse_name ("objects-removed", e_book_client_view_get_type (), &_tmp4_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, e_book_client_view_get_type (), EBookClientView), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) __edsf_persona_store_contacts_removed_cb_e_book_client_view_objects_removed, self);
			_tmp5_ = self->priv->_ebookview;
			g_signal_parse_name ("objects-modified", e_book_client_view_get_type (), &_tmp6_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, e_book_client_view_get_type (), EBookClientView), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) __edsf_persona_store_contacts_changed_cb_e_book_client_view_objects_modified, self);
			_tmp7_ = self->priv->_ebookview;
			g_signal_parse_name ("complete", e_book_client_view_get_type (), &_tmp8_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, e_book_client_view_get_type (), EBookClientView), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp8_, 0, NULL, (GCallback) __edsf_persona_store_contacts_complete_cb_e_book_client_view_complete, self);
			_tmp9_ = self->priv->_ebookview;
			e_book_client_view_stop (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, e_book_client_view_get_type (), EBookClientView), &_inner_error_);
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				goto __catch2_g_error;
			}
			_g_object_unref0 (self->priv->_ebookview);
			self->priv->_ebookview = NULL;
		}
		_tmp10_ = self->priv->_addressbook;
		if (_tmp10_ != NULL) {
			EBookClient* _tmp11_;
			guint _tmp12_;
			GQuark _tmp13_;
			_tmp11_ = self->priv->_addressbook;
			g_signal_parse_name ("notify::readonly", G_TYPE_OBJECT, &_tmp12_, &_tmp13_, TRUE);
			g_signal_handlers_disconnect_matched ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, e_book_client_get_type (), EBookClient), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp12_, _tmp13_, NULL, (GCallback) __edsf_persona_store_address_book_notify_read_only_cb_g_object_notify, self);
			_g_object_unref0 (self->priv->_addressbook);
			self->priv->_addressbook = NULL;
		}
		_tmp14_ = self->priv->_source_registry;
		if (_tmp14_ != NULL) {
			ESourceRegistry* _tmp15_;
			guint _tmp16_;
			ESourceRegistry* _tmp17_;
			guint _tmp18_;
			_tmp15_ = self->priv->_source_registry;
			g_signal_parse_name ("source-removed", e_source_registry_get_type (), &_tmp16_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, e_source_registry_get_type (), ESourceRegistry), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp16_, 0, NULL, (GCallback) __edsf_persona_store_source_registry_changed_cb_e_source_registry_source_removed, self);
			_tmp17_ = self->priv->_source_registry;
			g_signal_parse_name ("source-disabled", e_source_registry_get_type (), &_tmp18_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, e_source_registry_get_type (), ESourceRegistry), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp18_, 0, NULL, (GCallback) __edsf_persona_store_source_registry_changed_cb_e_source_registry_source_disabled, self);
			_g_object_unref0 (self->priv->_source_registry);
			self->priv->_source_registry = NULL;
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* e = NULL;
		gboolean _tmp19_ = FALSE;
		GError* _tmp20_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp20_ = e;
		if (!g_error_matches (_tmp20_, G_IO_ERROR, G_IO_ERROR_CLOSED)) {
			GError* _tmp21_;
			_tmp21_ = e;
			_tmp19_ = !g_error_matches (_tmp21_, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED);
		} else {
			_tmp19_ = FALSE;
		}
		if (_tmp19_) {
			GError* _tmp22_;
			const gchar* _tmp23_;
			_tmp22_ = e;
			_tmp23_ = _tmp22_->message;
			g_warning ("edsf-persona-store.vala:375: ~PersonaStore: %s\n", _tmp23_);
		}
		_g_error_free0 (e);
	}
	__finally2:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
	}
	_g_object_unref0 (self->priv->_personas);
	_g_object_unref0 (self->priv->_personas_ro);
	_g_object_unref0 (self->priv->_pending_personas);
	_g_object_unref0 (self->priv->_addressbook);
	_g_object_unref0 (self->priv->_ebookview);
	_g_object_unref0 (self->priv->_source_registry);
	_g_free0 (self->priv->_query_str);
	self->priv->_always_writeable_properties = (_vala_array_free (self->priv->_always_writeable_properties, self->priv->_always_writeable_properties_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->_source);
	_g_object_unref0 (self->priv->_idle_tasks);
	G_OBJECT_CLASS (edsf_persona_store_parent_class)->finalize (obj);
}


/**
 * A persona store representing a single EDS address book.
 *
 * The persona store will contain {@link Edsf.Persona}s for each contact in the
 * address book it represents.
 */
GType edsf_persona_store_get_type (void) {
	static volatile gsize edsf_persona_store_type_id__volatile = 0;
	if (g_once_init_enter (&edsf_persona_store_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (EdsfPersonaStoreClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) edsf_persona_store_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EdsfPersonaStore), 0, (GInstanceInitFunc) edsf_persona_store_instance_init, NULL };
		GType edsf_persona_store_type_id;
		edsf_persona_store_type_id = g_type_register_static (FOLKS_TYPE_PERSONA_STORE, "EdsfPersonaStore", &g_define_type_info, 0);
		g_once_init_leave (&edsf_persona_store_type_id__volatile, edsf_persona_store_type_id);
	}
	return edsf_persona_store_type_id__volatile;
}


static void _vala_edsf_persona_store_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	EdsfPersonaStore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore);
	switch (property_id) {
		case EDSF_PERSONA_STORE_TYPE_ID:
		g_value_set_string (value, folks_persona_store_get_type_id ((FolksPersonaStore*) self));
		break;
		case EDSF_PERSONA_STORE_CAN_ADD_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_add_personas ((FolksPersonaStore*) self));
		break;
		case EDSF_PERSONA_STORE_CAN_ALIAS_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_alias_personas ((FolksPersonaStore*) self));
		break;
		case EDSF_PERSONA_STORE_CAN_GROUP_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_group_personas ((FolksPersonaStore*) self));
		break;
		case EDSF_PERSONA_STORE_CAN_REMOVE_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_remove_personas ((FolksPersonaStore*) self));
		break;
		case EDSF_PERSONA_STORE_IS_PREPARED:
		g_value_set_boolean (value, folks_persona_store_get_is_prepared ((FolksPersonaStore*) self));
		break;
		case EDSF_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_store_get_always_writeable_properties ((FolksPersonaStore*) self, &length));
		}
		break;
		case EDSF_PERSONA_STORE_IS_QUIESCENT:
		g_value_set_boolean (value, folks_persona_store_get_is_quiescent ((FolksPersonaStore*) self));
		break;
		case EDSF_PERSONA_STORE_PERSONAS:
		g_value_set_object (value, folks_persona_store_get_personas ((FolksPersonaStore*) self));
		break;
		case EDSF_PERSONA_STORE_SOURCE:
		g_value_set_object (value, edsf_persona_store_get_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_edsf_persona_store_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	EdsfPersonaStore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore);
	switch (property_id) {
		case EDSF_PERSONA_STORE_SOURCE:
		edsf_persona_store_set_source (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



