/* edsf-persona.c generated by valac 0.16.0, 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>
#include <folks-internal.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;
typedef struct _EdsfPersonaChangeIsFavouriteData EdsfPersonaChangeIsFavouriteData;
#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 __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 __vala_EContactPhoto_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactPhoto_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 _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;
	gboolean _is_favourite;
	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 _EdsfPersonaChangeIsFavouriteData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	EdsfPersona* self;
	gboolean is_favourite;
	gboolean _tmp0_;
	gboolean _tmp1_;
	FolksPersonaStore* _tmp2_;
	FolksPersonaStore* _tmp3_;
	gboolean _tmp4_;
	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 FolksFavouriteDetailsIface* edsf_persona_folks_favourite_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,
	EDSF_PERSONA_IS_FAVOURITE
};
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_);
static void edsf_persona_real_change_is_favourite_data_free (gpointer _data);
static void edsf_persona_real_change_is_favourite (FolksFavouriteDetails* base, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean edsf_persona_real_change_is_favourite_co (EdsfPersonaChangeIsFavouriteData* _data_);
void _edsf_persona_store_set_is_favourite (EdsfPersonaStore* self, EdsfPersona* persona, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _edsf_persona_store_set_is_favourite_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
static void edsf_persona_change_is_favourite_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_real_linkable_property_to_links (FolksPersona* base, const gchar* prop_name, FolksPersonaLinkablePropertyCallback callback, void* callback_target);
void _edsf_persona_update (EdsfPersona* self, EContact* updated_contact);
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_favourite (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);
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);
static EContactPhoto* _vala_EContactPhoto_copy (EContactPhoto* self);
static void _vala_EContactPhoto_free (EContactPhoto* self);
static guint8* _vala_array_dup1 (guint8* self, int length);
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 (void * _userdata_);
static void ___lambda4_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
static void ____lambda4__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);
GHashTable* _edsf_persona_get_im_eds_map (void);
static gchar* _edsf_persona_im_proto_from_addr (EdsfPersona* self, const gchar* addr);
gboolean _edsf_persona_store_is_google_contacts_address_book (EdsfPersonaStore* self);
#define EDSF_PERSONA_STORE_android_favourite_group_name "Starred in Android"
static void _g_free0_ (gpointer var);
static FolksPostalAddress* _edsf_persona_postal_address_from_attribute (EdsfPersona* self, EVCardAttribute* attr);
static void edsf_persona_set_contact (EdsfPersona* self, EContact* value);
const gchar* edsf_persona_get_contact_id (EdsfPersona* self);
static void edsf_persona_set_contact_id (EdsfPersona* self, const gchar* value);
static GObject * edsf_persona_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
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_;
	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_;
	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_;
	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;
}


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


static void edsf_persona_real_change_is_favourite (FolksFavouriteDetails* base, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	EdsfPersona * self;
	EdsfPersonaChangeIsFavouriteData* _data_;
	EdsfPersona* _tmp0_;
	gboolean _tmp1_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeIsFavouriteData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_is_favourite);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_is_favourite_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = is_favourite;
	_data_->is_favourite = _tmp1_;
	edsf_persona_real_change_is_favourite_co (_data_);
}


static void edsf_persona_real_change_is_favourite_finish (FolksFavouriteDetails* base, GAsyncResult* _res_, GError** error) {
	EdsfPersonaChangeIsFavouriteData* _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.5
   */
static void edsf_persona_change_is_favourite_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	EdsfPersonaChangeIsFavouriteData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_is_favourite_co (_data_);
}


static gboolean edsf_persona_real_change_is_favourite_co (EdsfPersonaChangeIsFavouriteData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_is_favourite;
	_data_->_tmp1_ = _data_->is_favourite;
	if (_data_->_tmp0_ == _data_->_tmp1_) {
		if (_data_->_state_ == 0) {
			g_simple_async_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_->_tmp2_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = _data_->is_favourite;
	_data_->_state_ = 1;
	_edsf_persona_store_set_is_favourite (EDSF_PERSONA_STORE (_data_->_tmp3_), _data_->self, _data_->_tmp4_, edsf_persona_change_is_favourite_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_is_favourite_finish (EDSF_PERSONA_STORE (_data_->_tmp3_), _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_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_ = 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_ = contact_id;
	_tmp4_ = g_strdup (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	if (_tmp6_ == NULL) {
		gchar* _tmp7_;
		_tmp7_ = g_strdup ("");
		_g_free0 (_tmp5_);
		_tmp5_ = _tmp7_;
	}
	_tmp8_ = store_id;
	_tmp9_ = _tmp5_;
	_tmp10_ = edsf_persona_build_iid (_tmp8_, (const gchar*) _tmp9_);
	result = _tmp10_;
	_g_free0 (_tmp5_);
	_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`.
   *
   * @param store the store which will contain the persona
   * @param contact the EDS contact being represented by the persona
   *
   * @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;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* contact_id;
	EdsfPersonaStore* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_ = NULL;
	gchar* uid;
	EdsfPersonaStore* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_ = NULL;
	gchar* iid;
	EContact* _tmp20_;
	gboolean _tmp21_ = FALSE;
	gboolean is_user;
	EContact* _tmp22_;
	void* _tmp23_ = NULL;
	gchar* _tmp24_;
	gchar* _full_name;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* full_name;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	EdsfPersonaStore* _tmp34_;
	gboolean _tmp35_;
	const gchar* _tmp36_;
	EContact* _tmp37_;
	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_ = _contact_id;
	_tmp4_ = g_strdup (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	if (_tmp6_ == NULL) {
		gchar* _tmp7_;
		_tmp7_ = g_strdup ("");
		_g_free0 (_tmp5_);
		_tmp5_ = _tmp7_;
	}
	_tmp8_ = _tmp5_;
	_tmp9_ = g_strdup ((const gchar*) _tmp8_);
	contact_id = _tmp9_;
	_tmp10_ = store;
	_tmp11_ = folks_persona_store_get_id ((FolksPersonaStore*) _tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = contact_id;
	_tmp14_ = folks_persona_build_uid (BACKEND_NAME, _tmp12_, _tmp13_);
	uid = _tmp14_;
	_tmp15_ = store;
	_tmp16_ = folks_persona_store_get_id ((FolksPersonaStore*) _tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = contact_id;
	_tmp19_ = edsf_persona_build_iid (_tmp17_, _tmp18_);
	iid = _tmp19_;
	_tmp20_ = contact;
	_tmp21_ = e_book_client_is_self (_tmp20_);
	is_user = _tmp21_;
	_tmp22_ = contact;
	_tmp23_ = _edsf_persona_get_property_from_contact (_tmp22_, "full_name");
	_tmp24_ = g_strdup ((const gchar*) _tmp23_);
	_full_name = _tmp24_;
	_tmp25_ = _full_name;
	_tmp26_ = g_strdup (_tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = _tmp27_;
	if (_tmp28_ == NULL) {
		gchar* _tmp29_;
		_tmp29_ = g_strdup ("");
		_g_free0 (_tmp27_);
		_tmp27_ = _tmp29_;
	}
	_tmp30_ = _tmp27_;
	_tmp31_ = g_strdup ((const gchar*) _tmp30_);
	full_name = _tmp31_;
	_tmp32_ = uid;
	_tmp33_ = iid;
	_tmp34_ = store;
	_tmp35_ = is_user;
	_tmp36_ = contact_id;
	_tmp37_ = contact;
	self = (EdsfPersona*) g_object_new (object_type, "display-id", full_name, "uid", _tmp32_, "iid", _tmp33_, "store", _tmp34_, "is-user", _tmp35_, "contact-id", _tmp36_, "contact", _tmp37_, NULL);
	_g_free0 (full_name);
	_g_free0 (_tmp27_);
	_g_free0 (_full_name);
	_g_free0 (iid);
	_g_free0 (uid);
	_g_free0 (contact_id);
	_g_free0 (_tmp5_);
	_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* updated_contact) {
	EContact* _tmp0_;
	EContact* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (updated_contact != NULL);
	g_object_freeze_notify ((GObject*) self);
	_tmp0_ = updated_contact;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_contact);
	self->priv->_contact = _tmp1_;
	g_object_notify ((GObject*) self, "contact");
	_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);
	_edsf_persona_update_favourite (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_;
	EContact* _tmp1_;
	EVCardAttribute* _tmp2_ = NULL;
	EVCardAttribute* _tmp3_;
	EVCardAttribute* gender_attr;
	EVCardAttribute* _tmp4_;
	FolksGender _tmp13_;
	FolksGender _tmp14_;
	g_return_if_fail (self != NULL);
	gender = FOLKS_GENDER_UNSPECIFIED;
	_tmp0_ = edsf_persona_get_contact (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = e_vcard_get_attribute ((EVCard*) _tmp1_, EDSF_PERSONA_gender_attribute_name);
	_tmp3_ = __vala_EVCardAttribute_copy0 (_tmp2_);
	gender_attr = _tmp3_;
	_tmp4_ = gender_attr;
	if (_tmp4_ != NULL) {
		EVCardAttribute* _tmp5_;
		gchar* _tmp6_ = NULL;
		gchar* val;
		const gchar* _tmp7_;
		_tmp5_ = gender_attr;
		_tmp6_ = e_vcard_attribute_get_value ((EVCardAttribute*) _tmp5_);
		val = _tmp6_;
		_tmp7_ = val;
		if (_tmp7_ != NULL) {
			const gchar* _tmp8_;
			gchar* _tmp9_ = NULL;
			gchar* _tmp10_;
			GQuark _tmp12_ = 0U;
			_tmp8_ = val;
			_tmp9_ = g_utf8_strup ((const gchar*) _tmp8_, (gssize) (-1));
			_tmp10_ = _tmp9_;
			_tmp12_ = (NULL == _tmp10_) ? 0 : g_quark_from_string (_tmp10_);
			g_free (_tmp10_);
			if (_tmp12_ == g_quark_from_string (EDSF_PERSONA_gender_male)) {
				switch (0) {
					default:
					{
						gender = FOLKS_GENDER_MALE;
						break;
					}
				}
			} else if (_tmp12_ == g_quark_from_string (EDSF_PERSONA_gender_female)) {
				switch (0) {
					default:
					{
						gender = FOLKS_GENDER_FEMALE;
						break;
					}
				}
			} else {
				switch (0) {
					default:
					{
						break;
					}
				}
			}
		}
		_g_free0 (val);
	}
	_tmp13_ = self->priv->_gender;
	_tmp14_ = gender;
	if (_tmp13_ != _tmp14_) {
		FolksGender _tmp15_;
		_tmp15_ = gender;
		self->priv->_gender = _tmp15_;
		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) {
		EContactDate* _tmp3_;
		EContactDate* _tmp4_;
		EContactDate* bday;
		GTimeZone* _tmp5_;
		EContactDate* _tmp6_;
		guint _tmp7_;
		EContactDate* _tmp8_;
		guint _tmp9_;
		EContactDate* _tmp10_;
		guint _tmp11_;
		GDateTime* _tmp12_;
		GDateTime* d;
		gboolean _tmp13_ = FALSE;
		GDateTime* _tmp14_;
		gboolean _tmp23_;
		_tmp3_ = _bday;
		_tmp4_ = __vala_EContactDate_copy0 ((EContactDate*) _tmp3_);
		bday = _tmp4_;
		_tmp5_ = edsf_persona__local_time_zone;
		_tmp6_ = bday;
		_tmp7_ = _tmp6_->year;
		_tmp8_ = bday;
		_tmp9_ = _tmp8_->month;
		_tmp10_ = bday;
		_tmp11_ = _tmp10_->day;
		_tmp12_ = g_date_time_new (_tmp5_, (gint) _tmp7_, (gint) _tmp9_, (gint) _tmp11_, 0, 0, 0.0);
		d = _tmp12_;
		_tmp14_ = self->priv->_birthday;
		if (_tmp14_ == NULL) {
			_tmp13_ = TRUE;
		} else {
			gboolean _tmp15_ = FALSE;
			GDateTime* _tmp16_;
			gboolean _tmp22_;
			_tmp16_ = self->priv->_birthday;
			if (_tmp16_ != NULL) {
				GDateTime* _tmp17_;
				GDateTime* _tmp18_;
				GDateTime* _tmp19_ = NULL;
				GDateTime* _tmp20_;
				gboolean _tmp21_ = FALSE;
				_tmp17_ = self->priv->_birthday;
				_tmp18_ = d;
				_tmp19_ = g_date_time_to_utc (_tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = g_date_time_equal ((GDateTime*) _tmp17_, _tmp20_);
				_tmp15_ = !_tmp21_;
				_g_date_time_unref0 (_tmp20_);
			} else {
				_tmp15_ = FALSE;
			}
			_tmp22_ = _tmp15_;
			_tmp13_ = _tmp22_;
		}
		_tmp23_ = _tmp13_;
		if (_tmp23_) {
			GDateTime* _tmp24_;
			GDateTime* _tmp25_ = NULL;
			_tmp24_ = d;
			_tmp25_ = g_date_time_to_utc (_tmp24_);
			_g_date_time_unref0 (self->priv->_birthday);
			self->priv->_birthday = _tmp25_;
			g_object_notify ((GObject*) self, "birthday");
		}
		_g_date_time_unref0 (d);
		__vala_EContactDate_free0 (bday);
	} else {
		GDateTime* _tmp26_;
		_tmp26_ = self->priv->_birthday;
		if (_tmp26_ != 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_;
	EContact* _tmp6_;
	EVCard* _tmp7_;
	EVCard* vcard;
	EVCard* _tmp8_;
	GList* _tmp9_ = NULL;
	GeeHashSet* _tmp45_;
	GeeHashSet* _tmp46_;
	gboolean _tmp47_ = 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_, FOLKS_ROLE_FIELD_DETAILS (_tmp4_));
	}
	_tmp5_ = edsf_persona_get_contact (self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (E_VCARD (_tmp6_));
	vcard = _tmp7_;
	_tmp8_ = vcard;
	_tmp9_ = e_vcard_get_attributes (_tmp8_);
	{
		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* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				EVCardAttribute* _tmp10_;
				const gchar* _tmp11_ = NULL;
				EVCardAttribute* _tmp12_;
				gchar* _tmp13_ = NULL;
				gchar* val;
				gboolean _tmp14_ = FALSE;
				const gchar* _tmp15_;
				gboolean _tmp17_;
				FolksRole* _tmp18_;
				FolksRole* role;
				FolksRole* _tmp19_;
				const gchar* _tmp20_;
				FolksRole* _tmp21_;
				FolksRoleFieldDetails* _tmp22_;
				FolksRoleFieldDetails* role_fd;
				EVCardAttribute* _tmp23_;
				GList* _tmp24_ = NULL;
				GeeHashSet* _tmp43_;
				FolksRoleFieldDetails* _tmp44_;
				_tmp10_ = attr;
				_tmp11_ = e_vcard_attribute_get_name (_tmp10_);
				if (g_strcmp0 (_tmp11_, "X-ROLES") != 0) {
					continue;
				}
				_tmp12_ = attr;
				_tmp13_ = e_vcard_attribute_get_value (_tmp12_);
				val = _tmp13_;
				_tmp15_ = val;
				if (_tmp15_ == NULL) {
					_tmp14_ = TRUE;
				} else {
					const gchar* _tmp16_;
					_tmp16_ = val;
					_tmp14_ = g_strcmp0 ((const gchar*) _tmp16_, "") == 0;
				}
				_tmp17_ = _tmp14_;
				if (_tmp17_) {
					_g_free0 (val);
					continue;
				}
				_tmp18_ = folks_role_new ("", "", NULL);
				role = _tmp18_;
				_tmp19_ = role;
				_tmp20_ = val;
				folks_role_set_role (_tmp19_, (const gchar*) _tmp20_);
				_tmp21_ = role;
				_tmp22_ = folks_role_field_details_new (_tmp21_, NULL);
				role_fd = _tmp22_;
				_tmp23_ = attr;
				_tmp24_ = e_vcard_attribute_get_params (_tmp23_);
				{
					GList* param_collection = NULL;
					GList* param_it = NULL;
					param_collection = _tmp24_;
					for (param_it = param_collection; param_it != NULL; param_it = param_it->next) {
						EVCardAttributeParam* param = NULL;
						param = (EVCardAttributeParam*) param_it->data;
						{
							EVCardAttributeParam* _tmp25_;
							const gchar* _tmp26_ = NULL;
							gchar* _tmp27_ = NULL;
							gchar* param_name;
							const gchar* _tmp28_;
							_tmp25_ = param;
							_tmp26_ = e_vcard_attribute_param_get_name (_tmp25_);
							_tmp27_ = g_utf8_strdown (_tmp26_, (gssize) (-1));
							param_name = _tmp27_;
							_tmp28_ = param_name;
							if (g_strcmp0 (_tmp28_, "organisation_name") == 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_organisation_name (_tmp31_, _tmp32_);
											break;
										}
									}
								}
							} else {
								const gchar* _tmp33_;
								_tmp33_ = param_name;
								if (g_strcmp0 (_tmp33_, "title") == 0) {
									EVCardAttributeParam* _tmp34_;
									GList* _tmp35_ = NULL;
									_tmp34_ = param;
									_tmp35_ = e_vcard_attribute_param_get_values (_tmp34_);
									{
										GList* param_value_collection = NULL;
										GList* param_value_it = NULL;
										param_value_collection = _tmp35_;
										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* _tmp36_;
												const gchar* _tmp37_;
												_tmp36_ = role;
												_tmp37_ = param_value;
												folks_role_set_title (_tmp36_, _tmp37_);
												break;
											}
										}
									}
								} else {
									EVCardAttributeParam* _tmp38_;
									GList* _tmp39_ = NULL;
									_tmp38_ = param;
									_tmp39_ = e_vcard_attribute_param_get_values (_tmp38_);
									{
										GList* param_value_collection = NULL;
										GList* param_value_it = NULL;
										param_value_collection = _tmp39_;
										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* _tmp40_;
												const gchar* _tmp41_;
												const gchar* _tmp42_;
												_tmp40_ = role_fd;
												_tmp41_ = param_name;
												_tmp42_ = param_value;
												folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp40_, _tmp41_, _tmp42_);
											}
										}
									}
								}
							}
							_g_free0 (param_name);
						}
					}
				}
				_tmp43_ = new_roles;
				_tmp44_ = role_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp43_, _tmp44_);
				_g_object_unref0 (role_fd);
				_g_object_unref0 (role);
				_g_free0 (val);
			}
		}
	}
	_tmp45_ = new_roles;
	_tmp46_ = self->priv->_roles;
	_tmp47_ = folks_internal_equal_sets (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeSet*) _tmp45_, (GeeSet*) _tmp46_);
	if (!_tmp47_) {
		GeeHashSet* _tmp48_;
		GeeHashSet* _tmp49_;
		GeeHashSet* _tmp50_;
		GeeSet* _tmp51_;
		GeeSet* _tmp52_;
		_tmp48_ = new_roles;
		_tmp49_ = _g_object_ref0 (_tmp48_);
		_g_object_unref0 (self->priv->_roles);
		self->priv->_roles = _tmp49_;
		_tmp50_ = new_roles;
		_tmp51_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp50_);
		_tmp52_ = _tmp51_;
		_g_object_unref0 (self->priv->_roles_ro);
		self->priv->_roles_ro = _tmp52_;
		g_object_notify ((GObject*) self, "roles");
	}
	_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;
		gboolean _tmp36_ = FALSE;
		const gchar* _tmp37_;
		gboolean _tmp39_;
		FolksRole* _tmp42_;
		gboolean _tmp43_ = FALSE;
		_tmp33_ = title;
		_tmp34_ = org;
		_tmp35_ = folks_role_new (_tmp33_, _tmp34_, NULL);
		new_role = _tmp35_;
		_tmp37_ = role;
		if (_tmp37_ != NULL) {
			const gchar* _tmp38_;
			_tmp38_ = role;
			_tmp36_ = g_strcmp0 ((const gchar*) _tmp38_, "") != 0;
		} else {
			_tmp36_ = FALSE;
		}
		_tmp39_ = _tmp36_;
		if (_tmp39_) {
			FolksRole* _tmp40_;
			const gchar* _tmp41_;
			_tmp40_ = new_role;
			_tmp41_ = role;
			folks_role_set_role (_tmp40_, (const gchar*) _tmp41_);
		}
		_tmp42_ = new_role;
		_tmp43_ = folks_role_is_empty (_tmp42_);
		if (!_tmp43_) {
			FolksRole* _tmp44_;
			FolksRoleFieldDetails* _tmp45_;
			FolksRoleFieldDetails* default_role;
			gboolean _tmp46_ = FALSE;
			const gchar* _tmp47_;
			gboolean _tmp49_;
			gboolean _tmp52_ = FALSE;
			const gchar* _tmp53_;
			gboolean _tmp55_;
			gboolean _tmp58_ = FALSE;
			const gchar* _tmp59_;
			gboolean _tmp61_;
			gboolean _tmp64_ = FALSE;
			const gchar* _tmp65_;
			gboolean _tmp67_;
			FolksRoleFieldDetails* _tmp70_;
			FolksRoleFieldDetails* _tmp71_;
			_tmp44_ = new_role;
			_tmp45_ = folks_role_field_details_new (_tmp44_, NULL);
			default_role = _tmp45_;
			_tmp47_ = org_unit;
			if (_tmp47_ != NULL) {
				const gchar* _tmp48_;
				_tmp48_ = org_unit;
				_tmp46_ = g_strcmp0 (_tmp48_, "") != 0;
			} else {
				_tmp46_ = FALSE;
			}
			_tmp49_ = _tmp46_;
			if (_tmp49_) {
				FolksRoleFieldDetails* _tmp50_;
				const gchar* _tmp51_;
				_tmp50_ = default_role;
				_tmp51_ = org_unit;
				folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp50_, "org_unit", (const gchar*) _tmp51_);
			}
			_tmp53_ = office;
			if (_tmp53_ != NULL) {
				const gchar* _tmp54_;
				_tmp54_ = office;
				_tmp52_ = g_strcmp0 (_tmp54_, "") != 0;
			} else {
				_tmp52_ = FALSE;
			}
			_tmp55_ = _tmp52_;
			if (_tmp55_) {
				FolksRoleFieldDetails* _tmp56_;
				const gchar* _tmp57_;
				_tmp56_ = default_role;
				_tmp57_ = office;
				folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp56_, "office", (const gchar*) _tmp57_);
			}
			_tmp59_ = manager;
			if (_tmp59_ != NULL) {
				const gchar* _tmp60_;
				_tmp60_ = manager;
				_tmp58_ = g_strcmp0 (_tmp60_, "") != 0;
			} else {
				_tmp58_ = FALSE;
			}
			_tmp61_ = _tmp58_;
			if (_tmp61_) {
				FolksRoleFieldDetails* _tmp62_;
				const gchar* _tmp63_;
				_tmp62_ = default_role;
				_tmp63_ = manager;
				folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp62_, "manager", (const gchar*) _tmp63_);
			}
			_tmp65_ = assistant;
			if (_tmp65_ != NULL) {
				const gchar* _tmp66_;
				_tmp66_ = manager;
				_tmp64_ = g_strcmp0 (_tmp66_, "") != 0;
			} else {
				_tmp64_ = FALSE;
			}
			_tmp67_ = _tmp64_;
			if (_tmp67_) {
				FolksRoleFieldDetails* _tmp68_;
				const gchar* _tmp69_;
				_tmp68_ = default_role;
				_tmp69_ = assistant;
				folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp68_, "assistant", (const gchar*) _tmp69_);
			}
			_tmp70_ = default_role;
			_tmp71_ = _g_object_ref0 (_tmp70_);
			_g_object_unref0 (_default_role);
			_default_role = _tmp71_;
			_g_object_unref0 (default_role);
		}
		_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_;
	EContact* _tmp2_;
	EVCardAttribute* _tmp3_ = NULL;
	EVCardAttribute* _tmp4_;
	EVCardAttribute* services;
	EVCardAttribute* _tmp5_;
	GeeHashMultiMap* _tmp21_;
	GeeHashMultiMap* _tmp22_;
	gboolean _tmp23_ = 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_ = edsf_persona_get_contact (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = e_vcard_get_attribute ((EVCard*) _tmp2_, "X-FOLKS-WEB-SERVICES-IDS");
	_tmp4_ = __vala_EVCardAttribute_copy0 (_tmp3_);
	services = _tmp4_;
	_tmp5_ = services;
	if (_tmp5_ != NULL) {
		EVCardAttribute* _tmp6_;
		GList* _tmp7_ = NULL;
		_tmp6_ = services;
		_tmp7_ = e_vcard_attribute_get_params ((EVCardAttribute*) _tmp6_);
		{
			GList* service_collection = NULL;
			GList* service_it = NULL;
			service_collection = _tmp7_;
			for (service_it = service_collection; service_it != NULL; service_it = service_it->next) {
				EVCardAttributeParam* _tmp8_;
				EVCardAttributeParam* service = NULL;
				_tmp8_ = __vala_EVCardAttributeParam_copy0 ((EVCardAttributeParam*) service_it->data);
				service = _tmp8_;
				{
					EVCardAttributeParam* _tmp9_;
					const gchar* _tmp10_ = NULL;
					gchar* _tmp11_ = NULL;
					gchar* service_name;
					EVCardAttributeParam* _tmp12_;
					GList* _tmp13_ = NULL;
					_tmp9_ = service;
					_tmp10_ = e_vcard_attribute_param_get_name (_tmp9_);
					_tmp11_ = g_utf8_strdown (_tmp10_, (gssize) (-1));
					service_name = _tmp11_;
					_tmp12_ = service;
					_tmp13_ = e_vcard_attribute_param_get_values (_tmp12_);
					{
						GList* service_id_collection = NULL;
						GList* service_id_it = NULL;
						service_id_collection = _tmp13_;
						for (service_id_it = service_id_collection; service_id_it != NULL; service_id_it = service_id_it->next) {
							gchar* _tmp14_;
							gchar* service_id = NULL;
							_tmp14_ = g_strdup ((const gchar*) service_id_it->data);
							service_id = _tmp14_;
							{
								const gchar* _tmp15_;
								GeeHashMultiMap* _tmp16_;
								const gchar* _tmp17_;
								const gchar* _tmp18_;
								FolksWebServiceFieldDetails* _tmp19_;
								FolksWebServiceFieldDetails* _tmp20_;
								_tmp15_ = service_id;
								if (g_strcmp0 (_tmp15_, "") == 0) {
									_g_free0 (service_id);
									continue;
								}
								_tmp16_ = new_services;
								_tmp17_ = service_name;
								_tmp18_ = service_id;
								_tmp19_ = folks_web_service_field_details_new (_tmp18_, NULL);
								_tmp20_ = _tmp19_;
								gee_multi_map_set ((GeeMultiMap*) _tmp16_, _tmp17_, _tmp20_);
								_g_object_unref0 (_tmp20_);
								_g_free0 (service_id);
							}
						}
					}
					_g_free0 (service_name);
					__vala_EVCardAttributeParam_free0 (service);
				}
			}
		}
	}
	_tmp21_ = new_services;
	_tmp22_ = self->priv->_web_service_addresses;
	_tmp23_ = folks_utils_multi_map_str_afd_equal ((GeeMultiMap*) _tmp21_, (GeeMultiMap*) _tmp22_);
	if (!_tmp23_) {
		GeeHashMultiMap* _tmp24_;
		GeeHashMultiMap* _tmp25_;
		_tmp24_ = new_services;
		_tmp25_ = _g_object_ref0 (_tmp24_);
		_g_object_unref0 (self->priv->_web_service_addresses);
		self->priv->_web_service_addresses = _tmp25_;
		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_;
	EContact* _tmp2_;
	GList* _tmp3_ = NULL;
	GList* attrs;
	GList* _tmp4_;
	GeeHashSet* _tmp18_;
	GeeHashSet* _tmp19_;
	gboolean _tmp20_ = 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_ = edsf_persona_get_contact (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = e_contact_get_attributes (_tmp2_, E_CONTACT_EMAIL);
	attrs = _tmp3_;
	_tmp4_ = attrs;
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp4_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* _tmp5_;
			EVCardAttribute* attr = NULL;
			_tmp5_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
			attr = _tmp5_;
			{
				EVCardAttribute* _tmp6_;
				gchar* _tmp7_ = NULL;
				gchar* val;
				gboolean _tmp8_ = FALSE;
				const gchar* _tmp9_;
				gboolean _tmp11_;
				const gchar* _tmp12_;
				FolksEmailFieldDetails* _tmp13_;
				FolksEmailFieldDetails* email_fd;
				FolksEmailFieldDetails* _tmp14_;
				EVCardAttribute* _tmp15_;
				GeeHashSet* _tmp16_;
				FolksEmailFieldDetails* _tmp17_;
				_tmp6_ = attr;
				_tmp7_ = e_vcard_attribute_get_value (_tmp6_);
				val = _tmp7_;
				_tmp9_ = val;
				if (_tmp9_ == NULL) {
					_tmp8_ = TRUE;
				} else {
					const gchar* _tmp10_;
					_tmp10_ = val;
					_tmp8_ = g_strcmp0 ((const gchar*) _tmp10_, "") == 0;
				}
				_tmp11_ = _tmp8_;
				if (_tmp11_) {
					_g_free0 (val);
					__vala_EVCardAttribute_free0 (attr);
					continue;
				}
				_tmp12_ = val;
				_tmp13_ = folks_email_field_details_new ((const gchar*) _tmp12_, NULL);
				email_fd = _tmp13_;
				_tmp14_ = email_fd;
				_tmp15_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp14_, _tmp15_);
				_tmp16_ = new_email_addresses;
				_tmp17_ = email_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp16_, _tmp17_);
				_g_object_unref0 (email_fd);
				_g_free0 (val);
				__vala_EVCardAttribute_free0 (attr);
			}
		}
	}
	_tmp18_ = new_email_addresses;
	_tmp19_ = self->priv->_email_addresses;
	_tmp20_ = folks_internal_equal_sets (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeSet*) _tmp18_, (GeeSet*) _tmp19_);
	if (!_tmp20_) {
		GeeHashSet* _tmp21_;
		GeeHashSet* _tmp22_;
		GeeHashSet* _tmp23_;
		GeeSet* _tmp24_;
		GeeSet* _tmp25_;
		_tmp21_ = new_email_addresses;
		_tmp22_ = _g_object_ref0 (_tmp21_);
		_g_object_unref0 (self->priv->_email_addresses);
		self->priv->_email_addresses = _tmp22_;
		_tmp23_ = new_email_addresses;
		_tmp24_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp23_);
		_tmp25_ = _tmp24_;
		_g_object_unref0 (self->priv->_email_addresses_ro);
		self->priv->_email_addresses_ro = _tmp25_;
		g_object_notify ((GObject*) self, "email-addresses");
	}
	__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_;
	GeeHashSet* _tmp11_;
	GeeHashSet* _tmp12_;
	gboolean _tmp13_ = 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 ((const gchar*) _tmp7_, NULL, NULL);
		note = _tmp8_;
		_tmp9_ = new_notes;
		_tmp10_ = note;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp10_);
		_g_object_unref0 (note);
	}
	_tmp11_ = new_notes;
	_tmp12_ = self->priv->_notes;
	_tmp13_ = folks_internal_equal_sets (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeSet*) _tmp11_, (GeeSet*) _tmp12_);
	if (!_tmp13_) {
		GeeHashSet* _tmp14_;
		GeeHashSet* _tmp15_;
		GeeHashSet* _tmp16_;
		GeeSet* _tmp17_;
		GeeSet* _tmp18_;
		_tmp14_ = new_notes;
		_tmp15_ = _g_object_ref0 (_tmp14_);
		_g_object_unref0 (self->priv->_notes);
		self->priv->_notes = _tmp15_;
		_tmp16_ = self->priv->_notes;
		_tmp17_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp16_);
		_tmp18_ = _tmp17_;
		_g_object_unref0 (self->priv->_notes_ro);
		self->priv->_notes_ro = _tmp18_;
		g_object_notify ((GObject*) self, "notes");
	}
	_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_;
	gchar* _tmp5_;
	gchar* full_name;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	void* _tmp10_ = NULL;
	gchar* _tmp11_;
	gchar* _nickname;
	const gchar* _tmp12_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* nickname;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	FolksStructuredName* structured_name;
	void* _tmp20_ = NULL;
	EContactName* _tmp21_;
	EContactName* _cn;
	EContactName* _tmp22_;
	gboolean _tmp46_ = FALSE;
	FolksStructuredName* _tmp47_;
	gboolean _tmp50_;
	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_ = _full_name;
	_tmp5_ = g_strdup ((const gchar*) _tmp4_);
	full_name = _tmp5_;
	_tmp6_ = self->priv->_full_name;
	_tmp7_ = full_name;
	if (g_strcmp0 (_tmp6_, _tmp7_) != 0) {
		const gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp8_ = full_name;
		_tmp9_ = g_strdup (_tmp8_);
		_g_free0 (self->priv->_full_name);
		self->priv->_full_name = _tmp9_;
		g_object_notify ((GObject*) self, "full-name");
	}
	_tmp10_ = _edsf_persona_get_property (self, "nickname");
	_tmp11_ = g_strdup ((const gchar*) _tmp10_);
	_nickname = _tmp11_;
	_tmp12_ = _nickname;
	if (_tmp12_ == NULL) {
		gchar* _tmp13_;
		_tmp13_ = g_strdup ("");
		_g_free0 (_nickname);
		_nickname = _tmp13_;
	}
	_tmp14_ = _nickname;
	_tmp15_ = g_strdup ((const gchar*) _tmp14_);
	nickname = _tmp15_;
	_tmp16_ = self->priv->_nickname;
	_tmp17_ = nickname;
	if (g_strcmp0 (_tmp16_, _tmp17_) != 0) {
		const gchar* _tmp18_;
		gchar* _tmp19_;
		_tmp18_ = nickname;
		_tmp19_ = g_strdup (_tmp18_);
		_g_free0 (self->priv->_nickname);
		self->priv->_nickname = _tmp19_;
		g_object_notify ((GObject*) self, "nickname");
	}
	structured_name = NULL;
	_tmp20_ = _edsf_persona_get_property (self, "name");
	_tmp21_ = __vala_EContactName_copy0 ((EContactName*) _tmp20_);
	_cn = _tmp21_;
	_tmp22_ = _cn;
	if (_tmp22_ != NULL) {
		EContactName* _tmp23_;
		EContactName* _tmp24_;
		EContactName* cn;
		EContactName* _tmp25_;
		const gchar* _tmp26_;
		gchar* _tmp27_;
		gchar* family_name;
		EContactName* _tmp28_;
		const gchar* _tmp29_;
		gchar* _tmp30_;
		gchar* given_name;
		EContactName* _tmp31_;
		const gchar* _tmp32_;
		gchar* _tmp33_;
		gchar* additional_names;
		EContactName* _tmp34_;
		const gchar* _tmp35_;
		gchar* _tmp36_;
		gchar* prefixes;
		EContactName* _tmp37_;
		const gchar* _tmp38_;
		gchar* _tmp39_;
		gchar* suffixes;
		const gchar* _tmp40_;
		const gchar* _tmp41_;
		const gchar* _tmp42_;
		const gchar* _tmp43_;
		const gchar* _tmp44_;
		FolksStructuredName* _tmp45_;
		_tmp23_ = _cn;
		_tmp24_ = __vala_EContactName_copy0 ((EContactName*) _tmp23_);
		cn = _tmp24_;
		_tmp25_ = cn;
		_tmp26_ = _tmp25_->family;
		_tmp27_ = g_strdup (_tmp26_);
		family_name = _tmp27_;
		_tmp28_ = cn;
		_tmp29_ = _tmp28_->given;
		_tmp30_ = g_strdup (_tmp29_);
		given_name = _tmp30_;
		_tmp31_ = cn;
		_tmp32_ = _tmp31_->additional;
		_tmp33_ = g_strdup (_tmp32_);
		additional_names = _tmp33_;
		_tmp34_ = cn;
		_tmp35_ = _tmp34_->prefixes;
		_tmp36_ = g_strdup (_tmp35_);
		prefixes = _tmp36_;
		_tmp37_ = cn;
		_tmp38_ = _tmp37_->suffixes;
		_tmp39_ = g_strdup (_tmp38_);
		suffixes = _tmp39_;
		_tmp40_ = family_name;
		_tmp41_ = given_name;
		_tmp42_ = additional_names;
		_tmp43_ = prefixes;
		_tmp44_ = suffixes;
		_tmp45_ = folks_structured_name_new (_tmp40_, _tmp41_, _tmp42_, _tmp43_, _tmp44_);
		_g_object_unref0 (structured_name);
		structured_name = _tmp45_;
		_g_free0 (suffixes);
		_g_free0 (prefixes);
		_g_free0 (additional_names);
		_g_free0 (given_name);
		_g_free0 (family_name);
		__vala_EContactName_free0 (cn);
	}
	_tmp47_ = structured_name;
	if (_tmp47_ != NULL) {
		FolksStructuredName* _tmp48_;
		gboolean _tmp49_ = FALSE;
		_tmp48_ = structured_name;
		_tmp49_ = folks_structured_name_is_empty (FOLKS_STRUCTURED_NAME (_tmp48_));
		_tmp46_ = !_tmp49_;
	} else {
		_tmp46_ = FALSE;
	}
	_tmp50_ = _tmp46_;
	if (_tmp50_) {
		FolksStructuredName* _tmp51_;
		FolksStructuredName* _tmp52_;
		_tmp51_ = structured_name;
		_tmp52_ = _g_object_ref0 (FOLKS_STRUCTURED_NAME (_tmp51_));
		_g_object_unref0 (self->priv->_structured_name);
		self->priv->_structured_name = _tmp52_;
		g_object_notify ((GObject*) self, "structured-name");
	} else {
		FolksStructuredName* _tmp53_;
		_tmp53_ = self->priv->_structured_name;
		if (_tmp53_ != 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 (_nickname);
	_g_free0 (full_name);
	_g_free0 (_full_name);
}


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 _vala_EContactPhoto_free (EContactPhoto* self) {
	g_boxed_free (e_contact_photo_get_type (), self);
}


static guint8* _vala_array_dup1 (guint8* self, int length) {
	return g_memdup (self, length * sizeof (guint8));
}


static GLoadableIcon* _edsf_persona_contact_photo_to_loadable_icon (EdsfPersona* self, EContactPhoto* _p) {
	GLoadableIcon* result = NULL;
	EContactPhoto* _tmp0_;
	EContactPhoto* _tmp1_;
	EContactPhoto* _tmp2_;
	EContactPhoto* p;
	EContactPhoto* _tmp3_;
	EContactPhotoType _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = _p;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = _p;
	_tmp2_ = __vala_EContactPhoto_copy0 ((EContactPhoto*) _tmp1_);
	p = _tmp2_;
	_tmp3_ = p;
	_tmp4_ = _tmp3_->type;
	switch (_tmp4_) {
		case E_CONTACT_PHOTO_TYPE_URI:
		{
			EContactPhoto* _tmp5_;
			const gchar* _tmp6_ = NULL;
			gchar* _tmp7_;
			gchar* uri;
			const gchar* _tmp8_;
			const gchar* _tmp9_;
			GFile* _tmp10_ = NULL;
			GFile* _tmp11_;
			GFileIcon* _tmp12_;
			GLoadableIcon* _tmp13_;
			_tmp5_ = p;
			_tmp6_ = e_contact_photo_get_uri (_tmp5_);
			_tmp7_ = g_strdup (_tmp6_);
			uri = _tmp7_;
			_tmp8_ = uri;
			if (_tmp8_ == NULL) {
				result = NULL;
				_g_free0 (uri);
				__vala_EContactPhoto_free0 (p);
				return result;
			}
			_tmp9_ = uri;
			_tmp10_ = g_file_new_for_uri ((const gchar*) _tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = (GFileIcon*) g_file_icon_new (_tmp11_);
			_tmp13_ = (GLoadableIcon*) _tmp12_;
			_g_object_unref0 (_tmp11_);
			result = _tmp13_;
			_g_free0 (uri);
			__vala_EContactPhoto_free0 (p);
			return result;
		}
		case E_CONTACT_PHOTO_TYPE_INLINED:
		{
			EContactPhoto* _tmp14_;
			gsize _tmp15_;
			guint8* _tmp16_ = NULL;
			guint8* _tmp17_;
			gint _tmp17__length1;
			guint8* data;
			gint data_length1;
			gint _data_size_;
			EContactPhoto* _tmp18_;
			const gchar* _tmp19_ = NULL;
			gchar* _tmp20_;
			gchar* mime_type;
			gboolean _tmp21_ = FALSE;
			guint8* _tmp22_;
			gint _tmp22__length1;
			gboolean _tmp24_;
			const gchar* _tmp25_;
			guint8* _tmp26_;
			gint _tmp26__length1;
			EdsfMemoryIcon* _tmp27_;
			_tmp14_ = p;
			_tmp16_ = e_contact_photo_get_inlined (_tmp14_, &_tmp15_);
			_tmp17_ = (_tmp16_ != NULL) ? _vala_array_dup1 (_tmp16_, _tmp15_) : ((gpointer) _tmp16_);
			_tmp17__length1 = _tmp15_;
			data = _tmp17_;
			data_length1 = _tmp17__length1;
			_data_size_ = data_length1;
			_tmp18_ = p;
			_tmp19_ = e_contact_photo_get_mime_type (_tmp18_);
			_tmp20_ = g_strdup (_tmp19_);
			mime_type = _tmp20_;
			_tmp22_ = data;
			_tmp22__length1 = data_length1;
			if (_tmp22_ == NULL) {
				_tmp21_ = TRUE;
			} else {
				const gchar* _tmp23_;
				_tmp23_ = mime_type;
				_tmp21_ = _tmp23_ == NULL;
			}
			_tmp24_ = _tmp21_;
			if (_tmp24_) {
				result = NULL;
				_g_free0 (mime_type);
				data = (g_free (data), NULL);
				__vala_EContactPhoto_free0 (p);
				return result;
			}
			_tmp25_ = mime_type;
			_tmp26_ = data;
			_tmp26__length1 = data_length1;
			_tmp27_ = edsf_memory_icon_new ((const gchar*) _tmp25_, (guint8*) _tmp26_, _tmp26__length1);
			result = (GLoadableIcon*) _tmp27_;
			_g_free0 (mime_type);
			data = (g_free (data), NULL);
			__vala_EContactPhoto_free0 (p);
			return result;
		}
		default:
		{
			result = NULL;
			__vala_EContactPhoto_free0 (p);
			return result;
		}
	}
	__vala_EContactPhoto_free0 (p);
}


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


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


static void ___lambda4_ (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 ____lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	___lambda4_ (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:1295: 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 _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_, ____lambda4__gasync_ready_callback, block1_data_ref (_data1_));
	} else {
		gboolean _tmp12_ = FALSE;
		gboolean _tmp13_ = FALSE;
		GLoadableIcon* _tmp14_;
		gboolean _tmp16_;
		gboolean _tmp26_;
		_tmp14_ = self->priv->_avatar;
		if (_tmp14_ == NULL) {
			GLoadableIcon* _tmp15_;
			_tmp15_ = _data1_->new_avatar;
			_tmp13_ = _tmp15_ != NULL;
		} else {
			_tmp13_ = FALSE;
		}
		_tmp16_ = _tmp13_;
		if (_tmp16_) {
			_tmp12_ = TRUE;
		} else {
			gboolean _tmp17_ = FALSE;
			gboolean _tmp18_ = FALSE;
			GLoadableIcon* _tmp19_;
			gboolean _tmp21_;
			gboolean _tmp25_;
			_tmp19_ = self->priv->_avatar;
			if (_tmp19_ != NULL) {
				GLoadableIcon* _tmp20_;
				_tmp20_ = _data1_->new_avatar;
				_tmp18_ = _tmp20_ != NULL;
			} else {
				_tmp18_ = FALSE;
			}
			_tmp21_ = _tmp18_;
			if (_tmp21_) {
				GLoadableIcon* _tmp22_;
				GLoadableIcon* _tmp23_;
				gboolean _tmp24_ = FALSE;
				_tmp22_ = self->priv->_avatar;
				_tmp23_ = _data1_->new_avatar;
				_tmp24_ = g_icon_equal ((GIcon*) G_LOADABLE_ICON (_tmp22_), (GIcon*) _tmp23_);
				_tmp17_ = _tmp24_ == FALSE;
			} else {
				_tmp17_ = FALSE;
			}
			_tmp25_ = _tmp17_;
			_tmp12_ = _tmp25_;
		}
		_tmp26_ = _tmp12_;
		if (_tmp26_) {
			FolksAvatarCache* _tmp27_;
			const gchar* _tmp28_;
			const gchar* _tmp29_;
			GLoadableIcon* _tmp30_;
			_tmp27_ = _data1_->cache;
			_tmp28_ = folks_persona_get_uid ((FolksPersona*) self);
			_tmp29_ = _tmp28_;
			_tmp30_ = _data1_->new_avatar;
			folks_avatar_cache_store_avatar (_tmp27_, _tmp29_, G_LOADABLE_ICON (_tmp30_), _____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_;
	EContact* _tmp22_;
	EVCard* _tmp23_;
	EVCard* vcard;
	EVCard* _tmp24_;
	GList* _tmp25_ = NULL;
	GeeHashSet* _tmp40_;
	GeeHashSet* _tmp41_;
	gboolean _tmp42_ = 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 ((const gchar*) _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_ = edsf_persona_get_contact (self);
	_tmp22_ = _tmp21_;
	_tmp23_ = _g_object_ref0 (E_VCARD (_tmp22_));
	vcard = _tmp23_;
	_tmp24_ = vcard;
	_tmp25_ = e_vcard_get_attributes (_tmp24_);
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp25_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				EVCardAttribute* _tmp26_;
				const gchar* _tmp27_ = NULL;
				_tmp26_ = attr;
				_tmp27_ = e_vcard_attribute_get_name (_tmp26_);
				if (g_strcmp0 (_tmp27_, "X-URIS") == 0) {
					EVCardAttribute* _tmp28_;
					gchar* _tmp29_ = NULL;
					gchar* val;
					gboolean _tmp30_ = FALSE;
					const gchar* _tmp31_;
					gboolean _tmp33_;
					const gchar* _tmp34_;
					FolksUrlFieldDetails* _tmp35_;
					FolksUrlFieldDetails* url_fd;
					FolksUrlFieldDetails* _tmp36_;
					EVCardAttribute* _tmp37_;
					GeeHashSet* _tmp38_;
					FolksUrlFieldDetails* _tmp39_;
					_tmp28_ = attr;
					_tmp29_ = e_vcard_attribute_get_value (_tmp28_);
					val = _tmp29_;
					_tmp31_ = val;
					if (_tmp31_ == NULL) {
						_tmp30_ = TRUE;
					} else {
						const gchar* _tmp32_;
						_tmp32_ = val;
						_tmp30_ = g_strcmp0 ((const gchar*) _tmp32_, "") == 0;
					}
					_tmp33_ = _tmp30_;
					if (_tmp33_) {
						_g_free0 (val);
						continue;
					}
					_tmp34_ = val;
					_tmp35_ = folks_url_field_details_new ((const gchar*) _tmp34_, NULL);
					url_fd = _tmp35_;
					_tmp36_ = url_fd;
					_tmp37_ = attr;
					_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp36_, _tmp37_);
					_tmp38_ = new_urls;
					_tmp39_ = url_fd;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp38_, _tmp39_);
					_g_object_unref0 (url_fd);
					_g_free0 (val);
				}
			}
		}
	}
	_tmp40_ = new_urls;
	_tmp41_ = self->priv->_urls;
	_tmp42_ = folks_utils_set_afd_equal ((GeeSet*) _tmp40_, (GeeSet*) _tmp41_);
	if (!_tmp42_) {
		GeeHashSet* _tmp43_;
		GeeHashSet* _tmp44_;
		GeeHashSet* _tmp45_;
		GeeSet* _tmp46_;
		GeeSet* _tmp47_;
		_tmp43_ = new_urls;
		_tmp44_ = _g_object_ref0 (_tmp43_);
		_g_object_unref0 (self->priv->_urls);
		self->priv->_urls = _tmp44_;
		_tmp45_ = new_urls;
		_tmp46_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp45_);
		_tmp47_ = _tmp46_;
		_g_object_unref0 (self->priv->_urls_ro);
		self->priv->_urls_ro = _tmp47_;
		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* _tmp79_;
	GeeHashMultiMap* _tmp80_;
	gboolean _tmp81_ = 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_;
				EContact* _tmp5_;
				GHashTable* _tmp6_;
				const gchar* _tmp7_;
				gconstpointer _tmp8_ = NULL;
				GList* _tmp9_ = NULL;
				GList* addresses;
				GList* _tmp10_;
				_tmp4_ = edsf_persona_get_contact (self);
				_tmp5_ = _tmp4_;
				_tmp6_ = im_eds_map;
				_tmp7_ = im_proto;
				_tmp8_ = g_hash_table_lookup (_tmp6_, _tmp7_);
				_tmp9_ = e_contact_get_attributes (_tmp5_, GPOINTER_TO_INT (_tmp8_));
				addresses = _tmp9_;
				_tmp10_ = addresses;
				{
					GList* attr_collection = NULL;
					GList* attr_it = NULL;
					attr_collection = _tmp10_;
					for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
						EVCardAttribute* _tmp11_;
						EVCardAttribute* attr = NULL;
						_tmp11_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
						attr = _tmp11_;
						{
							{
								EVCardAttribute* _tmp12_;
								gchar* _tmp13_ = NULL;
								gchar* addr;
								gboolean _tmp14_ = FALSE;
								const gchar* _tmp15_;
								gboolean _tmp17_;
								const gchar* _tmp18_;
								const gchar* _tmp19_;
								gchar* _tmp20_ = NULL;
								gchar* _tmp21_;
								gchar* _tmp22_;
								gchar* _tmp23_;
								gchar* _tmp24_;
								gchar* normalised_addr;
								const gchar* _tmp25_;
								FolksImFieldDetails* _tmp26_;
								FolksImFieldDetails* im_fd;
								GeeHashMultiMap* _tmp27_;
								const gchar* _tmp28_;
								FolksImFieldDetails* _tmp29_;
								_tmp12_ = attr;
								_tmp13_ = e_vcard_attribute_get_value (_tmp12_);
								addr = _tmp13_;
								_tmp15_ = addr;
								if (_tmp15_ == NULL) {
									_tmp14_ = TRUE;
								} else {
									const gchar* _tmp16_;
									_tmp16_ = addr;
									_tmp14_ = g_strcmp0 ((const gchar*) _tmp16_, "") == 0;
								}
								_tmp17_ = _tmp14_;
								if (_tmp17_) {
									_g_free0 (addr);
									__vala_EVCardAttribute_free0 (attr);
									continue;
								}
								_tmp18_ = addr;
								_tmp19_ = im_proto;
								_tmp20_ = folks_im_details_normalise_im_address ((const gchar*) _tmp18_, _tmp19_, &_inner_error_);
								_tmp21_ = _tmp20_;
								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;
								}
								_tmp22_ = _tmp21_;
								_tmp23_ = _tmp22_;
								_tmp22_ = NULL;
								_tmp24_ = _tmp23_;
								_g_free0 (_tmp22_);
								normalised_addr = _tmp24_;
								_tmp25_ = normalised_addr;
								_tmp26_ = folks_im_field_details_new (_tmp25_, NULL);
								im_fd = _tmp26_;
								_tmp27_ = new_im_addresses;
								_tmp28_ = im_proto;
								_tmp29_ = im_fd;
								gee_multi_map_set ((GeeMultiMap*) _tmp27_, _tmp28_, _tmp29_);
								_g_object_unref0 (im_fd);
								_g_free0 (normalised_addr);
								_g_free0 (addr);
							}
							goto __finally2;
							__catch2_folks_im_details_error:
							{
								GError* e = NULL;
								GError* _tmp30_;
								const gchar* _tmp31_;
								e = _inner_error_;
								_inner_error_ = NULL;
								_tmp30_ = e;
								_tmp31_ = _tmp30_->message;
								g_warning ("edsf-persona.vala:1376: Problem when trying to normalise address: %s\n", _tmp31_);
								_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* _tmp32_;
		GeeSet* _tmp33_;
		GeeIterator* _tmp34_ = NULL;
		GeeIterator* _email_it;
		_tmp32_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) self);
		_tmp33_ = _tmp32_;
		_tmp34_ = gee_iterable_iterator ((GeeIterable*) _tmp33_);
		_email_it = _tmp34_;
		while (TRUE) {
			GeeIterator* _tmp35_;
			gboolean _tmp36_ = FALSE;
			GeeIterator* _tmp37_;
			gpointer _tmp38_ = NULL;
			FolksEmailFieldDetails* email;
			FolksEmailFieldDetails* _tmp39_;
			gconstpointer _tmp40_;
			const gchar* _tmp41_;
			gchar* _tmp42_ = NULL;
			gchar* _proto;
			const gchar* _tmp43_;
			_tmp35_ = _email_it;
			_tmp36_ = gee_iterator_next (_tmp35_);
			if (!_tmp36_) {
				break;
			}
			_tmp37_ = _email_it;
			_tmp38_ = gee_iterator_get (_tmp37_);
			email = (FolksEmailFieldDetails*) _tmp38_;
			_tmp39_ = email;
			_tmp40_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp39_);
			_tmp41_ = _tmp40_;
			_tmp42_ = _edsf_persona_im_proto_from_addr (self, (const gchar*) _tmp41_);
			_proto = _tmp42_;
			_tmp43_ = _proto;
			if (_tmp43_ != NULL) {
				const gchar* _tmp44_;
				gchar* _tmp45_;
				gchar* proto;
				gboolean exists;
				GeeHashMultiMap* _tmp46_;
				const gchar* _tmp47_;
				GeeCollection* _tmp48_ = NULL;
				GeeCollection* current_im_addrs;
				GeeCollection* _tmp49_;
				gboolean _tmp62_;
				_tmp44_ = _proto;
				_tmp45_ = g_strdup ((const gchar*) _tmp44_);
				proto = _tmp45_;
				exists = FALSE;
				_tmp46_ = new_im_addresses;
				_tmp47_ = proto;
				_tmp48_ = gee_multi_map_get ((GeeMultiMap*) _tmp46_, _tmp47_);
				current_im_addrs = _tmp48_;
				_tmp49_ = current_im_addrs;
				if (_tmp49_ != NULL) {
					{
						GeeCollection* _tmp50_;
						GeeIterator* _tmp51_ = NULL;
						GeeIterator* _cur_im_it;
						_tmp50_ = current_im_addrs;
						_tmp51_ = gee_iterable_iterator ((GeeIterable*) GEE_COLLECTION (_tmp50_));
						_cur_im_it = _tmp51_;
						while (TRUE) {
							GeeIterator* _tmp52_;
							gboolean _tmp53_ = FALSE;
							GeeIterator* _tmp54_;
							gpointer _tmp55_ = NULL;
							FolksImFieldDetails* cur_im;
							FolksImFieldDetails* _tmp56_;
							gconstpointer _tmp57_;
							const gchar* _tmp58_;
							FolksEmailFieldDetails* _tmp59_;
							gconstpointer _tmp60_;
							const gchar* _tmp61_;
							_tmp52_ = _cur_im_it;
							_tmp53_ = gee_iterator_next (_tmp52_);
							if (!_tmp53_) {
								break;
							}
							_tmp54_ = _cur_im_it;
							_tmp55_ = gee_iterator_get (_tmp54_);
							cur_im = (FolksImFieldDetails*) _tmp55_;
							_tmp56_ = cur_im;
							_tmp57_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp56_);
							_tmp58_ = _tmp57_;
							_tmp59_ = email;
							_tmp60_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp59_);
							_tmp61_ = _tmp60_;
							if (g_strcmp0 ((const gchar*) _tmp58_, (const gchar*) _tmp61_) == 0) {
								exists = TRUE;
								_g_object_unref0 (cur_im);
								break;
							}
							_g_object_unref0 (cur_im);
						}
						_g_object_unref0 (_cur_im_it);
					}
				}
				_tmp62_ = exists;
				if (_tmp62_) {
					_g_object_unref0 (current_im_addrs);
					_g_free0 (proto);
					_g_free0 (_proto);
					_g_object_unref0 (email);
					continue;
				}
				{
					FolksEmailFieldDetails* _tmp63_;
					gconstpointer _tmp64_;
					const gchar* _tmp65_;
					const gchar* _tmp66_;
					gchar* _tmp67_ = NULL;
					gchar* _tmp68_;
					gchar* _tmp69_;
					gchar* _tmp70_;
					gchar* _tmp71_;
					gchar* normalised_addr;
					const gchar* _tmp72_;
					FolksImFieldDetails* _tmp73_;
					FolksImFieldDetails* im_fd;
					GeeHashMultiMap* _tmp74_;
					const gchar* _tmp75_;
					FolksImFieldDetails* _tmp76_;
					_tmp63_ = email;
					_tmp64_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp63_);
					_tmp65_ = _tmp64_;
					_tmp66_ = proto;
					_tmp67_ = folks_im_details_normalise_im_address ((const gchar*) _tmp65_, _tmp66_, &_inner_error_);
					_tmp68_ = _tmp67_;
					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_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;
					}
					_tmp69_ = _tmp68_;
					_tmp70_ = _tmp69_;
					_tmp69_ = NULL;
					_tmp71_ = _tmp70_;
					_g_free0 (_tmp69_);
					normalised_addr = _tmp71_;
					_tmp72_ = normalised_addr;
					_tmp73_ = folks_im_field_details_new (_tmp72_, NULL);
					im_fd = _tmp73_;
					_tmp74_ = new_im_addresses;
					_tmp75_ = proto;
					_tmp76_ = im_fd;
					gee_multi_map_set ((GeeMultiMap*) _tmp74_, _tmp75_, _tmp76_);
					_g_object_unref0 (im_fd);
					_g_free0 (normalised_addr);
				}
				goto __finally3;
				__catch3_folks_im_details_error:
				{
					GError* e = NULL;
					GError* _tmp77_;
					const gchar* _tmp78_;
					e = _inner_error_;
					_inner_error_ = NULL;
					_tmp77_ = e;
					_tmp78_ = _tmp77_->message;
					g_warning ("edsf-persona.vala:1427: Problem when trying to normalise address: %s\n", _tmp78_);
					_g_error_free0 (e);
				}
				__finally3:
				if (_inner_error_ != NULL) {
					_g_object_unref0 (current_im_addrs);
					_g_free0 (proto);
					_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_free0 (_proto);
			_g_object_unref0 (email);
		}
		_g_object_unref0 (_email_it);
	}
	_tmp79_ = new_im_addresses;
	_tmp80_ = self->priv->_im_addresses;
	_tmp81_ = folks_utils_multi_map_str_afd_equal ((GeeMultiMap*) _tmp79_, (GeeMultiMap*) _tmp80_);
	if (!_tmp81_) {
		GeeHashMultiMap* _tmp82_;
		GeeHashMultiMap* _tmp83_;
		_tmp82_ = new_im_addresses;
		_tmp83_ = _g_object_ref0 (_tmp82_);
		_g_object_unref0 (self->priv->_im_addresses);
		self->priv->_im_addresses = _tmp83_;
		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 _tmp25_;
	gboolean old_is_favourite;
	FolksPersonaStore* _tmp26_;
	FolksPersonaStore* _tmp27_;
	EdsfPersonaStore* _tmp28_;
	EdsfPersonaStore* store;
	gboolean _tmp67_ = FALSE;
	GeeLinkedList* _tmp68_;
	gint _tmp69_;
	gint _tmp70_;
	gboolean _tmp74_;
	gboolean _tmp75_;
	gboolean _tmp76_;
	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);
	}
	_tmp25_ = self->priv->_is_favourite;
	old_is_favourite = _tmp25_;
	_tmp26_ = folks_persona_get_store ((FolksPersona*) self);
	_tmp27_ = _tmp26_;
	_tmp28_ = _g_object_ref0 (EDSF_PERSONA_STORE (_tmp27_));
	store = _tmp28_;
	{
		GeeLinkedList* _tmp29_;
		GeeLinkedList* _tmp30_;
		GeeLinkedList* _category_name_list;
		GeeLinkedList* _tmp31_;
		gint _tmp32_;
		gint _tmp33_;
		gint _category_name_size;
		gint _category_name_index;
		_tmp29_ = removed_categories;
		_tmp30_ = _g_object_ref0 (_tmp29_);
		_category_name_list = _tmp30_;
		_tmp31_ = _category_name_list;
		_tmp32_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp31_);
		_tmp33_ = _tmp32_;
		_category_name_size = _tmp33_;
		_category_name_index = -1;
		while (TRUE) {
			gint _tmp34_;
			gint _tmp35_;
			gint _tmp36_;
			GeeLinkedList* _tmp37_;
			gint _tmp38_;
			gpointer _tmp39_ = NULL;
			gchar* category_name;
			gboolean _tmp40_ = FALSE;
			EdsfPersonaStore* _tmp41_;
			gboolean _tmp42_ = FALSE;
			gboolean _tmp44_;
			const gchar* _tmp45_;
			GeeHashSet* _tmp46_;
			const gchar* _tmp47_;
			_tmp34_ = _category_name_index;
			_category_name_index = _tmp34_ + 1;
			_tmp35_ = _category_name_index;
			_tmp36_ = _category_name_size;
			if (!(_tmp35_ < _tmp36_)) {
				break;
			}
			_tmp37_ = _category_name_list;
			_tmp38_ = _category_name_index;
			_tmp39_ = gee_abstract_list_get ((GeeAbstractList*) _tmp37_, _tmp38_);
			category_name = (gchar*) _tmp39_;
			_tmp41_ = store;
			_tmp42_ = _edsf_persona_store_is_google_contacts_address_book (_tmp41_);
			if (_tmp42_) {
				const gchar* _tmp43_;
				_tmp43_ = category_name;
				_tmp40_ = g_strcmp0 (_tmp43_, EDSF_PERSONA_STORE_android_favourite_group_name) == 0;
			} else {
				_tmp40_ = FALSE;
			}
			_tmp44_ = _tmp40_;
			if (_tmp44_) {
				self->priv->_is_favourite = FALSE;
			}
			_tmp45_ = category_name;
			g_signal_emit_by_name ((FolksGroupDetails*) self, "group-changed", _tmp45_, FALSE);
			_tmp46_ = self->priv->_groups;
			_tmp47_ = category_name;
			gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp46_, _tmp47_);
			_g_free0 (category_name);
		}
		_g_object_unref0 (_category_name_list);
	}
	{
		GeeLinkedList* _tmp48_;
		GeeLinkedList* _tmp49_;
		GeeLinkedList* _category_name_list;
		GeeLinkedList* _tmp50_;
		gint _tmp51_;
		gint _tmp52_;
		gint _category_name_size;
		gint _category_name_index;
		_tmp48_ = added_categories;
		_tmp49_ = _g_object_ref0 (_tmp48_);
		_category_name_list = _tmp49_;
		_tmp50_ = _category_name_list;
		_tmp51_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp50_);
		_tmp52_ = _tmp51_;
		_category_name_size = _tmp52_;
		_category_name_index = -1;
		while (TRUE) {
			gint _tmp53_;
			gint _tmp54_;
			gint _tmp55_;
			GeeLinkedList* _tmp56_;
			gint _tmp57_;
			gpointer _tmp58_ = NULL;
			gchar* category_name;
			gboolean _tmp59_ = FALSE;
			EdsfPersonaStore* _tmp60_;
			gboolean _tmp61_ = FALSE;
			gboolean _tmp63_;
			GeeHashSet* _tmp64_;
			const gchar* _tmp65_;
			const gchar* _tmp66_;
			_tmp53_ = _category_name_index;
			_category_name_index = _tmp53_ + 1;
			_tmp54_ = _category_name_index;
			_tmp55_ = _category_name_size;
			if (!(_tmp54_ < _tmp55_)) {
				break;
			}
			_tmp56_ = _category_name_list;
			_tmp57_ = _category_name_index;
			_tmp58_ = gee_abstract_list_get ((GeeAbstractList*) _tmp56_, _tmp57_);
			category_name = (gchar*) _tmp58_;
			_tmp60_ = store;
			_tmp61_ = _edsf_persona_store_is_google_contacts_address_book (_tmp60_);
			if (_tmp61_) {
				const gchar* _tmp62_;
				_tmp62_ = category_name;
				_tmp59_ = g_strcmp0 (_tmp62_, EDSF_PERSONA_STORE_android_favourite_group_name) == 0;
			} else {
				_tmp59_ = FALSE;
			}
			_tmp63_ = _tmp59_;
			if (_tmp63_) {
				self->priv->_is_favourite = TRUE;
			}
			_tmp64_ = self->priv->_groups;
			_tmp65_ = category_name;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp64_, _tmp65_);
			_tmp66_ = category_name;
			g_signal_emit_by_name ((FolksGroupDetails*) self, "group-changed", _tmp66_, TRUE);
			_g_free0 (category_name);
		}
		_g_object_unref0 (_category_name_list);
	}
	g_object_freeze_notify ((GObject*) self);
	_tmp68_ = added_categories;
	_tmp69_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp68_);
	_tmp70_ = _tmp69_;
	if (_tmp70_ != 0) {
		_tmp67_ = TRUE;
	} else {
		GeeLinkedList* _tmp71_;
		gint _tmp72_;
		gint _tmp73_;
		_tmp71_ = removed_categories;
		_tmp72_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp71_);
		_tmp73_ = _tmp72_;
		_tmp67_ = _tmp73_ != 0;
	}
	_tmp74_ = _tmp67_;
	if (_tmp74_) {
		g_object_notify ((GObject*) self, "groups");
	}
	_tmp75_ = self->priv->_is_favourite;
	_tmp76_ = old_is_favourite;
	if (_tmp75_ != _tmp76_) {
		g_object_notify ((GObject*) self, "is-favourite");
	}
	g_object_thaw_notify ((GObject*) self);
	_g_object_unref0 (store);
	_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* retval = NULL;
	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_;
			GHashTable* _tmp23_;
			GHashTable* _tmp24_;
			_tmp1_ = edsf_persona__im_eds_map;
			if (_tmp1_ == NULL) {
				GHashFunc _tmp2_;
				GEqualFunc _tmp3_;
				GHashTable* _tmp4_;
				GHashTable* table;
				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_;
				GHashTable* _tmp21_;
				GHashTable* _tmp22_;
				_tmp2_ = g_str_hash;
				_tmp3_ = g_str_equal;
				_tmp4_ = g_hash_table_new_full (_tmp2_, _tmp3_, _g_free0_, NULL);
				table = _tmp4_;
				_tmp5_ = table;
				_tmp6_ = g_strdup ("aim");
				g_hash_table_insert (_tmp5_, _tmp6_, GINT_TO_POINTER (E_CONTACT_IM_AIM));
				_tmp7_ = table;
				_tmp8_ = g_strdup ("yahoo");
				g_hash_table_insert (_tmp7_, _tmp8_, GINT_TO_POINTER (E_CONTACT_IM_YAHOO));
				_tmp9_ = table;
				_tmp10_ = g_strdup ("groupwise");
				g_hash_table_insert (_tmp9_, _tmp10_, GINT_TO_POINTER (E_CONTACT_IM_GROUPWISE));
				_tmp11_ = table;
				_tmp12_ = g_strdup ("jabber");
				g_hash_table_insert (_tmp11_, _tmp12_, GINT_TO_POINTER (E_CONTACT_IM_JABBER));
				_tmp13_ = table;
				_tmp14_ = g_strdup ("msn");
				g_hash_table_insert (_tmp13_, _tmp14_, GINT_TO_POINTER (E_CONTACT_IM_MSN));
				_tmp15_ = table;
				_tmp16_ = g_strdup ("icq");
				g_hash_table_insert (_tmp15_, _tmp16_, GINT_TO_POINTER (E_CONTACT_IM_ICQ));
				_tmp17_ = table;
				_tmp18_ = g_strdup ("gadugadu");
				g_hash_table_insert (_tmp17_, _tmp18_, GINT_TO_POINTER (E_CONTACT_IM_GADUGADU));
				_tmp19_ = table;
				_tmp20_ = g_strdup ("skype");
				g_hash_table_insert (_tmp19_, _tmp20_, GINT_TO_POINTER (E_CONTACT_IM_SKYPE));
				_tmp21_ = table;
				_tmp22_ = _g_hash_table_ref0 (_tmp21_);
				_g_hash_table_unref0 (edsf_persona__im_eds_map);
				edsf_persona__im_eds_map = _tmp22_;
				_g_hash_table_unref0 (table);
			}
			_tmp23_ = edsf_persona__im_eds_map;
			_tmp24_ = _g_hash_table_ref0 ((GHashTable*) _tmp23_);
			_g_hash_table_unref0 (retval);
			retval = _tmp24_;
		}
		__finally4:
		{
			GHashTable* _tmp25_;
			_tmp25_ = edsf_persona__im_eds_map;
			g_static_rec_mutex_unlock (&__lock_edsf_persona__im_eds_map);
		}
		if (_inner_error_ != NULL) {
			_g_hash_table_unref0 (retval);
			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;
		}
	}
	result = retval;
	return result;
}


static void _edsf_persona_update_phones (EdsfPersona* self) {
	GeeHashSet* _tmp0_;
	GeeHashSet* new_phone_numbers;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GList* _tmp3_ = NULL;
	GList* attrs;
	GList* _tmp4_;
	GeeHashSet* _tmp18_;
	GeeHashSet* _tmp19_;
	gboolean _tmp20_ = 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_ = edsf_persona_get_contact (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = e_contact_get_attributes (_tmp2_, E_CONTACT_TEL);
	attrs = _tmp3_;
	_tmp4_ = attrs;
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp4_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* _tmp5_;
			EVCardAttribute* attr = NULL;
			_tmp5_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
			attr = _tmp5_;
			{
				EVCardAttribute* _tmp6_;
				gchar* _tmp7_ = NULL;
				gchar* val;
				gboolean _tmp8_ = FALSE;
				const gchar* _tmp9_;
				gboolean _tmp11_;
				const gchar* _tmp12_;
				FolksPhoneFieldDetails* _tmp13_;
				FolksPhoneFieldDetails* phone_fd;
				FolksPhoneFieldDetails* _tmp14_;
				EVCardAttribute* _tmp15_;
				GeeHashSet* _tmp16_;
				FolksPhoneFieldDetails* _tmp17_;
				_tmp6_ = attr;
				_tmp7_ = e_vcard_attribute_get_value (_tmp6_);
				val = _tmp7_;
				_tmp9_ = val;
				if (_tmp9_ == NULL) {
					_tmp8_ = TRUE;
				} else {
					const gchar* _tmp10_;
					_tmp10_ = val;
					_tmp8_ = g_strcmp0 ((const gchar*) _tmp10_, "") == 0;
				}
				_tmp11_ = _tmp8_;
				if (_tmp11_) {
					_g_free0 (val);
					__vala_EVCardAttribute_free0 (attr);
					continue;
				}
				_tmp12_ = val;
				_tmp13_ = folks_phone_field_details_new ((const gchar*) _tmp12_, NULL);
				phone_fd = _tmp13_;
				_tmp14_ = phone_fd;
				_tmp15_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp14_, _tmp15_);
				_tmp16_ = new_phone_numbers;
				_tmp17_ = phone_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp16_, _tmp17_);
				_g_object_unref0 (phone_fd);
				_g_free0 (val);
				__vala_EVCardAttribute_free0 (attr);
			}
		}
	}
	_tmp18_ = new_phone_numbers;
	_tmp19_ = self->priv->_phone_numbers;
	_tmp20_ = folks_internal_equal_sets (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeSet*) _tmp18_, (GeeSet*) _tmp19_);
	if (!_tmp20_) {
		GeeHashSet* _tmp21_;
		GeeHashSet* _tmp22_;
		GeeHashSet* _tmp23_;
		GeeSet* _tmp24_;
		GeeSet* _tmp25_;
		_tmp21_ = new_phone_numbers;
		_tmp22_ = _g_object_ref0 (_tmp21_);
		_g_object_unref0 (self->priv->_phone_numbers);
		self->priv->_phone_numbers = _tmp22_;
		_tmp23_ = new_phone_numbers;
		_tmp24_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp23_);
		_tmp25_ = _tmp24_;
		_g_object_unref0 (self->priv->_phone_numbers_ro);
		self->priv->_phone_numbers_ro = _tmp25_;
		g_object_notify ((GObject*) self, "phone-numbers");
	}
	__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_ = ((GList*) _tmp12_)->data;
		_tmp14_ = g_strdup ((const gchar*) _tmp13_);
		_g_free0 (po_box);
		po_box = _tmp14_;
		_tmp15_ = l;
		_tmp16_ = ((GList*) _tmp15_)->next;
		l = _tmp16_;
	}
	_tmp17_ = l;
	if (_tmp17_ != NULL) {
		GList* _tmp18_;
		gconstpointer _tmp19_;
		gchar* _tmp20_;
		GList* _tmp21_;
		GList* _tmp22_;
		_tmp18_ = l;
		_tmp19_ = ((GList*) _tmp18_)->data;
		_tmp20_ = g_strdup ((const gchar*) _tmp19_);
		_g_free0 (extension);
		extension = _tmp20_;
		_tmp21_ = l;
		_tmp22_ = ((GList*) _tmp21_)->next;
		l = _tmp22_;
	}
	_tmp23_ = l;
	if (_tmp23_ != NULL) {
		GList* _tmp24_;
		gconstpointer _tmp25_;
		gchar* _tmp26_;
		GList* _tmp27_;
		GList* _tmp28_;
		_tmp24_ = l;
		_tmp25_ = ((GList*) _tmp24_)->data;
		_tmp26_ = g_strdup ((const gchar*) _tmp25_);
		_g_free0 (street);
		street = _tmp26_;
		_tmp27_ = l;
		_tmp28_ = ((GList*) _tmp27_)->next;
		l = _tmp28_;
	}
	_tmp29_ = l;
	if (_tmp29_ != NULL) {
		GList* _tmp30_;
		gconstpointer _tmp31_;
		gchar* _tmp32_;
		GList* _tmp33_;
		GList* _tmp34_;
		_tmp30_ = l;
		_tmp31_ = ((GList*) _tmp30_)->data;
		_tmp32_ = g_strdup ((const gchar*) _tmp31_);
		_g_free0 (locality);
		locality = _tmp32_;
		_tmp33_ = l;
		_tmp34_ = ((GList*) _tmp33_)->next;
		l = _tmp34_;
	}
	_tmp35_ = l;
	if (_tmp35_ != NULL) {
		GList* _tmp36_;
		gconstpointer _tmp37_;
		gchar* _tmp38_;
		GList* _tmp39_;
		GList* _tmp40_;
		_tmp36_ = l;
		_tmp37_ = ((GList*) _tmp36_)->data;
		_tmp38_ = g_strdup ((const gchar*) _tmp37_);
		_g_free0 (region);
		region = _tmp38_;
		_tmp39_ = l;
		_tmp40_ = ((GList*) _tmp39_)->next;
		l = _tmp40_;
	}
	_tmp41_ = l;
	if (_tmp41_ != NULL) {
		GList* _tmp42_;
		gconstpointer _tmp43_;
		gchar* _tmp44_;
		GList* _tmp45_;
		GList* _tmp46_;
		_tmp42_ = l;
		_tmp43_ = ((GList*) _tmp42_)->data;
		_tmp44_ = g_strdup ((const gchar*) _tmp43_);
		_g_free0 (postal_code);
		postal_code = _tmp44_;
		_tmp45_ = l;
		_tmp46_ = ((GList*) _tmp45_)->next;
		l = _tmp46_;
	}
	_tmp47_ = l;
	if (_tmp47_ != NULL) {
		GList* _tmp48_;
		gconstpointer _tmp49_;
		gchar* _tmp50_;
		GList* _tmp51_;
		GList* _tmp52_;
		_tmp48_ = l;
		_tmp49_ = ((GList*) _tmp48_)->data;
		_tmp50_ = g_strdup ((const gchar*) _tmp49_);
		_g_free0 (country);
		country = _tmp50_;
		_tmp51_ = l;
		_tmp52_ = ((GList*) _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_;
	EContact* _tmp2_;
	GList* _tmp3_ = NULL;
	GList* attrs;
	GList* _tmp4_;
	GeeHashSet* _tmp14_;
	GeeHashSet* _tmp15_;
	gboolean _tmp16_ = 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_ = edsf_persona_get_contact (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = e_contact_get_attributes (_tmp2_, E_CONTACT_ADDRESS);
	attrs = _tmp3_;
	_tmp4_ = attrs;
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp4_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				EVCardAttribute* _tmp5_;
				FolksPostalAddress* _tmp6_ = NULL;
				FolksPostalAddress* _tmp7_;
				FolksPostalAddressFieldDetails* _tmp8_;
				FolksPostalAddressFieldDetails* _tmp9_;
				FolksPostalAddressFieldDetails* pa_fd;
				FolksPostalAddressFieldDetails* _tmp10_;
				EVCardAttribute* _tmp11_;
				GeeHashSet* _tmp12_;
				FolksPostalAddressFieldDetails* _tmp13_;
				_tmp5_ = attr;
				_tmp6_ = _edsf_persona_postal_address_from_attribute (self, _tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = folks_postal_address_field_details_new (_tmp7_, NULL);
				_tmp9_ = _tmp8_;
				_g_object_unref0 (_tmp7_);
				pa_fd = _tmp9_;
				_tmp10_ = pa_fd;
				_tmp11_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp10_, _tmp11_);
				_tmp12_ = new_postal_addresses;
				_tmp13_ = pa_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp13_);
				_g_object_unref0 (pa_fd);
			}
		}
	}
	_tmp14_ = new_postal_addresses;
	_tmp15_ = self->priv->_postal_addresses;
	_tmp16_ = folks_internal_equal_sets (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeSet*) _tmp14_, (GeeSet*) _tmp15_);
	if (!_tmp16_) {
		GeeHashSet* _tmp17_;
		GeeHashSet* _tmp18_;
		GeeHashSet* _tmp19_;
		GeeSet* _tmp20_;
		GeeSet* _tmp21_;
		_tmp17_ = new_postal_addresses;
		_tmp18_ = _g_object_ref0 (_tmp17_);
		_g_object_unref0 (self->priv->_postal_addresses);
		self->priv->_postal_addresses = _tmp18_;
		_tmp19_ = new_postal_addresses;
		_tmp20_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp19_);
		_tmp21_ = _tmp20_;
		_g_object_unref0 (self->priv->_postal_addresses_ro);
		self->priv->_postal_addresses_ro = _tmp21_;
		g_object_notify ((GObject*) self, "phone-numbers");
	}
	g_object_notify ((GObject*) self, "postal-addresses");
	__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_;
	EContact* _tmp2_;
	EVCardAttribute* _tmp3_ = NULL;
	EVCardAttribute* _tmp4_;
	EVCardAttribute* ids;
	EVCardAttribute* _tmp5_;
	GeeHashSet* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _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_ = edsf_persona_get_contact (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = e_vcard_get_attribute ((EVCard*) _tmp2_, "X-FOLKS-CONTACTS-IDS");
	_tmp4_ = __vala_EVCardAttribute_copy0 (_tmp3_);
	ids = _tmp4_;
	_tmp5_ = ids;
	if (_tmp5_ != NULL) {
		EVCardAttribute* _tmp6_;
		GList* _tmp7_ = NULL;
		GList* ids_v;
		GList* _tmp8_;
		_tmp6_ = ids;
		_tmp7_ = e_vcard_attribute_get_values ((EVCardAttribute*) _tmp6_);
		ids_v = _tmp7_;
		_tmp8_ = ids_v;
		{
			GList* local_id_collection = NULL;
			GList* local_id_it = NULL;
			local_id_collection = _tmp8_;
			for (local_id_it = local_id_collection; local_id_it != NULL; local_id_it = local_id_it->next) {
				gchar* _tmp9_;
				gchar* local_id = NULL;
				_tmp9_ = g_strdup ((const gchar*) local_id_it->data);
				local_id = _tmp9_;
				{
					const gchar* _tmp10_;
					_tmp10_ = local_id;
					if (g_strcmp0 (_tmp10_, "") != 0) {
						GeeHashSet* _tmp11_;
						const gchar* _tmp12_;
						_tmp11_ = new_local_ids;
						_tmp12_ = local_id;
						gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp12_);
					}
					_g_free0 (local_id);
				}
			}
		}
	}
	_tmp13_ = new_local_ids;
	_tmp14_ = folks_persona_get_iid ((FolksPersona*) self);
	_tmp15_ = _tmp14_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp13_, _tmp15_);
	_tmp16_ = new_local_ids;
	_tmp17_ = folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self);
	_tmp18_ = _tmp17_;
	_tmp19_ = folks_internal_equal_sets (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, (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");
	}
	__vala_EVCardAttribute_free0 (ids);
	_g_object_unref0 (new_local_ids);
}


static void _edsf_persona_update_favourite (EdsfPersona* self) {
	gboolean is_fav;
	EContact* _tmp0_;
	EContact* _tmp1_;
	EVCardAttribute* _tmp2_ = NULL;
	EVCardAttribute* _tmp3_;
	EVCardAttribute* fav;
	EVCardAttribute* _tmp4_;
	FolksPersonaStore* _tmp13_;
	FolksPersonaStore* _tmp14_;
	EdsfPersonaStore* _tmp15_;
	EdsfPersonaStore* store;
	EdsfPersonaStore* _tmp16_;
	gboolean _tmp17_ = FALSE;
	gboolean _tmp23_;
	gboolean _tmp24_;
	g_return_if_fail (self != NULL);
	is_fav = FALSE;
	_tmp0_ = edsf_persona_get_contact (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = e_vcard_get_attribute ((EVCard*) _tmp1_, "X-FOLKS-FAVOURITE");
	_tmp3_ = __vala_EVCardAttribute_copy0 (_tmp2_);
	fav = _tmp3_;
	_tmp4_ = fav;
	if (_tmp4_ != NULL) {
		EVCardAttribute* _tmp5_;
		gchar* _tmp6_ = NULL;
		gchar* val;
		gboolean _tmp7_ = FALSE;
		const gchar* _tmp8_;
		gboolean _tmp12_;
		_tmp5_ = fav;
		_tmp6_ = e_vcard_attribute_get_value ((EVCardAttribute*) _tmp5_);
		val = _tmp6_;
		_tmp8_ = val;
		if (_tmp8_ != NULL) {
			const gchar* _tmp9_;
			gchar* _tmp10_ = NULL;
			gchar* _tmp11_;
			_tmp9_ = val;
			_tmp10_ = g_utf8_strdown ((const gchar*) _tmp9_, (gssize) (-1));
			_tmp11_ = _tmp10_;
			_tmp7_ = g_strcmp0 (_tmp11_, "true") == 0;
			_g_free0 (_tmp11_);
		} else {
			_tmp7_ = FALSE;
		}
		_tmp12_ = _tmp7_;
		if (_tmp12_) {
			is_fav = TRUE;
		}
		_g_free0 (val);
	}
	_tmp13_ = folks_persona_get_store ((FolksPersona*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = _g_object_ref0 (EDSF_PERSONA_STORE (_tmp14_));
	store = _tmp15_;
	_tmp16_ = store;
	_tmp17_ = _edsf_persona_store_is_google_contacts_address_book (_tmp16_);
	if (_tmp17_) {
		gboolean _tmp18_ = FALSE;
		gboolean _tmp19_;
		gboolean _tmp22_;
		_tmp19_ = is_fav;
		if (_tmp19_) {
			_tmp18_ = TRUE;
		} else {
			GeeHashSet* _tmp20_;
			gboolean _tmp21_ = FALSE;
			_tmp20_ = self->priv->_groups;
			_tmp21_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp20_, EDSF_PERSONA_STORE_android_favourite_group_name);
			_tmp18_ = _tmp21_;
		}
		_tmp22_ = _tmp18_;
		is_fav = _tmp22_;
	}
	_tmp23_ = is_fav;
	_tmp24_ = self->priv->_is_favourite;
	if (_tmp23_ != _tmp24_) {
		gboolean _tmp25_;
		gboolean groups_changed;
		gboolean _tmp26_ = FALSE;
		EdsfPersonaStore* _tmp27_;
		gboolean _tmp28_ = FALSE;
		gboolean _tmp31_;
		gboolean _tmp33_;
		_tmp25_ = is_fav;
		self->priv->_is_favourite = _tmp25_;
		groups_changed = FALSE;
		_tmp27_ = store;
		_tmp28_ = _edsf_persona_store_is_google_contacts_address_book (_tmp27_);
		if (_tmp28_) {
			GeeHashSet* _tmp29_;
			gboolean _tmp30_ = FALSE;
			_tmp29_ = self->priv->_groups;
			_tmp30_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp29_, EDSF_PERSONA_STORE_android_favourite_group_name);
			_tmp26_ = !_tmp30_;
		} else {
			_tmp26_ = FALSE;
		}
		_tmp31_ = _tmp26_;
		if (_tmp31_) {
			GeeHashSet* _tmp32_;
			_tmp32_ = self->priv->_groups;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp32_, EDSF_PERSONA_STORE_android_favourite_group_name);
			g_signal_emit_by_name ((FolksGroupDetails*) self, "group-changed", EDSF_PERSONA_STORE_android_favourite_group_name, TRUE);
			groups_changed = TRUE;
		}
		g_object_freeze_notify ((GObject*) self);
		_tmp33_ = groups_changed;
		if (_tmp33_ == TRUE) {
			g_object_notify ((GObject*) self, "groups");
		}
		g_object_notify ((GObject*) self, "is-favourite");
		g_object_thaw_notify ((GObject*) self);
	}
	_g_object_unref0 (store);
	__vala_EVCardAttribute_free0 (fav);
}


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_;
	EContact* _tmp1_;
	const gchar* _tmp2_;
	void* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (prop_name != NULL, NULL);
	_tmp0_ = edsf_persona_get_contact (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = prop_name;
	_tmp3_ = _edsf_persona_get_property_from_contact (_tmp1_, _tmp2_);
	result = _tmp3_;
	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 gboolean edsf_persona_real_get_is_favourite (FolksFavouriteDetails* base) {
	gboolean result;
	EdsfPersona* self;
	gboolean _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_is_favourite;
	result = _tmp0_;
	return result;
}


static void edsf_persona_real_set_is_favourite (FolksFavouriteDetails* base, gboolean value) {
	EdsfPersona* self;
	gboolean _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = value;
	folks_favourite_details_change_is_favourite ((FolksFavouriteDetails*) self, _tmp0_, NULL, NULL);
}


static GObject * edsf_persona_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	EdsfPersona * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GeeHashSet* _tmp2_;
	GeeHashSet* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	GeeHashSet* _tmp6_;
	GeeHashSet* _tmp7_;
	GeeSet* _tmp8_;
	GeeSet* _tmp9_;
	GeeHashSet* _tmp10_;
	GeeHashSet* _tmp11_;
	GeeSet* _tmp12_;
	GeeSet* _tmp13_;
	GeeHashSet* _tmp14_;
	GeeHashSet* _tmp15_;
	GeeSet* _tmp16_;
	GeeSet* _tmp17_;
	GeeHashSet* _tmp18_;
	GeeHashSet* _tmp19_;
	GeeSet* _tmp20_;
	GeeSet* _tmp21_;
	GeeHashSet* _tmp22_;
	GeeHashSet* _tmp23_;
	GeeSet* _tmp24_;
	GeeSet* _tmp25_;
	GeeHashMultiMap* _tmp26_;
	GeeHashSet* _tmp27_;
	GeeHashSet* _tmp28_;
	GeeSet* _tmp29_;
	GeeSet* _tmp30_;
	GeeHashSet* _tmp31_;
	GeeHashSet* _tmp32_;
	GeeSet* _tmp33_;
	GeeSet* _tmp34_;
	EContact* _tmp35_;
	parent_class = G_OBJECT_CLASS (edsf_persona_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = EDSF_PERSONA (obj);
	_tmp0_ = folks_persona_get_iid ((FolksPersona*) self);
	_tmp1_ = _tmp0_;
	g_debug ("edsf-persona.vala:743: Creating new Edsf.Persona with IID '%s'", _tmp1_);
	self->priv->_gender = FOLKS_GENDER_UNSPECIFIED;
	_tmp2_ = 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 = _tmp2_;
	_tmp3_ = self->priv->_phone_numbers;
	_tmp4_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (self->priv->_phone_numbers_ro);
	self->priv->_phone_numbers_ro = _tmp5_;
	_tmp6_ = 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 = _tmp6_;
	_tmp7_ = self->priv->_email_addresses;
	_tmp8_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp7_);
	_tmp9_ = _tmp8_;
	_g_object_unref0 (self->priv->_email_addresses_ro);
	self->priv->_email_addresses_ro = _tmp9_;
	_tmp10_ = 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 = _tmp10_;
	_tmp11_ = self->priv->_notes;
	_tmp12_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp11_);
	_tmp13_ = _tmp12_;
	_g_object_unref0 (self->priv->_notes_ro);
	self->priv->_notes_ro = _tmp13_;
	_tmp14_ = 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 = _tmp14_;
	_tmp15_ = self->priv->_urls;
	_tmp16_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp15_);
	_tmp17_ = _tmp16_;
	_g_object_unref0 (self->priv->_urls_ro);
	self->priv->_urls_ro = _tmp17_;
	_tmp18_ = 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 = _tmp18_;
	_tmp19_ = self->priv->_postal_addresses;
	_tmp20_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp19_);
	_tmp21_ = _tmp20_;
	_g_object_unref0 (self->priv->_postal_addresses_ro);
	self->priv->_postal_addresses_ro = _tmp21_;
	_tmp22_ = 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 = _tmp22_;
	_tmp23_ = self->priv->_local_ids;
	_tmp24_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp23_);
	_tmp25_ = _tmp24_;
	_g_object_unref0 (self->priv->_local_ids_ro);
	self->priv->_local_ids_ro = _tmp25_;
	_tmp26_ = 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 = _tmp26_;
	_tmp27_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	_g_object_unref0 (self->priv->_groups);
	self->priv->_groups = _tmp27_;
	_tmp28_ = self->priv->_groups;
	_tmp29_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp28_);
	_tmp30_ = _tmp29_;
	_g_object_unref0 (self->priv->_groups_ro);
	self->priv->_groups_ro = _tmp30_;
	_tmp31_ = 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 = _tmp31_;
	_tmp32_ = self->priv->_roles;
	_tmp33_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp32_);
	_tmp34_ = _tmp33_;
	_g_object_unref0 (self->priv->_roles_ro);
	self->priv->_roles_ro = _tmp34_;
	_tmp35_ = self->priv->_contact;
	_edsf_persona_update (self, _tmp35_);
	return obj;
}


static void edsf_persona_url_type_mapping_copy (const EdsfPersonaUrlTypeMapping* self, EdsfPersonaUrlTypeMapping* dest) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	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)->constructor = edsf_persona_constructor;
	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 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	/**
	   * {@inheritDoc}
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_WEB_SERVICE_ADDRESSES, g_param_spec_object ("web-service-addresses", "web-service-addresses", "web-service-addresses", GEE_TYPE_MULTI_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * IDs used to link {@link Edsf.Persona}s.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LOCAL_IDS, g_param_spec_object ("local-ids", "local-ids", "local-ids", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * The postal addresses of the contact.
	   *
	   * A list of postal addresses associated to the contact.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_POSTAL_ADDRESSES, g_param_spec_object ("postal-addresses", "postal-addresses", "postal-addresses", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_PHONE_NUMBERS, g_param_spec_object ("phone-numbers", "phone-numbers", "phone-numbers", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_EMAIL_ADDRESSES, g_param_spec_object ("email-addresses", "email-addresses", "email-addresses", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_NOTES, g_param_spec_object ("notes", "notes", "notes", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LINKABLE_PROPERTIES, g_param_spec_boxed ("linkable-properties", "linkable-properties", "linkable-properties", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_WRITEABLE_PROPERTIES, g_param_spec_boxed ("writeable-properties", "writeable-properties", "writeable-properties", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * An avatar for the Persona.
	   *
	   * See {@link Folks.AvatarDetails.avatar}.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_AVATAR, g_param_spec_object ("avatar", "avatar", "avatar", g_loadable_icon_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STRUCTURED_NAME, g_param_spec_object ("structured-name", "structured-name", "structured-name", FOLKS_TYPE_STRUCTURED_NAME, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * 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 | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_FULL_NAME, g_param_spec_string ("full-name", "full-name", "full-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_NICKNAME, g_param_spec_string ("nickname", "nickname", "nickname", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_GENDER, g_param_spec_enum ("gender", "gender", "gender", FOLKS_TYPE_GENDER, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_URLS, g_param_spec_object ("urls", "urls", "urls", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_IM_ADDRESSES, g_param_spec_object ("im-addresses", "im-addresses", "im-addresses", GEE_TYPE_MULTI_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_GROUPS, g_param_spec_object ("groups", "groups", "groups", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * e-d-s has no equivalent field, so this is unsupported.
	   *
	   * @since 0.6.2
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_CALENDAR_EVENT_ID, g_param_spec_string ("calendar-event-id", "calendar-event-id", "calendar-event-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.2
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_BIRTHDAY, g_param_spec_boxed ("birthday", "birthday", "birthday", G_TYPE_DATE_TIME, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.2
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_ROLES, g_param_spec_object ("roles", "roles", "roles", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * Whether this contact is a user-defined favourite.
	   *
	   * @since 0.6.5
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_IS_FAVOURITE, g_param_spec_boolean ("is-favourite", "is-favourite", "is-favourite", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	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_favourite_details_interface_init (FolksFavouriteDetailsIface * iface) {
	edsf_persona_folks_favourite_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_is_favourite = (void (*)(FolksFavouriteDetails*, gboolean, GError**)) edsf_persona_real_change_is_favourite;
	iface->change_is_favourite_finish = edsf_persona_real_change_is_favourite_finish;
	iface->get_is_favourite = edsf_persona_real_get_is_favourite;
	iface->set_is_favourite = edsf_persona_real_set_is_favourite;
}


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:832: 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_favourite_details_info = { (GInterfaceInitFunc) edsf_persona_folks_favourite_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_FAVOURITE_DETAILS, &folks_favourite_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;
		case EDSF_PERSONA_IS_FAVOURITE:
		g_value_set_boolean (value, folks_favourite_details_get_is_favourite ((FolksFavouriteDetails*) 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;
		case EDSF_PERSONA_IS_FAVOURITE:
		folks_favourite_details_set_is_favourite ((FolksFavouriteDetails*) self, g_value_get_boolean (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;
}



