/* edsf-persona-store.c generated by valac 0.14.0.15-f8b5, 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>


#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 __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (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 _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;
#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;

#define EDSF_TYPE_SET_COMPARATOR (edsf_set_comparator_get_type ())
#define EDSF_SET_COMPARATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_TYPE_SET_COMPARATOR, EdsfSetComparator))
#define EDSF_SET_COMPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_TYPE_SET_COMPARATOR, EdsfSetComparatorClass))
#define EDSF_IS_SET_COMPARATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_TYPE_SET_COMPARATOR))
#define EDSF_IS_SET_COMPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_TYPE_SET_COMPARATOR))
#define EDSF_SET_COMPARATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_TYPE_SET_COMPARATOR, EdsfSetComparatorClass))

typedef struct _EdsfSetComparator EdsfSetComparator;
typedef struct _EdsfSetComparatorClass EdsfSetComparatorClass;
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;
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 _is_quiescent;
	EBookClient* _addressbook;
	EBookClientView* _ebookview;
	ESourceList* _source_list;
	ESource* _source;
	gchar* _query_str;
	gchar** _always_writeable_properties;
	gint _always_writeable_properties_length1;
	gint __always_writeable_properties_size_;
};

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

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

struct _EdsfPersonaStorePrepareData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	ESourceList* _tmp3_;
	ESourceList* _tmp4_;
	ESource* _tmp5_;
	EBookClient* _tmp6_;
	EBookClient* _tmp7_;
	EBookClient* _tmp8_;
	EBookClient* _tmp9_;
	GError* e1;
	GError* _tmp10_;
	GQuark _tmp11_;
	GQuark _tmp12_;
	GError* _tmp13_;
	gint _tmp14_;
	GError* _tmp15_;
	GQuark _tmp16_;
	GQuark _tmp17_;
	GError* _tmp18_;
	gint _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	GError* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	GError* _tmp27_;
	const gchar* _tmp28_;
	GError* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	GError* _tmp33_;
	const gchar* _tmp34_;
	GError* _tmp35_;
	EBookClient* _tmp36_;
	gboolean _tmp37_;
	const gchar* _tmp38_;
	const gchar* _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_;
	gchar** _tmp55_;
	gint _tmp55__length1;
	gchar** field_collection;
	gint field_collection_length1;
	gint _field_collection_size_;
	gint field_it;
	const gchar* field;
	const gchar* _tmp56_;
	FolksPersonaDetail _tmp57_;
	const gchar* _tmp58_;
	gchar* _tmp59_;
	gchar* prop;
	const gchar* _tmp60_;
	GeeHashSet* _tmp61_;
	gchar* _tmp62_;
	gchar* _tmp63_;
	GeeHashSet* _tmp64_;
	gint _tmp65_;
	gint _tmp66_;
	gchar** _tmp67_;
	guint i;
	GeeHashSet* _tmp68_;
	GeeIterator* _tmp69_;
	GeeIterator* _final_prop_it;
	GeeIterator* _tmp70_;
	gboolean _tmp71_;
	GeeIterator* _tmp72_;
	gpointer _tmp73_;
	gchar* final_prop;
	gchar** _tmp74_;
	gint _tmp74__length1;
	guint _tmp75_;
	const gchar* _tmp76_;
	gchar* _tmp77_;
	gchar* _tmp78_;
	gchar** _tmp79_;
	gint _tmp79__length1;
	guint _tmp80_;
	gchar* _tmp81_;
	GError* e2;
	const gchar* _tmp82_;
	GError* _tmp83_;
	const gchar* _tmp84_;
	GError* _tmp85_;
	gboolean do_initial_query;
	gchar* capabilities;
	EBookClient* _tmp86_;
	gchar* _tmp87_;
	const gchar* _tmp88_;
	const gchar* _tmp89_;
	gchar** _tmp90_;
	gchar** _tmp91_;
	gchar** caps;
	gint caps_length1;
	gint _caps_size_;
	gchar** _tmp92_;
	gint _tmp92__length1;
	GError* e4;
	const gchar* _tmp93_;
	GError* _tmp94_;
	const gchar* _tmp95_;
	GError* _tmp96_;
	gboolean got_view;
	EBookClient* _tmp97_;
	const gchar* _tmp98_;
	EBookClientView* _tmp99_;
	gboolean _tmp100_;
	gboolean _tmp101_;
	gboolean _tmp102_;
	const gchar* _tmp103_;
	const gchar* _tmp104_;
	const gchar* _tmp105_;
	GError* _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 _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_;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* contact;
	gulong signal_id;
	guint timeout_id;
	Block3Data* _data3_;
	EdsfPersona* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gulong _tmp7_;
	EBookClient* _tmp8_;
	EContact* _tmp9_;
	guint _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	GError* _tmp15_;
	GError* e;
	const gchar* _tmp16_;
	GError* _tmp17_;
	GError* _tmp18_;
	EdsfPersona* _tmp19_;
	gulong _tmp20_;
	guint _tmp21_;
	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;
	EVCardAttribute* _tmp2_;
	EContact* _tmp3_;
	EVCardAttribute* _tmp4_;
	EVCardAttribute* _tmp5_;
	EVCardAttribute* attr_n;
	GeeMultiMap* _tmp6_;
	GeeSet* _tmp7_;
	GeeSet* _tmp8_;
	GeeIterator* _tmp9_;
	GeeIterator* _tmp10_;
	GeeIterator* _service_it;
	GeeIterator* _tmp11_;
	gboolean _tmp12_;
	GeeIterator* _tmp13_;
	gpointer _tmp14_;
	gchar* service;
	const gchar* _tmp15_;
	EVCardAttributeParam* _tmp16_;
	EVCardAttributeParam* param;
	GeeMultiMap* _tmp17_;
	const gchar* _tmp18_;
	GeeCollection* _tmp19_;
	GeeCollection* _tmp20_;
	GeeIterator* _tmp21_;
	GeeIterator* _tmp22_;
	GeeIterator* _ws_fd_it;
	GeeIterator* _tmp23_;
	gboolean _tmp24_;
	GeeIterator* _tmp25_;
	gpointer _tmp26_;
	FolksWebServiceFieldDetails* ws_fd;
	EVCardAttributeParam* _tmp27_;
	FolksWebServiceFieldDetails* _tmp28_;
	gconstpointer _tmp29_;
	const gchar* _tmp30_;
	EVCardAttribute* _tmp31_;
	EVCardAttributeParam* _tmp32_;
	EVCardAttributeParam* _tmp33_;
	EContact* _tmp34_;
	EVCardAttribute* _tmp35_;
};

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* attr;
	EVCardAttribute* _tmp2_;
	EContact* _tmp3_;
	EVCardAttribute* _tmp4_;
	EVCardAttribute* _tmp5_;
	EVCardAttribute* new_attr;
	GeeSet* _tmp6_;
	GeeIterator* _tmp7_;
	GeeIterator* _local_id_it;
	GeeIterator* _tmp8_;
	gboolean _tmp9_;
	GeeIterator* _tmp10_;
	gpointer _tmp11_;
	gchar* local_id;
	EVCardAttribute* _tmp12_;
	const gchar* _tmp13_;
	EContact* _tmp14_;
	EVCardAttribute* _tmp15_;
};

struct _EdsfPersonaStoreSetContactAvatarData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GLoadableIcon* avatar;
	GLoadableIcon* _tmp0_;
	EContact* _tmp1_;
	EVCardAttribute* _tmp2_;
	EVCardAttribute* attr;
	EVCardAttribute* _tmp3_;
	EContact* _tmp4_;
	EVCardAttribute* _tmp5_;
	EContactPhoto* _tmp6_;
	EContactPhoto* cp;
	EContactPhoto* _tmp7_;
	GLoadableIcon* _tmp8_;
	GInputStream* _tmp9_;
	GInputStream* input_s;
	guint8* _tmp10_;
	guint8* image_data;
	gint image_data_length1;
	gint _image_data_size_;
	guint8* _tmp11_;
	guint8* buffer;
	gint buffer_length1;
	gint _buffer_size_;
	GInputStream* _tmp12_;
	guint8* _tmp13_;
	gint _tmp13__length1;
	gssize _tmp14_;
	gssize size_read;
	gssize _tmp15_;
	guint8* _tmp16_;
	gint _tmp16__length1;
	gint read_cur;
	gint _tmp17_;
	gssize _tmp18_;
	gint _tmp19_;
	guint8* _tmp20_;
	gint _tmp20__length1;
	gint _tmp21_;
	guint8* _tmp22_;
	gint _tmp22__length1;
	gssize _tmp23_;
	EContactPhoto* _tmp24_;
	guint8* _tmp25_;
	gint _tmp25__length1;
	EContact* _tmp26_;
	EContactPhoto* _tmp27_;
	GError* e1;
	const gchar* _tmp28_;
	GError* _tmp29_;
	const gchar* _tmp30_;
	GError* _tmp31_;
	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_;
	EdsfPersona* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	EdsfPersona* _tmp8_;
	EContact* _tmp9_;
	EContact* _tmp10_;
	EContactField _tmp11_;
	const gchar* _tmp12_;
	EdsfPersona* _tmp13_;
	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_;
	EdsfPersona* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	EdsfPersona* _tmp8_;
	EContact* _tmp9_;
	EContact* _tmp10_;
	EContactField _tmp11_;
	const gchar* _tmp12_;
	EdsfPersona* _tmp13_;
	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_;
	EContactDate* _tmp1_;
	EContactDate* _tmp2_;
	GDateTime* _tmp3_;
	gint _tmp4_;
	EContactDate* _tmp5_;
	GDateTime* _tmp6_;
	gint _tmp7_;
	EContactDate* _tmp8_;
	GDateTime* _tmp9_;
	gint _tmp10_;
	EContact* _tmp11_;
	EContactField _tmp12_;
	EContactDate* _tmp13_;
};

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_;
	EdsfSetComparator* _tmp3_;
	EdsfSetComparator* comp;
	EdsfSetComparator* _tmp4_;
	GeeSet* _tmp5_;
	EdsfPersona* _tmp6_;
	GeeSet* _tmp7_;
	GeeSet* _tmp8_;
	gboolean _tmp9_;
	EdsfPersona* _tmp10_;
	EContact* _tmp11_;
	EContact* _tmp12_;
	GeeSet* _tmp13_;
	EdsfPersona* _tmp14_;
	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_;
	EdsfPersona* _tmp4_;
	FolksStructuredName* _tmp5_;
	FolksStructuredName* _tmp6_;
	EdsfPersona* _tmp7_;
	FolksStructuredName* _tmp8_;
	FolksStructuredName* _tmp9_;
	FolksStructuredName* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	EdsfPersona* _tmp13_;
	EContact* _tmp14_;
	EContact* _tmp15_;
	FolksStructuredName* _tmp16_;
	EdsfPersona* _tmp17_;
	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_;
	EContactName* _tmp2_;
	FolksStructuredName* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	EContactName* _tmp7_;
	FolksStructuredName* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	EContactName* _tmp12_;
	FolksStructuredName* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	EContactName* _tmp17_;
	FolksStructuredName* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	EContactName* _tmp22_;
	FolksStructuredName* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	EContact* _tmp27_;
	EContactField _tmp28_;
	EContactName* _tmp29_;
};

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_;
	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* attr;
	EVCardAttribute* _tmp2_;
	EContact* _tmp3_;
	EVCardAttribute* _tmp4_;
	EVCardAttribute* _tmp5_;
	EVCardAttribute* new_attr;
	FolksGender _tmp6_;
	EVCardAttribute* _tmp7_;
	EContact* _tmp8_;
	EVCardAttribute* _tmp9_;
	EVCardAttribute* _tmp10_;
	EContact* _tmp11_;
	EVCardAttribute* _tmp12_;
};


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
};
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_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)
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_source_changed_cb (EdsfPersonaStore* self);
static void __edsf_persona_store_source_changed_cb_e_source_changed (ESource* _sender, gpointer self);
static void _edsf_persona_store_notify_if_default (EdsfPersonaStore* self);
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 GValue* _g_value_dup (GValue* self);
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 _vala_GValue_free (GValue* self);
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_);
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_);
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_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 (Block2Data* _data2_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (Block3Data* _data3_);
static void ___lambda5_ (Block3Data* _data3_, GObject* obj, GParamSpec* pspec);
static void ____lambda5__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 ___lambda6_ (Block3Data* _data3_);
static gboolean ____lambda6__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_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_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 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_);
EdsfSetComparator* edsf_set_comparator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
EdsfSetComparator* edsf_set_comparator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
GType edsf_set_comparator_get_type (void) G_GNUC_CONST;
gboolean edsf_set_comparator_equal (EdsfSetComparator* self, GeeSet* a, GeeSet* b);
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* contact);
static gboolean _edsf_persona_store_is_in_source_list (EdsfPersonaStore* 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_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_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
   */
static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


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


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_;
	ESource* _tmp4_;
	GeeHashMap* _tmp5_;
	GeeHashMap* _tmp6_;
	GeeMap* _tmp7_;
	GeeMap* _tmp8_;
	gchar* _tmp9_;
	ESource* _tmp10_;
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = s;
	_tmp1_ = e_source_peek_uid (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	eds_uid = _tmp2_;
	self = (EdsfPersonaStore*) g_object_new (object_type, "id", eds_uid, "display-name", eds_uid, NULL);
	_tmp3_ = s;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (self->priv->_source);
	self->priv->_source = _tmp4_;
	_tmp5_ = 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 = _tmp5_;
	_tmp6_ = self->priv->_personas;
	_tmp7_ = gee_abstract_map_get_read_only_view ((GeeAbstractMap*) _tmp6_);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (self->priv->_personas_ro);
	self->priv->_personas_ro = _tmp8_;
	_tmp9_ = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
	_g_free0 (self->priv->_query_str);
	self->priv->_query_str = _tmp9_;
	_tmp10_ = self->priv->_source;
	g_signal_connect_object (_tmp10_, "changed", (GCallback) __edsf_persona_store_source_changed_cb_e_source_changed, self, 0);
	_edsf_persona_store_notify_if_default (self);
	_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_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.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 GValue* _g_value_dup (GValue* self) {
	return g_boxed_copy (G_TYPE_VALUE, self);
}


static gpointer __g_value_dup0 (gpointer self) {
	return self ? _g_value_dup (self) : NULL;
}


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 void _vala_GValue_free (GValue* self) {
	g_value_unset (self);
	g_free (self);
}


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;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = e_contact_new ();
	_data_->contact = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->details;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = g_hash_table_get_keys (_data_->_tmp1_);
	{
		_data_->k_collection = _data_->_tmp2_;
		_data_->k_it = NULL;
		for (_data_->k_it = _data_->k_collection; _data_->k_it != NULL; _data_->k_it = _data_->k_it->next) {
			_data_->k = (const gchar*) _data_->k_it->data;
			{
				_data_->_tmp3_ = _data_->details;
				_data_->_tmp4_ = _data_->k;
				_data_->_tmp5_ = NULL;
				_data_->_tmp5_ = g_hash_table_lookup (_data_->_tmp3_, _data_->_tmp4_);
				_data_->_tmp6_ = __g_value_dup0 ((GValue*) _data_->_tmp5_);
				_data_->v = _data_->_tmp6_;
				_data_->_tmp7_ = _data_->k;
				_data_->_tmp8_ = NULL;
				_data_->_tmp8_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_FULL_NAME);
				if (g_strcmp0 (_data_->_tmp7_, _data_->_tmp8_) == 0) {
					_data_->_tmp9_ = _data_->v;
					_data_->_tmp10_ = NULL;
					_data_->_tmp10_ = g_value_get_string (_data_->_tmp9_);
					_data_->_tmp11_ = g_strdup (_data_->_tmp10_);
					_data_->full_name = _data_->_tmp11_;
					_data_->_tmp12_ = _data_->full_name;
					if (g_strcmp0 (_data_->_tmp12_, "") == 0) {
						_g_free0 (_data_->full_name);
						_data_->full_name = NULL;
					}
					_data_->_tmp13_ = _data_->contact;
					_data_->_tmp14_ = 0;
					_data_->_tmp14_ = e_contact_field_id ("full_name");
					_data_->_tmp15_ = _data_->full_name;
					e_contact_set (_data_->_tmp13_, _data_->_tmp14_, _data_->_tmp15_);
					_g_free0 (_data_->full_name);
				} else {
					_data_->_tmp16_ = _data_->k;
					_data_->_tmp17_ = NULL;
					_data_->_tmp17_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_EMAIL_ADDRESSES);
					if (g_strcmp0 (_data_->_tmp16_, _data_->_tmp17_) == 0) {
						_data_->_tmp18_ = _data_->v;
						_data_->_tmp19_ = NULL;
						_data_->_tmp19_ = g_value_get_object (_data_->_tmp18_);
						_data_->_tmp20_ = _g_object_ref0 (GEE_SET (_data_->_tmp19_));
						_data_->email_addresses = _data_->_tmp20_;
						_data_->_tmp21_ = _data_->contact;
						_data_->_tmp22_ = _data_->email_addresses;
						_data_->_state_ = 1;
						_edsf_persona_store_set_contact_attributes_string (_data_->self, _data_->_tmp21_, _data_->_tmp22_, "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_->_tmp23_ = _data_->k;
						_data_->_tmp24_ = NULL;
						_data_->_tmp24_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_AVATAR);
						if (g_strcmp0 (_data_->_tmp23_, _data_->_tmp24_) == 0) {
							{
								_data_->_tmp25_ = _data_->v;
								_data_->_tmp26_ = NULL;
								_data_->_tmp26_ = g_value_get_object (_data_->_tmp25_);
								_data_->_tmp27_ = _g_object_ref0 (G_LOADABLE_ICON (_data_->_tmp26_));
								_data_->avatar = _data_->_tmp27_;
								_data_->_tmp28_ = _data_->contact;
								_data_->_tmp29_ = _data_->avatar;
								_data_->_state_ = 2;
								_edsf_persona_store_set_contact_avatar (_data_->self, _data_->_tmp28_, _data_->_tmp29_, 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);
									__vala_GValue_free0 (_data_->v);
									_g_list_free0 (_data_->k_collection);
									_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_->_tmp30_ = _data_->e1;
								_data_->_tmp31_ = _data_->_tmp30_->message;
								g_warning ("edsf-persona-store.vala:312: Couldn't set avatar on the EContact: %s", _data_->_tmp31_);
								_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_);
									__vala_GValue_free0 (_data_->v);
									_g_list_free0 (_data_->k_collection);
									_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 {
									__vala_GValue_free0 (_data_->v);
									_g_list_free0 (_data_->k_collection);
									_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_->_tmp32_ = _data_->k;
							_data_->_tmp33_ = NULL;
							_data_->_tmp33_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IM_ADDRESSES);
							if (g_strcmp0 (_data_->_tmp32_, _data_->_tmp33_) == 0) {
								_data_->_tmp34_ = _data_->v;
								_data_->_tmp35_ = NULL;
								_data_->_tmp35_ = g_value_get_object (_data_->_tmp34_);
								_data_->_tmp36_ = _g_object_ref0 (GEE_MULTI_MAP (_data_->_tmp35_));
								_data_->im_fds = _data_->_tmp36_;
								_data_->_tmp37_ = _data_->contact;
								_data_->_tmp38_ = _data_->im_fds;
								_data_->_state_ = 3;
								_edsf_persona_store_set_contact_im_fds (_data_->self, _data_->_tmp37_, _data_->_tmp38_, 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_->_tmp39_ = _data_->k;
								_data_->_tmp40_ = NULL;
								_data_->_tmp40_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_PHONE_NUMBERS);
								if (g_strcmp0 (_data_->_tmp39_, _data_->_tmp40_) == 0) {
									_data_->_tmp41_ = _data_->v;
									_data_->_tmp42_ = NULL;
									_data_->_tmp42_ = g_value_get_object (_data_->_tmp41_);
									_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_ = _data_->v;
										_data_->_tmp49_ = NULL;
										_data_->_tmp49_ = g_value_get_object (_data_->_tmp48_);
										_data_->_tmp50_ = _g_object_ref0 (GEE_SET (_data_->_tmp49_));
										_data_->postal_fds = _data_->_tmp50_;
										_data_->_tmp51_ = _data_->contact;
										_data_->_tmp52_ = _data_->postal_fds;
										_data_->_state_ = 5;
										_edsf_persona_store_set_contact_postal_addresses (_data_->self, _data_->_tmp51_, _data_->_tmp52_, 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_->_tmp53_ = _data_->k;
										_data_->_tmp54_ = NULL;
										_data_->_tmp54_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_STRUCTURED_NAME);
										if (g_strcmp0 (_data_->_tmp53_, _data_->_tmp54_) == 0) {
											_data_->_tmp55_ = _data_->v;
											_data_->_tmp56_ = NULL;
											_data_->_tmp56_ = g_value_get_object (_data_->_tmp55_);
											_data_->_tmp57_ = _g_object_ref0 (FOLKS_STRUCTURED_NAME (_data_->_tmp56_));
											_data_->sname = _data_->_tmp57_;
											_data_->_tmp58_ = _data_->contact;
											_data_->_tmp59_ = _data_->sname;
											_data_->_state_ = 6;
											_edsf_persona_store_set_contact_name (_data_->self, _data_->_tmp58_, _data_->_tmp59_, 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_->_tmp60_ = _data_->k;
											_data_->_tmp61_ = NULL;
											_data_->_tmp61_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_LOCAL_IDS);
											if (g_strcmp0 (_data_->_tmp60_, _data_->_tmp61_) == 0) {
												_data_->_tmp62_ = _data_->v;
												_data_->_tmp63_ = NULL;
												_data_->_tmp63_ = g_value_get_object (_data_->_tmp62_);
												_data_->_tmp64_ = _g_object_ref0 (GEE_SET (_data_->_tmp63_));
												_data_->local_ids = _data_->_tmp64_;
												_data_->_tmp65_ = _data_->contact;
												_data_->_tmp66_ = _data_->local_ids;
												_data_->_state_ = 7;
												_edsf_persona_store_set_contact_local_ids (_data_->self, _data_->_tmp65_, _data_->_tmp66_, 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_->_tmp67_ = _data_->k;
												_data_->_tmp68_ = NULL;
												_data_->_tmp68_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_WEB_SERVICE_ADDRESSES);
												if (g_strcmp0 (_data_->_tmp67_, _data_->_tmp68_) == 0) {
													_data_->_tmp69_ = _data_->v;
													_data_->_tmp70_ = NULL;
													_data_->_tmp70_ = g_value_get_object (_data_->_tmp69_);
													_data_->_tmp71_ = _g_object_ref0 (GEE_HASH_MULTI_MAP (_data_->_tmp70_));
													_data_->web_service_addresses = _data_->_tmp71_;
													_data_->_tmp72_ = _data_->contact;
													_data_->_tmp73_ = _data_->web_service_addresses;
													_data_->_state_ = 8;
													_edsf_persona_store_set_contact_web_service_addresses (_data_->self, _data_->_tmp72_, (GeeMultiMap*) _data_->_tmp73_, 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_->_tmp74_ = _data_->k;
													_data_->_tmp75_ = NULL;
													_data_->_tmp75_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_NOTES);
													if (g_strcmp0 (_data_->_tmp74_, _data_->_tmp75_) == 0) {
														_data_->_tmp76_ = _data_->v;
														_data_->_tmp77_ = NULL;
														_data_->_tmp77_ = g_value_get_object (_data_->_tmp76_);
														_data_->_tmp78_ = _g_object_ref0 (GEE_HASH_SET (_data_->_tmp77_));
														_data_->notes = _data_->_tmp78_;
														_data_->_tmp79_ = _data_->contact;
														_data_->_tmp80_ = _data_->notes;
														_data_->_state_ = 9;
														_edsf_persona_store_set_contact_notes (_data_->self, _data_->_tmp79_, (GeeSet*) _data_->_tmp80_, 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_->_tmp81_ = _data_->k;
														_data_->_tmp82_ = NULL;
														_data_->_tmp82_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_GENDER);
														if (g_strcmp0 (_data_->_tmp81_, _data_->_tmp82_) == 0) {
															_data_->_tmp83_ = _data_->v;
															_data_->_tmp84_ = 0;
															_data_->_tmp84_ = g_value_get_enum (_data_->_tmp83_);
															_data_->gender = (FolksGender) _data_->_tmp84_;
															_data_->_tmp85_ = _data_->contact;
															_data_->_tmp86_ = _data_->gender;
															_data_->_state_ = 10;
															_edsf_persona_store_set_contact_gender (_data_->self, _data_->_tmp85_, _data_->_tmp86_, 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_->_tmp87_ = _data_->k;
															_data_->_tmp88_ = NULL;
															_data_->_tmp88_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_URLS);
															if (g_strcmp0 (_data_->_tmp87_, _data_->_tmp88_) == 0) {
																_data_->_tmp89_ = _data_->v;
																_data_->_tmp90_ = NULL;
																_data_->_tmp90_ = g_value_get_object (_data_->_tmp89_);
																_data_->_tmp91_ = _g_object_ref0 (GEE_SET (_data_->_tmp90_));
																_data_->urls = _data_->_tmp91_;
																_data_->_tmp92_ = _data_->contact;
																_data_->_tmp93_ = _data_->urls;
																_data_->_state_ = 11;
																_edsf_persona_store_set_contact_urls (_data_->self, _data_->_tmp92_, _data_->_tmp93_, 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_->_tmp94_ = _data_->k;
																_data_->_tmp95_ = NULL;
																_data_->_tmp95_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_BIRTHDAY);
																if (g_strcmp0 (_data_->_tmp94_, _data_->_tmp95_) == 0) {
																	_data_->_tmp96_ = _data_->v;
																	_data_->_tmp97_ = NULL;
																	_data_->_tmp97_ = g_value_get_boxed (_data_->_tmp96_);
																	_data_->_tmp98_ = _g_date_time_ref0 ((GDateTime*) _data_->_tmp97_);
																	_data_->birthday = _data_->_tmp98_;
																	_data_->_tmp99_ = _data_->contact;
																	_data_->_tmp100_ = _data_->birthday;
																	_data_->_state_ = 12;
																	_edsf_persona_store_set_contact_birthday (_data_->self, _data_->_tmp99_, _data_->_tmp100_, 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_->_tmp101_ = _data_->k;
																	_data_->_tmp102_ = NULL;
																	_data_->_tmp102_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_ROLES);
																	if (g_strcmp0 (_data_->_tmp101_, _data_->_tmp102_) == 0) {
																		_data_->_tmp103_ = _data_->v;
																		_data_->_tmp104_ = NULL;
																		_data_->_tmp104_ = g_value_get_object (_data_->_tmp103_);
																		_data_->_tmp105_ = _g_object_ref0 (GEE_SET (_data_->_tmp104_));
																		_data_->roles = _data_->_tmp105_;
																		_data_->_tmp106_ = _data_->contact;
																		_data_->_tmp107_ = _data_->roles;
																		_data_->_state_ = 13;
																		_edsf_persona_store_set_contact_roles (_data_->self, _data_->_tmp106_, _data_->_tmp107_, 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);
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
				__vala_GValue_free0 (_data_->v);
			}
		}
		_g_list_free0 (_data_->k_collection);
	}
	_data_->persona = NULL;
	{
		_data_->_tmp108_ = _data_->self->priv->_addressbook;
		_data_->_tmp109_ = _data_->contact;
		_data_->_tmp110_ = NULL;
		_data_->_state_ = 14;
		e_book_client_add_contact (_data_->_tmp108_, _data_->_tmp109_, NULL, edsf_persona_store_add_persona_from_details_ready, _data_);
		return FALSE;
		_state_14:
		_data_->_tmp111_ = FALSE;
		_data_->_tmp111_ = e_book_client_add_contact_finish (_data_->_tmp108_, _data_->_res_, &_data_->_tmp110_, &_data_->_inner_error_);
		_g_free0 (_data_->added_uid);
		_data_->added_uid = _data_->_tmp110_;
		_data_->_result_ = _data_->_tmp111_;
		if (_data_->_inner_error_ != NULL) {
			_g_free0 (_data_->added_uid);
			goto __catch7_g_error;
		}
		_data_->_tmp112_ = _data_->_result_;
		if (_data_->_tmp112_) {
			_data_->_tmp113_ = _data_->added_uid;
			g_debug ("edsf-persona-store.vala:398: Created contact with uid: %s\n", _data_->_tmp113_);
			{
				_data_->_tmp114_ = _data_->self->priv->_personas;
				g_static_rec_mutex_lock (&_data_->self->priv->__lock__personas);
				{
					_data_->_tmp115_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
					_data_->_tmp116_ = _data_->_tmp115_;
					_data_->_tmp117_ = _data_->added_uid;
					_data_->_tmp118_ = NULL;
					_data_->_tmp118_ = edsf_persona_build_iid (_data_->_tmp116_, _data_->_tmp117_);
					_data_->iid = _data_->_tmp118_;
					_data_->_tmp119_ = _data_->self->priv->_personas;
					_data_->_tmp120_ = _data_->iid;
					_data_->_tmp121_ = NULL;
					_data_->_tmp121_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp119_, _data_->_tmp120_);
					_g_object_unref0 (_data_->persona);
					_data_->persona = (EdsfPersona*) _data_->_tmp121_;
					_data_->_tmp122_ = _data_->persona;
					if (_data_->_tmp122_ == NULL) {
						_data_->_tmp123_ = _data_->contact;
						_data_->_tmp124_ = 0;
						_data_->_tmp124_ = e_contact_field_id ("id");
						_data_->_tmp125_ = _data_->added_uid;
						e_contact_set (_data_->_tmp123_, _data_->_tmp124_, _data_->_tmp125_);
						_data_->_tmp126_ = _data_->contact;
						_data_->_tmp127_ = edsf_persona_new (_data_->self, _data_->_tmp126_);
						_g_object_unref0 (_data_->persona);
						_data_->persona = _data_->_tmp127_;
						_data_->_tmp128_ = _data_->self->priv->_personas;
						_data_->_tmp129_ = _data_->persona;
						_data_->_tmp130_ = folks_persona_get_iid ((FolksPersona*) _data_->_tmp129_);
						_data_->_tmp131_ = _data_->_tmp130_;
						_data_->_tmp132_ = _data_->persona;
						gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp128_, _data_->_tmp131_, _data_->_tmp132_);
						_data_->_tmp133_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
						_data_->added_personas = _data_->_tmp133_;
						_data_->_tmp134_ = _data_->added_personas;
						_data_->_tmp135_ = _data_->persona;
						gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp134_, _data_->_tmp135_);
						_data_->_tmp136_ = _data_->added_personas;
						_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) _data_->self, (GeeSet*) _data_->_tmp136_, NULL, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
						_g_object_unref0 (_data_->added_personas);
					}
					_g_free0 (_data_->iid);
				}
				__finally8:
				{
					_data_->_tmp137_ = _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_->_tmp138_ = g_error_new_literal (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_CREATE_FAILED, "BookClient.add_contact () failed.");
			_data_->_inner_error_ = _data_->_tmp138_;
			_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_->_tmp139_ = _data_->e;
		_data_->_tmp140_ = _data_->_tmp139_->message;
		g_warning ("edsf-persona-store.vala:422: add_persona_from_details: %s\n", _data_->_tmp140_);
		_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->_addressbook;
		_data_->_tmp1_ = _data_->persona;
		_data_->_tmp2_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp1_));
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_state_ = 1;
		e_book_client_remove_contact (_data_->_tmp0_, _data_->_tmp3_, NULL, edsf_persona_store_remove_persona_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_remove_contact_finish (_data_->_tmp0_, _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_->_tmp4_ = _data_->e;
		_data_->_tmp5_ = _data_->_tmp4_->domain;
		_data_->_tmp6_ = 0U;
		_data_->_tmp6_ = e_book_client_error_quark ();
		if (_data_->_tmp5_ == _data_->_tmp6_) {
			_data_->_tmp7_ = _data_->e;
			_data_->_tmp8_ = _data_->_tmp7_->code;
			switch ((EBookClientError) _data_->_tmp8_) {
				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_->_tmp9_ = _data_->e;
			_data_->_tmp10_ = _data_->_tmp9_->domain;
			_data_->_tmp11_ = 0U;
			_data_->_tmp11_ = e_client_error_quark ();
			if (_data_->_tmp10_ == _data_->_tmp11_) {
				_data_->_tmp12_ = _data_->e;
				_data_->_tmp13_ = _data_->_tmp12_->code;
				switch ((EClientError) _data_->_tmp13_) {
					case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
					{
						_data_->_tmp14_ = NULL;
						_data_->_tmp14_ = _ ("Address book ‘%s’ is offline, so contact ‘%s’ cannot be removed.");
						_data_->_tmp15_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
						_data_->_tmp16_ = _data_->_tmp15_;
						_data_->_tmp17_ = _data_->persona;
						_data_->_tmp18_ = folks_persona_get_uid (_data_->_tmp17_);
						_data_->_tmp19_ = _data_->_tmp18_;
						_data_->_tmp20_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _data_->_tmp14_, _data_->_tmp16_, _data_->_tmp19_);
						_data_->_inner_error_ = _data_->_tmp20_;
						_g_error_free0 (_data_->e);
						goto __finally9;
					}
					case E_CLIENT_ERROR_PERMISSION_DENIED:
					{
						_data_->_tmp21_ = NULL;
						_data_->_tmp21_ = _ ("Permission denied to remove contact ‘%s’: %s");
						_data_->_tmp22_ = _data_->persona;
						_data_->_tmp23_ = folks_persona_get_uid (_data_->_tmp22_);
						_data_->_tmp24_ = _data_->_tmp23_;
						_data_->_tmp25_ = _data_->e;
						_data_->_tmp26_ = _data_->_tmp25_->message;
						_data_->_tmp27_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _data_->_tmp21_, _data_->_tmp24_, _data_->_tmp26_);
						_data_->_inner_error_ = _data_->_tmp27_;
						_g_error_free0 (_data_->e);
						goto __finally9;
					}
					case E_CLIENT_ERROR_NOT_SUPPORTED:
					{
						_data_->_tmp28_ = NULL;
						_data_->_tmp28_ = _ ("Removing contacts isn't supported by this persona store: %s");
						_data_->_tmp29_ = _data_->e;
						_data_->_tmp30_ = _data_->_tmp29_->message;
						_data_->_tmp31_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_READ_ONLY, _data_->_tmp28_, _data_->_tmp30_);
						_data_->_inner_error_ = _data_->_tmp31_;
						_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_->_tmp32_ = NULL;
		_data_->_tmp32_ = _ ("Can't remove contact ‘%s’: %s");
		_data_->_tmp33_ = _data_->persona;
		_data_->_tmp34_ = folks_persona_get_uid (_data_->_tmp33_);
		_data_->_tmp35_ = _data_->_tmp34_;
		_data_->_tmp36_ = _data_->e;
		_data_->_tmp37_ = _data_->_tmp36_->message;
		_data_->_tmp38_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_REMOVE_FAILED, _data_->_tmp32_, _data_->_tmp35_, _data_->_tmp37_);
		_data_->_inner_error_ = _data_->_tmp38_;
		_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_->_tmp1_ = _data_->self->priv->_is_prepared;
			if (_data_->_tmp1_) {
				{
					_data_->_tmp2_ = _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_->_tmp3_ = NULL;
				e_book_client_get_sources (&_data_->_tmp3_, &_data_->_inner_error_);
				_g_object_unref0 (_data_->self->priv->_source_list);
				_data_->self->priv->_source_list = _data_->_tmp3_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch11_g_error;
				}
				_data_->_tmp4_ = _data_->self->priv->_source_list;
				g_signal_connect_object (_data_->_tmp4_, "changed", (GCallback) __edsf_persona_store_source_list_changed_cb_e_source_list_changed, _data_->self, 0);
				_data_->_tmp5_ = _data_->self->priv->_source;
				_data_->_tmp6_ = e_book_client_new (_data_->_tmp5_, &_data_->_inner_error_);
				_data_->_tmp7_ = _data_->_tmp6_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch11_g_error;
				}
				_g_object_unref0 (_data_->self->priv->_addressbook);
				_data_->self->priv->_addressbook = _data_->_tmp7_;
				_data_->_tmp8_ = _data_->self->priv->_addressbook;
				g_signal_connect_object ((GObject*) _data_->_tmp8_, "notify::readonly", (GCallback) __edsf_persona_store_address_book_notify_read_only_cb_g_object_notify, _data_->self, 0);
				_data_->_tmp9_ = _data_->self->priv->_addressbook;
				_data_->_state_ = 1;
				e_client_open ((EClient*) _data_->_tmp9_, FALSE, NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_1:
				e_client_open_finish ((EClient*) _data_->_tmp9_, _data_->_res_, &_data_->_inner_error_);
				if (_data_->_inner_error_ != NULL) {
					goto __catch11_g_error;
				}
				_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_->_tmp10_ = _data_->e1;
				_data_->_tmp11_ = _data_->_tmp10_->domain;
				_data_->_tmp12_ = 0U;
				_data_->_tmp12_ = e_book_client_error_quark ();
				if (_data_->_tmp11_ == _data_->_tmp12_) {
					_data_->_tmp13_ = _data_->e1;
					_data_->_tmp14_ = _data_->_tmp13_->code;
					switch ((EBookClientError) _data_->_tmp14_) {
						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_->_tmp15_ = _data_->e1;
					_data_->_tmp16_ = _data_->_tmp15_->domain;
					_data_->_tmp17_ = 0U;
					_data_->_tmp17_ = e_client_error_quark ();
					if (_data_->_tmp16_ == _data_->_tmp17_) {
						_data_->_tmp18_ = _data_->e1;
						_data_->_tmp19_ = _data_->_tmp18_->code;
						switch ((EClientError) _data_->_tmp19_) {
							case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
							{
								_data_->_tmp20_ = NULL;
								_data_->_tmp20_ = _ ("Address book ‘%s’ is offline.");
								_data_->_tmp21_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp22_ = _data_->_tmp21_;
								_data_->_tmp23_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _data_->_tmp20_, _data_->_tmp22_);
								_data_->_inner_error_ = _data_->_tmp23_;
								_g_error_free0 (_data_->e1);
								goto __finally11;
							}
							case E_CLIENT_ERROR_PERMISSION_DENIED:
							{
								_data_->_tmp24_ = NULL;
								_data_->_tmp24_ = _ ("Permission denied to open address book ‘%s’: %s");
								_data_->_tmp25_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp26_ = _data_->_tmp25_;
								_data_->_tmp27_ = _data_->e1;
								_data_->_tmp28_ = _data_->_tmp27_->message;
								_data_->_tmp29_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _data_->_tmp24_, _data_->_tmp26_, _data_->_tmp28_);
								_data_->_inner_error_ = _data_->_tmp29_;
								_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_->_tmp30_ = NULL;
				_data_->_tmp30_ = _ ("Couldn't 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_INVALID_ARGUMENT, _data_->_tmp30_, _data_->_tmp32_, _data_->_tmp34_);
				_data_->_inner_error_ = _data_->_tmp35_;
				_g_error_free0 (_data_->e1);
				goto __finally11;
			}
			__finally11:
			if (_data_->_inner_error_ != NULL) {
				goto __finally10;
			}
			_data_->_tmp36_ = _data_->self->priv->_addressbook;
			_data_->_tmp37_ = FALSE;
			_data_->_tmp37_ = e_client_is_opened ((EClient*) _data_->_tmp36_);
			if (_data_->_tmp37_ == FALSE) {
				g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
				_data_->_tmp38_ = NULL;
				_data_->_tmp38_ = _ ("Couldn't open address book ‘%s’.");
				_data_->_tmp39_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
				_data_->_tmp40_ = _data_->_tmp39_;
				_data_->_tmp41_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp38_, _data_->_tmp40_);
				_data_->_inner_error_ = _data_->_tmp41_;
				goto __finally10;
			}
			{
				_data_->_tmp42_ = _data_->self->priv->_addressbook;
				_data_->_tmp43_ = NULL;
				_data_->_state_ = 2;
				e_client_get_backend_property ((EClient*) _data_->_tmp42_, "supported-fields", NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_2:
				e_client_get_backend_property_finish ((EClient*) _data_->_tmp42_, _data_->_res_, &_data_->_tmp43_, &_data_->_inner_error_);
				_g_free0 (_data_->supported_fields);
				_data_->supported_fields = _data_->_tmp43_;
				if (_data_->_inner_error_ != NULL) {
					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 (_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_, _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_, _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_, _data_->_tmp54_);
					_data_->_tmp55_ = _data_->fields;
					_data_->_tmp55__length1 = _data_->fields_length1;
					{
						_data_->field_collection_length1 = 0;
						_data_->_field_collection_size_ = 0;
						_data_->field_collection = _data_->_tmp55_;
						_data_->field_collection_length1 = _data_->_tmp55__length1;
						_data_->field_it = 0;
						for (_data_->field_it = 0; _data_->field_it < _data_->_tmp55__length1; _data_->field_it = _data_->field_it + 1) {
							_data_->field = _data_->field_collection[_data_->field_it];
							{
								_data_->_tmp56_ = _data_->field;
								_data_->_tmp57_ = 0;
								_data_->_tmp57_ = _edsf_persona_store_eds_field_name_to_folks_persona_detail (_data_->self, _data_->_tmp56_);
								_data_->_tmp58_ = NULL;
								_data_->_tmp58_ = folks_persona_store_detail_key (_data_->_tmp57_);
								_data_->_tmp59_ = g_strdup (_data_->_tmp58_);
								_data_->prop = _data_->_tmp59_;
								_data_->_tmp60_ = _data_->prop;
								if (_data_->_tmp60_ != NULL) {
									_data_->_tmp61_ = _data_->prop_set;
									_data_->_tmp62_ = _data_->prop;
									_data_->prop = NULL;
									_data_->_tmp63_ = _data_->_tmp62_;
									gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp61_, _data_->_tmp63_);
									_g_free0 (_data_->_tmp63_);
								}
								_g_free0 (_data_->prop);
							}
						}
					}
					_data_->fields = (_vala_array_free (_data_->fields, _data_->fields_length1, (GDestroyNotify) g_free), NULL);
				}
				_data_->_tmp64_ = _data_->prop_set;
				_data_->_tmp65_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp64_);
				_data_->_tmp66_ = _data_->_tmp65_;
				_data_->_tmp67_ = NULL;
				_data_->_tmp67_ = g_new0 (gchar*, (_data_->_tmp66_ + 1) + 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_->_tmp67_;
				_data_->self->priv->_always_writeable_properties_length1 = _data_->_tmp66_ + 1;
				_data_->self->priv->__always_writeable_properties_size_ = _data_->self->priv->_always_writeable_properties_length1;
				_data_->i = (guint) 0;
				{
					_data_->_tmp68_ = _data_->prop_set;
					_data_->_tmp69_ = NULL;
					_data_->_tmp69_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp68_);
					_data_->_final_prop_it = _data_->_tmp69_;
					while (TRUE) {
						_data_->_tmp70_ = _data_->_final_prop_it;
						_data_->_tmp71_ = FALSE;
						_data_->_tmp71_ = gee_iterator_next (_data_->_tmp70_);
						if (!_data_->_tmp71_) {
							break;
						}
						_data_->_tmp72_ = _data_->_final_prop_it;
						_data_->_tmp73_ = NULL;
						_data_->_tmp73_ = gee_iterator_get (_data_->_tmp72_);
						_data_->final_prop = (gchar*) _data_->_tmp73_;
						_data_->_tmp74_ = _data_->self->priv->_always_writeable_properties;
						_data_->_tmp74__length1 = _data_->self->priv->_always_writeable_properties_length1;
						_data_->_tmp75_ = _data_->i;
						_data_->i = _data_->_tmp75_ + 1;
						_data_->_tmp76_ = _data_->final_prop;
						_data_->_tmp77_ = g_strdup (_data_->_tmp76_);
						_g_free0 (_data_->_tmp74_[_data_->_tmp75_]);
						_data_->_tmp74_[_data_->_tmp75_] = _data_->_tmp77_;
						_data_->_tmp78_ = _data_->_tmp74_[_data_->_tmp75_];
						_g_free0 (_data_->final_prop);
					}
					_g_object_unref0 (_data_->_final_prop_it);
				}
				_data_->_tmp79_ = _data_->self->priv->_always_writeable_properties;
				_data_->_tmp79__length1 = _data_->self->priv->_always_writeable_properties_length1;
				_data_->_tmp80_ = _data_->i;
				_g_free0 (_data_->_tmp79_[_data_->_tmp80_]);
				_data_->_tmp79_[_data_->_tmp80_] = NULL;
				_data_->_tmp81_ = _data_->_tmp79_[_data_->_tmp80_];
				_g_object_unref0 (_data_->prop_set);
			}
			goto __finally12;
			__catch12_g_error:
			{
				_data_->e2 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
				_data_->_tmp82_ = NULL;
				_data_->_tmp82_ = _ ("Couldn't get address book capabilities: %s");
				_data_->_tmp83_ = _data_->e2;
				_data_->_tmp84_ = _data_->_tmp83_->message;
				_data_->_tmp85_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp82_, _data_->_tmp84_);
				_data_->_inner_error_ = _data_->_tmp85_;
				_g_error_free0 (_data_->e2);
				goto __finally12;
			}
			__finally12:
			if (_data_->_inner_error_ != NULL) {
				_g_free0 (_data_->supported_fields);
				goto __finally10;
			}
			_data_->do_initial_query = FALSE;
			{
				_data_->_tmp86_ = _data_->self->priv->_addressbook;
				_data_->_tmp87_ = NULL;
				_data_->_state_ = 3;
				e_client_get_backend_property ((EClient*) _data_->_tmp86_, "capabilities", NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_3:
				e_client_get_backend_property_finish ((EClient*) _data_->_tmp86_, _data_->_res_, &_data_->_tmp87_, &_data_->_inner_error_);
				_g_free0 (_data_->capabilities);
				_data_->capabilities = _data_->_tmp87_;
				if (_data_->_inner_error_ != NULL) {
					_g_free0 (_data_->capabilities);
					goto __catch13_g_error;
				}
				_data_->_tmp88_ = _data_->capabilities;
				if (_data_->_tmp88_ != NULL) {
					_data_->_tmp89_ = _data_->capabilities;
					_data_->_tmp91_ = NULL;
					_data_->_tmp91_ = _data_->_tmp90_ = g_strsplit (_data_->_tmp89_, ",", 0);
					_data_->caps = _data_->_tmp91_;
					_data_->caps_length1 = _vala_array_length (_data_->_tmp90_);
					_data_->_caps_size_ = _data_->caps_length1;
					_data_->_tmp92_ = _data_->caps;
					_data_->_tmp92__length1 = _data_->caps_length1;
					_data_->do_initial_query = _vala_string_array_contains (_data_->_tmp92_, _data_->_tmp92__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_->_tmp93_ = NULL;
				_data_->_tmp93_ = _ ("Couldn't get address book capabilities: %s");
				_data_->_tmp94_ = _data_->e4;
				_data_->_tmp95_ = _data_->_tmp94_->message;
				_data_->_tmp96_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp93_, _data_->_tmp95_);
				_data_->_inner_error_ = _data_->_tmp96_;
				_g_error_free0 (_data_->e4);
				goto __finally13;
			}
			__finally13:
			if (_data_->_inner_error_ != NULL) {
				_g_free0 (_data_->supported_fields);
				goto __finally10;
			}
			_data_->got_view = FALSE;
			{
				_data_->_tmp97_ = _data_->self->priv->_addressbook;
				_data_->_tmp98_ = _data_->self->priv->_query_str;
				_data_->_tmp99_ = NULL;
				_data_->_state_ = 4;
				e_book_client_get_view (_data_->_tmp97_, _data_->_tmp98_, NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_4:
				_data_->_tmp100_ = FALSE;
				_data_->_tmp100_ = e_book_client_get_view_finish (_data_->_tmp97_, _data_->_res_, &_data_->_tmp99_, &_data_->_inner_error_);
				_g_object_unref0 (_data_->self->priv->_ebookview);
				_data_->self->priv->_ebookview = _data_->_tmp99_;
				_data_->_tmp101_ = _data_->_tmp100_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch14_g_error;
				}
				_data_->got_view = _data_->_tmp101_;
				_data_->_tmp102_ = _data_->got_view;
				if (_data_->_tmp102_ == FALSE) {
					_data_->_tmp103_ = NULL;
					_data_->_tmp103_ = _ ("Couldn't get view for address book ‘%s’.");
					_data_->_tmp104_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
					_data_->_tmp105_ = _data_->_tmp104_;
					_data_->_tmp106_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp103_, _data_->_tmp105_);
					_data_->_inner_error_ = _data_->_tmp106_;
					goto __catch14_g_error;
				}
				_data_->_tmp107_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (_data_->_tmp107_, "objects-added", (GCallback) __edsf_persona_store_contacts_added_cb_e_book_client_view_objects_added, _data_->self, 0);
				_data_->_tmp108_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (_data_->_tmp108_, "objects-removed", (GCallback) __edsf_persona_store_contacts_removed_cb_e_book_client_view_objects_removed, _data_->self, 0);
				_data_->_tmp109_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (_data_->_tmp109_, "objects-modified", (GCallback) __edsf_persona_store_contacts_changed_cb_e_book_client_view_objects_modified, _data_->self, 0);
				_data_->_tmp110_ = _data_->self->priv->_ebookview;
				e_book_client_view_start (_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:
			if (_data_->_inner_error_ != NULL) {
				_g_free0 (_data_->supported_fields);
				goto __finally10;
			}
			_data_->self->priv->_is_prepared = TRUE;
			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");
			}
			_g_free0 (_data_->supported_fields);
		}
		__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 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:
		{
			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:
		{
			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;
		}
		default:
		case E_CONTACT_UID:
		case E_CONTACT_FILE_AS:
		case E_CONTACT_BOOK_URI:
		case E_CONTACT_MAILER:
		case E_CONTACT_CALENDAR_URI:
		case E_CONTACT_ICS_CALENDAR:
		case E_CONTACT_SPOUSE:
		case E_CONTACT_REV:
		case E_CONTACT_NAME_OR_ORG:
		case E_CONTACT_LOGO:
		case E_CONTACT_NAME:
		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:971: 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_;
	const 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 (Block2Data* _data2_) {
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		_g_object_unref0 (_data2_->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 (Block3Data* _data3_) {
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		block2_data_unref (_data3_->_data2_);
		_data3_->_data2_ = NULL;
		g_slice_free (Block3Data, _data3_);
	}
}


static void ___lambda5_ (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 ____lambda5__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	___lambda5_ (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 ___lambda6_ (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 ____lambda6__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda6_ (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_->persona;
	_data_->_tmp1_ = edsf_persona_get_contact (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->contact = _data_->_tmp3_;
	_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_->_tmp4_ = _data_->persona;
		_data_->_tmp5_ = _data_->property_name;
		_data_->_tmp6_ = g_strconcat ("notify::", _data_->_tmp5_, NULL);
		_data_->_tmp7_ = 0UL;
		_data_->_tmp7_ = g_signal_connect_data ((GObject*) _data_->_tmp4_, _data_->_tmp6_, (GCallback) ____lambda5__g_object_notify, block3_data_ref (_data_->_data3_), (GClosureNotify) block3_data_unref, 0);
		_data_->signal_id = _data_->_tmp7_;
		_g_free0 (_data_->_tmp6_);
		_data_->_tmp8_ = _data_->self->priv->_addressbook;
		_data_->_tmp9_ = _data_->contact;
		_data_->_state_ = 1;
		e_book_client_modify_contact (_data_->_tmp8_, _data_->_tmp9_, NULL, _edsf_persona_store_commit_modified_property_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_modify_contact_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			goto __catch15_g_error;
		}
		_data_->_tmp10_ = 0U;
		_data_->_tmp10_ = g_timeout_add_seconds_full (G_PRIORITY_LOW, EDSF_PERSONA_STORE__property_change_timeout, ____lambda6__gsource_func, block3_data_ref (_data_->_data3_), block3_data_unref);
		_data_->timeout_id = _data_->_tmp10_;
		_data_->_tmp11_ = _data_->_data3_->received_notification;
		if (_data_->_tmp11_ == FALSE) {
			_data_->_data3_->has_yielded = TRUE;
			_data_->_state_ = 2;
			return FALSE;
			_state_2:
			;
		}
		_data_->_tmp12_ = _data_->_data3_->received_notification;
		if (_data_->_tmp12_ == FALSE) {
			_data_->_tmp13_ = NULL;
			_data_->_tmp13_ = _ ("Changing the ‘%s’ property failed due to reaching the timeout.");
			_data_->_tmp14_ = _data_->property_name;
			_data_->_tmp15_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_UNKNOWN_ERROR, _data_->_tmp13_, _data_->_tmp14_);
			_data_->_inner_error_ = _data_->_tmp15_;
			block3_data_unref (_data_->_data3_);
			_data_->_data3_ = NULL;
			goto __catch15_g_error;
		}
		block3_data_unref (_data_->_data3_);
		_data_->_data3_ = NULL;
	}
	goto __finally15;
	__catch15_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp16_ = _data_->property_name;
		_data_->_tmp17_ = _data_->e;
		_data_->_tmp18_ = NULL;
		_data_->_tmp18_ = edsf_persona_store_e_client_error_to_property_error (_data_->self, _data_->_tmp16_, _data_->_tmp17_);
		_data_->_inner_error_ = _data_->_tmp18_;
		_g_error_free0 (_data_->e);
		goto __finally15;
	}
	__finally15:
	{
		_data_->_tmp19_ = _data_->persona;
		_data_->_tmp20_ = _data_->signal_id;
		g_signal_handler_disconnect ((GObject*) _data_->_tmp19_, _data_->_tmp20_);
		_data_->_tmp21_ = _data_->timeout_id;
		g_source_remove (_data_->_tmp21_);
	}
	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_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*) _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;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = e_vcard_get_attribute ((EVCard*) _data_->_tmp0_, "X-FOLKS-WEB-SERVICES-IDS");
	_data_->attr = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->attr;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp3_ = _data_->contact;
		_data_->_tmp4_ = _data_->attr;
		e_vcard_remove_attribute ((EVCard*) _data_->_tmp3_, _data_->_tmp4_);
	}
	_data_->_tmp5_ = e_vcard_attribute_new (NULL, "X-FOLKS-WEB-SERVICES-IDS");
	_data_->attr_n = _data_->_tmp5_;
	{
		_data_->_tmp6_ = _data_->web_service_addresses;
		_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_->_service_it = _data_->_tmp10_;
		while (TRUE) {
			_data_->_tmp11_ = _data_->_service_it;
			_data_->_tmp12_ = FALSE;
			_data_->_tmp12_ = gee_iterator_next (_data_->_tmp11_);
			if (!_data_->_tmp12_) {
				break;
			}
			_data_->_tmp13_ = _data_->_service_it;
			_data_->_tmp14_ = NULL;
			_data_->_tmp14_ = gee_iterator_get (_data_->_tmp13_);
			_data_->service = (gchar*) _data_->_tmp14_;
			_data_->_tmp15_ = _data_->service;
			_data_->_tmp16_ = e_vcard_attribute_param_new (_data_->_tmp15_);
			_data_->param = _data_->_tmp16_;
			{
				_data_->_tmp17_ = _data_->web_service_addresses;
				_data_->_tmp18_ = _data_->service;
				_data_->_tmp19_ = NULL;
				_data_->_tmp19_ = gee_multi_map_get (_data_->_tmp17_, _data_->_tmp18_);
				_data_->_tmp20_ = _data_->_tmp19_;
				_data_->_tmp21_ = NULL;
				_data_->_tmp21_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp20_);
				_data_->_tmp22_ = _data_->_tmp21_;
				_g_object_unref0 (_data_->_tmp20_);
				_data_->_ws_fd_it = _data_->_tmp22_;
				while (TRUE) {
					_data_->_tmp23_ = _data_->_ws_fd_it;
					_data_->_tmp24_ = FALSE;
					_data_->_tmp24_ = gee_iterator_next (_data_->_tmp23_);
					if (!_data_->_tmp24_) {
						break;
					}
					_data_->_tmp25_ = _data_->_ws_fd_it;
					_data_->_tmp26_ = NULL;
					_data_->_tmp26_ = gee_iterator_get (_data_->_tmp25_);
					_data_->ws_fd = (FolksWebServiceFieldDetails*) _data_->_tmp26_;
					_data_->_tmp27_ = _data_->param;
					_data_->_tmp28_ = _data_->ws_fd;
					_data_->_tmp29_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp28_);
					_data_->_tmp30_ = _data_->_tmp29_;
					e_vcard_attribute_param_add_value (_data_->_tmp27_, (const gchar*) _data_->_tmp30_);
					_g_object_unref0 (_data_->ws_fd);
				}
				_g_object_unref0 (_data_->_ws_fd_it);
			}
			_data_->_tmp31_ = _data_->attr_n;
			_data_->_tmp32_ = _data_->param;
			_data_->_tmp33_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp32_);
			e_vcard_attribute_add_param (_data_->_tmp31_, _data_->_tmp33_);
			__vala_EVCardAttributeParam_free0 (_data_->param);
			_g_free0 (_data_->service);
		}
		_g_object_unref0 (_data_->_service_it);
	}
	_data_->_tmp34_ = _data_->contact;
	_data_->_tmp35_ = _data_->attr_n;
	_data_->attr_n = NULL;
	e_vcard_add_attribute ((EVCard*) _data_->_tmp34_, _data_->_tmp35_);
	__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);
									_data_->mapping_it = 0;
									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;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = e_vcard_get_attribute ((EVCard*) _data_->_tmp0_, "X-FOLKS-CONTACTS-IDS");
	_data_->attr = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->attr;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp3_ = _data_->contact;
		_data_->_tmp4_ = _data_->attr;
		e_vcard_remove_attribute ((EVCard*) _data_->_tmp3_, _data_->_tmp4_);
	}
	_data_->_tmp5_ = e_vcard_attribute_new (NULL, "X-FOLKS-CONTACTS-IDS");
	_data_->new_attr = _data_->_tmp5_;
	{
		_data_->_tmp6_ = _data_->local_ids;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp6_);
		_data_->_local_id_it = _data_->_tmp7_;
		while (TRUE) {
			_data_->_tmp8_ = _data_->_local_id_it;
			_data_->_tmp9_ = FALSE;
			_data_->_tmp9_ = gee_iterator_next (_data_->_tmp8_);
			if (!_data_->_tmp9_) {
				break;
			}
			_data_->_tmp10_ = _data_->_local_id_it;
			_data_->_tmp11_ = NULL;
			_data_->_tmp11_ = gee_iterator_get (_data_->_tmp10_);
			_data_->local_id = (gchar*) _data_->_tmp11_;
			_data_->_tmp12_ = _data_->new_attr;
			_data_->_tmp13_ = _data_->local_id;
			e_vcard_attribute_add_value (_data_->_tmp12_, _data_->_tmp13_);
			_g_free0 (_data_->local_id);
		}
		_g_object_unref0 (_data_->_local_id_it);
	}
	_data_->_tmp14_ = _data_->contact;
	_data_->_tmp15_ = _data_->new_attr;
	_data_->new_attr = NULL;
	e_vcard_add_attribute ((EVCard*) _data_->_tmp14_, _data_->_tmp15_);
	__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;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = e_vcard_get_attribute ((EVCard*) _data_->_tmp1_, "PHOTO");
		_data_->attr = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->attr;
		if (_data_->_tmp3_ != NULL) {
			_data_->_tmp4_ = _data_->contact;
			_data_->_tmp5_ = _data_->attr;
			e_vcard_remove_attribute ((EVCard*) _data_->_tmp4_, _data_->_tmp5_);
		}
	} else {
		{
			_data_->_tmp6_ = e_contact_photo_new ();
			_data_->cp = _data_->_tmp6_;
			_data_->_tmp7_ = _data_->cp;
			_data_->_tmp7_->type = E_CONTACT_PHOTO_TYPE_INLINED;
			_data_->_tmp8_ = _data_->avatar;
			_data_->_state_ = 1;
			g_loadable_icon_load_async (_data_->_tmp8_, -1, NULL, _edsf_persona_store_set_contact_avatar_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp9_ = NULL;
			_data_->_tmp9_ = g_loadable_icon_load_finish (_data_->_tmp8_, _data_->_res_, NULL, &_data_->_inner_error_);
			_data_->input_s = _data_->_tmp9_;
			if (_data_->_inner_error_ != NULL) {
				__vala_EContactPhoto_free0 (_data_->cp);
				goto __catch16_g_error;
			}
			_data_->_tmp10_ = NULL;
			_data_->_tmp10_ = g_new0 (guint8, 0);
			_data_->image_data = _data_->_tmp10_;
			_data_->image_data_length1 = 0;
			_data_->_image_data_size_ = _data_->image_data_length1;
			_data_->_tmp11_ = NULL;
			_data_->_tmp11_ = g_new0 (guint8, 4096);
			_data_->buffer = _data_->_tmp11_;
			_data_->buffer_length1 = 4096;
			_data_->_buffer_size_ = _data_->buffer_length1;
			while (TRUE) {
				_data_->_tmp12_ = _data_->input_s;
				_data_->_tmp13_ = _data_->buffer;
				_data_->_tmp13__length1 = _data_->buffer_length1;
				_data_->_state_ = 2;
				g_input_stream_read_async (_data_->_tmp12_, _data_->_tmp13_, (gsize) _data_->_tmp13__length1, G_PRIORITY_DEFAULT, NULL, _edsf_persona_store_set_contact_avatar_ready, _data_);
				return FALSE;
				_state_2:
				_data_->_tmp14_ = 0L;
				_data_->_tmp14_ = g_input_stream_read_finish (_data_->_tmp12_, _data_->_res_, &_data_->_inner_error_);
				_data_->size_read = _data_->_tmp14_;
				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 __catch16_g_error;
				}
				_data_->_tmp15_ = _data_->size_read;
				if (_data_->_tmp15_ <= ((gssize) 0)) {
					break;
				}
				_data_->_tmp16_ = _data_->image_data;
				_data_->_tmp16__length1 = _data_->image_data_length1;
				_data_->read_cur = _data_->_tmp16__length1;
				_data_->_tmp17_ = _data_->read_cur;
				_data_->_tmp18_ = _data_->size_read;
				_data_->_tmp19_ = 0;
				_data_->_tmp19_ = _data_->_tmp17_ + ((gint) _data_->_tmp18_);
				_data_->image_data = g_renew (guint8, _data_->image_data, _data_->_tmp17_ + ((gint) _data_->_tmp18_));
				(_data_->_tmp19_ > _data_->image_data_length1) ? memset (_data_->image_data + _data_->image_data_length1, 0, sizeof (guint8) * (_data_->_tmp19_ - _data_->image_data_length1)) : NULL;
				_data_->image_data_length1 = _data_->_tmp19_;
				_data_->_image_data_size_ = _data_->_tmp19_;
				_data_->_tmp20_ = _data_->image_data;
				_data_->_tmp20__length1 = _data_->image_data_length1;
				_data_->_tmp21_ = _data_->read_cur;
				_data_->_tmp22_ = _data_->buffer;
				_data_->_tmp22__length1 = _data_->buffer_length1;
				_data_->_tmp23_ = _data_->size_read;
				memcpy (&_data_->_tmp20_[_data_->_tmp21_], _data_->_tmp22_, (gsize) _data_->_tmp23_);
			}
			_data_->_tmp24_ = _data_->cp;
			_data_->_tmp25_ = _data_->image_data;
			_data_->_tmp25__length1 = _data_->image_data_length1;
			e_contact_photo_set_inlined (_data_->_tmp24_, _data_->_tmp25_, (gsize) _data_->_tmp25__length1);
			_data_->_tmp26_ = _data_->contact;
			_data_->_tmp27_ = _data_->cp;
			e_contact_set (_data_->_tmp26_, E_CONTACT_PHOTO, _data_->_tmp27_);
			_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 __finally16;
		__catch16_g_error:
		{
			_data_->e1 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			_data_->_tmp28_ = NULL;
			_data_->_tmp28_ = _ ("Can't update avatar: %s");
			_data_->_tmp29_ = _data_->e1;
			_data_->_tmp30_ = _data_->_tmp29_->message;
			_data_->_tmp31_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_INVALID_VALUE, _data_->_tmp28_, _data_->_tmp30_);
			_data_->_inner_error_ = _data_->_tmp31_;
			_g_error_free0 (_data_->e1);
			goto __finally16;
		}
		__finally16:
		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_;
	const 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_;
	const 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_;
	const 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;
	if (g_strcmp0 (_data_->_tmp3_, "") == 0) {
		_data_->full_name = NULL;
	}
	_data_->_tmp4_ = _data_->persona;
	_data_->_tmp5_ = folks_name_details_get_full_name ((FolksNameDetails*) _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->full_name;
	if (g_strcmp0 (_data_->_tmp6_, _data_->_tmp7_) == 0) {
		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_ = 0;
	_data_->_tmp11_ = e_contact_field_id ("full_name");
	_data_->_tmp12_ = _data_->full_name;
	e_contact_set (_data_->_tmp10_, _data_->_tmp11_, _data_->_tmp12_);
	_data_->_tmp13_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp13_, "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_);
			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_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_;
	const 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;
	if (g_strcmp0 (_data_->_tmp3_, "") == 0) {
		_data_->nickname = NULL;
	}
	_data_->_tmp4_ = _data_->persona;
	_data_->_tmp5_ = folks_name_details_get_nickname ((FolksNameDetails*) _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->nickname;
	if (g_strcmp0 (_data_->_tmp6_, _data_->_tmp7_) == 0) {
		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_ = 0;
	_data_->_tmp11_ = e_contact_field_id ("nickname");
	_data_->_tmp12_ = _data_->nickname;
	e_contact_set (_data_->_tmp10_, _data_->_tmp11_, _data_->_tmp12_);
	_data_->_tmp13_ = _data_->persona;
	_data_->_state_ = 1;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp13_, "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_);
			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_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 (_data_->_tmp12_, _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 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_ = e_contact_date_new ();
		__vala_EContactDate_free0 (_data_->contact_bday);
		_data_->contact_bday = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->contact_bday;
		_data_->_tmp3_ = _data_->bday;
		_data_->_tmp4_ = 0;
		_data_->_tmp4_ = g_date_time_get_year (_data_->_tmp3_);
		_data_->_tmp2_->year = (guint) _data_->_tmp4_;
		_data_->_tmp5_ = _data_->contact_bday;
		_data_->_tmp6_ = _data_->bday;
		_data_->_tmp7_ = 0;
		_data_->_tmp7_ = g_date_time_get_month (_data_->_tmp6_);
		_data_->_tmp5_->month = (guint) _data_->_tmp7_;
		_data_->_tmp8_ = _data_->contact_bday;
		_data_->_tmp9_ = _data_->bday;
		_data_->_tmp10_ = 0;
		_data_->_tmp10_ = g_date_time_get_day_of_month (_data_->_tmp9_);
		_data_->_tmp8_->day = (guint) _data_->_tmp10_;
	}
	_data_->_tmp11_ = _data_->contact;
	_data_->_tmp12_ = 0;
	_data_->_tmp12_ = e_contact_field_id ("birth_date");
	_data_->_tmp13_ = _data_->contact_bday;
	e_contact_set (_data_->_tmp11_, _data_->_tmp12_, _data_->_tmp13_);
	__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_ = edsf_set_comparator_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
	_data_->comp = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->comp;
	_data_->_tmp5_ = _data_->roles;
	_data_->_tmp6_ = _data_->persona;
	_data_->_tmp7_ = folks_role_details_get_roles ((FolksRoleDetails*) _data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = FALSE;
	_data_->_tmp9_ = edsf_set_comparator_equal (_data_->_tmp4_, _data_->_tmp5_, _data_->_tmp8_);
	if (_data_->_tmp9_) {
		_g_object_unref0 (_data_->comp);
		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_ = _data_->roles;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_roles (_data_->self, _data_->_tmp12_, _data_->_tmp13_, _edsf_persona_store_set_roles_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_roles_finish (_data_->self, _data_->_res_);
	_data_->_tmp14_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp14_, "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_);
			_g_object_unref0 (_data_->comp);
			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_->comp);
			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_->comp);
	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 (_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 (_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 (_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 (_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 (_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 (_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 (_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 (_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_->_tmp4_ = _data_->persona;
	_data_->_tmp5_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp7_ = _data_->persona;
		_data_->_tmp8_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = _data_->sname;
		_data_->_tmp11_ = FALSE;
		_data_->_tmp11_ = folks_structured_name_equal (_data_->_tmp9_, _data_->_tmp10_);
		_data_->_tmp3_ = _data_->_tmp11_;
	} else {
		_data_->_tmp3_ = FALSE;
	}
	_data_->_tmp12_ = _data_->_tmp3_;
	if (_data_->_tmp12_) {
		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_->_tmp13_ = _data_->persona;
	_data_->_tmp14_ = edsf_persona_get_contact (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = _data_->sname;
	_data_->_state_ = 1;
	_edsf_persona_store_set_contact_name (_data_->self, _data_->_tmp15_, _data_->_tmp16_, _edsf_persona_store_set_structured_name_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_contact_name_finish (_data_->self, _data_->_res_);
	_data_->_tmp17_ = _data_->persona;
	_data_->_state_ = 2;
	_edsf_persona_store_commit_modified_property (_data_->self, _data_->_tmp17_, "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_->contact_name;
		_data_->_tmp3_ = _data_->sname;
		_data_->_tmp4_ = folks_structured_name_get_family_name (_data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = g_strdup (_data_->_tmp5_);
		_g_free0 (_data_->_tmp2_->family);
		_data_->_tmp2_->family = _data_->_tmp6_;
		_data_->_tmp7_ = _data_->contact_name;
		_data_->_tmp8_ = _data_->sname;
		_data_->_tmp9_ = folks_structured_name_get_given_name (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = g_strdup (_data_->_tmp10_);
		_g_free0 (_data_->_tmp7_->given);
		_data_->_tmp7_->given = _data_->_tmp11_;
		_data_->_tmp12_ = _data_->contact_name;
		_data_->_tmp13_ = _data_->sname;
		_data_->_tmp14_ = folks_structured_name_get_additional_names (_data_->_tmp13_);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = g_strdup (_data_->_tmp15_);
		_g_free0 (_data_->_tmp12_->additional);
		_data_->_tmp12_->additional = _data_->_tmp16_;
		_data_->_tmp17_ = _data_->contact_name;
		_data_->_tmp18_ = _data_->sname;
		_data_->_tmp19_ = folks_structured_name_get_suffixes (_data_->_tmp18_);
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_tmp21_ = g_strdup (_data_->_tmp20_);
		_g_free0 (_data_->_tmp17_->suffixes);
		_data_->_tmp17_->suffixes = _data_->_tmp21_;
		_data_->_tmp22_ = _data_->contact_name;
		_data_->_tmp23_ = _data_->sname;
		_data_->_tmp24_ = folks_structured_name_get_prefixes (_data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = g_strdup (_data_->_tmp25_);
		_g_free0 (_data_->_tmp22_->prefixes);
		_data_->_tmp22_->prefixes = _data_->_tmp26_;
	}
	_data_->_tmp27_ = _data_->contact;
	_data_->_tmp28_ = 0;
	_data_->_tmp28_ = e_contact_field_id ("name");
	_data_->_tmp29_ = _data_->contact_name;
	e_contact_set (_data_->_tmp27_, _data_->_tmp28_, _data_->_tmp29_);
	__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_;
		_data_->field_id_it = NULL;
		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;
		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;
		}
	}
	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;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = e_vcard_get_attribute ((EVCard*) _data_->_tmp0_, EDSF_PERSONA_gender_attribute_name);
	_data_->attr = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->attr;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp3_ = _data_->contact;
		_data_->_tmp4_ = _data_->attr;
		e_vcard_remove_attribute ((EVCard*) _data_->_tmp3_, _data_->_tmp4_);
	}
	_data_->_tmp5_ = e_vcard_attribute_new (NULL, EDSF_PERSONA_gender_attribute_name);
	_data_->new_attr = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->gender;
	switch (_data_->_tmp6_) {
		case FOLKS_GENDER_UNSPECIFIED:
		{
			break;
		}
		case FOLKS_GENDER_MALE:
		{
			_data_->_tmp7_ = _data_->new_attr;
			e_vcard_attribute_add_value (_data_->_tmp7_, EDSF_PERSONA_gender_male);
			_data_->_tmp8_ = _data_->contact;
			_data_->_tmp9_ = _data_->new_attr;
			_data_->new_attr = NULL;
			e_vcard_add_attribute ((EVCard*) _data_->_tmp8_, _data_->_tmp9_);
			break;
		}
		case FOLKS_GENDER_FEMALE:
		{
			_data_->_tmp10_ = _data_->new_attr;
			e_vcard_attribute_add_value (_data_->_tmp10_, EDSF_PERSONA_gender_female);
			_data_->_tmp11_ = _data_->contact;
			_data_->_tmp12_ = _data_->new_attr;
			_data_->new_attr = NULL;
			e_vcard_add_attribute ((EVCard*) _data_->_tmp11_, _data_->_tmp12_);
			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* _tmp22_;
	gint _tmp23_;
	gint _tmp24_;
	gboolean _tmp26_;
	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_;
						gpointer _tmp10_ = NULL;
						EdsfPersona* persona;
						EdsfPersona* _tmp11_;
						_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_get ((GeeAbstractMap*) _tmp8_, _tmp9_);
						persona = (EdsfPersona*) _tmp10_;
						_tmp11_ = persona;
						if (_tmp11_ == NULL) {
							EContact* _tmp12_;
							EdsfPersona* _tmp13_;
							GeeHashMap* _tmp14_;
							EdsfPersona* _tmp15_;
							const gchar* _tmp16_;
							const gchar* _tmp17_;
							EdsfPersona* _tmp18_;
							GeeHashSet* _tmp19_;
							EdsfPersona* _tmp20_;
							_tmp12_ = c;
							_tmp13_ = edsf_persona_new (self, _tmp12_);
							_g_object_unref0 (persona);
							persona = _tmp13_;
							_tmp14_ = self->priv->_personas;
							_tmp15_ = persona;
							_tmp16_ = folks_persona_get_iid ((FolksPersona*) _tmp15_);
							_tmp17_ = _tmp16_;
							_tmp18_ = persona;
							gee_abstract_map_set ((GeeAbstractMap*) _tmp14_, _tmp17_, _tmp18_);
							_tmp19_ = added_personas;
							_tmp20_ = persona;
							gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, _tmp20_);
						}
						_g_object_unref0 (persona);
						_g_free0 (iid);
						_g_object_unref0 (c);
					}
				}
			}
		}
		__finally17:
		{
			GeeHashMap* _tmp21_;
			_tmp21_ = 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;
		}
	}
	_tmp22_ = added_personas;
	_tmp23_ = gee_collection_get_size ((GeeCollection*) _tmp22_);
	_tmp24_ = _tmp23_;
	if (_tmp24_ > 0) {
		GeeHashSet* _tmp25_;
		_tmp25_ = added_personas;
		_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) self, (GeeSet*) _tmp25_, NULL, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
	}
	_tmp26_ = self->priv->_is_quiescent;
	if (_tmp26_ == FALSE) {
		self->priv->_is_quiescent = TRUE;
		g_object_notify ((GObject*) self, "is-quiescent");
	}
	_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 (_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_, _tmp12_);
					_tmp13_ = self->priv->_personas;
					_tmp14_ = persona;
					_tmp15_ = folks_persona_get_iid ((FolksPersona*) _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_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 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;
}


static gboolean _edsf_persona_store_is_in_source_list (EdsfPersonaStore* self) {
	gboolean result = FALSE;
	ESourceList* _tmp0_;
	GSList* _tmp1_ = NULL;
	GSList* groups;
	GSList* _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_source_list;
	_tmp1_ = e_source_list_peek_groups (_tmp0_);
	groups = _tmp1_;
	_tmp2_ = groups;
	{
		GSList* g_collection = NULL;
		GSList* g_it = NULL;
		g_collection = _tmp2_;
		for (g_it = g_collection; g_it != NULL; g_it = g_it->next) {
			ESourceGroup* g = NULL;
			g = (ESourceGroup*) g_it->data;
			{
				ESourceGroup* _tmp3_;
				GSList* _tmp4_ = NULL;
				_tmp3_ = g;
				_tmp4_ = e_source_group_peek_sources (_tmp3_);
				{
					GSList* s_collection = NULL;
					GSList* s_it = NULL;
					s_collection = _tmp4_;
					for (s_it = s_collection; s_it != NULL; s_it = s_it->next) {
						ESource* _tmp5_;
						ESource* s = NULL;
						_tmp5_ = _g_object_ref0 ((ESource*) s_it->data);
						s = _tmp5_;
						{
							ESource* _tmp6_;
							const gchar* _tmp7_ = NULL;
							const gchar* _tmp8_;
							const gchar* _tmp9_;
							_tmp6_ = s;
							_tmp7_ = e_source_peek_uid (_tmp6_);
							_tmp8_ = folks_persona_store_get_id ((FolksPersonaStore*) self);
							_tmp9_ = _tmp8_;
							if (g_strcmp0 (_tmp7_, _tmp9_) == 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) {
	ESource* _tmp0_;
	void* _tmp1_ = NULL;
	ESourceGroup* group;
	ESourceGroup* _tmp2_;
	EBookClient* _tmp11_;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_;
	g_return_if_fail (self != NULL);
	_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;
		gboolean _tmp6_ = FALSE;
		const gchar* _tmp7_;
		gboolean _tmp10_;
		_tmp3_ = group;
		_tmp4_ = e_source_group_peek_base_uri (_tmp3_);
		_tmp5_ = g_strdup (_tmp4_);
		base_uri = _tmp5_;
		_tmp7_ = base_uri;
		if (_tmp7_ != NULL) {
			const gchar* _tmp8_;
			gboolean _tmp9_ = FALSE;
			_tmp8_ = base_uri;
			_tmp9_ = g_str_has_prefix (_tmp8_, "ldap");
			_tmp6_ = _tmp9_;
		} else {
			_tmp6_ = FALSE;
		}
		_tmp10_ = _tmp6_;
		if (_tmp10_) {
			folks_persona_store_set_trust_level ((FolksPersonaStore*) self, FOLKS_PERSONA_STORE_TRUST_PARTIAL);
			_g_free0 (base_uri);
			return;
		}
		_g_free0 (base_uri);
	}
	_tmp11_ = self->priv->_addressbook;
	g_object_get ((EClient*) _tmp11_, "readonly", &_tmp12_, NULL);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		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 __catch18_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 (_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 __finally18;
	__catch18_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);
	}
	__finally18:
	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*) _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*) _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;
	EBookClient* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar** _tmp6_;
	gint _tmp6__length1;
	self = (EdsfPersonaStore*) base;
	_tmp0_ = self->priv->_addressbook;
	g_object_get ((EClient*) _tmp0_, "readonly", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == TRUE) {
		gchar** _tmp3_;
		gint _tmp3__length1;
		gchar** _tmp4_;
		gint _tmp4__length1;
		_tmp3_ = edsf_persona_store__always_writeable_properties_empty;
		_tmp3__length1 = edsf_persona_store__always_writeable_properties_empty_length1;
		_tmp4_ = _tmp3_;
		_tmp4__length1 = _tmp3__length1;
		if (result_length1) {
			*result_length1 = _tmp4__length1;
		}
		result = _tmp4_;
		return result;
	}
	_tmp5_ = self->priv->_always_writeable_properties;
	_tmp5__length1 = self->priv->_always_writeable_properties_length1;
	_tmp6_ = _tmp5_;
	_tmp6__length1 = _tmp5__length1;
	if (result_length1) {
		*result_length1 = _tmp6__length1;
	}
	result = _tmp6_;
	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;
}


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)->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_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_TYPE_ID, "type-id");
	/**
	   * Whether this PersonaStore can add {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_add_personas}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_CAN_ADD_PERSONAS, "can-add-personas");
	/**
	   * 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_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_CAN_ALIAS_PERSONAS, "can-alias-personas");
	/**
	   * 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_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_CAN_GROUP_PERSONAS, "can-group-personas");
	/**
	   * Whether this PersonaStore can remove {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_remove_personas}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_CAN_REMOVE_PERSONAS, "can-remove-personas");
	/**
	   * Whether this PersonaStore has been prepared.
	   *
	   * See {@link Folks.PersonaStore.is_prepared}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_IS_PREPARED, "is-prepared");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.2
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES, "always-writeable-properties");
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_IS_QUIESCENT, "is-quiescent");
	/**
	   * The {@link Persona}s exposed by this PersonaStore.
	   *
	   * See {@link Folks.PersonaStore.personas}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STORE_PERSONAS, "personas");
	_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->_is_quiescent = FALSE;
	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;
}


static void edsf_persona_store_finalize (GObject* obj) {
	EdsfPersonaStore * self;
	GError * _inner_error_ = NULL;
	self = EDSF_PERSONA_STORE (obj);
	{
		EBookClientView* _tmp0_;
		EBookClient* _tmp8_;
		ESourceList* _tmp12_;
		_tmp0_ = self->priv->_ebookview;
		if (_tmp0_ != NULL) {
			EBookClientView* _tmp1_;
			guint _tmp2_ = 0U;
			EBookClientView* _tmp3_;
			guint _tmp4_ = 0U;
			EBookClientView* _tmp5_;
			guint _tmp6_ = 0U;
			EBookClientView* _tmp7_;
			_tmp1_ = self->priv->_ebookview;
			g_signal_parse_name ("objects-added", e_book_client_view_get_type (), &_tmp2_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (_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 (_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 (_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;
			e_book_client_view_stop (_tmp7_, &_inner_error_);
			if (_inner_error_ != NULL) {
				goto __catch5_g_error;
			}
			_g_object_unref0 (self->priv->_ebookview);
			self->priv->_ebookview = NULL;
		}
		_tmp8_ = self->priv->_addressbook;
		if (_tmp8_ != NULL) {
			EBookClient* _tmp9_;
			guint _tmp10_ = 0U;
			GQuark _tmp11_ = 0U;
			_tmp9_ = self->priv->_addressbook;
			g_signal_parse_name ("notify::readonly", G_TYPE_OBJECT, &_tmp10_, &_tmp11_, TRUE);
			g_signal_handlers_disconnect_matched ((GObject*) _tmp9_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp10_, _tmp11_, 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;
		}
		_tmp12_ = self->priv->_source_list;
		if (_tmp12_ != NULL) {
			ESourceList* _tmp13_;
			guint _tmp14_ = 0U;
			_tmp13_ = self->priv->_source_list;
			g_signal_parse_name ("changed", e_source_list_get_type (), &_tmp14_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (_tmp13_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp14_, 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* _tmp15_;
		const gchar* _tmp16_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp15_ = e;
		_tmp16_ = _tmp15_->message;
		g_warning ("edsf-persona-store.vala:248: ~PersonaStore: %s\n", _tmp16_);
		_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_object_unref0 (self->priv->_source);
	_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_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;
		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;
}



