/* edsf-persona.c generated by valac 0.14.0.3-1a311, the Vala compiler
 * generated from edsf-persona.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>
 *       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 <gio/gio.h>


#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;
typedef struct _EdsfPersonaPrivate EdsfPersonaPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

#define EDSF_PERSONA_TYPE_URL_TYPE_MAPPING (edsf_persona_url_type_mapping_get_type ())
typedef struct _EdsfPersonaUrlTypeMapping EdsfPersonaUrlTypeMapping;

#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 _EdsfPersonaChangeWebServiceAddressesData EdsfPersonaChangeWebServiceAddressesData;
typedef struct _EdsfPersonaChangeLocalIdsData EdsfPersonaChangeLocalIdsData;
typedef struct _EdsfPersonaChangePostalAddressesData EdsfPersonaChangePostalAddressesData;
typedef struct _EdsfPersonaChangePhoneNumbersData EdsfPersonaChangePhoneNumbersData;
typedef struct _EdsfPersonaChangeEmailAddressesData EdsfPersonaChangeEmailAddressesData;
typedef struct _EdsfPersonaChangeNotesData EdsfPersonaChangeNotesData;
typedef struct _EdsfPersonaChangeAvatarData EdsfPersonaChangeAvatarData;
typedef struct _EdsfPersonaChangeStructuredNameData EdsfPersonaChangeStructuredNameData;
typedef struct _EdsfPersonaChangeFullNameData EdsfPersonaChangeFullNameData;
typedef struct _EdsfPersonaChangeNicknameData EdsfPersonaChangeNicknameData;
typedef struct _EdsfPersonaChangeGenderData EdsfPersonaChangeGenderData;
typedef struct _EdsfPersonaChangeUrlsData EdsfPersonaChangeUrlsData;
typedef struct _EdsfPersonaChangeImAddressesData EdsfPersonaChangeImAddressesData;
typedef struct _EdsfPersonaChangeGroupData EdsfPersonaChangeGroupData;
typedef struct _EdsfPersonaChangeGroupsData EdsfPersonaChangeGroupsData;
typedef struct _EdsfPersonaChangeBirthdayData EdsfPersonaChangeBirthdayData;
typedef struct _EdsfPersonaChangeRolesData EdsfPersonaChangeRolesData;
#define __vala_EVCardAttribute_free0(var) ((var == NULL) ? NULL : (var = (_vala_EVCardAttribute_free (var), NULL)))
#define __vala_EContactDate_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactDate_free (var), NULL)))

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

typedef struct _EdsfSetComparator EdsfSetComparator;
typedef struct _EdsfSetComparatorClass EdsfSetComparatorClass;
#define __vala_EVCardAttributeParam_free0(var) ((var == NULL) ? NULL : (var = (_vala_EVCardAttributeParam_free (var), NULL)))
#define __g_list_free___vala_EVCardAttribute_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free___vala_EVCardAttribute_free0_ (var), NULL)))
#define __vala_EContactName_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactName_free (var), NULL)))

#define EDSF_TYPE_MEMORY_ICON (edsf_memory_icon_get_type ())
#define EDSF_MEMORY_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_TYPE_MEMORY_ICON, EdsfMemoryIcon))
#define EDSF_MEMORY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_TYPE_MEMORY_ICON, EdsfMemoryIconClass))
#define EDSF_IS_MEMORY_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_TYPE_MEMORY_ICON))
#define EDSF_IS_MEMORY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_TYPE_MEMORY_ICON))
#define EDSF_MEMORY_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_TYPE_MEMORY_ICON, EdsfMemoryIconClass))

typedef struct _EdsfMemoryIcon EdsfMemoryIcon;
typedef struct _EdsfMemoryIconClass EdsfMemoryIconClass;
typedef struct _Block1Data Block1Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define __vala_EContactPhoto_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactPhoto_free (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

struct _EdsfPersona {
	FolksPersona parent_instance;
	EdsfPersonaPrivate * priv;
};

struct _EdsfPersonaClass {
	FolksPersonaClass parent_class;
};

struct _EdsfPersonaPrivate {
	GeeHashSet* _phone_numbers;
	GeeSet* _phone_numbers_ro;
	GeeHashSet* _email_addresses;
	GeeSet* _email_addresses_ro;
	GeeHashSet* _notes;
	GeeSet* _notes_ro;
	GeeHashSet* _postal_addresses;
	GeeSet* _postal_addresses_ro;
	GeeHashSet* _local_ids;
	GeeSet* _local_ids_ro;
	GeeHashMultiMap* _web_service_addresses;
	EContact* _contact;
	GLoadableIcon* _avatar;
	FolksStructuredName* _structured_name;
	gchar* _contact_id;
	gchar* _full_name;
	gchar* _nickname;
	FolksGender _gender;
	GeeHashSet* _urls;
	GeeSet* _urls_ro;
	GeeHashMultiMap* _im_addresses;
	GeeHashSet* _groups;
	GeeSet* _groups_ro;
	GDateTime* _birthday;
	GeeHashSet* _roles;
	GeeSet* _roles_ro;
};

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

struct _EdsfPersonaChangeWebServiceAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeMultiMap* web_service_addresses;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeMultiMap* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeLocalIdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeSet* local_ids;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeSet* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangePostalAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeSet* postal_addresses;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeSet* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangePhoneNumbersData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeSet* phone_numbers;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeSet* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeEmailAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeSet* email_addresses;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeSet* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeNotesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeSet* notes;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeSet* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeAvatarData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GLoadableIcon* avatar;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GLoadableIcon* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeStructuredNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	FolksStructuredName* structured_name;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	FolksStructuredName* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeFullNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	gchar* full_name;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	const gchar* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeNicknameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	gchar* nickname;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	const gchar* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeGenderData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	FolksGender gender;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	FolksGender _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeUrlsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeSet* urls;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeSet* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeImAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeMultiMap* im_addresses;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeMultiMap* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeGroupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	gchar* group;
	gboolean is_member;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GeeHashSet* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	GeeHashSet* _tmp9_;
	const gchar* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	GeeHashSet* _tmp14_;
	GeeHashSet* new_groups;
	GeeHashSet* _tmp15_;
	GeeIterator* _tmp16_;
	GeeIterator* _category_name_it;
	GeeIterator* _tmp17_;
	gboolean _tmp18_;
	GeeIterator* _tmp19_;
	gpointer _tmp20_;
	gchar* category_name;
	GeeHashSet* _tmp21_;
	const gchar* _tmp22_;
	gboolean _tmp23_;
	GeeHashSet* _tmp24_;
	const gchar* _tmp25_;
	GeeHashSet* _tmp26_;
	const gchar* _tmp27_;
	GeeHashSet* _tmp28_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeGroupsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeSet* groups;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeSet* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeBirthdayData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GDateTime* bday;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GDateTime* _tmp2_;
	GError * _inner_error_;
};

struct _EdsfPersonaChangeRolesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	GeeSet* roles;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GeeSet* _tmp2_;
	GError * _inner_error_;
};

struct _Block1Data {
	int _ref_count_;
	EdsfPersona * self;
	FolksAvatarCache* cache;
	GLoadableIcon* new_avatar;
};


static gpointer edsf_persona_parent_class = NULL;
static GHashTable* edsf_persona__im_eds_map;
static GStaticRecMutex __lock_edsf_persona__im_eds_map = {0};
static GHashTable* edsf_persona__im_eds_map = NULL;
static GTimeZone* edsf_persona__local_time_zone;
static GTimeZone* edsf_persona__local_time_zone = NULL;
static FolksAvatarDetailsIface* edsf_persona_folks_avatar_details_parent_iface = NULL;
static FolksBirthdayDetailsIface* edsf_persona_folks_birthday_details_parent_iface = NULL;
static FolksEmailDetailsIface* edsf_persona_folks_email_details_parent_iface = NULL;
static FolksGenderDetailsIface* edsf_persona_folks_gender_details_parent_iface = NULL;
static FolksGroupDetailsIface* edsf_persona_folks_group_details_parent_iface = NULL;
static FolksImDetailsIface* edsf_persona_folks_im_details_parent_iface = NULL;
static FolksLocalIdDetailsIface* edsf_persona_folks_local_id_details_parent_iface = NULL;
static FolksNameDetailsIface* edsf_persona_folks_name_details_parent_iface = NULL;
static FolksNoteDetailsIface* edsf_persona_folks_note_details_parent_iface = NULL;
static FolksPhoneDetailsIface* edsf_persona_folks_phone_details_parent_iface = NULL;
static FolksRoleDetailsIface* edsf_persona_folks_role_details_parent_iface = NULL;
static FolksUrlDetailsIface* edsf_persona_folks_url_details_parent_iface = NULL;
static FolksPostalAddressDetailsIface* edsf_persona_folks_postal_address_details_parent_iface = NULL;
static FolksWebServiceDetailsIface* edsf_persona_folks_web_service_details_parent_iface = NULL;

GType edsf_persona_get_type (void) G_GNUC_CONST;
#define EDSF_PERSONA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EDSF_TYPE_PERSONA, EdsfPersonaPrivate))
enum  {
	EDSF_PERSONA_DUMMY_PROPERTY,
	EDSF_PERSONA_CONTACT,
	EDSF_PERSONA_WEB_SERVICE_ADDRESSES,
	EDSF_PERSONA_LOCAL_IDS,
	EDSF_PERSONA_POSTAL_ADDRESSES,
	EDSF_PERSONA_PHONE_NUMBERS,
	EDSF_PERSONA_EMAIL_ADDRESSES,
	EDSF_PERSONA_NOTES,
	EDSF_PERSONA_LINKABLE_PROPERTIES,
	EDSF_PERSONA_WRITEABLE_PROPERTIES,
	EDSF_PERSONA_AVATAR,
	EDSF_PERSONA_STRUCTURED_NAME,
	EDSF_PERSONA_CONTACT_ID,
	EDSF_PERSONA_FULL_NAME,
	EDSF_PERSONA_NICKNAME,
	EDSF_PERSONA_GENDER,
	EDSF_PERSONA_URLS,
	EDSF_PERSONA_IM_ADDRESSES,
	EDSF_PERSONA_GROUPS,
	EDSF_PERSONA_CALENDAR_EVENT_ID,
	EDSF_PERSONA_BIRTHDAY,
	EDSF_PERSONA_ROLES
};
static GType edsf_persona_url_type_mapping_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static EdsfPersonaUrlTypeMapping* edsf_persona_url_type_mapping_dup (const EdsfPersonaUrlTypeMapping* self);
static void edsf_persona_url_type_mapping_free (EdsfPersonaUrlTypeMapping* self);
static void edsf_persona_url_type_mapping_copy (const EdsfPersonaUrlTypeMapping* self, EdsfPersonaUrlTypeMapping* dest);
static void edsf_persona_url_type_mapping_destroy (EdsfPersonaUrlTypeMapping* self);
#define EDSF_PERSONA_gender_attribute_name "X-GENDER"
#define EDSF_PERSONA_gender_male "M"
#define EDSF_PERSONA_gender_female "F"
static void edsf_persona_real_change_web_service_addresses_data_free (gpointer _data);
static void edsf_persona_real_change_web_service_addresses (FolksWebServiceDetails* base, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_web_service_addresses_co (EdsfPersonaChangeWebServiceAddressesData* _data_);
GType edsf_persona_store_get_type (void) G_GNUC_CONST;
void _edsf_persona_store_set_web_service_addresses (EdsfPersonaStore* self, EdsfPersona* persona, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_web_service_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_web_service_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_local_ids_data_free (gpointer _data);
static void edsf_persona_real_change_local_ids (FolksLocalIdDetails* base, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_local_ids_co (EdsfPersonaChangeLocalIdsData* _data_);
void _edsf_persona_store_set_local_ids (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_local_ids_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_local_ids_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_postal_addresses_data_free (gpointer _data);
static void edsf_persona_real_change_postal_addresses (FolksPostalAddressDetails* base, GeeSet* postal_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_postal_addresses_co (EdsfPersonaChangePostalAddressesData* _data_);
void _edsf_persona_store_set_postal_addresses (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* postal_fds, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_postal_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_phone_numbers_data_free (gpointer _data);
static void edsf_persona_real_change_phone_numbers (FolksPhoneDetails* base, GeeSet* phone_numbers, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_phone_numbers_co (EdsfPersonaChangePhoneNumbersData* _data_);
void _edsf_persona_store_set_phones (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* phones, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_phones_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_phone_numbers_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_email_addresses_data_free (gpointer _data);
static void edsf_persona_real_change_email_addresses (FolksEmailDetails* base, GeeSet* email_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_email_addresses_co (EdsfPersonaChangeEmailAddressesData* _data_);
void _edsf_persona_store_set_emails (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* emails, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_emails_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_email_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_notes_data_free (gpointer _data);
static void edsf_persona_real_change_notes (FolksNoteDetails* base, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_notes_co (EdsfPersonaChangeNotesData* _data_);
void _edsf_persona_store_set_notes (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_notes_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_notes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_avatar_data_free (gpointer _data);
static void edsf_persona_real_change_avatar (FolksAvatarDetails* base, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_avatar_co (EdsfPersonaChangeAvatarData* _data_);
void _edsf_persona_store_set_avatar (EdsfPersonaStore* self, EdsfPersona* persona, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_avatar_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_structured_name_data_free (gpointer _data);
static void edsf_persona_real_change_structured_name (FolksNameDetails* base, FolksStructuredName* structured_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_structured_name_co (EdsfPersonaChangeStructuredNameData* _data_);
void _edsf_persona_store_set_structured_name (EdsfPersonaStore* self, EdsfPersona* persona, FolksStructuredName* sname, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_structured_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_structured_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_full_name_data_free (gpointer _data);
static void edsf_persona_real_change_full_name (FolksNameDetails* base, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_full_name_co (EdsfPersonaChangeFullNameData* _data_);
void _edsf_persona_store_set_full_name (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_full_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_full_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_nickname_data_free (gpointer _data);
static void edsf_persona_real_change_nickname (FolksNameDetails* base, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_nickname_co (EdsfPersonaChangeNicknameData* _data_);
void _edsf_persona_store_set_nickname (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_nickname_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_nickname_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_gender_data_free (gpointer _data);
static void edsf_persona_real_change_gender (FolksGenderDetails* base, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_gender_co (EdsfPersonaChangeGenderData* _data_);
void _edsf_persona_store_set_gender (EdsfPersonaStore* self, EdsfPersona* persona, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_gender_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_gender_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_urls_data_free (gpointer _data);
static void edsf_persona_real_change_urls (FolksUrlDetails* base, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_urls_co (EdsfPersonaChangeUrlsData* _data_);
void _edsf_persona_store_set_urls (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_urls_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_urls_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_im_addresses_data_free (gpointer _data);
static void edsf_persona_real_change_im_addresses (FolksImDetails* base, GeeMultiMap* im_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_im_addresses_co (EdsfPersonaChangeImAddressesData* _data_);
void _edsf_persona_store_set_im_fds (EdsfPersonaStore* self, EdsfPersona* persona, GeeMultiMap* im_fds, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_im_fds_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_im_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_group_data_free (gpointer _data);
static void edsf_persona_real_change_group (FolksGroupDetails* base, const gchar* group, gboolean is_member, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_group_co (EdsfPersonaChangeGroupData* _data_);
static void edsf_persona_change_group_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_groups_data_free (gpointer _data);
static void edsf_persona_real_change_groups (FolksGroupDetails* base, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_groups_co (EdsfPersonaChangeGroupsData* _data_);
void _edsf_persona_store_set_groups (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_groups_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_birthday_data_free (gpointer _data);
static void edsf_persona_real_change_birthday (FolksBirthdayDetails* base, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_birthday_co (EdsfPersonaChangeBirthdayData* _data_);
void _edsf_persona_store_set_birthday (EdsfPersonaStore* self, EdsfPersona* persona, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_birthday_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_birthday_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void edsf_persona_real_change_roles_data_free (gpointer _data);
static void edsf_persona_real_change_roles (FolksRoleDetails* base, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_roles_co (EdsfPersonaChangeRolesData* _data_);
void _edsf_persona_store_set_roles (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_roles_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_roles_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
gchar* edsf_persona_build_iid_from_contact (const gchar* store_id, EContact* contact);
void* _edsf_persona_get_property_from_contact (EContact* contact, const gchar* prop_name);
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_set_contact_id (EdsfPersona* self, const gchar* value);
void _edsf_persona_update (EdsfPersona* self, EContact* contact);
static void edsf_persona_real_linkable_property_to_links (FolksPersona* base, const gchar* prop_name, FolksPersonaLinkablePropertyCallback callback, void* callback_target);
static void edsf_persona_set_contact (EdsfPersona* self, EContact* value);
static void _edsf_persona_update_names (EdsfPersona* self);
static void _edsf_persona_update_avatar (EdsfPersona* self);
static void _edsf_persona_update_urls (EdsfPersona* self);
static void _edsf_persona_update_phones (EdsfPersona* self);
static void _edsf_persona_update_addresses (EdsfPersona* self);
static void _edsf_persona_update_emails (EdsfPersona* self);
static void _edsf_persona_update_im_addresses (EdsfPersona* self);
static void _edsf_persona_update_groups (EdsfPersona* self);
static void _edsf_persona_update_notes (EdsfPersona* self);
static void _edsf_persona_update_local_ids (EdsfPersona* self);
static void _edsf_persona_update_web_services_addresses (EdsfPersona* self);
static void _edsf_persona_update_gender (EdsfPersona* self);
static void _edsf_persona_update_birthday (EdsfPersona* self);
static void _edsf_persona_update_roles (EdsfPersona* self);
static void _edsf_persona_update_params (EdsfPersona* self, FolksAbstractFieldDetails* details, EVCardAttribute* attr);
EContact* edsf_persona_get_contact (EdsfPersona* self);
static EVCardAttribute* _vala_EVCardAttribute_copy (EVCardAttribute* self);
static void _vala_EVCardAttribute_free (EVCardAttribute* self);
static void* _edsf_persona_get_property (EdsfPersona* self, const gchar* prop_name);
static EContactDate* _vala_EContactDate_copy (EContactDate* self);
static void _vala_EContactDate_free (EContactDate* self);
static FolksRoleFieldDetails* _edsf_persona_get_default_role (EdsfPersona* self);
EdsfSetComparator* edsf_set_comparator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
EdsfSetComparator* edsf_set_comparator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
GType edsf_set_comparator_get_type (void) G_GNUC_CONST;
gboolean edsf_set_comparator_equal (EdsfSetComparator* self, GeeSet* a, GeeSet* b);
static EVCardAttributeParam* _vala_EVCardAttributeParam_copy (EVCardAttributeParam* self);
static void _vala_EVCardAttributeParam_free (EVCardAttributeParam* self);
static void __vala_EVCardAttribute_free0_ (gpointer var);
static void _g_list_free___vala_EVCardAttribute_free0_ (GList* self);
static EContactName* _vala_EContactName_copy (EContactName* self);
static void _vala_EContactName_free (EContactName* self);
static GLoadableIcon* _edsf_persona_contact_photo_to_loadable_icon (EdsfPersona* self, EContactPhoto* p);
EdsfMemoryIcon* edsf_memory_icon_new (const gchar* image_type, guint8* image_data, int image_data_length1);
EdsfMemoryIcon* edsf_memory_icon_construct (GType object_type, const gchar* image_type, guint8* image_data, int image_data_length1);
GType edsf_memory_icon_get_type (void) G_GNUC_CONST;
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static EContactPhoto* _vala_EContactPhoto_copy (EContactPhoto* self);
static void ___lambda2_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
static void ____lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void ____lambda5_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
static void _____lambda5__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _vala_EContactPhoto_free (EContactPhoto* self);
GHashTable* _edsf_persona_get_im_eds_map (void);
static gchar* _edsf_persona_im_proto_from_addr (EdsfPersona* self, const gchar* addr);
static void _g_free0_ (gpointer var);
static FolksPostalAddress* _edsf_persona_postal_address_from_attribute (EdsfPersona* self, EVCardAttribute* attr);
const gchar* edsf_persona_get_contact_id (EdsfPersona* self);
static void edsf_persona_finalize (GObject* obj);
static void _vala_edsf_persona_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_edsf_persona_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

const gchar* EDSF_PERSONA_phone_fields[12] = {"assistant_phone", "business_phone", "business_phone_2", "callback_phone", "car_phone", "company_phone", "home_phone", "home_phone_2", "isdn_phone", "mobile_phone", "other_phone", "primary_phone"};
const gchar* EDSF_PERSONA_address_fields[3] = {"address_home", "address_other", "address_work"};
const gchar* EDSF_PERSONA_email_fields[4] = {"email_1", "email_2", "email_3", "email_4"};
const gchar* EDSF_PERSONA_url_properties[4] = {"blog_url", "fburl", "homepage_url", "video_url"};
const EdsfPersonaUrlTypeMapping EDSF_PERSONA__url_properties[4] = {{"homepage_url", FOLKS_URL_FIELD_DETAILS_PARAM_TYPE_HOME_PAGE}, {"blog_url", FOLKS_URL_FIELD_DETAILS_PARAM_TYPE_BLOG}, {"fburl", "x-free-busy"}, {"video_url", "x-video"}};
static const gchar* EDSF_PERSONA__linkable_properties[3] = {"im-addresses", "local-ids", "web-service-addresses"};

static void edsf_persona_real_change_web_service_addresses_data_free (gpointer _data) {
	EdsfPersonaChangeWebServiceAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->web_service_addresses);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeWebServiceAddressesData, _data_);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void edsf_persona_real_change_web_service_addresses (FolksWebServiceDetails* base, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeWebServiceAddressesData* _data_;
	EdsfPersona* _tmp0_;
	GeeMultiMap* _tmp1_;
	GeeMultiMap* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeWebServiceAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_web_service_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_web_service_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = web_service_addresses;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->web_service_addresses = _tmp2_;
	edsf_persona_real_change_web_service_addresses_co (_data_);
}


static void edsf_persona_real_change_web_service_addresses_finish (FolksWebServiceDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeWebServiceAddressesData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_web_service_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeWebServiceAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_web_service_addresses_co (_data_);
}


static gboolean edsf_persona_real_change_web_service_addresses_co (EdsfPersonaChangeWebServiceAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->web_service_addresses;
	_data_->_state_ = 1;
	_edsf_persona_store_set_web_service_addresses (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_web_service_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_web_service_addresses_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_local_ids_data_free (gpointer _data) {
	EdsfPersonaChangeLocalIdsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->local_ids);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeLocalIdsData, _data_);
}


static void edsf_persona_real_change_local_ids (FolksLocalIdDetails* base, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeLocalIdsData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeLocalIdsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_local_ids);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_local_ids_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = local_ids;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->local_ids = _tmp2_;
	edsf_persona_real_change_local_ids_co (_data_);
}


static void edsf_persona_real_change_local_ids_finish (FolksLocalIdDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeLocalIdsData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_local_ids_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeLocalIdsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_local_ids_co (_data_);
}


static gboolean edsf_persona_real_change_local_ids_co (EdsfPersonaChangeLocalIdsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->local_ids;
	_data_->_state_ = 1;
	_edsf_persona_store_set_local_ids (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_local_ids_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_local_ids_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_postal_addresses_data_free (gpointer _data) {
	EdsfPersonaChangePostalAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->postal_addresses);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangePostalAddressesData, _data_);
}


static void edsf_persona_real_change_postal_addresses (FolksPostalAddressDetails* base, GeeSet* postal_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangePostalAddressesData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangePostalAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_postal_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_postal_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = postal_addresses;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->postal_addresses = _tmp2_;
	edsf_persona_real_change_postal_addresses_co (_data_);
}


static void edsf_persona_real_change_postal_addresses_finish (FolksPostalAddressDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangePostalAddressesData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangePostalAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_postal_addresses_co (_data_);
}


static gboolean edsf_persona_real_change_postal_addresses_co (EdsfPersonaChangePostalAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->postal_addresses;
	_data_->_state_ = 1;
	_edsf_persona_store_set_postal_addresses (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_postal_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_postal_addresses_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_phone_numbers_data_free (gpointer _data) {
	EdsfPersonaChangePhoneNumbersData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->phone_numbers);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangePhoneNumbersData, _data_);
}


static void edsf_persona_real_change_phone_numbers (FolksPhoneDetails* base, GeeSet* phone_numbers, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangePhoneNumbersData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangePhoneNumbersData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_phone_numbers);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_phone_numbers_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = phone_numbers;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->phone_numbers = _tmp2_;
	edsf_persona_real_change_phone_numbers_co (_data_);
}


static void edsf_persona_real_change_phone_numbers_finish (FolksPhoneDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangePhoneNumbersData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_phone_numbers_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangePhoneNumbersData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_phone_numbers_co (_data_);
}


static gboolean edsf_persona_real_change_phone_numbers_co (EdsfPersonaChangePhoneNumbersData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->phone_numbers;
	_data_->_state_ = 1;
	_edsf_persona_store_set_phones (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_phone_numbers_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_phones_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_email_addresses_data_free (gpointer _data) {
	EdsfPersonaChangeEmailAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->email_addresses);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeEmailAddressesData, _data_);
}


static void edsf_persona_real_change_email_addresses (FolksEmailDetails* base, GeeSet* email_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeEmailAddressesData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeEmailAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_email_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_email_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = email_addresses;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->email_addresses = _tmp2_;
	edsf_persona_real_change_email_addresses_co (_data_);
}


static void edsf_persona_real_change_email_addresses_finish (FolksEmailDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeEmailAddressesData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_email_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeEmailAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_email_addresses_co (_data_);
}


static gboolean edsf_persona_real_change_email_addresses_co (EdsfPersonaChangeEmailAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->email_addresses;
	_data_->_state_ = 1;
	_edsf_persona_store_set_emails (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_email_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_emails_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_notes_data_free (gpointer _data) {
	EdsfPersonaChangeNotesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->notes);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeNotesData, _data_);
}


static void edsf_persona_real_change_notes (FolksNoteDetails* base, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeNotesData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeNotesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_notes);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_notes_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = notes;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->notes = _tmp2_;
	edsf_persona_real_change_notes_co (_data_);
}


static void edsf_persona_real_change_notes_finish (FolksNoteDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeNotesData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_notes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeNotesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_notes_co (_data_);
}


static gboolean edsf_persona_real_change_notes_co (EdsfPersonaChangeNotesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->notes;
	_data_->_state_ = 1;
	_edsf_persona_store_set_notes (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_notes_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_notes_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_avatar_data_free (gpointer _data) {
	EdsfPersonaChangeAvatarData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->avatar);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeAvatarData, _data_);
}


static void edsf_persona_real_change_avatar (FolksAvatarDetails* base, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeAvatarData* _data_;
	EdsfPersona* _tmp0_;
	GLoadableIcon* _tmp1_;
	GLoadableIcon* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeAvatarData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_avatar);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_avatar_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = avatar;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->avatar = _tmp2_;
	edsf_persona_real_change_avatar_co (_data_);
}


static void edsf_persona_real_change_avatar_finish (FolksAvatarDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeAvatarData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeAvatarData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_avatar_co (_data_);
}


static gboolean edsf_persona_real_change_avatar_co (EdsfPersonaChangeAvatarData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->avatar;
	_data_->_state_ = 1;
	_edsf_persona_store_set_avatar (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_avatar_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_avatar_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_structured_name_data_free (gpointer _data) {
	EdsfPersonaChangeStructuredNameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->structured_name);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeStructuredNameData, _data_);
}


static void edsf_persona_real_change_structured_name (FolksNameDetails* base, FolksStructuredName* structured_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeStructuredNameData* _data_;
	EdsfPersona* _tmp0_;
	FolksStructuredName* _tmp1_;
	FolksStructuredName* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeStructuredNameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_structured_name);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_structured_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = structured_name;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->structured_name = _tmp2_;
	edsf_persona_real_change_structured_name_co (_data_);
}


static void edsf_persona_real_change_structured_name_finish (FolksNameDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeStructuredNameData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_structured_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeStructuredNameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_structured_name_co (_data_);
}


static gboolean edsf_persona_real_change_structured_name_co (EdsfPersonaChangeStructuredNameData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->structured_name;
	_data_->_state_ = 1;
	_edsf_persona_store_set_structured_name (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_structured_name_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_structured_name_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void edsf_persona_real_change_full_name (FolksNameDetails* base, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeFullNameData* _data_;
	EdsfPersona* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeFullNameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_full_name);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_full_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = full_name;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->full_name = _tmp2_;
	edsf_persona_real_change_full_name_co (_data_);
}


static void edsf_persona_real_change_full_name_finish (FolksNameDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeFullNameData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_full_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeFullNameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_full_name_co (_data_);
}


static gboolean edsf_persona_real_change_full_name_co (EdsfPersonaChangeFullNameData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->full_name;
	_data_->_state_ = 1;
	_edsf_persona_store_set_full_name (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_full_name_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_full_name_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void edsf_persona_real_change_nickname (FolksNameDetails* base, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeNicknameData* _data_;
	EdsfPersona* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeNicknameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_nickname);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_nickname_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = nickname;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->nickname = _tmp2_;
	edsf_persona_real_change_nickname_co (_data_);
}


static void edsf_persona_real_change_nickname_finish (FolksNameDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeNicknameData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_nickname_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeNicknameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_nickname_co (_data_);
}


static gboolean edsf_persona_real_change_nickname_co (EdsfPersonaChangeNicknameData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->nickname;
	_data_->_state_ = 1;
	_edsf_persona_store_set_nickname (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_nickname_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_nickname_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void edsf_persona_real_change_gender (FolksGenderDetails* base, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeGenderData* _data_;
	EdsfPersona* _tmp0_;
	FolksGender _tmp1_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeGenderData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_gender);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_gender_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = gender;
	_data_->gender = _tmp1_;
	edsf_persona_real_change_gender_co (_data_);
}


static void edsf_persona_real_change_gender_finish (FolksGenderDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeGenderData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_gender_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeGenderData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_gender_co (_data_);
}


static gboolean edsf_persona_real_change_gender_co (EdsfPersonaChangeGenderData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->gender;
	_data_->_state_ = 1;
	_edsf_persona_store_set_gender (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_gender_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_gender_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_urls_data_free (gpointer _data) {
	EdsfPersonaChangeUrlsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->urls);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeUrlsData, _data_);
}


static void edsf_persona_real_change_urls (FolksUrlDetails* base, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeUrlsData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeUrlsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_urls);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_urls_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = urls;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->urls = _tmp2_;
	edsf_persona_real_change_urls_co (_data_);
}


static void edsf_persona_real_change_urls_finish (FolksUrlDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeUrlsData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_urls_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeUrlsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_urls_co (_data_);
}


static gboolean edsf_persona_real_change_urls_co (EdsfPersonaChangeUrlsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->urls;
	_data_->_state_ = 1;
	_edsf_persona_store_set_urls (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_urls_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_urls_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_im_addresses_data_free (gpointer _data) {
	EdsfPersonaChangeImAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->im_addresses);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeImAddressesData, _data_);
}


static void edsf_persona_real_change_im_addresses (FolksImDetails* base, GeeMultiMap* im_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeImAddressesData* _data_;
	EdsfPersona* _tmp0_;
	GeeMultiMap* _tmp1_;
	GeeMultiMap* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeImAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_im_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_im_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = im_addresses;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->im_addresses = _tmp2_;
	edsf_persona_real_change_im_addresses_co (_data_);
}


static void edsf_persona_real_change_im_addresses_finish (FolksImDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeImAddressesData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_im_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeImAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_im_addresses_co (_data_);
}


static gboolean edsf_persona_real_change_im_addresses_co (EdsfPersonaChangeImAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->im_addresses;
	_data_->_state_ = 1;
	_edsf_persona_store_set_im_fds (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_im_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_im_fds_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_group_data_free (gpointer _data) {
	EdsfPersonaChangeGroupData* _data_;
	_data_ = _data;
	_g_free0 (_data_->group);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeGroupData, _data_);
}


static void edsf_persona_real_change_group (FolksGroupDetails* base, const gchar* group, gboolean is_member, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeGroupData* _data_;
	EdsfPersona* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeGroupData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_group);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_group_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = group;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->group = _tmp2_;
	_tmp3_ = is_member;
	_data_->is_member = _tmp3_;
	edsf_persona_real_change_group_co (_data_);
}


static void edsf_persona_real_change_group_finish (FolksGroupDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeGroupData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.0
   */
static void edsf_persona_change_group_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeGroupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_group_co (_data_);
}


static gboolean edsf_persona_real_change_group_co (EdsfPersonaChangeGroupData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp2_ = _data_->is_member;
	if (_data_->_tmp2_ == TRUE) {
		_data_->_tmp3_ = _data_->self->priv->_groups;
		_data_->_tmp4_ = _data_->group;
		_data_->_tmp5_ = FALSE;
		_data_->_tmp5_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _data_->_tmp3_, _data_->_tmp4_);
		_data_->_tmp1_ = _data_->_tmp5_ == TRUE;
	} else {
		_data_->_tmp1_ = FALSE;
	}
	_data_->_tmp6_ = _data_->_tmp1_;
	if (_data_->_tmp6_) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp8_ = _data_->is_member;
		if (_data_->_tmp8_ == FALSE) {
			_data_->_tmp9_ = _data_->self->priv->_groups;
			_data_->_tmp10_ = _data_->group;
			_data_->_tmp11_ = FALSE;
			_data_->_tmp11_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _data_->_tmp9_, _data_->_tmp10_);
			_data_->_tmp7_ = _data_->_tmp11_ == FALSE;
		} else {
			_data_->_tmp7_ = FALSE;
		}
		_data_->_tmp12_ = _data_->_tmp7_;
		_data_->_tmp0_ = _data_->_tmp12_;
	}
	_data_->_tmp13_ = _data_->_tmp0_;
	if (_data_->_tmp13_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp14_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	_data_->new_groups = _data_->_tmp14_;
	{
		_data_->_tmp15_ = _data_->self->priv->_groups;
		_data_->_tmp16_ = NULL;
		_data_->_tmp16_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp15_);
		_data_->_category_name_it = _data_->_tmp16_;
		while (TRUE) {
			_data_->_tmp17_ = _data_->_category_name_it;
			_data_->_tmp18_ = FALSE;
			_data_->_tmp18_ = gee_iterator_next (_data_->_tmp17_);
			if (!_data_->_tmp18_) {
				break;
			}
			_data_->_tmp19_ = _data_->_category_name_it;
			_data_->_tmp20_ = NULL;
			_data_->_tmp20_ = gee_iterator_get (_data_->_tmp19_);
			_data_->category_name = (gchar*) _data_->_tmp20_;
			_data_->_tmp21_ = _data_->new_groups;
			_data_->_tmp22_ = _data_->category_name;
			gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp21_, _data_->_tmp22_);
			_g_free0 (_data_->category_name);
		}
		_g_object_unref0 (_data_->_category_name_it);
	}
	_data_->_tmp23_ = _data_->is_member;
	if (_data_->_tmp23_ == FALSE) {
		_data_->_tmp24_ = _data_->new_groups;
		_data_->_tmp25_ = _data_->group;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _data_->_tmp24_, _data_->_tmp25_);
	} else {
		_data_->_tmp26_ = _data_->new_groups;
		_data_->_tmp27_ = _data_->group;
		gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp26_, _data_->_tmp27_);
	}
	_data_->_tmp28_ = _data_->new_groups;
	_data_->_state_ = 1;
	folks_group_details_change_groups ((FolksGroupDetails*) _data_->self, (GeeSet*) _data_->_tmp28_, edsf_persona_change_group_ready, _data_);
	return FALSE;
	_state_1:
	folks_group_details_change_groups_finish ((FolksGroupDetails*) _data_->self, _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_object_unref0 (_data_->new_groups);
		if (_data_->_state_ == 0) {
			g_simple_async_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_->new_groups);
	if (_data_->_state_ == 0) {
		g_simple_async_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_real_change_groups_data_free (gpointer _data) {
	EdsfPersonaChangeGroupsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->groups);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeGroupsData, _data_);
}


static void edsf_persona_real_change_groups (FolksGroupDetails* base, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeGroupsData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeGroupsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_groups);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_groups_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = groups;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->groups = _tmp2_;
	edsf_persona_real_change_groups_co (_data_);
}


static void edsf_persona_real_change_groups_finish (FolksGroupDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeGroupsData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeGroupsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_groups_co (_data_);
}


static gboolean edsf_persona_real_change_groups_co (EdsfPersonaChangeGroupsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->groups;
	_data_->_state_ = 1;
	_edsf_persona_store_set_groups (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_groups_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_groups_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


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


static void edsf_persona_real_change_birthday (FolksBirthdayDetails* base, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeBirthdayData* _data_;
	EdsfPersona* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeBirthdayData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_birthday);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_birthday_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = bday;
	_tmp2_ = _g_date_time_ref0 (_tmp1_);
	_data_->bday = _tmp2_;
	edsf_persona_real_change_birthday_co (_data_);
}


static void edsf_persona_real_change_birthday_finish (FolksBirthdayDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeBirthdayData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_birthday_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeBirthdayData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_birthday_co (_data_);
}


static gboolean edsf_persona_real_change_birthday_co (EdsfPersonaChangeBirthdayData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->bday;
	_data_->_state_ = 1;
	_edsf_persona_store_set_birthday (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_birthday_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_birthday_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void edsf_persona_real_change_roles_data_free (gpointer _data) {
	EdsfPersonaChangeRolesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->roles);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeRolesData, _data_);
}


static void edsf_persona_real_change_roles (FolksRoleDetails* base, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeRolesData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeRolesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_roles);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_roles_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = roles;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->roles = _tmp2_;
	edsf_persona_real_change_roles_co (_data_);
}


static void edsf_persona_real_change_roles_finish (FolksRoleDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeRolesData* _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_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void edsf_persona_change_roles_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeRolesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_roles_co (_data_);
}


static gboolean edsf_persona_real_change_roles_co (EdsfPersonaChangeRolesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->roles;
	_data_->_state_ = 1;
	_edsf_persona_store_set_roles (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_roles_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_roles_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


/**
   * Build a IID.
   *
   * @param store_id the {@link PersonaStore.id}
   * @param contact the Contact
   * @return a valid IID
   *
   * @since 0.6.0
   */
gchar* edsf_persona_build_iid_from_contact (const gchar* store_id, EContact* contact) {
	gchar* result = NULL;
	EContact* _tmp0_;
	void* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* contact_id;
	const gchar* _tmp3_;
	gchar* _tmp4_ = NULL;
	g_return_val_if_fail (store_id != NULL, NULL);
	g_return_val_if_fail (contact != NULL, NULL);
	_tmp0_ = contact;
	_tmp1_ = _edsf_persona_get_property_from_contact (_tmp0_, "id");
	_tmp2_ = g_strdup ((const gchar*) _tmp1_);
	contact_id = _tmp2_;
	_tmp3_ = store_id;
	_tmp4_ = edsf_persona_build_iid (_tmp3_, contact_id);
	result = _tmp4_;
	_g_free0 (contact_id);
	return result;
}


/**
   * Build a IID.
   *
   * @param store_id the {@link PersonaStore.id}
   * @param contact_id the id belonging to the Contact
   * @return a valid IID
   *
   * @since 0.6.0
   */
gchar* edsf_persona_build_iid (const gchar* store_id, const gchar* contact_id) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_ = NULL;
	g_return_val_if_fail (store_id != NULL, NULL);
	g_return_val_if_fail (contact_id != NULL, NULL);
	_tmp0_ = store_id;
	_tmp1_ = contact_id;
	_tmp2_ = g_strdup_printf ("%s:%s", _tmp0_, _tmp1_);
	result = _tmp2_;
	return result;
}


/**
   * Create a new persona.
   *
   * Create a new persona for the {@link PersonaStore} `store`, representing
   * the EDS contact given by `contact`.
   *
   * @since 0.6.0
   */
EdsfPersona* edsf_persona_construct (GType object_type, EdsfPersonaStore* store, EContact* contact) {
	EdsfPersona * self = NULL;
	EContact* _tmp0_;
	void* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* contact_id;
	EdsfPersonaStore* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* uid;
	EdsfPersonaStore* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_ = NULL;
	gchar* iid;
	EContact* _tmp11_;
	gboolean _tmp12_ = FALSE;
	gboolean is_user;
	EContact* _tmp13_;
	void* _tmp14_ = NULL;
	gchar* _tmp15_;
	gchar* full_name;
	EdsfPersonaStore* _tmp16_;
	GeeHashSet* _tmp17_;
	GeeHashSet* _tmp18_;
	GeeSet* _tmp19_;
	GeeSet* _tmp20_;
	GeeHashSet* _tmp21_;
	GeeHashSet* _tmp22_;
	GeeSet* _tmp23_;
	GeeSet* _tmp24_;
	GeeHashSet* _tmp25_;
	GeeHashSet* _tmp26_;
	GeeSet* _tmp27_;
	GeeSet* _tmp28_;
	GeeHashSet* _tmp29_;
	GeeHashSet* _tmp30_;
	GeeSet* _tmp31_;
	GeeSet* _tmp32_;
	GeeHashSet* _tmp33_;
	GeeHashSet* _tmp34_;
	GeeSet* _tmp35_;
	GeeSet* _tmp36_;
	GeeHashSet* _tmp37_;
	GeeHashSet* _tmp38_;
	GeeSet* _tmp39_;
	GeeSet* _tmp40_;
	GeeHashMultiMap* _tmp41_;
	GeeHashSet* _tmp42_;
	GeeHashSet* _tmp43_;
	GeeSet* _tmp44_;
	GeeSet* _tmp45_;
	GeeHashSet* _tmp46_;
	GeeHashSet* _tmp47_;
	GeeSet* _tmp48_;
	GeeSet* _tmp49_;
	EContact* _tmp50_;
	g_return_val_if_fail (store != NULL, NULL);
	g_return_val_if_fail (contact != NULL, NULL);
	_tmp0_ = contact;
	_tmp1_ = _edsf_persona_get_property_from_contact (_tmp0_, "id");
	_tmp2_ = g_strdup ((const gchar*) _tmp1_);
	contact_id = _tmp2_;
	_tmp3_ = store;
	_tmp4_ = folks_persona_store_get_id ((FolksPersonaStore*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = folks_persona_build_uid (BACKEND_NAME, _tmp5_, contact_id);
	uid = _tmp6_;
	_tmp7_ = store;
	_tmp8_ = folks_persona_store_get_id ((FolksPersonaStore*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = edsf_persona_build_iid (_tmp9_, contact_id);
	iid = _tmp10_;
	_tmp11_ = contact;
	_tmp12_ = e_book_client_is_self (_tmp11_);
	is_user = _tmp12_;
	_tmp13_ = contact;
	_tmp14_ = _edsf_persona_get_property_from_contact (_tmp13_, "full_name");
	_tmp15_ = g_strdup ((const gchar*) _tmp14_);
	full_name = _tmp15_;
	g_debug ("edsf-persona.vala:673: Creating new Edsf.Persona with IID '%s'", iid);
	_tmp16_ = store;
	self = (EdsfPersona*) g_object_new (object_type, "display-id", full_name, "uid", uid, "iid", iid, "store", _tmp16_, "is-user", is_user, NULL);
	self->priv->_gender = FOLKS_GENDER_UNSPECIFIED;
	edsf_persona_set_contact_id (self, contact_id);
	_tmp17_ = gee_hash_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_g_object_unref0 (self->priv->_phone_numbers);
	self->priv->_phone_numbers = _tmp17_;
	_tmp18_ = self->priv->_phone_numbers;
	_tmp19_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp18_);
	_tmp20_ = _tmp19_;
	_g_object_unref0 (self->priv->_phone_numbers_ro);
	self->priv->_phone_numbers_ro = _tmp20_;
	_tmp21_ = gee_hash_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_g_object_unref0 (self->priv->_email_addresses);
	self->priv->_email_addresses = _tmp21_;
	_tmp22_ = self->priv->_email_addresses;
	_tmp23_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp22_);
	_tmp24_ = _tmp23_;
	_g_object_unref0 (self->priv->_email_addresses_ro);
	self->priv->_email_addresses_ro = _tmp24_;
	_tmp25_ = gee_hash_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_g_object_unref0 (self->priv->_notes);
	self->priv->_notes = _tmp25_;
	_tmp26_ = self->priv->_notes;
	_tmp27_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp26_);
	_tmp28_ = _tmp27_;
	_g_object_unref0 (self->priv->_notes_ro);
	self->priv->_notes_ro = _tmp28_;
	_tmp29_ = gee_hash_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_g_object_unref0 (self->priv->_urls);
	self->priv->_urls = _tmp29_;
	_tmp30_ = self->priv->_urls;
	_tmp31_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp30_);
	_tmp32_ = _tmp31_;
	_g_object_unref0 (self->priv->_urls_ro);
	self->priv->_urls_ro = _tmp32_;
	_tmp33_ = gee_hash_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_g_object_unref0 (self->priv->_postal_addresses);
	self->priv->_postal_addresses = _tmp33_;
	_tmp34_ = self->priv->_postal_addresses;
	_tmp35_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp34_);
	_tmp36_ = _tmp35_;
	_g_object_unref0 (self->priv->_postal_addresses_ro);
	self->priv->_postal_addresses_ro = _tmp36_;
	_tmp37_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	_g_object_unref0 (self->priv->_local_ids);
	self->priv->_local_ids = _tmp37_;
	_tmp38_ = self->priv->_local_ids;
	_tmp39_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp38_);
	_tmp40_ = _tmp39_;
	_g_object_unref0 (self->priv->_local_ids_ro);
	self->priv->_local_ids_ro = _tmp40_;
	_tmp41_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_g_object_unref0 (self->priv->_web_service_addresses);
	self->priv->_web_service_addresses = _tmp41_;
	_tmp42_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	_g_object_unref0 (self->priv->_groups);
	self->priv->_groups = _tmp42_;
	_tmp43_ = self->priv->_groups;
	_tmp44_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp43_);
	_tmp45_ = _tmp44_;
	_g_object_unref0 (self->priv->_groups_ro);
	self->priv->_groups_ro = _tmp45_;
	_tmp46_ = gee_hash_set_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_g_object_unref0 (self->priv->_roles);
	self->priv->_roles = _tmp46_;
	_tmp47_ = self->priv->_roles;
	_tmp48_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp47_);
	_tmp49_ = _tmp48_;
	_g_object_unref0 (self->priv->_roles_ro);
	self->priv->_roles_ro = _tmp49_;
	_tmp50_ = contact;
	_edsf_persona_update (self, _tmp50_);
	_g_free0 (full_name);
	_g_free0 (iid);
	_g_free0 (uid);
	_g_free0 (contact_id);
	return self;
}


EdsfPersona* edsf_persona_new (EdsfPersonaStore* store, EContact* contact) {
	return edsf_persona_construct (EDSF_TYPE_PERSONA, store, contact);
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.0
   */
static void edsf_persona_real_linkable_property_to_links (FolksPersona* base, const gchar* prop_name, FolksPersonaLinkablePropertyCallback callback, void* callback_target) {
	EdsfPersona * self;
	const gchar* _tmp0_;
	self = (EdsfPersona*) base;
	g_return_if_fail (prop_name != NULL);
	_tmp0_ = prop_name;
	if (g_strcmp0 (_tmp0_, "im-addresses") == 0) {
		{
			GeeHashMultiMap* _tmp1_;
			GeeSet* _tmp2_ = NULL;
			GeeSet* _tmp3_;
			GeeIterator* _tmp4_ = NULL;
			GeeIterator* _tmp5_;
			GeeIterator* _protocol_it;
			_tmp1_ = self->priv->_im_addresses;
			_tmp2_ = gee_multi_map_get_keys ((GeeMultiMap*) _tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
			_tmp5_ = _tmp4_;
			_g_object_unref0 (_tmp3_);
			_protocol_it = _tmp5_;
			while (TRUE) {
				GeeIterator* _tmp6_;
				gboolean _tmp7_ = FALSE;
				GeeIterator* _tmp8_;
				gpointer _tmp9_ = NULL;
				gchar* protocol;
				GeeHashMultiMap* _tmp10_;
				const gchar* _tmp11_;
				GeeCollection* _tmp12_ = NULL;
				GeeCollection* im_fds;
				_tmp6_ = _protocol_it;
				_tmp7_ = gee_iterator_next (_tmp6_);
				if (!_tmp7_) {
					break;
				}
				_tmp8_ = _protocol_it;
				_tmp9_ = gee_iterator_get (_tmp8_);
				protocol = (gchar*) _tmp9_;
				_tmp10_ = self->priv->_im_addresses;
				_tmp11_ = protocol;
				_tmp12_ = gee_multi_map_get ((GeeMultiMap*) _tmp10_, _tmp11_);
				im_fds = _tmp12_;
				{
					GeeCollection* _tmp13_;
					GeeIterator* _tmp14_ = NULL;
					GeeIterator* _im_fd_it;
					_tmp13_ = im_fds;
					_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
					_im_fd_it = _tmp14_;
					while (TRUE) {
						GeeIterator* _tmp15_;
						gboolean _tmp16_ = FALSE;
						GeeIterator* _tmp17_;
						gpointer _tmp18_ = NULL;
						FolksImFieldDetails* im_fd;
						FolksPersonaLinkablePropertyCallback _tmp19_;
						void* _tmp19__target;
						const gchar* _tmp20_;
						gchar* _tmp21_;
						gchar* _tmp22_;
						FolksImFieldDetails* _tmp23_;
						gconstpointer _tmp24_;
						const gchar* _tmp25_;
						gchar* _tmp26_;
						gchar* _tmp27_;
						_tmp15_ = _im_fd_it;
						_tmp16_ = gee_iterator_next (_tmp15_);
						if (!_tmp16_) {
							break;
						}
						_tmp17_ = _im_fd_it;
						_tmp18_ = gee_iterator_get (_tmp17_);
						im_fd = (FolksImFieldDetails*) _tmp18_;
						_tmp19_ = callback;
						_tmp19__target = callback_target;
						_tmp20_ = protocol;
						_tmp21_ = g_strconcat (_tmp20_, ":", NULL);
						_tmp22_ = _tmp21_;
						_tmp23_ = im_fd;
						_tmp24_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp23_);
						_tmp25_ = _tmp24_;
						_tmp26_ = g_strconcat (_tmp22_, (const gchar*) _tmp25_, NULL);
						_tmp27_ = _tmp26_;
						_tmp19_ (_tmp27_, _tmp19__target);
						_g_free0 (_tmp27_);
						_g_free0 (_tmp22_);
						_g_object_unref0 (im_fd);
					}
					_g_object_unref0 (_im_fd_it);
				}
				_g_object_unref0 (im_fds);
				_g_free0 (protocol);
			}
			_g_object_unref0 (_protocol_it);
		}
	} else {
		const gchar* _tmp28_;
		_tmp28_ = prop_name;
		if (g_strcmp0 (_tmp28_, "local-ids") == 0) {
			{
				GeeSet* _tmp29_;
				GeeSet* _tmp30_;
				GeeIterator* _tmp31_ = NULL;
				GeeIterator* _id_it;
				_tmp29_ = folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self);
				_tmp30_ = _tmp29_;
				_tmp31_ = gee_iterable_iterator ((GeeIterable*) _tmp30_);
				_id_it = _tmp31_;
				while (TRUE) {
					GeeIterator* _tmp32_;
					gboolean _tmp33_ = FALSE;
					GeeIterator* _tmp34_;
					gpointer _tmp35_ = NULL;
					gchar* id;
					FolksPersonaLinkablePropertyCallback _tmp36_;
					void* _tmp36__target;
					const gchar* _tmp37_;
					_tmp32_ = _id_it;
					_tmp33_ = gee_iterator_next (_tmp32_);
					if (!_tmp33_) {
						break;
					}
					_tmp34_ = _id_it;
					_tmp35_ = gee_iterator_get (_tmp34_);
					id = (gchar*) _tmp35_;
					_tmp36_ = callback;
					_tmp36__target = callback_target;
					_tmp37_ = id;
					_tmp36_ (_tmp37_, _tmp36__target);
					_g_free0 (id);
				}
				_g_object_unref0 (_id_it);
			}
		} else {
			const gchar* _tmp38_;
			_tmp38_ = prop_name;
			if (g_strcmp0 (_tmp38_, "web-service-addresses") == 0) {
				{
					GeeMultiMap* _tmp39_;
					GeeMultiMap* _tmp40_;
					GeeSet* _tmp41_ = NULL;
					GeeSet* _tmp42_;
					GeeIterator* _tmp43_ = NULL;
					GeeIterator* _tmp44_;
					GeeIterator* _web_service_it;
					_tmp39_ = folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) self);
					_tmp40_ = _tmp39_;
					_tmp41_ = gee_multi_map_get_keys (_tmp40_);
					_tmp42_ = _tmp41_;
					_tmp43_ = gee_iterable_iterator ((GeeIterable*) _tmp42_);
					_tmp44_ = _tmp43_;
					_g_object_unref0 (_tmp42_);
					_web_service_it = _tmp44_;
					while (TRUE) {
						GeeIterator* _tmp45_;
						gboolean _tmp46_ = FALSE;
						GeeIterator* _tmp47_;
						gpointer _tmp48_ = NULL;
						gchar* web_service;
						GeeHashMultiMap* _tmp49_;
						const gchar* _tmp50_;
						GeeCollection* _tmp51_ = NULL;
						GeeCollection* web_service_addresses;
						_tmp45_ = _web_service_it;
						_tmp46_ = gee_iterator_next (_tmp45_);
						if (!_tmp46_) {
							break;
						}
						_tmp47_ = _web_service_it;
						_tmp48_ = gee_iterator_get (_tmp47_);
						web_service = (gchar*) _tmp48_;
						_tmp49_ = self->priv->_web_service_addresses;
						_tmp50_ = web_service;
						_tmp51_ = gee_multi_map_get ((GeeMultiMap*) _tmp49_, _tmp50_);
						web_service_addresses = _tmp51_;
						{
							GeeCollection* _tmp52_;
							GeeIterator* _tmp53_ = NULL;
							GeeIterator* _ws_fd_it;
							_tmp52_ = web_service_addresses;
							_tmp53_ = gee_iterable_iterator ((GeeIterable*) _tmp52_);
							_ws_fd_it = _tmp53_;
							while (TRUE) {
								GeeIterator* _tmp54_;
								gboolean _tmp55_ = FALSE;
								GeeIterator* _tmp56_;
								gpointer _tmp57_ = NULL;
								FolksWebServiceFieldDetails* ws_fd;
								FolksPersonaLinkablePropertyCallback _tmp58_;
								void* _tmp58__target;
								const gchar* _tmp59_;
								gchar* _tmp60_;
								gchar* _tmp61_;
								FolksWebServiceFieldDetails* _tmp62_;
								gconstpointer _tmp63_;
								const gchar* _tmp64_;
								gchar* _tmp65_;
								gchar* _tmp66_;
								_tmp54_ = _ws_fd_it;
								_tmp55_ = gee_iterator_next (_tmp54_);
								if (!_tmp55_) {
									break;
								}
								_tmp56_ = _ws_fd_it;
								_tmp57_ = gee_iterator_get (_tmp56_);
								ws_fd = (FolksWebServiceFieldDetails*) _tmp57_;
								_tmp58_ = callback;
								_tmp58__target = callback_target;
								_tmp59_ = web_service;
								_tmp60_ = g_strconcat (_tmp59_, ":", NULL);
								_tmp61_ = _tmp60_;
								_tmp62_ = ws_fd;
								_tmp63_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp62_);
								_tmp64_ = _tmp63_;
								_tmp65_ = g_strconcat (_tmp61_, (const gchar*) _tmp64_, NULL);
								_tmp66_ = _tmp65_;
								_tmp58_ (_tmp66_, _tmp58__target);
								_g_free0 (_tmp66_);
								_g_free0 (_tmp61_);
								_g_object_unref0 (ws_fd);
							}
							_g_object_unref0 (_ws_fd_it);
						}
						_g_object_unref0 (web_service_addresses);
						_g_free0 (web_service);
					}
					_g_object_unref0 (_web_service_it);
				}
			} else {
				const gchar* _tmp67_;
				FolksPersonaLinkablePropertyCallback _tmp68_;
				void* _tmp68__target;
				_tmp67_ = prop_name;
				_tmp68_ = callback;
				_tmp68__target = callback_target;
				FOLKS_PERSONA_CLASS (edsf_persona_parent_class)->linkable_property_to_links (FOLKS_PERSONA (self), _tmp67_, _tmp68_, _tmp68__target);
			}
		}
	}
}


/**
   * Update attribs of the persona.
   */
void _edsf_persona_update (EdsfPersona* self, EContact* contact) {
	EContact* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contact != NULL);
	_tmp0_ = contact;
	edsf_persona_set_contact (self, _tmp0_);
	g_object_freeze_notify ((GObject*) self);
	_edsf_persona_update_names (self);
	_edsf_persona_update_avatar (self);
	_edsf_persona_update_urls (self);
	_edsf_persona_update_phones (self);
	_edsf_persona_update_addresses (self);
	_edsf_persona_update_emails (self);
	_edsf_persona_update_im_addresses (self);
	_edsf_persona_update_groups (self);
	_edsf_persona_update_notes (self);
	_edsf_persona_update_local_ids (self);
	_edsf_persona_update_web_services_addresses (self);
	_edsf_persona_update_gender (self);
	_edsf_persona_update_birthday (self);
	_edsf_persona_update_roles (self);
	g_object_thaw_notify ((GObject*) self);
}


static void _edsf_persona_update_params (EdsfPersona* self, FolksAbstractFieldDetails* details, EVCardAttribute* attr) {
	EVCardAttribute* _tmp0_;
	GList* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (details != NULL);
	g_return_if_fail (attr != NULL);
	_tmp0_ = attr;
	_tmp1_ = e_vcard_attribute_get_params (_tmp0_);
	{
		GList* param_collection = NULL;
		GList* param_it = NULL;
		param_collection = _tmp1_;
		for (param_it = param_collection; param_it != NULL; param_it = param_it->next) {
			EVCardAttributeParam* param = NULL;
			param = (EVCardAttributeParam*) param_it->data;
			{
				EVCardAttributeParam* _tmp2_;
				const gchar* _tmp3_ = NULL;
				gchar* _tmp4_ = NULL;
				gchar* param_name;
				EVCardAttributeParam* _tmp5_;
				GList* _tmp6_ = NULL;
				_tmp2_ = param;
				_tmp3_ = e_vcard_attribute_param_get_name (_tmp2_);
				_tmp4_ = g_utf8_strdown (_tmp3_, (gssize) (-1));
				param_name = _tmp4_;
				_tmp5_ = param;
				_tmp6_ = e_vcard_attribute_param_get_values (_tmp5_);
				{
					GList* param_value_collection = NULL;
					GList* param_value_it = NULL;
					param_value_collection = _tmp6_;
					for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
						const gchar* param_value = NULL;
						param_value = (const gchar*) param_value_it->data;
						{
							const gchar* _tmp7_;
							_tmp7_ = param_name;
							if (g_strcmp0 (_tmp7_, FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE) == 0) {
								FolksAbstractFieldDetails* _tmp8_;
								const gchar* _tmp9_;
								const gchar* _tmp10_;
								gchar* _tmp11_ = NULL;
								gchar* _tmp12_;
								_tmp8_ = details;
								_tmp9_ = param_name;
								_tmp10_ = param_value;
								_tmp11_ = g_utf8_strdown (_tmp10_, (gssize) (-1));
								_tmp12_ = _tmp11_;
								folks_abstract_field_details_add_parameter (_tmp8_, _tmp9_, _tmp12_);
								_g_free0 (_tmp12_);
							} else {
								FolksAbstractFieldDetails* _tmp13_;
								const gchar* _tmp14_;
								const gchar* _tmp15_;
								_tmp13_ = details;
								_tmp14_ = param_name;
								_tmp15_ = param_value;
								folks_abstract_field_details_add_parameter (_tmp13_, _tmp14_, _tmp15_);
							}
						}
					}
				}
				_g_free0 (param_name);
			}
		}
	}
}


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


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


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


static void _edsf_persona_update_gender (EdsfPersona* self) {
	FolksGender gender;
	EContact* _tmp0_;
	EVCardAttribute* _tmp1_ = NULL;
	EVCardAttribute* _tmp2_;
	EVCardAttribute* gender_attr;
	EVCardAttribute* _tmp3_;
	FolksGender _tmp11_;
	FolksGender _tmp12_;
	g_return_if_fail (self != NULL);
	gender = FOLKS_GENDER_UNSPECIFIED;
	_tmp0_ = self->priv->_contact;
	_tmp1_ = e_vcard_get_attribute ((EVCard*) _tmp0_, EDSF_PERSONA_gender_attribute_name);
	_tmp2_ = __vala_EVCardAttribute_copy0 (_tmp1_);
	gender_attr = _tmp2_;
	_tmp3_ = gender_attr;
	if (_tmp3_ != NULL) {
		EVCardAttribute* _tmp4_;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_;
		gchar* gender_str;
		const gchar* _tmp9_;
		_tmp4_ = gender_attr;
		_tmp5_ = e_vcard_attribute_get_value (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_utf8_strup (_tmp6_, (gssize) (-1));
		_tmp8_ = _tmp7_;
		_g_free0 (_tmp6_);
		gender_str = _tmp8_;
		_tmp9_ = gender_str;
		if (g_strcmp0 (_tmp9_, EDSF_PERSONA_gender_male) == 0) {
			gender = FOLKS_GENDER_MALE;
		} else {
			const gchar* _tmp10_;
			_tmp10_ = gender_str;
			if (g_strcmp0 (_tmp10_, EDSF_PERSONA_gender_female) == 0) {
				gender = FOLKS_GENDER_FEMALE;
			}
		}
		_g_free0 (gender_str);
	}
	_tmp11_ = self->priv->_gender;
	_tmp12_ = gender;
	if (_tmp11_ != _tmp12_) {
		FolksGender _tmp13_;
		_tmp13_ = gender;
		self->priv->_gender = _tmp13_;
		g_object_notify ((GObject*) self, "gender");
	}
	__vala_EVCardAttribute_free0 (gender_attr);
}


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


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


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


static void _edsf_persona_update_birthday (EdsfPersona* self) {
	void* _tmp0_ = NULL;
	EContactDate* _tmp1_;
	EContactDate* bday;
	EContactDate* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _edsf_persona_get_property (self, "birth_date");
	_tmp1_ = __vala_EContactDate_copy0 ((EContactDate*) _tmp0_);
	bday = _tmp1_;
	_tmp2_ = bday;
	if (_tmp2_ != NULL) {
		GTimeZone* _tmp3_;
		EContactDate* _tmp4_;
		guint _tmp5_;
		EContactDate* _tmp6_;
		guint _tmp7_;
		EContactDate* _tmp8_;
		guint _tmp9_;
		GDateTime* _tmp10_;
		GDateTime* d;
		gboolean _tmp11_ = FALSE;
		GDateTime* _tmp12_;
		gboolean _tmp21_;
		_tmp3_ = edsf_persona__local_time_zone;
		_tmp4_ = bday;
		_tmp5_ = _tmp4_->year;
		_tmp6_ = bday;
		_tmp7_ = _tmp6_->month;
		_tmp8_ = bday;
		_tmp9_ = _tmp8_->day;
		_tmp10_ = g_date_time_new (_tmp3_, (gint) _tmp5_, (gint) _tmp7_, (gint) _tmp9_, 0, 0, 0.0);
		d = _tmp10_;
		_tmp12_ = self->priv->_birthday;
		if (_tmp12_ == NULL) {
			_tmp11_ = TRUE;
		} else {
			gboolean _tmp13_ = FALSE;
			GDateTime* _tmp14_;
			gboolean _tmp20_;
			_tmp14_ = self->priv->_birthday;
			if (_tmp14_ != NULL) {
				GDateTime* _tmp15_;
				GDateTime* _tmp16_;
				GDateTime* _tmp17_ = NULL;
				GDateTime* _tmp18_;
				gboolean _tmp19_ = FALSE;
				_tmp15_ = self->priv->_birthday;
				_tmp16_ = d;
				_tmp17_ = g_date_time_to_utc (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = g_date_time_equal (_tmp15_, _tmp18_);
				_tmp13_ = !_tmp19_;
				_g_date_time_unref0 (_tmp18_);
			} else {
				_tmp13_ = FALSE;
			}
			_tmp20_ = _tmp13_;
			_tmp11_ = _tmp20_;
		}
		_tmp21_ = _tmp11_;
		if (_tmp21_) {
			GDateTime* _tmp22_;
			GDateTime* _tmp23_ = NULL;
			_tmp22_ = d;
			_tmp23_ = g_date_time_to_utc (_tmp22_);
			_g_date_time_unref0 (self->priv->_birthday);
			self->priv->_birthday = _tmp23_;
			g_object_notify ((GObject*) self, "birthday");
		}
		_g_date_time_unref0 (d);
	} else {
		GDateTime* _tmp24_;
		_tmp24_ = self->priv->_birthday;
		if (_tmp24_ != NULL) {
			_g_date_time_unref0 (self->priv->_birthday);
			self->priv->_birthday = NULL;
			g_object_notify ((GObject*) self, "birthday");
		}
	}
	__vala_EContactDate_free0 (bday);
}


static void _edsf_persona_update_roles (EdsfPersona* self) {
	GeeHashSet* _tmp0_;
	GeeHashSet* new_roles;
	FolksRoleFieldDetails* _tmp1_ = NULL;
	FolksRoleFieldDetails* default_role_fd;
	FolksRoleFieldDetails* _tmp2_;
	EContact* _tmp5_;
	EVCard* _tmp6_;
	EVCard* vcard;
	EVCard* _tmp7_;
	GList* _tmp8_ = NULL;
	EdsfSetComparator* _tmp40_;
	EdsfSetComparator* comp;
	EdsfSetComparator* _tmp41_;
	GeeHashSet* _tmp42_;
	GeeHashSet* _tmp43_;
	gboolean _tmp44_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	new_roles = _tmp0_;
	_tmp1_ = _edsf_persona_get_default_role (self);
	default_role_fd = _tmp1_;
	_tmp2_ = default_role_fd;
	if (_tmp2_ != NULL) {
		GeeHashSet* _tmp3_;
		FolksRoleFieldDetails* _tmp4_;
		_tmp3_ = new_roles;
		_tmp4_ = default_role_fd;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, _tmp4_);
	}
	_tmp5_ = self->priv->_contact;
	_tmp6_ = _g_object_ref0 (E_VCARD (_tmp5_));
	vcard = _tmp6_;
	_tmp7_ = vcard;
	_tmp8_ = e_vcard_get_attributes (_tmp7_);
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp8_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				EVCardAttribute* _tmp9_;
				const gchar* _tmp10_ = NULL;
				FolksRole* _tmp11_;
				FolksRole* role;
				FolksRole* _tmp12_;
				EVCardAttribute* _tmp13_;
				gchar* _tmp14_ = NULL;
				gchar* _tmp15_;
				FolksRole* _tmp16_;
				FolksRoleFieldDetails* _tmp17_;
				FolksRoleFieldDetails* role_fd;
				EVCardAttribute* _tmp18_;
				GList* _tmp19_ = NULL;
				GeeHashSet* _tmp38_;
				FolksRoleFieldDetails* _tmp39_;
				_tmp9_ = attr;
				_tmp10_ = e_vcard_attribute_get_name (_tmp9_);
				if (g_strcmp0 (_tmp10_, "X-ROLES") != 0) {
					continue;
				}
				_tmp11_ = folks_role_new ("", "", NULL);
				role = _tmp11_;
				_tmp12_ = role;
				_tmp13_ = attr;
				_tmp14_ = e_vcard_attribute_get_value (_tmp13_);
				_tmp15_ = _tmp14_;
				folks_role_set_role (_tmp12_, _tmp15_);
				_g_free0 (_tmp15_);
				_tmp16_ = role;
				_tmp17_ = folks_role_field_details_new (_tmp16_, NULL);
				role_fd = _tmp17_;
				_tmp18_ = attr;
				_tmp19_ = e_vcard_attribute_get_params (_tmp18_);
				{
					GList* param_collection = NULL;
					GList* param_it = NULL;
					param_collection = _tmp19_;
					for (param_it = param_collection; param_it != NULL; param_it = param_it->next) {
						EVCardAttributeParam* param = NULL;
						param = (EVCardAttributeParam*) param_it->data;
						{
							EVCardAttributeParam* _tmp20_;
							const gchar* _tmp21_ = NULL;
							gchar* _tmp22_ = NULL;
							gchar* param_name;
							const gchar* _tmp23_;
							_tmp20_ = param;
							_tmp21_ = e_vcard_attribute_param_get_name (_tmp20_);
							_tmp22_ = g_utf8_strdown (_tmp21_, (gssize) (-1));
							param_name = _tmp22_;
							_tmp23_ = param_name;
							if (g_strcmp0 (_tmp23_, "organisation_name") == 0) {
								EVCardAttributeParam* _tmp24_;
								GList* _tmp25_ = NULL;
								_tmp24_ = param;
								_tmp25_ = e_vcard_attribute_param_get_values (_tmp24_);
								{
									GList* param_value_collection = NULL;
									GList* param_value_it = NULL;
									param_value_collection = _tmp25_;
									for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
										const gchar* param_value = NULL;
										param_value = (const gchar*) param_value_it->data;
										{
											FolksRole* _tmp26_;
											const gchar* _tmp27_;
											_tmp26_ = role;
											_tmp27_ = param_value;
											folks_role_set_organisation_name (_tmp26_, _tmp27_);
											break;
										}
									}
								}
							} else {
								const gchar* _tmp28_;
								_tmp28_ = param_name;
								if (g_strcmp0 (_tmp28_, "title") == 0) {
									EVCardAttributeParam* _tmp29_;
									GList* _tmp30_ = NULL;
									_tmp29_ = param;
									_tmp30_ = e_vcard_attribute_param_get_values (_tmp29_);
									{
										GList* param_value_collection = NULL;
										GList* param_value_it = NULL;
										param_value_collection = _tmp30_;
										for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
											const gchar* param_value = NULL;
											param_value = (const gchar*) param_value_it->data;
											{
												FolksRole* _tmp31_;
												const gchar* _tmp32_;
												_tmp31_ = role;
												_tmp32_ = param_value;
												folks_role_set_title (_tmp31_, _tmp32_);
												break;
											}
										}
									}
								} else {
									EVCardAttributeParam* _tmp33_;
									GList* _tmp34_ = NULL;
									_tmp33_ = param;
									_tmp34_ = e_vcard_attribute_param_get_values (_tmp33_);
									{
										GList* param_value_collection = NULL;
										GList* param_value_it = NULL;
										param_value_collection = _tmp34_;
										for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
											const gchar* param_value = NULL;
											param_value = (const gchar*) param_value_it->data;
											{
												FolksRoleFieldDetails* _tmp35_;
												const gchar* _tmp36_;
												const gchar* _tmp37_;
												_tmp35_ = role_fd;
												_tmp36_ = param_name;
												_tmp37_ = param_value;
												folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp35_, _tmp36_, _tmp37_);
											}
										}
									}
								}
							}
							_g_free0 (param_name);
						}
					}
				}
				_tmp38_ = new_roles;
				_tmp39_ = role_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp38_, _tmp39_);
				_g_object_unref0 (role_fd);
				_g_object_unref0 (role);
			}
		}
	}
	_tmp40_ = edsf_set_comparator_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
	comp = _tmp40_;
	_tmp41_ = comp;
	_tmp42_ = new_roles;
	_tmp43_ = self->priv->_roles;
	_tmp44_ = edsf_set_comparator_equal (_tmp41_, (GeeSet*) _tmp42_, (GeeSet*) _tmp43_);
	if (!_tmp44_) {
		GeeHashSet* _tmp45_;
		GeeHashSet* _tmp46_;
		GeeHashSet* _tmp47_;
		GeeSet* _tmp48_;
		GeeSet* _tmp49_;
		_tmp45_ = new_roles;
		_tmp46_ = _g_object_ref0 (_tmp45_);
		_g_object_unref0 (self->priv->_roles);
		self->priv->_roles = _tmp46_;
		_tmp47_ = new_roles;
		_tmp48_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp47_);
		_tmp49_ = _tmp48_;
		_g_object_unref0 (self->priv->_roles_ro);
		self->priv->_roles_ro = _tmp49_;
		g_object_notify ((GObject*) self, "roles");
	}
	_g_object_unref0 (comp);
	_g_object_unref0 (vcard);
	_g_object_unref0 (default_role_fd);
	_g_object_unref0 (new_roles);
}


static FolksRoleFieldDetails* _edsf_persona_get_default_role (EdsfPersona* self) {
	FolksRoleFieldDetails* result = NULL;
	FolksRoleFieldDetails* default_role;
	void* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* org;
	void* _tmp2_ = NULL;
	gchar* _tmp3_;
	gchar* org_unit;
	void* _tmp4_ = NULL;
	gchar* _tmp5_;
	gchar* office;
	void* _tmp6_ = NULL;
	gchar* _tmp7_;
	gchar* title;
	void* _tmp8_ = NULL;
	gchar* _tmp9_;
	gchar* role;
	void* _tmp10_ = NULL;
	gchar* _tmp11_;
	gchar* manager;
	void* _tmp12_ = NULL;
	gchar* _tmp13_;
	gchar* assistant;
	gboolean _tmp14_ = FALSE;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	const gchar* _tmp20_;
	gboolean _tmp22_;
	gboolean _tmp24_;
	gboolean _tmp26_;
	gboolean _tmp28_;
	gboolean _tmp30_;
	gboolean _tmp32_;
	g_return_val_if_fail (self != NULL, NULL);
	default_role = NULL;
	_tmp0_ = _edsf_persona_get_property (self, "org");
	_tmp1_ = g_strdup ((const gchar*) _tmp0_);
	org = _tmp1_;
	_tmp2_ = _edsf_persona_get_property (self, "org_unit");
	_tmp3_ = g_strdup ((const gchar*) _tmp2_);
	org_unit = _tmp3_;
	_tmp4_ = _edsf_persona_get_property (self, "office");
	_tmp5_ = g_strdup ((const gchar*) _tmp4_);
	office = _tmp5_;
	_tmp6_ = _edsf_persona_get_property (self, "title");
	_tmp7_ = g_strdup ((const gchar*) _tmp6_);
	title = _tmp7_;
	_tmp8_ = _edsf_persona_get_property (self, "role");
	_tmp9_ = g_strdup ((const gchar*) _tmp8_);
	role = _tmp9_;
	_tmp10_ = _edsf_persona_get_property (self, "manager");
	_tmp11_ = g_strdup ((const gchar*) _tmp10_);
	manager = _tmp11_;
	_tmp12_ = _edsf_persona_get_property (self, "assistant");
	_tmp13_ = g_strdup ((const gchar*) _tmp12_);
	assistant = _tmp13_;
	_tmp20_ = org;
	if (_tmp20_ != NULL) {
		_tmp19_ = TRUE;
	} else {
		const gchar* _tmp21_;
		_tmp21_ = org_unit;
		_tmp19_ = _tmp21_ != NULL;
	}
	_tmp22_ = _tmp19_;
	if (_tmp22_) {
		_tmp18_ = TRUE;
	} else {
		const gchar* _tmp23_;
		_tmp23_ = office;
		_tmp18_ = _tmp23_ != NULL;
	}
	_tmp24_ = _tmp18_;
	if (_tmp24_) {
		_tmp17_ = TRUE;
	} else {
		const gchar* _tmp25_;
		_tmp25_ = title;
		_tmp17_ = _tmp25_ != NULL;
	}
	_tmp26_ = _tmp17_;
	if (_tmp26_) {
		_tmp16_ = TRUE;
	} else {
		const gchar* _tmp27_;
		_tmp27_ = role;
		_tmp16_ = _tmp27_ != NULL;
	}
	_tmp28_ = _tmp16_;
	if (_tmp28_) {
		_tmp15_ = TRUE;
	} else {
		const gchar* _tmp29_;
		_tmp29_ = manager;
		_tmp15_ = _tmp29_ != NULL;
	}
	_tmp30_ = _tmp15_;
	if (_tmp30_) {
		_tmp14_ = TRUE;
	} else {
		const gchar* _tmp31_;
		_tmp31_ = assistant;
		_tmp14_ = _tmp31_ != NULL;
	}
	_tmp32_ = _tmp14_;
	if (_tmp32_) {
		const gchar* _tmp33_;
		const gchar* _tmp34_;
		FolksRole* _tmp35_;
		FolksRole* new_role;
		const gchar* _tmp36_;
		FolksRole* _tmp39_;
		FolksRoleFieldDetails* _tmp40_;
		const gchar* _tmp41_;
		const gchar* _tmp44_;
		const gchar* _tmp47_;
		const gchar* _tmp50_;
		_tmp33_ = title;
		_tmp34_ = org;
		_tmp35_ = folks_role_new (_tmp33_, _tmp34_, NULL);
		new_role = _tmp35_;
		_tmp36_ = role;
		if (_tmp36_ != NULL) {
			FolksRole* _tmp37_;
			const gchar* _tmp38_;
			_tmp37_ = new_role;
			_tmp38_ = role;
			folks_role_set_role (_tmp37_, _tmp38_);
		}
		_tmp39_ = new_role;
		_tmp40_ = folks_role_field_details_new (_tmp39_, NULL);
		_g_object_unref0 (default_role);
		default_role = _tmp40_;
		_tmp41_ = org_unit;
		if (_tmp41_ != NULL) {
			FolksRoleFieldDetails* _tmp42_;
			const gchar* _tmp43_;
			_tmp42_ = default_role;
			_tmp43_ = org_unit;
			folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp42_, "org_unit", _tmp43_);
		}
		_tmp44_ = office;
		if (_tmp44_ != NULL) {
			FolksRoleFieldDetails* _tmp45_;
			const gchar* _tmp46_;
			_tmp45_ = default_role;
			_tmp46_ = office;
			folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp45_, "office", _tmp46_);
		}
		_tmp47_ = manager;
		if (_tmp47_ != NULL) {
			FolksRoleFieldDetails* _tmp48_;
			const gchar* _tmp49_;
			_tmp48_ = default_role;
			_tmp49_ = manager;
			folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp48_, "manager", _tmp49_);
		}
		_tmp50_ = assistant;
		if (_tmp50_ != NULL) {
			FolksRoleFieldDetails* _tmp51_;
			const gchar* _tmp52_;
			_tmp51_ = default_role;
			_tmp52_ = assistant;
			folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp51_, "assistant", _tmp52_);
		}
		_g_object_unref0 (new_role);
	}
	result = default_role;
	_g_free0 (assistant);
	_g_free0 (manager);
	_g_free0 (role);
	_g_free0 (title);
	_g_free0 (office);
	_g_free0 (org_unit);
	_g_free0 (org);
	return result;
}


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 _edsf_persona_update_web_services_addresses (EdsfPersona* self) {
	GeeHashMultiMap* _tmp0_;
	GeeHashMultiMap* new_services;
	EContact* _tmp1_;
	EVCardAttribute* _tmp2_ = NULL;
	EVCardAttribute* _tmp3_;
	EVCardAttribute* services;
	EVCardAttribute* _tmp4_;
	GeeHashMultiMap* _tmp20_;
	GeeHashMultiMap* _tmp21_;
	gboolean _tmp22_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	new_services = _tmp0_;
	_tmp1_ = self->priv->_contact;
	_tmp2_ = e_vcard_get_attribute ((EVCard*) _tmp1_, "X-FOLKS-WEB-SERVICES-IDS");
	_tmp3_ = __vala_EVCardAttribute_copy0 (_tmp2_);
	services = _tmp3_;
	_tmp4_ = services;
	if (_tmp4_ != NULL) {
		EVCardAttribute* _tmp5_;
		GList* _tmp6_ = NULL;
		_tmp5_ = services;
		_tmp6_ = e_vcard_attribute_get_params (_tmp5_);
		{
			GList* service_collection = NULL;
			GList* service_it = NULL;
			service_collection = _tmp6_;
			for (service_it = service_collection; service_it != NULL; service_it = service_it->next) {
				EVCardAttributeParam* _tmp7_;
				EVCardAttributeParam* service = NULL;
				_tmp7_ = __vala_EVCardAttributeParam_copy0 ((EVCardAttributeParam*) service_it->data);
				service = _tmp7_;
				{
					EVCardAttributeParam* _tmp8_;
					const gchar* _tmp9_ = NULL;
					gchar* _tmp10_ = NULL;
					gchar* service_name;
					EVCardAttributeParam* _tmp11_;
					GList* _tmp12_ = NULL;
					_tmp8_ = service;
					_tmp9_ = e_vcard_attribute_param_get_name (_tmp8_);
					_tmp10_ = g_utf8_strdown (_tmp9_, (gssize) (-1));
					service_name = _tmp10_;
					_tmp11_ = service;
					_tmp12_ = e_vcard_attribute_param_get_values (_tmp11_);
					{
						GList* service_id_collection = NULL;
						GList* service_id_it = NULL;
						service_id_collection = _tmp12_;
						for (service_id_it = service_id_collection; service_id_it != NULL; service_id_it = service_id_it->next) {
							gchar* _tmp13_;
							gchar* service_id = NULL;
							_tmp13_ = g_strdup ((const gchar*) service_id_it->data);
							service_id = _tmp13_;
							{
								const gchar* _tmp14_;
								GeeHashMultiMap* _tmp15_;
								const gchar* _tmp16_;
								const gchar* _tmp17_;
								FolksWebServiceFieldDetails* _tmp18_;
								FolksWebServiceFieldDetails* _tmp19_;
								_tmp14_ = service_id;
								if (_tmp14_ == NULL) {
									_g_free0 (service_id);
									continue;
								}
								_tmp15_ = new_services;
								_tmp16_ = service_name;
								_tmp17_ = service_id;
								_tmp18_ = folks_web_service_field_details_new (_tmp17_, NULL);
								_tmp19_ = _tmp18_;
								gee_multi_map_set ((GeeMultiMap*) _tmp15_, _tmp16_, _tmp19_);
								_g_object_unref0 (_tmp19_);
								_g_free0 (service_id);
							}
						}
					}
					_g_free0 (service_name);
					__vala_EVCardAttributeParam_free0 (service);
				}
			}
		}
	}
	_tmp20_ = new_services;
	_tmp21_ = self->priv->_web_service_addresses;
	_tmp22_ = folks_utils_multi_map_str_afd_equal ((GeeMultiMap*) _tmp20_, (GeeMultiMap*) _tmp21_);
	if (!_tmp22_) {
		GeeHashMultiMap* _tmp23_;
		GeeHashMultiMap* _tmp24_;
		_tmp23_ = new_services;
		_tmp24_ = _g_object_ref0 (_tmp23_);
		_g_object_unref0 (self->priv->_web_service_addresses);
		self->priv->_web_service_addresses = _tmp24_;
		g_object_notify ((GObject*) self, "web-service-addresses");
	}
	__vala_EVCardAttribute_free0 (services);
	_g_object_unref0 (new_services);
}


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


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


static void _edsf_persona_update_emails (EdsfPersona* self) {
	GeeHashSet* _tmp0_;
	GeeHashSet* new_email_addresses;
	EContact* _tmp1_;
	GList* _tmp2_ = NULL;
	GList* attrs;
	GList* _tmp3_;
	EdsfSetComparator* _tmp14_;
	EdsfSetComparator* comp;
	EdsfSetComparator* _tmp15_;
	GeeHashSet* _tmp16_;
	GeeHashSet* _tmp17_;
	gboolean _tmp18_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	new_email_addresses = _tmp0_;
	_tmp1_ = self->priv->_contact;
	_tmp2_ = e_contact_get_attributes (_tmp1_, E_CONTACT_EMAIL);
	attrs = _tmp2_;
	_tmp3_ = attrs;
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp3_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* _tmp4_;
			EVCardAttribute* attr = NULL;
			_tmp4_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
			attr = _tmp4_;
			{
				EVCardAttribute* _tmp5_;
				gchar* _tmp6_ = NULL;
				gchar* _tmp7_;
				FolksEmailFieldDetails* _tmp8_;
				FolksEmailFieldDetails* _tmp9_;
				FolksEmailFieldDetails* email_fd;
				FolksEmailFieldDetails* _tmp10_;
				EVCardAttribute* _tmp11_;
				GeeHashSet* _tmp12_;
				FolksEmailFieldDetails* _tmp13_;
				_tmp5_ = attr;
				_tmp6_ = e_vcard_attribute_get_value (_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = folks_email_field_details_new (_tmp7_, NULL);
				_tmp9_ = _tmp8_;
				_g_free0 (_tmp7_);
				email_fd = _tmp9_;
				_tmp10_ = email_fd;
				_tmp11_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp10_, _tmp11_);
				_tmp12_ = new_email_addresses;
				_tmp13_ = email_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp13_);
				_g_object_unref0 (email_fd);
				__vala_EVCardAttribute_free0 (attr);
			}
		}
	}
	_tmp14_ = edsf_set_comparator_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
	comp = _tmp14_;
	_tmp15_ = comp;
	_tmp16_ = new_email_addresses;
	_tmp17_ = self->priv->_email_addresses;
	_tmp18_ = edsf_set_comparator_equal (_tmp15_, (GeeSet*) _tmp16_, (GeeSet*) _tmp17_);
	if (!_tmp18_) {
		GeeHashSet* _tmp19_;
		GeeHashSet* _tmp20_;
		GeeHashSet* _tmp21_;
		GeeSet* _tmp22_;
		GeeSet* _tmp23_;
		_tmp19_ = new_email_addresses;
		_tmp20_ = _g_object_ref0 (_tmp19_);
		_g_object_unref0 (self->priv->_email_addresses);
		self->priv->_email_addresses = _tmp20_;
		_tmp21_ = new_email_addresses;
		_tmp22_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp21_);
		_tmp23_ = _tmp22_;
		_g_object_unref0 (self->priv->_email_addresses_ro);
		self->priv->_email_addresses_ro = _tmp23_;
		g_object_notify ((GObject*) self, "email-addresses");
	}
	_g_object_unref0 (comp);
	__g_list_free___vala_EVCardAttribute_free0_0 (attrs);
	_g_object_unref0 (new_email_addresses);
}


static void _edsf_persona_update_notes (EdsfPersona* self) {
	GeeHashSet* _tmp0_;
	GeeHashSet* new_notes;
	void* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* n;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	gboolean _tmp6_;
	EdsfSetComparator* _tmp11_;
	EdsfSetComparator* comp;
	EdsfSetComparator* _tmp12_;
	GeeHashSet* _tmp13_;
	GeeHashSet* _tmp14_;
	gboolean _tmp15_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	new_notes = _tmp0_;
	_tmp1_ = _edsf_persona_get_property (self, "note");
	_tmp2_ = g_strdup ((const gchar*) _tmp1_);
	n = _tmp2_;
	_tmp4_ = n;
	if (_tmp4_ != NULL) {
		const gchar* _tmp5_;
		_tmp5_ = n;
		_tmp3_ = g_strcmp0 (_tmp5_, "") != 0;
	} else {
		_tmp3_ = FALSE;
	}
	_tmp6_ = _tmp3_;
	if (_tmp6_) {
		const gchar* _tmp7_;
		FolksNoteFieldDetails* _tmp8_;
		FolksNoteFieldDetails* note;
		GeeHashSet* _tmp9_;
		FolksNoteFieldDetails* _tmp10_;
		_tmp7_ = n;
		_tmp8_ = folks_note_field_details_new (_tmp7_, NULL, NULL);
		note = _tmp8_;
		_tmp9_ = new_notes;
		_tmp10_ = note;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp10_);
		_g_object_unref0 (note);
	}
	_tmp11_ = edsf_set_comparator_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
	comp = _tmp11_;
	_tmp12_ = comp;
	_tmp13_ = new_notes;
	_tmp14_ = self->priv->_notes;
	_tmp15_ = edsf_set_comparator_equal (_tmp12_, (GeeSet*) _tmp13_, (GeeSet*) _tmp14_);
	if (!_tmp15_) {
		GeeHashSet* _tmp16_;
		GeeHashSet* _tmp17_;
		GeeHashSet* _tmp18_;
		GeeSet* _tmp19_;
		GeeSet* _tmp20_;
		_tmp16_ = new_notes;
		_tmp17_ = _g_object_ref0 (_tmp16_);
		_g_object_unref0 (self->priv->_notes);
		self->priv->_notes = _tmp17_;
		_tmp18_ = self->priv->_notes;
		_tmp19_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp18_);
		_tmp20_ = _tmp19_;
		_g_object_unref0 (self->priv->_notes_ro);
		self->priv->_notes_ro = _tmp20_;
		g_object_notify ((GObject*) self, "notes");
	}
	_g_object_unref0 (comp);
	_g_free0 (n);
	_g_object_unref0 (new_notes);
}


static EContactName* _vala_EContactName_copy (EContactName* self) {
	return g_boxed_copy (e_contact_name_get_type (), self);
}


static gpointer __vala_EContactName_copy0 (gpointer self) {
	return self ? _vala_EContactName_copy (self) : NULL;
}


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


static void _edsf_persona_update_names (EdsfPersona* self) {
	void* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* full_name;
	const gchar* _tmp2_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	void* _tmp8_ = NULL;
	gchar* _tmp9_;
	gchar* nickname;
	const gchar* _tmp10_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	FolksStructuredName* structured_name;
	void* _tmp16_ = NULL;
	EContactName* _tmp17_;
	EContactName* cn;
	EContactName* _tmp18_;
	gboolean _tmp40_ = FALSE;
	FolksStructuredName* _tmp41_;
	gboolean _tmp44_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _edsf_persona_get_property (self, "full_name");
	_tmp1_ = g_strdup ((const gchar*) _tmp0_);
	full_name = _tmp1_;
	_tmp2_ = full_name;
	if (_tmp2_ == NULL) {
		gchar* _tmp3_;
		_tmp3_ = g_strdup ("");
		_g_free0 (full_name);
		full_name = _tmp3_;
	}
	_tmp4_ = self->priv->_full_name;
	_tmp5_ = full_name;
	if (g_strcmp0 (_tmp4_, _tmp5_) != 0) {
		const gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp6_ = full_name;
		_tmp7_ = g_strdup (_tmp6_);
		_g_free0 (self->priv->_full_name);
		self->priv->_full_name = _tmp7_;
		g_object_notify ((GObject*) self, "full-name");
	}
	_tmp8_ = _edsf_persona_get_property (self, "nickname");
	_tmp9_ = g_strdup ((const gchar*) _tmp8_);
	nickname = _tmp9_;
	_tmp10_ = nickname;
	if (_tmp10_ == NULL) {
		gchar* _tmp11_;
		_tmp11_ = g_strdup ("");
		_g_free0 (nickname);
		nickname = _tmp11_;
	}
	_tmp12_ = self->priv->_nickname;
	_tmp13_ = nickname;
	if (g_strcmp0 (_tmp12_, _tmp13_) != 0) {
		const gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp14_ = nickname;
		_tmp15_ = g_strdup (_tmp14_);
		_g_free0 (self->priv->_nickname);
		self->priv->_nickname = _tmp15_;
		g_object_notify ((GObject*) self, "nickname");
	}
	structured_name = NULL;
	_tmp16_ = _edsf_persona_get_property (self, "name");
	_tmp17_ = __vala_EContactName_copy0 ((EContactName*) _tmp16_);
	cn = _tmp17_;
	_tmp18_ = cn;
	if (_tmp18_ != NULL) {
		EContactName* _tmp19_;
		const gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* family_name;
		EContactName* _tmp22_;
		const gchar* _tmp23_;
		gchar* _tmp24_;
		gchar* given_name;
		EContactName* _tmp25_;
		const gchar* _tmp26_;
		gchar* _tmp27_;
		gchar* additional_names;
		EContactName* _tmp28_;
		const gchar* _tmp29_;
		gchar* _tmp30_;
		gchar* prefixes;
		EContactName* _tmp31_;
		const gchar* _tmp32_;
		gchar* _tmp33_;
		gchar* suffixes;
		const gchar* _tmp34_;
		const gchar* _tmp35_;
		const gchar* _tmp36_;
		const gchar* _tmp37_;
		const gchar* _tmp38_;
		FolksStructuredName* _tmp39_;
		_tmp19_ = cn;
		_tmp20_ = _tmp19_->family;
		_tmp21_ = g_strdup (_tmp20_);
		family_name = _tmp21_;
		_tmp22_ = cn;
		_tmp23_ = _tmp22_->given;
		_tmp24_ = g_strdup (_tmp23_);
		given_name = _tmp24_;
		_tmp25_ = cn;
		_tmp26_ = _tmp25_->additional;
		_tmp27_ = g_strdup (_tmp26_);
		additional_names = _tmp27_;
		_tmp28_ = cn;
		_tmp29_ = _tmp28_->prefixes;
		_tmp30_ = g_strdup (_tmp29_);
		prefixes = _tmp30_;
		_tmp31_ = cn;
		_tmp32_ = _tmp31_->suffixes;
		_tmp33_ = g_strdup (_tmp32_);
		suffixes = _tmp33_;
		_tmp34_ = family_name;
		_tmp35_ = given_name;
		_tmp36_ = additional_names;
		_tmp37_ = prefixes;
		_tmp38_ = suffixes;
		_tmp39_ = folks_structured_name_new (_tmp34_, _tmp35_, _tmp36_, _tmp37_, _tmp38_);
		_g_object_unref0 (structured_name);
		structured_name = _tmp39_;
		_g_free0 (suffixes);
		_g_free0 (prefixes);
		_g_free0 (additional_names);
		_g_free0 (given_name);
		_g_free0 (family_name);
	}
	_tmp41_ = structured_name;
	if (_tmp41_ != NULL) {
		FolksStructuredName* _tmp42_;
		gboolean _tmp43_ = FALSE;
		_tmp42_ = structured_name;
		_tmp43_ = folks_structured_name_is_empty (_tmp42_);
		_tmp40_ = !_tmp43_;
	} else {
		_tmp40_ = FALSE;
	}
	_tmp44_ = _tmp40_;
	if (_tmp44_) {
		FolksStructuredName* _tmp45_;
		FolksStructuredName* _tmp46_;
		_tmp45_ = structured_name;
		_tmp46_ = _g_object_ref0 (_tmp45_);
		_g_object_unref0 (self->priv->_structured_name);
		self->priv->_structured_name = _tmp46_;
		g_object_notify ((GObject*) self, "structured-name");
	} else {
		FolksStructuredName* _tmp47_;
		_tmp47_ = self->priv->_structured_name;
		if (_tmp47_ != NULL) {
			_g_object_unref0 (self->priv->_structured_name);
			self->priv->_structured_name = NULL;
			g_object_notify ((GObject*) self, "structured-name");
		}
	}
	__vala_EContactName_free0 (cn);
	_g_object_unref0 (structured_name);
	_g_free0 (nickname);
	_g_free0 (full_name);
}


static GLoadableIcon* _edsf_persona_contact_photo_to_loadable_icon (EdsfPersona* self, EContactPhoto* p) {
	GLoadableIcon* result = NULL;
	EContactPhoto* _tmp0_;
	EContactPhoto* _tmp1_;
	EContactPhotoType _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = p;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = p;
	_tmp2_ = _tmp1_->type;
	switch (_tmp2_) {
		case E_CONTACT_PHOTO_TYPE_URI:
		{
			EContactPhoto* _tmp3_;
			const gchar* _tmp4_ = NULL;
			EContactPhoto* _tmp5_;
			const gchar* _tmp6_ = NULL;
			GFile* _tmp7_ = NULL;
			GFile* _tmp8_;
			GFileIcon* _tmp9_;
			GLoadableIcon* _tmp10_;
			_tmp3_ = p;
			_tmp4_ = e_contact_photo_get_uri (_tmp3_);
			if (_tmp4_ == NULL) {
				result = NULL;
				return result;
			}
			_tmp5_ = p;
			_tmp6_ = e_contact_photo_get_uri (_tmp5_);
			_tmp7_ = g_file_new_for_uri (_tmp6_);
			_tmp8_ = _tmp7_;
			_tmp9_ = (GFileIcon*) g_file_icon_new (_tmp8_);
			_tmp10_ = (GLoadableIcon*) _tmp9_;
			_g_object_unref0 (_tmp8_);
			result = _tmp10_;
			return result;
		}
		case E_CONTACT_PHOTO_TYPE_INLINED:
		{
			gboolean _tmp11_ = FALSE;
			EContactPhoto* _tmp12_;
			const gchar* _tmp13_ = NULL;
			gboolean _tmp17_;
			EContactPhoto* _tmp18_;
			const gchar* _tmp19_ = NULL;
			EContactPhoto* _tmp20_;
			gsize _tmp21_;
			guint8* _tmp22_ = NULL;
			EdsfMemoryIcon* _tmp23_;
			_tmp12_ = p;
			_tmp13_ = e_contact_photo_get_mime_type (_tmp12_);
			if (_tmp13_ == NULL) {
				_tmp11_ = TRUE;
			} else {
				EContactPhoto* _tmp14_;
				gsize _tmp15_;
				guint8* _tmp16_ = NULL;
				_tmp14_ = p;
				_tmp16_ = e_contact_photo_get_inlined (_tmp14_, &_tmp15_);
				_tmp11_ = _tmp16_ == NULL;
			}
			_tmp17_ = _tmp11_;
			if (_tmp17_) {
				result = NULL;
				return result;
			}
			_tmp18_ = p;
			_tmp19_ = e_contact_photo_get_mime_type (_tmp18_);
			_tmp20_ = p;
			_tmp22_ = e_contact_photo_get_inlined (_tmp20_, &_tmp21_);
			_tmp23_ = edsf_memory_icon_new (_tmp19_, _tmp22_, _tmp21_);
			result = (GLoadableIcon*) _tmp23_;
			return result;
		}
		default:
		{
			result = NULL;
			return result;
		}
	}
}


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


static void block1_data_unref (Block1Data* _data1_) {
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_object_unref0 (_data1_->self);
		_g_object_unref0 (_data1_->new_avatar);
		_g_object_unref0 (_data1_->cache);
		g_slice_free (Block1Data, _data1_);
	}
}


static EContactPhoto* _vala_EContactPhoto_copy (EContactPhoto* self) {
	return g_boxed_copy (e_contact_photo_get_type (), self);
}


static gpointer __vala_EContactPhoto_copy0 (gpointer self) {
	return self ? _vala_EContactPhoto_copy (self) : NULL;
}


static void ___lambda2_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) {
	EdsfPersona * self;
	GError * _inner_error_ = NULL;
	self = _data1_->self;
	g_return_if_fail (res != NULL);
	{
		FolksAvatarCache* _tmp0_;
		GAsyncResult* _tmp1_;
		_tmp0_ = _data1_->cache;
		_tmp1_ = res;
		folks_avatar_cache_remove_avatar_finish (_tmp0_, _tmp1_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e1 = NULL;
		e1 = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (e1);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_g_object_unref0 (self->priv->_avatar);
	self->priv->_avatar = NULL;
	g_object_notify ((GObject*) self, "avatar");
}


static void ____lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	___lambda2_ (self, source_object, res);
	block1_data_unref (self);
}


static void ____lambda5_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) {
	EdsfPersona * self;
	GError * _inner_error_ = NULL;
	self = _data1_->self;
	g_return_if_fail (res != NULL);
	{
		FolksAvatarCache* _tmp0_;
		GAsyncResult* _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		GLoadableIcon* _tmp4_;
		GLoadableIcon* _tmp5_;
		_tmp0_ = _data1_->cache;
		_tmp1_ = res;
		_tmp2_ = folks_avatar_cache_store_avatar_finish (_tmp0_, _tmp1_, &_inner_error_);
		_tmp3_ = _tmp2_;
		_g_free0 (_tmp3_);
		if (_inner_error_ != NULL) {
			goto __catch1_g_error;
		}
		_tmp4_ = _data1_->new_avatar;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_g_object_unref0 (self->priv->_avatar);
		self->priv->_avatar = _tmp5_;
		g_object_notify ((GObject*) self, "avatar");
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e2 = NULL;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		GError* _tmp8_;
		const gchar* _tmp9_;
		e2 = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = folks_persona_get_uid ((FolksPersona*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = e2;
		_tmp9_ = _tmp8_->message;
		g_warning ("edsf-persona.vala:1190: Couldn't cache avatar for Edsf.Persona '%s': %" \
"s", _tmp7_, _tmp9_);
		_g_object_unref0 (_data1_->new_avatar);
		_data1_->new_avatar = NULL;
		_g_error_free0 (e2);
	}
	__finally1:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void _____lambda5__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	____lambda5_ (self, source_object, res);
	block1_data_unref (self);
}


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


static void _edsf_persona_update_avatar (EdsfPersona* self) {
	Block1Data* _data1_;
	void* _tmp0_ = NULL;
	EContactPhoto* _tmp1_;
	EContactPhoto* p;
	FolksAvatarCache* _tmp2_ = NULL;
	EContactPhoto* _tmp3_;
	GLoadableIcon* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	GLoadableIcon* _tmp6_;
	gboolean _tmp8_;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = _edsf_persona_get_property (self, "photo");
	_tmp1_ = __vala_EContactPhoto_copy0 ((EContactPhoto*) _tmp0_);
	p = _tmp1_;
	_tmp2_ = folks_avatar_cache_dup ();
	_data1_->cache = _tmp2_;
	_tmp3_ = p;
	_tmp4_ = _edsf_persona_contact_photo_to_loadable_icon (self, _tmp3_);
	_data1_->new_avatar = _tmp4_;
	_tmp6_ = self->priv->_avatar;
	if (_tmp6_ != NULL) {
		GLoadableIcon* _tmp7_;
		_tmp7_ = _data1_->new_avatar;
		_tmp5_ = _tmp7_ == NULL;
	} else {
		_tmp5_ = FALSE;
	}
	_tmp8_ = _tmp5_;
	if (_tmp8_) {
		FolksAvatarCache* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		_tmp9_ = _data1_->cache;
		_tmp10_ = folks_persona_get_uid ((FolksPersona*) self);
		_tmp11_ = _tmp10_;
		folks_avatar_cache_remove_avatar (_tmp9_, _tmp11_, ____lambda2__gasync_ready_callback, block1_data_ref (_data1_));
	} else {
		gboolean _tmp12_ = FALSE;
		gboolean _tmp13_ = FALSE;
		GLoadableIcon* _tmp14_;
		GLoadableIcon* _tmp15_;
		gboolean _tmp17_;
		gboolean _tmp28_;
		_tmp14_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) self);
		_tmp15_ = _tmp14_;
		if (_tmp15_ == NULL) {
			GLoadableIcon* _tmp16_;
			_tmp16_ = _data1_->new_avatar;
			_tmp13_ = _tmp16_ != NULL;
		} else {
			_tmp13_ = FALSE;
		}
		_tmp17_ = _tmp13_;
		if (_tmp17_) {
			_tmp12_ = TRUE;
		} else {
			gboolean _tmp18_ = FALSE;
			gboolean _tmp19_ = FALSE;
			GLoadableIcon* _tmp20_;
			GLoadableIcon* _tmp21_;
			gboolean _tmp23_;
			gboolean _tmp27_;
			_tmp20_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) self);
			_tmp21_ = _tmp20_;
			if (_tmp21_ != NULL) {
				GLoadableIcon* _tmp22_;
				_tmp22_ = _data1_->new_avatar;
				_tmp19_ = _tmp22_ != NULL;
			} else {
				_tmp19_ = FALSE;
			}
			_tmp23_ = _tmp19_;
			if (_tmp23_) {
				GLoadableIcon* _tmp24_;
				GLoadableIcon* _tmp25_;
				gboolean _tmp26_ = FALSE;
				_tmp24_ = self->priv->_avatar;
				_tmp25_ = _data1_->new_avatar;
				_tmp26_ = g_icon_equal ((GIcon*) _tmp24_, (GIcon*) _tmp25_);
				_tmp18_ = _tmp26_ == FALSE;
			} else {
				_tmp18_ = FALSE;
			}
			_tmp27_ = _tmp18_;
			_tmp12_ = _tmp27_;
		}
		_tmp28_ = _tmp12_;
		if (_tmp28_) {
			FolksAvatarCache* _tmp29_;
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			GLoadableIcon* _tmp32_;
			_tmp29_ = _data1_->cache;
			_tmp30_ = folks_persona_get_uid ((FolksPersona*) self);
			_tmp31_ = _tmp30_;
			_tmp32_ = _data1_->new_avatar;
			folks_avatar_cache_store_avatar (_tmp29_, _tmp31_, _tmp32_, _____lambda5__gasync_ready_callback, block1_data_ref (_data1_));
		}
	}
	__vala_EContactPhoto_free0 (p);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}


static void _edsf_persona_update_urls (EdsfPersona* self) {
	GeeHashSet* _tmp0_;
	GeeHashSet* new_urls;
	EContact* _tmp21_;
	EVCard* _tmp22_;
	EVCard* vcard;
	EVCard* _tmp23_;
	GList* _tmp24_ = NULL;
	GeeHashSet* _tmp36_;
	GeeHashSet* _tmp37_;
	gboolean _tmp38_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
	new_urls = _tmp0_;
	{
		EdsfPersonaUrlTypeMapping* mapping_collection = NULL;
		gint mapping_collection_length1 = 0;
		gint _mapping_collection_size_ = 0;
		gint mapping_it = 0;
		mapping_collection = EDSF_PERSONA__url_properties;
		mapping_collection_length1 = G_N_ELEMENTS (EDSF_PERSONA__url_properties);
		for (mapping_it = 0; mapping_it < G_N_ELEMENTS (EDSF_PERSONA__url_properties); mapping_it = mapping_it + 1) {
			EdsfPersonaUrlTypeMapping mapping = {0};
			mapping = mapping_collection[mapping_it];
			{
				EdsfPersonaUrlTypeMapping _tmp1_;
				const gchar* _tmp2_;
				gchar* _tmp3_;
				gchar* url_property;
				EdsfPersonaUrlTypeMapping _tmp4_;
				const gchar* _tmp5_;
				gchar* _tmp6_;
				gchar* folks_type;
				const gchar* _tmp7_;
				void* _tmp8_ = NULL;
				gchar* _tmp9_;
				gchar* u;
				gboolean _tmp10_ = FALSE;
				const gchar* _tmp11_;
				gboolean _tmp13_;
				_tmp1_ = mapping;
				_tmp2_ = _tmp1_.vcard_field_name;
				_tmp3_ = g_strdup (_tmp2_);
				url_property = _tmp3_;
				_tmp4_ = mapping;
				_tmp5_ = _tmp4_.folks_type;
				_tmp6_ = g_strdup (_tmp5_);
				folks_type = _tmp6_;
				_tmp7_ = url_property;
				_tmp8_ = _edsf_persona_get_property (self, _tmp7_);
				_tmp9_ = g_strdup ((const gchar*) _tmp8_);
				u = _tmp9_;
				_tmp11_ = u;
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					_tmp12_ = u;
					_tmp10_ = g_strcmp0 (_tmp12_, "") != 0;
				} else {
					_tmp10_ = FALSE;
				}
				_tmp13_ = _tmp10_;
				if (_tmp13_) {
					const gchar* _tmp14_;
					FolksUrlFieldDetails* _tmp15_;
					FolksUrlFieldDetails* fd_u;
					FolksUrlFieldDetails* _tmp16_;
					FolksUrlFieldDetails* _tmp17_;
					const gchar* _tmp18_;
					GeeHashSet* _tmp19_;
					FolksUrlFieldDetails* _tmp20_;
					_tmp14_ = u;
					_tmp15_ = folks_url_field_details_new (_tmp14_, NULL);
					fd_u = _tmp15_;
					_tmp16_ = fd_u;
					_tmp17_ = fd_u;
					_tmp18_ = folks_type;
					folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp16_, FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE, _tmp18_);
					_tmp19_ = new_urls;
					_tmp20_ = fd_u;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, _tmp20_);
					_g_object_unref0 (fd_u);
				}
				_g_free0 (u);
				_g_free0 (folks_type);
				_g_free0 (url_property);
			}
		}
	}
	_tmp21_ = self->priv->_contact;
	_tmp22_ = _g_object_ref0 (E_VCARD (_tmp21_));
	vcard = _tmp22_;
	_tmp23_ = vcard;
	_tmp24_ = e_vcard_get_attributes (_tmp23_);
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp24_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				EVCardAttribute* _tmp25_;
				const gchar* _tmp26_ = NULL;
				_tmp25_ = attr;
				_tmp26_ = e_vcard_attribute_get_name (_tmp25_);
				if (g_strcmp0 (_tmp26_, "X-URIS") == 0) {
					EVCardAttribute* _tmp27_;
					gchar* _tmp28_ = NULL;
					gchar* _tmp29_;
					FolksUrlFieldDetails* _tmp30_;
					FolksUrlFieldDetails* _tmp31_;
					FolksUrlFieldDetails* url_fd;
					FolksUrlFieldDetails* _tmp32_;
					EVCardAttribute* _tmp33_;
					GeeHashSet* _tmp34_;
					FolksUrlFieldDetails* _tmp35_;
					_tmp27_ = attr;
					_tmp28_ = e_vcard_attribute_get_value (_tmp27_);
					_tmp29_ = _tmp28_;
					_tmp30_ = folks_url_field_details_new (_tmp29_, NULL);
					_tmp31_ = _tmp30_;
					_g_free0 (_tmp29_);
					url_fd = _tmp31_;
					_tmp32_ = url_fd;
					_tmp33_ = attr;
					_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp32_, _tmp33_);
					_tmp34_ = new_urls;
					_tmp35_ = url_fd;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp34_, _tmp35_);
					_g_object_unref0 (url_fd);
				}
			}
		}
	}
	_tmp36_ = new_urls;
	_tmp37_ = self->priv->_urls;
	_tmp38_ = folks_utils_set_afd_equal ((GeeSet*) _tmp36_, (GeeSet*) _tmp37_);
	if (!_tmp38_) {
		GeeHashSet* _tmp39_;
		GeeHashSet* _tmp40_;
		GeeHashSet* _tmp41_;
		GeeSet* _tmp42_;
		GeeSet* _tmp43_;
		_tmp39_ = new_urls;
		_tmp40_ = _g_object_ref0 (_tmp39_);
		_g_object_unref0 (self->priv->_urls);
		self->priv->_urls = _tmp40_;
		_tmp41_ = new_urls;
		_tmp42_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp41_);
		_tmp43_ = _tmp42_;
		_g_object_unref0 (self->priv->_urls_ro);
		self->priv->_urls_ro = _tmp43_;
		g_object_notify ((GObject*) self, "urls");
	}
	_g_object_unref0 (vcard);
	_g_object_unref0 (new_urls);
}


static void _edsf_persona_update_im_addresses (EdsfPersona* self) {
	GHashTable* _tmp0_ = NULL;
	GHashTable* im_eds_map;
	GeeHashMultiMap* _tmp1_;
	GeeHashMultiMap* new_im_addresses;
	GHashTable* _tmp2_;
	GList* _tmp3_ = NULL;
	GeeHashMultiMap* _tmp73_;
	GeeHashMultiMap* _tmp74_;
	gboolean _tmp75_ = FALSE;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = _edsf_persona_get_im_eds_map ();
	im_eds_map = _tmp0_;
	_tmp1_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	new_im_addresses = _tmp1_;
	_tmp2_ = im_eds_map;
	_tmp3_ = g_hash_table_get_keys (_tmp2_);
	{
		GList* im_proto_collection = NULL;
		GList* im_proto_it = NULL;
		im_proto_collection = _tmp3_;
		for (im_proto_it = im_proto_collection; im_proto_it != NULL; im_proto_it = im_proto_it->next) {
			const gchar* im_proto = NULL;
			im_proto = (const gchar*) im_proto_it->data;
			{
				EContact* _tmp4_;
				GHashTable* _tmp5_;
				const gchar* _tmp6_;
				gconstpointer _tmp7_ = NULL;
				GList* _tmp8_ = NULL;
				GList* addresses;
				GList* _tmp9_;
				_tmp4_ = self->priv->_contact;
				_tmp5_ = im_eds_map;
				_tmp6_ = im_proto;
				_tmp7_ = g_hash_table_lookup (_tmp5_, _tmp6_);
				_tmp8_ = e_contact_get_attributes (_tmp4_, GPOINTER_TO_INT (_tmp7_));
				addresses = _tmp8_;
				_tmp9_ = addresses;
				{
					GList* attr_collection = NULL;
					GList* attr_it = NULL;
					attr_collection = _tmp9_;
					for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
						EVCardAttribute* _tmp10_;
						EVCardAttribute* attr = NULL;
						_tmp10_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
						attr = _tmp10_;
						{
							{
								EVCardAttribute* _tmp11_;
								gchar* _tmp12_ = NULL;
								gchar* addr;
								const gchar* _tmp13_;
								const gchar* _tmp14_;
								gchar* _tmp15_ = NULL;
								gchar* _tmp16_;
								gchar* _tmp17_;
								gchar* _tmp18_;
								gchar* _tmp19_;
								gchar* normalised_addr;
								const gchar* _tmp20_;
								FolksImFieldDetails* _tmp21_;
								FolksImFieldDetails* im_fd;
								GeeHashMultiMap* _tmp22_;
								const gchar* _tmp23_;
								FolksImFieldDetails* _tmp24_;
								_tmp11_ = attr;
								_tmp12_ = e_vcard_attribute_get_value (_tmp11_);
								addr = _tmp12_;
								_tmp13_ = addr;
								_tmp14_ = im_proto;
								_tmp15_ = folks_im_details_normalise_im_address (_tmp13_, _tmp14_, &_inner_error_);
								_tmp16_ = _tmp15_;
								if (_inner_error_ != NULL) {
									_g_free0 (addr);
									if (_inner_error_->domain == FOLKS_IM_DETAILS_ERROR) {
										goto __catch2_folks_im_details_error;
									}
									_g_free0 (addr);
									__vala_EVCardAttribute_free0 (attr);
									__g_list_free___vala_EVCardAttribute_free0_0 (addresses);
									_g_list_free0 (im_proto_collection);
									_g_object_unref0 (new_im_addresses);
									_g_hash_table_unref0 (im_eds_map);
									g_critical ("file %s: line %d: unexpected 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;
								}
								_tmp17_ = _tmp16_;
								_tmp18_ = _tmp17_;
								_tmp17_ = NULL;
								_tmp19_ = _tmp18_;
								_g_free0 (_tmp17_);
								normalised_addr = _tmp19_;
								_tmp20_ = normalised_addr;
								_tmp21_ = folks_im_field_details_new (_tmp20_, NULL);
								im_fd = _tmp21_;
								_tmp22_ = new_im_addresses;
								_tmp23_ = im_proto;
								_tmp24_ = im_fd;
								gee_multi_map_set ((GeeMultiMap*) _tmp22_, _tmp23_, _tmp24_);
								_g_object_unref0 (im_fd);
								_g_free0 (normalised_addr);
								_g_free0 (addr);
							}
							goto __finally2;
							__catch2_folks_im_details_error:
							{
								GError* e = NULL;
								GError* _tmp25_;
								const gchar* _tmp26_;
								e = _inner_error_;
								_inner_error_ = NULL;
								_tmp25_ = e;
								_tmp26_ = _tmp25_->message;
								g_warning ("edsf-persona.vala:1260: Problem when trying to normalise address: %s\n", _tmp26_);
								_g_error_free0 (e);
							}
							__finally2:
							if (_inner_error_ != NULL) {
								__vala_EVCardAttribute_free0 (attr);
								__g_list_free___vala_EVCardAttribute_free0_0 (addresses);
								_g_list_free0 (im_proto_collection);
								_g_object_unref0 (new_im_addresses);
								_g_hash_table_unref0 (im_eds_map);
								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;
							}
							__vala_EVCardAttribute_free0 (attr);
						}
					}
				}
				__g_list_free___vala_EVCardAttribute_free0_0 (addresses);
			}
		}
		_g_list_free0 (im_proto_collection);
	}
	{
		GeeSet* _tmp27_;
		GeeSet* _tmp28_;
		GeeIterator* _tmp29_ = NULL;
		GeeIterator* _email_it;
		_tmp27_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) self);
		_tmp28_ = _tmp27_;
		_tmp29_ = gee_iterable_iterator ((GeeIterable*) _tmp28_);
		_email_it = _tmp29_;
		while (TRUE) {
			GeeIterator* _tmp30_;
			gboolean _tmp31_ = FALSE;
			GeeIterator* _tmp32_;
			gpointer _tmp33_ = NULL;
			FolksEmailFieldDetails* email;
			FolksEmailFieldDetails* _tmp34_;
			gconstpointer _tmp35_;
			const gchar* _tmp36_;
			gchar* _tmp37_ = NULL;
			gchar* proto;
			const gchar* _tmp38_;
			_tmp30_ = _email_it;
			_tmp31_ = gee_iterator_next (_tmp30_);
			if (!_tmp31_) {
				break;
			}
			_tmp32_ = _email_it;
			_tmp33_ = gee_iterator_get (_tmp32_);
			email = (FolksEmailFieldDetails*) _tmp33_;
			_tmp34_ = email;
			_tmp35_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = _edsf_persona_im_proto_from_addr (self, (const gchar*) _tmp36_);
			proto = _tmp37_;
			_tmp38_ = proto;
			if (_tmp38_ != NULL) {
				gboolean exists;
				GeeMultiMap* _tmp39_;
				GeeMultiMap* _tmp40_;
				const gchar* _tmp41_;
				GeeCollection* _tmp42_ = NULL;
				GeeCollection* current_im_addrs;
				GeeCollection* _tmp43_;
				gboolean _tmp56_;
				exists = FALSE;
				_tmp39_ = folks_im_details_get_im_addresses ((FolksImDetails*) self);
				_tmp40_ = _tmp39_;
				_tmp41_ = proto;
				_tmp42_ = gee_multi_map_get (_tmp40_, _tmp41_);
				current_im_addrs = _tmp42_;
				_tmp43_ = current_im_addrs;
				if (_tmp43_ != NULL) {
					{
						GeeCollection* _tmp44_;
						GeeIterator* _tmp45_ = NULL;
						GeeIterator* _cur_im_it;
						_tmp44_ = current_im_addrs;
						_tmp45_ = gee_iterable_iterator ((GeeIterable*) _tmp44_);
						_cur_im_it = _tmp45_;
						while (TRUE) {
							GeeIterator* _tmp46_;
							gboolean _tmp47_ = FALSE;
							GeeIterator* _tmp48_;
							gpointer _tmp49_ = NULL;
							FolksImFieldDetails* cur_im;
							FolksImFieldDetails* _tmp50_;
							gconstpointer _tmp51_;
							const gchar* _tmp52_;
							FolksEmailFieldDetails* _tmp53_;
							gconstpointer _tmp54_;
							const gchar* _tmp55_;
							_tmp46_ = _cur_im_it;
							_tmp47_ = gee_iterator_next (_tmp46_);
							if (!_tmp47_) {
								break;
							}
							_tmp48_ = _cur_im_it;
							_tmp49_ = gee_iterator_get (_tmp48_);
							cur_im = (FolksImFieldDetails*) _tmp49_;
							_tmp50_ = cur_im;
							_tmp51_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp50_);
							_tmp52_ = _tmp51_;
							_tmp53_ = email;
							_tmp54_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp53_);
							_tmp55_ = _tmp54_;
							if (g_strcmp0 ((const gchar*) _tmp52_, (const gchar*) _tmp55_) == 0) {
								exists = TRUE;
								_g_object_unref0 (cur_im);
								break;
							}
							_g_object_unref0 (cur_im);
						}
						_g_object_unref0 (_cur_im_it);
					}
				}
				_tmp56_ = exists;
				if (_tmp56_) {
					_g_object_unref0 (current_im_addrs);
					_g_free0 (proto);
					_g_object_unref0 (email);
					continue;
				}
				{
					FolksEmailFieldDetails* _tmp57_;
					gconstpointer _tmp58_;
					const gchar* _tmp59_;
					const gchar* _tmp60_;
					gchar* _tmp61_ = NULL;
					gchar* _tmp62_;
					gchar* _tmp63_;
					gchar* _tmp64_;
					gchar* _tmp65_;
					gchar* normalised_addr;
					const gchar* _tmp66_;
					FolksImFieldDetails* _tmp67_;
					FolksImFieldDetails* im_fd;
					GeeHashMultiMap* _tmp68_;
					const gchar* _tmp69_;
					FolksImFieldDetails* _tmp70_;
					_tmp57_ = email;
					_tmp58_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp57_);
					_tmp59_ = _tmp58_;
					_tmp60_ = proto;
					_tmp61_ = folks_im_details_normalise_im_address ((const gchar*) _tmp59_, _tmp60_, &_inner_error_);
					_tmp62_ = _tmp61_;
					if (_inner_error_ != NULL) {
						if (_inner_error_->domain == FOLKS_IM_DETAILS_ERROR) {
							goto __catch3_folks_im_details_error;
						}
						_g_object_unref0 (current_im_addrs);
						_g_free0 (proto);
						_g_object_unref0 (email);
						_g_object_unref0 (_email_it);
						_g_object_unref0 (new_im_addresses);
						_g_hash_table_unref0 (im_eds_map);
						g_critical ("file %s: line %d: unexpected 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;
					}
					_tmp63_ = _tmp62_;
					_tmp64_ = _tmp63_;
					_tmp63_ = NULL;
					_tmp65_ = _tmp64_;
					_g_free0 (_tmp63_);
					normalised_addr = _tmp65_;
					_tmp66_ = normalised_addr;
					_tmp67_ = folks_im_field_details_new (_tmp66_, NULL);
					im_fd = _tmp67_;
					_tmp68_ = new_im_addresses;
					_tmp69_ = proto;
					_tmp70_ = im_fd;
					gee_multi_map_set ((GeeMultiMap*) _tmp68_, _tmp69_, _tmp70_);
					_g_object_unref0 (im_fd);
					_g_free0 (normalised_addr);
				}
				goto __finally3;
				__catch3_folks_im_details_error:
				{
					GError* e = NULL;
					GError* _tmp71_;
					const gchar* _tmp72_;
					e = _inner_error_;
					_inner_error_ = NULL;
					_tmp71_ = e;
					_tmp72_ = _tmp71_->message;
					g_warning ("edsf-persona.vala:1308: Problem when trying to normalise address: %s\n", _tmp72_);
					_g_error_free0 (e);
				}
				__finally3:
				if (_inner_error_ != NULL) {
					_g_object_unref0 (current_im_addrs);
					_g_free0 (proto);
					_g_object_unref0 (email);
					_g_object_unref0 (_email_it);
					_g_object_unref0 (new_im_addresses);
					_g_hash_table_unref0 (im_eds_map);
					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;
				}
				_g_object_unref0 (current_im_addrs);
			}
			_g_free0 (proto);
			_g_object_unref0 (email);
		}
		_g_object_unref0 (_email_it);
	}
	_tmp73_ = new_im_addresses;
	_tmp74_ = self->priv->_im_addresses;
	_tmp75_ = folks_utils_multi_map_str_afd_equal ((GeeMultiMap*) _tmp73_, (GeeMultiMap*) _tmp74_);
	if (!_tmp75_) {
		GeeHashMultiMap* _tmp76_;
		GeeHashMultiMap* _tmp77_;
		_tmp76_ = new_im_addresses;
		_tmp77_ = _g_object_ref0 (_tmp76_);
		_g_object_unref0 (self->priv->_im_addresses);
		self->priv->_im_addresses = _tmp77_;
		g_object_notify ((GObject*) self, "im-addresses");
	}
	_g_object_unref0 (new_im_addresses);
	_g_hash_table_unref0 (im_eds_map);
}


static void _edsf_persona_update_groups (EdsfPersona* self) {
	EContact* _tmp0_;
	void* _tmp1_ = NULL;
	GList* category_names;
	GeeHashSet* _tmp2_;
	GeeHashSet* new_categories;
	GeeLinkedList* _tmp3_;
	GeeLinkedList* added_categories;
	GList* _tmp4_;
	GeeLinkedList* _tmp13_;
	GeeLinkedList* removed_categories;
	gboolean _tmp53_ = FALSE;
	GeeLinkedList* _tmp54_;
	gint _tmp55_;
	gint _tmp56_;
	gboolean _tmp60_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_contact;
	_tmp1_ = e_contact_get (_tmp0_, E_CONTACT_CATEGORY_LIST);
	category_names = (GList*) _tmp1_;
	_tmp2_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	new_categories = _tmp2_;
	_tmp3_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
	added_categories = _tmp3_;
	_tmp4_ = category_names;
	{
		GList* category_name_collection = NULL;
		GList* category_name_it = NULL;
		category_name_collection = _tmp4_;
		for (category_name_it = category_name_collection; category_name_it != NULL; category_name_it = category_name_it->next) {
			gchar* _tmp5_;
			gchar* category_name = NULL;
			_tmp5_ = g_strdup ((const gchar*) category_name_it->data);
			category_name = _tmp5_;
			{
				GeeHashSet* _tmp6_;
				const gchar* _tmp7_;
				GeeHashSet* _tmp8_;
				const gchar* _tmp9_;
				gboolean _tmp10_ = FALSE;
				_tmp6_ = new_categories;
				_tmp7_ = category_name;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp7_);
				_tmp8_ = self->priv->_groups;
				_tmp9_ = category_name;
				_tmp10_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp8_, _tmp9_);
				if (!_tmp10_) {
					GeeLinkedList* _tmp11_;
					const gchar* _tmp12_;
					_tmp11_ = added_categories;
					_tmp12_ = category_name;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp12_);
				}
				_g_free0 (category_name);
			}
		}
	}
	_tmp13_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
	removed_categories = _tmp13_;
	{
		GeeHashSet* _tmp14_;
		GeeIterator* _tmp15_ = NULL;
		GeeIterator* _category_name_it;
		_tmp14_ = self->priv->_groups;
		_tmp15_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp14_);
		_category_name_it = _tmp15_;
		while (TRUE) {
			GeeIterator* _tmp16_;
			gboolean _tmp17_ = FALSE;
			GeeIterator* _tmp18_;
			gpointer _tmp19_ = NULL;
			gchar* category_name;
			GeeHashSet* _tmp20_;
			const gchar* _tmp21_;
			gboolean _tmp22_ = FALSE;
			_tmp16_ = _category_name_it;
			_tmp17_ = gee_iterator_next (_tmp16_);
			if (!_tmp17_) {
				break;
			}
			_tmp18_ = _category_name_it;
			_tmp19_ = gee_iterator_get (_tmp18_);
			category_name = (gchar*) _tmp19_;
			_tmp20_ = new_categories;
			_tmp21_ = category_name;
			_tmp22_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp20_, _tmp21_);
			if (!_tmp22_) {
				GeeLinkedList* _tmp23_;
				const gchar* _tmp24_;
				_tmp23_ = removed_categories;
				_tmp24_ = category_name;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp23_, _tmp24_);
			}
			_g_free0 (category_name);
		}
		_g_object_unref0 (_category_name_it);
	}
	{
		GeeLinkedList* _tmp25_;
		GeeLinkedList* _tmp26_;
		GeeLinkedList* _category_name_list;
		GeeLinkedList* _tmp27_;
		gint _tmp28_;
		gint _tmp29_;
		gint _category_name_size;
		gint _category_name_index;
		_tmp25_ = removed_categories;
		_tmp26_ = _g_object_ref0 (_tmp25_);
		_category_name_list = _tmp26_;
		_tmp27_ = _category_name_list;
		_tmp28_ = gee_collection_get_size ((GeeCollection*) _tmp27_);
		_tmp29_ = _tmp28_;
		_category_name_size = _tmp29_;
		_category_name_index = -1;
		while (TRUE) {
			gint _tmp30_;
			gint _tmp31_;
			gint _tmp32_;
			GeeLinkedList* _tmp33_;
			gint _tmp34_;
			gpointer _tmp35_ = NULL;
			gchar* category_name;
			const gchar* _tmp36_;
			GeeHashSet* _tmp37_;
			const gchar* _tmp38_;
			_tmp30_ = _category_name_index;
			_category_name_index = _tmp30_ + 1;
			_tmp31_ = _category_name_index;
			_tmp32_ = _category_name_size;
			if (!(_tmp31_ < _tmp32_)) {
				break;
			}
			_tmp33_ = _category_name_list;
			_tmp34_ = _category_name_index;
			_tmp35_ = gee_abstract_list_get ((GeeAbstractList*) _tmp33_, _tmp34_);
			category_name = (gchar*) _tmp35_;
			_tmp36_ = category_name;
			g_signal_emit_by_name ((FolksGroupDetails*) self, "group-changed", _tmp36_, FALSE);
			_tmp37_ = self->priv->_groups;
			_tmp38_ = category_name;
			gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp37_, _tmp38_);
			_g_free0 (category_name);
		}
		_g_object_unref0 (_category_name_list);
	}
	{
		GeeLinkedList* _tmp39_;
		GeeLinkedList* _tmp40_;
		GeeLinkedList* _category_name_list;
		GeeLinkedList* _tmp41_;
		gint _tmp42_;
		gint _tmp43_;
		gint _category_name_size;
		gint _category_name_index;
		_tmp39_ = added_categories;
		_tmp40_ = _g_object_ref0 (_tmp39_);
		_category_name_list = _tmp40_;
		_tmp41_ = _category_name_list;
		_tmp42_ = gee_collection_get_size ((GeeCollection*) _tmp41_);
		_tmp43_ = _tmp42_;
		_category_name_size = _tmp43_;
		_category_name_index = -1;
		while (TRUE) {
			gint _tmp44_;
			gint _tmp45_;
			gint _tmp46_;
			GeeLinkedList* _tmp47_;
			gint _tmp48_;
			gpointer _tmp49_ = NULL;
			gchar* category_name;
			GeeHashSet* _tmp50_;
			const gchar* _tmp51_;
			const gchar* _tmp52_;
			_tmp44_ = _category_name_index;
			_category_name_index = _tmp44_ + 1;
			_tmp45_ = _category_name_index;
			_tmp46_ = _category_name_size;
			if (!(_tmp45_ < _tmp46_)) {
				break;
			}
			_tmp47_ = _category_name_list;
			_tmp48_ = _category_name_index;
			_tmp49_ = gee_abstract_list_get ((GeeAbstractList*) _tmp47_, _tmp48_);
			category_name = (gchar*) _tmp49_;
			_tmp50_ = self->priv->_groups;
			_tmp51_ = category_name;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp50_, _tmp51_);
			_tmp52_ = category_name;
			g_signal_emit_by_name ((FolksGroupDetails*) self, "group-changed", _tmp52_, TRUE);
			_g_free0 (category_name);
		}
		_g_object_unref0 (_category_name_list);
	}
	_tmp54_ = added_categories;
	_tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_);
	_tmp56_ = _tmp55_;
	if (_tmp56_ != 0) {
		_tmp53_ = TRUE;
	} else {
		GeeLinkedList* _tmp57_;
		gint _tmp58_;
		gint _tmp59_;
		_tmp57_ = removed_categories;
		_tmp58_ = gee_collection_get_size ((GeeCollection*) _tmp57_);
		_tmp59_ = _tmp58_;
		_tmp53_ = _tmp59_ != 0;
	}
	_tmp60_ = _tmp53_;
	if (_tmp60_) {
		g_object_notify ((GObject*) self, "groups");
	}
	_g_object_unref0 (removed_categories);
	_g_object_unref0 (added_categories);
	_g_object_unref0 (new_categories);
}


/**
   * build a table of im protocols / im protocol aliases
   */
static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


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


GHashTable* _edsf_persona_get_im_eds_map (void) {
	GHashTable* result = NULL;
	GHashTable* _tmp22_;
	GHashTable* _tmp23_;
	GError * _inner_error_ = NULL;
	{
		GHashTable* _tmp0_;
		_tmp0_ = edsf_persona__im_eds_map;
		g_static_rec_mutex_lock (&__lock_edsf_persona__im_eds_map);
		{
			GHashTable* _tmp1_;
			_tmp1_ = edsf_persona__im_eds_map;
			if (_tmp1_ == NULL) {
				GHashFunc _tmp2_;
				GEqualFunc _tmp3_;
				GHashTable* _tmp4_;
				GHashTable* _tmp5_;
				gchar* _tmp6_;
				GHashTable* _tmp7_;
				gchar* _tmp8_;
				GHashTable* _tmp9_;
				gchar* _tmp10_;
				GHashTable* _tmp11_;
				gchar* _tmp12_;
				GHashTable* _tmp13_;
				gchar* _tmp14_;
				GHashTable* _tmp15_;
				gchar* _tmp16_;
				GHashTable* _tmp17_;
				gchar* _tmp18_;
				GHashTable* _tmp19_;
				gchar* _tmp20_;
				_tmp2_ = g_str_hash;
				_tmp3_ = g_str_equal;
				_tmp4_ = g_hash_table_new_full (_tmp2_, _tmp3_, _g_free0_, NULL);
				_g_hash_table_unref0 (edsf_persona__im_eds_map);
				edsf_persona__im_eds_map = _tmp4_;
				_tmp5_ = edsf_persona__im_eds_map;
				_tmp6_ = g_strdup ("aim");
				g_hash_table_insert (_tmp5_, _tmp6_, GINT_TO_POINTER (E_CONTACT_IM_AIM));
				_tmp7_ = edsf_persona__im_eds_map;
				_tmp8_ = g_strdup ("yahoo");
				g_hash_table_insert (_tmp7_, _tmp8_, GINT_TO_POINTER (E_CONTACT_IM_YAHOO));
				_tmp9_ = edsf_persona__im_eds_map;
				_tmp10_ = g_strdup ("groupwise");
				g_hash_table_insert (_tmp9_, _tmp10_, GINT_TO_POINTER (E_CONTACT_IM_GROUPWISE));
				_tmp11_ = edsf_persona__im_eds_map;
				_tmp12_ = g_strdup ("jabber");
				g_hash_table_insert (_tmp11_, _tmp12_, GINT_TO_POINTER (E_CONTACT_IM_JABBER));
				_tmp13_ = edsf_persona__im_eds_map;
				_tmp14_ = g_strdup ("msn");
				g_hash_table_insert (_tmp13_, _tmp14_, GINT_TO_POINTER (E_CONTACT_IM_MSN));
				_tmp15_ = edsf_persona__im_eds_map;
				_tmp16_ = g_strdup ("icq");
				g_hash_table_insert (_tmp15_, _tmp16_, GINT_TO_POINTER (E_CONTACT_IM_ICQ));
				_tmp17_ = edsf_persona__im_eds_map;
				_tmp18_ = g_strdup ("gadugadu");
				g_hash_table_insert (_tmp17_, _tmp18_, GINT_TO_POINTER (E_CONTACT_IM_GADUGADU));
				_tmp19_ = edsf_persona__im_eds_map;
				_tmp20_ = g_strdup ("skype");
				g_hash_table_insert (_tmp19_, _tmp20_, GINT_TO_POINTER (E_CONTACT_IM_SKYPE));
			}
		}
		__finally4:
		{
			GHashTable* _tmp21_;
			_tmp21_ = edsf_persona__im_eds_map;
			g_static_rec_mutex_unlock (&__lock_edsf_persona__im_eds_map);
		}
		if (_inner_error_ != NULL) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	_tmp22_ = edsf_persona__im_eds_map;
	_tmp23_ = _g_hash_table_ref0 (_tmp22_);
	result = _tmp23_;
	return result;
}


static void _edsf_persona_update_phones (EdsfPersona* self) {
	GeeHashSet* _tmp0_;
	GeeHashSet* new_phone_numbers;
	EContact* _tmp1_;
	GList* _tmp2_ = NULL;
	GList* attrs;
	GList* _tmp3_;
	EdsfSetComparator* _tmp14_;
	EdsfSetComparator* comp;
	EdsfSetComparator* _tmp15_;
	GeeHashSet* _tmp16_;
	GeeHashSet* _tmp17_;
	gboolean _tmp18_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	new_phone_numbers = _tmp0_;
	_tmp1_ = self->priv->_contact;
	_tmp2_ = e_contact_get_attributes (_tmp1_, E_CONTACT_TEL);
	attrs = _tmp2_;
	_tmp3_ = attrs;
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp3_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* _tmp4_;
			EVCardAttribute* attr = NULL;
			_tmp4_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
			attr = _tmp4_;
			{
				EVCardAttribute* _tmp5_;
				gchar* _tmp6_ = NULL;
				gchar* _tmp7_;
				FolksPhoneFieldDetails* _tmp8_;
				FolksPhoneFieldDetails* _tmp9_;
				FolksPhoneFieldDetails* phone_fd;
				FolksPhoneFieldDetails* _tmp10_;
				EVCardAttribute* _tmp11_;
				GeeHashSet* _tmp12_;
				FolksPhoneFieldDetails* _tmp13_;
				_tmp5_ = attr;
				_tmp6_ = e_vcard_attribute_get_value (_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = folks_phone_field_details_new (_tmp7_, NULL);
				_tmp9_ = _tmp8_;
				_g_free0 (_tmp7_);
				phone_fd = _tmp9_;
				_tmp10_ = phone_fd;
				_tmp11_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp10_, _tmp11_);
				_tmp12_ = new_phone_numbers;
				_tmp13_ = phone_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp13_);
				_g_object_unref0 (phone_fd);
				__vala_EVCardAttribute_free0 (attr);
			}
		}
	}
	_tmp14_ = edsf_set_comparator_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
	comp = _tmp14_;
	_tmp15_ = comp;
	_tmp16_ = new_phone_numbers;
	_tmp17_ = self->priv->_phone_numbers;
	_tmp18_ = edsf_set_comparator_equal (_tmp15_, (GeeSet*) _tmp16_, (GeeSet*) _tmp17_);
	if (!_tmp18_) {
		GeeHashSet* _tmp19_;
		GeeHashSet* _tmp20_;
		GeeHashSet* _tmp21_;
		GeeSet* _tmp22_;
		GeeSet* _tmp23_;
		_tmp19_ = new_phone_numbers;
		_tmp20_ = _g_object_ref0 (_tmp19_);
		_g_object_unref0 (self->priv->_phone_numbers);
		self->priv->_phone_numbers = _tmp20_;
		_tmp21_ = new_phone_numbers;
		_tmp22_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp21_);
		_tmp23_ = _tmp22_;
		_g_object_unref0 (self->priv->_phone_numbers_ro);
		self->priv->_phone_numbers_ro = _tmp23_;
		g_object_notify ((GObject*) self, "phone-numbers");
	}
	_g_object_unref0 (comp);
	__g_list_free___vala_EVCardAttribute_free0_0 (attrs);
	_g_object_unref0 (new_phone_numbers);
}


static FolksPostalAddress* _edsf_persona_postal_address_from_attribute (EdsfPersona* self, EVCardAttribute* attr) {
	FolksPostalAddress* result = NULL;
	EVCardAttribute* _tmp0_;
	GList* _tmp1_ = NULL;
	GList* values;
	GList* _tmp2_;
	GList* l;
	gchar* _tmp3_;
	gchar* address_format;
	gchar* _tmp4_;
	gchar* po_box;
	gchar* _tmp5_;
	gchar* extension;
	gchar* _tmp6_;
	gchar* street;
	gchar* _tmp7_;
	gchar* locality;
	gchar* _tmp8_;
	gchar* region;
	gchar* _tmp9_;
	gchar* postal_code;
	gchar* _tmp10_;
	gchar* country;
	GList* _tmp11_;
	GList* _tmp17_;
	GList* _tmp23_;
	GList* _tmp29_;
	GList* _tmp35_;
	GList* _tmp41_;
	GList* _tmp47_;
	const gchar* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	const gchar* _tmp56_;
	const gchar* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	FolksPostalAddress* _tmp61_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (attr != NULL, NULL);
	_tmp0_ = attr;
	_tmp1_ = e_vcard_attribute_get_values (_tmp0_);
	values = _tmp1_;
	_tmp2_ = values;
	l = _tmp2_;
	_tmp3_ = g_strdup ("");
	address_format = _tmp3_;
	_tmp4_ = g_strdup ("");
	po_box = _tmp4_;
	_tmp5_ = g_strdup ("");
	extension = _tmp5_;
	_tmp6_ = g_strdup ("");
	street = _tmp6_;
	_tmp7_ = g_strdup ("");
	locality = _tmp7_;
	_tmp8_ = g_strdup ("");
	region = _tmp8_;
	_tmp9_ = g_strdup ("");
	postal_code = _tmp9_;
	_tmp10_ = g_strdup ("");
	country = _tmp10_;
	_tmp11_ = l;
	if (_tmp11_ != NULL) {
		GList* _tmp12_;
		gconstpointer _tmp13_;
		gchar* _tmp14_;
		GList* _tmp15_;
		GList* _tmp16_;
		_tmp12_ = l;
		_tmp13_ = _tmp12_->data;
		_tmp14_ = g_strdup ((const gchar*) _tmp13_);
		_g_free0 (po_box);
		po_box = _tmp14_;
		_tmp15_ = l;
		_tmp16_ = _tmp15_->next;
		l = _tmp16_;
	}
	_tmp17_ = l;
	if (_tmp17_ != NULL) {
		GList* _tmp18_;
		gconstpointer _tmp19_;
		gchar* _tmp20_;
		GList* _tmp21_;
		GList* _tmp22_;
		_tmp18_ = l;
		_tmp19_ = _tmp18_->data;
		_tmp20_ = g_strdup ((const gchar*) _tmp19_);
		_g_free0 (extension);
		extension = _tmp20_;
		_tmp21_ = l;
		_tmp22_ = _tmp21_->next;
		l = _tmp22_;
	}
	_tmp23_ = l;
	if (_tmp23_ != NULL) {
		GList* _tmp24_;
		gconstpointer _tmp25_;
		gchar* _tmp26_;
		GList* _tmp27_;
		GList* _tmp28_;
		_tmp24_ = l;
		_tmp25_ = _tmp24_->data;
		_tmp26_ = g_strdup ((const gchar*) _tmp25_);
		_g_free0 (street);
		street = _tmp26_;
		_tmp27_ = l;
		_tmp28_ = _tmp27_->next;
		l = _tmp28_;
	}
	_tmp29_ = l;
	if (_tmp29_ != NULL) {
		GList* _tmp30_;
		gconstpointer _tmp31_;
		gchar* _tmp32_;
		GList* _tmp33_;
		GList* _tmp34_;
		_tmp30_ = l;
		_tmp31_ = _tmp30_->data;
		_tmp32_ = g_strdup ((const gchar*) _tmp31_);
		_g_free0 (locality);
		locality = _tmp32_;
		_tmp33_ = l;
		_tmp34_ = _tmp33_->next;
		l = _tmp34_;
	}
	_tmp35_ = l;
	if (_tmp35_ != NULL) {
		GList* _tmp36_;
		gconstpointer _tmp37_;
		gchar* _tmp38_;
		GList* _tmp39_;
		GList* _tmp40_;
		_tmp36_ = l;
		_tmp37_ = _tmp36_->data;
		_tmp38_ = g_strdup ((const gchar*) _tmp37_);
		_g_free0 (region);
		region = _tmp38_;
		_tmp39_ = l;
		_tmp40_ = _tmp39_->next;
		l = _tmp40_;
	}
	_tmp41_ = l;
	if (_tmp41_ != NULL) {
		GList* _tmp42_;
		gconstpointer _tmp43_;
		gchar* _tmp44_;
		GList* _tmp45_;
		GList* _tmp46_;
		_tmp42_ = l;
		_tmp43_ = _tmp42_->data;
		_tmp44_ = g_strdup ((const gchar*) _tmp43_);
		_g_free0 (postal_code);
		postal_code = _tmp44_;
		_tmp45_ = l;
		_tmp46_ = _tmp45_->next;
		l = _tmp46_;
	}
	_tmp47_ = l;
	if (_tmp47_ != NULL) {
		GList* _tmp48_;
		gconstpointer _tmp49_;
		gchar* _tmp50_;
		GList* _tmp51_;
		GList* _tmp52_;
		_tmp48_ = l;
		_tmp49_ = _tmp48_->data;
		_tmp50_ = g_strdup ((const gchar*) _tmp49_);
		_g_free0 (country);
		country = _tmp50_;
		_tmp51_ = l;
		_tmp52_ = _tmp51_->next;
		l = _tmp52_;
	}
	_tmp53_ = po_box;
	_tmp54_ = extension;
	_tmp55_ = street;
	_tmp56_ = locality;
	_tmp57_ = region;
	_tmp58_ = postal_code;
	_tmp59_ = country;
	_tmp60_ = address_format;
	_tmp61_ = folks_postal_address_new (_tmp53_, _tmp54_, _tmp55_, _tmp56_, _tmp57_, _tmp58_, _tmp59_, _tmp60_, NULL);
	result = _tmp61_;
	_g_free0 (country);
	_g_free0 (postal_code);
	_g_free0 (region);
	_g_free0 (locality);
	_g_free0 (street);
	_g_free0 (extension);
	_g_free0 (po_box);
	_g_free0 (address_format);
	return result;
}


static void _edsf_persona_update_addresses (EdsfPersona* self) {
	GeeHashSet* _tmp0_;
	GeeHashSet* new_postal_addresses;
	EContact* _tmp1_;
	GList* _tmp2_ = NULL;
	GList* attrs;
	GList* _tmp3_;
	EdsfSetComparator* _tmp13_;
	EdsfSetComparator* comp;
	EdsfSetComparator* _tmp14_;
	GeeHashSet* _tmp15_;
	GeeHashSet* _tmp16_;
	gboolean _tmp17_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	new_postal_addresses = _tmp0_;
	_tmp1_ = self->priv->_contact;
	_tmp2_ = e_contact_get_attributes (_tmp1_, E_CONTACT_ADDRESS);
	attrs = _tmp2_;
	_tmp3_ = attrs;
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp3_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				EVCardAttribute* _tmp4_;
				FolksPostalAddress* _tmp5_ = NULL;
				FolksPostalAddress* _tmp6_;
				FolksPostalAddressFieldDetails* _tmp7_;
				FolksPostalAddressFieldDetails* _tmp8_;
				FolksPostalAddressFieldDetails* pa_fd;
				FolksPostalAddressFieldDetails* _tmp9_;
				EVCardAttribute* _tmp10_;
				GeeHashSet* _tmp11_;
				FolksPostalAddressFieldDetails* _tmp12_;
				_tmp4_ = attr;
				_tmp5_ = _edsf_persona_postal_address_from_attribute (self, _tmp4_);
				_tmp6_ = _tmp5_;
				_tmp7_ = folks_postal_address_field_details_new (_tmp6_, NULL);
				_tmp8_ = _tmp7_;
				_g_object_unref0 (_tmp6_);
				pa_fd = _tmp8_;
				_tmp9_ = pa_fd;
				_tmp10_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp9_, _tmp10_);
				_tmp11_ = new_postal_addresses;
				_tmp12_ = pa_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp12_);
				_g_object_unref0 (pa_fd);
			}
		}
	}
	_tmp13_ = edsf_set_comparator_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
	comp = _tmp13_;
	_tmp14_ = comp;
	_tmp15_ = new_postal_addresses;
	_tmp16_ = self->priv->_postal_addresses;
	_tmp17_ = edsf_set_comparator_equal (_tmp14_, (GeeSet*) _tmp15_, (GeeSet*) _tmp16_);
	if (!_tmp17_) {
		GeeHashSet* _tmp18_;
		GeeHashSet* _tmp19_;
		GeeHashSet* _tmp20_;
		GeeSet* _tmp21_;
		GeeSet* _tmp22_;
		_tmp18_ = new_postal_addresses;
		_tmp19_ = _g_object_ref0 (_tmp18_);
		_g_object_unref0 (self->priv->_postal_addresses);
		self->priv->_postal_addresses = _tmp19_;
		_tmp20_ = new_postal_addresses;
		_tmp21_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp20_);
		_tmp22_ = _tmp21_;
		_g_object_unref0 (self->priv->_postal_addresses_ro);
		self->priv->_postal_addresses_ro = _tmp22_;
		g_object_notify ((GObject*) self, "phone-numbers");
	}
	g_object_notify ((GObject*) self, "postal-addresses");
	_g_object_unref0 (comp);
	__g_list_free___vala_EVCardAttribute_free0_0 (attrs);
	_g_object_unref0 (new_postal_addresses);
}


static void _edsf_persona_update_local_ids (EdsfPersona* self) {
	GeeHashSet* _tmp0_;
	GeeHashSet* new_local_ids;
	EContact* _tmp1_;
	EVCardAttribute* _tmp2_ = NULL;
	EVCardAttribute* _tmp3_;
	EVCardAttribute* ids;
	EVCardAttribute* _tmp4_;
	GeeHashSet* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	EdsfSetComparator* _tmp14_;
	EdsfSetComparator* comp;
	EdsfSetComparator* _tmp15_;
	GeeHashSet* _tmp16_;
	GeeSet* _tmp17_;
	GeeSet* _tmp18_;
	gboolean _tmp19_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	new_local_ids = _tmp0_;
	_tmp1_ = self->priv->_contact;
	_tmp2_ = e_vcard_get_attribute ((EVCard*) _tmp1_, "X-FOLKS-CONTACTS-IDS");
	_tmp3_ = __vala_EVCardAttribute_copy0 (_tmp2_);
	ids = _tmp3_;
	_tmp4_ = ids;
	if (_tmp4_ != NULL) {
		EVCardAttribute* _tmp5_;
		GList* _tmp6_ = NULL;
		GList* ids_v;
		GList* _tmp7_;
		_tmp5_ = ids;
		_tmp6_ = e_vcard_attribute_get_values (_tmp5_);
		ids_v = _tmp6_;
		_tmp7_ = ids_v;
		{
			GList* local_id_collection = NULL;
			GList* local_id_it = NULL;
			local_id_collection = _tmp7_;
			for (local_id_it = local_id_collection; local_id_it != NULL; local_id_it = local_id_it->next) {
				gchar* _tmp8_;
				gchar* local_id = NULL;
				_tmp8_ = g_strdup ((const gchar*) local_id_it->data);
				local_id = _tmp8_;
				{
					GeeHashSet* _tmp9_;
					const gchar* _tmp10_;
					_tmp9_ = new_local_ids;
					_tmp10_ = local_id;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp10_);
					_g_free0 (local_id);
				}
			}
		}
	}
	_tmp11_ = new_local_ids;
	_tmp12_ = folks_persona_get_iid ((FolksPersona*) self);
	_tmp13_ = _tmp12_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp13_);
	_tmp14_ = edsf_set_comparator_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free);
	comp = _tmp14_;
	_tmp15_ = comp;
	_tmp16_ = new_local_ids;
	_tmp17_ = folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self);
	_tmp18_ = _tmp17_;
	_tmp19_ = edsf_set_comparator_equal (_tmp15_, (GeeSet*) _tmp16_, _tmp18_);
	if (!_tmp19_) {
		GeeHashSet* _tmp20_;
		GeeHashSet* _tmp21_;
		GeeHashSet* _tmp22_;
		GeeSet* _tmp23_;
		GeeSet* _tmp24_;
		_tmp20_ = new_local_ids;
		_tmp21_ = _g_object_ref0 (_tmp20_);
		_g_object_unref0 (self->priv->_local_ids);
		self->priv->_local_ids = _tmp21_;
		_tmp22_ = self->priv->_local_ids;
		_tmp23_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp22_);
		_tmp24_ = _tmp23_;
		_g_object_unref0 (self->priv->_local_ids_ro);
		self->priv->_local_ids_ro = _tmp24_;
		g_object_notify ((GObject*) self, "local-ids");
	}
	_g_object_unref0 (comp);
	__vala_EVCardAttribute_free0 (ids);
	_g_object_unref0 (new_local_ids);
}


void* _edsf_persona_get_property_from_contact (EContact* contact, const gchar* prop_name) {
	void* result = NULL;
	void* prop_value;
	EContact* _tmp0_;
	const gchar* _tmp1_;
	EContactField _tmp2_ = 0;
	void* _tmp3_ = NULL;
	void* _tmp4_;
	g_return_val_if_fail (contact != NULL, NULL);
	g_return_val_if_fail (prop_name != NULL, NULL);
	prop_value = NULL;
	_tmp0_ = contact;
	_tmp1_ = prop_name;
	_tmp2_ = e_contact_field_id (_tmp1_);
	_tmp3_ = e_contact_get (_tmp0_, _tmp2_);
	prop_value = _tmp3_;
	_tmp4_ = prop_value;
	result = _tmp4_;
	return result;
}


static void* _edsf_persona_get_property (EdsfPersona* self, const gchar* prop_name) {
	void* result = NULL;
	EContact* _tmp0_;
	const gchar* _tmp1_;
	void* _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (prop_name != NULL, NULL);
	_tmp0_ = self->priv->_contact;
	_tmp1_ = prop_name;
	_tmp2_ = _edsf_persona_get_property_from_contact (_tmp0_, _tmp1_);
	result = _tmp2_;
	return result;
}


static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) {
	gint result = 0;
	gint _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* _result_;
	gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (needle != NULL, 0);
	_tmp0_ = start_index;
	_tmp1_ = needle;
	_tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
	_result_ = _tmp2_;
	_tmp3_ = _result_;
	if (_tmp3_ != NULL) {
		gchar* _tmp4_;
		_tmp4_ = _result_;
		result = (gint) (_tmp4_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}


static gchar* _edsf_persona_im_proto_from_addr (EdsfPersona* self, const gchar* addr) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gint _tmp1_ = 0;
	const gchar* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_ = NULL;
	gchar** tokens;
	gint tokens_length1;
	gint _tokens_size_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar** _tmp6_;
	gint _tmp6__length1;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* domain;
	const gchar* _tmp9_;
	gint _tmp10_ = 0;
	const gchar* _tmp11_;
	gchar** _tmp12_;
	gchar** _tmp13_ = NULL;
	gchar** _tmp14_;
	gint _tmp14__length1;
	gchar** _tmp15_;
	gint _tmp15__length1;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	const gchar* _tmp20_;
	gboolean _tmp22_;
	gboolean _tmp24_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (addr != NULL, NULL);
	_tmp0_ = addr;
	_tmp1_ = string_index_of (_tmp0_, "@", 0);
	if (_tmp1_ == (-1)) {
		result = NULL;
		return result;
	}
	_tmp2_ = addr;
	_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, "@", 2);
	tokens = _tmp4_;
	tokens_length1 = _vala_array_length (_tmp3_);
	_tokens_size_ = tokens_length1;
	_tmp5_ = tokens;
	_tmp5__length1 = tokens_length1;
	if (_tmp5__length1 != 2) {
		result = NULL;
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	_tmp6_ = tokens;
	_tmp6__length1 = tokens_length1;
	_tmp7_ = _tmp6_[1];
	_tmp8_ = g_strdup (_tmp7_);
	domain = _tmp8_;
	_tmp9_ = domain;
	_tmp10_ = string_index_of (_tmp9_, ".", 0);
	if (_tmp10_ == (-1)) {
		result = NULL;
		_g_free0 (domain);
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	_tmp11_ = domain;
	_tmp13_ = _tmp12_ = g_strsplit (_tmp11_, ".", 2);
	tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
	tokens = _tmp13_;
	tokens_length1 = _vala_array_length (_tmp12_);
	_tokens_size_ = tokens_length1;
	_tmp14_ = tokens;
	_tmp14__length1 = tokens_length1;
	if (_tmp14__length1 != 2) {
		result = NULL;
		_g_free0 (domain);
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	_tmp15_ = tokens;
	_tmp15__length1 = tokens_length1;
	_tmp16_ = _tmp15_[0];
	_tmp17_ = g_strdup (_tmp16_);
	_g_free0 (domain);
	domain = _tmp17_;
	_tmp20_ = domain;
	if (g_strcmp0 (_tmp20_, "msn") == 0) {
		_tmp19_ = TRUE;
	} else {
		const gchar* _tmp21_;
		_tmp21_ = domain;
		_tmp19_ = g_strcmp0 (_tmp21_, "hotmail") == 0;
	}
	_tmp22_ = _tmp19_;
	if (_tmp22_) {
		_tmp18_ = TRUE;
	} else {
		const gchar* _tmp23_;
		_tmp23_ = domain;
		_tmp18_ = g_strcmp0 (_tmp23_, "live") == 0;
	}
	_tmp24_ = _tmp18_;
	if (_tmp24_) {
		gchar* _tmp25_;
		_tmp25_ = g_strdup ("msn");
		result = _tmp25_;
		_g_free0 (domain);
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		return result;
	} else {
		gboolean _tmp26_ = FALSE;
		const gchar* _tmp27_;
		gboolean _tmp29_;
		_tmp27_ = domain;
		if (g_strcmp0 (_tmp27_, "gmail") == 0) {
			_tmp26_ = TRUE;
		} else {
			const gchar* _tmp28_;
			_tmp28_ = domain;
			_tmp26_ = g_strcmp0 (_tmp28_, "googlemail") == 0;
		}
		_tmp29_ = _tmp26_;
		if (_tmp29_) {
			gchar* _tmp30_;
			_tmp30_ = g_strdup ("jabber");
			result = _tmp30_;
			_g_free0 (domain);
			tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
			return result;
		} else {
			const gchar* _tmp31_;
			_tmp31_ = domain;
			if (g_strcmp0 (_tmp31_, "yahoo") == 0) {
				gchar* _tmp32_;
				_tmp32_ = g_strdup ("yahoo");
				result = _tmp32_;
				_g_free0 (domain);
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				return result;
			}
		}
	}
	result = NULL;
	_g_free0 (domain);
	tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


EContact* edsf_persona_get_contact (EdsfPersona* self) {
	EContact* result;
	EContact* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_contact;
	result = _tmp0_;
	return result;
}


static void edsf_persona_set_contact (EdsfPersona* self, EContact* value) {
	EContact* _tmp0_;
	EContact* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_contact);
	self->priv->_contact = _tmp1_;
	g_object_notify ((GObject *) self, "contact");
}


static GeeMultiMap* edsf_persona_real_get_web_service_addresses (FolksWebServiceDetails* base) {
	GeeMultiMap* result;
	EdsfPersona* self;
	GeeHashMultiMap* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_web_service_addresses;
	result = (GeeMultiMap*) _tmp0_;
	return result;
}


static void edsf_persona_real_set_web_service_addresses (FolksWebServiceDetails* base, GeeMultiMap* value) {
	EdsfPersona* self;
	GeeMultiMap* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_web_service_details_change_web_service_addresses ((FolksWebServiceDetails*) self, _tmp0_, NULL, NULL);
}


static GeeSet* edsf_persona_real_get_local_ids (FolksLocalIdDetails* base) {
	GeeSet* result;
	EdsfPersona* self;
	GeeHashSet* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GeeSet* _tmp7_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_local_ids;
	_tmp1_ = folks_persona_get_iid ((FolksPersona*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp0_, _tmp2_);
	if (_tmp3_ == FALSE) {
		GeeHashSet* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp4_ = self->priv->_local_ids;
		_tmp5_ = folks_persona_get_iid ((FolksPersona*) self);
		_tmp6_ = _tmp5_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _tmp6_);
	}
	_tmp7_ = self->priv->_local_ids_ro;
	result = _tmp7_;
	return result;
}


static void edsf_persona_real_set_local_ids (FolksLocalIdDetails* base, GeeSet* value) {
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_local_id_details_change_local_ids ((FolksLocalIdDetails*) self, _tmp0_, NULL, NULL);
}


static GeeSet* edsf_persona_real_get_postal_addresses (FolksPostalAddressDetails* base) {
	GeeSet* result;
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_postal_addresses_ro;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_postal_addresses (FolksPostalAddressDetails* base, GeeSet* value) {
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_postal_address_details_change_postal_addresses ((FolksPostalAddressDetails*) self, _tmp0_, NULL, NULL);
}


static GeeSet* edsf_persona_real_get_phone_numbers (FolksPhoneDetails* base) {
	GeeSet* result;
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_phone_numbers_ro;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_phone_numbers (FolksPhoneDetails* base, GeeSet* value) {
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_phone_details_change_phone_numbers ((FolksPhoneDetails*) self, _tmp0_, NULL, NULL);
}


static GeeSet* edsf_persona_real_get_email_addresses (FolksEmailDetails* base) {
	GeeSet* result;
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_email_addresses_ro;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_email_addresses (FolksEmailDetails* base, GeeSet* value) {
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_email_details_change_email_addresses ((FolksEmailDetails*) self, _tmp0_, NULL, NULL);
}


static GeeSet* edsf_persona_real_get_notes (FolksNoteDetails* base) {
	GeeSet* result;
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_notes_ro;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_notes (FolksNoteDetails* base, GeeSet* value) {
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_note_details_change_notes ((FolksNoteDetails*) self, _tmp0_, NULL, NULL);
}


static gchar** edsf_persona_real_get_linkable_properties (FolksPersona* base, int* result_length1) {
	gchar** result;
	EdsfPersona* self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	self = (EdsfPersona*) base;
	_tmp0_ = EDSF_PERSONA__linkable_properties;
	_tmp0__length1 = G_N_ELEMENTS (EDSF_PERSONA__linkable_properties);
	if (result_length1) {
		*result_length1 = _tmp0__length1;
	}
	result = _tmp0_;
	return result;
}


static gchar** edsf_persona_real_get_writeable_properties (FolksPersona* base, int* result_length1) {
	gchar** result;
	EdsfPersona* self;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar** _tmp4_;
	gint _tmp4__length1;
	self = (EdsfPersona*) base;
	_tmp0_ = folks_persona_get_store ((FolksPersona*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = folks_persona_store_get_always_writeable_properties (_tmp1_, &_tmp2__length1);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp2__length1;
	_tmp4_ = _tmp3_;
	_tmp4__length1 = _tmp3__length1;
	if (result_length1) {
		*result_length1 = _tmp4__length1;
	}
	result = _tmp4_;
	return result;
}


static GLoadableIcon* edsf_persona_real_get_avatar (FolksAvatarDetails* base) {
	GLoadableIcon* result;
	EdsfPersona* self;
	GLoadableIcon* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_avatar;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_avatar (FolksAvatarDetails* base, GLoadableIcon* value) {
	EdsfPersona* self;
	GLoadableIcon* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_avatar_details_change_avatar ((FolksAvatarDetails*) self, _tmp0_, NULL, NULL);
}


static FolksStructuredName* edsf_persona_real_get_structured_name (FolksNameDetails* base) {
	FolksStructuredName* result;
	EdsfPersona* self;
	FolksStructuredName* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_structured_name;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_structured_name (FolksNameDetails* base, FolksStructuredName* value) {
	EdsfPersona* self;
	FolksStructuredName* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_name_details_change_structured_name ((FolksNameDetails*) self, _tmp0_, NULL, NULL);
}


const gchar* edsf_persona_get_contact_id (EdsfPersona* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_contact_id;
	result = _tmp0_;
	return result;
}


static void edsf_persona_set_contact_id (EdsfPersona* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_contact_id);
	self->priv->_contact_id = _tmp1_;
	g_object_notify ((GObject *) self, "contact-id");
}


static const gchar* edsf_persona_real_get_full_name (FolksNameDetails* base) {
	const gchar* result;
	EdsfPersona* self;
	const gchar* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_full_name;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_full_name (FolksNameDetails* base, const gchar* value) {
	EdsfPersona* self;
	const gchar* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_name_details_change_full_name ((FolksNameDetails*) self, _tmp0_, NULL, NULL);
}


static const gchar* edsf_persona_real_get_nickname (FolksNameDetails* base) {
	const gchar* result;
	EdsfPersona* self;
	const gchar* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_nickname;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_nickname (FolksNameDetails* base, const gchar* value) {
	EdsfPersona* self;
	const gchar* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_name_details_change_nickname ((FolksNameDetails*) self, _tmp0_, NULL, NULL);
}


static FolksGender edsf_persona_real_get_gender (FolksGenderDetails* base) {
	FolksGender result;
	EdsfPersona* self;
	FolksGender _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_gender;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_gender (FolksGenderDetails* base, FolksGender value) {
	EdsfPersona* self;
	FolksGender _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_gender_details_change_gender ((FolksGenderDetails*) self, _tmp0_, NULL, NULL);
}


static GeeSet* edsf_persona_real_get_urls (FolksUrlDetails* base) {
	GeeSet* result;
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_urls_ro;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_urls (FolksUrlDetails* base, GeeSet* value) {
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_url_details_change_urls ((FolksUrlDetails*) self, _tmp0_, NULL, NULL);
}


static GeeMultiMap* edsf_persona_real_get_im_addresses (FolksImDetails* base) {
	GeeMultiMap* result;
	EdsfPersona* self;
	GeeHashMultiMap* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_im_addresses;
	result = (GeeMultiMap*) _tmp0_;
	return result;
}


static void edsf_persona_real_set_im_addresses (FolksImDetails* base, GeeMultiMap* value) {
	EdsfPersona* self;
	GeeMultiMap* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_im_details_change_im_addresses ((FolksImDetails*) self, _tmp0_, NULL, NULL);
}


static GeeSet* edsf_persona_real_get_groups (FolksGroupDetails* base) {
	GeeSet* result;
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_groups_ro;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_groups (FolksGroupDetails* base, GeeSet* value) {
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_group_details_change_groups ((FolksGroupDetails*) self, _tmp0_, NULL, NULL);
}


static const gchar* edsf_persona_real_get_calendar_event_id (FolksBirthdayDetails* base) {
	const gchar* result;
	EdsfPersona* self;
	self = (EdsfPersona*) base;
	result = NULL;
	return result;
}


static void edsf_persona_real_set_calendar_event_id (FolksBirthdayDetails* base, const gchar* value) {
	EdsfPersona* self;
	const gchar* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_birthday_details_change_calendar_event_id ((FolksBirthdayDetails*) self, _tmp0_, NULL, NULL);
}


static GDateTime* edsf_persona_real_get_birthday (FolksBirthdayDetails* base) {
	GDateTime* result;
	EdsfPersona* self;
	GDateTime* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_birthday;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_birthday (FolksBirthdayDetails* base, GDateTime* value) {
	EdsfPersona* self;
	GDateTime* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_birthday_details_change_birthday ((FolksBirthdayDetails*) self, _tmp0_, NULL, NULL);
}


static GeeSet* edsf_persona_real_get_roles (FolksRoleDetails* base) {
	GeeSet* result;
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_roles_ro;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_roles (FolksRoleDetails* base, GeeSet* value) {
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_role_details_change_roles ((FolksRoleDetails*) self, _tmp0_, NULL, NULL);
}


static void edsf_persona_url_type_mapping_copy (const EdsfPersonaUrlTypeMapping* self, EdsfPersonaUrlTypeMapping* dest) {
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	_tmp0_ = (*self).vcard_field_name;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).vcard_field_name);
	(*dest).vcard_field_name = _tmp1_;
	_tmp2_ = (*self).folks_type;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).folks_type);
	(*dest).folks_type = _tmp3_;
}


static void edsf_persona_url_type_mapping_destroy (EdsfPersonaUrlTypeMapping* self) {
	_g_free0 ((*self).vcard_field_name);
	_g_free0 ((*self).folks_type);
}


static EdsfPersonaUrlTypeMapping* edsf_persona_url_type_mapping_dup (const EdsfPersonaUrlTypeMapping* self) {
	EdsfPersonaUrlTypeMapping* dup;
	dup = g_new0 (EdsfPersonaUrlTypeMapping, 1);
	edsf_persona_url_type_mapping_copy (self, dup);
	return dup;
}


static void edsf_persona_url_type_mapping_free (EdsfPersonaUrlTypeMapping* self) {
	edsf_persona_url_type_mapping_destroy (self);
	g_free (self);
}


static GType edsf_persona_url_type_mapping_get_type (void) {
	static volatile gsize edsf_persona_url_type_mapping_type_id__volatile = 0;
	if (g_once_init_enter (&edsf_persona_url_type_mapping_type_id__volatile)) {
		GType edsf_persona_url_type_mapping_type_id;
		edsf_persona_url_type_mapping_type_id = g_boxed_type_register_static ("EdsfPersonaUrlTypeMapping", (GBoxedCopyFunc) edsf_persona_url_type_mapping_dup, (GBoxedFreeFunc) edsf_persona_url_type_mapping_free);
		g_once_init_leave (&edsf_persona_url_type_mapping_type_id__volatile, edsf_persona_url_type_mapping_type_id);
	}
	return edsf_persona_url_type_mapping_type_id__volatile;
}


static void edsf_persona_class_init (EdsfPersonaClass * klass) {
	GTimeZone* _tmp0_;
	edsf_persona_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (EdsfPersonaPrivate));
	FOLKS_PERSONA_CLASS (klass)->linkable_property_to_links = edsf_persona_real_linkable_property_to_links;
	FOLKS_PERSONA_CLASS (klass)->get_linkable_properties = edsf_persona_real_get_linkable_properties;
	FOLKS_PERSONA_CLASS (klass)->get_writeable_properties = edsf_persona_real_get_writeable_properties;
	G_OBJECT_CLASS (klass)->get_property = _vala_edsf_persona_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_edsf_persona_set_property;
	G_OBJECT_CLASS (klass)->finalize = edsf_persona_finalize;
	/**
	   * The e-d-s contact represented by this Persona
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_CONTACT, g_param_spec_object ("contact", "contact", "contact", e_contact_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * {@inheritDoc}
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_WEB_SERVICE_ADDRESSES, "web-service-addresses");
	/**
	   * IDs used to link {@link Edsf.Persona}s.
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LOCAL_IDS, "local-ids");
	/**
	   * The postal addresses of the contact.
	   *
	   * A list of postal addresses associated to the contact.
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_POSTAL_ADDRESSES, "postal-addresses");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_PHONE_NUMBERS, "phone-numbers");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_EMAIL_ADDRESSES, "email-addresses");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_NOTES, "notes");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LINKABLE_PROPERTIES, "linkable-properties");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_WRITEABLE_PROPERTIES, "writeable-properties");
	/**
	   * An avatar for the Persona.
	   *
	   * See {@link Folks.AvatarDetails.avatar}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_AVATAR, "avatar");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STRUCTURED_NAME, "structured-name");
	/**
	   * The e-d-s contact uid
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_CONTACT_ID, g_param_spec_string ("contact-id", "contact-id", "contact-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_FULL_NAME, "full-name");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_NICKNAME, "nickname");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_GENDER, "gender");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_URLS, "urls");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_IM_ADDRESSES, "im-addresses");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_GROUPS, "groups");
	/**
	   * {@inheritDoc}
	   *
	   * e-d-s has no equivalent field, so this is unsupported.
	   *
	   * @since 0.6.2
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_CALENDAR_EVENT_ID, "calendar-event-id");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.2
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_BIRTHDAY, "birthday");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.2
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_ROLES, "roles");
	g_static_rec_mutex_init (&__lock_edsf_persona__im_eds_map);
	_tmp0_ = g_time_zone_new_local ();
	edsf_persona__local_time_zone = _tmp0_;
}


static void edsf_persona_folks_avatar_details_interface_init (FolksAvatarDetailsIface * iface) {
	edsf_persona_folks_avatar_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_avatar = (void (*)(FolksAvatarDetails*, GLoadableIcon*, GError**)) edsf_persona_real_change_avatar;
	iface->change_avatar_finish = edsf_persona_real_change_avatar_finish;
	iface->get_avatar = edsf_persona_real_get_avatar;
	iface->set_avatar = edsf_persona_real_set_avatar;
}


static void edsf_persona_folks_birthday_details_interface_init (FolksBirthdayDetailsIface * iface) {
	edsf_persona_folks_birthday_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_birthday = (void (*)(FolksBirthdayDetails*, GDateTime*, GError**)) edsf_persona_real_change_birthday;
	iface->change_birthday_finish = edsf_persona_real_change_birthday_finish;
	iface->get_calendar_event_id = edsf_persona_real_get_calendar_event_id;
	iface->set_calendar_event_id = edsf_persona_real_set_calendar_event_id;
	iface->get_birthday = edsf_persona_real_get_birthday;
	iface->set_birthday = edsf_persona_real_set_birthday;
}


static void edsf_persona_folks_email_details_interface_init (FolksEmailDetailsIface * iface) {
	edsf_persona_folks_email_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_email_addresses = (void (*)(FolksEmailDetails*, GeeSet*, GError**)) edsf_persona_real_change_email_addresses;
	iface->change_email_addresses_finish = edsf_persona_real_change_email_addresses_finish;
	iface->get_email_addresses = edsf_persona_real_get_email_addresses;
	iface->set_email_addresses = edsf_persona_real_set_email_addresses;
}


static void edsf_persona_folks_gender_details_interface_init (FolksGenderDetailsIface * iface) {
	edsf_persona_folks_gender_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_gender = (void (*)(FolksGenderDetails*, FolksGender, GError**)) edsf_persona_real_change_gender;
	iface->change_gender_finish = edsf_persona_real_change_gender_finish;
	iface->get_gender = edsf_persona_real_get_gender;
	iface->set_gender = edsf_persona_real_set_gender;
}


static void edsf_persona_folks_group_details_interface_init (FolksGroupDetailsIface * iface) {
	edsf_persona_folks_group_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_group = (void (*)(FolksGroupDetails*, const gchar*, gboolean, GError**)) edsf_persona_real_change_group;
	iface->change_group_finish = edsf_persona_real_change_group_finish;
	iface->change_groups = (void (*)(FolksGroupDetails*, GeeSet*, GError**)) edsf_persona_real_change_groups;
	iface->change_groups_finish = edsf_persona_real_change_groups_finish;
	iface->get_groups = edsf_persona_real_get_groups;
	iface->set_groups = edsf_persona_real_set_groups;
}


static void edsf_persona_folks_im_details_interface_init (FolksImDetailsIface * iface) {
	edsf_persona_folks_im_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_im_addresses = (void (*)(FolksImDetails*, GeeMultiMap*, GError**)) edsf_persona_real_change_im_addresses;
	iface->change_im_addresses_finish = edsf_persona_real_change_im_addresses_finish;
	iface->get_im_addresses = edsf_persona_real_get_im_addresses;
	iface->set_im_addresses = edsf_persona_real_set_im_addresses;
}


static void edsf_persona_folks_local_id_details_interface_init (FolksLocalIdDetailsIface * iface) {
	edsf_persona_folks_local_id_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_local_ids = (void (*)(FolksLocalIdDetails*, GeeSet*, GError**)) edsf_persona_real_change_local_ids;
	iface->change_local_ids_finish = edsf_persona_real_change_local_ids_finish;
	iface->get_local_ids = edsf_persona_real_get_local_ids;
	iface->set_local_ids = edsf_persona_real_set_local_ids;
}


static void edsf_persona_folks_name_details_interface_init (FolksNameDetailsIface * iface) {
	edsf_persona_folks_name_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_structured_name = (void (*)(FolksNameDetails*, FolksStructuredName*, GError**)) edsf_persona_real_change_structured_name;
	iface->change_structured_name_finish = edsf_persona_real_change_structured_name_finish;
	iface->change_full_name = (void (*)(FolksNameDetails*, const gchar*, GError**)) edsf_persona_real_change_full_name;
	iface->change_full_name_finish = edsf_persona_real_change_full_name_finish;
	iface->change_nickname = (void (*)(FolksNameDetails*, const gchar*, GError**)) edsf_persona_real_change_nickname;
	iface->change_nickname_finish = edsf_persona_real_change_nickname_finish;
	iface->get_structured_name = edsf_persona_real_get_structured_name;
	iface->set_structured_name = edsf_persona_real_set_structured_name;
	iface->get_full_name = edsf_persona_real_get_full_name;
	iface->set_full_name = edsf_persona_real_set_full_name;
	iface->get_nickname = edsf_persona_real_get_nickname;
	iface->set_nickname = edsf_persona_real_set_nickname;
}


static void edsf_persona_folks_note_details_interface_init (FolksNoteDetailsIface * iface) {
	edsf_persona_folks_note_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_notes = (void (*)(FolksNoteDetails*, GeeSet*, GError**)) edsf_persona_real_change_notes;
	iface->change_notes_finish = edsf_persona_real_change_notes_finish;
	iface->get_notes = edsf_persona_real_get_notes;
	iface->set_notes = edsf_persona_real_set_notes;
}


static void edsf_persona_folks_phone_details_interface_init (FolksPhoneDetailsIface * iface) {
	edsf_persona_folks_phone_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_phone_numbers = (void (*)(FolksPhoneDetails*, GeeSet*, GError**)) edsf_persona_real_change_phone_numbers;
	iface->change_phone_numbers_finish = edsf_persona_real_change_phone_numbers_finish;
	iface->get_phone_numbers = edsf_persona_real_get_phone_numbers;
	iface->set_phone_numbers = edsf_persona_real_set_phone_numbers;
}


static void edsf_persona_folks_role_details_interface_init (FolksRoleDetailsIface * iface) {
	edsf_persona_folks_role_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_roles = (void (*)(FolksRoleDetails*, GeeSet*, GError**)) edsf_persona_real_change_roles;
	iface->change_roles_finish = edsf_persona_real_change_roles_finish;
	iface->get_roles = edsf_persona_real_get_roles;
	iface->set_roles = edsf_persona_real_set_roles;
}


static void edsf_persona_folks_url_details_interface_init (FolksUrlDetailsIface * iface) {
	edsf_persona_folks_url_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_urls = (void (*)(FolksUrlDetails*, GeeSet*, GError**)) edsf_persona_real_change_urls;
	iface->change_urls_finish = edsf_persona_real_change_urls_finish;
	iface->get_urls = edsf_persona_real_get_urls;
	iface->set_urls = edsf_persona_real_set_urls;
}


static void edsf_persona_folks_postal_address_details_interface_init (FolksPostalAddressDetailsIface * iface) {
	edsf_persona_folks_postal_address_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_postal_addresses = (void (*)(FolksPostalAddressDetails*, GeeSet*, GError**)) edsf_persona_real_change_postal_addresses;
	iface->change_postal_addresses_finish = edsf_persona_real_change_postal_addresses_finish;
	iface->get_postal_addresses = edsf_persona_real_get_postal_addresses;
	iface->set_postal_addresses = edsf_persona_real_set_postal_addresses;
}


static void edsf_persona_folks_web_service_details_interface_init (FolksWebServiceDetailsIface * iface) {
	edsf_persona_folks_web_service_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_web_service_addresses = (void (*)(FolksWebServiceDetails*, GeeMultiMap*, GError**)) edsf_persona_real_change_web_service_addresses;
	iface->change_web_service_addresses_finish = edsf_persona_real_change_web_service_addresses_finish;
	iface->get_web_service_addresses = edsf_persona_real_get_web_service_addresses;
	iface->set_web_service_addresses = edsf_persona_real_set_web_service_addresses;
}


static void edsf_persona_instance_init (EdsfPersona * self) {
	gchar* _tmp0_;
	gchar* _tmp1_;
	GeeHashMultiMap* _tmp2_;
	self->priv = EDSF_PERSONA_GET_PRIVATE (self);
	self->priv->_avatar = NULL;
	self->priv->_structured_name = NULL;
	_tmp0_ = g_strdup ("");
	self->priv->_full_name = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_nickname = _tmp1_;
	_tmp2_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	self->priv->_im_addresses = _tmp2_;
	self->priv->_birthday = NULL;
}


static void edsf_persona_finalize (GObject* obj) {
	EdsfPersona * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	self = EDSF_PERSONA (obj);
	_tmp0_ = folks_persona_get_uid ((FolksPersona*) self);
	_tmp1_ = _tmp0_;
	g_debug ("edsf-persona.vala:769: Destroying Edsf.Persona '%s': %p", _tmp1_, self);
	_g_object_unref0 (self->priv->_phone_numbers);
	_g_object_unref0 (self->priv->_phone_numbers_ro);
	_g_object_unref0 (self->priv->_email_addresses);
	_g_object_unref0 (self->priv->_email_addresses_ro);
	_g_object_unref0 (self->priv->_notes);
	_g_object_unref0 (self->priv->_notes_ro);
	_g_object_unref0 (self->priv->_postal_addresses);
	_g_object_unref0 (self->priv->_postal_addresses_ro);
	_g_object_unref0 (self->priv->_local_ids);
	_g_object_unref0 (self->priv->_local_ids_ro);
	_g_object_unref0 (self->priv->_web_service_addresses);
	_g_object_unref0 (self->priv->_contact);
	_g_object_unref0 (self->priv->_avatar);
	_g_object_unref0 (self->priv->_structured_name);
	_g_free0 (self->priv->_contact_id);
	_g_free0 (self->priv->_full_name);
	_g_free0 (self->priv->_nickname);
	_g_object_unref0 (self->priv->_urls);
	_g_object_unref0 (self->priv->_urls_ro);
	_g_object_unref0 (self->priv->_im_addresses);
	_g_object_unref0 (self->priv->_groups);
	_g_object_unref0 (self->priv->_groups_ro);
	_g_date_time_unref0 (self->priv->_birthday);
	_g_object_unref0 (self->priv->_roles);
	_g_object_unref0 (self->priv->_roles_ro);
	G_OBJECT_CLASS (edsf_persona_parent_class)->finalize (obj);
}


/**
 * A persona subclass which represents a single EDS contact.
 */
GType edsf_persona_get_type (void) {
	static volatile gsize edsf_persona_type_id__volatile = 0;
	if (g_once_init_enter (&edsf_persona_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (EdsfPersonaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) edsf_persona_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EdsfPersona), 0, (GInstanceInitFunc) edsf_persona_instance_init, NULL };
		static const GInterfaceInfo folks_avatar_details_info = { (GInterfaceInitFunc) edsf_persona_folks_avatar_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_birthday_details_info = { (GInterfaceInitFunc) edsf_persona_folks_birthday_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_email_details_info = { (GInterfaceInitFunc) edsf_persona_folks_email_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_gender_details_info = { (GInterfaceInitFunc) edsf_persona_folks_gender_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_group_details_info = { (GInterfaceInitFunc) edsf_persona_folks_group_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_im_details_info = { (GInterfaceInitFunc) edsf_persona_folks_im_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_local_id_details_info = { (GInterfaceInitFunc) edsf_persona_folks_local_id_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_name_details_info = { (GInterfaceInitFunc) edsf_persona_folks_name_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_note_details_info = { (GInterfaceInitFunc) edsf_persona_folks_note_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_phone_details_info = { (GInterfaceInitFunc) edsf_persona_folks_phone_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_role_details_info = { (GInterfaceInitFunc) edsf_persona_folks_role_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_url_details_info = { (GInterfaceInitFunc) edsf_persona_folks_url_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_postal_address_details_info = { (GInterfaceInitFunc) edsf_persona_folks_postal_address_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_web_service_details_info = { (GInterfaceInitFunc) edsf_persona_folks_web_service_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType edsf_persona_type_id;
		edsf_persona_type_id = g_type_register_static (FOLKS_TYPE_PERSONA, "EdsfPersona", &g_define_type_info, 0);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_AVATAR_DETAILS, &folks_avatar_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_BIRTHDAY_DETAILS, &folks_birthday_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_EMAIL_DETAILS, &folks_email_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_GENDER_DETAILS, &folks_gender_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_GROUP_DETAILS, &folks_group_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_IM_DETAILS, &folks_im_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_LOCAL_ID_DETAILS, &folks_local_id_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_NAME_DETAILS, &folks_name_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_NOTE_DETAILS, &folks_note_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_PHONE_DETAILS, &folks_phone_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_ROLE_DETAILS, &folks_role_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_URL_DETAILS, &folks_url_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_POSTAL_ADDRESS_DETAILS, &folks_postal_address_details_info);
		g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_WEB_SERVICE_DETAILS, &folks_web_service_details_info);
		g_once_init_leave (&edsf_persona_type_id__volatile, edsf_persona_type_id);
	}
	return edsf_persona_type_id__volatile;
}


static void _vala_edsf_persona_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	EdsfPersona * self;
	self = EDSF_PERSONA (object);
	switch (property_id) {
		case EDSF_PERSONA_CONTACT:
		g_value_set_object (value, edsf_persona_get_contact (self));
		break;
		case EDSF_PERSONA_WEB_SERVICE_ADDRESSES:
		g_value_set_object (value, folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) self));
		break;
		case EDSF_PERSONA_LOCAL_IDS:
		g_value_set_object (value, folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self));
		break;
		case EDSF_PERSONA_POSTAL_ADDRESSES:
		g_value_set_object (value, folks_postal_address_details_get_postal_addresses ((FolksPostalAddressDetails*) self));
		break;
		case EDSF_PERSONA_PHONE_NUMBERS:
		g_value_set_object (value, folks_phone_details_get_phone_numbers ((FolksPhoneDetails*) self));
		break;
		case EDSF_PERSONA_EMAIL_ADDRESSES:
		g_value_set_object (value, folks_email_details_get_email_addresses ((FolksEmailDetails*) self));
		break;
		case EDSF_PERSONA_NOTES:
		g_value_set_object (value, folks_note_details_get_notes ((FolksNoteDetails*) self));
		break;
		case EDSF_PERSONA_LINKABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_get_linkable_properties ((FolksPersona*) self, &length));
		}
		break;
		case EDSF_PERSONA_WRITEABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_get_writeable_properties ((FolksPersona*) self, &length));
		}
		break;
		case EDSF_PERSONA_AVATAR:
		g_value_set_object (value, folks_avatar_details_get_avatar ((FolksAvatarDetails*) self));
		break;
		case EDSF_PERSONA_STRUCTURED_NAME:
		g_value_set_object (value, folks_name_details_get_structured_name ((FolksNameDetails*) self));
		break;
		case EDSF_PERSONA_CONTACT_ID:
		g_value_set_string (value, edsf_persona_get_contact_id (self));
		break;
		case EDSF_PERSONA_FULL_NAME:
		g_value_set_string (value, folks_name_details_get_full_name ((FolksNameDetails*) self));
		break;
		case EDSF_PERSONA_NICKNAME:
		g_value_set_string (value, folks_name_details_get_nickname ((FolksNameDetails*) self));
		break;
		case EDSF_PERSONA_GENDER:
		g_value_set_enum (value, folks_gender_details_get_gender ((FolksGenderDetails*) self));
		break;
		case EDSF_PERSONA_URLS:
		g_value_set_object (value, folks_url_details_get_urls ((FolksUrlDetails*) self));
		break;
		case EDSF_PERSONA_IM_ADDRESSES:
		g_value_set_object (value, folks_im_details_get_im_addresses ((FolksImDetails*) self));
		break;
		case EDSF_PERSONA_GROUPS:
		g_value_set_object (value, folks_group_details_get_groups ((FolksGroupDetails*) self));
		break;
		case EDSF_PERSONA_CALENDAR_EVENT_ID:
		g_value_set_string (value, folks_birthday_details_get_calendar_event_id ((FolksBirthdayDetails*) self));
		break;
		case EDSF_PERSONA_BIRTHDAY:
		g_value_set_boxed (value, folks_birthday_details_get_birthday ((FolksBirthdayDetails*) self));
		break;
		case EDSF_PERSONA_ROLES:
		g_value_set_object (value, folks_role_details_get_roles ((FolksRoleDetails*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_edsf_persona_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	EdsfPersona * self;
	self = EDSF_PERSONA (object);
	switch (property_id) {
		case EDSF_PERSONA_CONTACT:
		edsf_persona_set_contact (self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_WEB_SERVICE_ADDRESSES:
		folks_web_service_details_set_web_service_addresses ((FolksWebServiceDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_LOCAL_IDS:
		folks_local_id_details_set_local_ids ((FolksLocalIdDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_POSTAL_ADDRESSES:
		folks_postal_address_details_set_postal_addresses ((FolksPostalAddressDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_PHONE_NUMBERS:
		folks_phone_details_set_phone_numbers ((FolksPhoneDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_EMAIL_ADDRESSES:
		folks_email_details_set_email_addresses ((FolksEmailDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_NOTES:
		folks_note_details_set_notes ((FolksNoteDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_AVATAR:
		folks_avatar_details_set_avatar ((FolksAvatarDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_STRUCTURED_NAME:
		folks_name_details_set_structured_name ((FolksNameDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_CONTACT_ID:
		edsf_persona_set_contact_id (self, g_value_get_string (value));
		break;
		case EDSF_PERSONA_FULL_NAME:
		folks_name_details_set_full_name ((FolksNameDetails*) self, g_value_get_string (value));
		break;
		case EDSF_PERSONA_NICKNAME:
		folks_name_details_set_nickname ((FolksNameDetails*) self, g_value_get_string (value));
		break;
		case EDSF_PERSONA_GENDER:
		folks_gender_details_set_gender ((FolksGenderDetails*) self, g_value_get_enum (value));
		break;
		case EDSF_PERSONA_URLS:
		folks_url_details_set_urls ((FolksUrlDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_IM_ADDRESSES:
		folks_im_details_set_im_addresses ((FolksImDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_GROUPS:
		folks_group_details_set_groups ((FolksGroupDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_CALENDAR_EVENT_ID:
		folks_birthday_details_set_calendar_event_id ((FolksBirthdayDetails*) self, g_value_get_string (value));
		break;
		case EDSF_PERSONA_BIRTHDAY:
		folks_birthday_details_set_birthday ((FolksBirthdayDetails*) self, g_value_get_boxed (value));
		break;
		case EDSF_PERSONA_ROLES:
		folks_role_details_set_roles ((FolksRoleDetails*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


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


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



