/* edsf-persona-store.c generated by valac 0.13.1.106-1068, 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)))
typedef struct _EdsfPersonaStoreAddPersonaFromDetailsData EdsfPersonaStoreAddPersonaFromDetailsData;
typedef struct _EdsfPersonaStoreRemovePersonaData EdsfPersonaStoreRemovePersonaData;
typedef struct _EdsfPersonaStorePrepareData EdsfPersonaStorePrepareData;
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;
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;
#define __vala_EContactAddress_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactAddress_free (var), NULL)))
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 _EdsfPersonaStoreSetFullNameData EdsfPersonaStoreSetFullNameData;
typedef struct _EdsfPersonaStoreSetNicknameData EdsfPersonaStoreSetNicknameData;
typedef struct _EdsfPersonaStoreSetNotesData EdsfPersonaStoreSetNotesData;
typedef struct _EdsfPersonaStoreSetContactNotesData EdsfPersonaStoreSetContactNotesData;
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;
	EBookClient* _addressbook;
	EBookClientView* _ebookview;
	gchar* _addressbook_uri;
	ESource* _source;
	gchar* _query_str;
	gboolean _groups_supported;
};

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_;
	EContact* _tmp9_;
	EContactField _tmp10_;
	GValue* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	GValue* _tmp15_;
	GObject* _tmp16_;
	GeeSet* _tmp17_;
	GeeSet* email_addresses;
	EContact* _tmp18_;
	GeeSet* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	GValue* _tmp22_;
	GObject* _tmp23_;
	GLoadableIcon* _tmp24_;
	GLoadableIcon* avatar;
	EContact* _tmp25_;
	GLoadableIcon* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	GValue* _tmp29_;
	GObject* _tmp30_;
	GeeMultiMap* _tmp31_;
	GeeMultiMap* im_fds;
	EContact* _tmp32_;
	GeeMultiMap* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	GValue* _tmp36_;
	GObject* _tmp37_;
	GeeSet* _tmp38_;
	GeeSet* phone_numbers;
	EContact* _tmp39_;
	GeeSet* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	GValue* _tmp43_;
	GObject* _tmp44_;
	GeeSet* _tmp45_;
	GeeSet* postal_fds;
	EContact* _tmp46_;
	GeeSet* _tmp47_;
	const gchar* _tmp48_;
	const gchar* _tmp49_;
	GValue* _tmp50_;
	GObject* _tmp51_;
	FolksStructuredName* _tmp52_;
	FolksStructuredName* sname;
	EContact* _tmp53_;
	FolksStructuredName* _tmp54_;
	const gchar* _tmp55_;
	const gchar* _tmp56_;
	GValue* _tmp57_;
	GObject* _tmp58_;
	GeeSet* _tmp59_;
	GeeSet* local_ids;
	EContact* _tmp60_;
	GeeSet* _tmp61_;
	const gchar* _tmp62_;
	const gchar* _tmp63_;
	GValue* _tmp64_;
	GObject* _tmp65_;
	GeeHashMultiMap* _tmp66_;
	GeeHashMultiMap* web_service_addresses;
	EContact* _tmp67_;
	GeeHashMultiMap* _tmp68_;
	const gchar* _tmp69_;
	const gchar* _tmp70_;
	GValue* _tmp71_;
	GObject* _tmp72_;
	GeeHashSet* _tmp73_;
	GeeHashSet* notes;
	EContact* _tmp74_;
	GeeHashSet* _tmp75_;
	const gchar* _tmp76_;
	const gchar* _tmp77_;
	GValue* _tmp78_;
	gint _tmp79_;
	FolksGender gender;
	EContact* _tmp80_;
	FolksGender _tmp81_;
	const gchar* _tmp82_;
	const gchar* _tmp83_;
	GValue* _tmp84_;
	GObject* _tmp85_;
	GeeSet* _tmp86_;
	GeeSet* urls;
	EContact* _tmp87_;
	GeeSet* _tmp88_;
	EdsfPersona* persona;
	gchar* added_uid;
	EBookClient* _tmp89_;
	EContact* _tmp90_;
	gchar* _tmp91_;
	gboolean _tmp92_;
	gboolean _result_;
	gboolean _tmp93_;
	const gchar* _tmp94_;
	GeeHashMap* _tmp95_;
	const gchar* _tmp96_;
	const gchar* _tmp97_;
	const gchar* _tmp98_;
	gchar* _tmp99_;
	gchar* iid;
	GeeHashMap* _tmp100_;
	const gchar* _tmp101_;
	gpointer _tmp102_;
	EdsfPersona* _tmp103_;
	EContact* _tmp104_;
	EContactField _tmp105_;
	const gchar* _tmp106_;
	EContact* _tmp107_;
	EdsfPersona* _tmp108_;
	GeeHashMap* _tmp109_;
	EdsfPersona* _tmp110_;
	const gchar* _tmp111_;
	const gchar* _tmp112_;
	EdsfPersona* _tmp113_;
	GeeHashSet* _tmp114_;
	GeeHashSet* added_personas;
	GeeHashSet* _tmp115_;
	EdsfPersona* _tmp116_;
	GeeHashSet* _tmp117_;
	GeeHashMap* _tmp118_;
	GError* _tmp119_;
	GError* e;
	GError* _tmp120_;
	const gchar* _tmp121_;
	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_;
	ESource* _tmp3_;
	EBookClient* _tmp4_;
	EBookClient* _tmp5_;
	EBookClient* _tmp6_;
	EBookClient* _tmp7_;
	EBookClient* _tmp8_;
	GError* e1;
	GError* _tmp9_;
	GQuark _tmp10_;
	GQuark _tmp11_;
	GError* _tmp12_;
	gint _tmp13_;
	GError* _tmp14_;
	GQuark _tmp15_;
	GQuark _tmp16_;
	GError* _tmp17_;
	gint _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	GError* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	GError* _tmp26_;
	const gchar* _tmp27_;
	GError* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	GError* _tmp32_;
	const gchar* _tmp33_;
	GError* _tmp34_;
	EBookClient* _tmp35_;
	gboolean _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	GError* _tmp40_;
	gchar* supported_fields;
	EBookClient* _tmp41_;
	gchar* _tmp42_;
	const gchar* _tmp43_;
	const gchar* _tmp44_;
	gchar** _tmp45_;
	gchar** _tmp46_;
	gchar** fields;
	gint fields_length1;
	gint _fields_size_;
	const gchar* _tmp47_;
	gchar** _tmp48_;
	gint _tmp48__length1;
	GError* e2;
	const gchar* _tmp49_;
	GError* _tmp50_;
	const gchar* _tmp51_;
	GError* _tmp52_;
	gboolean got_view;
	EBookClient* _tmp53_;
	const gchar* _tmp54_;
	EBookClientView* _tmp55_;
	gboolean _tmp56_;
	gboolean _tmp57_;
	gboolean _tmp58_;
	gboolean _tmp59_;
	const gchar* _tmp60_;
	const gchar* _tmp61_;
	const gchar* _tmp62_;
	GError* _tmp63_;
	EBookClientView* _tmp64_;
	EBookClientView* _tmp65_;
	EBookClientView* _tmp66_;
	EBookClientView* _tmp67_;
	GError* e3;
	GError* _tmp68_;
	GQuark _tmp69_;
	GQuark _tmp70_;
	GError* _tmp71_;
	gint _tmp72_;
	GError* _tmp73_;
	GQuark _tmp74_;
	GQuark _tmp75_;
	GError* _tmp76_;
	gint _tmp77_;
	const gchar* _tmp78_;
	const gchar* _tmp79_;
	const gchar* _tmp80_;
	GError* _tmp81_;
	const gchar* _tmp82_;
	const gchar* _tmp83_;
	const gchar* _tmp84_;
	GError* _tmp85_;
	const gchar* _tmp86_;
	GError* _tmp87_;
	const gchar* _tmp88_;
	const gchar* _tmp89_;
	const gchar* _tmp90_;
	GError* _tmp91_;
	const gchar* _tmp92_;
	GError* _tmp93_;
	gboolean _tmp94_;
	GError * _inner_error_;
};

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

struct _EdsfPersonaStoreSetWebServiceAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeMultiMap* web_service_addresses;
	EdsfPersona* _tmp0_;
	GeeMultiMap* _tmp1_;
	GeeMultiMap* _tmp2_;
	GeeMultiMap* _tmp3_;
	gboolean _tmp4_;
	EdsfPersona* _tmp5_;
	EContact* _tmp6_;
	EContact* _tmp7_;
	EContact* _tmp8_;
	EContact* contact;
	EContact* _tmp9_;
	GeeMultiMap* _tmp10_;
	EBookClient* _tmp11_;
	EContact* _tmp12_;
	GError* e;
	GError* _tmp13_;
	const gchar* _tmp14_;
	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* _tmp2_;
	EVCardAttribute* attr;
	EVCardAttribute* _tmp3_;
	EContact* _tmp4_;
	EVCardAttribute* _tmp5_;
	EVCardAttribute* _tmp6_;
	EVCardAttribute* attr_n;
	GeeMultiMap* _tmp7_;
	GeeSet* _tmp8_;
	GeeSet* _tmp9_;
	GeeIterator* _tmp10_;
	GeeIterator* _tmp11_;
	GeeIterator* _service_it;
	GeeIterator* _tmp12_;
	gboolean _tmp13_;
	GeeIterator* _tmp14_;
	gpointer _tmp15_;
	gchar* service;
	const gchar* _tmp16_;
	EVCardAttributeParam* _tmp17_;
	EVCardAttributeParam* param;
	GeeMultiMap* _tmp18_;
	const gchar* _tmp19_;
	GeeCollection* _tmp20_;
	GeeCollection* _tmp21_;
	GeeIterator* _tmp22_;
	GeeIterator* _tmp23_;
	GeeIterator* _ws_fd_it;
	GeeIterator* _tmp24_;
	gboolean _tmp25_;
	GeeIterator* _tmp26_;
	gpointer _tmp27_;
	FolksWebServiceFieldDetails* ws_fd;
	EVCardAttributeParam* _tmp28_;
	FolksWebServiceFieldDetails* _tmp29_;
	gconstpointer _tmp30_;
	const gchar* _tmp31_;
	EVCardAttribute* _tmp32_;
	EVCardAttributeParam* _tmp33_;
	EVCardAttributeParam* _tmp34_;
	EContact* _tmp35_;
	EVCardAttribute* _tmp36_;
	EVCardAttribute* _tmp37_;
};

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

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 homepage;
	gboolean blog;
	gboolean fburl;
	gboolean video;
	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_;
	const gchar* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	EVCardAttributeParam* _tmp47_;
	const gchar* _tmp48_;
	EVCardAttribute* _tmp49_;
	EVCardAttributeParam* _tmp50_;
	EVCardAttributeParam* _tmp51_;
	gboolean _tmp52_;
	EContact* _tmp53_;
	EContactField _tmp54_;
	FolksUrlFieldDetails* _tmp55_;
	gconstpointer _tmp56_;
	const gchar* _tmp57_;
	gboolean _tmp58_;
	EContact* _tmp59_;
	EContactField _tmp60_;
	FolksUrlFieldDetails* _tmp61_;
	gconstpointer _tmp62_;
	const gchar* _tmp63_;
	gboolean _tmp64_;
	EContact* _tmp65_;
	EContactField _tmp66_;
	FolksUrlFieldDetails* _tmp67_;
	gconstpointer _tmp68_;
	const gchar* _tmp69_;
	gboolean _tmp70_;
	EContact* _tmp71_;
	EContactField _tmp72_;
	FolksUrlFieldDetails* _tmp73_;
	gconstpointer _tmp74_;
	const gchar* _tmp75_;
	EContact* _tmp76_;
	EVCardAttribute* _tmp77_;
	EVCardAttribute* _tmp78_;
};

struct _EdsfPersonaStoreSetLocalIdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* local_ids;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* contact;
	EContact* _tmp4_;
	GeeSet* _tmp5_;
	EBookClient* _tmp6_;
	EContact* _tmp7_;
	GError* e;
	GError* _tmp8_;
	const gchar* _tmp9_;
	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* _tmp2_;
	EVCardAttribute* attr;
	EVCardAttribute* _tmp3_;
	EContact* _tmp4_;
	EVCardAttribute* _tmp5_;
	EVCardAttribute* _tmp6_;
	GeeSet* _tmp7_;
	GeeIterator* _tmp8_;
	GeeIterator* _local_id_it;
	GeeIterator* _tmp9_;
	gboolean _tmp10_;
	GeeIterator* _tmp11_;
	gpointer _tmp12_;
	gchar* local_id;
	EVCardAttribute* _tmp13_;
	const gchar* _tmp14_;
	EContact* _tmp15_;
	EVCardAttribute* _tmp16_;
	EVCardAttribute* _tmp17_;
};

struct _EdsfPersonaStoreSetContactAvatarData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GLoadableIcon* avatar;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	EContact* _tmp2_;
	void* _tmp3_;
	gchar* _tmp4_;
	gchar* uid;
	FolksAvatarCache* _tmp5_;
	FolksAvatarCache* cache;
	GLoadableIcon* _tmp6_;
	FolksAvatarCache* _tmp7_;
	const gchar* _tmp8_;
	GLoadableIcon* _tmp9_;
	gchar* _tmp10_;
	gchar* uri;
	EContactPhoto* _tmp11_;
	EContactPhoto* cp;
	EContactPhoto* _tmp12_;
	EContactPhoto* _tmp13_;
	const gchar* _tmp14_;
	EContact* _tmp15_;
	EContactPhoto* _tmp16_;
	GError* e1;
	const gchar* _tmp17_;
	GError* _tmp18_;
	const gchar* _tmp19_;
	FolksAvatarCache* _tmp20_;
	const gchar* _tmp21_;
	GError* e2;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetEmailsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* emails;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* contact;
	EContact* _tmp4_;
	GeeSet* _tmp5_;
	EBookClient* _tmp6_;
	EContact* _tmp7_;
	GError* _error_;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetPhonesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* phones;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* contact;
	EContact* _tmp4_;
	GeeSet* _tmp5_;
	EBookClient* _tmp6_;
	EContact* _tmp7_;
	GError* _error_;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetPostalAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* postal_fds;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* contact;
	EContact* _tmp4_;
	GeeSet* _tmp5_;
	EBookClient* _tmp6_;
	EContact* _tmp7_;
	GError* _error_;
	GError* _tmp8_;
	const gchar* _tmp9_;
	GError * _inner_error_;
};

struct _EdsfPersonaStoreSetContactPostalAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* postal_fds;
	GeeSet* _tmp0_;
	GeeIterator* _tmp1_;
	GeeIterator* _fd_it;
	GeeIterator* _tmp2_;
	gboolean _tmp3_;
	GeeIterator* _tmp4_;
	gpointer _tmp5_;
	FolksPostalAddressFieldDetails* fd;
	gboolean _tmp6_;
	FolksPostalAddressFieldDetails* _tmp7_;
	FolksPostalAddressFieldDetails* _tmp8_;
	gconstpointer _tmp9_;
	FolksPostalAddress* _tmp10_;
	gboolean _tmp11_;
	EContactAddress* _tmp12_;
	EContactAddress* address;
	EContactAddress* _tmp13_;
	FolksPostalAddressFieldDetails* _tmp14_;
	gconstpointer _tmp15_;
	FolksPostalAddress* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	EContactAddress* _tmp20_;
	FolksPostalAddressFieldDetails* _tmp21_;
	gconstpointer _tmp22_;
	FolksPostalAddress* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	EContactAddress* _tmp27_;
	FolksPostalAddressFieldDetails* _tmp28_;
	gconstpointer _tmp29_;
	FolksPostalAddress* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	EContactAddress* _tmp34_;
	FolksPostalAddressFieldDetails* _tmp35_;
	gconstpointer _tmp36_;
	FolksPostalAddress* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	gchar* _tmp40_;
	EContactAddress* _tmp41_;
	FolksPostalAddressFieldDetails* _tmp42_;
	gconstpointer _tmp43_;
	FolksPostalAddress* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	gchar* _tmp47_;
	EContactAddress* _tmp48_;
	FolksPostalAddressFieldDetails* _tmp49_;
	gconstpointer _tmp50_;
	FolksPostalAddress* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	gchar* _tmp54_;
	EContactAddress* _tmp55_;
	FolksPostalAddressFieldDetails* _tmp56_;
	gconstpointer _tmp57_;
	FolksPostalAddress* _tmp58_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	gchar* _tmp61_;
	EContactAddress* _tmp62_;
	FolksPostalAddressFieldDetails* _tmp63_;
	gconstpointer _tmp64_;
	FolksPostalAddress* _tmp65_;
	const gchar* _tmp66_;
	const gchar* _tmp67_;
	gchar* _tmp68_;
	FolksPostalAddressFieldDetails* _tmp69_;
	GeeMultiMap* _tmp70_;
	GeeMultiMap* _tmp71_;
	GeeCollection* _tmp72_;
	GeeCollection* types;
	GeeCollection* _tmp73_;
	gint _tmp74_;
	gint _tmp75_;
	GeeCollection* _tmp76_;
	gint _tmp77_;
	gpointer* _tmp78_;
	gchar** _tmp79_;
	gint _tmp79__length1;
	const gchar* _tmp80_;
	gchar* _tmp81_;
	gchar* _tmp82_;
	gchar* type;
	EContact* _tmp83_;
	const gchar* _tmp84_;
	EContactField _tmp85_;
	EContactAddress* _tmp86_;
	EContact* _tmp87_;
	EContactAddress* _tmp88_;
};

struct _EdsfPersonaStoreSetContactAttributesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EContact* contact;
	GeeSet* new_attributes;
	gchar* attrib_name;
	EContactField field_id;
	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;
	EVCardAttribute* _tmp8_;
	FolksAbstractFieldDetails* _tmp9_;
	gconstpointer _tmp10_;
	const gchar* _tmp11_;
	FolksAbstractFieldDetails* _tmp12_;
	GeeMultiMap* _tmp13_;
	GeeMultiMap* _tmp14_;
	GeeSet* _tmp15_;
	GeeSet* _tmp16_;
	GeeIterator* _tmp17_;
	GeeIterator* _tmp18_;
	GeeIterator* _param_name_it;
	GeeIterator* _tmp19_;
	gboolean _tmp20_;
	GeeIterator* _tmp21_;
	gpointer _tmp22_;
	gchar* param_name;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	EVCardAttributeParam* _tmp26_;
	EVCardAttributeParam* _tmp27_;
	EVCardAttributeParam* param;
	FolksAbstractFieldDetails* _tmp28_;
	GeeMultiMap* _tmp29_;
	GeeMultiMap* _tmp30_;
	const gchar* _tmp31_;
	GeeCollection* _tmp32_;
	GeeCollection* _tmp33_;
	GeeIterator* _tmp34_;
	GeeIterator* _tmp35_;
	GeeIterator* _param_val_it;
	GeeIterator* _tmp36_;
	gboolean _tmp37_;
	GeeIterator* _tmp38_;
	gpointer _tmp39_;
	gchar* param_val;
	EVCardAttributeParam* _tmp40_;
	const gchar* _tmp41_;
	EVCardAttribute* _tmp42_;
	EVCardAttributeParam* _tmp43_;
	EVCardAttributeParam* _tmp44_;
	EVCardAttribute* _tmp45_;
	EVCardAttribute* _tmp46_;
	EContact* _tmp47_;
	EContactField _tmp48_;
	GList* _tmp49_;
};

struct _EdsfPersonaStoreSetFullNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	gchar* full_name;
	EdsfPersona* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	EdsfPersona* _tmp4_;
	EContact* _tmp5_;
	EContact* _tmp6_;
	EContact* _tmp7_;
	EContact* contact;
	EContact* _tmp8_;
	EContactField _tmp9_;
	const gchar* _tmp10_;
	EBookClient* _tmp11_;
	EContact* _tmp12_;
	GError* _error_;
	GError* _tmp13_;
	const gchar* _tmp14_;
	GError * _inner_error_;
};

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

struct _EdsfPersonaStoreSetNotesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* notes;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* contact;
	EContact* _tmp4_;
	GeeSet* _tmp5_;
	EBookClient* _tmp6_;
	EContact* _tmp7_;
	GError* _error_;
	GError* _tmp8_;
	const gchar* _tmp9_;
	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 _EdsfPersonaStoreSetStructuredNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	FolksStructuredName* sname;
	gboolean _tmp0_;
	EdsfPersona* _tmp1_;
	FolksStructuredName* _tmp2_;
	FolksStructuredName* _tmp3_;
	EdsfPersona* _tmp4_;
	FolksStructuredName* _tmp5_;
	FolksStructuredName* _tmp6_;
	FolksStructuredName* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	EdsfPersona* _tmp10_;
	EContact* _tmp11_;
	EContact* _tmp12_;
	EContact* _tmp13_;
	EContact* contact;
	EContact* _tmp14_;
	FolksStructuredName* _tmp15_;
	EBookClient* _tmp16_;
	EContact* _tmp17_;
	GError* _error_;
	GError* _tmp18_;
	const gchar* _tmp19_;
	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;
	EdsfPersona* _tmp0_;
	GeeMultiMap* _tmp1_;
	GeeMultiMap* _tmp2_;
	GeeMultiMap* _tmp3_;
	gboolean _tmp4_;
	EdsfPersona* _tmp5_;
	EContact* _tmp6_;
	EContact* _tmp7_;
	EContact* _tmp8_;
	EContact* contact;
	EContact* _tmp9_;
	GeeMultiMap* _tmp10_;
	EBookClient* _tmp11_;
	EContact* _tmp12_;
	GError* _error_;
	GError* _tmp13_;
	const gchar* _tmp14_;
	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_;
	GList* _tmp5_;
	GList* attrs;
	GList* _tmp6_;
	GList* attr_collection;
	GList* attr_it;
	EVCardAttribute* _tmp7_;
	EVCardAttribute* attr;
	EContact* _tmp8_;
	EVCardAttribute* _tmp9_;
	GeeMultiMap* _tmp10_;
	GeeSet* _tmp11_;
	GeeSet* _tmp12_;
	GeeIterator* _tmp13_;
	GeeIterator* _tmp14_;
	GeeIterator* _proto_it;
	GeeIterator* _tmp15_;
	gboolean _tmp16_;
	GeeIterator* _tmp17_;
	gpointer _tmp18_;
	gchar* proto;
	GList* attributes;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* attrib_name;
	gboolean added;
	GeeMultiMap* _tmp24_;
	const gchar* _tmp25_;
	GeeCollection* _tmp26_;
	GeeCollection* _tmp27_;
	GeeIterator* _tmp28_;
	GeeIterator* _tmp29_;
	GeeIterator* _im_fd_it;
	GeeIterator* _tmp30_;
	gboolean _tmp31_;
	GeeIterator* _tmp32_;
	gpointer _tmp33_;
	FolksImFieldDetails* im_fd;
	const gchar* _tmp34_;
	EVCardAttribute* _tmp35_;
	EVCardAttribute* attr_n;
	EVCardAttribute* _tmp36_;
	FolksImFieldDetails* _tmp37_;
	gconstpointer _tmp38_;
	const gchar* _tmp39_;
	EVCardAttribute* _tmp40_;
	EVCardAttribute* _tmp41_;
	gboolean _tmp42_;
	GHashTable* _tmp43_;
	const gchar* _tmp44_;
	gconstpointer _tmp45_;
	EContactField field_id_t;
	EContact* _tmp46_;
	EContactField _tmp47_;
	GList* _tmp48_;
};

struct _EdsfPersonaStoreSetGroupsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersonaStore* self;
	EdsfPersona* persona;
	GeeSet* groups;
	gboolean _tmp0_;
	EdsfPersona* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* _tmp4_;
	EContact* contact;
	EContact* _tmp5_;
	GeeSet* _tmp6_;
	EBookClient* _tmp7_;
	EContact* _tmp8_;
	GError* _error_;
	GError* _tmp9_;
	const gchar* _tmp10_;
	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;
	EdsfPersona* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EContact* _tmp3_;
	EContact* contact;
	EContact* _tmp4_;
	FolksGender _tmp5_;
	EBookClient* _tmp6_;
	EContact* _tmp7_;
	GError* e;
	GError* _tmp8_;
	const gchar* _tmp9_;
	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* _tmp2_;
	EVCardAttribute* attr;
	EVCardAttribute* _tmp3_;
	EContact* _tmp4_;
	EVCardAttribute* _tmp5_;
	FolksGender _tmp6_;
	EVCardAttribute* _tmp7_;
	EVCardAttribute* _tmp8_;
	EContact* _tmp9_;
	EVCardAttribute* _tmp10_;
	EVCardAttribute* _tmp11_;
	EVCardAttribute* _tmp12_;
	EVCardAttribute* _tmp13_;
	EContact* _tmp14_;
	EVCardAttribute* _tmp15_;
	EVCardAttribute* _tmp16_;
};


static gpointer edsf_persona_store_parent_class = NULL;

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_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* objects, 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* uids, 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* objects, 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);
EdsfPersonaStore* edsf_persona_store_new (ESource* s);
EdsfPersonaStore* edsf_persona_store_construct (GType object_type, ESource* s);
static void edsf_persona_store_real_add_persona_from_details_data_free (gpointer _data);
static void edsf_persona_store_real_add_persona_from_details (FolksPersonaStore* base, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_store_real_add_persona_from_details_co (EdsfPersonaStoreAddPersonaFromDetailsData* _data_);
static GValue* _g_value_dup (GValue* self);
static void _edsf_persona_store_set_contact_attributes (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_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_);
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 _vala_GValue_free (GValue* self);
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 gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
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_);
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_);
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 EVCardAttribute* _vala_EVCardAttribute_copy (EVCardAttribute* self);
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_);
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 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_);
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_);
void* _edsf_persona_get_property_from_contact (EContact* contact, const gchar* prop_name);
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_);
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_);
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_);
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 _vala_EContactAddress_free (EContactAddress* self);
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_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_);
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_);
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_);
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_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_);
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_);
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_);
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_);
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 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);


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


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


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


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_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);
	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;
}


EdsfPersonaStore* edsf_persona_store_construct (GType object_type, ESource* s) {
	EdsfPersonaStore * self = NULL;
	ESource* _tmp0_;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* uri;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	ESource* _tmp5_;
	ESource* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	GeeHashMap* _tmp9_;
	GeeHashMap* _tmp10_;
	GeeMap* _tmp11_;
	GeeMap* _tmp12_;
	gchar* _tmp13_;
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = s;
	_tmp1_ = e_source_peek_relative_uri (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	uri = _tmp2_;
	_tmp3_ = uri;
	_tmp4_ = uri;
	self = (EdsfPersonaStore*) g_object_new (object_type, "id", _tmp3_, "display-name", _tmp4_, NULL);
	_tmp5_ = s;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	_g_object_unref0 (self->priv->_source);
	self->priv->_source = _tmp6_;
	_tmp7_ = uri;
	_tmp8_ = g_strdup (_tmp7_);
	_g_free0 (self->priv->_addressbook_uri);
	self->priv->_addressbook_uri = _tmp8_;
	_tmp9_ = 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 = _tmp9_;
	_tmp10_ = self->priv->_personas;
	_tmp11_ = gee_abstract_map_get_read_only_view ((GeeAbstractMap*) _tmp10_);
	_tmp12_ = _tmp11_;
	_g_object_unref0 (self->priv->_personas_ro);
	self->priv->_personas_ro = _tmp12_;
	_tmp13_ = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
	_g_free0 (self->priv->_query_str);
	self->priv->_query_str = _tmp13_;
	_g_free0 (uri);
	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.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.STRUCTURED_NAME)
   * - PersonaStore.detail_key (PersonaDetail.LOCAL_IDS)
   * - PersonaDetail.detail_key (PersonaDetail.WEB_SERVICE_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.NOTES)
   * - PersonaStore.detail_key (PersonaDetail.URL)
   *
   * 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 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;
		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_->contact;
					_data_->_tmp10_ = 0;
					_data_->_tmp10_ = e_contact_field_id ("full_name");
					_data_->_tmp11_ = _data_->v;
					_data_->_tmp12_ = NULL;
					_data_->_tmp12_ = g_value_get_string (_data_->_tmp11_);
					e_contact_set (_data_->_tmp9_, _data_->_tmp10_, _data_->_tmp12_);
				} else {
					_data_->_tmp13_ = _data_->k;
					_data_->_tmp14_ = NULL;
					_data_->_tmp14_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_EMAIL_ADDRESSES);
					if (g_strcmp0 (_data_->_tmp13_, _data_->_tmp14_) == 0) {
						_data_->_tmp15_ = _data_->v;
						_data_->_tmp16_ = NULL;
						_data_->_tmp16_ = g_value_get_object (_data_->_tmp15_);
						_data_->_tmp17_ = _g_object_ref0 (GEE_SET (_data_->_tmp16_));
						_data_->email_addresses = _data_->_tmp17_;
						_data_->_tmp18_ = _data_->contact;
						_data_->_tmp19_ = _data_->email_addresses;
						_data_->_state_ = 1;
						_edsf_persona_store_set_contact_attributes (_data_->self, _data_->_tmp18_, _data_->_tmp19_, "EMAIL", E_CONTACT_EMAIL, edsf_persona_store_add_persona_from_details_ready, _data_);
						return FALSE;
						_state_1:
						_edsf_persona_store_set_contact_attributes_finish (_data_->self, _data_->_res_);
						_g_object_unref0 (_data_->email_addresses);
					} else {
						_data_->_tmp20_ = _data_->k;
						_data_->_tmp21_ = NULL;
						_data_->_tmp21_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_AVATAR);
						if (g_strcmp0 (_data_->_tmp20_, _data_->_tmp21_) == 0) {
							_data_->_tmp22_ = _data_->v;
							_data_->_tmp23_ = NULL;
							_data_->_tmp23_ = g_value_get_object (_data_->_tmp22_);
							_data_->_tmp24_ = _g_object_ref0 (G_LOADABLE_ICON (_data_->_tmp23_));
							_data_->avatar = _data_->_tmp24_;
							_data_->_tmp25_ = _data_->contact;
							_data_->_tmp26_ = _data_->avatar;
							_data_->_state_ = 2;
							_edsf_persona_store_set_contact_avatar (_data_->self, _data_->_tmp25_, _data_->_tmp26_, edsf_persona_store_add_persona_from_details_ready, _data_);
							return FALSE;
							_state_2:
							_edsf_persona_store_set_contact_avatar_finish (_data_->self, _data_->_res_);
							_g_object_unref0 (_data_->avatar);
						} else {
							_data_->_tmp27_ = _data_->k;
							_data_->_tmp28_ = NULL;
							_data_->_tmp28_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IM_ADDRESSES);
							if (g_strcmp0 (_data_->_tmp27_, _data_->_tmp28_) == 0) {
								_data_->_tmp29_ = _data_->v;
								_data_->_tmp30_ = NULL;
								_data_->_tmp30_ = g_value_get_object (_data_->_tmp29_);
								_data_->_tmp31_ = _g_object_ref0 (GEE_MULTI_MAP (_data_->_tmp30_));
								_data_->im_fds = _data_->_tmp31_;
								_data_->_tmp32_ = _data_->contact;
								_data_->_tmp33_ = _data_->im_fds;
								_data_->_state_ = 3;
								_edsf_persona_store_set_contact_im_fds (_data_->self, _data_->_tmp32_, _data_->_tmp33_, 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_->_tmp34_ = _data_->k;
								_data_->_tmp35_ = NULL;
								_data_->_tmp35_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_PHONE_NUMBERS);
								if (g_strcmp0 (_data_->_tmp34_, _data_->_tmp35_) == 0) {
									_data_->_tmp36_ = _data_->v;
									_data_->_tmp37_ = NULL;
									_data_->_tmp37_ = g_value_get_object (_data_->_tmp36_);
									_data_->_tmp38_ = _g_object_ref0 (GEE_SET (_data_->_tmp37_));
									_data_->phone_numbers = _data_->_tmp38_;
									_data_->_tmp39_ = _data_->contact;
									_data_->_tmp40_ = _data_->phone_numbers;
									_data_->_state_ = 4;
									_edsf_persona_store_set_contact_attributes (_data_->self, _data_->_tmp39_, _data_->_tmp40_, "TEL", E_CONTACT_TEL, edsf_persona_store_add_persona_from_details_ready, _data_);
									return FALSE;
									_state_4:
									_edsf_persona_store_set_contact_attributes_finish (_data_->self, _data_->_res_);
									_g_object_unref0 (_data_->phone_numbers);
								} else {
									_data_->_tmp41_ = _data_->k;
									_data_->_tmp42_ = NULL;
									_data_->_tmp42_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_POSTAL_ADDRESSES);
									if (g_strcmp0 (_data_->_tmp41_, _data_->_tmp42_) == 0) {
										_data_->_tmp43_ = _data_->v;
										_data_->_tmp44_ = NULL;
										_data_->_tmp44_ = g_value_get_object (_data_->_tmp43_);
										_data_->_tmp45_ = _g_object_ref0 (GEE_SET (_data_->_tmp44_));
										_data_->postal_fds = _data_->_tmp45_;
										_data_->_tmp46_ = _data_->contact;
										_data_->_tmp47_ = _data_->postal_fds;
										_data_->_state_ = 5;
										_edsf_persona_store_set_contact_postal_addresses (_data_->self, _data_->_tmp46_, _data_->_tmp47_, 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_->_tmp48_ = _data_->k;
										_data_->_tmp49_ = NULL;
										_data_->_tmp49_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_STRUCTURED_NAME);
										if (g_strcmp0 (_data_->_tmp48_, _data_->_tmp49_) == 0) {
											_data_->_tmp50_ = _data_->v;
											_data_->_tmp51_ = NULL;
											_data_->_tmp51_ = g_value_get_object (_data_->_tmp50_);
											_data_->_tmp52_ = _g_object_ref0 (FOLKS_STRUCTURED_NAME (_data_->_tmp51_));
											_data_->sname = _data_->_tmp52_;
											_data_->_tmp53_ = _data_->contact;
											_data_->_tmp54_ = _data_->sname;
											_data_->_state_ = 6;
											_edsf_persona_store_set_contact_name (_data_->self, _data_->_tmp53_, _data_->_tmp54_, 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_->_tmp55_ = _data_->k;
											_data_->_tmp56_ = NULL;
											_data_->_tmp56_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_LOCAL_IDS);
											if (g_strcmp0 (_data_->_tmp55_, _data_->_tmp56_) == 0) {
												_data_->_tmp57_ = _data_->v;
												_data_->_tmp58_ = NULL;
												_data_->_tmp58_ = g_value_get_object (_data_->_tmp57_);
												_data_->_tmp59_ = _g_object_ref0 (GEE_SET (_data_->_tmp58_));
												_data_->local_ids = _data_->_tmp59_;
												_data_->_tmp60_ = _data_->contact;
												_data_->_tmp61_ = _data_->local_ids;
												_data_->_state_ = 7;
												_edsf_persona_store_set_contact_local_ids (_data_->self, _data_->_tmp60_, _data_->_tmp61_, 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_->_tmp62_ = _data_->k;
												_data_->_tmp63_ = NULL;
												_data_->_tmp63_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_WEB_SERVICE_ADDRESSES);
												if (g_strcmp0 (_data_->_tmp62_, _data_->_tmp63_) == 0) {
													_data_->_tmp64_ = _data_->v;
													_data_->_tmp65_ = NULL;
													_data_->_tmp65_ = g_value_get_object (_data_->_tmp64_);
													_data_->_tmp66_ = _g_object_ref0 (GEE_HASH_MULTI_MAP (_data_->_tmp65_));
													_data_->web_service_addresses = _data_->_tmp66_;
													_data_->_tmp67_ = _data_->contact;
													_data_->_tmp68_ = _data_->web_service_addresses;
													_data_->_state_ = 8;
													_edsf_persona_store_set_contact_web_service_addresses (_data_->self, _data_->_tmp67_, (GeeMultiMap*) _data_->_tmp68_, 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_->_tmp69_ = _data_->k;
													_data_->_tmp70_ = NULL;
													_data_->_tmp70_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_NOTES);
													if (g_strcmp0 (_data_->_tmp69_, _data_->_tmp70_) == 0) {
														_data_->_tmp71_ = _data_->v;
														_data_->_tmp72_ = NULL;
														_data_->_tmp72_ = g_value_get_object (_data_->_tmp71_);
														_data_->_tmp73_ = _g_object_ref0 (GEE_HASH_SET (_data_->_tmp72_));
														_data_->notes = _data_->_tmp73_;
														_data_->_tmp74_ = _data_->contact;
														_data_->_tmp75_ = _data_->notes;
														_data_->_state_ = 9;
														_edsf_persona_store_set_contact_notes (_data_->self, _data_->_tmp74_, (GeeSet*) _data_->_tmp75_, edsf_persona_store_add_persona_from_details_ready, _data_);
														return FALSE;
														_state_9:
														_edsf_persona_store_set_contact_notes_finish (_data_->self, _data_->_res_);
														_g_object_unref0 (_data_->notes);
													} else {
														_data_->_tmp76_ = _data_->k;
														_data_->_tmp77_ = NULL;
														_data_->_tmp77_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_GENDER);
														if (g_strcmp0 (_data_->_tmp76_, _data_->_tmp77_) == 0) {
															_data_->_tmp78_ = _data_->v;
															_data_->_tmp79_ = 0;
															_data_->_tmp79_ = g_value_get_enum (_data_->_tmp78_);
															_data_->gender = (FolksGender) _data_->_tmp79_;
															_data_->_tmp80_ = _data_->contact;
															_data_->_tmp81_ = _data_->gender;
															_data_->_state_ = 10;
															_edsf_persona_store_set_contact_gender (_data_->self, _data_->_tmp80_, _data_->_tmp81_, 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_->_tmp82_ = _data_->k;
															_data_->_tmp83_ = NULL;
															_data_->_tmp83_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_URLS);
															if (g_strcmp0 (_data_->_tmp82_, _data_->_tmp83_) == 0) {
																_data_->_tmp84_ = _data_->v;
																_data_->_tmp85_ = NULL;
																_data_->_tmp85_ = g_value_get_object (_data_->_tmp84_);
																_data_->_tmp86_ = _g_object_ref0 (GEE_SET (_data_->_tmp85_));
																_data_->urls = _data_->_tmp86_;
																_data_->_tmp87_ = _data_->contact;
																_data_->_tmp88_ = _data_->urls;
																_data_->_state_ = 11;
																_edsf_persona_store_set_contact_urls (_data_->self, _data_->_tmp87_, _data_->_tmp88_, 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);
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
				__vala_GValue_free0 (_data_->v);
			}
		}
		_g_list_free0 (_data_->k_collection);
	}
	_data_->persona = NULL;
	{
		_data_->_tmp89_ = _data_->self->priv->_addressbook;
		_data_->_tmp90_ = _data_->contact;
		_data_->_tmp91_ = NULL;
		_data_->_state_ = 12;
		e_book_client_add_contact (_data_->_tmp89_, _data_->_tmp90_, NULL, edsf_persona_store_add_persona_from_details_ready, _data_);
		return FALSE;
		_state_12:
		_data_->_tmp92_ = FALSE;
		_data_->_tmp92_ = e_book_client_add_contact_finish (_data_->_tmp89_, _data_->_res_, &_data_->_tmp91_, &_data_->_inner_error_);
		_g_free0 (_data_->added_uid);
		_data_->added_uid = _data_->_tmp91_;
		_data_->_result_ = _data_->_tmp92_;
		if (_data_->_inner_error_ != NULL) {
			_g_free0 (_data_->added_uid);
			goto __catch5_g_error;
		}
		_data_->_tmp93_ = _data_->_result_;
		if (_data_->_tmp93_) {
			_data_->_tmp94_ = _data_->added_uid;
			g_debug ("edsf-persona-store.vala:320: Created contact with uid: %s\n", _data_->_tmp94_);
			{
				_data_->_tmp95_ = _data_->self->priv->_personas;
				g_static_rec_mutex_lock (&_data_->self->priv->__lock__personas);
				{
					_data_->_tmp96_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
					_data_->_tmp97_ = _data_->_tmp96_;
					_data_->_tmp98_ = _data_->added_uid;
					_data_->_tmp99_ = NULL;
					_data_->_tmp99_ = edsf_persona_build_iid (_data_->_tmp97_, _data_->_tmp98_);
					_data_->iid = _data_->_tmp99_;
					_data_->_tmp100_ = _data_->self->priv->_personas;
					_data_->_tmp101_ = _data_->iid;
					_data_->_tmp102_ = NULL;
					_data_->_tmp102_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp100_, _data_->_tmp101_);
					_g_object_unref0 (_data_->persona);
					_data_->persona = (EdsfPersona*) _data_->_tmp102_;
					_data_->_tmp103_ = _data_->persona;
					if (_data_->_tmp103_ == NULL) {
						_data_->_tmp104_ = _data_->contact;
						_data_->_tmp105_ = 0;
						_data_->_tmp105_ = e_contact_field_id ("id");
						_data_->_tmp106_ = _data_->added_uid;
						e_contact_set (_data_->_tmp104_, _data_->_tmp105_, _data_->_tmp106_);
						_data_->_tmp107_ = _data_->contact;
						_data_->_tmp108_ = edsf_persona_new (_data_->self, _data_->_tmp107_);
						_g_object_unref0 (_data_->persona);
						_data_->persona = _data_->_tmp108_;
						_data_->_tmp109_ = _data_->self->priv->_personas;
						_data_->_tmp110_ = _data_->persona;
						_data_->_tmp111_ = folks_persona_get_iid ((FolksPersona*) _data_->_tmp110_);
						_data_->_tmp112_ = _data_->_tmp111_;
						_data_->_tmp113_ = _data_->persona;
						gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp109_, _data_->_tmp112_, _data_->_tmp113_);
						_data_->_tmp114_ = gee_hash_set_new (EDSF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
						_data_->added_personas = _data_->_tmp114_;
						_data_->_tmp115_ = _data_->added_personas;
						_data_->_tmp116_ = _data_->persona;
						gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp115_, _data_->_tmp116_);
						_data_->_tmp117_ = _data_->added_personas;
						_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) _data_->self, (GeeSet*) _data_->_tmp117_, NULL, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
						_g_object_unref0 (_data_->added_personas);
					}
					_g_free0 (_data_->iid);
				}
				__finally6:
				{
					_data_->_tmp118_ = _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 __catch5_g_error;
				}
			}
		} else {
			_data_->_tmp119_ = g_error_new_literal (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_CREATE_FAILED, "BookClient.add_contact () failed.");
			_data_->_inner_error_ = _data_->_tmp119_;
			_g_free0 (_data_->added_uid);
			goto __catch5_g_error;
		}
		_g_free0 (_data_->added_uid);
	}
	goto __finally5;
	__catch5_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp120_ = _data_->e;
		_data_->_tmp121_ = _data_->_tmp120_->message;
		g_warning ("edsf-persona-store.vala:344: add_persona_from_details: %s\n", _data_->_tmp121_);
		_g_error_free0 (_data_->e);
	}
	__finally5:
	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 __catch7_g_error;
		}
	}
	goto __finally7;
	__catch7_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 __finally7;
					}
					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 __finally7;
					}
					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 __finally7;
					}
					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 __finally7;
	}
	__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_);
			if (_data_->_state_ == 0) {
				g_simple_async_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;
		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_ = _data_->self->priv->_source;
				_data_->_tmp4_ = e_book_client_new (_data_->_tmp3_, &_data_->_inner_error_);
				_data_->_tmp5_ = _data_->_tmp4_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch9_g_error;
				}
				_data_->_tmp6_ = _data_->_tmp5_;
				_g_object_unref0 (_data_->self->priv->_addressbook);
				_data_->self->priv->_addressbook = _data_->_tmp6_;
				_data_->_tmp7_ = _data_->self->priv->_addressbook;
				g_signal_connect_object ((GObject*) _data_->_tmp7_, "notify::readonly", (GCallback) __edsf_persona_store_address_book_notify_read_only_cb_g_object_notify, _data_->self, 0);
				_data_->_tmp8_ = _data_->self->priv->_addressbook;
				_data_->_state_ = 1;
				e_client_open ((EClient*) _data_->_tmp8_, TRUE, NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_1:
				e_client_open_finish ((EClient*) _data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
				if (_data_->_inner_error_ != NULL) {
					goto __catch9_g_error;
				}
			}
			goto __finally9;
			__catch9_g_error:
			{
				_data_->e1 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				_data_->_tmp9_ = _data_->e1;
				_data_->_tmp10_ = _data_->_tmp9_->domain;
				_data_->_tmp11_ = 0U;
				_data_->_tmp11_ = e_book_client_error_quark ();
				if (_data_->_tmp10_ == _data_->_tmp11_) {
					_data_->_tmp12_ = _data_->e1;
					_data_->_tmp13_ = _data_->_tmp12_->code;
					switch ((EBookClientError) _data_->_tmp13_) {
						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_->_tmp14_ = _data_->e1;
					_data_->_tmp15_ = _data_->_tmp14_->domain;
					_data_->_tmp16_ = 0U;
					_data_->_tmp16_ = e_client_error_quark ();
					if (_data_->_tmp15_ == _data_->_tmp16_) {
						_data_->_tmp17_ = _data_->e1;
						_data_->_tmp18_ = _data_->_tmp17_->code;
						switch ((EClientError) _data_->_tmp18_) {
							case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
							{
								_data_->_tmp19_ = NULL;
								_data_->_tmp19_ = _ ("Address book ‘%s’ is offline.");
								_data_->_tmp20_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp21_ = _data_->_tmp20_;
								_data_->_tmp22_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _data_->_tmp19_, _data_->_tmp21_);
								_data_->_inner_error_ = _data_->_tmp22_;
								_g_error_free0 (_data_->e1);
								goto __finally9;
							}
							case E_CLIENT_ERROR_PERMISSION_DENIED:
							{
								_data_->_tmp23_ = NULL;
								_data_->_tmp23_ = _ ("Permission denied to open address book ‘%s’: %s");
								_data_->_tmp24_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp25_ = _data_->_tmp24_;
								_data_->_tmp26_ = _data_->e1;
								_data_->_tmp27_ = _data_->_tmp26_->message;
								_data_->_tmp28_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _data_->_tmp23_, _data_->_tmp25_, _data_->_tmp27_);
								_data_->_inner_error_ = _data_->_tmp28_;
								_g_error_free0 (_data_->e1);
								goto __finally9;
							}
							default:
							case E_CLIENT_ERROR_AUTHENTICATION_REQUIRED:
							case E_CLIENT_ERROR_NOT_SUPPORTED:
							case E_CLIENT_ERROR_INVALID_ARG:
							case E_CLIENT_ERROR_BUSY:
							case E_CLIENT_ERROR_DBUS_ERROR:
							case E_CLIENT_ERROR_OTHER_ERROR:
							case E_CLIENT_ERROR_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_->_tmp29_ = NULL;
				_data_->_tmp29_ = _ ("Couldn't open address book ‘%s’: %s");
				_data_->_tmp30_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
				_data_->_tmp31_ = _data_->_tmp30_;
				_data_->_tmp32_ = _data_->e1;
				_data_->_tmp33_ = _data_->_tmp32_->message;
				_data_->_tmp34_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp29_, _data_->_tmp31_, _data_->_tmp33_);
				_data_->_inner_error_ = _data_->_tmp34_;
				_g_error_free0 (_data_->e1);
				goto __finally9;
			}
			__finally9:
			if (_data_->_inner_error_ != NULL) {
				goto __finally8;
			}
			_data_->_tmp35_ = _data_->self->priv->_addressbook;
			_data_->_tmp36_ = FALSE;
			_data_->_tmp36_ = e_client_is_opened ((EClient*) _data_->_tmp35_);
			if (_data_->_tmp36_ == FALSE) {
				_data_->_tmp37_ = NULL;
				_data_->_tmp37_ = _ ("Couldn't open address book ‘%s’.");
				_data_->_tmp38_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
				_data_->_tmp39_ = _data_->_tmp38_;
				_data_->_tmp40_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp37_, _data_->_tmp39_);
				_data_->_inner_error_ = _data_->_tmp40_;
				goto __finally8;
			}
			{
				_data_->_tmp41_ = _data_->self->priv->_addressbook;
				_data_->_tmp42_ = NULL;
				_data_->_state_ = 2;
				e_client_get_backend_property ((EClient*) _data_->_tmp41_, "supported-fields", NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_2:
				e_client_get_backend_property_finish ((EClient*) _data_->_tmp41_, _data_->_res_, &_data_->_tmp42_, &_data_->_inner_error_);
				_g_free0 (_data_->supported_fields);
				_data_->supported_fields = _data_->_tmp42_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch10_g_error;
				}
				_data_->_tmp43_ = _data_->supported_fields;
				if (_data_->_tmp43_ != NULL) {
					_data_->_tmp44_ = _data_->supported_fields;
					_data_->_tmp46_ = NULL;
					_data_->_tmp46_ = _data_->_tmp45_ = g_strsplit (_data_->_tmp44_, ",", 0);
					_data_->fields = _data_->_tmp46_;
					_data_->fields_length1 = _vala_array_length (_data_->_tmp45_);
					_data_->_fields_size_ = _data_->fields_length1;
					_data_->_tmp47_ = NULL;
					_data_->_tmp47_ = e_contact_field_name (E_CONTACT_CATEGORIES);
					_data_->_tmp48_ = _data_->fields;
					_data_->_tmp48__length1 = _data_->fields_length1;
					_data_->self->priv->_groups_supported = _vala_string_array_contains (_data_->_tmp48_, _data_->_tmp48__length1, _data_->_tmp47_);
					_data_->fields = (_vala_array_free (_data_->fields, _data_->fields_length1, (GDestroyNotify) g_free), NULL);
				}
			}
			goto __finally10;
			__catch10_g_error:
			{
				_data_->e2 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				_data_->_tmp49_ = NULL;
				_data_->_tmp49_ = _ ("Couldn't get address book capabilities: %s");
				_data_->_tmp50_ = _data_->e2;
				_data_->_tmp51_ = _data_->_tmp50_->message;
				_data_->_tmp52_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp49_, _data_->_tmp51_);
				_data_->_inner_error_ = _data_->_tmp52_;
				_g_error_free0 (_data_->e2);
				goto __finally10;
			}
			__finally10:
			if (_data_->_inner_error_ != NULL) {
				_g_free0 (_data_->supported_fields);
				goto __finally8;
			}
			_data_->got_view = FALSE;
			{
				_data_->_tmp53_ = _data_->self->priv->_addressbook;
				_data_->_tmp54_ = _data_->self->priv->_query_str;
				_data_->_tmp55_ = NULL;
				_data_->_state_ = 3;
				e_book_client_get_view (_data_->_tmp53_, _data_->_tmp54_, NULL, edsf_persona_store_prepare_ready, _data_);
				return FALSE;
				_state_3:
				_data_->_tmp56_ = FALSE;
				_data_->_tmp56_ = e_book_client_get_view_finish (_data_->_tmp53_, _data_->_res_, &_data_->_tmp55_, &_data_->_inner_error_);
				_g_object_unref0 (_data_->self->priv->_ebookview);
				_data_->self->priv->_ebookview = _data_->_tmp55_;
				_data_->_tmp57_ = _data_->_tmp56_;
				if (_data_->_inner_error_ != NULL) {
					goto __catch11_g_error;
				}
				_data_->_tmp58_ = _data_->_tmp57_;
				_data_->got_view = _data_->_tmp58_;
				_data_->_tmp59_ = _data_->got_view;
				if (_data_->_tmp59_ == FALSE) {
					_data_->_tmp60_ = NULL;
					_data_->_tmp60_ = _ ("Couldn't get view for address book ‘%s’.");
					_data_->_tmp61_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
					_data_->_tmp62_ = _data_->_tmp61_;
					_data_->_tmp63_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp60_, _data_->_tmp62_);
					_data_->_inner_error_ = _data_->_tmp63_;
					goto __catch11_g_error;
				}
				_data_->_tmp64_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (_data_->_tmp64_, "objects-added", (GCallback) __edsf_persona_store_contacts_added_cb_e_book_client_view_objects_added, _data_->self, 0);
				_data_->_tmp65_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (_data_->_tmp65_, "objects-removed", (GCallback) __edsf_persona_store_contacts_removed_cb_e_book_client_view_objects_removed, _data_->self, 0);
				_data_->_tmp66_ = _data_->self->priv->_ebookview;
				g_signal_connect_object (_data_->_tmp66_, "objects-modified", (GCallback) __edsf_persona_store_contacts_changed_cb_e_book_client_view_objects_modified, _data_->self, 0);
				_data_->_tmp67_ = _data_->self->priv->_ebookview;
				e_book_client_view_start (_data_->_tmp67_, &_data_->_inner_error_);
				if (_data_->_inner_error_ != NULL) {
					goto __catch11_g_error;
				}
			}
			goto __finally11;
			__catch11_g_error:
			{
				_data_->e3 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				_data_->_tmp68_ = _data_->e3;
				_data_->_tmp69_ = _data_->_tmp68_->domain;
				_data_->_tmp70_ = 0U;
				_data_->_tmp70_ = e_book_client_error_quark ();
				if (_data_->_tmp69_ == _data_->_tmp70_) {
					_data_->_tmp71_ = _data_->e3;
					_data_->_tmp72_ = _data_->_tmp71_->code;
					switch ((EBookClientError) _data_->_tmp72_) {
						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_->_tmp73_ = _data_->e3;
					_data_->_tmp74_ = _data_->_tmp73_->domain;
					_data_->_tmp75_ = 0U;
					_data_->_tmp75_ = e_client_error_quark ();
					if (_data_->_tmp74_ == _data_->_tmp75_) {
						_data_->_tmp76_ = _data_->e3;
						_data_->_tmp77_ = _data_->_tmp76_->code;
						switch ((EClientError) _data_->_tmp77_) {
							case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
							{
								_data_->_tmp78_ = NULL;
								_data_->_tmp78_ = _ ("Address book ‘%s’ is offline.");
								_data_->_tmp79_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp80_ = _data_->_tmp79_;
								_data_->_tmp81_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE, _data_->_tmp78_, _data_->_tmp80_);
								_data_->_inner_error_ = _data_->_tmp81_;
								_g_error_free0 (_data_->e3);
								goto __finally11;
							}
							case E_CLIENT_ERROR_PERMISSION_DENIED:
							{
								_data_->_tmp82_ = NULL;
								_data_->_tmp82_ = _ ("Permission denied to open address book ‘%s’: %s");
								_data_->_tmp83_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
								_data_->_tmp84_ = _data_->_tmp83_;
								_data_->_tmp85_ = _data_->e3;
								_data_->_tmp86_ = _data_->_tmp85_->message;
								_data_->_tmp87_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED, _data_->_tmp82_, _data_->_tmp84_, _data_->_tmp86_);
								_data_->_inner_error_ = _data_->_tmp87_;
								_g_error_free0 (_data_->e3);
								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_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_->_tmp88_ = NULL;
				_data_->_tmp88_ = _ ("Couldn't get view for address book ‘%s’: %s");
				_data_->_tmp89_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
				_data_->_tmp90_ = _data_->_tmp89_;
				_data_->_tmp91_ = _data_->e3;
				_data_->_tmp92_ = _data_->_tmp91_->message;
				_data_->_tmp93_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp88_, _data_->_tmp90_, _data_->_tmp92_);
				_data_->_inner_error_ = _data_->_tmp93_;
				_g_error_free0 (_data_->e3);
				goto __finally11;
			}
			__finally11:
			if (_data_->_inner_error_ != NULL) {
				_g_free0 (_data_->supported_fields);
				goto __finally8;
			}
			_data_->self->priv->_is_prepared = TRUE;
			g_object_notify ((GObject*) _data_->self, "is-prepared");
			_g_free0 (_data_->supported_fields);
		}
		__finally8:
		{
			_data_->_tmp94_ = _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 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_) {
	EdsfPersonaStoreSetAvatarData* _data_;
	_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_->_tmp2_ = _data_->persona;
	_data_->_tmp3_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (_data_->_tmp4_ == NULL) {
		_data_->_tmp5_ = _data_->avatar;
		_data_->_tmp1_ = _data_->_tmp5_ == NULL;
	} else {
		_data_->_tmp1_ = FALSE;
	}
	_data_->_tmp6_ = _data_->_tmp1_;
	if (_data_->_tmp6_) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp8_ = _data_->persona;
		_data_->_tmp9_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		if (_data_->_tmp10_ != NULL) {
			_data_->_tmp11_ = _data_->persona;
			_data_->_tmp12_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _data_->_tmp11_);
			_data_->_tmp13_ = _data_->_tmp12_;
			_data_->_tmp14_ = _data_->avatar;
			_data_->_tmp15_ = FALSE;
			_data_->_tmp15_ = g_icon_equal ((GIcon*) _data_->_tmp13_, (GIcon*) _data_->_tmp14_);
			_data_->_tmp7_ = _data_->_tmp15_;
		} else {
			_data_->_tmp7_ = FALSE;
		}
		_data_->_tmp16_ = _data_->_tmp7_;
		_data_->_tmp0_ = _data_->_tmp16_;
	}
	_data_->_tmp17_ = _data_->_tmp0_;
	if (_data_->_tmp17_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp18_ = _data_->persona;
		_data_->_tmp19_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp18_));
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_tmp21_ = _g_object_ref0 (_data_->_tmp20_);
		_data_->contact = _data_->_tmp21_;
		_data_->_tmp22_ = _data_->contact;
		_data_->_tmp23_ = _data_->avatar;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_avatar (_data_->self, _data_->_tmp22_, _data_->_tmp23_, _edsf_persona_store_set_avatar_ready, _data_);
		return FALSE;
		_state_1:
		_edsf_persona_store_set_contact_avatar_finish (_data_->self, _data_->_res_);
		_data_->_tmp24_ = _data_->self->priv->_addressbook;
		_data_->_tmp25_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp24_, _data_->_tmp25_, NULL, _edsf_persona_store_set_avatar_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp24_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch12_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally12;
	__catch12_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp26_ = _data_->e;
		_data_->_tmp27_ = _data_->_tmp26_->message;
		g_warning ("edsf-persona-store.vala:673: Can't update avatar: %s\n", _data_->_tmp27_);
		_g_error_free0 (_data_->e);
	}
	__finally12:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_) {
	EdsfPersonaStoreSetWebServiceAddressesData* _data_;
	_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_->persona;
	_data_->_tmp1_ = folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) _data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->web_service_addresses;
	_data_->_tmp4_ = FALSE;
	_data_->_tmp4_ = folks_utils_multi_map_str_afd_equal (_data_->_tmp2_, _data_->_tmp3_);
	if (_data_->_tmp4_) {
		if (_data_->_state_ == 0) {
			g_simple_async_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_->_tmp5_ = _data_->persona;
		_data_->_tmp6_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp5_));
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
		_data_->contact = _data_->_tmp8_;
		_data_->_tmp9_ = _data_->contact;
		_data_->_tmp10_ = _data_->web_service_addresses;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_web_service_addresses (_data_->self, _data_->_tmp9_, _data_->_tmp10_, _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_->_tmp11_ = _data_->self->priv->_addressbook;
		_data_->_tmp12_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp11_, _data_->_tmp12_, NULL, _edsf_persona_store_set_web_service_addresses_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch13_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally13;
	__catch13_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp13_ = _data_->e;
		_data_->_tmp14_ = _data_->_tmp13_->message;
		g_warning ("edsf-persona-store.vala:693: Can't set local IDS: %s\n", _data_->_tmp14_);
		_g_error_free0 (_data_->e);
	}
	__finally13:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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 EVCardAttribute* _vala_EVCardAttribute_copy (EVCardAttribute* self) {
	return g_boxed_copy (e_vcard_attribute_get_type (), self);
}


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


static 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_->_tmp2_ = __vala_EVCardAttribute_copy0 (_data_->_tmp1_);
	_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_);
	}
	_data_->_tmp6_ = e_vcard_attribute_new (NULL, "X-FOLKS-WEB-SERVICES-IDS");
	_data_->attr_n = _data_->_tmp6_;
	{
		_data_->_tmp7_ = _data_->web_service_addresses;
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = gee_multi_map_get_keys (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp9_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_g_object_unref0 (_data_->_tmp9_);
		_data_->_service_it = _data_->_tmp11_;
		while (TRUE) {
			_data_->_tmp12_ = _data_->_service_it;
			_data_->_tmp13_ = FALSE;
			_data_->_tmp13_ = gee_iterator_next (_data_->_tmp12_);
			if (!_data_->_tmp13_) {
				break;
			}
			_data_->_tmp14_ = _data_->_service_it;
			_data_->_tmp15_ = NULL;
			_data_->_tmp15_ = gee_iterator_get (_data_->_tmp14_);
			_data_->service = (gchar*) _data_->_tmp15_;
			_data_->_tmp16_ = _data_->service;
			_data_->_tmp17_ = e_vcard_attribute_param_new (_data_->_tmp16_);
			_data_->param = _data_->_tmp17_;
			{
				_data_->_tmp18_ = _data_->web_service_addresses;
				_data_->_tmp19_ = _data_->service;
				_data_->_tmp20_ = NULL;
				_data_->_tmp20_ = gee_multi_map_get (_data_->_tmp18_, _data_->_tmp19_);
				_data_->_tmp21_ = _data_->_tmp20_;
				_data_->_tmp22_ = NULL;
				_data_->_tmp22_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp21_);
				_data_->_tmp23_ = _data_->_tmp22_;
				_g_object_unref0 (_data_->_tmp21_);
				_data_->_ws_fd_it = _data_->_tmp23_;
				while (TRUE) {
					_data_->_tmp24_ = _data_->_ws_fd_it;
					_data_->_tmp25_ = FALSE;
					_data_->_tmp25_ = gee_iterator_next (_data_->_tmp24_);
					if (!_data_->_tmp25_) {
						break;
					}
					_data_->_tmp26_ = _data_->_ws_fd_it;
					_data_->_tmp27_ = NULL;
					_data_->_tmp27_ = gee_iterator_get (_data_->_tmp26_);
					_data_->ws_fd = (FolksWebServiceFieldDetails*) _data_->_tmp27_;
					_data_->_tmp28_ = _data_->param;
					_data_->_tmp29_ = _data_->ws_fd;
					_data_->_tmp30_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp29_);
					_data_->_tmp31_ = _data_->_tmp30_;
					e_vcard_attribute_param_add_value (_data_->_tmp28_, (const gchar*) _data_->_tmp31_);
					_g_object_unref0 (_data_->ws_fd);
				}
				_g_object_unref0 (_data_->_ws_fd_it);
			}
			_data_->_tmp32_ = _data_->attr_n;
			_data_->_tmp33_ = _data_->param;
			_data_->_tmp34_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp33_);
			e_vcard_attribute_add_param (_data_->_tmp32_, _data_->_tmp34_);
			__vala_EVCardAttributeParam_free0 (_data_->param);
			_g_free0 (_data_->service);
		}
		_g_object_unref0 (_data_->_service_it);
	}
	_data_->_tmp35_ = _data_->contact;
	_data_->_tmp36_ = _data_->attr_n;
	_data_->_tmp37_ = __vala_EVCardAttribute_copy0 (_data_->_tmp36_);
	e_vcard_add_attribute ((EVCard*) _data_->_tmp35_, _data_->_tmp37_);
	__vala_EVCardAttribute_free0 (_data_->attr_n);
	__vala_EVCardAttribute_free0 (_data_->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_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_) {
	EdsfPersonaStoreSetUrlsData* _data_;
	_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_->persona;
	_data_->_tmp1_ = folks_url_details_get_urls ((FolksUrlDetails*) _data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->urls;
	_data_->_tmp4_ = FALSE;
	_data_->_tmp4_ = folks_utils_set_afd_equal (_data_->_tmp2_, _data_->_tmp3_);
	if (_data_->_tmp4_) {
		if (_data_->_state_ == 0) {
			g_simple_async_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_->_tmp5_ = _data_->persona;
		_data_->_tmp6_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp5_));
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
		_data_->contact = _data_->_tmp8_;
		_data_->_tmp9_ = _data_->contact;
		_data_->_tmp10_ = _data_->urls;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_urls (_data_->self, _data_->_tmp9_, _data_->_tmp10_, _edsf_persona_store_set_urls_ready, _data_);
		return FALSE;
		_state_1:
		_edsf_persona_store_set_contact_urls_finish (_data_->self, _data_->_res_);
		_data_->_tmp11_ = _data_->self->priv->_addressbook;
		_data_->_tmp12_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp11_, _data_->_tmp12_, NULL, _edsf_persona_store_set_urls_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch14_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally14;
	__catch14_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp13_ = _data_->e;
		_data_->_tmp14_ = _data_->_tmp13_->message;
		g_warning ("edsf-persona-store.vala:733: Can't set urls: %s", _data_->_tmp14_);
		_g_error_free0 (_data_->e);
	}
	__finally14:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_->homepage = FALSE;
			_data_->blog = FALSE;
			_data_->fburl = FALSE;
			_data_->video = 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_, "type") == 0) {
								_data_->_tmp43_ = _data_->param_val;
								if (g_strcmp0 (_data_->_tmp43_, "homepage_url") == 0) {
									_data_->homepage = TRUE;
								} else {
									_data_->_tmp44_ = _data_->param_val;
									if (g_strcmp0 (_data_->_tmp44_, "blog_url") == 0) {
										_data_->blog = TRUE;
									} else {
										_data_->_tmp45_ = _data_->param_val;
										if (g_strcmp0 (_data_->_tmp45_, "fburl") == 0) {
											_data_->fburl = TRUE;
										} else {
											_data_->_tmp46_ = _data_->param_val;
											if (g_strcmp0 (_data_->_tmp46_, "video_url") == 0) {
												_data_->video = TRUE;
											}
										}
									}
								}
							}
							_data_->_tmp47_ = _data_->param;
							_data_->_tmp48_ = _data_->param_val;
							e_vcard_attribute_param_add_value (_data_->_tmp47_, _data_->_tmp48_);
							_g_free0 (_data_->param_val);
						}
						_g_object_unref0 (_data_->_param_val_it);
					}
					_data_->_tmp49_ = _data_->attr;
					_data_->_tmp50_ = _data_->param;
					_data_->_tmp51_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp50_);
					e_vcard_attribute_add_param (_data_->_tmp49_, _data_->_tmp51_);
					__vala_EVCardAttributeParam_free0 (_data_->param);
					_g_free0 (_data_->param_name);
				}
				_g_object_unref0 (_data_->_param_name_it);
			}
			_data_->_tmp52_ = _data_->homepage;
			if (_data_->_tmp52_) {
				_data_->_tmp53_ = _data_->contact;
				_data_->_tmp54_ = 0;
				_data_->_tmp54_ = e_contact_field_id ("homepage_url");
				_data_->_tmp55_ = _data_->u;
				_data_->_tmp56_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp55_);
				_data_->_tmp57_ = _data_->_tmp56_;
				e_contact_set (_data_->_tmp53_, _data_->_tmp54_, (const gchar*) _data_->_tmp57_);
			} else {
				_data_->_tmp58_ = _data_->blog;
				if (_data_->_tmp58_) {
					_data_->_tmp59_ = _data_->contact;
					_data_->_tmp60_ = 0;
					_data_->_tmp60_ = e_contact_field_id ("blog_url");
					_data_->_tmp61_ = _data_->u;
					_data_->_tmp62_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp61_);
					_data_->_tmp63_ = _data_->_tmp62_;
					e_contact_set (_data_->_tmp59_, _data_->_tmp60_, (const gchar*) _data_->_tmp63_);
				} else {
					_data_->_tmp64_ = _data_->fburl;
					if (_data_->_tmp64_) {
						_data_->_tmp65_ = _data_->contact;
						_data_->_tmp66_ = 0;
						_data_->_tmp66_ = e_contact_field_id ("fburl");
						_data_->_tmp67_ = _data_->u;
						_data_->_tmp68_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp67_);
						_data_->_tmp69_ = _data_->_tmp68_;
						e_contact_set (_data_->_tmp65_, _data_->_tmp66_, (const gchar*) _data_->_tmp69_);
					} else {
						_data_->_tmp70_ = _data_->video;
						if (_data_->_tmp70_) {
							_data_->_tmp71_ = _data_->contact;
							_data_->_tmp72_ = 0;
							_data_->_tmp72_ = e_contact_field_id ("video_url");
							_data_->_tmp73_ = _data_->u;
							_data_->_tmp74_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp73_);
							_data_->_tmp75_ = _data_->_tmp74_;
							e_contact_set (_data_->_tmp71_, _data_->_tmp72_, (const gchar*) _data_->_tmp75_);
						} else {
							_data_->_tmp76_ = _data_->contact;
							_data_->_tmp77_ = _data_->attr;
							_data_->_tmp78_ = __vala_EVCardAttribute_copy0 (_data_->_tmp77_);
							e_vcard_add_attribute ((EVCard*) _data_->_tmp76_, _data_->_tmp78_);
						}
					}
				}
			}
			__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_) {
	EdsfPersonaStoreSetLocalIdsData* _data_;
	_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_->persona;
		_data_->_tmp1_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp0_));
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
		_data_->contact = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->contact;
		_data_->_tmp5_ = _data_->local_ids;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_local_ids (_data_->self, _data_->_tmp4_, _data_->_tmp5_, _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_->_tmp6_ = _data_->self->priv->_addressbook;
		_data_->_tmp7_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp6_, _data_->_tmp7_, NULL, _edsf_persona_store_set_local_ids_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch15_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally15;
	__catch15_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp8_ = _data_->e;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("edsf-persona-store.vala:816: Can't set local IDS: %s\n", _data_->_tmp9_);
		_g_error_free0 (_data_->e);
	}
	__finally15:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_->_tmp2_ = __vala_EVCardAttribute_copy0 (_data_->_tmp1_);
	_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_);
	}
	_data_->_tmp6_ = e_vcard_attribute_new (NULL, "X-FOLKS-CONTACTS-IDS");
	__vala_EVCardAttribute_free0 (_data_->attr);
	_data_->attr = _data_->_tmp6_;
	{
		_data_->_tmp7_ = _data_->local_ids;
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp7_);
		_data_->_local_id_it = _data_->_tmp8_;
		while (TRUE) {
			_data_->_tmp9_ = _data_->_local_id_it;
			_data_->_tmp10_ = FALSE;
			_data_->_tmp10_ = gee_iterator_next (_data_->_tmp9_);
			if (!_data_->_tmp10_) {
				break;
			}
			_data_->_tmp11_ = _data_->_local_id_it;
			_data_->_tmp12_ = NULL;
			_data_->_tmp12_ = gee_iterator_get (_data_->_tmp11_);
			_data_->local_id = (gchar*) _data_->_tmp12_;
			_data_->_tmp13_ = _data_->attr;
			_data_->_tmp14_ = _data_->local_id;
			e_vcard_attribute_add_value (_data_->_tmp13_, _data_->_tmp14_);
			_g_free0 (_data_->local_id);
		}
		_g_object_unref0 (_data_->_local_id_it);
	}
	_data_->_tmp15_ = _data_->contact;
	_data_->_tmp16_ = _data_->attr;
	_data_->_tmp17_ = __vala_EVCardAttribute_copy0 (_data_->_tmp16_);
	e_vcard_add_attribute ((EVCard*) _data_->_tmp15_, _data_->_tmp17_);
	__vala_EVCardAttribute_free0 (_data_->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_) {
	EdsfPersonaStoreSetContactAvatarData* _data_;
	_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_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->contact;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _edsf_persona_get_property_from_contact (_data_->_tmp2_, "id");
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = folks_persona_build_uid (BACKEND_NAME, _data_->_tmp1_, (const gchar*) _data_->_tmp3_);
	_data_->uid = _data_->_tmp4_;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = folks_avatar_cache_dup ();
	_data_->cache = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->avatar;
	if (_data_->_tmp6_ != NULL) {
		{
			_data_->_tmp7_ = _data_->cache;
			_data_->_tmp8_ = _data_->uid;
			_data_->_tmp9_ = _data_->avatar;
			_data_->_state_ = 1;
			folks_avatar_cache_store_avatar (_data_->_tmp7_, _data_->_tmp8_, _data_->_tmp9_, _edsf_persona_store_set_contact_avatar_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp10_ = NULL;
			_data_->_tmp10_ = folks_avatar_cache_store_avatar_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error_);
			_data_->uri = _data_->_tmp10_;
			if (_data_->_inner_error_ != NULL) {
				goto __catch16_g_error;
			}
			_data_->_tmp11_ = e_contact_photo_new ();
			_data_->cp = _data_->_tmp11_;
			_data_->_tmp12_ = _data_->cp;
			_data_->_tmp12_->type = E_CONTACT_PHOTO_TYPE_URI;
			_data_->_tmp13_ = _data_->cp;
			_data_->_tmp14_ = _data_->uri;
			e_contact_photo_set_uri (_data_->_tmp13_, _data_->_tmp14_);
			_data_->_tmp15_ = _data_->contact;
			_data_->_tmp16_ = _data_->cp;
			e_contact_set (_data_->_tmp15_, E_CONTACT_PHOTO, _data_->_tmp16_);
			__vala_EContactPhoto_free0 (_data_->cp);
			_g_free0 (_data_->uri);
		}
		goto __finally16;
		__catch16_g_error:
		{
			_data_->e1 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			_data_->_tmp17_ = _data_->uid;
			_data_->_tmp18_ = _data_->e1;
			_data_->_tmp19_ = _data_->_tmp18_->message;
			g_warning ("edsf-persona-store.vala:861: Couldn't cache avatar for Edsf.Persona '%" \
"s': %s", _data_->_tmp17_, _data_->_tmp19_);
			_g_error_free0 (_data_->e1);
		}
		__finally16:
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->cache);
			_g_free0 (_data_->uid);
			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_->_tmp20_ = _data_->cache;
			_data_->_tmp21_ = _data_->uid;
			_data_->_state_ = 2;
			folks_avatar_cache_remove_avatar (_data_->_tmp20_, _data_->_tmp21_, _edsf_persona_store_set_contact_avatar_ready, _data_);
			return FALSE;
			_state_2:
			folks_avatar_cache_remove_avatar_finish (_data_->_tmp20_, _data_->_res_, &_data_->_inner_error_);
			if (_data_->_inner_error_ != NULL) {
				goto __catch17_g_error;
			}
		}
		goto __finally17;
		__catch17_g_error:
		{
			_data_->e2 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			_g_error_free0 (_data_->e2);
		}
		__finally17:
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->cache);
			_g_free0 (_data_->uid);
			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_->cache);
	_g_free0 (_data_->uid);
	if (_data_->_state_ == 0) {
		g_simple_async_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_) {
	EdsfPersonaStoreSetEmailsData* _data_;
	_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_->persona;
		_data_->_tmp1_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp0_));
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
		_data_->contact = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->contact;
		_data_->_tmp5_ = _data_->emails;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_attributes (_data_->self, _data_->_tmp4_, _data_->_tmp5_, "EMAIL", E_CONTACT_EMAIL, _edsf_persona_store_set_emails_ready, _data_);
		return FALSE;
		_state_1:
		_edsf_persona_store_set_contact_attributes_finish (_data_->self, _data_->_res_);
		_data_->_tmp6_ = _data_->self->priv->_addressbook;
		_data_->_tmp7_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp6_, _data_->_tmp7_, NULL, _edsf_persona_store_set_emails_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch18_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally18;
	__catch18_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp8_ = _data_->_error_;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("edsf-persona-store.vala:888: Can't update email-addresses: %s\n", _data_->_tmp9_);
		_g_error_free0 (_data_->_error_);
	}
	__finally18:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_) {
	EdsfPersonaStoreSetPhonesData* _data_;
	_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_->persona;
		_data_->_tmp1_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp0_));
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
		_data_->contact = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->contact;
		_data_->_tmp5_ = _data_->phones;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_attributes (_data_->self, _data_->_tmp4_, _data_->_tmp5_, "TEL", E_CONTACT_TEL, _edsf_persona_store_set_phones_ready, _data_);
		return FALSE;
		_state_1:
		_edsf_persona_store_set_contact_attributes_finish (_data_->self, _data_->_res_);
		_data_->_tmp6_ = _data_->self->priv->_addressbook;
		_data_->_tmp7_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp6_, _data_->_tmp7_, NULL, _edsf_persona_store_set_phones_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch19_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally19;
	__catch19_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp8_ = _data_->_error_;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("edsf-persona-store.vala:905: Can't update phones: %s\n", _data_->_tmp9_);
		_g_error_free0 (_data_->_error_);
	}
	__finally19:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_) {
	EdsfPersonaStoreSetPostalAddressesData* _data_;
	_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_->persona;
		_data_->_tmp1_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp0_));
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
		_data_->contact = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->contact;
		_data_->_tmp5_ = _data_->postal_fds;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_postal_addresses (_data_->self, _data_->_tmp4_, _data_->_tmp5_, _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_->_tmp6_ = _data_->self->priv->_addressbook;
		_data_->_tmp7_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp6_, _data_->_tmp7_, NULL, _edsf_persona_store_set_postal_addresses_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch20_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally20;
	__catch20_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp8_ = _data_->_error_;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("edsf-persona-store.vala:921: Can't update postal addresses: %s\n", _data_->_tmp9_);
		_g_error_free0 (_data_->_error_);
	}
	__finally20:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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 _vala_EContactAddress_free (EContactAddress* self) {
	g_boxed_free (e_contact_address_get_type (), self);
}


static gboolean _edsf_persona_store_set_contact_postal_addresses_co (EdsfPersonaStoreSetContactPostalAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->postal_fds;
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp0_);
		_data_->_fd_it = _data_->_tmp1_;
		while (TRUE) {
			_data_->_tmp2_ = _data_->_fd_it;
			_data_->_tmp3_ = FALSE;
			_data_->_tmp3_ = gee_iterator_next (_data_->_tmp2_);
			if (!_data_->_tmp3_) {
				break;
			}
			_data_->_tmp4_ = _data_->_fd_it;
			_data_->_tmp5_ = NULL;
			_data_->_tmp5_ = gee_iterator_get (_data_->_tmp4_);
			_data_->fd = (FolksPostalAddressFieldDetails*) _data_->_tmp5_;
			_data_->_tmp7_ = _data_->fd;
			if (_data_->_tmp7_ == NULL) {
				_data_->_tmp6_ = TRUE;
			} else {
				_data_->_tmp8_ = _data_->fd;
				_data_->_tmp9_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp8_);
				_data_->_tmp10_ = _data_->_tmp9_;
				_data_->_tmp6_ = ((FolksPostalAddress*) _data_->_tmp10_) == NULL;
			}
			_data_->_tmp11_ = _data_->_tmp6_;
			if (_data_->_tmp11_) {
				_g_object_unref0 (_data_->fd);
				continue;
			}
			_data_->_tmp12_ = e_contact_address_new ();
			_data_->address = _data_->_tmp12_;
			_data_->_tmp13_ = _data_->address;
			_data_->_tmp14_ = _data_->fd;
			_data_->_tmp15_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp14_);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = folks_postal_address_get_po_box ((FolksPostalAddress*) _data_->_tmp16_);
			_data_->_tmp18_ = _data_->_tmp17_;
			_data_->_tmp19_ = g_strdup (_data_->_tmp18_);
			_g_free0 (_data_->_tmp13_->po);
			_data_->_tmp13_->po = _data_->_tmp19_;
			_data_->_tmp20_ = _data_->address;
			_data_->_tmp21_ = _data_->fd;
			_data_->_tmp22_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp21_);
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->_tmp24_ = folks_postal_address_get_extension ((FolksPostalAddress*) _data_->_tmp23_);
			_data_->_tmp25_ = _data_->_tmp24_;
			_data_->_tmp26_ = g_strdup (_data_->_tmp25_);
			_g_free0 (_data_->_tmp20_->ext);
			_data_->_tmp20_->ext = _data_->_tmp26_;
			_data_->_tmp27_ = _data_->address;
			_data_->_tmp28_ = _data_->fd;
			_data_->_tmp29_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp28_);
			_data_->_tmp30_ = _data_->_tmp29_;
			_data_->_tmp31_ = folks_postal_address_get_street ((FolksPostalAddress*) _data_->_tmp30_);
			_data_->_tmp32_ = _data_->_tmp31_;
			_data_->_tmp33_ = g_strdup (_data_->_tmp32_);
			_g_free0 (_data_->_tmp27_->street);
			_data_->_tmp27_->street = _data_->_tmp33_;
			_data_->_tmp34_ = _data_->address;
			_data_->_tmp35_ = _data_->fd;
			_data_->_tmp36_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp35_);
			_data_->_tmp37_ = _data_->_tmp36_;
			_data_->_tmp38_ = folks_postal_address_get_locality ((FolksPostalAddress*) _data_->_tmp37_);
			_data_->_tmp39_ = _data_->_tmp38_;
			_data_->_tmp40_ = g_strdup (_data_->_tmp39_);
			_g_free0 (_data_->_tmp34_->locality);
			_data_->_tmp34_->locality = _data_->_tmp40_;
			_data_->_tmp41_ = _data_->address;
			_data_->_tmp42_ = _data_->fd;
			_data_->_tmp43_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp42_);
			_data_->_tmp44_ = _data_->_tmp43_;
			_data_->_tmp45_ = folks_postal_address_get_region ((FolksPostalAddress*) _data_->_tmp44_);
			_data_->_tmp46_ = _data_->_tmp45_;
			_data_->_tmp47_ = g_strdup (_data_->_tmp46_);
			_g_free0 (_data_->_tmp41_->region);
			_data_->_tmp41_->region = _data_->_tmp47_;
			_data_->_tmp48_ = _data_->address;
			_data_->_tmp49_ = _data_->fd;
			_data_->_tmp50_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp49_);
			_data_->_tmp51_ = _data_->_tmp50_;
			_data_->_tmp52_ = folks_postal_address_get_postal_code ((FolksPostalAddress*) _data_->_tmp51_);
			_data_->_tmp53_ = _data_->_tmp52_;
			_data_->_tmp54_ = g_strdup (_data_->_tmp53_);
			_g_free0 (_data_->_tmp48_->code);
			_data_->_tmp48_->code = _data_->_tmp54_;
			_data_->_tmp55_ = _data_->address;
			_data_->_tmp56_ = _data_->fd;
			_data_->_tmp57_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp56_);
			_data_->_tmp58_ = _data_->_tmp57_;
			_data_->_tmp59_ = folks_postal_address_get_country ((FolksPostalAddress*) _data_->_tmp58_);
			_data_->_tmp60_ = _data_->_tmp59_;
			_data_->_tmp61_ = g_strdup (_data_->_tmp60_);
			_g_free0 (_data_->_tmp55_->country);
			_data_->_tmp55_->country = _data_->_tmp61_;
			_data_->_tmp62_ = _data_->address;
			_data_->_tmp63_ = _data_->fd;
			_data_->_tmp64_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp63_);
			_data_->_tmp65_ = _data_->_tmp64_;
			_data_->_tmp66_ = folks_postal_address_get_address_format ((FolksPostalAddress*) _data_->_tmp65_);
			_data_->_tmp67_ = _data_->_tmp66_;
			_data_->_tmp68_ = g_strdup (_data_->_tmp67_);
			_g_free0 (_data_->_tmp62_->address_format);
			_data_->_tmp62_->address_format = _data_->_tmp68_;
			_data_->_tmp69_ = _data_->fd;
			_data_->_tmp70_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _data_->_tmp69_);
			_data_->_tmp71_ = _data_->_tmp70_;
			_data_->_tmp72_ = NULL;
			_data_->_tmp72_ = gee_multi_map_get (_data_->_tmp71_, "type");
			_data_->types = _data_->_tmp72_;
			_data_->_tmp73_ = _data_->types;
			_data_->_tmp74_ = gee_collection_get_size (_data_->_tmp73_);
			_data_->_tmp75_ = _data_->_tmp74_;
			if (_data_->_tmp75_ > 0) {
				_data_->_tmp76_ = _data_->types;
				_data_->_tmp77_ = 0;
				_data_->_tmp78_ = NULL;
				_data_->_tmp78_ = gee_collection_to_array (_data_->_tmp76_, &_data_->_tmp77_);
				_data_->_tmp79_ = _data_->_tmp78_;
				_data_->_tmp79__length1 = _data_->_tmp77_;
				_data_->_tmp80_ = _data_->_tmp79_[0];
				_data_->_tmp81_ = g_strdup (_data_->_tmp80_);
				_data_->_tmp82_ = _data_->_tmp81_;
				_data_->_tmp79_ = (_vala_array_free (_data_->_tmp79_, _data_->_tmp79__length1, (GDestroyNotify) g_free), NULL);
				_data_->type = _data_->_tmp82_;
				_data_->_tmp83_ = _data_->contact;
				_data_->_tmp84_ = _data_->type;
				_data_->_tmp85_ = 0;
				_data_->_tmp85_ = e_contact_field_id (_data_->_tmp84_);
				_data_->_tmp86_ = _data_->address;
				e_contact_set (_data_->_tmp83_, _data_->_tmp85_, _data_->_tmp86_);
				_g_free0 (_data_->type);
			} else {
				_data_->_tmp87_ = _data_->contact;
				_data_->_tmp88_ = _data_->address;
				e_contact_set (_data_->_tmp87_, E_CONTACT_ADDRESS_OTHER, _data_->_tmp88_);
			}
			_g_object_unref0 (_data_->types);
			__vala_EContactAddress_free0 (_data_->address);
			_g_object_unref0 (_data_->fd);
		}
		_g_object_unref0 (_data_->_fd_it);
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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, EContact* contact, GeeSet* new_attributes, const gchar* attrib_name, EContactField field_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersonaStoreSetContactAttributesData* _data_;
	EdsfPersonaStore* _tmp0_;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	EContactField _tmp7_;
	_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_ = attrib_name;
	_tmp6_ = g_strdup (_tmp5_);
	_data_->attrib_name = _tmp6_;
	_tmp7_ = field_id;
	_data_->field_id = _tmp7_;
	_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_->attr;
			_data_->_tmp9_ = _data_->e;
			_data_->_tmp10_ = folks_abstract_field_details_get_value (_data_->_tmp9_);
			_data_->_tmp11_ = _data_->_tmp10_;
			e_vcard_attribute_add_value (_data_->_tmp8_, (const gchar*) _data_->_tmp11_);
			{
				_data_->_tmp12_ = _data_->e;
				_data_->_tmp13_ = folks_abstract_field_details_get_parameters (_data_->_tmp12_);
				_data_->_tmp14_ = _data_->_tmp13_;
				_data_->_tmp15_ = NULL;
				_data_->_tmp15_ = gee_multi_map_get_keys (_data_->_tmp14_);
				_data_->_tmp16_ = _data_->_tmp15_;
				_data_->_tmp17_ = NULL;
				_data_->_tmp17_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp16_);
				_data_->_tmp18_ = _data_->_tmp17_;
				_g_object_unref0 (_data_->_tmp16_);
				_data_->_param_name_it = _data_->_tmp18_;
				while (TRUE) {
					_data_->_tmp19_ = _data_->_param_name_it;
					_data_->_tmp20_ = FALSE;
					_data_->_tmp20_ = gee_iterator_next (_data_->_tmp19_);
					if (!_data_->_tmp20_) {
						break;
					}
					_data_->_tmp21_ = _data_->_param_name_it;
					_data_->_tmp22_ = NULL;
					_data_->_tmp22_ = gee_iterator_get (_data_->_tmp21_);
					_data_->param_name = (gchar*) _data_->_tmp22_;
					_data_->_tmp23_ = _data_->param_name;
					_data_->_tmp24_ = NULL;
					_data_->_tmp24_ = g_utf8_strup (_data_->_tmp23_, (gssize) (-1));
					_data_->_tmp25_ = _data_->_tmp24_;
					_data_->_tmp26_ = e_vcard_attribute_param_new (_data_->_tmp25_);
					_data_->_tmp27_ = _data_->_tmp26_;
					_g_free0 (_data_->_tmp25_);
					_data_->param = _data_->_tmp27_;
					{
						_data_->_tmp28_ = _data_->e;
						_data_->_tmp29_ = folks_abstract_field_details_get_parameters (_data_->_tmp28_);
						_data_->_tmp30_ = _data_->_tmp29_;
						_data_->_tmp31_ = _data_->param_name;
						_data_->_tmp32_ = NULL;
						_data_->_tmp32_ = gee_multi_map_get (_data_->_tmp30_, _data_->_tmp31_);
						_data_->_tmp33_ = _data_->_tmp32_;
						_data_->_tmp34_ = NULL;
						_data_->_tmp34_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp33_);
						_data_->_tmp35_ = _data_->_tmp34_;
						_g_object_unref0 (_data_->_tmp33_);
						_data_->_param_val_it = _data_->_tmp35_;
						while (TRUE) {
							_data_->_tmp36_ = _data_->_param_val_it;
							_data_->_tmp37_ = FALSE;
							_data_->_tmp37_ = gee_iterator_next (_data_->_tmp36_);
							if (!_data_->_tmp37_) {
								break;
							}
							_data_->_tmp38_ = _data_->_param_val_it;
							_data_->_tmp39_ = NULL;
							_data_->_tmp39_ = gee_iterator_get (_data_->_tmp38_);
							_data_->param_val = (gchar*) _data_->_tmp39_;
							_data_->_tmp40_ = _data_->param;
							_data_->_tmp41_ = _data_->param_val;
							e_vcard_attribute_param_add_value (_data_->_tmp40_, _data_->_tmp41_);
							_g_free0 (_data_->param_val);
						}
						_g_object_unref0 (_data_->_param_val_it);
					}
					_data_->_tmp42_ = _data_->attr;
					_data_->_tmp43_ = _data_->param;
					_data_->_tmp44_ = __vala_EVCardAttributeParam_copy0 (_data_->_tmp43_);
					e_vcard_attribute_add_param (_data_->_tmp42_, _data_->_tmp44_);
					__vala_EVCardAttributeParam_free0 (_data_->param);
					_g_free0 (_data_->param_name);
				}
				_g_object_unref0 (_data_->_param_name_it);
			}
			_data_->_tmp45_ = _data_->attr;
			_data_->_tmp46_ = __vala_EVCardAttribute_copy0 (_data_->_tmp45_);
			_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_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_) {
	EdsfPersonaStoreSetFullNameData* _data_;
	_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_->persona;
	_data_->_tmp1_ = folks_name_details_get_full_name ((FolksNameDetails*) _data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->full_name;
	if (g_strcmp0 (_data_->_tmp2_, _data_->_tmp3_) == 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_->_tmp4_ = _data_->persona;
		_data_->_tmp5_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp4_));
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = _g_object_ref0 (_data_->_tmp6_);
		_data_->contact = _data_->_tmp7_;
		_data_->_tmp8_ = _data_->contact;
		_data_->_tmp9_ = 0;
		_data_->_tmp9_ = e_contact_field_id ("full_name");
		_data_->_tmp10_ = _data_->full_name;
		e_contact_set (_data_->_tmp8_, _data_->_tmp9_, _data_->_tmp10_);
		_data_->_tmp11_ = _data_->self->priv->_addressbook;
		_data_->_tmp12_ = _data_->contact;
		_data_->_state_ = 1;
		e_book_client_modify_contact (_data_->_tmp11_, _data_->_tmp12_, NULL, _edsf_persona_store_set_full_name_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_modify_contact_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch21_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally21;
	__catch21_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp13_ = _data_->_error_;
		_data_->_tmp14_ = _data_->_tmp13_->message;
		g_warning ("edsf-persona-store.vala:997: Can't update full name: %s\n", _data_->_tmp14_);
		_g_error_free0 (_data_->_error_);
	}
	__finally21:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_) {
	EdsfPersonaStoreSetNicknameData* _data_;
	_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_->persona;
	_data_->_tmp1_ = folks_name_details_get_nickname ((FolksNameDetails*) _data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->nickname;
	if (g_strcmp0 (_data_->_tmp2_, _data_->_tmp3_) == 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_->_tmp4_ = _data_->persona;
		_data_->_tmp5_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp4_));
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = _g_object_ref0 (_data_->_tmp6_);
		_data_->contact = _data_->_tmp7_;
		_data_->_tmp8_ = _data_->contact;
		_data_->_tmp9_ = 0;
		_data_->_tmp9_ = e_contact_field_id ("nickname");
		_data_->_tmp10_ = _data_->nickname;
		e_contact_set (_data_->_tmp8_, _data_->_tmp9_, _data_->_tmp10_);
		_data_->_tmp11_ = _data_->self->priv->_addressbook;
		_data_->_tmp12_ = _data_->contact;
		_data_->_state_ = 1;
		e_book_client_modify_contact (_data_->_tmp11_, _data_->_tmp12_, NULL, _edsf_persona_store_set_nickname_ready, _data_);
		return FALSE;
		_state_1:
		e_book_client_modify_contact_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch22_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally22;
	__catch22_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp13_ = _data_->_error_;
		_data_->_tmp14_ = _data_->_tmp13_->message;
		g_warning ("edsf-persona-store.vala:1014: Can't update nickname: %s\n", _data_->_tmp14_);
		_g_error_free0 (_data_->_error_);
	}
	__finally22:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_) {
	EdsfPersonaStoreSetNotesData* _data_;
	_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_->persona;
		_data_->_tmp1_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp0_));
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
		_data_->contact = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->contact;
		_data_->_tmp5_ = _data_->notes;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_notes (_data_->self, _data_->_tmp4_, _data_->_tmp5_, _edsf_persona_store_set_notes_ready, _data_);
		return FALSE;
		_state_1:
		_edsf_persona_store_set_contact_notes_finish (_data_->self, _data_->_res_);
		_data_->_tmp6_ = _data_->self->priv->_addressbook;
		_data_->_tmp7_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp6_, _data_->_tmp7_, NULL, _edsf_persona_store_set_notes_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch23_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally23;
	__catch23_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp8_ = _data_->_error_;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("edsf-persona-store.vala:1029: Can't update notes: %s\n", _data_->_tmp9_);
		_g_error_free0 (_data_->_error_);
	}
	__finally23:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_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_) {
	EdsfPersonaStoreSetStructuredNameData* _data_;
	_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_->_tmp1_ = _data_->persona;
	_data_->_tmp2_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = _data_->persona;
		_data_->_tmp5_ = folks_name_details_get_structured_name ((FolksNameDetails*) _data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = _data_->sname;
		_data_->_tmp8_ = FALSE;
		_data_->_tmp8_ = folks_structured_name_equal (_data_->_tmp6_, _data_->_tmp7_);
		_data_->_tmp0_ = _data_->_tmp8_;
	} else {
		_data_->_tmp0_ = FALSE;
	}
	_data_->_tmp9_ = _data_->_tmp0_;
	if (_data_->_tmp9_) {
		if (_data_->_state_ == 0) {
			g_simple_async_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 (EDSF_PERSONA (_data_->_tmp10_));
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = _g_object_ref0 (_data_->_tmp12_);
		_data_->contact = _data_->_tmp13_;
		_data_->_tmp14_ = _data_->contact;
		_data_->_tmp15_ = _data_->sname;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_name (_data_->self, _data_->_tmp14_, _data_->_tmp15_, _edsf_persona_store_set_structured_name_ready, _data_);
		return FALSE;
		_state_1:
		_edsf_persona_store_set_contact_name_finish (_data_->self, _data_->_res_);
		_data_->_tmp16_ = _data_->self->priv->_addressbook;
		_data_->_tmp17_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp16_, _data_->_tmp17_, NULL, _edsf_persona_store_set_structured_name_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp16_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch24_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally24;
	__catch24_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp18_ = _data_->_error_;
		_data_->_tmp19_ = _data_->_tmp18_->message;
		g_warning ("edsf-persona-store.vala:1064: Can't update structured name: %s\n", _data_->_tmp19_);
		_g_error_free0 (_data_->_error_);
	}
	__finally24:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_) {
	EdsfPersonaStoreSetImFdsData* _data_;
	_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_->persona;
	_data_->_tmp1_ = folks_im_details_get_im_addresses ((FolksImDetails*) _data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->im_fds;
	_data_->_tmp4_ = FALSE;
	_data_->_tmp4_ = folks_utils_multi_map_str_afd_equal (_data_->_tmp2_, _data_->_tmp3_);
	if (_data_->_tmp4_) {
		if (_data_->_state_ == 0) {
			g_simple_async_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_->_tmp5_ = _data_->persona;
		_data_->_tmp6_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp5_));
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
		_data_->contact = _data_->_tmp8_;
		_data_->_tmp9_ = _data_->contact;
		_data_->_tmp10_ = _data_->im_fds;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_im_fds (_data_->self, _data_->_tmp9_, _data_->_tmp10_, _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_->_tmp11_ = _data_->self->priv->_addressbook;
		_data_->_tmp12_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp11_, _data_->_tmp12_, NULL, _edsf_persona_store_set_im_fds_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch25_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally25;
	__catch25_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp13_ = _data_->_error_;
		_data_->_tmp14_ = _data_->_tmp13_->message;
		g_warning ("edsf-persona-store.vala:1099: Can't update IM addresses: %s\n", _data_->_tmp14_);
		_g_error_free0 (_data_->_error_);
	}
	__finally25:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_get_attributes (_data_->_tmp3_, _data_->_tmp4_);
				_data_->attrs = _data_->_tmp5_;
				_data_->_tmp6_ = _data_->attrs;
				{
					_data_->attr_collection = _data_->_tmp6_;
					_data_->attr_it = NULL;
					for (_data_->attr_it = _data_->attr_collection; _data_->attr_it != NULL; _data_->attr_it = _data_->attr_it->next) {
						_data_->_tmp7_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) _data_->attr_it->data);
						_data_->attr = _data_->_tmp7_;
						{
							_data_->_tmp8_ = _data_->contact;
							_data_->_tmp9_ = _data_->attr;
							e_vcard_remove_attribute ((EVCard*) _data_->_tmp8_, _data_->_tmp9_);
							__vala_EVCardAttribute_free0 (_data_->attr);
						}
					}
				}
				__g_list_free___vala_EVCardAttribute_free0_0 (_data_->attrs);
			}
		}
		_g_list_free0 (_data_->field_id_collection);
	}
	{
		_data_->_tmp10_ = _data_->im_fds;
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = gee_multi_map_get_keys (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = NULL;
		_data_->_tmp13_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_g_object_unref0 (_data_->_tmp12_);
		_data_->_proto_it = _data_->_tmp14_;
		while (TRUE) {
			_data_->_tmp15_ = _data_->_proto_it;
			_data_->_tmp16_ = FALSE;
			_data_->_tmp16_ = gee_iterator_next (_data_->_tmp15_);
			if (!_data_->_tmp16_) {
				break;
			}
			_data_->_tmp17_ = _data_->_proto_it;
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = gee_iterator_get (_data_->_tmp17_);
			_data_->proto = (gchar*) _data_->_tmp18_;
			_data_->attributes = NULL;
			_data_->_tmp19_ = _data_->proto;
			_data_->_tmp20_ = g_strconcat ("X-", _data_->_tmp19_, NULL);
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_tmp22_ = NULL;
			_data_->_tmp22_ = g_utf8_strup (_data_->_tmp21_, (gssize) (-1));
			_data_->_tmp23_ = _data_->_tmp22_;
			_g_free0 (_data_->_tmp21_);
			_data_->attrib_name = _data_->_tmp23_;
			_data_->added = FALSE;
			{
				_data_->_tmp24_ = _data_->im_fds;
				_data_->_tmp25_ = _data_->proto;
				_data_->_tmp26_ = NULL;
				_data_->_tmp26_ = gee_multi_map_get (_data_->_tmp24_, _data_->_tmp25_);
				_data_->_tmp27_ = _data_->_tmp26_;
				_data_->_tmp28_ = NULL;
				_data_->_tmp28_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp27_);
				_data_->_tmp29_ = _data_->_tmp28_;
				_g_object_unref0 (_data_->_tmp27_);
				_data_->_im_fd_it = _data_->_tmp29_;
				while (TRUE) {
					_data_->_tmp30_ = _data_->_im_fd_it;
					_data_->_tmp31_ = FALSE;
					_data_->_tmp31_ = gee_iterator_next (_data_->_tmp30_);
					if (!_data_->_tmp31_) {
						break;
					}
					_data_->_tmp32_ = _data_->_im_fd_it;
					_data_->_tmp33_ = NULL;
					_data_->_tmp33_ = gee_iterator_get (_data_->_tmp32_);
					_data_->im_fd = (FolksImFieldDetails*) _data_->_tmp33_;
					_data_->_tmp34_ = _data_->attrib_name;
					_data_->_tmp35_ = e_vcard_attribute_new (NULL, _data_->_tmp34_);
					_data_->attr_n = _data_->_tmp35_;
					_data_->_tmp36_ = _data_->attr_n;
					_data_->_tmp37_ = _data_->im_fd;
					_data_->_tmp38_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp37_);
					_data_->_tmp39_ = _data_->_tmp38_;
					e_vcard_attribute_add_value (_data_->_tmp36_, (const gchar*) _data_->_tmp39_);
					_data_->_tmp40_ = _data_->attr_n;
					_data_->_tmp41_ = __vala_EVCardAttribute_copy0 (_data_->_tmp40_);
					_data_->attributes = g_list_prepend (_data_->attributes, _data_->_tmp41_);
					_data_->added = TRUE;
					__vala_EVCardAttribute_free0 (_data_->attr_n);
					_g_object_unref0 (_data_->im_fd);
				}
				_g_object_unref0 (_data_->_im_fd_it);
			}
			_data_->_tmp42_ = _data_->added;
			if (_data_->_tmp42_) {
				_data_->_tmp43_ = _data_->im_eds_map;
				_data_->_tmp44_ = _data_->proto;
				_data_->_tmp45_ = NULL;
				_data_->_tmp45_ = g_hash_table_lookup (_data_->_tmp43_, _data_->_tmp44_);
				_data_->field_id_t = GPOINTER_TO_INT (_data_->_tmp45_);
				_data_->_tmp46_ = _data_->contact;
				_data_->_tmp47_ = _data_->field_id_t;
				_data_->_tmp48_ = _data_->attributes;
				e_contact_set_attributes (_data_->_tmp46_, _data_->_tmp47_, _data_->_tmp48_);
			}
			_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_) {
	EdsfPersonaStoreSetGroupsData* _data_;
	_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->_groups_supported;
	if (_data_->_tmp0_ == 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;
	}
	{
		_data_->_tmp1_ = _data_->persona;
		_data_->_tmp2_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp1_));
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = _g_object_ref0 (_data_->_tmp3_);
		_data_->contact = _data_->_tmp4_;
		_data_->_tmp5_ = _data_->contact;
		_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_->self->priv->_addressbook;
		_data_->_tmp8_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp7_, _data_->_tmp8_, NULL, _edsf_persona_store_set_groups_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch26_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally26;
	__catch26_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp9_ = _data_->_error_;
		_data_->_tmp10_ = _data_->_tmp9_->message;
		g_warning ("edsf-persona-store.vala:1158: Can't update groups: %s\n", _data_->_tmp10_);
		_g_error_free0 (_data_->_error_);
	}
	__finally26:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_) {
	EdsfPersonaStoreSetGenderData* _data_;
	_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_->persona;
		_data_->_tmp1_ = edsf_persona_get_contact (EDSF_PERSONA (_data_->_tmp0_));
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
		_data_->contact = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->contact;
		_data_->_tmp5_ = _data_->gender;
		_data_->_state_ = 1;
		_edsf_persona_store_set_contact_gender (_data_->self, _data_->_tmp4_, _data_->_tmp5_, _edsf_persona_store_set_gender_ready, _data_);
		return FALSE;
		_state_1:
		_edsf_persona_store_set_contact_gender_finish (_data_->self, _data_->_res_);
		_data_->_tmp6_ = _data_->self->priv->_addressbook;
		_data_->_tmp7_ = _data_->contact;
		_data_->_state_ = 2;
		e_book_client_modify_contact (_data_->_tmp6_, _data_->_tmp7_, NULL, _edsf_persona_store_set_gender_ready, _data_);
		return FALSE;
		_state_2:
		e_book_client_modify_contact_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->contact);
			goto __catch27_g_error;
		}
		_g_object_unref0 (_data_->contact);
	}
	goto __finally27;
	__catch27_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp8_ = _data_->e;
		_data_->_tmp9_ = _data_->_tmp8_->message;
		g_warning ("edsf-persona-store.vala:1190: Can't set gender: %s", _data_->_tmp9_);
		_g_error_free0 (_data_->e);
	}
	__finally27:
	if (_data_->_inner_error_ != 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;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_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_->_tmp2_ = __vala_EVCardAttribute_copy0 (_data_->_tmp1_);
	_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_);
	}
	_data_->_tmp6_ = _data_->gender;
	switch (_data_->_tmp6_) {
		case FOLKS_GENDER_UNSPECIFIED:
		{
			break;
		}
		case FOLKS_GENDER_MALE:
		{
			_data_->_tmp7_ = e_vcard_attribute_new (NULL, EDSF_PERSONA_gender_attribute_name);
			__vala_EVCardAttribute_free0 (_data_->attr);
			_data_->attr = _data_->_tmp7_;
			_data_->_tmp8_ = _data_->attr;
			e_vcard_attribute_add_value (_data_->_tmp8_, EDSF_PERSONA_gender_male);
			_data_->_tmp9_ = _data_->contact;
			_data_->_tmp10_ = _data_->attr;
			_data_->_tmp11_ = __vala_EVCardAttribute_copy0 (_data_->_tmp10_);
			e_vcard_add_attribute ((EVCard*) _data_->_tmp9_, _data_->_tmp11_);
			break;
		}
		case FOLKS_GENDER_FEMALE:
		{
			_data_->_tmp12_ = e_vcard_attribute_new (NULL, EDSF_PERSONA_gender_attribute_name);
			__vala_EVCardAttribute_free0 (_data_->attr);
			_data_->attr = _data_->_tmp12_;
			_data_->_tmp13_ = _data_->attr;
			e_vcard_attribute_add_value (_data_->_tmp13_, EDSF_PERSONA_gender_female);
			_data_->_tmp14_ = _data_->contact;
			_data_->_tmp15_ = _data_->attr;
			_data_->_tmp16_ = __vala_EVCardAttribute_copy0 (_data_->_tmp15_);
			e_vcard_add_attribute ((EVCard*) _data_->_tmp14_, _data_->_tmp16_);
			break;
		}
		default:
		break;
	}
	__vala_EVCardAttribute_free0 (_data_->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_;
	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);
					}
				}
			}
		}
		__finally28:
		{
			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);
	}
	_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 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;
	gboolean _tmp1_;
	FolksMaybeBool _tmp2_;
	self = (EdsfPersonaStore*) base;
	_tmp1_ = self->priv->_groups_supported;
	if (_tmp1_) {
		_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 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) {
	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_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");
	/**
	   * 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");
}


static void edsf_persona_store_instance_init (EdsfPersonaStore * self) {
	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->_addressbook_uri = NULL;
	self->priv->_groups_supported = FALSE;
}


static void edsf_persona_store_finalize (GObject* obj) {
	EdsfPersonaStore * self;
	GError * _inner_error_ = NULL;
	self = EDSF_PERSONA_STORE (obj);
	{
		EBookClientView* _tmp0_;
		EBookClient* _tmp8_;
		_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 __catch4_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;
		}
	}
	goto __finally4;
	__catch4_g_error:
	{
		GError* e = NULL;
		GError* _tmp12_;
		const gchar* _tmp13_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		g_warning ("edsf-persona-store.vala:198: ~PersonaStore: %s\n", _tmp13_);
		_g_error_free0 (e);
	}
	__finally4:
	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_free0 (self->priv->_addressbook_uri);
	_g_object_unref0 (self->priv->_source);
	_g_free0 (self->priv->_query_str);
	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_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;
}



