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

/*
 * Copyright (C) 2011 Collabora Ltd.
 *
 * 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 <folks/folks.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <libebook/e-book-client.h>
#include <libedataserver/e-account.h>
#include <libedataserver/e-source.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <folks-internal.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 _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))
#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 _EdsfPersonaStoreOpenAddressBookData EdsfPersonaStoreOpenAddressBookData;
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
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 _EdsfPersonaStoreSetContactWebServiceAddressesData EdsfPersonaStoreSetContactWebServiceAddressesData;
typedef struct _EdsfPersonaStoreSetUrlsData EdsfPersonaStoreSetUrlsData;

#define EDSF_PERSONA_TYPE_URL_TYPE_MAPPING (edsf_persona_url_type_mapping_get_type ())
typedef struct _EdsfPersonaUrlTypeMapping EdsfPersonaUrlTypeMapping;
typedef struct _EdsfPersonaStoreSetContactUrlsData EdsfPersonaStoreSetContactUrlsData;
typedef struct _EdsfPersonaStoreSetLocalIdsData EdsfPersonaStoreSetLocalIdsData;
typedef struct _EdsfPersonaStoreSetContactLocalIdsData EdsfPersonaStoreSetContactLocalIdsData;
typedef struct _EdsfPersonaStoreSetIsFavouriteData EdsfPersonaStoreSetIsFavouriteData;
typedef struct _EdsfPersonaStoreSetContactIsFavouriteData EdsfPersonaStoreSetContactIsFavouriteData;
#define __vala_EContactPhoto_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactPhoto_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetContactAvatarData EdsfPersonaStoreSetContactAvatarData;
typedef struct _EdsfPersonaStoreSetEmailsData EdsfPersonaStoreSetEmailsData;
typedef struct _EdsfPersonaStoreSetPhonesData EdsfPersonaStoreSetPhonesData;
typedef struct _EdsfPersonaStoreSetPostalAddressesData EdsfPersonaStoreSetPostalAddressesData;
typedef struct _EdsfPersonaStoreSetContactPostalAddressesData EdsfPersonaStoreSetContactPostalAddressesData;
#define __g_list_free___vala_EVCardAttribute_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free___vala_EVCardAttribute_free0_ (var), NULL)))
typedef struct _EdsfPersonaStoreSetContactAttributesData EdsfPersonaStoreSetContactAttributesData;
typedef struct _EdsfPersonaStoreSetContactAttributesStringData EdsfPersonaStoreSetContactAttributesStringData;
typedef struct _EdsfPersonaStoreSetFullNameData EdsfPersonaStoreSetFullNameData;
typedef struct _EdsfPersonaStoreSetNicknameData EdsfPersonaStoreSetNicknameData;
typedef struct _EdsfPersonaStoreSetNotesData EdsfPersonaStoreSetNotesData;
typedef struct _EdsfPersonaStoreSetContactNotesData EdsfPersonaStoreSetContactNotesData;
typedef struct _EdsfPersonaStoreSetBirthdayData EdsfPersonaStoreSetBirthdayData;
#define __vala_EContactDate_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactDate_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetContactBirthdayData EdsfPersonaStoreSetContactBirthdayData;
typedef struct _EdsfPersonaStoreSetRolesData EdsfPersonaStoreSetRolesData;
typedef struct _EdsfPersonaStoreSetContactRolesData EdsfPersonaStoreSetContactRolesData;
typedef struct _EdsfPersonaStoreSetStructuredNameData EdsfPersonaStoreSetStructuredNameData;
#define __vala_EContactName_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactName_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetContactNameData EdsfPersonaStoreSetContactNameData;
typedef struct _EdsfPersonaStoreSetImFdsData EdsfPersonaStoreSetImFdsData;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _EdsfPersonaStoreSetContactImFdsData EdsfPersonaStoreSetContactImFdsData;
typedef struct _EdsfPersonaStoreSetGroupsData EdsfPersonaStoreSetGroupsData;
#define __g_list_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_free0_ (var), NULL)))
typedef struct _EdsfPersonaStoreSetContactGroupsData EdsfPersonaStoreSetContactGroupsData;
typedef struct _EdsfPersonaStoreSetGenderData EdsfPersonaStoreSetGenderData;
typedef struct _EdsfPersonaStoreSetContactGenderData EdsfPersonaStoreSetContactGenderData;

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

struct _EdsfPersonaStoreClass {
	FolksPersonaStoreClass parent_class;
};

struct _EdsfPersonaStorePrivate {
	GeeHashMap* _personas;
	GStaticRecMutex __lock__personas;
	GeeMap* _personas_ro;
	gboolean _is_prepared;
	GStaticRecMutex __lock__is_prepared;
	gboolean _prepare_pending;
	gboolean _is_quiescent;
	EBookClient* _addressbook;
	EBookClientView* _ebookview;
	ESourceList* _source_list;
	gchar* _query_str;
	gchar** _always_writeable_properties;
	gint _always_writeable_properties_length1;
	gint __always_writeable_properties_size_;
	ESource* _source;
	GError* _open_address_book_error;
	GSourceFunc _open_address_book_callback;
	gpointer _open_address_book_callback_target;
	GDestroyNotify _open_address_book_callback_target_destroy_notify;
};

struct _EdsfPersonaStoreAddPersonaFromDetailsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	GHashTable* details;
	FolksPersona* result;
	gboolean _tmp0_;
	GError* _tmp1_;
	EContact* _tmp2_;
	EContact* contact;
	GHashTable* _tmp3_;
	GHashTableIter iter;
	const gchar* k;
	GValue* _v;
	gconstpointer _tmp4_;
	gconstpointer _tmp5_;
	gboolean _tmp6_;
	GValue* _tmp7_;
	GValue* _tmp8_;
	GValue v;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* full_name;
	gboolean _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gboolean _tmp16_;
	EContact* _tmp17_;
	EContactField _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	GObject* _tmp22_;
	GeeSet* _tmp23_;
	GeeSet* email_addresses;
	EContact* _tmp24_;
	GeeSet* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	GObject* _tmp28_;
	GLoadableIcon* _tmp29_;
	GLoadableIcon* avatar;
	EContact* _tmp30_;
	GLoadableIcon* _tmp31_;
	GError* e1;
	GError* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	GObject* _tmp36_;
	GeeMultiMap* _tmp37_;
	GeeMultiMap* im_fds;
	EContact* _tmp38_;
	GeeMultiMap* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	GObject* _tmp42_;
	GeeSet* _tmp43_;
	GeeSet* phone_numbers;
	EContact* _tmp44_;
	GeeSet* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	GObject* _tmp48_;
	GeeSet* _tmp49_;
	GeeSet* postal_fds;
	EContact* _tmp50_;
	GeeSet* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	GObject* _tmp54_;
	FolksStructuredName* _tmp55_;
	FolksStructuredName* sname;
	EContact* _tmp56_;
	FolksStructuredName* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	GObject* _tmp60_;
	GeeSet* _tmp61_;
	GeeSet* local_ids;
	EContact* _tmp62_;
	GeeSet* _tmp63_;
	const gchar* _tmp64_;
	const gchar* _tmp65_;
	GObject* _tmp66_;
	GeeHashMultiMap* _tmp67_;
	GeeHashMultiMap* web_service_addresses;
	EContact* _tmp68_;
	GeeHashMultiMap* _tmp69_;
	const gchar* _tmp70_;
	const gchar* _tmp71_;
	GObject* _tmp72_;
	GeeHashSet* _tmp73_;
	GeeHashSet* notes;
	EContact* _tmp74_;
	GeeHashSet* _tmp75_;
	const gchar* _tmp76_;
	const gchar* _tmp77_;
	gint _tmp78_;
	FolksGender gender;
	EContact* _tmp79_;
	FolksGender _tmp80_;
	const gchar* _tmp81_;
	const gchar* _tmp82_;
	GObject* _tmp83_;
	GeeSet* _tmp84_;
	GeeSet* urls;
	EContact* _tmp85_;
	GeeSet* _tmp86_;
	const gchar* _tmp87_;
	const gchar* _tmp88_;
	void* _tmp89_;
	GDateTime* _tmp90_;
	GDateTime* birthday;
	EContact* _tmp91_;
	GDateTime* _tmp92_;
	const gchar* _tmp93_;
	const gchar* _tmp94_;
	GObject* _tmp95_;
	GeeSet* _tmp96_;
	GeeSet* roles;
	EContact* _tmp97_;
	GeeSet* _tmp98_;
	const gchar* _tmp99_;
	const gchar* _tmp100_;
	gboolean _tmp101_;
	gboolean is_fav;
	EContact* _tmp102_;
	gboolean _tmp103_;
	EdsfPersona* _persona;
	gchar* added_uid;
	EBookClient* _tmp104_;
	EContact* _tmp105_;
	gchar* _tmp106_;
	gboolean _tmp107_;
	gboolean _result_;
	gboolean _tmp108_;
	const gchar* _tmp109_;
	GeeHashMap* _tmp110_;
	const gchar* _tmp111_;
	const gchar* _tmp112_;
	const gchar* _tmp113_;
	gchar* _tmp114_;
	gchar* iid;
	GeeHashMap* _tmp115_;
	const gchar* _tmp116_;
	gpointer _tmp117_;
	EdsfPersona* _tmp118_;
	EdsfPersona* persona;
	EContact* _tmp119_;
	EContactField _tmp120_;
	const gchar* _tmp121_;
	EContact* _tmp122_;
	EdsfPersona* _tmp123_;
	GeeHashMap* _tmp124_;
	EdsfPersona* _tmp125_;
	const gchar* _tmp126_;
	const gchar* _tmp127_;
	EdsfPersona* _tmp128_;
	GeeHashSet* _tmp129_;
	GeeHashSet* added_personas;
	GeeHashSet* _tmp130_;
	EdsfPersona* _tmp131_;
	GeeHashSet* _tmp132_;
	EdsfPersona* _tmp133_;
	EdsfPersona* _tmp134_;
	GeeHashMap* _tmp135_;
	GError* _tmp136_;
	GError* e;
	GError* _tmp137_;
	const gchar* _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_;
	GQuark _tmp7_;
	GQuark _tmp8_;
	GError* _tmp9_;
	gint _tmp10_;
	GError* _tmp11_;
	GQuark _tmp12_;
	GQuark _tmp13_;
	GError* _tmp14_;
	gint _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	FolksPersona* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	GError* _tmp22_;
	const gchar* _tmp23_;
	FolksPersona* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	GError* _tmp27_;
	const gchar* _tmp28_;
	GError* _tmp29_;
	const gchar* _tmp30_;
	GError* _tmp31_;
	const gchar* _tmp32_;
	GError* _tmp33_;
	const gchar* _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;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	ESourceList* _tmp6_;
	ESourceList* _tmp7_;
	ESource* _tmp8_;
	EBookClient* _tmp9_;
	EBookClient* _tmp10_;
	EBookClient* _tmp11_;
	EBookClient* _tmp12_;
	EBookClient* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	GError* e1;
	GError* _tmp16_;
	GQuark _tmp17_;
	GQuark _tmp18_;
	GError* _tmp19_;
	gint _tmp20_;
	GError* _tmp21_;
	GQuark _tmp22_;
	GQuark _tmp23_;
	GError* _tmp24_;
	gint _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	GError* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	GError* _tmp33_;
	const gchar* _tmp34_;
	GError* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	GError* _tmp39_;
	const gchar* _tmp40_;
	GError* _tmp41_;
	gchar* supported_fields;
	EBookClient* _tmp42_;
	gchar* _tmp43_;
	GeeHashSet* _tmp44_;
	GeeHashSet* prop_set;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	gchar** _tmp47_;
	gchar** _tmp48_;
	gchar** fields;
	gint fields_length1;
	gint _fields_size_;
	GeeHashSet* _tmp49_;
	const gchar* _tmp50_;
	GeeHashSet* _tmp51_;
	const gchar* _tmp52_;
	GeeHashSet* _tmp53_;
	const gchar* _tmp54_;
	GeeHashSet* _tmp55_;
	const gchar* _tmp56_;
	gchar** _tmp57_;
	gint _tmp57__length1;
	gchar** field_collection;
	gint field_collection_length1;
	gint _field_collection_size_;
	gint field_it;
	const gchar* field;
	const gchar* _tmp58_;
	FolksPersonaDetail _tmp59_;
	const gchar* _tmp60_;
	gchar* _tmp61_;
	gchar* prop;
	const gchar* _tmp62_;
	GeeHashSet* _tmp63_;
	gchar* _tmp64_;
	gchar* _tmp65_;
	GeeHashSet* _tmp66_;
	gint _tmp67_;
	gint _tmp68_;
	gchar** _tmp69_;
	guint i;
	GeeHashSet* _tmp70_;
	GeeIterator* _tmp71_;
	GeeIterator* _final_prop_it;
	GeeIterator* _tmp72_;
	gboolean _tmp73_;
	GeeIterator* _tmp74_;
	gpointer _tmp75_;
	gchar* final_prop;
	gchar** _tmp76_;
	gint _tmp76__length1;
	guint _tmp77_;
	const gchar* _tmp78_;
	gchar* _tmp79_;
	gchar* _tmp80_;
	GError* e2;
	const gchar* _tmp81_;
	GError* _tmp82_;
	const gchar* _tmp83_;
	GError* _tmp84_;
	gboolean do_initial_query;
	gchar* capabilities;
	EBookClient* _tmp85_;
	gchar* _tmp86_;
	const gchar* _tmp87_;
	const gchar* _tmp88_;
	gchar** _tmp89_;
	gchar** _tmp90_;
	gchar** caps;
	gint caps_length1;
	gint _caps_size_;
	gchar** _tmp91_;
	gint _tmp91__length1;
	GError* e4;
	const gchar* _tmp92_;
	GError* _tmp93_;
	const gchar* _tmp94_;
	GError* _tmp95_;
	gboolean got_view;
	EBookClient* _tmp96_;
	const gchar* _tmp97_;
	EBookClientView* _tmp98_;
	gboolean _tmp99_;
	gboolean _tmp100_;
	gboolean _tmp101_;
	const gchar* _tmp102_;
	const gchar* _tmp103_;
	const gchar* _tmp104_;
	GError* _tmp105_;
	EBookClientView* _tmp106_;
	EBookClientView* _tmp107_;
	EBookClientView* _tmp108_;
	EBookClientView* _tmp109_;
	EBookClientView* _tmp110_;
	GError* e3;
	GError* _tmp111_;
	GQuark _tmp112_;
	GQuark _tmp113_;
	GError* _tmp114_;
	gint _tmp115_;
	GError* _tmp116_;
	GQuark _tmp117_;
	GQuark _tmp118_;
	GError* _tmp119_;
	gint _tmp120_;
	const gchar* _tmp121_;
	const gchar* _tmp122_;
	const gchar* _tmp123_;
	GError* _tmp124_;
	const gchar* _tmp125_;
	const gchar* _tmp126_;
	const gchar* _tmp127_;
	GError* _tmp128_;
	const gchar* _tmp129_;
	GError* _tmp130_;
	const gchar* _tmp131_;
	const gchar* _tmp132_;
	const gchar* _tmp133_;
	GError* _tmp134_;
	const gchar* _tmp135_;
	GError* _tmp136_;
	gboolean _tmp137_;
	gboolean _tmp138_;
	gboolean _tmp139_;
	gboolean _tmp140_;
	gboolean _tmp141_;
	GError * _inner_error_;
};

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

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

struct _Block3Data {
	int _ref_count_;
	Block2Data * _data2_;
	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;
	Block2Data* _data2_;
	EBookClient* _tmp0_;
	EdsfPersona* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* _tmp4_;
	EContact* contact;
	gulong signal_id;
	guint timeout_id;
	Block3Data* _data3_;
	EdsfPersona* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gulong _tmp8_;
	EBookClient* _tmp9_;
	EContact* _tmp10_;
	guint _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	GError* _tmp16_;
	GError* e;
	const gchar* _tmp17_;
	GError* _tmp18_;
	GError* _tmp19_;
	EdsfPersona* _tmp20_;
	gulong _tmp21_;
	guint _tmp22_;
	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;
	const gchar* _tmp1_;
	GError* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	EdsfPersona* _tmp5_;
	GLoadableIcon* _tmp6_;
	GLoadableIcon* _tmp7_;
	GLoadableIcon* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	EdsfPersona* _tmp11_;
	GLoadableIcon* _tmp12_;
	GLoadableIcon* _tmp13_;
	EdsfPersona* _tmp14_;
	GLoadableIcon* _tmp15_;
	GLoadableIcon* _tmp16_;
	GLoadableIcon* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	EdsfPersona* _tmp21_;
	EContact* _tmp22_;
	EContact* _tmp23_;
	GLoadableIcon* _tmp24_;
	EdsfPersona* _tmp25_;
	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;
	const gchar* _tmp1_;
	GError* _tmp2_;
	EdsfPersona* _tmp3_;
	GeeMultiMap* _tmp4_;
	GeeMultiMap* _tmp5_;
	GeeMultiMap* _tmp6_;
	gboolean _tmp7_;
	EdsfPersona* _tmp8_;
	EContact* _tmp9_;
	EContact* _tmp10_;
	GeeMultiMap* _tmp11_;
	EdsfPersona* _tmp12_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetContactWebServiceAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeMultiMap* web_service_addresses;
	EContact* _tmp0_;
	EVCardAttribute* _tmp1_;
	EVCardAttribute* attr_n;
	GeeMultiMap* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	GeeIterator* _tmp5_;
	GeeIterator* _tmp6_;
	GeeIterator* _service_it;
	GeeIterator* _tmp7_;
	gboolean _tmp8_;
	GeeIterator* _tmp9_;
	gpointer _tmp10_;
	gchar* service;
	const gchar* _tmp11_;
	EVCardAttributeParam* _tmp12_;
	EVCardAttributeParam* param;
	GeeMultiMap* _tmp13_;
	const gchar* _tmp14_;
	GeeCollection* _tmp15_;
	GeeCollection* _tmp16_;
	GeeIterator* _tmp17_;
	GeeIterator* _tmp18_;
	GeeIterator* _ws_fd_it;
	GeeIterator* _tmp19_;
	gboolean _tmp20_;
	GeeIterator* _tmp21_;
	gpointer _tmp22_;
	FolksWebServiceFieldDetails* ws_fd;
	EVCardAttributeParam* _tmp23_;
	FolksWebServiceFieldDetails* _tmp24_;
	gconstpointer _tmp25_;
	const gchar* _tmp26_;
	EVCardAttribute* _tmp27_;
	EVCardAttributeParam* _tmp28_;
	EVCardAttributeParam* _tmp29_;
	EContact* _tmp30_;
	EVCardAttribute* _tmp31_;
};

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

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

struct _EdsfPersonaStoreSetContactUrlsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* urls;
	EContact* _tmp0_;
	EVCard* _tmp1_;
	EVCard* vcard;
	EVCard* _tmp2_;
	GeeSet* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _u_it;
	GeeIterator* _tmp5_;
	gboolean _tmp6_;
	GeeIterator* _tmp7_;
	gpointer _tmp8_;
	FolksUrlFieldDetails* u;
	gboolean set_attr_already;
	EVCardAttribute* _tmp9_;
	EVCardAttribute* attr;
	EVCardAttribute* _tmp10_;
	FolksUrlFieldDetails* _tmp11_;
	gconstpointer _tmp12_;
	const gchar* _tmp13_;
	FolksUrlFieldDetails* _tmp14_;
	GeeMultiMap* _tmp15_;
	GeeMultiMap* _tmp16_;
	GeeSet* _tmp17_;
	GeeSet* _tmp18_;
	GeeIterator* _tmp19_;
	GeeIterator* _tmp20_;
	GeeIterator* _param_name_it;
	GeeIterator* _tmp21_;
	gboolean _tmp22_;
	GeeIterator* _tmp23_;
	gpointer _tmp24_;
	gchar* param_name;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	EVCardAttributeParam* _tmp28_;
	EVCardAttributeParam* _tmp29_;
	EVCardAttributeParam* param;
	FolksUrlFieldDetails* _tmp30_;
	GeeMultiMap* _tmp31_;
	GeeMultiMap* _tmp32_;
	const gchar* _tmp33_;
	GeeCollection* _tmp34_;
	GeeCollection* _tmp35_;
	GeeIterator* _tmp36_;
	GeeIterator* _tmp37_;
	GeeIterator* _param_val_it;
	GeeIterator* _tmp38_;
	gboolean _tmp39_;
	GeeIterator* _tmp40_;
	gpointer _tmp41_;
	gchar* param_val;
	const gchar* _tmp42_;
	EdsfPersonaUrlTypeMapping* mapping_collection;
	gint mapping_collection_length1;
	gint _mapping_collection_size_;
	gint mapping_it;
	EdsfPersonaUrlTypeMapping mapping;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	EdsfPersonaUrlTypeMapping _tmp46_;
	const gchar* _tmp47_;
	gboolean _tmp48_;
	EContact* _tmp49_;
	EdsfPersonaUrlTypeMapping _tmp50_;
	const gchar* _tmp51_;
	EContactField _tmp52_;
	FolksUrlFieldDetails* _tmp53_;
	gconstpointer _tmp54_;
	const gchar* _tmp55_;
	gboolean _tmp56_;
	EVCardAttributeParam* _tmp57_;
	const gchar* _tmp58_;
	gboolean _tmp59_;
	EVCardAttribute* _tmp60_;
	EVCardAttributeParam* _tmp61_;
	EVCardAttributeParam* _tmp62_;
	gboolean _tmp63_;
	EContact* _tmp64_;
	EVCardAttribute* _tmp65_;
};

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

struct _EdsfPersonaStoreSetContactLocalIdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* local_ids;
	EContact* _tmp0_;
	EVCardAttribute* _tmp1_;
	EVCardAttribute* new_attr;
	GeeSet* _tmp2_;
	GeeIterator* _tmp3_;
	GeeIterator* _local_id_it;
	GeeIterator* _tmp4_;
	gboolean _tmp5_;
	GeeIterator* _tmp6_;
	gpointer _tmp7_;
	gchar* local_id;
	EVCardAttribute* _tmp8_;
	const gchar* _tmp9_;
	EContact* _tmp10_;
	EVCardAttribute* _tmp11_;
};

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

struct _EdsfPersonaStoreSetContactIsFavouriteData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	gboolean is_favourite;
	EContact* _tmp0_;
	gboolean _tmp1_;
	EVCardAttribute* _tmp2_;
	EVCardAttribute* new_attr;
	EVCardAttribute* _tmp3_;
	EContact* _tmp4_;
	EVCardAttribute* _tmp5_;
};

struct _EdsfPersonaStoreSetContactAvatarData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GLoadableIcon* avatar;
	GLoadableIcon* _tmp0_;
	EContact* _tmp1_;
	EContactPhoto* _tmp2_;
	EContactPhoto* cp;
	EContactPhoto* _tmp3_;
	GLoadableIcon* _tmp4_;
	GInputStream* _tmp5_;
	GInputStream* input_s;
	guint8* _tmp6_;
	guint8* image_data;
	gint image_data_length1;
	gint _image_data_size_;
	guint8* _tmp7_;
	guint8* buffer;
	gint buffer_length1;
	gint _buffer_size_;
	GInputStream* _tmp8_;
	guint8* _tmp9_;
	gint _tmp9__length1;
	gssize _tmp10_;
	gssize size_read;
	gssize _tmp11_;
	guint8* _tmp12_;
	gint _tmp12__length1;
	gint read_cur;
	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;
	guint8* _tmp22_;
	gint _tmp22__length1;
	gboolean _tmp23_;
	gchar* _tmp24_;
	gchar* mime_type;
	gboolean _tmp25_;
	EContactPhoto* _tmp26_;
	const gchar* _tmp27_;
	EContact* _tmp28_;
	EContactPhoto* _tmp29_;
	GError* e1;
	const gchar* _tmp30_;
	GError* _tmp31_;
	const gchar* _tmp32_;
	GError* _tmp33_;
	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;
	const gchar* _tmp1_;
	GError* _tmp2_;
	EdsfPersona* _tmp3_;
	EContact* _tmp4_;
	EContact* _tmp5_;
	GeeSet* _tmp6_;
	EdsfPersona* _tmp7_;
	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;
	const gchar* _tmp1_;
	GError* _tmp2_;
	EdsfPersona* _tmp3_;
	EContact* _tmp4_;
	EContact* _tmp5_;
	GeeSet* _tmp6_;
	EdsfPersona* _tmp7_;
	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;
	const gchar* _tmp1_;
	GError* _tmp2_;
	EdsfPersona* _tmp3_;
	EContact* _tmp4_;
	EContact* _tmp5_;
	GeeSet* _tmp6_;
	EdsfPersona* _tmp7_;
	GError * _inner_error_;
};

typedef void (*EdsfPersonaStoreFieldToAttribute) (EVCardAttribute* attr, gconstpointer value, void* user_data);
struct _EdsfPersonaStoreSetContactPostalAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* postal_fds;
	EContact* _tmp0_;
	GeeSet* _tmp1_;
};

struct _EdsfPersonaStoreSetContactAttributesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* new_attributes;
	EdsfPersonaStoreFieldToAttribute fill_attribute;
	gpointer fill_attribute_target;
	gchar* attrib_name;
	EContactField field_id;
	GType t_type;
	GBoxedCopyFunc t_dup_func;
	GDestroyNotify t_destroy_func;
	GList* attributes;
	GeeSet* _tmp0_;
	GeeIterator* _tmp1_;
	GeeIterator* _e_it;
	GeeIterator* _tmp2_;
	gboolean _tmp3_;
	GeeIterator* _tmp4_;
	gpointer _tmp5_;
	FolksAbstractFieldDetails* e;
	const gchar* _tmp6_;
	EVCardAttribute* _tmp7_;
	EVCardAttribute* attr;
	EdsfPersonaStoreFieldToAttribute _tmp8_;
	void* _tmp8__target;
	EVCardAttribute* _tmp9_;
	FolksAbstractFieldDetails* _tmp10_;
	gconstpointer _tmp11_;
	gconstpointer _tmp12_;
	FolksAbstractFieldDetails* _tmp13_;
	GeeMultiMap* _tmp14_;
	GeeMultiMap* _tmp15_;
	GeeSet* _tmp16_;
	GeeSet* _tmp17_;
	GeeIterator* _tmp18_;
	GeeIterator* _tmp19_;
	GeeIterator* _param_name_it;
	GeeIterator* _tmp20_;
	gboolean _tmp21_;
	GeeIterator* _tmp22_;
	gpointer _tmp23_;
	gchar* param_name;
	const gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	EVCardAttributeParam* _tmp27_;
	EVCardAttributeParam* _tmp28_;
	EVCardAttributeParam* param;
	FolksAbstractFieldDetails* _tmp29_;
	GeeMultiMap* _tmp30_;
	GeeMultiMap* _tmp31_;
	const gchar* _tmp32_;
	GeeCollection* _tmp33_;
	GeeCollection* _tmp34_;
	GeeIterator* _tmp35_;
	GeeIterator* _tmp36_;
	GeeIterator* _param_val_it;
	GeeIterator* _tmp37_;
	gboolean _tmp38_;
	GeeIterator* _tmp39_;
	gpointer _tmp40_;
	gchar* param_val;
	EVCardAttributeParam* _tmp41_;
	const gchar* _tmp42_;
	EVCardAttribute* _tmp43_;
	EVCardAttributeParam* _tmp44_;
	EVCardAttributeParam* _tmp45_;
	EVCardAttribute* _tmp46_;
	EContact* _tmp47_;
	EContactField _tmp48_;
	GList* _tmp49_;
};

struct _EdsfPersonaStoreSetContactAttributesStringData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* new_attributes;
	gchar* attrib_name;
	EContactField field_id;
	EContact* _tmp0_;
	GeeSet* _tmp1_;
	const gchar* _tmp2_;
	EContactField _tmp3_;
};

struct _EdsfPersonaStoreSetFullNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	gchar* full_name;
	gchar** _tmp0_;
	gint _tmp0__length1;
	const gchar* _tmp1_;
	GError* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _full_name;
	const gchar* _tmp5_;
	EdsfPersona* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	EdsfPersona* _tmp10_;
	EContact* _tmp11_;
	EContact* _tmp12_;
	EContactField _tmp13_;
	const gchar* _tmp14_;
	EdsfPersona* _tmp15_;
	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;
	const gchar* _tmp1_;
	GError* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _nickname;
	const gchar* _tmp5_;
	EdsfPersona* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	EdsfPersona* _tmp10_;
	EContact* _tmp11_;
	EContact* _tmp12_;
	EContactField _tmp13_;
	const gchar* _tmp14_;
	EdsfPersona* _tmp15_;
	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;
	const gchar* _tmp1_;
	GError* _tmp2_;
	EdsfPersona* _tmp3_;
	EContact* _tmp4_;
	EContact* _tmp5_;
	GeeSet* _tmp6_;
	EdsfPersona* _tmp7_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetContactNotesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* notes;
	gchar* _tmp0_;
	gchar* note_str;
	GeeSet* _tmp1_;
	GeeIterator* _tmp2_;
	GeeIterator* _note_it;
	GeeIterator* _tmp3_;
	gboolean _tmp4_;
	GeeIterator* _tmp5_;
	gpointer _tmp6_;
	FolksNoteFieldDetails* note;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	FolksNoteFieldDetails* _tmp11_;
	gconstpointer _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	EContact* _tmp15_;
	EContactField _tmp16_;
	const gchar* _tmp17_;
};

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

struct _EdsfPersonaStoreSetContactBirthdayData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GDateTime* _bday;
	EContactDate* _contact_bday;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* bday;
	EContactDate* contact_bday;
	EContactDate* _tmp3_;
	EContactDate* _tmp4_;
	GDateTime* _tmp5_;
	gint _tmp6_;
	EContactDate* _tmp7_;
	GDateTime* _tmp8_;
	gint _tmp9_;
	EContactDate* _tmp10_;
	GDateTime* _tmp11_;
	gint _tmp12_;
	EContactDate* _tmp13_;
	EContactDate* _tmp14_;
	EContact* _tmp15_;
	EContactField _tmp16_;
	EContactDate* _tmp17_;
};

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

struct _EdsfPersonaStoreSetContactRolesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* roles;
	EContact* _tmp0_;
	EVCard* _tmp1_;
	EVCard* vcard;
	EVCard* _tmp2_;
	gchar* org;
	gchar* org_unit;
	gchar* office;
	gchar* title;
	gchar* role;
	gchar* manager;
	gchar* assistant;
	gint count;
	GeeSet* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _role_fd_it;
	GeeIterator* _tmp5_;
	gboolean _tmp6_;
	GeeIterator* _tmp7_;
	gpointer _tmp8_;
	FolksRoleFieldDetails* role_fd;
	gint _tmp9_;
	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_;
	FolksRoleFieldDetails* _tmp28_;
	GeeCollection* _tmp29_;
	GeeCollection* org_unit_values;
	gboolean _tmp30_;
	GeeCollection* _tmp31_;
	GeeCollection* _tmp32_;
	gint _tmp33_;
	gint _tmp34_;
	gboolean _tmp35_;
	GeeCollection* _tmp36_;
	gint _tmp37_;
	gpointer* _tmp38_;
	gchar** _tmp39_;
	gint _tmp39__length1;
	const gchar* _tmp40_;
	gchar* _tmp41_;
	FolksRoleFieldDetails* _tmp42_;
	GeeCollection* _tmp43_;
	GeeCollection* office_values;
	gboolean _tmp44_;
	GeeCollection* _tmp45_;
	GeeCollection* _tmp46_;
	gint _tmp47_;
	gint _tmp48_;
	gboolean _tmp49_;
	GeeCollection* _tmp50_;
	gint _tmp51_;
	gpointer* _tmp52_;
	gchar** _tmp53_;
	gint _tmp53__length1;
	const gchar* _tmp54_;
	gchar* _tmp55_;
	FolksRoleFieldDetails* _tmp56_;
	GeeCollection* _tmp57_;
	GeeCollection* manager_values;
	gboolean _tmp58_;
	GeeCollection* _tmp59_;
	GeeCollection* _tmp60_;
	gint _tmp61_;
	gint _tmp62_;
	gboolean _tmp63_;
	GeeCollection* _tmp64_;
	gint _tmp65_;
	gpointer* _tmp66_;
	gchar** _tmp67_;
	gint _tmp67__length1;
	const gchar* _tmp68_;
	gchar* _tmp69_;
	FolksRoleFieldDetails* _tmp70_;
	GeeCollection* _tmp71_;
	GeeCollection* assistant_values;
	gboolean _tmp72_;
	GeeCollection* _tmp73_;
	GeeCollection* _tmp74_;
	gint _tmp75_;
	gint _tmp76_;
	gboolean _tmp77_;
	GeeCollection* _tmp78_;
	gint _tmp79_;
	gpointer* _tmp80_;
	gchar** _tmp81_;
	gint _tmp81__length1;
	const gchar* _tmp82_;
	gchar* _tmp83_;
	EVCardAttribute* _tmp84_;
	EVCardAttribute* attr;
	EVCardAttribute* _tmp85_;
	FolksRoleFieldDetails* _tmp86_;
	gconstpointer _tmp87_;
	FolksRole* _tmp88_;
	const gchar* _tmp89_;
	const gchar* _tmp90_;
	EVCardAttributeParam* _tmp91_;
	EVCardAttributeParam* param1;
	EVCardAttributeParam* _tmp92_;
	FolksRoleFieldDetails* _tmp93_;
	gconstpointer _tmp94_;
	FolksRole* _tmp95_;
	const gchar* _tmp96_;
	const gchar* _tmp97_;
	EVCardAttribute* _tmp98_;
	EVCardAttributeParam* _tmp99_;
	EVCardAttributeParam* _tmp100_;
	EVCardAttributeParam* _tmp101_;
	EVCardAttributeParam* param2;
	EVCardAttributeParam* _tmp102_;
	FolksRoleFieldDetails* _tmp103_;
	gconstpointer _tmp104_;
	FolksRole* _tmp105_;
	const gchar* _tmp106_;
	const gchar* _tmp107_;
	EVCardAttribute* _tmp108_;
	EVCardAttributeParam* _tmp109_;
	EVCardAttributeParam* _tmp110_;
	FolksRoleFieldDetails* _tmp111_;
	GeeMultiMap* _tmp112_;
	GeeMultiMap* _tmp113_;
	GeeSet* _tmp114_;
	GeeSet* _tmp115_;
	GeeIterator* _tmp116_;
	GeeIterator* _tmp117_;
	GeeIterator* _param_name_it;
	GeeIterator* _tmp118_;
	gboolean _tmp119_;
	GeeIterator* _tmp120_;
	gpointer _tmp121_;
	gchar* param_name;
	const gchar* _tmp122_;
	gchar* _tmp123_;
	gchar* _tmp124_;
	EVCardAttributeParam* _tmp125_;
	EVCardAttributeParam* _tmp126_;
	EVCardAttributeParam* param3;
	FolksRoleFieldDetails* _tmp127_;
	GeeMultiMap* _tmp128_;
	GeeMultiMap* _tmp129_;
	const gchar* _tmp130_;
	GeeCollection* _tmp131_;
	GeeCollection* _tmp132_;
	GeeIterator* _tmp133_;
	GeeIterator* _tmp134_;
	GeeIterator* _param_val_it;
	GeeIterator* _tmp135_;
	gboolean _tmp136_;
	GeeIterator* _tmp137_;
	gpointer _tmp138_;
	gchar* param_val;
	EVCardAttributeParam* _tmp139_;
	const gchar* _tmp140_;
	EVCardAttribute* _tmp141_;
	EVCardAttributeParam* _tmp142_;
	EVCardAttributeParam* _tmp143_;
	EContact* _tmp144_;
	EVCardAttribute* _tmp145_;
	gint _tmp146_;
	EContact* _tmp147_;
	EContactField _tmp148_;
	const gchar* _tmp149_;
	EContact* _tmp150_;
	EContactField _tmp151_;
	const gchar* _tmp152_;
	EContact* _tmp153_;
	EContactField _tmp154_;
	const gchar* _tmp155_;
	EContact* _tmp156_;
	EContactField _tmp157_;
	const gchar* _tmp158_;
	EContact* _tmp159_;
	EContactField _tmp160_;
	const gchar* _tmp161_;
	EContact* _tmp162_;
	EContactField _tmp163_;
	const gchar* _tmp164_;
	EContact* _tmp165_;
	EContactField _tmp166_;
	const gchar* _tmp167_;
};

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

struct _EdsfPersonaStoreSetContactNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	FolksStructuredName* _sname;
	EContactName* _tmp0_;
	EContactName* contact_name;
	FolksStructuredName* _tmp1_;
	FolksStructuredName* _tmp2_;
	FolksStructuredName* _tmp3_;
	FolksStructuredName* sname;
	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_;
	EContact* _tmp29_;
	EContactField _tmp30_;
	EContactName* _tmp31_;
};

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

struct _EdsfPersonaStoreSetContactImFdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeMultiMap* im_fds;
	GHashTable* _tmp0_;
	GHashTable* im_eds_map;
	GHashTable* _tmp1_;
	GList* _tmp2_;
	GList* field_id_collection;
	GList* field_id_it;
	EContactField field_id;
	EContact* _tmp3_;
	EContactField _tmp4_;
	const gchar* _tmp5_;
	GeeMultiMap* _tmp6_;
	GeeSet* _tmp7_;
	GeeSet* _tmp8_;
	GeeIterator* _tmp9_;
	GeeIterator* _tmp10_;
	GeeIterator* _proto_it;
	GeeIterator* _tmp11_;
	gboolean _tmp12_;
	GeeIterator* _tmp13_;
	gpointer _tmp14_;
	gchar* proto;
	GList* attributes;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* attrib_name;
	gboolean added;
	GeeMultiMap* _tmp20_;
	const gchar* _tmp21_;
	GeeCollection* _tmp22_;
	GeeCollection* _tmp23_;
	GeeIterator* _tmp24_;
	GeeIterator* _tmp25_;
	GeeIterator* _im_fd_it;
	GeeIterator* _tmp26_;
	gboolean _tmp27_;
	GeeIterator* _tmp28_;
	gpointer _tmp29_;
	FolksImFieldDetails* im_fd;
	const gchar* _tmp30_;
	EVCardAttribute* _tmp31_;
	EVCardAttribute* attr_n;
	EVCardAttribute* _tmp32_;
	FolksImFieldDetails* _tmp33_;
	gconstpointer _tmp34_;
	const gchar* _tmp35_;
	EVCardAttribute* _tmp36_;
	gboolean _tmp37_;
	GHashTable* _tmp38_;
	const gchar* _tmp39_;
	gconstpointer _tmp40_;
	EContactField field_id_t;
	EContact* _tmp41_;
	EContactField _tmp42_;
	GList* _tmp43_;
};

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

struct _EdsfPersonaStoreSetContactGroupsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* groups;
	GList* categories;
	GeeSet* _tmp0_;
	GeeIterator* _tmp1_;
	GeeIterator* _group_it;
	GeeIterator* _tmp2_;
	gboolean _tmp3_;
	GeeIterator* _tmp4_;
	gpointer _tmp5_;
	gchar* group;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	EContact* _tmp9_;
	GList* _tmp10_;
};

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

struct _EdsfPersonaStoreSetContactGenderData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	FolksGender gender;
	EContact* _tmp0_;
	EVCardAttribute* _tmp1_;
	EVCardAttribute* new_attr;
	FolksGender _tmp2_;
	EVCardAttribute* _tmp3_;
	EContact* _tmp4_;
	EVCardAttribute* _tmp5_;
	EVCardAttribute* _tmp6_;
	EContact* _tmp7_;
	EVCardAttribute* _tmp8_;
};


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;

GType edsf_persona_store_get_type (void) G_GNUC_CONST;
GType edsf_persona_get_type (void) G_GNUC_CONST;
#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 gboolean _edsf_persona_store_address_book_authenticate_cb (EdsfPersonaStore* self, EClient* address_book, void* credentials);
static gboolean __edsf_persona_store_address_book_authenticate_cb_e_client_authenticate (EClient* _sender, void* credentials, 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_list_changed_cb (EdsfPersonaStore* self, ESourceList* list);
static void __edsf_persona_store_source_list_changed_cb_e_source_list_changed (ESourceList* _sender, gpointer self);
#define EDSF_PERSONA_STORE__property_change_timeout ((guint) 30)
#define EDSF_PERSONA_STORE_android_favourite_group_name "Starred in Android"
static void _edsf_persona_store_update_trust_level (EdsfPersonaStore* self);
EdsfPersonaStore* edsf_persona_store_new (ESource* s);
EdsfPersonaStore* edsf_persona_store_construct (GType object_type, 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, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_attributes_string_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
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_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_set_contact_im_fds (EdsfPersonaStore* self, EContact* contact, GeeMultiMap* im_fds, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_im_fds_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_postal_addresses (EdsfPersonaStore* self, EContact* contact, GeeSet* postal_fds, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_postal_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_name (EdsfPersonaStore* self, EContact* contact, FolksStructuredName* _sname, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_local_ids (EdsfPersonaStore* self, EContact* contact, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_local_ids_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_web_service_addresses (EdsfPersonaStore* self, EContact* contact, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_web_service_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_notes (EdsfPersonaStore* self, EContact* contact, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_notes_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_gender (EdsfPersonaStore* self, EContact* contact, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_gender_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_urls (EdsfPersonaStore* self, EContact* contact, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_urls_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_birthday (EdsfPersonaStore* self, EContact* contact, GDateTime* _bday, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_birthday_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_roles (EdsfPersonaStore* self, EContact* contact, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_roles_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_contact_is_favourite (EdsfPersonaStore* self, EContact* contact, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_is_favourite_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
gchar* edsf_persona_build_iid (const gchar* store_id, const gchar* contact_id);
EdsfPersona* edsf_persona_new (EdsfPersonaStore* store, EContact* contact);
EdsfPersona* edsf_persona_construct (GType object_type, EdsfPersonaStore* store, EContact* contact);
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_);
ESource* edsf_persona_store_get_source (EdsfPersonaStore* self);
static void _edsf_persona_store_open_address_book (EdsfPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_open_address_book_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_store_prepare_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
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_open_address_book_data_free (gpointer _data);
static gboolean _edsf_persona_store_open_address_book_co (EdsfPersonaStoreOpenAddressBookData* _data_);
static void _edsf_persona_store_address_book_opened_cb (EdsfPersonaStore* self, GError* err, EBookClient* address_book);
static void _edsf_persona_store_open_address_book_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gboolean __edsf_persona_store_open_address_book_co_gsource_func (gpointer self);
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 Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void ___lambda6_ (Block3Data* _data3_, GObject* obj, GParamSpec* pspec);
static void ____lambda6__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 ___lambda7_ (Block3Data* _data3_);
static gboolean ____lambda7__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 void _edsf_persona_store_set_contact_web_service_addresses_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_web_service_addresses_co (EdsfPersonaStoreSetContactWebServiceAddressesData* _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 void _edsf_persona_store_set_contact_urls_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_urls_co (EdsfPersonaStoreSetContactUrlsData* _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_contact_local_ids_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_local_ids_co (EdsfPersonaStoreSetContactLocalIdsData* _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_);
gboolean _edsf_persona_store_is_google_contacts_address_book (EdsfPersonaStore* self);
static void _edsf_persona_store_set_contact_is_favourite_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_is_favourite_co (EdsfPersonaStoreSetContactIsFavouriteData* _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_);
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_postal_addresses_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_postal_addresses_co (EdsfPersonaStoreSetContactPostalAddressesData* _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, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_attributes_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void __lambda3_ (EdsfPersonaStore* self, EVCardAttribute* attr, FolksPostalAddress* address);
static void ___lambda3__edsf_persona_store_field_to_attribute (EVCardAttribute* attr, gconstpointer value, gpointer self);
static void _edsf_persona_store_set_contact_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_attributes_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_attributes_co (EdsfPersonaStoreSetContactAttributesData* _data_);
static void __vala_EVCardAttribute_free0_ (gpointer var);
static void _g_list_free___vala_EVCardAttribute_free0_ (GList* self);
static void _edsf_persona_store_set_contact_attributes_string_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_attributes_string_co (EdsfPersonaStoreSetContactAttributesStringData* _data_);
static void __lambda2_ (EdsfPersonaStore* self, EVCardAttribute* attr, const gchar* value);
static void ___lambda2__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_contact_notes_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_notes_co (EdsfPersonaStoreSetContactNotesData* _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 _edsf_persona_store_set_contact_birthday_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_birthday_co (EdsfPersonaStoreSetContactBirthdayData* _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_contact_roles_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_roles_co (EdsfPersonaStoreSetContactRolesData* _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 _edsf_persona_store_set_contact_name_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_name_co (EdsfPersonaStoreSetContactNameData* _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_);
static void _edsf_persona_store_set_contact_im_fds_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_im_fds_co (EdsfPersonaStoreSetContactImFdsData* _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_contact_groups (EdsfPersonaStore* self, EContact* contact, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_groups_finish (EdsfPersonaStore* self, GAsyncResult* _res_);
static void _edsf_persona_store_set_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _edsf_persona_store_set_contact_groups_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_groups_co (EdsfPersonaStoreSetContactGroupsData* _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_);
static void _edsf_persona_store_set_contact_gender_data_free (gpointer _data);
static gboolean _edsf_persona_store_set_contact_gender_co (EdsfPersonaStoreSetContactGenderData* _data_);
#define EDSF_PERSONA_gender_attribute_name "X-GENDER"
#define EDSF_PERSONA_gender_male "M"
#define EDSF_PERSONA_gender_female "F"
gchar* edsf_persona_build_iid_from_contact (const gchar* store_id, EContact* contact);
void _edsf_persona_update (EdsfPersona* self, EContact* updated_contact);
static gboolean _edsf_persona_store_is_in_source_list (EdsfPersonaStore* self);
static void _edsf_persona_store_source_changed_cb (EdsfPersonaStore* self);
static void _edsf_persona_store_notify_if_default (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);
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 (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 (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 (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 (self, _error_);
}


static gboolean __edsf_persona_store_address_book_authenticate_cb_e_client_authenticate (EClient* _sender, void* credentials, gpointer self) {
	gboolean result;
	result = _edsf_persona_store_address_book_authenticate_cb (self, _sender, credentials);
	return result;
}


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 (self, _sender, pspec);
}


static void __edsf_persona_store_source_list_changed_cb_e_source_list_changed (ESourceList* _sender, gpointer self) {
	_edsf_persona_store_source_list_changed_cb (self, _sender);
}


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;
	ESource* _tmp0_;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* eds_uid;
	ESource* _tmp3_;
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = s;
	_tmp1_ = e_source_peek_uid (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	eds_uid = _tmp2_;
	_tmp3_ = s;
	self = (EdsfPersonaStore*) g_object_new (object_type, "id", eds_uid, "display-name", eds_uid, "source", _tmp3_, NULL);
	_g_free0 (eds_uid);
	return self;
}


EdsfPersonaStore* edsf_persona_store_new (ESource* s) {
	return edsf_persona_store_construct (EDSF_TYPE_PERSONA_STORE, 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_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


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_);
	_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.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.WEB_SERVICE_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.NOTES)
   * - PersonaStore.detail_key (PersonaDetail.URLS)
   *
   * See {@link Folks.PersonaStore.add_persona_from_details}.
   *
   * @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;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		case 9:
		goto _state_9;
		case 10:
		goto _state_10;
		case 11:
		goto _state_11;
		case 12:
		goto _state_12;
		case 13:
		goto _state_13;
		case 14:
		goto _state_14;
		case 15:
		goto _state_15;
		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_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_);
	while (TRUE) {
		_data_->_tmp4_ = NULL;
		_data_->_tmp5_ = NULL;
		_data_->_tmp6_ = FALSE;
		_data_->_tmp6_ = g_hash_table_iter_next (&_data_->iter, &_data_->_tmp4_, &_data_->_tmp5_);
		_data_->k = _data_->_tmp4_;
		_data_->_v = _data_->_tmp5_;
		if (!(_data_->_tmp6_ == TRUE)) {
			break;
		}
		_data_->_tmp7_ = _data_->_v;
		if (_data_->_tmp7_ == NULL) {
			continue;
		}
		_data_->_tmp8_ = _data_->_v;
		_data_->v = (GValue) (*_data_->_tmp8_);
		_data_->_tmp9_ = _data_->k;
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_FULL_NAME);
		if (g_strcmp0 (_data_->_tmp9_, _data_->_tmp10_) == 0) {
			_data_->_tmp11_ = NULL;
			_data_->_tmp11_ = g_value_get_string (&_data_->v);
			_data_->_tmp12_ = g_strdup (_data_->_tmp11_);
			_data_->full_name = _data_->_tmp12_;
			_data_->_tmp14_ = _data_->full_name;
			if (_data_->_tmp14_ != NULL) {
				_data_->_tmp15_ = _data_->full_name;
				_data_->_tmp13_ = g_strcmp0 ((const gchar*) _data_->_tmp15_, "") == 0;
			} else {
				_data_->_tmp13_ = FALSE;
			}
			_data_->_tmp16_ = _data_->_tmp13_;
			if (_data_->_tmp16_) {
				_g_free0 (_data_->full_name);
				_data_->full_name = NULL;
			}
			_data_->_tmp17_ = _data_->contact;
			_data_->_tmp18_ = 0;
			_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_ = NULL;
			_data_->_tmp21_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_EMAIL_ADDRESSES);
			if (g_strcmp0 (_data_->_tmp20_, _data_->_tmp21_) == 0) {
				_data_->_tmp22_ = NULL;
				_data_->_tmp22_ = g_value_get_object (&_data_->v);
				_data_->_tmp23_ = _g_object_ref0 (GEE_SET (_data_->_tmp22_));
				_data_->email_addresses = _data_->_tmp23_;
				_data_->_tmp24_ = _data_->contact;
				_data_->_tmp25_ = _data_->email_addresses;
				_data_->_state_ = 1;
				_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp24_, _data_->_tmp25_, "EMAIL", E_CONTACT_EMAIL, edsf_persona_store_add_persona_from_details_ready, _data_);
				return FALSE;
				_state_1:
				_edsf_persona_store_set_contact_attributes_string_finish (_data_->self, _data_->_res_);
				_g_object_unref0 (_data_->email_addresses);
			} else {
				_data_->_tmp26_ = _data_->k;
				_data_->_tmp27_ = NULL;
				_data_->_tmp27_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_AVATAR);
				if (g_strcmp0 (_data_->_tmp26_, _data_->_tmp27_) == 0) {
					{
						_data_->_tmp28_ = NULL;
						_data_->_tmp28_ = g_value_get_object (&_data_->v);
						_data_->_tmp29_ = _g_object_ref0 (G_LOADABLE_ICON (_data_->_tmp28_));
						_data_->avatar = _data_->_tmp29_;
						_data_->_tmp30_ = _data_->contact;
						_data_->_tmp31_ = _data_->avatar;
						_data_->_state_ = 2;
						_edsf_persona_store_set_contact_avatar (_data_->self, _data_->_tmp30_, _data_->_tmp31_, edsf_persona_store_add_persona_from_details_ready, _data_);
						return FALSE;
						_state_2:
						_edsf_persona_store_set_contact_avatar_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
						if (_data_->_inner_error_ != NULL) {
							_g_object_unref0 (_data_->avatar);
							if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
								goto __catch6_folks_property_error;
							}
							_g_object_unref0 (_data_->avatar);
							_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 __finally6;
					__catch6_folks_property_error:
					{
						_data_->e1 = _data_->_inner_error_;
						_data_->_inner_error_ = NULL;
						_data_->_tmp32_ = _data_->e1;
						_data_->_tmp33_ = _data_->_tmp32_->message;
						g_warning ("edsf-persona-store.vala:357: Couldn't set avatar on the EContact: %s", _data_->_tmp33_);
						_g_error_free0 (_data_->e1);
					}
					__finally6:
					if (_data_->_inner_error_ != NULL) {
						if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
							g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
							g_error_free (_data_->_inner_error_);
							_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_->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_->_tmp34_ = _data_->k;
					_data_->_tmp35_ = NULL;
					_data_->_tmp35_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IM_ADDRESSES);
					if (g_strcmp0 (_data_->_tmp34_, _data_->_tmp35_) == 0) {
						_data_->_tmp36_ = NULL;
						_data_->_tmp36_ = g_value_get_object (&_data_->v);
						_data_->_tmp37_ = _g_object_ref0 (GEE_MULTI_MAP (_data_->_tmp36_));
						_data_->im_fds = _data_->_tmp37_;
						_data_->_tmp38_ = _data_->contact;
						_data_->_tmp39_ = _data_->im_fds;
						_data_->_state_ = 3;
						_edsf_persona_store_set_contact_im_fds (_data_->self, _data_->_tmp38_, _data_->_tmp39_, edsf_persona_store_add_persona_from_details_ready, _data_);
						return FALSE;
						_state_3:
						_edsf_persona_store_set_contact_im_fds_finish (_data_->self, _data_->_res_);
						_g_object_unref0 (_data_->im_fds);
					} else {
						_data_->_tmp40_ = _data_->k;
						_data_->_tmp41_ = NULL;
						_data_->_tmp41_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_PHONE_NUMBERS);
						if (g_strcmp0 (_data_->_tmp40_, _data_->_tmp41_) == 0) {
							_data_->_tmp42_ = NULL;
							_data_->_tmp42_ = g_value_get_object (&_data_->v);
							_data_->_tmp43_ = _g_object_ref0 (GEE_SET (_data_->_tmp42_));
							_data_->phone_numbers = _data_->_tmp43_;
							_data_->_tmp44_ = _data_->contact;
							_data_->_tmp45_ = _data_->phone_numbers;
							_data_->_state_ = 4;
							_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp44_, _data_->_tmp45_, "TEL", E_CONTACT_TEL, edsf_persona_store_add_persona_from_details_ready, _data_);
							return FALSE;
							_state_4:
							_edsf_persona_store_set_contact_attributes_string_finish (_data_->self, _data_->_res_);
							_g_object_unref0 (_data_->phone_numbers);
						} else {
							_data_->_tmp46_ = _data_->k;
							_data_->_tmp47_ = NULL;
							_data_->_tmp47_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_POSTAL_ADDRESSES);
							if (g_strcmp0 (_data_->_tmp46_, _data_->_tmp47_) == 0) {
								_data_->_tmp48_ = NULL;
								_data_->_tmp48_ = g_value_get_object (&_data_->v);
								_data_->_tmp49_ = _g_object_ref0 (GEE_SET (_data_->_tmp48_));
								_data_->postal_fds = _data_->_tmp49_;
								_data_->_tmp50_ = _data_->contact;
								_data_->_tmp51_ = _data_->postal_fds;
								_data_->_state_ = 5;
								_edsf_persona_store_set_contact_postal_addresses (_data_->self, _data_->_tmp50_, _data_->_tmp51_, edsf_persona_store_add_persona_from_details_ready, _data_);
								return FALSE;
								_state_5:
								_edsf_persona_store_set_contact_postal_addresses_finish (_data_->self, _data_->_res_);
								_g_object_unref0 (_data_->postal_fds);
							} else {
								_data_->_tmp52_ = _data_->k;
								_data_->_tmp53_ = NULL;
								_data_->_tmp53_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_STRUCTURED_NAME);
								if (g_strcmp0 (_data_->_tmp52_, _data_->_tmp53_) == 0) {
									_data_->_tmp54_ = NULL;
									_data_->_tmp54_ = g_value_get_object (&_data_->v);
									_data_->_tmp55_ = _g_object_ref0 (FOLKS_STRUCTURED_NAME (_data_->_tmp54_));
									_data_->sname = _data_->_tmp55_;
									_data_->_tmp56_ = _data_->contact;
									_data_->_tmp57_ = _data_->sname;
									_data_->_state_ = 6;
									_edsf_persona_store_set_contact_name (_data_->self, _data_->_tmp56_, _data_->_tmp57_, edsf_persona_store_add_persona_from_details_ready, _data_);
									return FALSE;
									_state_6:
									_edsf_persona_store_set_contact_name_finish (_data_->self, _data_->_res_);
									_g_object_unref0 (_data_->sname);
								} else {
									_data_->_tmp58_ = _data_->k;
									_data_->_tmp59_ = NULL;
									_data_->_tmp59_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_LOCAL_IDS);
									if (g_strcmp0 (_data_->_tmp58_, _data_->_tmp59_) == 0) {
										_data_->_tmp60_ = NULL;
										_data_->_tmp60_ = g_value_get_object (&_data_->v);
										_data_->_tmp61_ = _g_object_ref0 (GEE_SET (_data_->_tmp60_));
										_data_->local_ids = _data_->_tmp61_;
										_data_->_tmp62_ = _data_->contact;
										_data_->_tmp63_ = _data_->local_ids;
										_data_->_state_ = 7;
										_edsf_persona_store_set_contact_local_ids (_data_->self, _data_->_tmp62_, _data_->_tmp63_, edsf_persona_store_add_persona_from_details_ready, _data_);
										return FALSE;
										_state_7:
										_edsf_persona_store_set_contact_local_ids_finish (_data_->self, _data_->_res_);
										_g_object_unref0 (_data_->local_ids);
									} else {
										_data_->_tmp64_ = _data_->k;
										_data_->_tmp65_ = NULL;
										_data_->_tmp65_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_WEB_SERVICE_ADDRESSES);
										if (g_strcmp0 (_data_->_tmp64_, _data_->_tmp65_) == 0) {
											_data_->_tmp66_ = NULL;
											_data_->_tmp66_ = g_value_get_object (&_data_->v);
											_data_->_tmp67_ = _g_object_ref0 (GEE_HASH_MULTI_MAP (_data_->_tmp66_));
											_data_->web_service_addresses = _data_->_tmp67_;
											_data_->_tmp68_ = _data_->contact;
											_data_->_tmp69_ = _data_->web_service_addresses;
											_data_->_state_ = 8;
											_edsf_persona_store_set_contact_web_service_addresses (_data_->self, _data_->_tmp68_, (GeeMultiMap*) _data_->_tmp69_, edsf_persona_store_add_persona_from_details_ready, _data_);
											return FALSE;
											_state_8:
											_edsf_persona_store_set_contact_web_service_addresses_finish (_data_->self, _data_->_res_);
											_g_object_unref0 (_data_->web_service_addresses);
										} else {
											_data_->_tmp70_ = _data_->k;
											_data_->_tmp71_ = NULL;
											_data_->_tmp71_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_NOTES);
											if (g_strcmp0 (_data_->_tmp70_, _data_->_tmp71_) == 0) {
												_data_->_tmp72_ = NULL;
												_data_->_tmp72_ = g_value_get_object (&_data_->v);
												_data_->_tmp73_ = _g_object_ref0 (GEE_HASH_SET (_data_->_tmp72_));
												_data_->notes = _data_->_tmp73_;
												_data_->_tmp74_ = _data_->contact;
												_data_->_tmp75_ = _data_->notes;
												_data_->_state_ = 9;
												_edsf_persona_store_set_contact_notes (_data_->self, _data_->_tmp74_, (GeeSet*) _data_->_tmp75_, edsf_persona_store_add_persona_from_details_ready, _data_);
												return FALSE;
												_state_9:
												_edsf_persona_store_set_contact_notes_finish (_data_->self, _data_->_res_);
												_g_object_unref0 (_data_->notes);
											} else {
												_data_->_tmp76_ = _data_->k;
												_data_->_tmp77_ = NULL;
												_data_->_tmp77_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_GENDER);
												if (g_strcmp0 (_data_->_tmp76_, _data_->_tmp77_) == 0) {
													_data_->_tmp78_ = 0;
													_data_->_tmp78_ = g_value_get_enum (&_data_->v);
													_data_->gender = (FolksGender) _data_->_tmp78_;
													_data_->_tmp79_ = _data_->contact;
													_data_->_tmp80_ = _data_->gender;
													_data_->_state_ = 10;
													_edsf_persona_store_set_contact_gender (_data_->self, _data_->_tmp79_, _data_->_tmp80_, edsf_persona_store_add_persona_from_details_ready, _data_);
													return FALSE;
													_state_10:
													_edsf_persona_store_set_contact_gender_finish (_data_->self, _data_->_res_);
												} else {
													_data_->_tmp81_ = _data_->k;
													_data_->_tmp82_ = NULL;
													_data_->_tmp82_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_URLS);
													if (g_strcmp0 (_data_->_tmp81_, _data_->_tmp82_) == 0) {
														_data_->_tmp83_ = NULL;
														_data_->_tmp83_ = g_value_get_object (&_data_->v);
														_data_->_tmp84_ = _g_object_ref0 (GEE_SET (_data_->_tmp83_));
														_data_->urls = _data_->_tmp84_;
														_data_->_tmp85_ = _data_->contact;
														_data_->_tmp86_ = _data_->urls;
														_data_->_state_ = 11;
														_edsf_persona_store_set_contact_urls (_data_->self, _data_->_tmp85_, _data_->_tmp86_, edsf_persona_store_add_persona_from_details_ready, _data_);
														return FALSE;
														_state_11:
														_edsf_persona_store_set_contact_urls_finish (_data_->self, _data_->_res_);
														_g_object_unref0 (_data_->urls);
													} else {
														_data_->_tmp87_ = _data_->k;
														_data_->_tmp88_ = NULL;
														_data_->_tmp88_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_BIRTHDAY);
														if (g_strcmp0 (_data_->_tmp87_, _data_->_tmp88_) == 0) {
															_data_->_tmp89_ = NULL;
															_data_->_tmp89_ = g_value_get_boxed (&_data_->v);
															_data_->_tmp90_ = _g_date_time_ref0 ((GDateTime*) _data_->_tmp89_);
															_data_->birthday = _data_->_tmp90_;
															_data_->_tmp91_ = _data_->contact;
															_data_->_tmp92_ = _data_->birthday;
															_data_->_state_ = 12;
															_edsf_persona_store_set_contact_birthday (_data_->self, _data_->_tmp91_, _data_->_tmp92_, edsf_persona_store_add_persona_from_details_ready, _data_);
															return FALSE;
															_state_12:
															_edsf_persona_store_set_contact_birthday_finish (_data_->self, _data_->_res_);
															_g_date_time_unref0 (_data_->birthday);
														} else {
															_data_->_tmp93_ = _data_->k;
															_data_->_tmp94_ = NULL;
															_data_->_tmp94_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_ROLES);
															if (g_strcmp0 (_data_->_tmp93_, _data_->_tmp94_) == 0) {
																_data_->_tmp95_ = NULL;
																_data_->_tmp95_ = g_value_get_object (&_data_->v);
																_data_->_tmp96_ = _g_object_ref0 (GEE_SET (_data_->_tmp95_));
																_data_->roles = _data_->_tmp96_;
																_data_->_tmp97_ = _data_->contact;
																_data_->_tmp98_ = _data_->roles;
																_data_->_state_ = 13;
																_edsf_persona_store_set_contact_roles (_data_->self, _data_->_tmp97_, _data_->_tmp98_, edsf_persona_store_add_persona_from_details_ready, _data_);
																return FALSE;
																_state_13:
																_edsf_persona_store_set_contact_roles_finish (_data_->self, _data_->_res_);
																_g_object_unref0 (_data_->roles);
															} else {
																_data_->_tmp99_ = _data_->k;
																_data_->_tmp100_ = NULL;
																_data_->_tmp100_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IS_FAVOURITE);
																if (g_strcmp0 (_data_->_tmp99_, _data_->_tmp100_) == 0) {
																	_data_->_tmp101_ = FALSE;
																	_data_->_tmp101_ = g_value_get_boolean (&_data_->v);
																	_data_->is_fav = _data_->_tmp101_;
																	_data_->_tmp102_ = _data_->contact;
																	_data_->_tmp103_ = _data_->is_fav;
																	_data_->_state_ = 14;
																	_edsf_persona_store_set_contact_is_favourite (_data_->self, _data_->_tmp102_, _data_->_tmp103_, edsf_persona_store_add_persona_from_details_ready, _data_);
																	return FALSE;
																	_state_14:
																	_edsf_persona_store_set_contact_is_favourite_finish (_data_->self, _data_->_res_);
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	_data_->_persona = NULL;
	{
		_data_->_tmp104_ = _data_->self->priv->_addressbook;
		_data_->_tmp105_ = _data_->contact;
		_data_->_tmp106_ = NULL;
		_data_->_state_ = 15;
		e_book_client_add_contact (E_BOOK_CLIENT (_data_->_tmp104_), _data_->_tmp105_, NULL, edsf_persona_store_add_persona_from_details_ready, _data_);
		return FALSE;
		_state_15:
		_data_->_tmp107_ = FALSE;
		_data_->_tmp107_ = e_book_client_add_contact_finish (E_BOOK_CLIENT (_data_->_tmp104_), _data_->_res_, &_data_->_tmp106_, &_data_->_inner_error_);
		_g_free0 (_data_->added_uid);
		_data_->added_uid = _data_->_tmp106_;
		_data_->_result_ = _data_->_tmp107_;
		if (_data_->_inner_error_ != NULL) {
			_g_free0 (_data_->added_uid);
			goto __catch7_g_error;
		}
		_data_->_tmp108_ = _data_->_result_;
		if (_data_->_tmp108_) {
			_data_->_tmp109_ = _data_->added_uid;
			g_debug ("edsf-persona-store.vala:451: Created contact with uid: %s\n", _data_->_tmp109_);
			{
				_data_->_tmp110_ = _data_->self->priv->_personas;
				g_static_rec_mutex_lock (&_data_->self->priv->__lock__personas);
				{
					_data_->_tmp111_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
					_data_->_tmp112_ = _data_->_tmp111_;
					_data_->_tmp113_ = _data_->added_uid;
					_data_->_tmp114_ = NULL;
					_data_->_tmp114_ = edsf_persona_build_iid (_data_->_tmp112_, _data_->_tmp113_);
					_data_->iid = _data_->_tmp114_;
					_data_->_tmp115_ = _data_->self->priv->_personas;
					_data_->_tmp116_ = _data_->iid;
					_data_->_tmp117_ = NULL;
					_data_->_tmp117_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp115_, _data_->_tmp116_);
					_g_object_unref0 (_data_->_persona);
					_data_->_persona = (EdsfPersona*) _data_->_tmp117_;
					_data_->_tmp118_ = _data_->_persona;
					if (_data_->_tmp118_ == NULL) {
						_data_->_tmp119_ = _data_->contact;
						_data_->_tmp120_ = 0;
						_data_->_tmp120_ = e_contact_field_id ("id");
						_data_->_tmp121_ = _data_->added_uid;
						e_contact_set (_data_->_tmp119_, _data_->_tmp120_, _data_->_tmp121_);
						_data_->_tmp122_ = _data_->contact;
						_data_->_tmp123_ = edsf_persona_new (_data_->self, _data_->_tmp122_);
						_g_object_unref0 (_data_->persona);
						_data_->persona = _data_->_tmp123_;
						_data_->_tmp124_ = _data_->self->priv->_personas;
						_data_->_tmp125_ = _data_->persona;
						_data_->_tmp126_ = folks_persona_get_iid ((FolksPersona*) _data_->_tmp125_);
						_data_->_tmp127_ = _data_->_tmp126_;
						_data_->_tmp128_ = _data_->persona;
						gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp124_, _data_->_tmp127_, _data_->_tmp128_);
						_data_->_tmp129_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
						_data_->added_personas = _data_->_tmp129_;
						_data_->_tmp130_ = _data_->added_personas;
						_data_->_tmp131_ = _data_->persona;
						gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp130_, _data_->_tmp131_);
						_data_->_tmp132_ = _data_->added_personas;
						_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) _data_->self, (GeeSet*) _data_->_tmp132_, NULL, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
						_data_->_tmp133_ = _data_->persona;
						_data_->_tmp134_ = _g_object_ref0 (_data_->_tmp133_);
						_g_object_unref0 (_data_->_persona);
						_data_->_persona = _data_->_tmp134_;
						_g_object_unref0 (_data_->added_personas);
						_g_object_unref0 (_data_->persona);
					}
					_g_free0 (_data_->iid);
				}
				__finally8:
				{
					_data_->_tmp135_ = _data_->self->priv->_personas;
					g_static_rec_mutex_unlock (&_data_->self->priv->__lock__personas);
				}
				if (_data_->_inner_error_ != NULL) {
					_g_free0 (_data_->added_uid);
					goto __catch7_g_error;
				}
			}
		} else {
			_data_->_tmp136_ = g_error_new_literal (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_CREATE_FAILED, "BookClient.add_contact () failed.");
			_data_->_inner_error_ = _data_->_tmp136_;
			_g_free0 (_data_->added_uid);
			goto __catch7_g_error;
		}
		_g_free0 (_data_->added_uid);
	}
	goto __finally7;
	__catch7_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp137_ = _data_->e;
		_data_->_tmp138_ = _data_->_tmp137_->message;
		g_warning ("edsf-persona-store.vala:479: add_persona_from_details: %s\n", _data_->_tmp138_);
		_g_error_free0 (_data_->e);
	}
	__finally7:
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->_persona);
			_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_->_persona);
			_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;
		}
	}
	_data_->result = (FolksPersona*) _data_->_persona;
	_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_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_);
	_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
   *
   * @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_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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 (EDSF_PERSONA (_data_->_tmp3_));
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_state_ = 1;
		e_book_client_remove_contact (E_BOOK_CLIENT (_data_->_tmp2_), _data_->_tmp5_, NULL, edsf_persona_store_remove_persona_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_remove_contact_finish (E_BOOK_CLIENT (_data_->_tmp2_), _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			goto __catch9_g_error;
		}
	}
	goto __finally9;
	__catch9_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp6_ = _data_->e;
		_data_->_tmp7_ = _data_->_tmp6_->domain;
		_data_->_tmp8_ = 0U;
		_data_->_tmp8_ = e_book_client_error_quark ();
		if (_data_->_tmp7_ == _data_->_tmp8_) {
			_data_->_tmp9_ = _data_->e;
			_data_->_tmp10_ = _data_->_tmp9_->code;
			switch ((EBookClientError) _data_->_tmp10_) {
				case 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;
				}
				default:
				case E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK:
				case E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS:
				case E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE:
				case E_BOOK_CLIENT_ERROR_NO_SPACE:
				{
					break;
				}
			}
		} else {
			_data_->_tmp11_ = _data_->e;
			_data_->_tmp12_ = _data_->_tmp11_->domain;
			_data_->_tmp13_ = 0U;
			_data_->_tmp13_ = e_client_error_quark ();
			if (_data_->_tmp12_ == _data_->_tmp13_) {
				_data_->_tmp14_ = _data_->e;
				_data_->_tmp15_ = _data_->_tmp14_->code;
				switch ((EClientError) _data_->_tmp15_) {
					case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
					{
						_data_->_tmp16_ = NULL;
						_data_->_tmp16_ = _ ("Address book ‘%s’ is offline, so contact ‘%s’ cannot be removed.");
						_data_->_tmp17_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
						_data_->_tmp18_ = _data_->_tmp17_;
						_data_->_tmp19_ = _data_->persona;
						_data_->_tmp20_ = folks_persona_get_uid (_data_->_tmp19_);
						_data_->_tmp21_ = _data_->_tmp20_;
						_data_->_tmp22_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _data_->_tmp16_, _data_->_tmp18_, _data_->_tmp21_);
						_data_->_inner_error_ = _data_->_tmp22_;
						_g_error_free0 (_data_->e);
						goto __finally9;
					}
					case E_CLIENT_ERROR_PERMISSION_DENIED:
					{
						_data_->_tmp23_ = NULL;
						_data_->_tmp23_ = _ ("Permission denied to remove contact ‘%s’: %s");
						_data_->_tmp24_ = _data_->persona;
						_data_->_tmp25_ = folks_persona_get_uid (_data_->_tmp24_);
						_data_->_tmp26_ = _data_->_tmp25_;
						_data_->_tmp27_ = _data_->e;
						_data_->_tmp28_ = _data_->_tmp27_->message;
						_data_->_tmp29_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _data_->_tmp23_, _data_->_tmp26_, _data_->_tmp28_);
						_data_->_inner_error_ = _data_->_tmp29_;
						_g_error_free0 (_data_->e);
						goto __finally9;
					}
					case E_CLIENT_ERROR_NOT_SUPPORTED:
					{
						_data_->_tmp30_ = NULL;
						_data_->_tmp30_ = _ ("Removing contacts isn't supported by this persona store: %s");
						_data_->_tmp31_ = _data_->e;
						_data_->_tmp32_ = _data_->_tmp31_->message;
						_data_->_tmp33_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_READ_ONLY, _data_->_tmp30_, _data_->_tmp32_);
						_data_->_inner_error_ = _data_->_tmp33_;
						_g_error_free0 (_data_->e);
						goto __finally9;
					}
					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_->_tmp34_ = NULL;
		_data_->_tmp34_ = _ ("Can't remove contact ‘%s’: %s");
		_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, _data_->_tmp34_, _data_->_tmp37_, _data_->_tmp39_);
		_data_->_inner_error_ = _data_->_tmp40_;
		_g_error_free0 (_data_->e);
		goto __finally9;
	}
	__finally9:
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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}.
   *
   * @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;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->_is_prepared;
		g_static_rec_mutex_lock (&_data_->self->priv->__lock__is_prepared);
		{
			_data_->_tmp2_ = _data_->self->priv->_is_prepared;
			if (_data_->_tmp2_ == TRUE) {
				_data_->_tmp1_ = TRUE;
			} else {
				_data_->_tmp3_ = _data_->self->priv->_prepare_pending;
				_data_->_tmp1_ = _data_->_tmp3_ == TRUE;
			}
			_data_->_tmp4_ = _data_->_tmp1_;
			if (_data_->_tmp4_) {
				{
					_data_->_tmp5_ = _data_->self->priv->_is_prepared;
					g_static_rec_mutex_unlock (&_data_->self->priv->__lock__is_prepared);
				}
				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_->_tmp6_ = NULL;
				e_book_client_get_sources (&_data_->_tmp6_, &_data_->_inner_error_);
				_g_object_unref0 (_data_->self->priv->_source_list);
				_data_->self->priv->_source_list = _data_->_tmp6_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch11_g_error;
				}
				_data_->_tmp7_ = _data_->self->priv->_source_list;
				g_signal_connect_object (E_SOURCE_LIST (_data_->_tmp7_), "changed", (GCallback) __edsf_persona_store_source_list_changed_cb_e_source_list_changed, _data_->self, 0);
				_data_->_tmp8_ = _data_->self->priv->_source;
				_data_->_tmp9_ = e_book_client_new (_data_->_tmp8_, &_data_->_inner_error_);
				_data_->_tmp10_ = _data_->_tmp9_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch11_g_error;
				}
				_g_object_unref0 (_data_->self->priv->_addressbook);
				_data_->self->priv->_addressbook = _data_->_tmp10_;
				_data_->_tmp11_ = _data_->self->priv->_addressbook;
				g_signal_connect_object ((GObject*) E_BOOK_CLIENT (_data_->_tmp11_), "notify::readonly", (GCallback) __edsf_persona_store_address_book_notify_read_only_cb_g_object_notify, _data_->self, 0);
				_data_->_tmp12_ = _data_->self->priv->_addressbook;
				g_signal_connect_object ((EClient*) E_BOOK_CLIENT (_data_->_tmp12_), "authenticate", (GCallback) __edsf_persona_store_address_book_authenticate_cb_e_client_authenticate, _data_->self, 0);
				_data_->_state_ = 1;
				_edsf_persona_store_open_address_book (_data_->self, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_1:
				_edsf_persona_store_open_address_book_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
				if (_data_->_inner_error_ != NULL) {
					goto __catch11_g_error;
				}
				_data_->_tmp13_ = _data_->self->priv->_addressbook;
				_data_->_tmp14_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
				_data_->_tmp15_ = _data_->_tmp14_;
				g_debug ("Successfully finished opening address book %p for " "persona store ‘%s’ (%p).", _data_->_tmp13_, _data_->_tmp15_, _data_->self);
				_edsf_persona_store_update_trust_level (_data_->self);
			}
			goto __finally11;
			__catch11_g_error:
			{
				_data_->e1 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
				_data_->_tmp16_ = _data_->e1;
				_data_->_tmp17_ = _data_->_tmp16_->domain;
				_data_->_tmp18_ = 0U;
				_data_->_tmp18_ = e_book_client_error_quark ();
				if (_data_->_tmp17_ == _data_->_tmp18_) {
					_data_->_tmp19_ = _data_->e1;
					_data_->_tmp20_ = _data_->_tmp19_->code;
					switch ((EBookClientError) _data_->_tmp20_) {
						default:
						case E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK:
						case E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE:
						case E_BOOK_CLIENT_ERROR_CONTACT_NOT_FOUND:
						case E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS:
						case E_BOOK_CLIENT_ERROR_NO_SPACE:
						{
							break;
						}
					}
				} else {
					_data_->_tmp21_ = _data_->e1;
					_data_->_tmp22_ = _data_->_tmp21_->domain;
					_data_->_tmp23_ = 0U;
					_data_->_tmp23_ = e_client_error_quark ();
					if (_data_->_tmp22_ == _data_->_tmp23_) {
						_data_->_tmp24_ = _data_->e1;
						_data_->_tmp25_ = _data_->_tmp24_->code;
						switch ((EClientError) _data_->_tmp25_) {
							case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
							{
								_data_->_tmp26_ = NULL;
								_data_->_tmp26_ = _ ("Address book ‘%s’ is offline.");
								_data_->_tmp27_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp28_ = _data_->_tmp27_;
								_data_->_tmp29_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _data_->_tmp26_, _data_->_tmp28_);
								_data_->_inner_error_ = _data_->_tmp29_;
								_g_error_free0 (_data_->e1);
								goto __finally11;
							}
							case E_CLIENT_ERROR_PERMISSION_DENIED:
							{
								_data_->_tmp30_ = NULL;
								_data_->_tmp30_ = _ ("Permission denied to open address book ‘%s’: %s");
								_data_->_tmp31_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp32_ = _data_->_tmp31_;
								_data_->_tmp33_ = _data_->e1;
								_data_->_tmp34_ = _data_->_tmp33_->message;
								_data_->_tmp35_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _data_->_tmp30_, _data_->_tmp32_, _data_->_tmp34_);
								_data_->_inner_error_ = _data_->_tmp35_;
								_g_error_free0 (_data_->e1);
								goto __finally11;
							}
							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_->_tmp36_ = NULL;
				_data_->_tmp36_ = _ ("Couldn't open address book ‘%s’: %s");
				_data_->_tmp37_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
				_data_->_tmp38_ = _data_->_tmp37_;
				_data_->_tmp39_ = _data_->e1;
				_data_->_tmp40_ = _data_->_tmp39_->message;
				_data_->_tmp41_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp36_, _data_->_tmp38_, _data_->_tmp40_);
				_data_->_inner_error_ = _data_->_tmp41_;
				_g_error_free0 (_data_->e1);
				goto __finally11;
			}
			__finally11:
			{
				_data_->self->priv->_prepare_pending = FALSE;
			}
			if (_data_->_inner_error_ != NULL) {
				goto __finally10;
			}
			{
				_data_->supported_fields = NULL;
				_data_->_tmp42_ = _data_->self->priv->_addressbook;
				_data_->_tmp43_ = NULL;
				_data_->_state_ = 2;
				e_client_get_backend_property ((EClient*) E_BOOK_CLIENT (_data_->_tmp42_), "supported-fields", NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_2:
				e_client_get_backend_property_finish ((EClient*) E_BOOK_CLIENT (_data_->_tmp42_), _data_->_res_, &_data_->_tmp43_, &_data_->_inner_error_);
				_g_free0 (_data_->supported_fields);
				_data_->supported_fields = _data_->_tmp43_;
				if (_data_->_inner_error_ != NULL) {
					_g_free0 (_data_->supported_fields);
					goto __catch12_g_error;
				}
				_data_->_tmp44_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
				_data_->prop_set = _data_->_tmp44_;
				_data_->_tmp45_ = _data_->supported_fields;
				if (_data_->_tmp45_ != NULL) {
					_data_->_tmp46_ = _data_->supported_fields;
					_data_->_tmp48_ = NULL;
					_data_->_tmp48_ = _data_->_tmp47_ = g_strsplit ((const gchar*) _data_->_tmp46_, ",", 0);
					_data_->fields = _data_->_tmp48_;
					_data_->fields_length1 = _vala_array_length (_data_->_tmp47_);
					_data_->_fields_size_ = _data_->fields_length1;
					_data_->_tmp49_ = _data_->prop_set;
					_data_->_tmp50_ = NULL;
					_data_->_tmp50_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_LOCAL_IDS);
					gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp49_, (const gchar*) _data_->_tmp50_);
					_data_->_tmp51_ = _data_->prop_set;
					_data_->_tmp52_ = NULL;
					_data_->_tmp52_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_WEB_SERVICE_ADDRESSES);
					gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp51_, (const gchar*) _data_->_tmp52_);
					_data_->_tmp53_ = _data_->prop_set;
					_data_->_tmp54_ = NULL;
					_data_->_tmp54_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_GENDER);
					gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp53_, (const gchar*) _data_->_tmp54_);
					_data_->_tmp55_ = _data_->prop_set;
					_data_->_tmp56_ = NULL;
					_data_->_tmp56_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IS_FAVOURITE);
					gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp55_, (const gchar*) _data_->_tmp56_);
					_data_->_tmp57_ = _data_->fields;
					_data_->_tmp57__length1 = _data_->fields_length1;
					{
						_data_->field_collection_length1 = 0;
						_data_->_field_collection_size_ = 0;
						_data_->field_collection = _data_->_tmp57_;
						_data_->field_collection_length1 = _data_->_tmp57__length1;
						for (_data_->field_it = 0; _data_->field_it < _data_->_tmp57__length1; _data_->field_it = _data_->field_it + 1) {
							_data_->field = _data_->field_collection[_data_->field_it];
							{
								_data_->_tmp58_ = _data_->field;
								_data_->_tmp59_ = 0;
								_data_->_tmp59_ = _edsf_persona_store_eds_field_name_to_folks_persona_detail (_data_->self, _data_->_tmp58_);
								_data_->_tmp60_ = NULL;
								_data_->_tmp60_ = folks_persona_store_detail_key (_data_->_tmp59_);
								_data_->_tmp61_ = g_strdup (_data_->_tmp60_);
								_data_->prop = _data_->_tmp61_;
								_data_->_tmp62_ = _data_->prop;
								if (_data_->_tmp62_ != NULL) {
									_data_->_tmp63_ = _data_->prop_set;
									_data_->_tmp64_ = _data_->prop;
									_data_->prop = NULL;
									_data_->_tmp65_ = (gchar*) _data_->_tmp64_;
									gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp63_, _data_->_tmp65_);
									_g_free0 (_data_->_tmp65_);
								}
								_g_free0 (_data_->prop);
							}
						}
					}
					_data_->fields = (_vala_array_free (_data_->fields, _data_->fields_length1, (GDestroyNotify) g_free), NULL);
				}
				_data_->_tmp66_ = _data_->prop_set;
				_data_->_tmp67_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp66_);
				_data_->_tmp68_ = _data_->_tmp67_;
				_data_->_tmp69_ = NULL;
				_data_->_tmp69_ = g_new0 (gchar*, _data_->_tmp68_ + 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_->_tmp69_;
				_data_->self->priv->_always_writeable_properties_length1 = _data_->_tmp68_;
				_data_->self->priv->__always_writeable_properties_size_ = _data_->self->priv->_always_writeable_properties_length1;
				_data_->i = (guint) 0;
				{
					_data_->_tmp70_ = _data_->prop_set;
					_data_->_tmp71_ = NULL;
					_data_->_tmp71_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp70_);
					_data_->_final_prop_it = _data_->_tmp71_;
					while (TRUE) {
						_data_->_tmp72_ = _data_->_final_prop_it;
						_data_->_tmp73_ = FALSE;
						_data_->_tmp73_ = gee_iterator_next (_data_->_tmp72_);
						if (!_data_->_tmp73_) {
							break;
						}
						_data_->_tmp74_ = _data_->_final_prop_it;
						_data_->_tmp75_ = NULL;
						_data_->_tmp75_ = gee_iterator_get (_data_->_tmp74_);
						_data_->final_prop = (gchar*) _data_->_tmp75_;
						_data_->_tmp76_ = _data_->self->priv->_always_writeable_properties;
						_data_->_tmp76__length1 = _data_->self->priv->_always_writeable_properties_length1;
						_data_->_tmp77_ = _data_->i;
						_data_->i = _data_->_tmp77_ + 1;
						_data_->_tmp78_ = _data_->final_prop;
						_data_->_tmp79_ = g_strdup (_data_->_tmp78_);
						_g_free0 (_data_->_tmp76_[_data_->_tmp77_]);
						_data_->_tmp76_[_data_->_tmp77_] = _data_->_tmp79_;
						_data_->_tmp80_ = _data_->_tmp76_[_data_->_tmp77_];
						_g_free0 (_data_->final_prop);
					}
					_g_object_unref0 (_data_->_final_prop_it);
				}
				_g_object_unref0 (_data_->prop_set);
				_g_free0 (_data_->supported_fields);
			}
			goto __finally12;
			__catch12_g_error:
			{
				_data_->e2 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
				_data_->_tmp81_ = NULL;
				_data_->_tmp81_ = _ ("Couldn't get address book capabilities: %s");
				_data_->_tmp82_ = _data_->e2;
				_data_->_tmp83_ = _data_->_tmp82_->message;
				_data_->_tmp84_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp81_, _data_->_tmp83_);
				_data_->_inner_error_ = _data_->_tmp84_;
				_g_error_free0 (_data_->e2);
				goto __finally12;
			}
			__finally12:
			{
				_data_->self->priv->_prepare_pending = FALSE;
			}
			if (_data_->_inner_error_ != NULL) {
				goto __finally10;
			}
			_data_->do_initial_query = FALSE;
			{
				_data_->capabilities = NULL;
				_data_->_tmp85_ = _data_->self->priv->_addressbook;
				_data_->_tmp86_ = NULL;
				_data_->_state_ = 3;
				e_client_get_backend_property ((EClient*) E_BOOK_CLIENT (_data_->_tmp85_), "capabilities", NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_3:
				e_client_get_backend_property_finish ((EClient*) E_BOOK_CLIENT (_data_->_tmp85_), _data_->_res_, &_data_->_tmp86_, &_data_->_inner_error_);
				_g_free0 (_data_->capabilities);
				_data_->capabilities = _data_->_tmp86_;
				if (_data_->_inner_error_ != NULL) {
					_g_free0 (_data_->capabilities);
					goto __catch13_g_error;
				}
				_data_->_tmp87_ = _data_->capabilities;
				if (_data_->_tmp87_ != NULL) {
					_data_->_tmp88_ = _data_->capabilities;
					_data_->_tmp90_ = NULL;
					_data_->_tmp90_ = _data_->_tmp89_ = g_strsplit ((const gchar*) _data_->_tmp88_, ",", 0);
					_data_->caps = _data_->_tmp90_;
					_data_->caps_length1 = _vala_array_length (_data_->_tmp89_);
					_data_->_caps_size_ = _data_->caps_length1;
					_data_->_tmp91_ = _data_->caps;
					_data_->_tmp91__length1 = _data_->caps_length1;
					_data_->do_initial_query = _vala_string_array_contains (_data_->_tmp91_, _data_->_tmp91__length1, "do-initial-query");
					_data_->caps = (_vala_array_free (_data_->caps, _data_->caps_length1, (GDestroyNotify) g_free), NULL);
				}
				_g_free0 (_data_->capabilities);
			}
			goto __finally13;
			__catch13_g_error:
			{
				_data_->e4 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
				_data_->_tmp92_ = NULL;
				_data_->_tmp92_ = _ ("Couldn't get address book capabilities: %s");
				_data_->_tmp93_ = _data_->e4;
				_data_->_tmp94_ = _data_->_tmp93_->message;
				_data_->_tmp95_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp92_, _data_->_tmp94_);
				_data_->_inner_error_ = _data_->_tmp95_;
				_g_error_free0 (_data_->e4);
				goto __finally13;
			}
			__finally13:
			{
				_data_->self->priv->_prepare_pending = FALSE;
			}
			if (_data_->_inner_error_ != NULL) {
				goto __finally10;
			}
			_data_->got_view = FALSE;
			{
				_data_->_tmp96_ = _data_->self->priv->_addressbook;
				_data_->_tmp97_ = _data_->self->priv->_query_str;
				_data_->_tmp98_ = NULL;
				_data_->_state_ = 4;
				e_book_client_get_view (E_BOOK_CLIENT (_data_->_tmp96_), _data_->_tmp97_, NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_4:
				_data_->_tmp99_ = FALSE;
				_data_->_tmp99_ = e_book_client_get_view_finish (E_BOOK_CLIENT (_data_->_tmp96_), _data_->_res_, &_data_->_tmp98_, &_data_->_inner_error_);
				_g_object_unref0 (_data_->self->priv->_ebookview);
				_data_->self->priv->_ebookview = _data_->_tmp98_;
				_data_->_tmp100_ = _data_->_tmp99_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch14_g_error;
				}
				_data_->got_view = _data_->_tmp100_;
				_data_->_tmp101_ = _data_->got_view;
				if (_data_->_tmp101_ == FALSE) {
					_data_->_tmp102_ = NULL;
					_data_->_tmp102_ = _ ("Couldn't get view for address book ‘%s’.");
					_data_->_tmp103_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
					_data_->_tmp104_ = _data_->_tmp103_;
					_data_->_tmp105_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp102_, _data_->_tmp104_);
					_data_->_inner_error_ = _data_->_tmp105_;
					goto __catch14_g_error;
				}
				_data_->_tmp106_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (E_BOOK_CLIENT_VIEW (_data_->_tmp106_), "objects-added", (GCallback) __edsf_persona_store_contacts_added_cb_e_book_client_view_objects_added, _data_->self, 0);
				_data_->_tmp107_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (E_BOOK_CLIENT_VIEW (_data_->_tmp107_), "objects-removed", (GCallback) __edsf_persona_store_contacts_removed_cb_e_book_client_view_objects_removed, _data_->self, 0);
				_data_->_tmp108_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (E_BOOK_CLIENT_VIEW (_data_->_tmp108_), "objects-modified", (GCallback) __edsf_persona_store_contacts_changed_cb_e_book_client_view_objects_modified, _data_->self, 0);
				_data_->_tmp109_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (E_BOOK_CLIENT_VIEW (_data_->_tmp109_), "complete", (GCallback) __edsf_persona_store_contacts_complete_cb_e_book_client_view_complete, _data_->self, 0);
				_data_->_tmp110_ = _data_->self->priv->_ebookview;
				e_book_client_view_start (E_BOOK_CLIENT_VIEW (_data_->_tmp110_), &_data_->_inner_error_);
				if (_data_->_inner_error_ != NULL) {
					goto __catch14_g_error;
				}
			}
			goto __finally14;
			__catch14_g_error:
			{
				_data_->e3 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
				_data_->_tmp111_ = _data_->e3;
				_data_->_tmp112_ = _data_->_tmp111_->domain;
				_data_->_tmp113_ = 0U;
				_data_->_tmp113_ = e_book_client_error_quark ();
				if (_data_->_tmp112_ == _data_->_tmp113_) {
					_data_->_tmp114_ = _data_->e3;
					_data_->_tmp115_ = _data_->_tmp114_->code;
					switch ((EBookClientError) _data_->_tmp115_) {
						default:
						case E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK:
						case E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE:
						case E_BOOK_CLIENT_ERROR_CONTACT_NOT_FOUND:
						case E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS:
						case E_BOOK_CLIENT_ERROR_NO_SPACE:
						{
							break;
						}
					}
				} else {
					_data_->_tmp116_ = _data_->e3;
					_data_->_tmp117_ = _data_->_tmp116_->domain;
					_data_->_tmp118_ = 0U;
					_data_->_tmp118_ = e_client_error_quark ();
					if (_data_->_tmp117_ == _data_->_tmp118_) {
						_data_->_tmp119_ = _data_->e3;
						_data_->_tmp120_ = _data_->_tmp119_->code;
						switch ((EClientError) _data_->_tmp120_) {
							case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
							{
								_data_->_tmp121_ = NULL;
								_data_->_tmp121_ = _ ("Address book ‘%s’ is offline.");
								_data_->_tmp122_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp123_ = _data_->_tmp122_;
								_data_->_tmp124_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _data_->_tmp121_, _data_->_tmp123_);
								_data_->_inner_error_ = _data_->_tmp124_;
								_g_error_free0 (_data_->e3);
								goto __finally14;
							}
							case E_CLIENT_ERROR_PERMISSION_DENIED:
							{
								_data_->_tmp125_ = NULL;
								_data_->_tmp125_ = _ ("Permission denied to open address book ‘%s’: %s");
								_data_->_tmp126_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp127_ = _data_->_tmp126_;
								_data_->_tmp128_ = _data_->e3;
								_data_->_tmp129_ = _data_->_tmp128_->message;
								_data_->_tmp130_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _data_->_tmp125_, _data_->_tmp127_, _data_->_tmp129_);
								_data_->_inner_error_ = _data_->_tmp130_;
								_g_error_free0 (_data_->e3);
								goto __finally14;
							}
							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_->_tmp131_ = NULL;
				_data_->_tmp131_ = _ ("Couldn't get view for address book ‘%s’: %s");
				_data_->_tmp132_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
				_data_->_tmp133_ = _data_->_tmp132_;
				_data_->_tmp134_ = _data_->e3;
				_data_->_tmp135_ = _data_->_tmp134_->message;
				_data_->_tmp136_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp131_, _data_->_tmp133_, _data_->_tmp135_);
				_data_->_inner_error_ = _data_->_tmp136_;
				_g_error_free0 (_data_->e3);
				goto __finally14;
			}
			__finally14:
			{
				_data_->self->priv->_prepare_pending = FALSE;
			}
			if (_data_->_inner_error_ != NULL) {
				goto __finally10;
			}
			_data_->self->priv->_is_prepared = TRUE;
			_data_->self->priv->_prepare_pending = FALSE;
			g_object_notify ((GObject*) _data_->self, "is-prepared");
			_data_->_tmp138_ = _data_->do_initial_query;
			if (_data_->_tmp138_ == FALSE) {
				_data_->_tmp139_ = _data_->self->priv->_is_quiescent;
				_data_->_tmp137_ = _data_->_tmp139_ == FALSE;
			} else {
				_data_->_tmp137_ = FALSE;
			}
			_data_->_tmp140_ = _data_->_tmp137_;
			if (_data_->_tmp140_) {
				_data_->self->priv->_is_quiescent = TRUE;
				g_object_notify ((GObject*) _data_->self, "is-quiescent");
			}
		}
		__finally10:
		{
			_data_->_tmp141_ = _data_->self->priv->_is_prepared;
			g_static_rec_mutex_unlock (&_data_->self->priv->__lock__is_prepared);
		}
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_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 gboolean _edsf_persona_store_address_book_authenticate_cb (EdsfPersonaStore* self, EClient* address_book, void* credentials) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (address_book != NULL, FALSE);
	result = FALSE;
	return result;
}


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


static void _edsf_persona_store_open_address_book (EdsfPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreOpenAddressBookData* _data_;
	EdsfPersonaStore* _tmp0_;
	_data_ = g_slice_new0 (EdsfPersonaStoreOpenAddressBookData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_open_address_book);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_open_address_book_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_edsf_persona_store_open_address_book_co (_data_);
}


static void _edsf_persona_store_open_address_book_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error) {
	EdsfPersonaStoreOpenAddressBookData* _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_open_address_book_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreOpenAddressBookData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_open_address_book_co (_data_);
}


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


static gboolean __edsf_persona_store_open_address_book_co_gsource_func (gpointer self) {
	gboolean result;
	result = _edsf_persona_store_open_address_book_co (self);
	return result;
}


static gboolean _edsf_persona_store_open_address_book_co (EdsfPersonaStoreOpenAddressBookData* _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_->err_out = NULL;
	_data_->_tmp0_ = _data_->self->priv->_addressbook;
	_data_->_tmp1_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	g_debug ("edsf-persona-store.vala:934: Opening address book %p for persona store" \
" ‘%s’ (%p)", _data_->_tmp0_, _data_->_tmp2_, _data_->self);
	_data_->_tmp3_ = _data_->self->priv->_addressbook;
	_data_->_tmp4_ = 0UL;
	_data_->_tmp4_ = g_signal_connect_swapped (E_BOOK_CLIENT (_data_->_tmp3_), "opened", (GCallback) _edsf_persona_store_address_book_opened_cb, _data_->self);
	_data_->signal_id = _data_->_tmp4_;
	{
		_g_error_free0 (_data_->self->priv->_open_address_book_error);
		_data_->self->priv->_open_address_book_error = NULL;
		_data_->_tmp5_ = _data_->self->priv->_addressbook;
		_data_->_state_ = 1;
		e_client_open ((EClient*) E_BOOK_CLIENT (_data_->_tmp5_), FALSE, NULL, _edsf_persona_store_open_address_book_ready, _data_);
		return FALSE;
		_state_1:
		e_client_open_finish ((EClient*) E_BOOK_CLIENT (_data_->_tmp5_), _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			goto __catch15_g_error;
		}
		_data_->_tmp6_ = _data_->self->priv->_open_address_book_error;
		if (_data_->_tmp6_ != NULL) {
			_data_->_tmp7_ = _data_->self->priv->_open_address_book_error;
			_data_->_tmp8_ = _g_error_copy0 (_data_->_tmp7_);
			_data_->_inner_error_ = _data_->_tmp8_;
			goto __catch15_g_error;
		}
	}
	goto __finally15;
	__catch15_g_error:
	{
		_data_->e1 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp10_ = _data_->e1;
		_data_->_tmp11_ = _data_->_tmp10_->domain;
		_data_->_tmp12_ = 0U;
		_data_->_tmp12_ = e_client_error_quark ();
		if (_data_->_tmp11_ == _data_->_tmp12_) {
			_data_->_tmp13_ = _data_->e1;
			_data_->_tmp14_ = _data_->_tmp13_->code;
			_data_->_tmp9_ = ((EClientError) _data_->_tmp14_) == E_CLIENT_ERROR_BUSY;
		} else {
			_data_->_tmp9_ = FALSE;
		}
		_data_->_tmp15_ = _data_->_tmp9_;
		if (_data_->_tmp15_) {
			(_data_->self->priv->_open_address_book_callback_target_destroy_notify == NULL) ? NULL : (_data_->self->priv->_open_address_book_callback_target_destroy_notify (_data_->self->priv->_open_address_book_callback_target), NULL);
			_data_->self->priv->_open_address_book_callback = NULL;
			_data_->self->priv->_open_address_book_callback_target = NULL;
			_data_->self->priv->_open_address_book_callback_target_destroy_notify = NULL;
			_data_->self->priv->_open_address_book_callback = __edsf_persona_store_open_address_book_co_gsource_func;
			_data_->self->priv->_open_address_book_callback_target = _data_;
			_data_->self->priv->_open_address_book_callback_target_destroy_notify = NULL;
			_g_error_free0 (_data_->self->priv->_open_address_book_error);
			_data_->self->priv->_open_address_book_error = NULL;
			_data_->_tmp16_ = _data_->self->priv->_addressbook;
			_data_->_tmp17_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp18_ = _data_->_tmp17_;
			g_debug ("Yielding on opening address book %p for persona store " "‘%s’ (%p)", _data_->_tmp16_, _data_->_tmp18_, _data_->self);
			_data_->_state_ = 2;
			return FALSE;
			_state_2:
			;
			_data_->_tmp19_ = _data_->self->priv->_open_address_book_error;
			_data_->_tmp20_ = _g_error_copy0 (_data_->_tmp19_);
			_g_error_free0 (_data_->err_out);
			_data_->err_out = _data_->_tmp20_;
		} else {
			_data_->_tmp21_ = _data_->e1;
			_data_->_tmp22_ = _g_error_copy0 (_data_->_tmp21_);
			_g_error_free0 (_data_->err_out);
			_data_->err_out = _data_->_tmp22_;
		}
		_data_->_tmp23_ = _data_->err_out;
		if (_data_->_tmp23_ != NULL) {
			_data_->_tmp24_ = _data_->err_out;
			_data_->_tmp25_ = _g_error_copy0 (_data_->_tmp24_);
			_data_->_inner_error_ = _data_->_tmp25_;
			_g_error_free0 (_data_->e1);
			goto __finally15;
		}
		_g_error_free0 (_data_->e1);
	}
	__finally15:
	{
		_data_->_tmp26_ = _data_->self->priv->_addressbook;
		_data_->_tmp27_ = _data_->signal_id;
		g_signal_handler_disconnect ((GObject*) E_BOOK_CLIENT (_data_->_tmp26_), _data_->_tmp27_);
		_data_->_tmp29_ = _data_->self->priv->_addressbook;
		_data_->_tmp30_ = FALSE;
		_data_->_tmp30_ = e_client_is_opened ((EClient*) E_BOOK_CLIENT (_data_->_tmp29_));
		if (_data_->_tmp30_ == FALSE) {
			_data_->_tmp31_ = _data_->err_out;
			_data_->_tmp28_ = _data_->_tmp31_ == NULL;
		} else {
			_data_->_tmp28_ = FALSE;
		}
		_data_->_tmp32_ = _data_->_tmp28_;
		if (_data_->_tmp32_) {
			_data_->_tmp33_ = 0U;
			_data_->_tmp33_ = e_client_error_quark ();
			_data_->_tmp34_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp35_ = _data_->_tmp34_;
			_data_->_tmp36_ = g_error_new (_data_->_tmp33_, (gint) E_CLIENT_ERROR_OTHER_ERROR, "Misbehaving EDS backend: %s.", _data_->_tmp35_);
			_g_error_free0 (_data_->err_out);
			_data_->err_out = _data_->_tmp36_;
		}
	}
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_error_free0 (_data_->err_out);
		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_error_free0 (_data_->err_out);
	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_opened_cb (EdsfPersonaStore* self, GError* err, EBookClient* address_book) {
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	EBookClient* _tmp2_;
	GError* _tmp3_;
	GError* _tmp4_;
	GError* _tmp5_;
	GSourceFunc _tmp6_;
	void* _tmp6__target;
	g_return_if_fail (self != NULL);
	g_return_if_fail (address_book != NULL);
	_tmp0_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = address_book;
	_tmp3_ = err;
	g_debug ("_address_book_opened_cb for store ‘%s’ (%p), address book %p " "and error %p", _tmp1_, self, _tmp2_, (void*) _tmp3_);
	_tmp4_ = err;
	_tmp5_ = _g_error_copy0 (_tmp4_);
	_g_error_free0 (self->priv->_open_address_book_error);
	self->priv->_open_address_book_error = _tmp5_;
	_tmp6_ = self->priv->_open_address_book_callback;
	_tmp6__target = self->priv->_open_address_book_callback_target;
	if (_tmp6_ != NULL) {
		GSourceFunc _tmp7_;
		void* _tmp7__target;
		_tmp7_ = self->priv->_open_address_book_callback;
		_tmp7__target = self->priv->_open_address_book_callback_target;
		_tmp7_ (_tmp7__target);
	}
}


static FolksPersonaDetail _edsf_persona_store_eds_field_name_to_folks_persona_detail (EdsfPersonaStore* self, const gchar* eds_field_name) {
	FolksPersonaDetail result = 0;
	const gchar* _tmp0_;
	EContactField _tmp1_ = 0;
	EContactField eds_field_id;
	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_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_URI:
		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:
		case E_CONTACT_GEO:
		{
			const gchar* _tmp3_;
			_tmp3_ = eds_field_name;
			g_debug ("edsf-persona-store.vala:1182: Unsupported/Unknown EDS field name '%s'.", _tmp3_);
			result = FOLKS_PERSONA_DETAIL_INVALID;
			return result;
		}
	}
}


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_);
	_data_->persona = _tmp2_;
	_tmp3_ = property_name;
	_tmp4_ = g_strdup (_tmp3_);
	_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 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_->self;
		_g_object_unref0 (self);
		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_->self;
		block2_data_unref (_data3_->_data2_);
		_data3_->_data2_ = NULL;
		g_slice_free (Block3Data, _data3_);
	}
}


static void ___lambda6_ (Block3Data* _data3_, GObject* obj, GParamSpec* pspec) {
	Block2Data* _data2_;
	EdsfPersonaStore * self;
	gboolean _tmp0_;
	_data2_ = _data3_->_data2_;
	self = _data2_->self;
	g_return_if_fail (obj != NULL);
	g_return_if_fail (pspec != NULL);
	_data3_->received_notification = TRUE;
	_tmp0_ = _data3_->has_yielded;
	if (_tmp0_ == TRUE) {
		_edsf_persona_store_commit_modified_property_co (_data2_->_async_data_);
	}
}


static void ____lambda6__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	___lambda6_ (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 ___lambda7_ (Block3Data* _data3_) {
	Block2Data* _data2_;
	EdsfPersonaStore * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	_data2_ = _data3_->_data2_;
	self = _data2_->self;
	_tmp0_ = _data3_->has_yielded;
	if (_tmp0_ == TRUE) {
		_edsf_persona_store_commit_modified_property_co (_data2_->_async_data_);
	}
	result = FALSE;
	return result;
}


static gboolean ____lambda7__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda7_ (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_->_data2_ = g_slice_new0 (Block2Data);
	_data_->_data2_->_ref_count_ = 1;
	_data_->_data2_->self = g_object_ref (_data_->self);
	_data_->_data2_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->_addressbook;
	g_assert (_data_->_tmp0_ != NULL);
	_data_->_tmp1_ = _data_->persona;
	_data_->_tmp2_ = edsf_persona_get_contact (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = _g_object_ref0 (_data_->_tmp3_);
	_data_->contact = _data_->_tmp4_;
	_data_->signal_id = (gulong) 0;
	_data_->timeout_id = (guint) 0;
	{
		_data_->_data3_ = g_slice_new0 (Block3Data);
		_data_->_data3_->_ref_count_ = 1;
		_data_->_data3_->_data2_ = block2_data_ref (_data_->_data2_);
		_data_->_data3_->received_notification = FALSE;
		_data_->_data3_->has_yielded = FALSE;
		_data_->_tmp5_ = _data_->persona;
		_data_->_tmp6_ = _data_->property_name;
		_data_->_tmp7_ = g_strconcat ("notify::", _data_->_tmp6_, NULL);
		_data_->_tmp8_ = 0UL;
		_data_->_tmp8_ = g_signal_connect_data ((GObject*) _data_->_tmp5_, _data_->_tmp7_, (GCallback) ____lambda6__g_object_notify, block3_data_ref (_data_->_data3_), (GClosureNotify) block3_data_unref, 0);
		_data_->signal_id = _data_->_tmp8_;
		_g_free0 (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->self->priv->_addressbook;
		_data_->_tmp10_ = _data_->contact;
		_data_->_state_ = 1;
		e_book_client_modify_contact (E_BOOK_CLIENT (_data_->_tmp9_), _data_->_tmp10_, NULL, _edsf_persona_store_commit_modified_property_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_modify_contact_finish (E_BOOK_CLIENT (_data_->_tmp9_), _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			goto __catch16_g_error;
		}
		_data_->_tmp11_ = 0U;
		_data_->_tmp11_ = g_timeout_add_seconds_full (G_PRIORITY_LOW, EDSF_PERSONA_STORE__property_change_timeout, ____lambda7__gsource_func, block3_data_ref (_data_->_data3_), block3_data_unref);
		_data_->timeout_id = _data_->_tmp11_;
		_data_->_tmp12_ = _data_->_data3_->received_notification;
		if (_data_->_tmp12_ == FALSE) {
			_data_->_data3_->has_yielded = TRUE;
			_data_->_state_ = 2;
			return FALSE;
			_state_2:
			;
		}
		_data_->_tmp13_ = _data_->_data3_->received_notification;
		if (_data_->_tmp13_ == FALSE) {
			_data_->_tmp14_ = NULL;
			_data_->_tmp14_ = _ ("Changing the ‘%s’ property failed due to reaching the timeout.");
			_data_->_tmp15_ = _data_->property_name;
			_data_->_tmp16_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_UNKNOWN_ERROR, _data_->_tmp14_, _data_->_tmp15_);
			_data_->_inner_error_ = _data_->_tmp16_;
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			goto __catch16_g_error;
		}
		block3_data_unref (_data_->_data3_);
		_data_->_data3_ = NULL;
	}
	goto __finally16;
	__catch16_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp17_ = _data_->property_name;
		_data_->_tmp18_ = _data_->e;
		_data_->_tmp19_ = NULL;
		_data_->_tmp19_ = edsf_persona_store_e_client_error_to_property_error (_data_->self, _data_->_tmp17_, _data_->_tmp18_);
		_data_->_inner_error_ = _data_->_tmp19_;
		_g_error_free0 (_data_->e);
		goto __finally16;
	}
	__finally16:
	{
		_data_->_tmp20_ = _data_->persona;
		_data_->_tmp21_ = _data_->signal_id;
		g_signal_handler_disconnect ((GObject*) _data_->_tmp20_, _data_->_tmp21_);
		_data_->_tmp22_ = _data_->timeout_id;
		g_source_remove (_data_->_tmp22_);
	}
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->contact);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = 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);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = 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);
	block2_data_unref (_data_->_data2_);
	_data_->_data2_ = 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_;
	EVCardAttribute* _tmp2_ = NULL;
	EVCardAttribute* attr;
	EVCardAttribute* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	g_return_if_fail (attr_name != NULL);
	_tmp0_ = contact;
	_tmp1_ = attr_name;
	_tmp2_ = e_vcard_get_attribute ((EVCard*) _tmp0_, _tmp1_);
	attr = _tmp2_;
	_tmp3_ = attr;
	if (_tmp3_ != NULL) {
		EContact* _tmp4_;
		EVCardAttribute* _tmp5_;
		_tmp4_ = contact;
		_tmp5_ = attr;
		e_vcard_remove_attribute ((EVCard*) _tmp4_, (EVCardAttribute*) _tmp5_);
	}
}


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_);
	_data_->persona = _tmp2_;
	_tmp3_ = avatar;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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_ = NULL;
		_data_->_tmp1_ = _ ("Avatar is not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp5_ = _data_->persona;
	_data_->_tmp6_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	if (_data_->_tmp7_ == NULL) {
		_data_->_tmp8_ = _data_->avatar;
		_data_->_tmp4_ = _data_->_tmp8_ == NULL;
	} else {
		_data_->_tmp4_ = FALSE;
	}
	_data_->_tmp9_ = _data_->_tmp4_;
	if (_data_->_tmp9_) {
		_data_->_tmp3_ = TRUE;
	} else {
		_data_->_tmp11_ = _data_->persona;
		_data_->_tmp12_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		if (_data_->_tmp13_ != NULL) {
			_data_->_tmp14_ = _data_->persona;
			_data_->_tmp15_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp14_);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = _data_->avatar;
			_data_->_tmp18_ = FALSE;
			_data_->_tmp18_ = g_icon_equal ((GIcon*) G_LOADABLE_ICON (_data_->_tmp16_), (GIcon*) _data_->_tmp17_);
			_data_->_tmp10_ = _data_->_tmp18_;
		} else {
			_data_->_tmp10_ = FALSE;
		}
		_data_->_tmp19_ = _data_->_tmp10_;
		_data_->_tmp3_ = _data_->_tmp19_;
	}
	_data_->_tmp20_ = _data_->_tmp3_;
	if (_data_->_tmp20_) {
		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_->_tmp21_ = _data_->persona;
	_data_->_tmp22_ = edsf_persona_get_contact (_data_->_tmp21_);
	_data_->_tmp23_ = _data_->_tmp22_;
	_data_->_tmp24_ = _data_->avatar;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_avatar (_data_->self, _data_->_tmp23_, _data_->_tmp24_, _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 (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp25_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp25_, "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 (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = web_service_addresses;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "web-service-addresses")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Web service addresses are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->web_service_addresses;
	_data_->_tmp7_ = FALSE;
	_data_->_tmp7_ = folks_utils_multi_map_str_afd_equal (_data_->_tmp5_, _data_->_tmp6_);
	if (_data_->_tmp7_) {
		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_->_tmp8_ = _data_->persona;
	_data_->_tmp9_ = edsf_persona_get_contact (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->web_service_addresses;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_web_service_addresses (_data_->self, _data_->_tmp10_, _data_->_tmp11_, _edsf_persona_store_set_web_service_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_web_service_addresses_finish (_data_->self, _data_->_res_);
	_data_->_tmp12_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp12_, "web-service-addresses", _edsf_persona_store_set_web_service_addresses_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_web_service_addresses_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactWebServiceAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->web_service_addresses);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactWebServiceAddressesData, _data_);
}


static void _edsf_persona_store_set_contact_web_service_addresses (EdsfPersonaStore* self, EContact* contact, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactWebServiceAddressesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeMultiMap* _tmp3_;
	GeeMultiMap* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactWebServiceAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_web_service_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_web_service_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = web_service_addresses;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->web_service_addresses = _tmp4_;
	_edsf_persona_store_set_contact_web_service_addresses_co (_data_);
}


static void _edsf_persona_store_set_contact_web_service_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactWebServiceAddressesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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 gboolean _edsf_persona_store_set_contact_web_service_addresses_co (EdsfPersonaStoreSetContactWebServiceAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->contact;
	_edsf_persona_store_remove_attribute (_data_->self, _data_->_tmp0_, "X-FOLKS-WEB-SERVICES-IDS");
	_data_->_tmp1_ = e_vcard_attribute_new (NULL, "X-FOLKS-WEB-SERVICES-IDS");
	_data_->attr_n = _data_->_tmp1_;
	{
		_data_->_tmp2_ = _data_->web_service_addresses;
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = gee_multi_map_get_keys (_data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		_g_object_unref0 (_data_->_tmp4_);
		_data_->_service_it = _data_->_tmp6_;
		while (TRUE) {
			_data_->_tmp7_ = _data_->_service_it;
			_data_->_tmp8_ = FALSE;
			_data_->_tmp8_ = gee_iterator_next (_data_->_tmp7_);
			if (!_data_->_tmp8_) {
				break;
			}
			_data_->_tmp9_ = _data_->_service_it;
			_data_->_tmp10_ = NULL;
			_data_->_tmp10_ = gee_iterator_get (_data_->_tmp9_);
			_data_->service = (gchar*) _data_->_tmp10_;
			_data_->_tmp11_ = _data_->service;
			_data_->_tmp12_ = e_vcard_attribute_param_new (_data_->_tmp11_);
			_data_->param = _data_->_tmp12_;
			{
				_data_->_tmp13_ = _data_->web_service_addresses;
				_data_->_tmp14_ = _data_->service;
				_data_->_tmp15_ = NULL;
				_data_->_tmp15_ = gee_multi_map_get (_data_->_tmp13_, _data_->_tmp14_);
				_data_->_tmp16_ = _data_->_tmp15_;
				_data_->_tmp17_ = NULL;
				_data_->_tmp17_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp16_);
				_data_->_tmp18_ = _data_->_tmp17_;
				_g_object_unref0 (_data_->_tmp16_);
				_data_->_ws_fd_it = _data_->_tmp18_;
				while (TRUE) {
					_data_->_tmp19_ = _data_->_ws_fd_it;
					_data_->_tmp20_ = FALSE;
					_data_->_tmp20_ = gee_iterator_next (_data_->_tmp19_);
					if (!_data_->_tmp20_) {
						break;
					}
					_data_->_tmp21_ = _data_->_ws_fd_it;
					_data_->_tmp22_ = NULL;
					_data_->_tmp22_ = gee_iterator_get (_data_->_tmp21_);
					_data_->ws_fd = (FolksWebServiceFieldDetails*) _data_->_tmp22_;
					_data_->_tmp23_ = _data_->param;
					_data_->_tmp24_ = _data_->ws_fd;
					_data_->_tmp25_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp24_);
					_data_->_tmp26_ = _data_->_tmp25_;
					e_vcard_attribute_param_add_value (_data_->_tmp23_, (const gchar*) _data_->_tmp26_);
					_g_object_unref0 (_data_->ws_fd);
				}
				_g_object_unref0 (_data_->_ws_fd_it);
			}
			_data_->_tmp27_ = _data_->attr_n;
			_data_->_tmp28_ = _data_->param;
			_data_->_tmp29_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp28_);
			e_vcard_attribute_add_param (_data_->_tmp27_, _data_->_tmp29_);
			__vala_EVCardAttributeParam_free0 (_data_->param);
			_g_free0 (_data_->service);
		}
		_g_object_unref0 (_data_->_service_it);
	}
	_data_->_tmp30_ = _data_->contact;
	_data_->_tmp31_ = _data_->attr_n;
	_data_->attr_n = NULL;
	e_vcard_add_attribute ((EVCard*) _data_->_tmp30_, _data_->_tmp31_);
	__vala_EVCardAttribute_free0 (_data_->attr_n);
	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_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = urls;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "urls")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("URLs are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_url_details_get_urls ((FolksUrlDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->urls;
	_data_->_tmp7_ = FALSE;
	_data_->_tmp7_ = folks_utils_set_afd_equal (_data_->_tmp5_, _data_->_tmp6_);
	if (_data_->_tmp7_) {
		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_->_tmp8_ = _data_->persona;
	_data_->_tmp9_ = edsf_persona_get_contact (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->urls;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_urls (_data_->self, _data_->_tmp10_, _data_->_tmp11_, _edsf_persona_store_set_urls_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_urls_finish (_data_->self, _data_->_res_);
	_data_->_tmp12_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp12_, "urls", _edsf_persona_store_set_urls_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactUrlsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->urls);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactUrlsData, _data_);
}


static void _edsf_persona_store_set_contact_urls (EdsfPersonaStore* self, EContact* contact, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactUrlsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactUrlsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_urls);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_urls_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = urls;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->urls = _tmp4_;
	_edsf_persona_store_set_contact_urls_co (_data_);
}


static void _edsf_persona_store_set_contact_urls_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactUrlsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _edsf_persona_store_set_contact_urls_co (EdsfPersonaStoreSetContactUrlsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->contact;
	_data_->_tmp1_ = _g_object_ref0 (E_VCARD (_data_->_tmp0_));
	_data_->vcard = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->vcard;
	e_vcard_remove_attributes (_data_->_tmp2_, NULL, "X-URIS");
	{
		_data_->_tmp3_ = _data_->urls;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp3_);
		_data_->_u_it = _data_->_tmp4_;
		while (TRUE) {
			_data_->_tmp5_ = _data_->_u_it;
			_data_->_tmp6_ = FALSE;
			_data_->_tmp6_ = gee_iterator_next (_data_->_tmp5_);
			if (!_data_->_tmp6_) {
				break;
			}
			_data_->_tmp7_ = _data_->_u_it;
			_data_->_tmp8_ = NULL;
			_data_->_tmp8_ = gee_iterator_get (_data_->_tmp7_);
			_data_->u = (FolksUrlFieldDetails*) _data_->_tmp8_;
			_data_->set_attr_already = FALSE;
			_data_->_tmp9_ = e_vcard_attribute_new (NULL, "X-URIS");
			_data_->attr = _data_->_tmp9_;
			_data_->_tmp10_ = _data_->attr;
			_data_->_tmp11_ = _data_->u;
			_data_->_tmp12_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp11_);
			_data_->_tmp13_ = _data_->_tmp12_;
			e_vcard_attribute_add_value (_data_->_tmp10_, (const gchar*) _data_->_tmp13_);
			{
				_data_->_tmp14_ = _data_->u;
				_data_->_tmp15_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _data_->_tmp14_);
				_data_->_tmp16_ = _data_->_tmp15_;
				_data_->_tmp17_ = NULL;
				_data_->_tmp17_ = gee_multi_map_get_keys (_data_->_tmp16_);
				_data_->_tmp18_ = _data_->_tmp17_;
				_data_->_tmp19_ = NULL;
				_data_->_tmp19_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp18_);
				_data_->_tmp20_ = _data_->_tmp19_;
				_g_object_unref0 (_data_->_tmp18_);
				_data_->_param_name_it = _data_->_tmp20_;
				while (TRUE) {
					_data_->_tmp21_ = _data_->_param_name_it;
					_data_->_tmp22_ = FALSE;
					_data_->_tmp22_ = gee_iterator_next (_data_->_tmp21_);
					if (!_data_->_tmp22_) {
						break;
					}
					_data_->_tmp23_ = _data_->_param_name_it;
					_data_->_tmp24_ = NULL;
					_data_->_tmp24_ = gee_iterator_get (_data_->_tmp23_);
					_data_->param_name = (gchar*) _data_->_tmp24_;
					_data_->_tmp25_ = _data_->param_name;
					_data_->_tmp26_ = NULL;
					_data_->_tmp26_ = g_utf8_strup (_data_->_tmp25_, (gssize) (-1));
					_data_->_tmp27_ = _data_->_tmp26_;
					_data_->_tmp28_ = e_vcard_attribute_param_new (_data_->_tmp27_);
					_data_->_tmp29_ = _data_->_tmp28_;
					_g_free0 (_data_->_tmp27_);
					_data_->param = _data_->_tmp29_;
					{
						_data_->_tmp30_ = _data_->u;
						_data_->_tmp31_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _data_->_tmp30_);
						_data_->_tmp32_ = _data_->_tmp31_;
						_data_->_tmp33_ = _data_->param_name;
						_data_->_tmp34_ = NULL;
						_data_->_tmp34_ = gee_multi_map_get (_data_->_tmp32_, _data_->_tmp33_);
						_data_->_tmp35_ = _data_->_tmp34_;
						_data_->_tmp36_ = NULL;
						_data_->_tmp36_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp35_);
						_data_->_tmp37_ = _data_->_tmp36_;
						_g_object_unref0 (_data_->_tmp35_);
						_data_->_param_val_it = _data_->_tmp37_;
						while (TRUE) {
							_data_->_tmp38_ = _data_->_param_val_it;
							_data_->_tmp39_ = FALSE;
							_data_->_tmp39_ = gee_iterator_next (_data_->_tmp38_);
							if (!_data_->_tmp39_) {
								break;
							}
							_data_->_tmp40_ = _data_->_param_val_it;
							_data_->_tmp41_ = NULL;
							_data_->_tmp41_ = gee_iterator_get (_data_->_tmp40_);
							_data_->param_val = (gchar*) _data_->_tmp41_;
							_data_->_tmp42_ = _data_->param_name;
							if (g_strcmp0 (_data_->_tmp42_, FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE) == 0) {
								{
									_data_->mapping_collection_length1 = 0;
									_data_->_mapping_collection_size_ = 0;
									_data_->mapping_collection = EDSF_PERSONA__url_properties;
									_data_->mapping_collection_length1 = G_N_ELEMENTS (EDSF_PERSONA__url_properties);
									for (_data_->mapping_it = 0; _data_->mapping_it < G_N_ELEMENTS (EDSF_PERSONA__url_properties); _data_->mapping_it = _data_->mapping_it + 1) {
										_data_->mapping = _data_->mapping_collection[_data_->mapping_it];
										{
											_data_->_tmp43_ = _data_->param_val;
											_data_->_tmp44_ = NULL;
											_data_->_tmp44_ = g_utf8_strdown (_data_->_tmp43_, (gssize) (-1));
											_data_->_tmp45_ = _data_->_tmp44_;
											_data_->_tmp46_ = _data_->mapping;
											_data_->_tmp47_ = _data_->_tmp46_.folks_type;
											_data_->_tmp48_ = g_strcmp0 (_data_->_tmp45_, _data_->_tmp47_) == 0;
											_g_free0 (_data_->_tmp45_);
											if (_data_->_tmp48_) {
												_data_->_tmp49_ = _data_->contact;
												_data_->_tmp50_ = _data_->mapping;
												_data_->_tmp51_ = _data_->_tmp50_.vcard_field_name;
												_data_->_tmp52_ = 0;
												_data_->_tmp52_ = e_contact_field_id (_data_->_tmp51_);
												_data_->_tmp53_ = _data_->u;
												_data_->_tmp54_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp53_);
												_data_->_tmp55_ = _data_->_tmp54_;
												e_contact_set (_data_->_tmp49_, _data_->_tmp52_, (const gchar*) _data_->_tmp55_);
												_data_->set_attr_already = TRUE;
												break;
											}
										}
									}
								}
							}
							_data_->_tmp56_ = _data_->set_attr_already;
							if (_data_->_tmp56_ == TRUE) {
								_g_free0 (_data_->param_val);
								break;
							}
							_data_->_tmp57_ = _data_->param;
							_data_->_tmp58_ = _data_->param_val;
							e_vcard_attribute_param_add_value (_data_->_tmp57_, _data_->_tmp58_);
							_g_free0 (_data_->param_val);
						}
						_g_object_unref0 (_data_->_param_val_it);
					}
					_data_->_tmp59_ = _data_->set_attr_already;
					if (_data_->_tmp59_ == TRUE) {
						__vala_EVCardAttributeParam_free0 (_data_->param);
						_g_free0 (_data_->param_name);
						break;
					}
					_data_->_tmp60_ = _data_->attr;
					_data_->_tmp61_ = _data_->param;
					_data_->_tmp62_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp61_);
					e_vcard_attribute_add_param (_data_->_tmp60_, _data_->_tmp62_);
					__vala_EVCardAttributeParam_free0 (_data_->param);
					_g_free0 (_data_->param_name);
				}
				_g_object_unref0 (_data_->_param_name_it);
			}
			_data_->_tmp63_ = _data_->set_attr_already;
			if (_data_->_tmp63_ == TRUE) {
				__vala_EVCardAttribute_free0 (_data_->attr);
				_g_object_unref0 (_data_->u);
				continue;
			}
			_data_->_tmp64_ = _data_->contact;
			_data_->_tmp65_ = _data_->attr;
			_data_->attr = NULL;
			e_vcard_add_attribute ((EVCard*) _data_->_tmp64_, _data_->_tmp65_);
			__vala_EVCardAttribute_free0 (_data_->attr);
			_g_object_unref0 (_data_->u);
		}
		_g_object_unref0 (_data_->_u_it);
	}
	_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_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = local_ids;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "local-ids")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Local IDs are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_contact (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->local_ids;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_local_ids (_data_->self, _data_->_tmp5_, _data_->_tmp6_, _edsf_persona_store_set_local_ids_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_local_ids_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp7_, "local-ids", _edsf_persona_store_set_local_ids_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactLocalIdsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->local_ids);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactLocalIdsData, _data_);
}


static void _edsf_persona_store_set_contact_local_ids (EdsfPersonaStore* self, EContact* contact, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactLocalIdsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactLocalIdsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_local_ids);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_local_ids_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = local_ids;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->local_ids = _tmp4_;
	_edsf_persona_store_set_contact_local_ids_co (_data_);
}


static void _edsf_persona_store_set_contact_local_ids_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactLocalIdsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _edsf_persona_store_set_contact_local_ids_co (EdsfPersonaStoreSetContactLocalIdsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->contact;
	_edsf_persona_store_remove_attribute (_data_->self, _data_->_tmp0_, "X-FOLKS-CONTACTS-IDS");
	_data_->_tmp1_ = e_vcard_attribute_new (NULL, "X-FOLKS-CONTACTS-IDS");
	_data_->new_attr = _data_->_tmp1_;
	{
		_data_->_tmp2_ = _data_->local_ids;
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp2_);
		_data_->_local_id_it = _data_->_tmp3_;
		while (TRUE) {
			_data_->_tmp4_ = _data_->_local_id_it;
			_data_->_tmp5_ = FALSE;
			_data_->_tmp5_ = gee_iterator_next (_data_->_tmp4_);
			if (!_data_->_tmp5_) {
				break;
			}
			_data_->_tmp6_ = _data_->_local_id_it;
			_data_->_tmp7_ = NULL;
			_data_->_tmp7_ = gee_iterator_get (_data_->_tmp6_);
			_data_->local_id = (gchar*) _data_->_tmp7_;
			_data_->_tmp8_ = _data_->new_attr;
			_data_->_tmp9_ = _data_->local_id;
			e_vcard_attribute_add_value (_data_->_tmp8_, _data_->_tmp9_);
			_g_free0 (_data_->local_id);
		}
		_g_object_unref0 (_data_->_local_id_it);
	}
	_data_->_tmp10_ = _data_->contact;
	_data_->_tmp11_ = _data_->new_attr;
	_data_->new_attr = NULL;
	e_vcard_add_attribute ((EVCard*) _data_->_tmp10_, _data_->_tmp11_);
	__vala_EVCardAttribute_free0 (_data_->new_attr);
	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_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_);
	_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;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		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_ = NULL;
		_data_->_tmp1_ = _ ("The contact cannot be marked as favourite.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_contact (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->is_favourite;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_is_favourite (_data_->self, _data_->_tmp5_, _data_->_tmp6_, _edsf_persona_store_set_is_favourite_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_is_favourite_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp7_, "is-favourite", _edsf_persona_store_set_is_favourite_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp8_ = FALSE;
	_data_->_tmp8_ = _edsf_persona_store_is_google_contacts_address_book (_data_->self);
	if (_data_->_tmp8_) {
		{
			_data_->_tmp9_ = _data_->persona;
			_data_->_tmp10_ = _data_->is_favourite;
			_data_->_state_ = 3;
			folks_group_details_change_group ((FolksGroupDetails*) _data_->_tmp9_, EDSF_PERSONA_STORE_android_favourite_group_name, _data_->_tmp10_, _edsf_persona_store_set_is_favourite_ready, _data_);
			return FALSE;
			_state_3:
			folks_group_details_change_group_finish ((FolksGroupDetails*) _data_->_tmp9_, _data_->_res_, &_data_->_inner_error_);
			if (_data_->_inner_error_ != NULL) {
				goto __catch17_g_error;
			}
		}
		goto __finally17;
		__catch17_g_error:
		{
			_data_->e1 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			_data_->_tmp11_ = _data_->e1;
			g_assert (_data_->_tmp11_->domain == FOLKS_PROPERTY_ERROR);
			_data_->_tmp12_ = _data_->e1;
			_data_->_tmp13_ = _g_error_copy0 ((GError*) _data_->_tmp12_);
			_data_->_inner_error_ = _data_->_tmp13_;
			_g_error_free0 (_data_->e1);
			goto __finally17;
		}
		__finally17:
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_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_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactIsFavouriteData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactIsFavouriteData, _data_);
}


static void _edsf_persona_store_set_contact_is_favourite (EdsfPersonaStore* self, EContact* contact, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactIsFavouriteData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	gboolean _tmp3_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactIsFavouriteData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_is_favourite);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_is_favourite_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = is_favourite;
	_data_->is_favourite = _tmp3_;
	_edsf_persona_store_set_contact_is_favourite_co (_data_);
}


static void _edsf_persona_store_set_contact_is_favourite_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactIsFavouriteData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _edsf_persona_store_set_contact_is_favourite_co (EdsfPersonaStoreSetContactIsFavouriteData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->contact;
	_edsf_persona_store_remove_attribute (_data_->self, _data_->_tmp0_, "X-FOLKS-FAVOURITE");
	_data_->_tmp1_ = _data_->is_favourite;
	if (_data_->_tmp1_) {
		_data_->_tmp2_ = e_vcard_attribute_new (NULL, "X-FOLKS-FAVOURITE");
		_data_->new_attr = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->new_attr;
		e_vcard_attribute_add_value (_data_->_tmp3_, "true");
		_data_->_tmp4_ = _data_->contact;
		_data_->_tmp5_ = _data_->new_attr;
		_data_->new_attr = NULL;
		e_vcard_add_attribute ((EVCard*) _data_->_tmp4_, _data_->_tmp5_);
		__vala_EVCardAttribute_free0 (_data_->new_attr);
	}
	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_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_);
	_data_->contact = _tmp2_;
	_tmp3_ = avatar;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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_LOADABLE_ICON (_data_->_tmp4_), -1, NULL, _edsf_persona_store_set_contact_avatar_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp5_ = NULL;
			_data_->_tmp5_ = g_loadable_icon_load_finish (G_LOADABLE_ICON (_data_->_tmp4_), _data_->_res_, NULL, &_data_->_inner_error_);
			_data_->input_s = _data_->_tmp5_;
			if (_data_->_inner_error_ != NULL) {
				__vala_EContactPhoto_free0 (_data_->cp);
				goto __catch18_g_error;
			}
			_data_->_tmp6_ = NULL;
			_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_ = NULL;
			_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_ = 0L;
				_data_->_tmp10_ = g_input_stream_read_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
				_data_->size_read = _data_->_tmp10_;
				if (_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 __catch18_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_ = 0;
				_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_ = NULL;
			_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 __finally18;
		__catch18_g_error:
		{
			_data_->e1 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			_data_->_tmp30_ = NULL;
			_data_->_tmp30_ = _ ("Can't update avatar: %s");
			_data_->_tmp31_ = _data_->e1;
			_data_->_tmp32_ = _data_->_tmp31_->message;
			_data_->_tmp33_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_INVALID_VALUE, _data_->_tmp30_, _data_->_tmp32_);
			_data_->_inner_error_ = _data_->_tmp33_;
			_g_error_free0 (_data_->e1);
			goto __finally18;
		}
		__finally18:
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = emails;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "email-addresses")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("E-mail addresses are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_contact (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->emails;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp5_, _data_->_tmp6_, "EMAIL", E_CONTACT_EMAIL, _edsf_persona_store_set_emails_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_attributes_string_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp7_, "email-addresses", _edsf_persona_store_set_emails_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = phones;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "phone-numbers")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Phone numbers are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_contact (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->phones;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp5_, _data_->_tmp6_, "TEL", E_CONTACT_TEL, _edsf_persona_store_set_phones_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_attributes_string_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp7_, "phone-numbers", _edsf_persona_store_set_phones_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = postal_fds;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "postal-addresses")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Postal addresses are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_contact (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->postal_fds;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_postal_addresses (_data_->self, _data_->_tmp5_, _data_->_tmp6_, _edsf_persona_store_set_postal_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_postal_addresses_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp7_, "postal-addresses", _edsf_persona_store_set_postal_addresses_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_postal_addresses_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactPostalAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->postal_fds);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactPostalAddressesData, _data_);
}


static void _edsf_persona_store_set_contact_postal_addresses (EdsfPersonaStore* self, EContact* contact, GeeSet* postal_fds, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactPostalAddressesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactPostalAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_postal_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_postal_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = postal_fds;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->postal_fds = _tmp4_;
	_edsf_persona_store_set_contact_postal_addresses_co (_data_);
}


static void _edsf_persona_store_set_contact_postal_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactPostalAddressesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void __lambda3_ (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 ___lambda3__edsf_persona_store_field_to_attribute (EVCardAttribute* attr, gconstpointer value, gpointer self) {
	__lambda3_ (self, attr, value);
}


static void _edsf_persona_store_set_contact_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactPostalAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_edsf_persona_store_set_contact_postal_addresses_co (_data_);
}


static gboolean _edsf_persona_store_set_contact_postal_addresses_co (EdsfPersonaStoreSetContactPostalAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->contact;
	_data_->_tmp1_ = _data_->postal_fds;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_attributes (_data_->self, FOLKS_TYPE_POSTAL_ADDRESS, (GBoxedCopyFunc) g_object_ref, g_object_unref, _data_->_tmp0_, _data_->_tmp1_, ___lambda3__edsf_persona_store_field_to_attribute, _data_->self, "ADR", E_CONTACT_ADDRESS, _edsf_persona_store_set_contact_postal_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_attributes_finish (_data_->self, _data_->_res_);
	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_attributes_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactAttributesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->new_attributes);
	_g_free0 (_data_->attrib_name);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactAttributesData, _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, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactAttributesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	EdsfPersonaStoreFieldToAttribute _tmp5_;
	void* _tmp5__target;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	EContactField _tmp8_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactAttributesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_attributes);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_attributes_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = new_attributes;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->new_attributes = _tmp4_;
	_tmp5_ = fill_attribute;
	_tmp5__target = fill_attribute_target;
	_data_->fill_attribute = _tmp5_;
	_data_->fill_attribute_target = _tmp5__target;
	_tmp6_ = attrib_name;
	_tmp7_ = g_strdup (_tmp6_);
	_data_->attrib_name = _tmp7_;
	_tmp8_ = field_id;
	_data_->field_id = _tmp8_;
	_data_->t_type = t_type;
	_data_->t_dup_func = t_dup_func;
	_data_->t_destroy_func = t_destroy_func;
	_edsf_persona_store_set_contact_attributes_co (_data_);
}


static void _edsf_persona_store_set_contact_attributes_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactAttributesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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 gboolean _edsf_persona_store_set_contact_attributes_co (EdsfPersonaStoreSetContactAttributesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->attributes = NULL;
	{
		_data_->_tmp0_ = _data_->new_attributes;
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp0_);
		_data_->_e_it = _data_->_tmp1_;
		while (TRUE) {
			_data_->_tmp2_ = _data_->_e_it;
			_data_->_tmp3_ = FALSE;
			_data_->_tmp3_ = gee_iterator_next (_data_->_tmp2_);
			if (!_data_->_tmp3_) {
				break;
			}
			_data_->_tmp4_ = _data_->_e_it;
			_data_->_tmp5_ = NULL;
			_data_->_tmp5_ = gee_iterator_get (_data_->_tmp4_);
			_data_->e = (FolksAbstractFieldDetails*) _data_->_tmp5_;
			_data_->_tmp6_ = _data_->attrib_name;
			_data_->_tmp7_ = e_vcard_attribute_new (NULL, _data_->_tmp6_);
			_data_->attr = _data_->_tmp7_;
			_data_->_tmp8_ = _data_->fill_attribute;
			_data_->_tmp8__target = _data_->fill_attribute_target;
			_data_->_tmp9_ = _data_->attr;
			_data_->_tmp10_ = _data_->e;
			_data_->_tmp11_ = folks_abstract_field_details_get_value (_data_->_tmp10_);
			_data_->_tmp12_ = _data_->_tmp11_;
			_data_->_tmp8_ (_data_->_tmp9_, _data_->_tmp12_, _data_->_tmp8__target);
			{
				_data_->_tmp13_ = _data_->e;
				_data_->_tmp14_ = folks_abstract_field_details_get_parameters (_data_->_tmp13_);
				_data_->_tmp15_ = _data_->_tmp14_;
				_data_->_tmp16_ = NULL;
				_data_->_tmp16_ = gee_multi_map_get_keys (_data_->_tmp15_);
				_data_->_tmp17_ = _data_->_tmp16_;
				_data_->_tmp18_ = NULL;
				_data_->_tmp18_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp17_);
				_data_->_tmp19_ = _data_->_tmp18_;
				_g_object_unref0 (_data_->_tmp17_);
				_data_->_param_name_it = _data_->_tmp19_;
				while (TRUE) {
					_data_->_tmp20_ = _data_->_param_name_it;
					_data_->_tmp21_ = FALSE;
					_data_->_tmp21_ = gee_iterator_next (_data_->_tmp20_);
					if (!_data_->_tmp21_) {
						break;
					}
					_data_->_tmp22_ = _data_->_param_name_it;
					_data_->_tmp23_ = NULL;
					_data_->_tmp23_ = gee_iterator_get (_data_->_tmp22_);
					_data_->param_name = (gchar*) _data_->_tmp23_;
					_data_->_tmp24_ = _data_->param_name;
					_data_->_tmp25_ = NULL;
					_data_->_tmp25_ = g_utf8_strup (_data_->_tmp24_, (gssize) (-1));
					_data_->_tmp26_ = _data_->_tmp25_;
					_data_->_tmp27_ = e_vcard_attribute_param_new (_data_->_tmp26_);
					_data_->_tmp28_ = _data_->_tmp27_;
					_g_free0 (_data_->_tmp26_);
					_data_->param = _data_->_tmp28_;
					{
						_data_->_tmp29_ = _data_->e;
						_data_->_tmp30_ = folks_abstract_field_details_get_parameters (_data_->_tmp29_);
						_data_->_tmp31_ = _data_->_tmp30_;
						_data_->_tmp32_ = _data_->param_name;
						_data_->_tmp33_ = NULL;
						_data_->_tmp33_ = gee_multi_map_get (_data_->_tmp31_, _data_->_tmp32_);
						_data_->_tmp34_ = _data_->_tmp33_;
						_data_->_tmp35_ = NULL;
						_data_->_tmp35_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp34_);
						_data_->_tmp36_ = _data_->_tmp35_;
						_g_object_unref0 (_data_->_tmp34_);
						_data_->_param_val_it = _data_->_tmp36_;
						while (TRUE) {
							_data_->_tmp37_ = _data_->_param_val_it;
							_data_->_tmp38_ = FALSE;
							_data_->_tmp38_ = gee_iterator_next (_data_->_tmp37_);
							if (!_data_->_tmp38_) {
								break;
							}
							_data_->_tmp39_ = _data_->_param_val_it;
							_data_->_tmp40_ = NULL;
							_data_->_tmp40_ = gee_iterator_get (_data_->_tmp39_);
							_data_->param_val = (gchar*) _data_->_tmp40_;
							_data_->_tmp41_ = _data_->param;
							_data_->_tmp42_ = _data_->param_val;
							e_vcard_attribute_param_add_value (_data_->_tmp41_, _data_->_tmp42_);
							_g_free0 (_data_->param_val);
						}
						_g_object_unref0 (_data_->_param_val_it);
					}
					_data_->_tmp43_ = _data_->attr;
					_data_->_tmp44_ = _data_->param;
					_data_->_tmp45_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp44_);
					e_vcard_attribute_add_param (_data_->_tmp43_, _data_->_tmp45_);
					__vala_EVCardAttributeParam_free0 (_data_->param);
					_g_free0 (_data_->param_name);
				}
				_g_object_unref0 (_data_->_param_name_it);
			}
			_data_->_tmp46_ = _data_->attr;
			_data_->attr = NULL;
			_data_->attributes = g_list_prepend (_data_->attributes, _data_->_tmp46_);
			__vala_EVCardAttribute_free0 (_data_->attr);
			_g_object_unref0 (_data_->e);
		}
		_g_object_unref0 (_data_->_e_it);
	}
	_data_->_tmp47_ = _data_->contact;
	_data_->_tmp48_ = _data_->field_id;
	_data_->_tmp49_ = _data_->attributes;
	e_contact_set_attributes (_data_->_tmp47_, _data_->_tmp48_, _data_->_tmp49_);
	__g_list_free___vala_EVCardAttribute_free0_0 (_data_->attributes);
	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_attributes_string_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactAttributesStringData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->new_attributes);
	_g_free0 (_data_->attrib_name);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactAttributesStringData, _data_);
}


static void _edsf_persona_store_set_contact_attributes_string (EdsfPersonaStore* self, EContact* contact, GeeSet* new_attributes, const gchar* attrib_name, EContactField field_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactAttributesStringData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	EContactField _tmp7_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactAttributesStringData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_attributes_string);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_attributes_string_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = new_attributes;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->new_attributes = _tmp4_;
	_tmp5_ = attrib_name;
	_tmp6_ = g_strdup (_tmp5_);
	_data_->attrib_name = _tmp6_;
	_tmp7_ = field_id;
	_data_->field_id = _tmp7_;
	_edsf_persona_store_set_contact_attributes_string_co (_data_);
}


static void _edsf_persona_store_set_contact_attributes_string_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactAttributesStringData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void __lambda2_ (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 ___lambda2__edsf_persona_store_field_to_attribute (EVCardAttribute* attr, gconstpointer value, gpointer self) {
	__lambda2_ (self, attr, value);
}


static gboolean _edsf_persona_store_set_contact_attributes_string_co (EdsfPersonaStoreSetContactAttributesStringData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->contact;
	_data_->_tmp1_ = _data_->new_attributes;
	_data_->_tmp2_ = _data_->attrib_name;
	_data_->_tmp3_ = _data_->field_id;
	_edsf_persona_store_set_contact_attributes (_data_->self, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _data_->_tmp0_, _data_->_tmp1_, ___lambda2__edsf_persona_store_field_to_attribute, _data_->self, _data_->_tmp2_, _data_->_tmp3_, NULL, 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_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = full_name;
	_tmp4_ = g_strdup (_tmp3_);
	_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_ = NULL;
		_data_->_tmp1_ = _ ("Full name is not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->full_name;
	_data_->_tmp4_ = g_strdup (_data_->_tmp3_);
	_data_->_full_name = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->full_name;
	if (g_strcmp0 (_data_->_tmp5_, "") == 0) {
		_g_free0 (_data_->_full_name);
		_data_->_full_name = NULL;
	}
	_data_->_tmp6_ = _data_->persona;
	_data_->_tmp7_ = folks_name_details_get_full_name ((FolksNameDetails*) _data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->_full_name;
	if (g_strcmp0 (_data_->_tmp8_, _data_->_tmp9_) == 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_->_tmp10_ = _data_->persona;
	_data_->_tmp11_ = edsf_persona_get_contact (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = 0;
	_data_->_tmp13_ = e_contact_field_id ("full_name");
	_data_->_tmp14_ = _data_->_full_name;
	e_contact_set (_data_->_tmp12_, _data_->_tmp13_, _data_->_tmp14_);
	_data_->_tmp15_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp15_, "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 (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = nickname;
	_tmp4_ = g_strdup (_tmp3_);
	_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_ = NULL;
		_data_->_tmp1_ = _ ("Nickname is not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->nickname;
	_data_->_tmp4_ = g_strdup (_data_->_tmp3_);
	_data_->_nickname = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->nickname;
	if (g_strcmp0 (_data_->_tmp5_, "") == 0) {
		_g_free0 (_data_->_nickname);
		_data_->_nickname = NULL;
	}
	_data_->_tmp6_ = _data_->persona;
	_data_->_tmp7_ = folks_name_details_get_nickname ((FolksNameDetails*) _data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->_nickname;
	if (g_strcmp0 (_data_->_tmp8_, _data_->_tmp9_) == 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_->_tmp10_ = _data_->persona;
	_data_->_tmp11_ = edsf_persona_get_contact (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = 0;
	_data_->_tmp13_ = e_contact_field_id ("nickname");
	_data_->_tmp14_ = _data_->_nickname;
	e_contact_set (_data_->_tmp12_, _data_->_tmp13_, _data_->_tmp14_);
	_data_->_tmp15_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp15_, "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 (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = notes;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "notes")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Notes are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_contact (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->notes;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_notes (_data_->self, _data_->_tmp5_, _data_->_tmp6_, _edsf_persona_store_set_notes_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_notes_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp7_, "notes", _edsf_persona_store_set_notes_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactNotesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->notes);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactNotesData, _data_);
}


static void _edsf_persona_store_set_contact_notes (EdsfPersonaStore* self, EContact* contact, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactNotesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactNotesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_notes);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_notes_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = notes;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->notes = _tmp4_;
	_edsf_persona_store_set_contact_notes_co (_data_);
}


static void _edsf_persona_store_set_contact_notes_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactNotesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _edsf_persona_store_set_contact_notes_co (EdsfPersonaStoreSetContactNotesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup ("");
	_data_->note_str = _data_->_tmp0_;
	{
		_data_->_tmp1_ = _data_->notes;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp1_);
		_data_->_note_it = _data_->_tmp2_;
		while (TRUE) {
			_data_->_tmp3_ = _data_->_note_it;
			_data_->_tmp4_ = FALSE;
			_data_->_tmp4_ = gee_iterator_next (_data_->_tmp3_);
			if (!_data_->_tmp4_) {
				break;
			}
			_data_->_tmp5_ = _data_->_note_it;
			_data_->_tmp6_ = NULL;
			_data_->_tmp6_ = gee_iterator_get (_data_->_tmp5_);
			_data_->note = (FolksNoteFieldDetails*) _data_->_tmp6_;
			_data_->_tmp7_ = _data_->note_str;
			if (g_strcmp0 (_data_->_tmp7_, "") != 0) {
				_data_->_tmp8_ = _data_->note_str;
				_data_->_tmp9_ = g_strconcat (_data_->_tmp8_, ". ", NULL);
				_g_free0 (_data_->note_str);
				_data_->note_str = _data_->_tmp9_;
			}
			_data_->_tmp10_ = _data_->note_str;
			_data_->_tmp11_ = _data_->note;
			_data_->_tmp12_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp11_);
			_data_->_tmp13_ = _data_->_tmp12_;
			_data_->_tmp14_ = g_strconcat (_data_->_tmp10_, (const gchar*) _data_->_tmp13_, NULL);
			_g_free0 (_data_->note_str);
			_data_->note_str = _data_->_tmp14_;
			_g_object_unref0 (_data_->note);
		}
		_g_object_unref0 (_data_->_note_it);
	}
	_data_->_tmp15_ = _data_->contact;
	_data_->_tmp16_ = 0;
	_data_->_tmp16_ = e_contact_field_id ("note");
	_data_->_tmp17_ = _data_->note_str;
	e_contact_set (_data_->_tmp15_, _data_->_tmp16_, _data_->_tmp17_);
	_g_free0 (_data_->note_str);
	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_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = bday;
	_tmp4_ = _g_date_time_ref0 (_tmp3_);
	_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;
		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, "birthday")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Birthday is not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp5_ = _data_->persona;
	_data_->_tmp6_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	if (_data_->_tmp7_ != NULL) {
		_data_->_tmp8_ = _data_->bday;
		_data_->_tmp4_ = _data_->_tmp8_ != NULL;
	} else {
		_data_->_tmp4_ = FALSE;
	}
	_data_->_tmp9_ = _data_->_tmp4_;
	if (_data_->_tmp9_) {
		_data_->_tmp10_ = _data_->persona;
		_data_->_tmp11_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = _data_->bday;
		_data_->_tmp14_ = FALSE;
		_data_->_tmp14_ = g_date_time_equal ((GDateTime*) _data_->_tmp12_, (GDateTime*) _data_->_tmp13_);
		_data_->_tmp3_ = _data_->_tmp14_;
	} else {
		_data_->_tmp3_ = FALSE;
	}
	_data_->_tmp15_ = _data_->_tmp3_;
	if (_data_->_tmp15_) {
		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_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	if (_data_->_tmp19_ == NULL) {
		_data_->_tmp20_ = _data_->bday;
		_data_->_tmp16_ = _data_->_tmp20_ == NULL;
	} else {
		_data_->_tmp16_ = FALSE;
	}
	_data_->_tmp21_ = _data_->_tmp16_;
	if (_data_->_tmp21_) {
		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_->_tmp22_ = _data_->persona;
	_data_->_tmp23_ = edsf_persona_get_contact (_data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = _data_->bday;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_birthday (_data_->self, _data_->_tmp24_, _data_->_tmp25_, _edsf_persona_store_set_birthday_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_birthday_finish (_data_->self, _data_->_res_);
	_data_->_tmp26_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp26_, "birthday", _edsf_persona_store_set_birthday_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_birthday_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactBirthdayData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_date_time_unref0 (_data_->_bday);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactBirthdayData, _data_);
}


static void _edsf_persona_store_set_contact_birthday (EdsfPersonaStore* self, EContact* contact, GDateTime* _bday, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactBirthdayData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactBirthdayData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_birthday);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_birthday_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = _bday;
	_tmp4_ = _g_date_time_ref0 (_tmp3_);
	_data_->_bday = _tmp4_;
	_edsf_persona_store_set_contact_birthday_co (_data_);
}


static void _edsf_persona_store_set_contact_birthday_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactBirthdayData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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 gboolean _edsf_persona_store_set_contact_birthday_co (EdsfPersonaStoreSetContactBirthdayData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_contact_bday = NULL;
	_data_->_tmp0_ = _data_->_bday;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->_bday;
		_data_->_tmp2_ = _g_date_time_ref0 ((GDateTime*) _data_->_tmp1_);
		_data_->bday = _data_->_tmp2_;
		_data_->_tmp3_ = e_contact_date_new ();
		__vala_EContactDate_free0 (_data_->contact_bday);
		_data_->contact_bday = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->contact_bday;
		_data_->_tmp5_ = _data_->bday;
		_data_->_tmp6_ = 0;
		_data_->_tmp6_ = g_date_time_get_year (_data_->_tmp5_);
		_data_->_tmp4_->year = (guint) _data_->_tmp6_;
		_data_->_tmp7_ = _data_->contact_bday;
		_data_->_tmp8_ = _data_->bday;
		_data_->_tmp9_ = 0;
		_data_->_tmp9_ = g_date_time_get_month (_data_->_tmp8_);
		_data_->_tmp7_->month = (guint) _data_->_tmp9_;
		_data_->_tmp10_ = _data_->contact_bday;
		_data_->_tmp11_ = _data_->bday;
		_data_->_tmp12_ = 0;
		_data_->_tmp12_ = g_date_time_get_day_of_month (_data_->_tmp11_);
		_data_->_tmp10_->day = (guint) _data_->_tmp12_;
		_data_->_tmp13_ = _data_->contact_bday;
		_data_->_tmp14_ = __vala_EContactDate_copy0 (_data_->_tmp13_);
		__vala_EContactDate_free0 (_data_->_contact_bday);
		_data_->_contact_bday = _data_->_tmp14_;
		__vala_EContactDate_free0 (_data_->contact_bday);
		_g_date_time_unref0 (_data_->bday);
	}
	_data_->_tmp15_ = _data_->contact;
	_data_->_tmp16_ = 0;
	_data_->_tmp16_ = e_contact_field_id ("birth_date");
	_data_->_tmp17_ = _data_->_contact_bday;
	e_contact_set (_data_->_tmp15_, _data_->_tmp16_, _data_->_tmp17_);
	__vala_EContactDate_free0 (_data_->_contact_bday);
	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_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = roles;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "roles")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Roles are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->roles;
	_data_->_tmp4_ = _data_->persona;
	_data_->_tmp5_ = folks_role_details_get_roles ((FolksRoleDetails*) _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = FALSE;
	_data_->_tmp7_ = folks_internal_equal_sets (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, _data_->_tmp3_, _data_->_tmp6_);
	if (_data_->_tmp7_) {
		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_->_tmp8_ = _data_->persona;
	_data_->_tmp9_ = edsf_persona_get_contact (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->roles;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_roles (_data_->self, _data_->_tmp10_, _data_->_tmp11_, _edsf_persona_store_set_roles_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_roles_finish (_data_->self, _data_->_res_);
	_data_->_tmp12_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp12_, "roles", _edsf_persona_store_set_roles_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactRolesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->roles);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactRolesData, _data_);
}


static void _edsf_persona_store_set_contact_roles (EdsfPersonaStore* self, EContact* contact, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactRolesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactRolesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_roles);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_roles_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = roles;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->roles = _tmp4_;
	_edsf_persona_store_set_contact_roles_co (_data_);
}


static void _edsf_persona_store_set_contact_roles_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactRolesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _edsf_persona_store_set_contact_roles_co (EdsfPersonaStoreSetContactRolesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->contact;
	_data_->_tmp1_ = _g_object_ref0 (E_VCARD (_data_->_tmp0_));
	_data_->vcard = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->vcard;
	e_vcard_remove_attributes (_data_->_tmp2_, NULL, "X-ROLES");
	_data_->org = NULL;
	_data_->org_unit = NULL;
	_data_->office = NULL;
	_data_->title = NULL;
	_data_->role = NULL;
	_data_->manager = NULL;
	_data_->assistant = NULL;
	_data_->count = 0;
	{
		_data_->_tmp3_ = _data_->roles;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp3_);
		_data_->_role_fd_it = _data_->_tmp4_;
		while (TRUE) {
			_data_->_tmp5_ = _data_->_role_fd_it;
			_data_->_tmp6_ = FALSE;
			_data_->_tmp6_ = gee_iterator_next (_data_->_tmp5_);
			if (!_data_->_tmp6_) {
				break;
			}
			_data_->_tmp7_ = _data_->_role_fd_it;
			_data_->_tmp8_ = NULL;
			_data_->_tmp8_ = gee_iterator_get (_data_->_tmp7_);
			_data_->role_fd = (FolksRoleFieldDetails*) _data_->_tmp8_;
			_data_->_tmp9_ = _data_->count;
			if (_data_->_tmp9_ == 0) {
				_data_->_tmp10_ = _data_->role_fd;
				_data_->_tmp11_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp10_);
				_data_->_tmp12_ = _data_->_tmp11_;
				_data_->_tmp13_ = folks_role_get_organisation_name ((FolksRole*) _data_->_tmp12_);
				_data_->_tmp14_ = _data_->_tmp13_;
				_data_->_tmp15_ = g_strdup (_data_->_tmp14_);
				_g_free0 (_data_->org);
				_data_->org = _data_->_tmp15_;
				_data_->_tmp16_ = _data_->role_fd;
				_data_->_tmp17_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp16_);
				_data_->_tmp18_ = _data_->_tmp17_;
				_data_->_tmp19_ = folks_role_get_title ((FolksRole*) _data_->_tmp18_);
				_data_->_tmp20_ = _data_->_tmp19_;
				_data_->_tmp21_ = g_strdup (_data_->_tmp20_);
				_g_free0 (_data_->title);
				_data_->title = _data_->_tmp21_;
				_data_->_tmp22_ = _data_->role_fd;
				_data_->_tmp23_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp22_);
				_data_->_tmp24_ = _data_->_tmp23_;
				_data_->_tmp25_ = folks_role_get_role ((FolksRole*) _data_->_tmp24_);
				_data_->_tmp26_ = _data_->_tmp25_;
				_data_->_tmp27_ = g_strdup (_data_->_tmp26_);
				_g_free0 (_data_->role);
				_data_->role = _data_->_tmp27_;
				_data_->_tmp28_ = _data_->role_fd;
				_data_->_tmp29_ = NULL;
				_data_->_tmp29_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _data_->_tmp28_, "org_unit");
				_data_->org_unit_values = _data_->_tmp29_;
				_data_->_tmp31_ = _data_->org_unit_values;
				if (_data_->_tmp31_ != NULL) {
					_data_->_tmp32_ = _data_->org_unit_values;
					_data_->_tmp33_ = gee_collection_get_size (GEE_COLLECTION (_data_->_tmp32_));
					_data_->_tmp34_ = _data_->_tmp33_;
					_data_->_tmp30_ = _data_->_tmp34_ > 0;
				} else {
					_data_->_tmp30_ = FALSE;
				}
				_data_->_tmp35_ = _data_->_tmp30_;
				if (_data_->_tmp35_) {
					_data_->_tmp36_ = _data_->org_unit_values;
					_data_->_tmp37_ = 0;
					_data_->_tmp38_ = NULL;
					_data_->_tmp38_ = gee_collection_to_array (GEE_COLLECTION (_data_->_tmp36_), &_data_->_tmp37_);
					_data_->_tmp39_ = _data_->_tmp38_;
					_data_->_tmp39__length1 = _data_->_tmp37_;
					_data_->_tmp40_ = _data_->_tmp39_[0];
					_data_->_tmp41_ = g_strdup (_data_->_tmp40_);
					_g_free0 (_data_->org_unit);
					_data_->org_unit = _data_->_tmp41_;
					_data_->_tmp39_ = (_vala_array_free (_data_->_tmp39_, _data_->_tmp39__length1, (GDestroyNotify) g_free), NULL);
				}
				_data_->_tmp42_ = _data_->role_fd;
				_data_->_tmp43_ = NULL;
				_data_->_tmp43_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _data_->_tmp42_, "office");
				_data_->office_values = _data_->_tmp43_;
				_data_->_tmp45_ = _data_->office_values;
				if (_data_->_tmp45_ != NULL) {
					_data_->_tmp46_ = _data_->office_values;
					_data_->_tmp47_ = gee_collection_get_size (GEE_COLLECTION (_data_->_tmp46_));
					_data_->_tmp48_ = _data_->_tmp47_;
					_data_->_tmp44_ = _data_->_tmp48_ > 0;
				} else {
					_data_->_tmp44_ = FALSE;
				}
				_data_->_tmp49_ = _data_->_tmp44_;
				if (_data_->_tmp49_) {
					_data_->_tmp50_ = _data_->office_values;
					_data_->_tmp51_ = 0;
					_data_->_tmp52_ = NULL;
					_data_->_tmp52_ = gee_collection_to_array (GEE_COLLECTION (_data_->_tmp50_), &_data_->_tmp51_);
					_data_->_tmp53_ = _data_->_tmp52_;
					_data_->_tmp53__length1 = _data_->_tmp51_;
					_data_->_tmp54_ = _data_->_tmp53_[0];
					_data_->_tmp55_ = g_strdup (_data_->_tmp54_);
					_g_free0 (_data_->office);
					_data_->office = _data_->_tmp55_;
					_data_->_tmp53_ = (_vala_array_free (_data_->_tmp53_, _data_->_tmp53__length1, (GDestroyNotify) g_free), NULL);
				}
				_data_->_tmp56_ = _data_->role_fd;
				_data_->_tmp57_ = NULL;
				_data_->_tmp57_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _data_->_tmp56_, "manager");
				_data_->manager_values = _data_->_tmp57_;
				_data_->_tmp59_ = _data_->manager_values;
				if (_data_->_tmp59_ != NULL) {
					_data_->_tmp60_ = _data_->manager_values;
					_data_->_tmp61_ = gee_collection_get_size (GEE_COLLECTION (_data_->_tmp60_));
					_data_->_tmp62_ = _data_->_tmp61_;
					_data_->_tmp58_ = _data_->_tmp62_ > 0;
				} else {
					_data_->_tmp58_ = FALSE;
				}
				_data_->_tmp63_ = _data_->_tmp58_;
				if (_data_->_tmp63_) {
					_data_->_tmp64_ = _data_->manager_values;
					_data_->_tmp65_ = 0;
					_data_->_tmp66_ = NULL;
					_data_->_tmp66_ = gee_collection_to_array (GEE_COLLECTION (_data_->_tmp64_), &_data_->_tmp65_);
					_data_->_tmp67_ = _data_->_tmp66_;
					_data_->_tmp67__length1 = _data_->_tmp65_;
					_data_->_tmp68_ = _data_->_tmp67_[0];
					_data_->_tmp69_ = g_strdup (_data_->_tmp68_);
					_g_free0 (_data_->manager);
					_data_->manager = _data_->_tmp69_;
					_data_->_tmp67_ = (_vala_array_free (_data_->_tmp67_, _data_->_tmp67__length1, (GDestroyNotify) g_free), NULL);
				}
				_data_->_tmp70_ = _data_->role_fd;
				_data_->_tmp71_ = NULL;
				_data_->_tmp71_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _data_->_tmp70_, "assistant");
				_data_->assistant_values = _data_->_tmp71_;
				_data_->_tmp73_ = _data_->assistant_values;
				if (_data_->_tmp73_ != NULL) {
					_data_->_tmp74_ = _data_->assistant_values;
					_data_->_tmp75_ = gee_collection_get_size (GEE_COLLECTION (_data_->_tmp74_));
					_data_->_tmp76_ = _data_->_tmp75_;
					_data_->_tmp72_ = _data_->_tmp76_ > 0;
				} else {
					_data_->_tmp72_ = FALSE;
				}
				_data_->_tmp77_ = _data_->_tmp72_;
				if (_data_->_tmp77_) {
					_data_->_tmp78_ = _data_->assistant_values;
					_data_->_tmp79_ = 0;
					_data_->_tmp80_ = NULL;
					_data_->_tmp80_ = gee_collection_to_array (GEE_COLLECTION (_data_->_tmp78_), &_data_->_tmp79_);
					_data_->_tmp81_ = _data_->_tmp80_;
					_data_->_tmp81__length1 = _data_->_tmp79_;
					_data_->_tmp82_ = _data_->_tmp81_[0];
					_data_->_tmp83_ = g_strdup (_data_->_tmp82_);
					_g_free0 (_data_->assistant);
					_data_->assistant = _data_->_tmp83_;
					_data_->_tmp81_ = (_vala_array_free (_data_->_tmp81_, _data_->_tmp81__length1, (GDestroyNotify) g_free), NULL);
				}
				_g_object_unref0 (_data_->assistant_values);
				_g_object_unref0 (_data_->manager_values);
				_g_object_unref0 (_data_->office_values);
				_g_object_unref0 (_data_->org_unit_values);
			} else {
				_data_->_tmp84_ = e_vcard_attribute_new (NULL, "X-ROLES");
				_data_->attr = _data_->_tmp84_;
				_data_->_tmp85_ = _data_->attr;
				_data_->_tmp86_ = _data_->role_fd;
				_data_->_tmp87_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp86_);
				_data_->_tmp88_ = _data_->_tmp87_;
				_data_->_tmp89_ = folks_role_get_role ((FolksRole*) _data_->_tmp88_);
				_data_->_tmp90_ = _data_->_tmp89_;
				e_vcard_attribute_add_value (_data_->_tmp85_, _data_->_tmp90_);
				_data_->_tmp91_ = e_vcard_attribute_param_new ("organisation_name");
				_data_->param1 = _data_->_tmp91_;
				_data_->_tmp92_ = _data_->param1;
				_data_->_tmp93_ = _data_->role_fd;
				_data_->_tmp94_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp93_);
				_data_->_tmp95_ = _data_->_tmp94_;
				_data_->_tmp96_ = folks_role_get_organisation_name ((FolksRole*) _data_->_tmp95_);
				_data_->_tmp97_ = _data_->_tmp96_;
				e_vcard_attribute_param_add_value (_data_->_tmp92_, _data_->_tmp97_);
				_data_->_tmp98_ = _data_->attr;
				_data_->_tmp99_ = _data_->param1;
				_data_->_tmp100_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp99_);
				e_vcard_attribute_add_param (_data_->_tmp98_, _data_->_tmp100_);
				_data_->_tmp101_ = e_vcard_attribute_param_new ("title");
				_data_->param2 = _data_->_tmp101_;
				_data_->_tmp102_ = _data_->param2;
				_data_->_tmp103_ = _data_->role_fd;
				_data_->_tmp104_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp103_);
				_data_->_tmp105_ = _data_->_tmp104_;
				_data_->_tmp106_ = folks_role_get_title ((FolksRole*) _data_->_tmp105_);
				_data_->_tmp107_ = _data_->_tmp106_;
				e_vcard_attribute_param_add_value (_data_->_tmp102_, _data_->_tmp107_);
				_data_->_tmp108_ = _data_->attr;
				_data_->_tmp109_ = _data_->param2;
				_data_->_tmp110_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp109_);
				e_vcard_attribute_add_param (_data_->_tmp108_, _data_->_tmp110_);
				{
					_data_->_tmp111_ = _data_->role_fd;
					_data_->_tmp112_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _data_->_tmp111_);
					_data_->_tmp113_ = _data_->_tmp112_;
					_data_->_tmp114_ = NULL;
					_data_->_tmp114_ = gee_multi_map_get_keys (_data_->_tmp113_);
					_data_->_tmp115_ = _data_->_tmp114_;
					_data_->_tmp116_ = NULL;
					_data_->_tmp116_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp115_);
					_data_->_tmp117_ = _data_->_tmp116_;
					_g_object_unref0 (_data_->_tmp115_);
					_data_->_param_name_it = _data_->_tmp117_;
					while (TRUE) {
						_data_->_tmp118_ = _data_->_param_name_it;
						_data_->_tmp119_ = FALSE;
						_data_->_tmp119_ = gee_iterator_next (_data_->_tmp118_);
						if (!_data_->_tmp119_) {
							break;
						}
						_data_->_tmp120_ = _data_->_param_name_it;
						_data_->_tmp121_ = NULL;
						_data_->_tmp121_ = gee_iterator_get (_data_->_tmp120_);
						_data_->param_name = (gchar*) _data_->_tmp121_;
						_data_->_tmp122_ = _data_->param_name;
						_data_->_tmp123_ = NULL;
						_data_->_tmp123_ = g_utf8_strup (_data_->_tmp122_, (gssize) (-1));
						_data_->_tmp124_ = _data_->_tmp123_;
						_data_->_tmp125_ = e_vcard_attribute_param_new (_data_->_tmp124_);
						_data_->_tmp126_ = _data_->_tmp125_;
						_g_free0 (_data_->_tmp124_);
						_data_->param3 = _data_->_tmp126_;
						{
							_data_->_tmp127_ = _data_->role_fd;
							_data_->_tmp128_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _data_->_tmp127_);
							_data_->_tmp129_ = _data_->_tmp128_;
							_data_->_tmp130_ = _data_->param_name;
							_data_->_tmp131_ = NULL;
							_data_->_tmp131_ = gee_multi_map_get (_data_->_tmp129_, _data_->_tmp130_);
							_data_->_tmp132_ = _data_->_tmp131_;
							_data_->_tmp133_ = NULL;
							_data_->_tmp133_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp132_);
							_data_->_tmp134_ = _data_->_tmp133_;
							_g_object_unref0 (_data_->_tmp132_);
							_data_->_param_val_it = _data_->_tmp134_;
							while (TRUE) {
								_data_->_tmp135_ = _data_->_param_val_it;
								_data_->_tmp136_ = FALSE;
								_data_->_tmp136_ = gee_iterator_next (_data_->_tmp135_);
								if (!_data_->_tmp136_) {
									break;
								}
								_data_->_tmp137_ = _data_->_param_val_it;
								_data_->_tmp138_ = NULL;
								_data_->_tmp138_ = gee_iterator_get (_data_->_tmp137_);
								_data_->param_val = (gchar*) _data_->_tmp138_;
								_data_->_tmp139_ = _data_->param3;
								_data_->_tmp140_ = _data_->param_val;
								e_vcard_attribute_param_add_value (_data_->_tmp139_, _data_->_tmp140_);
								_g_free0 (_data_->param_val);
							}
							_g_object_unref0 (_data_->_param_val_it);
						}
						_data_->_tmp141_ = _data_->attr;
						_data_->_tmp142_ = _data_->param3;
						_data_->_tmp143_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp142_);
						e_vcard_attribute_add_param (_data_->_tmp141_, _data_->_tmp143_);
						__vala_EVCardAttributeParam_free0 (_data_->param3);
						_g_free0 (_data_->param_name);
					}
					_g_object_unref0 (_data_->_param_name_it);
				}
				_data_->_tmp144_ = _data_->contact;
				_data_->_tmp145_ = _data_->attr;
				_data_->attr = NULL;
				e_vcard_add_attribute ((EVCard*) _data_->_tmp144_, _data_->_tmp145_);
				__vala_EVCardAttributeParam_free0 (_data_->param2);
				__vala_EVCardAttributeParam_free0 (_data_->param1);
				__vala_EVCardAttribute_free0 (_data_->attr);
			}
			_data_->_tmp146_ = _data_->count;
			_data_->count = _data_->_tmp146_ + 1;
			_g_object_unref0 (_data_->role_fd);
		}
		_g_object_unref0 (_data_->_role_fd_it);
	}
	_data_->_tmp147_ = _data_->contact;
	_data_->_tmp148_ = 0;
	_data_->_tmp148_ = e_contact_field_id ("org");
	_data_->_tmp149_ = _data_->org;
	e_contact_set (_data_->_tmp147_, _data_->_tmp148_, _data_->_tmp149_);
	_data_->_tmp150_ = _data_->contact;
	_data_->_tmp151_ = 0;
	_data_->_tmp151_ = e_contact_field_id ("org_unit");
	_data_->_tmp152_ = _data_->org_unit;
	e_contact_set (_data_->_tmp150_, _data_->_tmp151_, _data_->_tmp152_);
	_data_->_tmp153_ = _data_->contact;
	_data_->_tmp154_ = 0;
	_data_->_tmp154_ = e_contact_field_id ("office");
	_data_->_tmp155_ = _data_->office;
	e_contact_set (_data_->_tmp153_, _data_->_tmp154_, _data_->_tmp155_);
	_data_->_tmp156_ = _data_->contact;
	_data_->_tmp157_ = 0;
	_data_->_tmp157_ = e_contact_field_id ("title");
	_data_->_tmp158_ = _data_->title;
	e_contact_set (_data_->_tmp156_, _data_->_tmp157_, _data_->_tmp158_);
	_data_->_tmp159_ = _data_->contact;
	_data_->_tmp160_ = 0;
	_data_->_tmp160_ = e_contact_field_id ("role");
	_data_->_tmp161_ = _data_->role;
	e_contact_set (_data_->_tmp159_, _data_->_tmp160_, _data_->_tmp161_);
	_data_->_tmp162_ = _data_->contact;
	_data_->_tmp163_ = 0;
	_data_->_tmp163_ = e_contact_field_id ("manager");
	_data_->_tmp164_ = _data_->manager;
	e_contact_set (_data_->_tmp162_, _data_->_tmp163_, _data_->_tmp164_);
	_data_->_tmp165_ = _data_->contact;
	_data_->_tmp166_ = 0;
	_data_->_tmp166_ = e_contact_field_id ("assistant");
	_data_->_tmp167_ = _data_->assistant;
	e_contact_set (_data_->_tmp165_, _data_->_tmp166_, _data_->_tmp167_);
	_g_free0 (_data_->assistant);
	_g_free0 (_data_->manager);
	_g_free0 (_data_->role);
	_g_free0 (_data_->title);
	_g_free0 (_data_->office);
	_g_free0 (_data_->org_unit);
	_g_free0 (_data_->org);
	_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_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = sname;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "structured-name")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Structured name is not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp5_ = _data_->persona;
	_data_->_tmp6_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	if (_data_->_tmp7_ != NULL) {
		_data_->_tmp8_ = _data_->sname;
		_data_->_tmp4_ = _data_->_tmp8_ != NULL;
	} else {
		_data_->_tmp4_ = FALSE;
	}
	_data_->_tmp9_ = _data_->_tmp4_;
	if (_data_->_tmp9_) {
		_data_->_tmp10_ = _data_->persona;
		_data_->_tmp11_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = _data_->sname;
		_data_->_tmp14_ = FALSE;
		_data_->_tmp14_ = folks_structured_name_equal (FOLKS_STRUCTURED_NAME (_data_->_tmp12_), FOLKS_STRUCTURED_NAME (_data_->_tmp13_));
		_data_->_tmp3_ = _data_->_tmp14_;
	} else {
		_data_->_tmp3_ = FALSE;
	}
	_data_->_tmp15_ = _data_->_tmp3_;
	if (_data_->_tmp15_) {
		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_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	if (_data_->_tmp19_ == NULL) {
		_data_->_tmp20_ = _data_->sname;
		_data_->_tmp16_ = _data_->_tmp20_ == NULL;
	} else {
		_data_->_tmp16_ = FALSE;
	}
	_data_->_tmp21_ = _data_->_tmp16_;
	if (_data_->_tmp21_) {
		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_->_tmp22_ = _data_->persona;
	_data_->_tmp23_ = edsf_persona_get_contact (_data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = _data_->sname;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_name (_data_->self, _data_->_tmp24_, _data_->_tmp25_, _edsf_persona_store_set_structured_name_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_name_finish (_data_->self, _data_->_res_);
	_data_->_tmp26_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp26_, "structured-name", _edsf_persona_store_set_structured_name_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_name_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactNameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->_sname);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactNameData, _data_);
}


static void _edsf_persona_store_set_contact_name (EdsfPersonaStore* self, EContact* contact, FolksStructuredName* _sname, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactNameData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	FolksStructuredName* _tmp3_;
	FolksStructuredName* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactNameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_name);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = _sname;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->_sname = _tmp4_;
	_edsf_persona_store_set_contact_name_co (_data_);
}


static void _edsf_persona_store_set_contact_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactNameData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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


static gboolean _edsf_persona_store_set_contact_name_co (EdsfPersonaStoreSetContactNameData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = e_contact_name_new ();
	_data_->contact_name = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->_sname;
	if (_data_->_tmp1_ != NULL) {
		_data_->_tmp2_ = _data_->_sname;
		_data_->_tmp3_ = _g_object_ref0 (FOLKS_STRUCTURED_NAME (_data_->_tmp2_));
		_data_->sname = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->contact_name;
		_data_->_tmp5_ = _data_->sname;
		_data_->_tmp6_ = folks_structured_name_get_family_name (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = g_strdup (_data_->_tmp7_);
		_g_free0 (_data_->_tmp4_->family);
		_data_->_tmp4_->family = _data_->_tmp8_;
		_data_->_tmp9_ = _data_->contact_name;
		_data_->_tmp10_ = _data_->sname;
		_data_->_tmp11_ = folks_structured_name_get_given_name (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = g_strdup (_data_->_tmp12_);
		_g_free0 (_data_->_tmp9_->given);
		_data_->_tmp9_->given = _data_->_tmp13_;
		_data_->_tmp14_ = _data_->contact_name;
		_data_->_tmp15_ = _data_->sname;
		_data_->_tmp16_ = folks_structured_name_get_additional_names (_data_->_tmp15_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
		_g_free0 (_data_->_tmp14_->additional);
		_data_->_tmp14_->additional = _data_->_tmp18_;
		_data_->_tmp19_ = _data_->contact_name;
		_data_->_tmp20_ = _data_->sname;
		_data_->_tmp21_ = folks_structured_name_get_suffixes (_data_->_tmp20_);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp23_ = g_strdup (_data_->_tmp22_);
		_g_free0 (_data_->_tmp19_->suffixes);
		_data_->_tmp19_->suffixes = _data_->_tmp23_;
		_data_->_tmp24_ = _data_->contact_name;
		_data_->_tmp25_ = _data_->sname;
		_data_->_tmp26_ = folks_structured_name_get_prefixes (_data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp28_ = g_strdup (_data_->_tmp27_);
		_g_free0 (_data_->_tmp24_->prefixes);
		_data_->_tmp24_->prefixes = _data_->_tmp28_;
		_g_object_unref0 (_data_->sname);
	}
	_data_->_tmp29_ = _data_->contact;
	_data_->_tmp30_ = 0;
	_data_->_tmp30_ = e_contact_field_id ("name");
	_data_->_tmp31_ = _data_->contact_name;
	e_contact_set (_data_->_tmp29_, _data_->_tmp30_, _data_->_tmp31_);
	__vala_EContactName_free0 (_data_->contact_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_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = im_fds;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		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, "im-addresses")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("IM addresses are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = folks_im_details_get_im_addresses ((FolksImDetails*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->im_fds;
	_data_->_tmp7_ = FALSE;
	_data_->_tmp7_ = folks_utils_multi_map_str_afd_equal (_data_->_tmp5_, _data_->_tmp6_);
	if (_data_->_tmp7_) {
		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_->_tmp8_ = _data_->persona;
	_data_->_tmp9_ = edsf_persona_get_contact (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->im_fds;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_im_fds (_data_->self, _data_->_tmp10_, _data_->_tmp11_, _edsf_persona_store_set_im_fds_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_im_fds_finish (_data_->self, _data_->_res_);
	_data_->_tmp12_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp12_, "im-addresses", _edsf_persona_store_set_im_fds_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactImFdsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->im_fds);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactImFdsData, _data_);
}


static void _edsf_persona_store_set_contact_im_fds (EdsfPersonaStore* self, EContact* contact, GeeMultiMap* im_fds, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactImFdsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeMultiMap* _tmp3_;
	GeeMultiMap* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactImFdsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_im_fds);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_im_fds_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = im_fds;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->im_fds = _tmp4_;
	_edsf_persona_store_set_contact_im_fds_co (_data_);
}


static void _edsf_persona_store_set_contact_im_fds_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactImFdsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _edsf_persona_store_set_contact_im_fds_co (EdsfPersonaStoreSetContactImFdsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _edsf_persona_get_im_eds_map ();
	_data_->im_eds_map = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->im_eds_map;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = g_hash_table_get_values (_data_->_tmp1_);
	{
		_data_->field_id_collection = _data_->_tmp2_;
		for (_data_->field_id_it = _data_->field_id_collection; _data_->field_id_it != NULL; _data_->field_id_it = _data_->field_id_it->next) {
			_data_->field_id = GPOINTER_TO_INT (_data_->field_id_it->data);
			{
				_data_->_tmp3_ = _data_->contact;
				_data_->_tmp4_ = _data_->field_id;
				_data_->_tmp5_ = NULL;
				_data_->_tmp5_ = e_contact_vcard_attribute (_data_->_tmp4_);
				e_vcard_remove_attributes ((EVCard*) _data_->_tmp3_, NULL, _data_->_tmp5_);
			}
		}
		_g_list_free0 (_data_->field_id_collection);
	}
	{
		_data_->_tmp6_ = _data_->im_fds;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = gee_multi_map_get_keys (_data_->_tmp6_);
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_g_object_unref0 (_data_->_tmp8_);
		_data_->_proto_it = _data_->_tmp10_;
		while (TRUE) {
			_data_->_tmp11_ = _data_->_proto_it;
			_data_->_tmp12_ = FALSE;
			_data_->_tmp12_ = gee_iterator_next (_data_->_tmp11_);
			if (!_data_->_tmp12_) {
				break;
			}
			_data_->_tmp13_ = _data_->_proto_it;
			_data_->_tmp14_ = NULL;
			_data_->_tmp14_ = gee_iterator_get (_data_->_tmp13_);
			_data_->proto = (gchar*) _data_->_tmp14_;
			_data_->attributes = NULL;
			_data_->_tmp15_ = _data_->proto;
			_data_->_tmp16_ = g_strconcat ("X-", _data_->_tmp15_, NULL);
			_data_->_tmp17_ = _data_->_tmp16_;
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = g_utf8_strup (_data_->_tmp17_, (gssize) (-1));
			_data_->_tmp19_ = _data_->_tmp18_;
			_g_free0 (_data_->_tmp17_);
			_data_->attrib_name = _data_->_tmp19_;
			_data_->added = FALSE;
			{
				_data_->_tmp20_ = _data_->im_fds;
				_data_->_tmp21_ = _data_->proto;
				_data_->_tmp22_ = NULL;
				_data_->_tmp22_ = gee_multi_map_get (_data_->_tmp20_, _data_->_tmp21_);
				_data_->_tmp23_ = _data_->_tmp22_;
				_data_->_tmp24_ = NULL;
				_data_->_tmp24_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp23_);
				_data_->_tmp25_ = _data_->_tmp24_;
				_g_object_unref0 (_data_->_tmp23_);
				_data_->_im_fd_it = _data_->_tmp25_;
				while (TRUE) {
					_data_->_tmp26_ = _data_->_im_fd_it;
					_data_->_tmp27_ = FALSE;
					_data_->_tmp27_ = gee_iterator_next (_data_->_tmp26_);
					if (!_data_->_tmp27_) {
						break;
					}
					_data_->_tmp28_ = _data_->_im_fd_it;
					_data_->_tmp29_ = NULL;
					_data_->_tmp29_ = gee_iterator_get (_data_->_tmp28_);
					_data_->im_fd = (FolksImFieldDetails*) _data_->_tmp29_;
					_data_->_tmp30_ = _data_->attrib_name;
					_data_->_tmp31_ = e_vcard_attribute_new (NULL, _data_->_tmp30_);
					_data_->attr_n = _data_->_tmp31_;
					_data_->_tmp32_ = _data_->attr_n;
					_data_->_tmp33_ = _data_->im_fd;
					_data_->_tmp34_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp33_);
					_data_->_tmp35_ = _data_->_tmp34_;
					e_vcard_attribute_add_value (_data_->_tmp32_, (const gchar*) _data_->_tmp35_);
					_data_->_tmp36_ = _data_->attr_n;
					_data_->attr_n = NULL;
					_data_->attributes = g_list_prepend (_data_->attributes, _data_->_tmp36_);
					_data_->added = TRUE;
					__vala_EVCardAttribute_free0 (_data_->attr_n);
					_g_object_unref0 (_data_->im_fd);
				}
				_g_object_unref0 (_data_->_im_fd_it);
			}
			_data_->_tmp37_ = _data_->added;
			if (_data_->_tmp37_) {
				_data_->_tmp38_ = _data_->im_eds_map;
				_data_->_tmp39_ = _data_->proto;
				_data_->_tmp40_ = NULL;
				_data_->_tmp40_ = g_hash_table_lookup (_data_->_tmp38_, _data_->_tmp39_);
				_data_->field_id_t = GPOINTER_TO_INT (_data_->_tmp40_);
				_data_->_tmp41_ = _data_->contact;
				_data_->_tmp42_ = _data_->field_id_t;
				_data_->_tmp43_ = _data_->attributes;
				e_contact_set_attributes (_data_->_tmp41_, _data_->_tmp42_, _data_->_tmp43_);
			}
			_g_free0 (_data_->attrib_name);
			__g_list_free___vala_EVCardAttribute_free0_0 (_data_->attributes);
			_g_free0 (_data_->proto);
		}
		_g_object_unref0 (_data_->_proto_it);
	}
	_g_hash_table_unref0 (_data_->im_eds_map);
	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_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_);
	_data_->persona = _tmp2_;
	_tmp3_ = groups;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_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;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		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_ = NULL;
		_data_->_tmp1_ = _ ("Groups are not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_contact (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->groups;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_groups (_data_->self, _data_->_tmp5_, _data_->_tmp6_, _edsf_persona_store_set_groups_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_groups_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp7_, "groups", _edsf_persona_store_set_groups_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp8_ = FALSE;
	_data_->_tmp8_ = _edsf_persona_store_is_google_contacts_address_book (_data_->self);
	if (_data_->_tmp8_) {
		_data_->_tmp9_ = _data_->persona;
		_data_->_tmp10_ = _data_->groups;
		_data_->_tmp11_ = FALSE;
		_data_->_tmp11_ = gee_collection_contains ((GeeCollection*) _data_->_tmp10_, EDSF_PERSONA_STORE_android_favourite_group_name);
		_data_->_state_ = 3;
		folks_favourite_details_change_is_favourite ((FolksFavouriteDetails*) _data_->_tmp9_, _data_->_tmp11_, _edsf_persona_store_set_groups_ready, _data_);
		return FALSE;
		_state_3:
		folks_favourite_details_change_is_favourite_finish ((FolksFavouriteDetails*) _data_->_tmp9_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_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_groups_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactGroupsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->groups);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactGroupsData, _data_);
}


static void _edsf_persona_store_set_contact_groups (EdsfPersonaStore* self, EContact* contact, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactGroupsData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactGroupsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_groups);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_groups_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = groups;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->groups = _tmp4_;
	_edsf_persona_store_set_contact_groups_co (_data_);
}


static void _edsf_persona_store_set_contact_groups_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactGroupsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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 gboolean _edsf_persona_store_set_contact_groups_co (EdsfPersonaStoreSetContactGroupsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->categories = NULL;
	{
		_data_->_tmp0_ = _data_->groups;
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp0_);
		_data_->_group_it = _data_->_tmp1_;
		while (TRUE) {
			_data_->_tmp2_ = _data_->_group_it;
			_data_->_tmp3_ = FALSE;
			_data_->_tmp3_ = gee_iterator_next (_data_->_tmp2_);
			if (!_data_->_tmp3_) {
				break;
			}
			_data_->_tmp4_ = _data_->_group_it;
			_data_->_tmp5_ = NULL;
			_data_->_tmp5_ = gee_iterator_get (_data_->_tmp4_);
			_data_->group = (gchar*) _data_->_tmp5_;
			_data_->_tmp6_ = _data_->group;
			if (g_strcmp0 (_data_->_tmp6_, "") == 0) {
				_g_free0 (_data_->group);
				continue;
			}
			_data_->_tmp7_ = _data_->group;
			_data_->_tmp8_ = g_strdup (_data_->_tmp7_);
			_data_->categories = g_list_prepend (_data_->categories, _data_->_tmp8_);
			_g_free0 (_data_->group);
		}
		_g_object_unref0 (_data_->_group_it);
	}
	_data_->_tmp9_ = _data_->contact;
	_data_->_tmp10_ = _data_->categories;
	e_contact_set (_data_->_tmp9_, E_CONTACT_CATEGORY_LIST, _data_->_tmp10_);
	__g_list_free__g_free0_0 (_data_->categories);
	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_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_);
	_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;
		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, "gender")) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _ ("Gender is not writeable on this contact.");
		_data_->_tmp2_ = g_error_new_literal (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _data_->_tmp1_);
		_data_->_inner_error_ = _data_->_tmp2_;
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_->_tmp3_ = _data_->persona;
	_data_->_tmp4_ = edsf_persona_get_contact (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->gender;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_gender (_data_->self, _data_->_tmp5_, _data_->_tmp6_, _edsf_persona_store_set_gender_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_gender_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp7_, "gender", _edsf_persona_store_set_gender_ready, _data_);
	return FALSE;
	_state_2:
	_edsf_persona_store_commit_modified_property_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_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_data_free (gpointer _data) {
	EdsfPersonaStoreSetContactGenderData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaStoreSetContactGenderData, _data_);
}


static void _edsf_persona_store_set_contact_gender (EdsfPersonaStore* self, EContact* contact, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactGenderData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	FolksGender _tmp3_;
	_data_ = g_slice_new0 (EdsfPersonaStoreSetContactGenderData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _edsf_persona_store_set_contact_gender);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _edsf_persona_store_set_contact_gender_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = contact;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->contact = _tmp2_;
	_tmp3_ = gender;
	_data_->gender = _tmp3_;
	_edsf_persona_store_set_contact_gender_co (_data_);
}


static void _edsf_persona_store_set_contact_gender_finish (EdsfPersonaStore* self, GAsyncResult* _res_) {
	EdsfPersonaStoreSetContactGenderData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _edsf_persona_store_set_contact_gender_co (EdsfPersonaStoreSetContactGenderData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->contact;
	_edsf_persona_store_remove_attribute (_data_->self, _data_->_tmp0_, EDSF_PERSONA_gender_attribute_name);
	_data_->_tmp1_ = e_vcard_attribute_new (NULL, EDSF_PERSONA_gender_attribute_name);
	_data_->new_attr = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->gender;
	switch (_data_->_tmp2_) {
		case FOLKS_GENDER_UNSPECIFIED:
		{
			break;
		}
		case FOLKS_GENDER_MALE:
		{
			_data_->_tmp3_ = _data_->new_attr;
			e_vcard_attribute_add_value (_data_->_tmp3_, EDSF_PERSONA_gender_male);
			_data_->_tmp4_ = _data_->contact;
			_data_->_tmp5_ = _data_->new_attr;
			_data_->new_attr = NULL;
			e_vcard_add_attribute ((EVCard*) _data_->_tmp4_, _data_->_tmp5_);
			break;
		}
		case FOLKS_GENDER_FEMALE:
		{
			_data_->_tmp6_ = _data_->new_attr;
			e_vcard_attribute_add_value (_data_->_tmp6_, EDSF_PERSONA_gender_female);
			_data_->_tmp7_ = _data_->contact;
			_data_->_tmp8_ = _data_->new_attr;
			_data_->new_attr = NULL;
			e_vcard_add_attribute ((EVCard*) _data_->_tmp7_, _data_->_tmp8_);
			break;
		}
		default:
		break;
	}
	__vala_EVCardAttribute_free0 (_data_->new_attr);
	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_contacts_added_cb (EdsfPersonaStore* self, GList* contacts) {
	GeeHashSet* _tmp0_;
	GeeHashSet* added_personas;
	GeeHashSet* _tmp21_;
	gint _tmp22_;
	gint _tmp23_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
	added_personas = _tmp0_;
	{
		GeeHashMap* _tmp1_;
		_tmp1_ = self->priv->_personas;
		g_static_rec_mutex_lock (&self->priv->__lock__personas);
		{
			GList* _tmp2_;
			_tmp2_ = contacts;
			{
				GList* c_collection = NULL;
				GList* c_it = NULL;
				c_collection = _tmp2_;
				for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
					EContact* _tmp3_;
					EContact* c = NULL;
					_tmp3_ = _g_object_ref0 ((EContact*) c_it->data);
					c = _tmp3_;
					{
						const gchar* _tmp4_;
						const gchar* _tmp5_;
						EContact* _tmp6_;
						gchar* _tmp7_ = NULL;
						gchar* iid;
						GeeHashMap* _tmp8_;
						const gchar* _tmp9_;
						gboolean _tmp10_ = FALSE;
						_tmp4_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
						_tmp5_ = _tmp4_;
						_tmp6_ = c;
						_tmp7_ = edsf_persona_build_iid_from_contact (_tmp5_, _tmp6_);
						iid = _tmp7_;
						_tmp8_ = self->priv->_personas;
						_tmp9_ = iid;
						_tmp10_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp8_, _tmp9_);
						if (_tmp10_ == FALSE) {
							EContact* _tmp11_;
							EdsfPersona* _tmp12_;
							EdsfPersona* persona;
							GeeHashMap* _tmp13_;
							EdsfPersona* _tmp14_;
							const gchar* _tmp15_;
							const gchar* _tmp16_;
							EdsfPersona* _tmp17_;
							GeeHashSet* _tmp18_;
							EdsfPersona* _tmp19_;
							_tmp11_ = c;
							_tmp12_ = edsf_persona_new (self, _tmp11_);
							persona = _tmp12_;
							_tmp13_ = self->priv->_personas;
							_tmp14_ = persona;
							_tmp15_ = folks_persona_get_iid ((FolksPersona*) _tmp14_);
							_tmp16_ = _tmp15_;
							_tmp17_ = persona;
							gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, _tmp16_, _tmp17_);
							_tmp18_ = added_personas;
							_tmp19_ = persona;
							gee_abstract_collection_add ((GeeAbstractCollection*) _tmp18_, _tmp19_);
							_g_object_unref0 (persona);
						}
						_g_free0 (iid);
						_g_object_unref0 (c);
					}
				}
			}
		}
		__finally19:
		{
			GeeHashMap* _tmp20_;
			_tmp20_ = self->priv->_personas;
			g_static_rec_mutex_unlock (&self->priv->__lock__personas);
		}
		if (_inner_error_ != NULL) {
			_g_object_unref0 (added_personas);
			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_);
			return;
		}
	}
	_tmp21_ = added_personas;
	_tmp22_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp21_);
	_tmp23_ = _tmp22_;
	if (_tmp23_ > 0) {
		GeeHashSet* _tmp24_;
		_tmp24_ = added_personas;
		_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) self, (GeeSet*) _tmp24_, NULL, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
	}
	_g_object_unref0 (added_personas);
}


static void _edsf_persona_store_contacts_changed_cb (EdsfPersonaStore* self, GList* contacts) {
	GList* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = contacts;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp0_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			EContact* _tmp1_;
			EContact* c = NULL;
			_tmp1_ = _g_object_ref0 ((EContact*) c_it->data);
			c = _tmp1_;
			{
				const gchar* _tmp2_;
				const gchar* _tmp3_;
				EContact* _tmp4_;
				gchar* _tmp5_ = NULL;
				gchar* iid;
				GeeHashMap* _tmp6_;
				const gchar* _tmp7_;
				gpointer _tmp8_ = NULL;
				EdsfPersona* persona;
				EdsfPersona* _tmp9_;
				_tmp2_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
				_tmp3_ = _tmp2_;
				_tmp4_ = c;
				_tmp5_ = edsf_persona_build_iid_from_contact (_tmp3_, _tmp4_);
				iid = _tmp5_;
				_tmp6_ = self->priv->_personas;
				_tmp7_ = iid;
				_tmp8_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp6_, _tmp7_);
				persona = (EdsfPersona*) _tmp8_;
				_tmp9_ = persona;
				if (_tmp9_ != NULL) {
					EdsfPersona* _tmp10_;
					EContact* _tmp11_;
					_tmp10_ = persona;
					_tmp11_ = c;
					_edsf_persona_update (EDSF_PERSONA (_tmp10_), _tmp11_);
				}
				_g_object_unref0 (persona);
				_g_free0 (iid);
				_g_object_unref0 (c);
			}
		}
	}
}


static void _edsf_persona_store_contacts_removed_cb (EdsfPersonaStore* self, GList* contacts_ids) {
	GeeHashSet* _tmp0_;
	GeeHashSet* removed_personas;
	GList* _tmp1_;
	GeeHashSet* _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
	removed_personas = _tmp0_;
	_tmp1_ = contacts_ids;
	{
		GList* contact_id_collection = NULL;
		GList* contact_id_it = NULL;
		contact_id_collection = _tmp1_;
		for (contact_id_it = contact_id_collection; contact_id_it != NULL; contact_id_it = contact_id_it->next) {
			gchar* _tmp2_;
			gchar* contact_id = NULL;
			_tmp2_ = g_strdup ((const gchar*) contact_id_it->data);
			contact_id = _tmp2_;
			{
				const gchar* _tmp3_;
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				gchar* _tmp6_ = NULL;
				gchar* iid;
				GeeHashMap* _tmp7_;
				const gchar* _tmp8_;
				gpointer _tmp9_ = NULL;
				EdsfPersona* persona;
				EdsfPersona* _tmp10_;
				_tmp3_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
				_tmp4_ = _tmp3_;
				_tmp5_ = contact_id;
				_tmp6_ = edsf_persona_build_iid (_tmp4_, _tmp5_);
				iid = _tmp6_;
				_tmp7_ = self->priv->_personas;
				_tmp8_ = iid;
				_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, _tmp8_);
				persona = (EdsfPersona*) _tmp9_;
				_tmp10_ = persona;
				if (_tmp10_ != NULL) {
					GeeHashSet* _tmp11_;
					EdsfPersona* _tmp12_;
					GeeHashMap* _tmp13_;
					EdsfPersona* _tmp14_;
					const gchar* _tmp15_;
					const gchar* _tmp16_;
					_tmp11_ = removed_personas;
					_tmp12_ = persona;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, EDSF_PERSONA (_tmp12_));
					_tmp13_ = self->priv->_personas;
					_tmp14_ = persona;
					_tmp15_ = folks_persona_get_iid ((FolksPersona*) EDSF_PERSONA (_tmp14_));
					_tmp16_ = _tmp15_;
					gee_abstract_map_unset ((GeeAbstractMap*) _tmp13_, _tmp16_, NULL);
				}
				_g_object_unref0 (persona);
				_g_free0 (iid);
				_g_free0 (contact_id);
			}
		}
	}
	_tmp17_ = removed_personas;
	_tmp18_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_ > 0) {
		GeeHashSet* _tmp20_;
		_tmp20_ = removed_personas;
		_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) self, NULL, (GeeSet*) _tmp20_, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
	}
	_g_object_unref0 (removed_personas);
}


static void _edsf_persona_store_contacts_complete_cb (EdsfPersonaStore* self, GError* err) {
	GError* _tmp0_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = err;
	if (_tmp0_ != NULL) {
		GError* _tmp1_;
		const gchar* _tmp2_;
		_tmp1_ = err;
		_tmp2_ = _tmp1_->message;
		g_warning ("edsf-persona-store.vala:2078: Error in address book view query: %s", _tmp2_);
	}
	_tmp3_ = self->priv->_is_quiescent;
	if (_tmp3_ == FALSE) {
		GError* _tmp4_;
		_tmp4_ = err;
		if (_tmp4_ != NULL) {
			g_warning ("edsf-persona-store.vala:2088: %s", "Error is considered unrecoverable. " "Removing persona store.");
			g_signal_emit_by_name ((FolksPersonaStore*) self, "removed");
			return;
		}
		self->priv->_is_quiescent = TRUE;
		g_object_notify ((GObject*) self, "is-quiescent");
	}
}


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_;
	GQuark _tmp1_;
	GQuark _tmp2_ = 0U;
	const gchar* _tmp20_ = NULL;
	const gchar* _tmp21_;
	GError* _tmp22_;
	const gchar* _tmp23_;
	GError* _tmp24_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (property_name != NULL, NULL);
	_tmp0_ = error_in;
	_tmp1_ = _tmp0_->domain;
	_tmp2_ = e_book_client_error_quark ();
	if (_tmp1_ == _tmp2_) {
		GError* _tmp3_;
		gint _tmp4_;
		_tmp3_ = error_in;
		_tmp4_ = _tmp3_->code;
		switch ((EBookClientError) _tmp4_) {
			default:
			case E_BOOK_CLIENT_ERROR_CONTACT_NOT_FOUND:
			case E_BOOK_CLIENT_ERROR_NO_SUCH_BOOK:
			case E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS:
			case E_BOOK_CLIENT_ERROR_NO_SUCH_SOURCE:
			case E_BOOK_CLIENT_ERROR_NO_SPACE:
			{
				break;
			}
		}
	} else {
		GError* _tmp5_;
		GQuark _tmp6_;
		GQuark _tmp7_ = 0U;
		_tmp5_ = error_in;
		_tmp6_ = _tmp5_->domain;
		_tmp7_ = e_client_error_quark ();
		if (_tmp6_ == _tmp7_) {
			GError* _tmp8_;
			gint _tmp9_;
			_tmp8_ = error_in;
			_tmp9_ = _tmp8_->code;
			switch ((EClientError) _tmp9_) {
				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* _tmp10_ = NULL;
					const gchar* _tmp11_;
					GError* _tmp12_;
					const gchar* _tmp13_;
					GError* _tmp14_;
					_tmp10_ = _ ("Property ‘%s’ is not writeable: %s");
					_tmp11_ = property_name;
					_tmp12_ = error_in;
					_tmp13_ = _tmp12_->message;
					_tmp14_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_NOT_WRITEABLE, _tmp10_, _tmp11_, _tmp13_);
					result = _tmp14_;
					return result;
				}
				case E_CLIENT_ERROR_INVALID_ARG:
				{
					const gchar* _tmp15_ = NULL;
					const gchar* _tmp16_;
					GError* _tmp17_;
					const gchar* _tmp18_;
					GError* _tmp19_;
					_tmp15_ = _ ("Invalid value for property ‘%s’: %s");
					_tmp16_ = property_name;
					_tmp17_ = error_in;
					_tmp18_ = _tmp17_->message;
					_tmp19_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_INVALID_VALUE, _tmp15_, _tmp16_, _tmp18_);
					result = _tmp19_;
					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;
				}
			}
		}
	}
	_tmp20_ = _ ("Unknown error setting property ‘%s’: %s");
	_tmp21_ = property_name;
	_tmp22_ = error_in;
	_tmp23_ = _tmp22_->message;
	_tmp24_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_UNKNOWN_ERROR, _tmp20_, _tmp21_, _tmp23_);
	result = _tmp24_;
	return result;
}


gboolean _edsf_persona_store_is_google_contacts_address_book (EdsfPersonaStore* self) {
	gboolean result = FALSE;
	ESource* _tmp0_;
	void* _tmp1_ = NULL;
	ESourceGroup* group;
	ESourceGroup* _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_source;
	_tmp1_ = e_source_peek_group (_tmp0_);
	group = E_SOURCE_GROUP (_tmp1_);
	_tmp2_ = group;
	if (_tmp2_ != NULL) {
		ESourceGroup* _tmp3_;
		const gchar* _tmp4_ = NULL;
		gchar* _tmp5_;
		gchar* base_uri;
		const gchar* _tmp6_;
		gboolean _tmp7_ = FALSE;
		_tmp3_ = group;
		_tmp4_ = e_source_group_peek_base_uri (E_SOURCE_GROUP (_tmp3_));
		_tmp5_ = g_strdup (_tmp4_);
		base_uri = _tmp5_;
		_tmp6_ = base_uri;
		_tmp7_ = g_str_has_prefix (_tmp6_, "google:");
		if (_tmp7_) {
			result = TRUE;
			_g_free0 (base_uri);
			return result;
		}
		_g_free0 (base_uri);
	}
	result = FALSE;
	return result;
}


static gboolean _edsf_persona_store_is_in_source_list (EdsfPersonaStore* self) {
	gboolean result = FALSE;
	ESourceList* _tmp0_;
	ESourceList* _tmp1_;
	GSList* _tmp2_ = NULL;
	GSList* groups;
	GSList* _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_source_list;
	g_assert (_tmp0_ != NULL);
	_tmp1_ = self->priv->_source_list;
	_tmp2_ = e_source_list_peek_groups (E_SOURCE_LIST (_tmp1_));
	groups = _tmp2_;
	_tmp3_ = groups;
	{
		GSList* g_collection = NULL;
		GSList* g_it = NULL;
		g_collection = _tmp3_;
		for (g_it = g_collection; g_it != NULL; g_it = g_it->next) {
			ESourceGroup* g = NULL;
			g = (ESourceGroup*) g_it->data;
			{
				ESourceGroup* _tmp4_;
				GSList* _tmp5_ = NULL;
				_tmp4_ = g;
				_tmp5_ = e_source_group_peek_sources (_tmp4_);
				{
					GSList* s_collection = NULL;
					GSList* s_it = NULL;
					s_collection = _tmp5_;
					for (s_it = s_collection; s_it != NULL; s_it = s_it->next) {
						ESource* _tmp6_;
						ESource* s = NULL;
						_tmp6_ = _g_object_ref0 ((ESource*) s_it->data);
						s = _tmp6_;
						{
							ESource* _tmp7_;
							const gchar* _tmp8_ = NULL;
							const gchar* _tmp9_;
							const gchar* _tmp10_;
							_tmp7_ = s;
							_tmp8_ = e_source_peek_uid (_tmp7_);
							_tmp9_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
							_tmp10_ = _tmp9_;
							if (g_strcmp0 (_tmp8_, _tmp10_) == 0) {
								result = TRUE;
								_g_object_unref0 (s);
								return result;
							}
							_g_object_unref0 (s);
						}
					}
				}
			}
		}
	}
	result = FALSE;
	return result;
}


static void _edsf_persona_store_source_list_changed_cb (EdsfPersonaStore* self, ESourceList* list) {
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (list != NULL);
	_tmp0_ = _edsf_persona_store_is_in_source_list (self);
	if (_tmp0_ == FALSE) {
		GeeHashSet* _tmp1_;
		GeeHashSet* removed_personas;
		GeeHashMap* _tmp2_;
		GeeMapIterator* _tmp3_ = NULL;
		GeeMapIterator* iter;
		GeeHashSet* _tmp10_;
		_tmp1_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, 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_ = FALSE;
			GeeHashSet* _tmp6_;
			GeeMapIterator* _tmp7_;
			gpointer _tmp8_ = NULL;
			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) {
	EBookClient* _tmp0_;
	ESource* _tmp1_;
	void* _tmp2_ = NULL;
	ESourceGroup* group;
	ESourceGroup* _tmp3_;
	EBookClient* _tmp9_;
	gboolean _tmp10_ = FALSE;
	gboolean _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_addressbook;
	g_assert (_tmp0_ != NULL);
	_tmp1_ = self->priv->_source;
	_tmp2_ = e_source_peek_group (_tmp1_);
	group = E_SOURCE_GROUP (_tmp2_);
	_tmp3_ = group;
	if (_tmp3_ != NULL) {
		ESourceGroup* _tmp4_;
		const gchar* _tmp5_ = NULL;
		gchar* _tmp6_;
		gchar* base_uri;
		const gchar* _tmp7_;
		gboolean _tmp8_ = FALSE;
		_tmp4_ = group;
		_tmp5_ = e_source_group_peek_base_uri (E_SOURCE_GROUP (_tmp4_));
		_tmp6_ = g_strdup (_tmp5_);
		base_uri = _tmp6_;
		_tmp7_ = base_uri;
		_tmp8_ = g_str_has_prefix (_tmp7_, "ldap");
		if (_tmp8_) {
			folks_persona_store_set_trust_level ((FolksPersonaStore*) self, FOLKS_PERSONA_STORE_TRUST_PARTIAL);
			_g_free0 (base_uri);
			return;
		}
		_g_free0 (base_uri);
	}
	_tmp9_ = self->priv->_addressbook;
	g_object_get ((EClient*) E_BOOK_CLIENT (_tmp9_), "readonly", &_tmp10_, NULL);
	_tmp11_ = _tmp10_;
	if (_tmp11_) {
		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;
	gboolean _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	is_default = FALSE;
	{
		ESourceList* sources = NULL;
		ESourceList* _tmp0_ = NULL;
		ESource* _tmp1_ = NULL;
		ESource* _tmp2_;
		ESource* default_source;
		gboolean _tmp3_ = FALSE;
		ESource* _tmp4_;
		gboolean _tmp9_;
		e_book_client_get_sources (&_tmp0_, &_inner_error_);
		_g_object_unref0 (sources);
		sources = _tmp0_;
		if (_inner_error_ != NULL) {
			_g_object_unref0 (sources);
			goto __catch20_g_error;
		}
		_tmp1_ = e_source_list_peek_default_source (sources);
		_tmp2_ = _g_object_ref0 (_tmp1_);
		default_source = _tmp2_;
		_tmp4_ = default_source;
		if (_tmp4_ != NULL) {
			ESource* _tmp5_;
			const gchar* _tmp6_ = NULL;
			ESource* _tmp7_;
			const gchar* _tmp8_ = NULL;
			_tmp5_ = self->priv->_source;
			_tmp6_ = e_source_peek_uid (_tmp5_);
			_tmp7_ = default_source;
			_tmp8_ = e_source_peek_uid (E_SOURCE (_tmp7_));
			_tmp3_ = g_strcmp0 (_tmp6_, _tmp8_) == 0;
		} else {
			_tmp3_ = FALSE;
		}
		_tmp9_ = _tmp3_;
		if (_tmp9_) {
			is_default = TRUE;
		}
		_g_object_unref0 (default_source);
		_g_object_unref0 (sources);
	}
	goto __finally20;
	__catch20_g_error:
	{
		GError* e = NULL;
		GError* _tmp10_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp10_ = e;
		g_warning ("Failed to get the set of ESources while looking for a " "default address book: %s", _tmp10_);
		_g_error_free0 (e);
	}
	__finally20:
	if (_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_);
		return;
	}
	_tmp11_ = is_default;
	_tmp12_ = folks_persona_store_get_is_user_set_default ((FolksPersonaStore*) self);
	_tmp13_ = _tmp12_;
	if (_tmp11_ != _tmp13_) {
		gboolean _tmp14_;
		_tmp14_ = is_default;
		folks_persona_store_set_is_user_set_default ((FolksPersonaStore*) self, _tmp14_);
	}
}


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_ = FALSE;
	gboolean _tmp4_;
	FolksMaybeBool _tmp5_;
	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*) E_BOOK_CLIENT (_tmp2_), "readonly", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		_tmp1_ = FOLKS_MAYBE_BOOL_FALSE;
	} else {
		_tmp1_ = FOLKS_MAYBE_BOOL_TRUE;
	}
	_tmp5_ = _tmp1_;
	result = _tmp5_;
	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;
	FolksMaybeBool _tmp2_;
	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;
	}
	_tmp2_ = _tmp0_;
	result = _tmp2_;
	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_ = FALSE;
	gboolean _tmp4_;
	FolksMaybeBool _tmp5_;
	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*) E_BOOK_CLIENT (_tmp2_), "readonly", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		_tmp1_ = FOLKS_MAYBE_BOOL_FALSE;
	} else {
		_tmp1_ = FOLKS_MAYBE_BOOL_TRUE;
	}
	_tmp5_ = _tmp1_;
	result = _tmp5_;
	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_;
	gboolean _tmp5_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	gchar** _tmp9_;
	gint _tmp9__length1;
	self = (EdsfPersonaStore*) base;
	_tmp1_ = self->priv->_addressbook;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		EBookClient* _tmp2_;
		gboolean _tmp3_ = FALSE;
		gboolean _tmp4_;
		_tmp2_ = self->priv->_addressbook;
		g_object_get ((EClient*) E_BOOK_CLIENT (_tmp2_), "readonly", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ == TRUE;
	}
	_tmp5_ = _tmp0_;
	if (_tmp5_) {
		gchar** _tmp6_;
		gint _tmp6__length1;
		gchar** _tmp7_;
		gint _tmp7__length1;
		_tmp6_ = edsf_persona_store__always_writeable_properties_empty;
		_tmp6__length1 = edsf_persona_store__always_writeable_properties_empty_length1;
		_tmp7_ = _tmp6_;
		_tmp7__length1 = _tmp6__length1;
		if (result_length1) {
			*result_length1 = _tmp7__length1;
		}
		result = _tmp7_;
		return result;
	}
	_tmp8_ = self->priv->_always_writeable_properties;
	_tmp8__length1 = self->priv->_always_writeable_properties_length1;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = _tmp8__length1;
	if (result_length1) {
		*result_length1 = _tmp9__length1;
	}
	result = _tmp9_;
	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) {
	ESource* _tmp0_;
	ESource* _tmp1_;
	g_return_if_fail (self != NULL);
	_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 (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 = EDSF_PERSONA_STORE (obj);
	_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);
	_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);
	_edsf_persona_store_notify_if_default (self);
	return obj;
}


static void edsf_persona_store_class_init (EdsfPersonaStoreClass * klass) {
	gchar** _tmp0_ = NULL;
	edsf_persona_store_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (EdsfPersonaStorePrivate));
	FOLKS_PERSONA_STORE_CLASS (klass)->add_persona_from_details = edsf_persona_store_real_add_persona_from_details;
	FOLKS_PERSONA_STORE_CLASS (klass)->add_persona_from_details_finish = edsf_persona_store_real_add_persona_from_details_finish;
	FOLKS_PERSONA_STORE_CLASS (klass)->remove_persona = edsf_persona_store_real_remove_persona;
	FOLKS_PERSONA_STORE_CLASS (klass)->remove_persona_finish = edsf_persona_store_real_remove_persona_finish;
	FOLKS_PERSONA_STORE_CLASS (klass)->prepare = edsf_persona_store_real_prepare;
	FOLKS_PERSONA_STORE_CLASS (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_ = NULL;
	self->priv = EDSF_PERSONA_STORE_GET_PRIVATE (self);
	g_static_rec_mutex_init (&self->priv->__lock__personas);
	g_static_rec_mutex_init (&self->priv->__lock__is_prepared);
	self->priv->_is_prepared = FALSE;
	self->priv->_prepare_pending = FALSE;
	self->priv->_is_quiescent = FALSE;
	self->priv->_addressbook = NULL;
	self->priv->_ebookview = NULL;
	self->priv->_source_list = 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;
	self->priv->_open_address_book_error = NULL;
	self->priv->_open_address_book_callback = NULL;
}


static void edsf_persona_store_finalize (GObject* obj) {
	EdsfPersonaStore * self;
	GError * _inner_error_ = NULL;
	self = EDSF_PERSONA_STORE (obj);
	{
		EBookClientView* _tmp0_;
		EBookClient* _tmp10_;
		ESourceList* _tmp16_;
		_tmp0_ = self->priv->_ebookview;
		if (_tmp0_ != NULL) {
			EBookClientView* _tmp1_;
			guint _tmp2_ = 0U;
			EBookClientView* _tmp3_;
			guint _tmp4_ = 0U;
			EBookClientView* _tmp5_;
			guint _tmp6_ = 0U;
			EBookClientView* _tmp7_;
			guint _tmp8_ = 0U;
			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 (E_BOOK_CLIENT_VIEW (_tmp1_), 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 (E_BOOK_CLIENT_VIEW (_tmp3_), 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 (E_BOOK_CLIENT_VIEW (_tmp5_), 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 (E_BOOK_CLIENT_VIEW (_tmp7_), 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 (E_BOOK_CLIENT_VIEW (_tmp9_), &_inner_error_);
			if (_inner_error_ != NULL) {
				goto __catch5_g_error;
			}
			_g_object_unref0 (self->priv->_ebookview);
			self->priv->_ebookview = NULL;
		}
		_tmp10_ = self->priv->_addressbook;
		if (_tmp10_ != NULL) {
			EBookClient* _tmp11_;
			guint _tmp12_ = 0U;
			EBookClient* _tmp13_;
			guint _tmp14_ = 0U;
			GQuark _tmp15_ = 0U;
			_tmp11_ = self->priv->_addressbook;
			g_signal_parse_name ("authenticate", e_client_get_type (), &_tmp12_, NULL, FALSE);
			g_signal_handlers_disconnect_matched ((EClient*) E_BOOK_CLIENT (_tmp11_), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp12_, 0, NULL, (GCallback) __edsf_persona_store_address_book_authenticate_cb_e_client_authenticate, self);
			_tmp13_ = self->priv->_addressbook;
			g_signal_parse_name ("notify::readonly", G_TYPE_OBJECT, &_tmp14_, &_tmp15_, TRUE);
			g_signal_handlers_disconnect_matched ((GObject*) E_BOOK_CLIENT (_tmp13_), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp14_, _tmp15_, 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;
		}
		_tmp16_ = self->priv->_source_list;
		if (_tmp16_ != NULL) {
			ESourceList* _tmp17_;
			guint _tmp18_ = 0U;
			_tmp17_ = self->priv->_source_list;
			g_signal_parse_name ("changed", e_source_list_get_type (), &_tmp18_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (E_SOURCE_LIST (_tmp17_), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp18_, 0, NULL, (GCallback) __edsf_persona_store_source_list_changed_cb_e_source_list_changed, self);
			_g_object_unref0 (self->priv->_source_list);
			self->priv->_source_list = NULL;
		}
	}
	goto __finally5;
	__catch5_g_error:
	{
		GError* e = NULL;
		GError* _tmp19_;
		const gchar* _tmp20_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp19_ = e;
		_tmp20_ = _tmp19_->message;
		g_warning ("edsf-persona-store.vala:276: ~PersonaStore: %s\n", _tmp20_);
		_g_error_free0 (e);
	}
	__finally5:
	if (_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_static_rec_mutex_free (&self->priv->__lock__personas);
	_g_object_unref0 (self->priv->_personas);
	_g_object_unref0 (self->priv->_personas_ro);
	g_static_rec_mutex_free (&self->priv->__lock__is_prepared);
	_g_object_unref0 (self->priv->_addressbook);
	_g_object_unref0 (self->priv->_ebookview);
	_g_object_unref0 (self->priv->_source_list);
	_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_error_free0 (self->priv->_open_address_book_error);
	(self->priv->_open_address_book_callback_target_destroy_notify == NULL) ? NULL : (self->priv->_open_address_book_callback_target_destroy_notify (self->priv->_open_address_book_callback_target), NULL);
	self->priv->_open_address_book_callback = NULL;
	self->priv->_open_address_book_callback_target = NULL;
	self->priv->_open_address_book_callback_target_destroy_notify = NULL;
	G_OBJECT_CLASS (edsf_persona_store_parent_class)->finalize (obj);
}


/**
 * A persona store.
 * It will create {@link Persona}s for each contacts on the main addressbook.
 */
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 = EDSF_PERSONA_STORE (object);
	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 = EDSF_PERSONA_STORE (object);
	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;
}



