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

/*
 * Copyright (C) 2011 Collabora Ltd.
 * Copyright (C) 2013, 2016 Philip Withnall
 *
 * 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 "folks/folks-eds.h"
#include <libebook-contacts/libebook-contacts.h>
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "folks/folks.h"
#include "folks/small-set.h"
#include <gio/gio.h>
#include <libebook/libebook.h>
#include "folks/small-set-internal.h"
#include "folks-internal.h"
#include <glib/gi18n-lib.h>

#define EDSF_PERSONA_GOOGLE_PERSONAL_GROUP_NAME "Contacts"
#define EDSF_PERSONA_STORE_android_favourite_group_name N_ ("Starred in Android")
#define EDSF_PERSONA_STORE_anti_links_attribute_name "X-FOLKS-ANTI-LINKS"

enum  {
	EDSF_PERSONA_0_PROPERTY,
	EDSF_PERSONA_CONTACT_PROPERTY,
	EDSF_PERSONA_WEB_SERVICE_ADDRESSES_PROPERTY,
	EDSF_PERSONA_LOCAL_IDS_PROPERTY,
	EDSF_PERSONA_LOCATION_PROPERTY,
	EDSF_PERSONA_POSTAL_ADDRESSES_PROPERTY,
	EDSF_PERSONA_PHONE_NUMBERS_PROPERTY,
	EDSF_PERSONA_EMAIL_ADDRESSES_PROPERTY,
	EDSF_PERSONA_NOTES_PROPERTY,
	EDSF_PERSONA_LINKABLE_PROPERTIES_PROPERTY,
	EDSF_PERSONA_WRITEABLE_PROPERTIES_PROPERTY,
	EDSF_PERSONA_AVATAR_PROPERTY,
	EDSF_PERSONA_STRUCTURED_NAME_PROPERTY,
	EDSF_PERSONA_CONTACT_ID_PROPERTY,
	EDSF_PERSONA_FULL_NAME_PROPERTY,
	EDSF_PERSONA_NICKNAME_PROPERTY,
	EDSF_PERSONA_GENDER_PROPERTY,
	EDSF_PERSONA_URLS_PROPERTY,
	EDSF_PERSONA_IM_ADDRESSES_PROPERTY,
	EDSF_PERSONA_GROUPS_PROPERTY,
	EDSF_PERSONA_CALENDAR_EVENT_ID_PROPERTY,
	EDSF_PERSONA_BIRTHDAY_PROPERTY,
	EDSF_PERSONA_ROLES_PROPERTY,
	EDSF_PERSONA_IS_FAVOURITE_PROPERTY,
	EDSF_PERSONA_ANTI_LINKS_PROPERTY,
	EDSF_PERSONA_SYSTEM_GROUPS_PROPERTY,
	EDSF_PERSONA_IN_GOOGLE_PERSONAL_GROUP_PROPERTY,
	EDSF_PERSONA_NUM_PROPERTIES
};
static GParamSpec* edsf_persona_properties[EDSF_PERSONA_NUM_PROPERTIES];

#define EDSF_PERSONA_TYPE_URL_TYPE_MAPPING (edsf_persona_url_type_mapping_get_type ())
typedef struct _EdsfPersonaUrlTypeMapping EdsfPersonaUrlTypeMapping;
#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)))
typedef struct _EdsfPersonaChangeWebServiceAddressesData EdsfPersonaChangeWebServiceAddressesData;
typedef struct _EdsfPersonaChangeLocalIdsData EdsfPersonaChangeLocalIdsData;
typedef struct _EdsfPersonaChangeLocationData EdsfPersonaChangeLocationData;
typedef struct _EdsfPersonaChangePostalAddressesData EdsfPersonaChangePostalAddressesData;
typedef struct _EdsfPersonaChangePhoneNumbersData EdsfPersonaChangePhoneNumbersData;
typedef struct _EdsfPersonaChangeEmailAddressesData EdsfPersonaChangeEmailAddressesData;
typedef struct _EdsfPersonaChangeExtendedFieldData EdsfPersonaChangeExtendedFieldData;
typedef struct _EdsfPersonaRemoveExtendedFieldData EdsfPersonaRemoveExtendedFieldData;
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 _EdsfPersonaChangeSystemGroupsData EdsfPersonaChangeSystemGroupsData;
typedef struct _EdsfPersonaChangeInGooglePersonalGroupData EdsfPersonaChangeInGooglePersonalGroupData;
typedef struct _EdsfPersonaChangeBirthdayData EdsfPersonaChangeBirthdayData;
typedef struct _EdsfPersonaChangeRolesData EdsfPersonaChangeRolesData;
typedef struct _EdsfPersonaChangeIsFavouriteData EdsfPersonaChangeIsFavouriteData;
typedef struct _EdsfPersonaChangeAntiLinksData EdsfPersonaChangeAntiLinksData;
#define __vala_EContactDate_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactDate_free (var), NULL)))
#define __vala_EContactName_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactName_free (var), NULL)))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define __vala_EContactPhoto_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactPhoto_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define __vala_EContactGeo_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactGeo_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _EdsfPersonaPrivate {
	EContact* _contact;
	GeeHashMultiMap* _web_service_addresses;
	FolksSmallSet* _local_ids;
	GeeSet* _local_ids_ro;
	FolksLocation* _location;
	FolksSmallSet* _postal_addresses;
	GeeSet* _postal_addresses_ro;
	FolksSmallSet* _phone_numbers;
	GeeSet* _phone_numbers_ro;
	FolksSmallSet* _email_addresses;
	GeeSet* _email_addresses_ro;
	FolksSmallSet* _notes;
	GeeSet* _notes_ro;
	GLoadableIcon* _avatar;
	FolksStructuredName* _structured_name;
	gchar* _contact_id;
	gchar* _full_name;
	gchar* _nickname;
	FolksGender _gender;
	FolksSmallSet* _urls;
	GeeSet* _urls_ro;
	GeeHashMultiMap* _im_addresses;
	FolksSmallSet* _groups;
	GeeSet* _groups_ro;
	GDateTime* _birthday;
	FolksSmallSet* _roles;
	GeeSet* _roles_ro;
	gboolean _is_favourite;
	FolksSmallSet* _anti_links;
	GeeSet* _anti_links_ro;
	FolksSmallSet* _system_groups;
	GeeSet* _system_groups_ro;
	gboolean _in_google_personal_group;
};

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

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

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

struct _EdsfPersonaChangeLocationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	FolksLocation* location;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GError* _inner_error0_;
};

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

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

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

struct _EdsfPersonaChangeExtendedFieldData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	gchar* name;
	FolksExtendedFieldDetails* value;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GError* _inner_error0_;
};

struct _EdsfPersonaRemoveExtendedFieldData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	gchar* name;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GError* _inner_error0_;
};

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

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

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

struct _EdsfPersonaChangeFullNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	gchar* full_name;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GError* _inner_error0_;
};

struct _EdsfPersonaChangeNicknameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	gchar* nickname;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GError* _inner_error0_;
};

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

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

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

struct _EdsfPersonaChangeGroupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	gchar* group;
	gboolean is_member;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GeeSet* _tmp2_;
	GeeSet* _tmp3_;
	gboolean _tmp4_;
	GeeSet* _tmp5_;
	GeeSet* _tmp6_;
	FolksSmallSet* new_groups;
	GeeSet* _tmp7_;
	GeeSet* _tmp8_;
	FolksSmallSet* _tmp9_;
	FolksSmallSet* _tmp10_;
	FolksSmallSet* _tmp11_;
	FolksSmallSet* _tmp12_;
	GError* _inner_error0_;
};

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

struct _EdsfPersonaChangeSystemGroupsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	GeeSet* system_groups;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GError* _inner_error0_;
};

struct _EdsfPersonaChangeInGooglePersonalGroupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	gboolean in_personal;
	FolksSmallSet* new_system_groups;
	FolksSmallSet* _tmp0_;
	FolksSmallSet* _tmp1_;
	FolksSmallSet* _tmp2_;
	FolksSmallSet* _tmp3_;
	FolksPersonaStore* _tmp4_;
	FolksPersonaStore* _tmp5_;
	FolksSmallSet* _tmp6_;
	GError* _inner_error0_;
};

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

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

struct _EdsfPersonaChangeIsFavouriteData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	gboolean is_favourite;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GError* _inner_error0_;
};

struct _EdsfPersonaChangeAntiLinksData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	EdsfPersona* self;
	GeeSet* anti_links;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GError* _inner_error0_;
};

static gint EdsfPersona_private_offset;
static gpointer edsf_persona_parent_class = NULL;
static GHashTable* edsf_persona__im_eds_map;
static GHashTable* edsf_persona__im_eds_map = NULL;
static GTimeZone* edsf_persona__local_time_zone;
static GTimeZone* edsf_persona__local_time_zone = NULL;
static FolksAntiLinkableIface * edsf_persona_folks_anti_linkable_parent_iface = 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 FolksExtendedInfoIface * edsf_persona_folks_extended_info_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 FolksLocationDetailsIface * edsf_persona_folks_location_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;

VALA_EXTERN GType edsf_persona_url_type_mapping_get_type (void) G_GNUC_CONST ;
VALA_EXTERN EdsfPersonaUrlTypeMapping* edsf_persona_url_type_mapping_dup (const EdsfPersonaUrlTypeMapping* self);
VALA_EXTERN void edsf_persona_url_type_mapping_free (EdsfPersonaUrlTypeMapping* self);
static guint _folks_abstract_field_details_hash_static_gee_hash_data_func (gconstpointer v,
                                                                    gpointer self);
static gboolean _folks_abstract_field_details_equal_static_gee_equal_data_func (gconstpointer a,
                                                                         gconstpointer b,
                                                                         gpointer self);
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_);
VALA_EXTERN void _edsf_persona_store_set_web_service_addresses (EdsfPersonaStore* self,
                                                    EdsfPersona* persona,
                                                    GeeMultiMap* web_service_addresses,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_local_ids (EdsfPersonaStore* self,
                                        EdsfPersona* persona,
                                        GeeSet* local_ids,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN 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_location_data_free (gpointer _data);
static void edsf_persona_real_change_location (FolksLocationDetails* base,
                                        FolksLocation* location,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static gboolean edsf_persona_real_change_location_co (EdsfPersonaChangeLocationData* _data_);
VALA_EXTERN void _edsf_persona_store_set_location (EdsfPersonaStore* self,
                                       EdsfPersona* persona,
                                       FolksLocation* location,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN void _edsf_persona_store_set_location_finish (EdsfPersonaStore* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static void edsf_persona_change_location_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_);
VALA_EXTERN void _edsf_persona_store_set_postal_addresses (EdsfPersonaStore* self,
                                               EdsfPersona* persona,
                                               GeeSet* postal_fds,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_phones (EdsfPersonaStore* self,
                                     EdsfPersona* persona,
                                     GeeSet* phones,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_emails (EdsfPersonaStore* self,
                                     EdsfPersona* persona,
                                     GeeSet* emails,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN 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 FolksExtendedFieldDetails* edsf_persona_real_get_extended_field (FolksExtendedInfo* base,
                                                                 const gchar* name);
VALA_EXTERN FolksExtendedFieldDetails* _edsf_persona_store_get_extended_field (EdsfPersonaStore* self,
                                                                   EdsfPersona* persona,
                                                                   const gchar* name);
static void edsf_persona_real_change_extended_field_data_free (gpointer _data);
static void edsf_persona_real_change_extended_field (FolksExtendedInfo* base,
                                              const gchar* name,
                                              FolksExtendedFieldDetails* value,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static gboolean edsf_persona_real_change_extended_field_co (EdsfPersonaChangeExtendedFieldData* _data_);
VALA_EXTERN void _edsf_persona_store_change_extended_field (EdsfPersonaStore* self,
                                                EdsfPersona* persona,
                                                const gchar* name,
                                                FolksExtendedFieldDetails* details,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN void _edsf_persona_store_change_extended_field_finish (EdsfPersonaStore* self,
                                                       GAsyncResult* _res_,
                                                       GError** error);
static void edsf_persona_change_extended_field_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void edsf_persona_real_remove_extended_field_data_free (gpointer _data);
static void edsf_persona_real_remove_extended_field (FolksExtendedInfo* base,
                                              const gchar* name,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static gboolean edsf_persona_real_remove_extended_field_co (EdsfPersonaRemoveExtendedFieldData* _data_);
VALA_EXTERN void _edsf_persona_store_remove_extended_field (EdsfPersonaStore* self,
                                                EdsfPersona* persona,
                                                const gchar* name,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN void _edsf_persona_store_remove_extended_field_finish (EdsfPersonaStore* self,
                                                       GAsyncResult* _res_,
                                                       GError** error);
static void edsf_persona_remove_extended_field_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_);
VALA_EXTERN void _edsf_persona_store_set_notes (EdsfPersonaStore* self,
                                    EdsfPersona* persona,
                                    GeeSet* notes,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_avatar (EdsfPersonaStore* self,
                                     EdsfPersona* persona,
                                     GLoadableIcon* avatar,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_structured_name (EdsfPersonaStore* self,
                                              EdsfPersona* persona,
                                              FolksStructuredName* sname,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_full_name (EdsfPersonaStore* self,
                                        EdsfPersona* persona,
                                        const gchar* full_name,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_nickname (EdsfPersonaStore* self,
                                       EdsfPersona* persona,
                                       const gchar* nickname,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_gender (EdsfPersonaStore* self,
                                     EdsfPersona* persona,
                                     FolksGender gender,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_urls (EdsfPersonaStore* self,
                                   EdsfPersona* persona,
                                   GeeSet* urls,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_im_fds (EdsfPersonaStore* self,
                                     EdsfPersona* persona,
                                     GeeMultiMap* im_fds,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_groups (EdsfPersonaStore* self,
                                     EdsfPersona* persona,
                                     GeeSet* groups,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN 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_change_system_groups_data_free (gpointer _data);
static gboolean edsf_persona_change_system_groups_co (EdsfPersonaChangeSystemGroupsData* _data_);
VALA_EXTERN void _edsf_persona_store_set_system_groups (EdsfPersonaStore* self,
                                            EdsfPersona* persona,
                                            GeeSet* system_groups,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN void _edsf_persona_store_set_system_groups_finish (EdsfPersonaStore* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static void edsf_persona_change_system_groups_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void edsf_persona_change_in_google_personal_group_data_free (gpointer _data);
static gboolean edsf_persona_change_in_google_personal_group_co (EdsfPersonaChangeInGooglePersonalGroupData* _data_);
static void edsf_persona_change_in_google_personal_group_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_);
VALA_EXTERN void _edsf_persona_store_set_birthday (EdsfPersonaStore* self,
                                       EdsfPersona* persona,
                                       GDateTime* bday,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_roles (EdsfPersonaStore* self,
                                    EdsfPersona* persona,
                                    GeeSet* roles,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN 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_);
VALA_EXTERN void _edsf_persona_store_set_is_favourite (EdsfPersonaStore* self,
                                           EdsfPersona* persona,
                                           gboolean is_favourite,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
VALA_EXTERN 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_);
static void edsf_persona_real_change_anti_links_data_free (gpointer _data);
static void edsf_persona_real_change_anti_links (FolksAntiLinkable* base,
                                          GeeSet* anti_links,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static gboolean edsf_persona_real_change_anti_links_co (EdsfPersonaChangeAntiLinksData* _data_);
VALA_EXTERN void _edsf_persona_store_set_anti_links (EdsfPersonaStore* self,
                                         EdsfPersona* persona,
                                         GeeSet* anti_links,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN void _edsf_persona_store_set_anti_links_finish (EdsfPersonaStore* self,
                                                GAsyncResult* _res_,
                                                GError** error);
static void edsf_persona_change_anti_links_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
VALA_EXTERN gchar* edsf_persona_build_iid_from_contact (const gchar* store_id,
                                            EContact* contact);
VALA_EXTERN gchar* edsf_persona_build_iid (const gchar* store_id,
                               const gchar* contact_id);
static void edsf_persona_real_linkable_property_to_links (FolksPersona* base,
                                                   const gchar* prop_name,
                                                   FolksPersonaLinkablePropertyCallback callback,
                                                   gpointer callback_target);
VALA_EXTERN 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,
                                gboolean create_if_not_exist,
                                gboolean emit_notification);
static void _edsf_persona_update_phones (EdsfPersona* self,
                                  gboolean create_if_not_exist,
                                  gboolean emit_notification);
static void _edsf_persona_update_addresses (EdsfPersona* self,
                                     gboolean create_if_not_exist,
                                     gboolean emit_notification);
static void _edsf_persona_update_emails (EdsfPersona* self,
                                  gboolean emit_notification);
static void _edsf_persona_update_im_addresses (EdsfPersona* self);
static void _edsf_persona_update_groups (EdsfPersona* self,
                                  gboolean create_if_not_exist,
                                  gboolean emit_notification);
static void _edsf_persona_update_notes (EdsfPersona* self,
                                 gboolean create_if_not_exist,
                                 gboolean emit_notification);
static void _edsf_persona_update_local_ids (EdsfPersona* self);
static void _edsf_persona_update_location (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,
                                 gboolean create_if_not_exist,
                                 gboolean emit_notification);
static void _edsf_persona_update_favourite (EdsfPersona* self);
static void _edsf_persona_update_anti_links (EdsfPersona* self);
static void _edsf_persona_update_params (EdsfPersona* self,
                                  FolksAbstractFieldDetails* details,
                                  EVCardAttribute* attr);
static const gchar* edsf_persona_get_vcard_attr_value (EdsfPersona* self,
                                                EVCardAttribute* attr);
static gpointer _edsf_persona_get_property (EdsfPersona* self,
                                     GType t_type,
                                     GBoxedCopyFunc t_dup_func,
                                     GDestroyNotify t_destroy_func,
                                     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 const gchar* _edsf_persona_get_string_property (EdsfPersona* self,
                                                const gchar* prop_name);
static void _vala_EVCardAttribute_free (EVCardAttribute* self);
static void __vala_EVCardAttribute_free0_ (gpointer var);
static inline 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);
VALA_EXTERN GHashTable* _edsf_persona_get_im_eds_map (void);
static const gchar* _edsf_persona_im_proto_from_addr (EdsfPersona* self,
                                               const gchar* addr);
VALA_EXTERN gboolean _edsf_persona_store_is_google_contacts_address_book (EdsfPersonaStore* self);
static void _g_free0_ (gpointer var);
static inline void _g_list_free__g_free0_ (GList* self);
static FolksPostalAddress* _edsf_persona_postal_address_from_attribute (EdsfPersona* self,
                                                                 EVCardAttribute* attr);
static EContactGeo* _vala_EContactGeo_copy (EContactGeo* self);
static void _vala_EContactGeo_free (EContactGeo* self);
VALA_EXTERN gpointer _edsf_persona_get_property_from_contact (GType t_type,
                                                  GBoxedCopyFunc t_dup_func,
                                                  GDestroyNotify t_destroy_func,
                                                  EContact* contact,
                                                  const gchar* prop_name);
static GObject * edsf_persona_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties);
static void edsf_persona_finalize (GObject * obj);
static GType edsf_persona_get_type_once (void);
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,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _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[5] = {"im-addresses", "email-addresses", "local-ids", "web-service-addresses", NULL};

static inline gpointer
edsf_persona_get_instance_private (EdsfPersona* self)
{
	return G_STRUCT_MEMBER_P (self, EdsfPersona_private_offset);
}

static guint
_folks_abstract_field_details_hash_static_gee_hash_data_func (gconstpointer v,
                                                              gpointer self)
{
	guint result;
	result = folks_abstract_field_details_hash_static ((FolksAbstractFieldDetails*) v);
	return result;
}

static gboolean
_folks_abstract_field_details_equal_static_gee_equal_data_func (gconstpointer a,
                                                                gconstpointer b,
                                                                gpointer self)
{
	gboolean result;
	result = folks_abstract_field_details_equal_static ((FolksAbstractFieldDetails*) a, (FolksAbstractFieldDetails*) b);
	return result;
}

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_;
	g_return_if_fail (web_service_addresses != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeWebServiceAddressesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_web_service_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (web_service_addresses);
	_g_object_unref0 (_data_->web_service_addresses);
	_data_->web_service_addresses = _tmp1_;
	edsf_persona_real_change_web_service_addresses_co (_data_);
}

static void
edsf_persona_change_web_service_addresses_finish (FolksWebServiceDetails* base,
                                                  GAsyncResult* _res_,
                                                  GError** error)
{
	EdsfPersonaChangeWebServiceAddressesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_web_service_addresses (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->web_service_addresses, edsf_persona_change_web_service_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_web_service_addresses_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (local_ids != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeLocalIdsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_local_ids_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (local_ids);
	_g_object_unref0 (_data_->local_ids);
	_data_->local_ids = _tmp1_;
	edsf_persona_real_change_local_ids_co (_data_);
}

static void
edsf_persona_change_local_ids_finish (FolksLocalIdDetails* base,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	EdsfPersonaChangeLocalIdsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_local_ids (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->local_ids, edsf_persona_change_local_ids_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_local_ids_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
edsf_persona_real_change_location_data_free (gpointer _data)
{
	EdsfPersonaChangeLocationData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->location);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeLocationData, _data_);
}

static void
edsf_persona_real_change_location (FolksLocationDetails* base,
                                   FolksLocation* location,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	EdsfPersona * self;
	EdsfPersonaChangeLocationData* _data_;
	EdsfPersona* _tmp0_;
	FolksLocation* _tmp1_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeLocationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_location_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (location);
	_g_object_unref0 (_data_->location);
	_data_->location = _tmp1_;
	edsf_persona_real_change_location_co (_data_);
}

static void
edsf_persona_change_location_finish (FolksLocationDetails* base,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	EdsfPersonaChangeLocationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@inheritDoc}
   *
   * @since 0.9.2
   */
static void
edsf_persona_change_location_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	EdsfPersonaChangeLocationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_location_co (_data_);
}

static gboolean
edsf_persona_real_change_location_co (EdsfPersonaChangeLocationData* _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_->_state_ = 1;
	_edsf_persona_store_set_location (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->location, edsf_persona_change_location_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_location_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (postal_addresses != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangePostalAddressesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_postal_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (postal_addresses);
	_g_object_unref0 (_data_->postal_addresses);
	_data_->postal_addresses = _tmp1_;
	edsf_persona_real_change_postal_addresses_co (_data_);
}

static void
edsf_persona_change_postal_addresses_finish (FolksPostalAddressDetails* base,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	EdsfPersonaChangePostalAddressesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_postal_addresses (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->postal_addresses, edsf_persona_change_postal_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_postal_addresses_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (phone_numbers != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangePhoneNumbersData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_phone_numbers_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (phone_numbers);
	_g_object_unref0 (_data_->phone_numbers);
	_data_->phone_numbers = _tmp1_;
	edsf_persona_real_change_phone_numbers_co (_data_);
}

static void
edsf_persona_change_phone_numbers_finish (FolksPhoneDetails* base,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	EdsfPersonaChangePhoneNumbersData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_phones (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->phone_numbers, edsf_persona_change_phone_numbers_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_phones_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (email_addresses != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeEmailAddressesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_email_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (email_addresses);
	_g_object_unref0 (_data_->email_addresses);
	_data_->email_addresses = _tmp1_;
	edsf_persona_real_change_email_addresses_co (_data_);
}

static void
edsf_persona_change_email_addresses_finish (FolksEmailDetails* base,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	EdsfPersonaChangeEmailAddressesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_emails (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->email_addresses, edsf_persona_change_email_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_emails_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

/**
   * {@inheritDoc}
   *
   * @since 0.11.0
   */
static FolksExtendedFieldDetails*
edsf_persona_real_get_extended_field (FolksExtendedInfo* base,
                                      const gchar* name)
{
	EdsfPersona * self;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	FolksExtendedFieldDetails* _tmp2_;
	FolksExtendedFieldDetails* result;
	self = (EdsfPersona*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = folks_persona_get_store ((FolksPersona*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _edsf_persona_store_get_extended_field (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), self, name);
	result = _tmp2_;
	return result;
}

static void
edsf_persona_real_change_extended_field_data_free (gpointer _data)
{
	EdsfPersonaChangeExtendedFieldData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->value);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeExtendedFieldData, _data_);
}

static void
edsf_persona_real_change_extended_field (FolksExtendedInfo* base,
                                         const gchar* name,
                                         FolksExtendedFieldDetails* value,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	EdsfPersona * self;
	EdsfPersonaChangeExtendedFieldData* _data_;
	EdsfPersona* _tmp0_;
	gchar* _tmp1_;
	FolksExtendedFieldDetails* _tmp2_;
	g_return_if_fail (name != NULL);
	g_return_if_fail (value != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeExtendedFieldData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_extended_field_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	_tmp2_ = _g_object_ref0 (value);
	_g_object_unref0 (_data_->value);
	_data_->value = _tmp2_;
	edsf_persona_real_change_extended_field_co (_data_);
}

static void
edsf_persona_change_extended_field_finish (FolksExtendedInfo* base,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	EdsfPersonaChangeExtendedFieldData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@inheritDoc}
   *
   * @since 0.11.0
   */
static void
edsf_persona_change_extended_field_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	EdsfPersonaChangeExtendedFieldData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_extended_field_co (_data_);
}

static gboolean
edsf_persona_real_change_extended_field_co (EdsfPersonaChangeExtendedFieldData* _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_->_state_ = 1;
	_edsf_persona_store_change_extended_field (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->name, _data_->value, edsf_persona_change_extended_field_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_change_extended_field_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
edsf_persona_real_remove_extended_field_data_free (gpointer _data)
{
	EdsfPersonaRemoveExtendedFieldData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaRemoveExtendedFieldData, _data_);
}

static void
edsf_persona_real_remove_extended_field (FolksExtendedInfo* base,
                                         const gchar* name,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	EdsfPersona * self;
	EdsfPersonaRemoveExtendedFieldData* _data_;
	EdsfPersona* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (name != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaRemoveExtendedFieldData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_remove_extended_field_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	edsf_persona_real_remove_extended_field_co (_data_);
}

static void
edsf_persona_remove_extended_field_finish (FolksExtendedInfo* base,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	EdsfPersonaRemoveExtendedFieldData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@inheritDoc}
   *
   * @since 0.11.0
   */
static void
edsf_persona_remove_extended_field_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	EdsfPersonaRemoveExtendedFieldData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_remove_extended_field_co (_data_);
}

static gboolean
edsf_persona_real_remove_extended_field_co (EdsfPersonaRemoveExtendedFieldData* _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_->_state_ = 1;
	_edsf_persona_store_remove_extended_field (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->name, edsf_persona_remove_extended_field_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_remove_extended_field_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (notes != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeNotesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_notes_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (notes);
	_g_object_unref0 (_data_->notes);
	_data_->notes = _tmp1_;
	edsf_persona_real_change_notes_co (_data_);
}

static void
edsf_persona_change_notes_finish (FolksNoteDetails* base,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	EdsfPersonaChangeNotesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_notes (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->notes, edsf_persona_change_notes_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_notes_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeAvatarData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_avatar_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (avatar);
	_g_object_unref0 (_data_->avatar);
	_data_->avatar = _tmp1_;
	edsf_persona_real_change_avatar_co (_data_);
}

static void
edsf_persona_change_avatar_finish (FolksAvatarDetails* base,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	EdsfPersonaChangeAvatarData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_avatar (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->avatar, edsf_persona_change_avatar_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_avatar_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeStructuredNameData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_structured_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (structured_name);
	_g_object_unref0 (_data_->structured_name);
	_data_->structured_name = _tmp1_;
	edsf_persona_real_change_structured_name_co (_data_);
}

static void
edsf_persona_change_structured_name_finish (FolksNameDetails* base,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	EdsfPersonaChangeStructuredNameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_structured_name (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->structured_name, edsf_persona_change_structured_name_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_structured_name_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	gchar* _tmp1_;
	g_return_if_fail (full_name != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeFullNameData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_full_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (full_name);
	_g_free0 (_data_->full_name);
	_data_->full_name = _tmp1_;
	edsf_persona_real_change_full_name_co (_data_);
}

static void
edsf_persona_change_full_name_finish (FolksNameDetails* base,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	EdsfPersonaChangeFullNameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_full_name (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->full_name, edsf_persona_change_full_name_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_full_name_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	gchar* _tmp1_;
	g_return_if_fail (nickname != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeNicknameData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_nickname_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (nickname);
	_g_free0 (_data_->nickname);
	_data_->nickname = _tmp1_;
	edsf_persona_real_change_nickname_co (_data_);
}

static void
edsf_persona_change_nickname_finish (FolksNameDetails* base,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	EdsfPersonaChangeNicknameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_nickname (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->nickname, edsf_persona_change_nickname_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_nickname_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeGenderData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_gender_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->gender = gender;
	edsf_persona_real_change_gender_co (_data_);
}

static void
edsf_persona_change_gender_finish (FolksGenderDetails* base,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	EdsfPersonaChangeGenderData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_gender (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->gender, edsf_persona_change_gender_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_gender_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (urls != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeUrlsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_urls_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (urls);
	_g_object_unref0 (_data_->urls);
	_data_->urls = _tmp1_;
	edsf_persona_real_change_urls_co (_data_);
}

static void
edsf_persona_change_urls_finish (FolksUrlDetails* base,
                                 GAsyncResult* _res_,
                                 GError** error)
{
	EdsfPersonaChangeUrlsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_urls (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->urls, edsf_persona_change_urls_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_urls_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (im_addresses != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeImAddressesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_im_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (im_addresses);
	_g_object_unref0 (_data_->im_addresses);
	_data_->im_addresses = _tmp1_;
	edsf_persona_real_change_im_addresses_co (_data_);
}

static void
edsf_persona_change_im_addresses_finish (FolksImDetails* base,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	EdsfPersonaChangeImAddressesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_im_fds (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->im_addresses, edsf_persona_change_im_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_im_fds_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	gchar* _tmp1_;
	g_return_if_fail (group != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeGroupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_group_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (group);
	_g_free0 (_data_->group);
	_data_->group = _tmp1_;
	_data_->is_member = is_member;
	edsf_persona_real_change_group_co (_data_);
}

static void
edsf_persona_change_group_finish (FolksGroupDetails* base,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	EdsfPersonaChangeGroupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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:
	if (_data_->is_member == TRUE) {
		_data_->_tmp2_ = folks_group_details_get_groups ((FolksGroupDetails*) _data_->self);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp1_ = gee_collection_contains ((GeeCollection*) _data_->_tmp3_, _data_->group) == TRUE;
	} else {
		_data_->_tmp1_ = FALSE;
	}
	if (_data_->_tmp1_) {
		_data_->_tmp0_ = TRUE;
	} else {
		if (_data_->is_member == FALSE) {
			_data_->_tmp5_ = folks_group_details_get_groups ((FolksGroupDetails*) _data_->self);
			_data_->_tmp6_ = _data_->_tmp5_;
			_data_->_tmp4_ = gee_collection_contains ((GeeCollection*) _data_->_tmp6_, _data_->group) == FALSE;
		} else {
			_data_->_tmp4_ = FALSE;
		}
		_data_->_tmp0_ = _data_->_tmp4_;
	}
	if (_data_->_tmp0_) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = folks_group_details_get_groups ((FolksGroupDetails*) _data_->self);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = folks_small_set_copy (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, (GeeIterable*) _data_->_tmp8_, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->new_groups = _data_->_tmp9_;
	if (_data_->is_member == FALSE) {
		_data_->_tmp10_ = _data_->new_groups;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _data_->_tmp10_, _data_->group);
	} else {
		_data_->_tmp11_ = _data_->new_groups;
		gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp11_, _data_->group);
	}
	_data_->_tmp12_ = _data_->new_groups;
	_data_->_state_ = 1;
	folks_group_details_change_groups ((FolksGroupDetails*) _data_->self, (GeeSet*) _data_->_tmp12_, edsf_persona_change_group_ready, _data_);
	return FALSE;
	_state_1:
	folks_group_details_change_groups_finish ((FolksGroupDetails*) _data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->new_groups);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->new_groups);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (groups != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeGroupsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_groups_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (groups);
	_g_object_unref0 (_data_->groups);
	_data_->groups = _tmp1_;
	edsf_persona_real_change_groups_co (_data_);
}

static void
edsf_persona_change_groups_finish (FolksGroupDetails* base,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	EdsfPersonaChangeGroupsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_groups (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->groups, edsf_persona_change_groups_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_groups_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
edsf_persona_change_system_groups_data_free (gpointer _data)
{
	EdsfPersonaChangeSystemGroupsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->system_groups);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeSystemGroupsData, _data_);
}

void
edsf_persona_change_system_groups (EdsfPersona* self,
                                   GeeSet* system_groups,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	EdsfPersonaChangeSystemGroupsData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (system_groups != NULL);
	_data_ = g_slice_new0 (EdsfPersonaChangeSystemGroupsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_change_system_groups_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (system_groups);
	_g_object_unref0 (_data_->system_groups);
	_data_->system_groups = _tmp1_;
	edsf_persona_change_system_groups_co (_data_);
}

void
edsf_persona_change_system_groups_finish (EdsfPersona* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	EdsfPersonaChangeSystemGroupsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * Change the contact's system groups.
   *
   * The system groups are a property exposed by Google Contacts address books,
   * and can include any combination of the following identifier:
   * - "Contacts"
   * - "Family"
   * - "Friends"
   * - "Coworkers"
   *
   * Setting the system groups will also change the group membership to include
   * the localized version of those groups, and may change the value of
   * {@link Edsf.Persona.in_google_personal_group}.
   *
   * Attempting to call this method on a persona belonging to a PersonaStore which
   * is not Google will throw a PropertyError.
   *
   * It's preferred to call this rather than setting {@link Persona.system_groups}
   * directly, as this method gives error notification and will only return once
   * the groups have been written to the relevant backing store (or the
   * operation's failed).
   *
   * @param system_groups the complete set of system group ids the contact should be a member of
   * @throws PropertyError if setting the groups failed
   * @since 0.9.0
   */
static void
edsf_persona_change_system_groups_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	EdsfPersonaChangeSystemGroupsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_change_system_groups_co (_data_);
}

static gboolean
edsf_persona_change_system_groups_co (EdsfPersonaChangeSystemGroupsData* _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_->_state_ = 1;
	_edsf_persona_store_set_system_groups (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->system_groups, edsf_persona_change_system_groups_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_system_groups_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

void
edsf_persona_change_in_google_personal_group (EdsfPersona* self,
                                              gboolean in_personal,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	EdsfPersonaChangeInGooglePersonalGroupData* _data_;
	EdsfPersona* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (EdsfPersonaChangeInGooglePersonalGroupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_change_in_google_personal_group_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->in_personal = in_personal;
	edsf_persona_change_in_google_personal_group_co (_data_);
}

void
edsf_persona_change_in_google_personal_group_finish (EdsfPersona* self,
                                                     GAsyncResult* _res_,
                                                     GError** error)
{
	EdsfPersonaChangeInGooglePersonalGroupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * Change whether this contact belongs to the personal group or not.
   *
   * The personal contact group is a concept that exists only in Google
   * address books. Other backends will throw a PropertyError.
   *
   * It's preferred to call this rather than setting {@link Persona.in_google_personal_group}
   * directly, as this method gives error notification and will only return once
   * the membership has been written to the relevant backing store (or the
   * operation's failed).
   *
   * @param in_personal Whether to add or remove the personal group membership
   * @throws PropertyError if the address book is not Google, or if setting the property failed
   * @since 0.9.0
   */
static void
edsf_persona_change_in_google_personal_group_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	EdsfPersonaChangeInGooglePersonalGroupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_change_in_google_personal_group_co (_data_);
}

static gboolean
edsf_persona_change_in_google_personal_group_co (EdsfPersonaChangeInGooglePersonalGroupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->in_personal == _data_->self->priv->_in_google_personal_group) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = _data_->self->priv->_system_groups;
	_data_->_tmp1_ = folks_small_set_copy (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, (GeeIterable*) _data_->_tmp0_, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->new_system_groups = _data_->_tmp1_;
	if (_data_->in_personal) {
		_data_->_tmp2_ = _data_->new_system_groups;
		gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp2_, EDSF_PERSONA_GOOGLE_PERSONAL_GROUP_NAME);
	} else {
		_data_->_tmp3_ = _data_->new_system_groups;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _data_->_tmp3_, EDSF_PERSONA_GOOGLE_PERSONAL_GROUP_NAME);
	}
	_data_->_tmp4_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->new_system_groups;
	_data_->_state_ = 1;
	_edsf_persona_store_set_system_groups (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, (GeeSet*) _data_->_tmp6_, edsf_persona_change_in_google_personal_group_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_system_groups_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->new_system_groups);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->new_system_groups);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_g_object_unref0 (_data_->new_system_groups);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeBirthdayData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_birthday_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_date_time_ref0 (bday);
	_g_date_time_unref0 (_data_->bday);
	_data_->bday = _tmp1_;
	edsf_persona_real_change_birthday_co (_data_);
}

static void
edsf_persona_change_birthday_finish (FolksBirthdayDetails* base,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	EdsfPersonaChangeBirthdayData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_birthday (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->bday, edsf_persona_change_birthday_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_birthday_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	g_return_if_fail (roles != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeRolesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_roles_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (roles);
	_g_object_unref0 (_data_->roles);
	_data_->roles = _tmp1_;
	edsf_persona_real_change_roles_co (_data_);
}

static void
edsf_persona_change_roles_finish (FolksRoleDetails* base,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	EdsfPersonaChangeRolesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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_->_state_ = 1;
	_edsf_persona_store_set_roles (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->roles, edsf_persona_change_roles_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_roles_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	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_;
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeIsFavouriteData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_is_favourite_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->is_favourite = is_favourite;
	edsf_persona_real_change_is_favourite_co (_data_);
}

static void
edsf_persona_change_is_favourite_finish (FolksFavouriteDetails* base,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	EdsfPersonaChangeIsFavouriteData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@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:
	if (_data_->self->priv->_is_favourite == _data_->is_favourite) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_state_ = 1;
	_edsf_persona_store_set_is_favourite (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->is_favourite, edsf_persona_change_is_favourite_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_is_favourite_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
edsf_persona_real_change_anti_links_data_free (gpointer _data)
{
	EdsfPersonaChangeAntiLinksData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->anti_links);
	_g_object_unref0 (_data_->self);
	g_slice_free (EdsfPersonaChangeAntiLinksData, _data_);
}

static void
edsf_persona_real_change_anti_links (FolksAntiLinkable* base,
                                     GeeSet* anti_links,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	EdsfPersona * self;
	EdsfPersonaChangeAntiLinksData* _data_;
	EdsfPersona* _tmp0_;
	GeeSet* _tmp1_;
	g_return_if_fail (anti_links != NULL);
	self = (EdsfPersona*) base;
	_data_ = g_slice_new0 (EdsfPersonaChangeAntiLinksData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, edsf_persona_real_change_anti_links_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (anti_links);
	_g_object_unref0 (_data_->anti_links);
	_data_->anti_links = _tmp1_;
	edsf_persona_real_change_anti_links_co (_data_);
}

static void
edsf_persona_change_anti_links_finish (FolksAntiLinkable* base,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	EdsfPersonaChangeAntiLinksData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
   * {@inheritDoc}
   *
   * @since 0.7.3
   */
static void
edsf_persona_change_anti_links_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	EdsfPersonaChangeAntiLinksData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	edsf_persona_real_change_anti_links_co (_data_);
}

static gboolean
edsf_persona_real_change_anti_links_co (EdsfPersonaChangeAntiLinksData* _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_->_state_ = 1;
	_edsf_persona_store_set_anti_links (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->self, _data_->anti_links, edsf_persona_change_anti_links_ready, _data_);
	return FALSE;
	_state_1:
	_edsf_persona_store_set_anti_links_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == FOLKS_PROPERTY_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

/**
   * Build a IID.
   *
   * This requires the UID field of the contact to be set to a non-empty value
   * already; if not, `null` will be returned.
   *
   * @param store_id the {@link PersonaStore.id}
   * @param contact the Contact, which must have a UID field set
   * @return a valid IID, or `null` if none could be constructed
   *
   * @since 0.6.0
   */
gchar*
edsf_persona_build_iid_from_contact (const gchar* store_id,
                                     EContact* contact)
{
	const gchar* contact_id = NULL;
	gconstpointer _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	g_return_val_if_fail (store_id != NULL, NULL);
	g_return_val_if_fail (contact != NULL, NULL);
	_tmp0_ = e_contact_get_const (contact, E_CONTACT_UID);
	contact_id = (const gchar*) _tmp0_;
	_tmp2_ = contact_id;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		const gchar* _tmp3_;
		_tmp3_ = contact_id;
		_tmp1_ = g_strcmp0 (_tmp3_, "") == 0;
	}
	if (_tmp1_) {
		result = NULL;
		return result;
	}
	_tmp4_ = contact_id;
	_tmp5_ = edsf_persona_build_iid (store_id, _tmp4_);
	result = _tmp5_;
	return result;
}

/**
   * Build a IID.
   *
   * @param store_id the {@link PersonaStore.id}, which must be non-empty
   * @param contact_id the ID belonging to the contact, which must be non-empty
   * @return a valid IID
   *
   * @since 0.6.0
   */
gchar*
edsf_persona_build_iid (const gchar* store_id,
                        const gchar* contact_id)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (store_id != NULL, NULL);
	g_return_val_if_fail (contact_id != NULL, NULL);
	_vala_return_val_if_fail (g_strcmp0 (store_id, "") != 0, "store_id != \"\"", NULL);
	_vala_return_val_if_fail (g_strcmp0 (contact_id, "") != 0, "contact_id != \"\"", NULL);
	_tmp0_ = g_strdup_printf ("%s:%s", store_id, contact_id);
	result = _tmp0_;
	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;
	const gchar* _contact_id = NULL;
	gconstpointer _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	const gchar* contact_id = NULL;
	const gchar* _tmp4_;
	gchar* uid = NULL;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* iid = NULL;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gboolean is_user = FALSE;
	g_return_val_if_fail (store != NULL, NULL);
	g_return_val_if_fail (contact != NULL, NULL);
	_tmp0_ = e_contact_get_const (contact, E_CONTACT_UID);
	_contact_id = (const gchar*) _tmp0_;
	_tmp2_ = _contact_id;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		_tmp3_ = _contact_id;
		_tmp1_ = g_strcmp0 (_tmp3_, "") != 0;
	} else {
		_tmp1_ = FALSE;
	}
	_vala_assert (_tmp1_, "_contact_id != null && _contact_id != \"\"");
	_tmp4_ = _contact_id;
	contact_id = (const gchar*) _tmp4_;
	_tmp5_ = folks_persona_store_get_id ((FolksPersonaStore*) store);
	_tmp6_ = _tmp5_;
	_tmp7_ = folks_persona_build_uid (BACKEND_NAME, _tmp6_, contact_id);
	uid = _tmp7_;
	_tmp8_ = folks_persona_store_get_id ((FolksPersonaStore*) store);
	_tmp9_ = _tmp8_;
	_tmp10_ = edsf_persona_build_iid (_tmp9_, contact_id);
	iid = _tmp10_;
	is_user = e_book_client_is_self (contact);
	self = (EdsfPersona*) g_object_new (object_type, "display-id", iid, "uid", uid, "iid", iid, "store", store, "is-user", is_user, "contact-id", contact_id, "contact", contact, NULL);
	_g_free0 (iid);
	_g_free0 (uid);
	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,
                                              gpointer callback_target)
{
	EdsfPersona * self;
	self = (EdsfPersona*) base;
	g_return_if_fail (prop_name != NULL);
	if (g_strcmp0 (prop_name, "im-addresses") == 0) {
		GeeMapIterator* iter = NULL;
		GeeHashMultiMap* _tmp0_;
		GeeMapIterator* _tmp1_;
		_tmp0_ = self->priv->_im_addresses;
		_tmp1_ = gee_multi_map_map_iterator ((GeeMultiMap*) _tmp0_);
		iter = _tmp1_;
		while (TRUE) {
			GeeMapIterator* _tmp2_;
			GeeMapIterator* _tmp3_;
			gpointer _tmp4_;
			gchar* _tmp5_;
			gchar* _tmp6_;
			gchar* _tmp7_;
			GeeMapIterator* _tmp8_;
			gpointer _tmp9_;
			FolksImFieldDetails* _tmp10_;
			gconstpointer _tmp11_;
			gconstpointer _tmp12_;
			gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp2_ = iter;
			if (!gee_map_iterator_next (_tmp2_)) {
				break;
			}
			_tmp3_ = iter;
			_tmp4_ = gee_map_iterator_get_key (_tmp3_);
			_tmp5_ = (gchar*) _tmp4_;
			_tmp6_ = g_strconcat (_tmp5_, ":", NULL);
			_tmp7_ = _tmp6_;
			_tmp8_ = iter;
			_tmp9_ = gee_map_iterator_get_value (_tmp8_);
			_tmp10_ = (FolksImFieldDetails*) _tmp9_;
			_tmp11_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = g_strconcat (_tmp7_, (const gchar*) _tmp12_, NULL);
			_tmp14_ = _tmp13_;
			callback (_tmp14_, callback_target);
			_g_free0 (_tmp14_);
			_g_object_unref0 (_tmp10_);
			_g_free0 (_tmp7_);
			_g_free0 (_tmp5_);
		}
		_g_object_unref0 (iter);
	} else {
		if (g_strcmp0 (prop_name, "local-ids") == 0) {
			{
				GeeIterator* _id_it = NULL;
				GeeSet* _tmp15_;
				GeeSet* _tmp16_;
				GeeIterator* _tmp17_;
				_tmp15_ = folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self);
				_tmp16_ = _tmp15_;
				_tmp17_ = gee_iterable_iterator ((GeeIterable*) _tmp16_);
				_id_it = _tmp17_;
				while (TRUE) {
					GeeIterator* _tmp18_;
					gchar* id = NULL;
					GeeIterator* _tmp19_;
					gpointer _tmp20_;
					const gchar* _tmp21_;
					_tmp18_ = _id_it;
					if (!gee_iterator_next (_tmp18_)) {
						break;
					}
					_tmp19_ = _id_it;
					_tmp20_ = gee_iterator_get (_tmp19_);
					id = (gchar*) _tmp20_;
					_tmp21_ = id;
					callback (_tmp21_, callback_target);
					_g_free0 (id);
				}
				_g_object_unref0 (_id_it);
			}
		} else {
			if (g_strcmp0 (prop_name, "web-service-addresses") == 0) {
				GeeMapIterator* iter = NULL;
				GeeMultiMap* _tmp22_;
				GeeMultiMap* _tmp23_;
				GeeMapIterator* _tmp24_;
				_tmp22_ = folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) self);
				_tmp23_ = _tmp22_;
				_tmp24_ = gee_multi_map_map_iterator (_tmp23_);
				iter = _tmp24_;
				while (TRUE) {
					GeeMapIterator* _tmp25_;
					GeeMapIterator* _tmp26_;
					gpointer _tmp27_;
					gchar* _tmp28_;
					gchar* _tmp29_;
					gchar* _tmp30_;
					GeeMapIterator* _tmp31_;
					gpointer _tmp32_;
					FolksWebServiceFieldDetails* _tmp33_;
					gconstpointer _tmp34_;
					gconstpointer _tmp35_;
					gchar* _tmp36_;
					gchar* _tmp37_;
					_tmp25_ = iter;
					if (!gee_map_iterator_next (_tmp25_)) {
						break;
					}
					_tmp26_ = iter;
					_tmp27_ = gee_map_iterator_get_key (_tmp26_);
					_tmp28_ = (gchar*) _tmp27_;
					_tmp29_ = g_strconcat (_tmp28_, ":", NULL);
					_tmp30_ = _tmp29_;
					_tmp31_ = iter;
					_tmp32_ = gee_map_iterator_get_value (_tmp31_);
					_tmp33_ = (FolksWebServiceFieldDetails*) _tmp32_;
					_tmp34_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp33_);
					_tmp35_ = _tmp34_;
					_tmp36_ = g_strconcat (_tmp30_, (const gchar*) _tmp35_, NULL);
					_tmp37_ = _tmp36_;
					callback (_tmp37_, callback_target);
					_g_free0 (_tmp37_);
					_g_object_unref0 (_tmp33_);
					_g_free0 (_tmp30_);
					_g_free0 (_tmp28_);
				}
				_g_object_unref0 (iter);
			} else {
				if (g_strcmp0 (prop_name, "email-addresses") == 0) {
					{
						FolksSmallSet* _email_list = NULL;
						FolksSmallSet* _tmp38_;
						gint _email_size = 0;
						FolksSmallSet* _tmp39_;
						gint _tmp40_;
						gint _tmp41_;
						gint _email_index = 0;
						_tmp38_ = self->priv->_email_addresses;
						_email_list = _tmp38_;
						_tmp39_ = _email_list;
						_tmp40_ = gee_collection_get_size ((GeeCollection*) _tmp39_);
						_tmp41_ = _tmp40_;
						_email_size = _tmp41_;
						_email_index = -1;
						while (TRUE) {
							gint _tmp42_;
							gint _tmp43_;
							FolksEmailFieldDetails* email = NULL;
							FolksSmallSet* _tmp44_;
							gconstpointer _tmp45_;
							FolksEmailFieldDetails* _tmp46_;
							FolksEmailFieldDetails* _tmp47_;
							gconstpointer _tmp48_;
							gconstpointer _tmp49_;
							_email_index = _email_index + 1;
							_tmp42_ = _email_index;
							_tmp43_ = _email_size;
							if (!(_tmp42_ < _tmp43_)) {
								break;
							}
							_tmp44_ = _email_list;
							_tmp45_ = folks_small_set_get (_tmp44_, _email_index);
							_tmp46_ = _g_object_ref0 ((FolksEmailFieldDetails*) _tmp45_);
							email = _tmp46_;
							_tmp47_ = email;
							_tmp48_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp47_);
							_tmp49_ = _tmp48_;
							callback ((const gchar*) _tmp49_, callback_target);
							_g_object_unref0 (email);
						}
					}
				} else {
					FOLKS_PERSONA_CLASS (edsf_persona_parent_class)->linkable_property_to_links (G_TYPE_CHECK_INSTANCE_CAST (self, FOLKS_TYPE_PERSONA, FolksPersona), prop_name, callback, callback_target);
				}
			}
		}
	}
}

/**
   * Update attribs of the persona.
   */
void
_edsf_persona_update (EdsfPersona* self,
                      EContact* updated_contact)
{
	EContact* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (updated_contact != NULL);
	g_object_freeze_notify ((GObject*) self);
	_tmp0_ = _g_object_ref0 (updated_contact);
	_g_object_unref0 (self->priv->_contact);
	self->priv->_contact = _tmp0_;
	g_object_notify ((GObject*) self, "contact");
	_edsf_persona_update_names (self);
	_edsf_persona_update_avatar (self);
	_edsf_persona_update_urls (self, FALSE, TRUE);
	_edsf_persona_update_phones (self, FALSE, TRUE);
	_edsf_persona_update_addresses (self, FALSE, TRUE);
	_edsf_persona_update_emails (self, TRUE);
	_edsf_persona_update_im_addresses (self);
	_edsf_persona_update_groups (self, FALSE, TRUE);
	_edsf_persona_update_notes (self, FALSE, TRUE);
	_edsf_persona_update_local_ids (self);
	_edsf_persona_update_location (self);
	_edsf_persona_update_web_services_addresses (self);
	_edsf_persona_update_gender (self);
	_edsf_persona_update_birthday (self);
	_edsf_persona_update_roles (self, FALSE, TRUE);
	_edsf_persona_update_favourite (self);
	_edsf_persona_update_anti_links (self);
	g_object_thaw_notify ((GObject*) self);
}

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

static void
_edsf_persona_update_gender (EdsfPersona* self)
{
	FolksGender gender = 0;
	EVCardAttribute* gender_attr = NULL;
	EContact* _tmp0_;
	EContact* _tmp1_;
	EVCardAttribute* _tmp2_;
	EVCardAttribute* _tmp3_;
	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);
	gender_attr = _tmp2_;
	_tmp3_ = gender_attr;
	if (_tmp3_ != NULL) {
		const gchar* val = NULL;
		EVCardAttribute* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp4_ = gender_attr;
		_tmp5_ = edsf_persona_get_vcard_attr_value (self, (EVCardAttribute*) _tmp4_);
		val = _tmp5_;
		_tmp6_ = val;
		if (_tmp6_ != NULL) {
			const gchar* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			GQuark _tmp11_ = 0U;
			static GQuark _tmp10_label0 = 0;
			static GQuark _tmp10_label1 = 0;
			_tmp7_ = val;
			_tmp8_ = g_utf8_strup ((const gchar*) _tmp7_, (gssize) -1);
			_tmp9_ = _tmp8_;
			_tmp11_ = (NULL == _tmp9_) ? 0 : g_quark_from_string (_tmp9_);
			g_free (_tmp9_);
			if (_tmp11_ == ((0 != _tmp10_label0) ? _tmp10_label0 : (_tmp10_label0 = g_quark_from_static_string (EDSF_PERSONA_gender_male)))) {
				switch (0) {
					default:
					{
						gender = FOLKS_GENDER_MALE;
						break;
					}
				}
			} else if (_tmp11_ == ((0 != _tmp10_label1) ? _tmp10_label1 : (_tmp10_label1 = g_quark_from_static_string (EDSF_PERSONA_gender_female)))) {
				switch (0) {
					default:
					{
						gender = FOLKS_GENDER_FEMALE;
						break;
					}
				}
			} else {
				switch (0) {
					default:
					{
						break;
					}
				}
			}
		}
	}
	if (self->priv->_gender != gender) {
		self->priv->_gender = gender;
		g_object_notify ((GObject*) self, "gender");
	}
}

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

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

static void
_edsf_persona_update_birthday (EdsfPersona* self)
{
	EContactDate* _bday = NULL;
	gpointer _tmp0_;
	EContactDate* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _edsf_persona_get_property (self, e_contact_date_get_type (), (GBoxedCopyFunc) _vala_EContactDate_copy, (GDestroyNotify) _vala_EContactDate_free, "birth_date");
	_bday = (EContactDate*) _tmp0_;
	_tmp1_ = _bday;
	if (_tmp1_ != NULL) {
		EContactDate* bday = NULL;
		EContactDate* _tmp2_;
		GDateTime* d = NULL;
		GTimeZone* _tmp3_;
		EContactDate* _tmp4_;
		EContactDate* _tmp5_;
		EContactDate* _tmp6_;
		GDateTime* _tmp7_;
		gboolean _tmp8_ = FALSE;
		GDateTime* _tmp9_;
		_tmp2_ = _bday;
		bday = (EContactDate*) _tmp2_;
		_tmp3_ = edsf_persona__local_time_zone;
		_tmp4_ = bday;
		_tmp5_ = bday;
		_tmp6_ = bday;
		_tmp7_ = g_date_time_new (_tmp3_, (gint) _tmp4_->year, (gint) _tmp5_->month, (gint) _tmp6_->day, 0, 0, 0.0);
		d = _tmp7_;
		_tmp9_ = d;
		if (_tmp9_ != NULL) {
			gboolean _tmp10_ = FALSE;
			GDateTime* _tmp11_;
			_tmp11_ = self->priv->_birthday;
			if (_tmp11_ == NULL) {
				_tmp10_ = TRUE;
			} else {
				gboolean _tmp12_ = FALSE;
				GDateTime* _tmp13_;
				_tmp13_ = self->priv->_birthday;
				if (_tmp13_ != NULL) {
					GDateTime* _tmp14_;
					GDateTime* _tmp15_;
					GDateTime* _tmp16_;
					GDateTime* _tmp17_;
					_tmp14_ = self->priv->_birthday;
					_tmp15_ = d;
					_tmp16_ = g_date_time_to_utc (_tmp15_);
					_tmp17_ = _tmp16_;
					_tmp12_ = !g_date_time_equal ((GDateTime*) _tmp14_, _tmp17_);
					_g_date_time_unref0 (_tmp17_);
				} else {
					_tmp12_ = FALSE;
				}
				_tmp10_ = _tmp12_;
			}
			_tmp8_ = _tmp10_;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			GDateTime* _tmp18_;
			GDateTime* _tmp19_;
			_tmp18_ = d;
			_tmp19_ = g_date_time_to_utc (_tmp18_);
			_g_date_time_unref0 (self->priv->_birthday);
			self->priv->_birthday = _tmp19_;
			g_object_notify ((GObject*) self, "birthday");
		}
		_g_date_time_unref0 (d);
	} else {
		GDateTime* _tmp20_;
		_tmp20_ = self->priv->_birthday;
		if (_tmp20_ != 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,
                            gboolean create_if_not_exist,
                            gboolean emit_notification)
{
	gboolean _tmp0_ = FALSE;
	FolksSmallSet* _tmp1_;
	FolksSmallSet* new_roles = NULL;
	FolksSmallSet* _tmp7_;
	FolksRoleFieldDetails* default_role_fd = NULL;
	FolksRoleFieldDetails* _tmp8_;
	FolksRoleFieldDetails* _tmp9_;
	EVCard* vcard = NULL;
	EContact* _tmp12_;
	EContact* _tmp13_;
	EVCard* _tmp14_;
	GList* _tmp15_;
	FolksSmallSet* _tmp50_;
	FolksSmallSet* _tmp51_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_roles;
	if (_tmp1_ == NULL) {
		_tmp0_ = create_if_not_exist == FALSE;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		if (emit_notification) {
			g_object_notify ((GObject*) self, "roles");
		}
		return;
	} else {
		FolksSmallSet* _tmp2_;
		_tmp2_ = self->priv->_roles;
		if (_tmp2_ == NULL) {
			FolksSmallSet* _tmp3_;
			FolksSmallSet* _tmp4_;
			GeeSet* _tmp5_;
			GeeSet* _tmp6_;
			_tmp3_ = folks_small_set_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
			_g_object_unref0 (self->priv->_roles);
			self->priv->_roles = _tmp3_;
			_tmp4_ = self->priv->_roles;
			_tmp5_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp4_);
			_tmp6_ = _tmp5_;
			_g_object_unref0 (self->priv->_roles_ro);
			self->priv->_roles_ro = _tmp6_;
		}
	}
	_tmp7_ = folks_small_set_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	new_roles = _tmp7_;
	_tmp8_ = _edsf_persona_get_default_role (self);
	default_role_fd = _tmp8_;
	_tmp9_ = default_role_fd;
	if (_tmp9_ != NULL) {
		FolksSmallSet* _tmp10_;
		FolksRoleFieldDetails* _tmp11_;
		_tmp10_ = new_roles;
		_tmp11_ = default_role_fd;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, FOLKS_TYPE_ROLE_FIELD_DETAILS, FolksRoleFieldDetails));
	}
	_tmp12_ = edsf_persona_get_contact (self);
	_tmp13_ = _tmp12_;
	vcard = G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, e_vcard_get_type (), EVCard);
	_tmp14_ = vcard;
	_tmp15_ = e_vcard_get_attributes (_tmp14_);
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp15_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				EVCardAttribute* _tmp16_;
				const gchar* _tmp17_;
				const gchar* val = NULL;
				EVCardAttribute* _tmp18_;
				const gchar* _tmp19_;
				gboolean _tmp20_ = FALSE;
				const gchar* _tmp21_;
				FolksRole* role = NULL;
				FolksRole* _tmp23_;
				FolksRole* _tmp24_;
				const gchar* _tmp25_;
				FolksRoleFieldDetails* role_fd = NULL;
				FolksRole* _tmp26_;
				FolksRoleFieldDetails* _tmp27_;
				EVCardAttribute* _tmp28_;
				GList* _tmp29_;
				FolksSmallSet* _tmp48_;
				FolksRoleFieldDetails* _tmp49_;
				_tmp16_ = attr;
				_tmp17_ = e_vcard_attribute_get_name (_tmp16_);
				if (g_strcmp0 (_tmp17_, "X-ROLES") != 0) {
					continue;
				}
				_tmp18_ = attr;
				_tmp19_ = edsf_persona_get_vcard_attr_value (self, _tmp18_);
				val = _tmp19_;
				_tmp21_ = val;
				if (_tmp21_ == NULL) {
					_tmp20_ = TRUE;
				} else {
					const gchar* _tmp22_;
					_tmp22_ = val;
					_tmp20_ = g_strcmp0 ((const gchar*) _tmp22_, "") == 0;
				}
				if (_tmp20_) {
					continue;
				}
				_tmp23_ = folks_role_new ("", "", NULL);
				role = _tmp23_;
				_tmp24_ = role;
				_tmp25_ = val;
				folks_role_set_role (_tmp24_, (const gchar*) _tmp25_);
				_tmp26_ = role;
				_tmp27_ = folks_role_field_details_new (_tmp26_, NULL);
				role_fd = _tmp27_;
				_tmp28_ = attr;
				_tmp29_ = e_vcard_attribute_get_params (_tmp28_);
				{
					GList* param_collection = NULL;
					GList* param_it = NULL;
					param_collection = _tmp29_;
					for (param_it = param_collection; param_it != NULL; param_it = param_it->next) {
						EVCardAttributeParam* param = NULL;
						param = (EVCardAttributeParam*) param_it->data;
						{
							gchar* param_name = NULL;
							EVCardAttributeParam* _tmp30_;
							const gchar* _tmp31_;
							gchar* _tmp32_;
							const gchar* _tmp33_;
							_tmp30_ = param;
							_tmp31_ = e_vcard_attribute_param_get_name (_tmp30_);
							_tmp32_ = g_utf8_strdown (_tmp31_, (gssize) -1);
							param_name = _tmp32_;
							_tmp33_ = param_name;
							if (g_strcmp0 (_tmp33_, "organisation_name") == 0) {
								EVCardAttributeParam* _tmp34_;
								GList* _tmp35_;
								_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_organisation_name (_tmp36_, _tmp37_);
											break;
										}
									}
								}
							} else {
								const gchar* _tmp38_;
								_tmp38_ = param_name;
								if (g_strcmp0 (_tmp38_, "title") == 0) {
									EVCardAttributeParam* _tmp39_;
									GList* _tmp40_;
									_tmp39_ = param;
									_tmp40_ = e_vcard_attribute_param_get_values (_tmp39_);
									{
										GList* param_value_collection = NULL;
										GList* param_value_it = NULL;
										param_value_collection = _tmp40_;
										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* _tmp41_;
												const gchar* _tmp42_;
												_tmp41_ = role;
												_tmp42_ = param_value;
												folks_role_set_title (_tmp41_, _tmp42_);
												break;
											}
										}
									}
								} else {
									EVCardAttributeParam* _tmp43_;
									GList* _tmp44_;
									_tmp43_ = param;
									_tmp44_ = e_vcard_attribute_param_get_values (_tmp43_);
									{
										GList* param_value_collection = NULL;
										GList* param_value_it = NULL;
										param_value_collection = _tmp44_;
										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* _tmp45_;
												const gchar* _tmp46_;
												const gchar* _tmp47_;
												_tmp45_ = role_fd;
												_tmp46_ = param_name;
												_tmp47_ = param_value;
												folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp45_, _tmp46_, _tmp47_);
											}
										}
									}
								}
							}
							_g_free0 (param_name);
						}
					}
				}
				_tmp48_ = new_roles;
				_tmp49_ = role_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp48_, _tmp49_);
				_g_object_unref0 (role_fd);
				_g_object_unref0 (role);
			}
		}
	}
	_tmp50_ = new_roles;
	_tmp51_ = self->priv->_roles;
	if (!folks_internal_equal_sets (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, (GeeSet*) _tmp50_, (GeeSet*) _tmp51_)) {
		FolksSmallSet* _tmp52_;
		FolksSmallSet* _tmp53_;
		FolksSmallSet* _tmp54_;
		GeeSet* _tmp55_;
		GeeSet* _tmp56_;
		_tmp52_ = new_roles;
		_tmp53_ = _g_object_ref0 (_tmp52_);
		_g_object_unref0 (self->priv->_roles);
		self->priv->_roles = _tmp53_;
		_tmp54_ = new_roles;
		_tmp55_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp54_);
		_tmp56_ = _tmp55_;
		_g_object_unref0 (self->priv->_roles_ro);
		self->priv->_roles_ro = _tmp56_;
		if (emit_notification) {
			g_object_notify ((GObject*) self, "roles");
		}
	}
	_g_object_unref0 (default_role_fd);
	_g_object_unref0 (new_roles);
}

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

static void
_edsf_persona_update_web_services_addresses (EdsfPersona* self)
{
	GeeHashMultiMap* new_services = NULL;
	GeeHashMultiMap* _tmp0_;
	EVCardAttribute* services = NULL;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EVCardAttribute* _tmp3_;
	EVCardAttribute* _tmp4_;
	GeeHashMultiMap* _tmp18_;
	GeeHashMultiMap* _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	new_services = _tmp0_;
	_tmp1_ = edsf_persona_get_contact (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = e_vcard_get_attribute ((EVCard*) _tmp2_, "X-FOLKS-WEB-SERVICES-IDS");
	services = _tmp3_;
	_tmp4_ = services;
	if (_tmp4_ != NULL) {
		EVCardAttribute* _tmp5_;
		GList* _tmp6_;
		_tmp5_ = services;
		_tmp6_ = e_vcard_attribute_get_params ((EVCardAttribute*) _tmp5_);
		{
			GList* service_collection = NULL;
			GList* service_it = NULL;
			service_collection = _tmp6_;
			for (service_it = service_collection; service_it != NULL; service_it = service_it->next) {
				EVCardAttributeParam* service = NULL;
				service = (EVCardAttributeParam*) service_it->data;
				{
					gchar* service_name = NULL;
					EVCardAttributeParam* _tmp7_;
					const gchar* _tmp8_;
					gchar* _tmp9_;
					EVCardAttributeParam* _tmp10_;
					GList* _tmp11_;
					_tmp7_ = service;
					_tmp8_ = e_vcard_attribute_param_get_name (_tmp7_);
					_tmp9_ = g_utf8_strdown (_tmp8_, (gssize) -1);
					service_name = _tmp9_;
					_tmp10_ = service;
					_tmp11_ = e_vcard_attribute_param_get_values (_tmp10_);
					{
						GList* service_id_collection = NULL;
						GList* service_id_it = NULL;
						service_id_collection = _tmp11_;
						for (service_id_it = service_id_collection; service_id_it != NULL; service_id_it = service_id_it->next) {
							const gchar* service_id = NULL;
							service_id = (const gchar*) service_id_it->data;
							{
								const gchar* _tmp12_;
								GeeHashMultiMap* _tmp13_;
								const gchar* _tmp14_;
								const gchar* _tmp15_;
								FolksWebServiceFieldDetails* _tmp16_;
								FolksWebServiceFieldDetails* _tmp17_;
								_tmp12_ = service_id;
								if (g_strcmp0 (_tmp12_, "") == 0) {
									continue;
								}
								_tmp13_ = new_services;
								_tmp14_ = service_name;
								_tmp15_ = service_id;
								_tmp16_ = folks_web_service_field_details_new (_tmp15_, NULL);
								_tmp17_ = _tmp16_;
								gee_multi_map_set ((GeeMultiMap*) _tmp13_, _tmp14_, _tmp17_);
								_g_object_unref0 (_tmp17_);
							}
						}
					}
					_g_free0 (service_name);
				}
			}
		}
	}
	_tmp18_ = new_services;
	_tmp19_ = self->priv->_web_service_addresses;
	if (!folks_utils_multi_map_str_afd_equal ((GeeMultiMap*) _tmp18_, (GeeMultiMap*) _tmp19_)) {
		GeeHashMultiMap* _tmp20_;
		GeeHashMultiMap* _tmp21_;
		_tmp20_ = new_services;
		_tmp21_ = _g_object_ref0 (_tmp20_);
		_g_object_unref0 (self->priv->_web_service_addresses);
		self->priv->_web_service_addresses = _tmp21_;
		g_object_notify ((GObject*) self, "web-service-addresses");
	}
	_g_object_unref0 (new_services);
}

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

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

static inline void
_g_list_free___vala_EVCardAttribute_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) __vala_EVCardAttribute_free0_);
}

static void
_edsf_persona_update_emails (EdsfPersona* self,
                             gboolean emit_notification)
{
	FolksSmallSet* new_email_addresses = NULL;
	FolksSmallSet* _tmp0_;
	GList* attrs = NULL;
	EContact* _tmp1_;
	EContact* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	FolksSmallSet* _tmp16_;
	FolksSmallSet* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = folks_small_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	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* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				const gchar* val = NULL;
				EVCardAttribute* _tmp5_;
				const gchar* _tmp6_;
				gboolean _tmp7_ = FALSE;
				const gchar* _tmp8_;
				FolksEmailFieldDetails* email_fd = NULL;
				const gchar* _tmp10_;
				FolksEmailFieldDetails* _tmp11_;
				FolksEmailFieldDetails* _tmp12_;
				EVCardAttribute* _tmp13_;
				FolksSmallSet* _tmp14_;
				FolksEmailFieldDetails* _tmp15_;
				_tmp5_ = attr;
				_tmp6_ = edsf_persona_get_vcard_attr_value (self, _tmp5_);
				val = _tmp6_;
				_tmp8_ = val;
				if (_tmp8_ == NULL) {
					_tmp7_ = TRUE;
				} else {
					const gchar* _tmp9_;
					_tmp9_ = val;
					_tmp7_ = g_strcmp0 ((const gchar*) _tmp9_, "") == 0;
				}
				if (_tmp7_) {
					continue;
				}
				_tmp10_ = val;
				_tmp11_ = folks_email_field_details_new ((const gchar*) _tmp10_, NULL);
				email_fd = _tmp11_;
				_tmp12_ = email_fd;
				_tmp13_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp12_, _tmp13_);
				_tmp14_ = new_email_addresses;
				_tmp15_ = email_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp14_, _tmp15_);
				_g_object_unref0 (email_fd);
			}
		}
	}
	_tmp16_ = new_email_addresses;
	_tmp17_ = self->priv->_email_addresses;
	if (!folks_internal_equal_sets (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, (GeeSet*) _tmp16_, (GeeSet*) _tmp17_)) {
		FolksSmallSet* _tmp18_;
		FolksSmallSet* _tmp19_;
		FolksSmallSet* _tmp20_;
		GeeSet* _tmp21_;
		GeeSet* _tmp22_;
		_tmp18_ = new_email_addresses;
		_tmp19_ = _g_object_ref0 (_tmp18_);
		_g_object_unref0 (self->priv->_email_addresses);
		self->priv->_email_addresses = _tmp19_;
		_tmp20_ = new_email_addresses;
		_tmp21_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp20_);
		_tmp22_ = _tmp21_;
		_g_object_unref0 (self->priv->_email_addresses_ro);
		self->priv->_email_addresses_ro = _tmp22_;
		if (emit_notification) {
			g_object_notify ((GObject*) self, "email-addresses");
		}
	}
	(attrs == NULL) ? NULL : (attrs = (_g_list_free___vala_EVCardAttribute_free0_ (attrs), NULL));
	_g_object_unref0 (new_email_addresses);
}

static void
_edsf_persona_update_notes (EdsfPersona* self,
                            gboolean create_if_not_exist,
                            gboolean emit_notification)
{
	gboolean _tmp0_ = FALSE;
	FolksSmallSet* _tmp1_;
	FolksSmallSet* new_notes = NULL;
	FolksSmallSet* _tmp7_;
	const gchar* n = NULL;
	const gchar* _tmp8_;
	gboolean _tmp9_ = FALSE;
	const gchar* _tmp10_;
	FolksSmallSet* _tmp16_;
	FolksSmallSet* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_notes;
	if (_tmp1_ == NULL) {
		_tmp0_ = create_if_not_exist == FALSE;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		if (emit_notification) {
			g_object_notify ((GObject*) self, "notes");
		}
		return;
	} else {
		FolksSmallSet* _tmp2_;
		_tmp2_ = self->priv->_notes;
		if (_tmp2_ == NULL) {
			FolksSmallSet* _tmp3_;
			FolksSmallSet* _tmp4_;
			GeeSet* _tmp5_;
			GeeSet* _tmp6_;
			_tmp3_ = folks_small_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
			_g_object_unref0 (self->priv->_notes);
			self->priv->_notes = _tmp3_;
			_tmp4_ = self->priv->_notes;
			_tmp5_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp4_);
			_tmp6_ = _tmp5_;
			_g_object_unref0 (self->priv->_notes_ro);
			self->priv->_notes_ro = _tmp6_;
		}
	}
	_tmp7_ = folks_small_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	new_notes = _tmp7_;
	_tmp8_ = _edsf_persona_get_string_property (self, "note");
	n = _tmp8_;
	_tmp10_ = n;
	if (_tmp10_ != NULL) {
		const gchar* _tmp11_;
		_tmp11_ = n;
		_tmp9_ = g_strcmp0 (_tmp11_, "") != 0;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		FolksNoteFieldDetails* note = NULL;
		const gchar* _tmp12_;
		FolksNoteFieldDetails* _tmp13_;
		FolksSmallSet* _tmp14_;
		FolksNoteFieldDetails* _tmp15_;
		_tmp12_ = n;
		_tmp13_ = folks_note_field_details_new ((const gchar*) _tmp12_, NULL, NULL);
		note = _tmp13_;
		_tmp14_ = new_notes;
		_tmp15_ = note;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp14_, _tmp15_);
		_g_object_unref0 (note);
	}
	_tmp16_ = new_notes;
	_tmp17_ = self->priv->_notes;
	if (!folks_internal_equal_sets (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, (GeeSet*) _tmp16_, (GeeSet*) _tmp17_)) {
		FolksSmallSet* _tmp18_;
		FolksSmallSet* _tmp19_;
		FolksSmallSet* _tmp20_;
		GeeSet* _tmp21_;
		GeeSet* _tmp22_;
		_tmp18_ = new_notes;
		_tmp19_ = _g_object_ref0 (_tmp18_);
		_g_object_unref0 (self->priv->_notes);
		self->priv->_notes = _tmp19_;
		_tmp20_ = self->priv->_notes;
		_tmp21_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp20_);
		_tmp22_ = _tmp21_;
		_g_object_unref0 (self->priv->_notes_ro);
		self->priv->_notes_ro = _tmp22_;
		if (emit_notification) {
			g_object_notify ((GObject*) self, "notes");
		}
	}
	_g_object_unref0 (new_notes);
}

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

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

static void
_edsf_persona_update_names (EdsfPersona* self)
{
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* full_name = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_;
	const gchar* nickname = NULL;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	FolksStructuredName* structured_name = NULL;
	EContactName* _cn = NULL;
	gpointer _tmp12_;
	EContactName* _tmp13_;
	gboolean _tmp31_ = FALSE;
	FolksStructuredName* _tmp32_;
	g_return_if_fail (self != NULL);
	_tmp1_ = _edsf_persona_get_string_property (self, "full_name");
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	full_name = _tmp0_;
	_tmp2_ = self->priv->_full_name;
	_tmp3_ = full_name;
	if (g_strcmp0 (_tmp2_, _tmp3_) != 0) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = full_name;
		_tmp5_ = g_strdup (_tmp4_);
		_g_free0 (self->priv->_full_name);
		self->priv->_full_name = _tmp5_;
		g_object_notify ((GObject*) self, "full-name");
	}
	_tmp7_ = _edsf_persona_get_string_property (self, "nickname");
	_tmp6_ = _tmp7_;
	if (_tmp6_ == NULL) {
		_tmp6_ = "";
	}
	nickname = _tmp6_;
	_tmp8_ = self->priv->_nickname;
	_tmp9_ = nickname;
	if (g_strcmp0 (_tmp8_, _tmp9_) != 0) {
		const gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp10_ = nickname;
		_tmp11_ = g_strdup (_tmp10_);
		_g_free0 (self->priv->_nickname);
		self->priv->_nickname = _tmp11_;
		g_object_notify ((GObject*) self, "nickname");
	}
	structured_name = NULL;
	_tmp12_ = _edsf_persona_get_property (self, e_contact_name_get_type (), (GBoxedCopyFunc) _vala_EContactName_copy, (GDestroyNotify) _vala_EContactName_free, "name");
	_cn = (EContactName*) _tmp12_;
	_tmp13_ = _cn;
	if (_tmp13_ != NULL) {
		EContactName* cn = NULL;
		EContactName* _tmp14_;
		const gchar* family_name = NULL;
		EContactName* _tmp15_;
		const gchar* _tmp16_;
		const gchar* given_name = NULL;
		EContactName* _tmp17_;
		const gchar* _tmp18_;
		const gchar* additional_names = NULL;
		EContactName* _tmp19_;
		const gchar* _tmp20_;
		const gchar* prefixes = NULL;
		EContactName* _tmp21_;
		const gchar* _tmp22_;
		const gchar* suffixes = NULL;
		EContactName* _tmp23_;
		const gchar* _tmp24_;
		const gchar* _tmp25_;
		const gchar* _tmp26_;
		const gchar* _tmp27_;
		const gchar* _tmp28_;
		const gchar* _tmp29_;
		FolksStructuredName* _tmp30_;
		_tmp14_ = _cn;
		cn = (EContactName*) _tmp14_;
		_tmp15_ = cn;
		_tmp16_ = _tmp15_->family;
		family_name = _tmp16_;
		_tmp17_ = cn;
		_tmp18_ = _tmp17_->given;
		given_name = _tmp18_;
		_tmp19_ = cn;
		_tmp20_ = _tmp19_->additional;
		additional_names = _tmp20_;
		_tmp21_ = cn;
		_tmp22_ = _tmp21_->prefixes;
		prefixes = _tmp22_;
		_tmp23_ = cn;
		_tmp24_ = _tmp23_->suffixes;
		suffixes = _tmp24_;
		_tmp25_ = family_name;
		_tmp26_ = given_name;
		_tmp27_ = additional_names;
		_tmp28_ = prefixes;
		_tmp29_ = suffixes;
		_tmp30_ = folks_structured_name_new (_tmp25_, _tmp26_, _tmp27_, _tmp28_, _tmp29_);
		_g_object_unref0 (structured_name);
		structured_name = _tmp30_;
	}
	_tmp32_ = structured_name;
	if (_tmp32_ != NULL) {
		FolksStructuredName* _tmp33_;
		_tmp33_ = structured_name;
		_tmp31_ = !folks_structured_name_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, FOLKS_TYPE_STRUCTURED_NAME, FolksStructuredName));
	} else {
		_tmp31_ = FALSE;
	}
	if (_tmp31_) {
		FolksStructuredName* _tmp34_;
		FolksStructuredName* _tmp35_;
		_tmp34_ = structured_name;
		_tmp35_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, FOLKS_TYPE_STRUCTURED_NAME, FolksStructuredName));
		_g_object_unref0 (self->priv->_structured_name);
		self->priv->_structured_name = _tmp35_;
		g_object_notify ((GObject*) self, "structured-name");
	} else {
		FolksStructuredName* _tmp36_;
		_tmp36_ = self->priv->_structured_name;
		if (_tmp36_ != 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);
}

static GLoadableIcon*
_edsf_persona_contact_photo_to_loadable_icon (EdsfPersona* self,
                                              EContactPhoto* _p)
{
	EContactPhoto* p = NULL;
	EContactPhoto* _tmp0_;
	GLoadableIcon* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (_p == NULL) {
		result = NULL;
		return result;
	}
	p = (EContactPhoto*) _p;
	_tmp0_ = p;
	switch (_tmp0_->type) {
		case E_CONTACT_PHOTO_TYPE_URI:
		{
			const gchar* uri = NULL;
			EContactPhoto* _tmp1_;
			const gchar* _tmp2_;
			const gchar* _tmp3_;
			gchar* scheme = NULL;
			const gchar* _tmp4_;
			gchar* _tmp5_;
			gboolean _tmp6_ = FALSE;
			const gchar* _tmp7_;
			const gchar* _tmp10_;
			GFile* _tmp11_;
			GFile* _tmp12_;
			GFileIcon* _tmp13_;
			GLoadableIcon* _tmp14_;
			_tmp1_ = p;
			_tmp2_ = e_contact_photo_get_uri (_tmp1_);
			uri = _tmp2_;
			_tmp3_ = uri;
			if (_tmp3_ == NULL) {
				result = NULL;
				return result;
			}
			_tmp4_ = uri;
			_tmp5_ = g_uri_parse_scheme (_tmp4_);
			scheme = _tmp5_;
			_tmp7_ = scheme;
			if (_tmp7_ == NULL) {
				_tmp6_ = TRUE;
			} else {
				const gchar* _tmp8_;
				_tmp8_ = scheme;
				_tmp6_ = g_strcmp0 (_tmp8_, "file") != 0;
			}
			if (_tmp6_) {
				const gchar* _tmp9_;
				_tmp9_ = uri;
				g_warning ("Ignoring contact photo with URI ‘%s’ because it’s " "not a local file.", _tmp9_);
				result = NULL;
				_g_free0 (scheme);
				return result;
			}
			_tmp10_ = uri;
			_tmp11_ = g_file_new_for_uri ((const gchar*) _tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = (GFileIcon*) g_file_icon_new (_tmp12_);
			_tmp14_ = (GLoadableIcon*) _tmp13_;
			_g_object_unref0 (_tmp12_);
			result = _tmp14_;
			_g_free0 (scheme);
			return result;
		}
		case E_CONTACT_PHOTO_TYPE_INLINED:
		{
			guint8* data = NULL;
			EContactPhoto* _tmp15_;
			gsize _tmp16_ = 0;
			guint8* _tmp17_;
			gint data_length1;
			gint _data_size_;
			const gchar* mime_type = NULL;
			EContactPhoto* _tmp18_;
			const gchar* _tmp19_;
			gboolean _tmp20_ = FALSE;
			guint8* _tmp21_;
			gint _tmp21__length1;
			GBytes* bytes = NULL;
			guint8* _tmp23_;
			gint _tmp23__length1;
			GBytes* _tmp24_;
			GBytes* _tmp25_;
			GBytesIcon* _tmp26_;
			_tmp15_ = p;
			_tmp17_ = e_contact_photo_get_inlined (_tmp15_, &_tmp16_);
			data = _tmp17_;
			data_length1 = _tmp16_;
			_data_size_ = data_length1;
			_tmp18_ = p;
			_tmp19_ = e_contact_photo_get_mime_type (_tmp18_);
			mime_type = _tmp19_;
			_tmp21_ = data;
			_tmp21__length1 = data_length1;
			if (_tmp21_ == NULL) {
				_tmp20_ = TRUE;
			} else {
				const gchar* _tmp22_;
				_tmp22_ = mime_type;
				_tmp20_ = _tmp22_ == NULL;
			}
			if (_tmp20_) {
				result = NULL;
				return result;
			}
			_tmp23_ = data;
			_tmp23__length1 = data_length1;
			_tmp24_ = g_bytes_new ((guint8*) _tmp23_, (_tmp23__length1 * sizeof (guint8)) / sizeof (guint8));
			bytes = _tmp24_;
			_tmp25_ = bytes;
			_tmp26_ = (GBytesIcon*) g_bytes_icon_new (_tmp25_);
			result = (GLoadableIcon*) _tmp26_;
			_g_bytes_unref0 (bytes);
			return result;
		}
		default:
		{
			result = NULL;
			return result;
		}
	}
}

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

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

static void
_edsf_persona_update_avatar (EdsfPersona* self)
{
	EContactPhoto* p = NULL;
	gpointer _tmp0_;
	GLoadableIcon* new_avatar = NULL;
	EContactPhoto* _tmp1_;
	GLoadableIcon* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GLoadableIcon* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _edsf_persona_get_property (self, e_contact_photo_get_type (), (GBoxedCopyFunc) _vala_EContactPhoto_copy, (GDestroyNotify) _vala_EContactPhoto_free, "photo");
	p = (EContactPhoto*) _tmp0_;
	_tmp1_ = p;
	_tmp2_ = _edsf_persona_contact_photo_to_loadable_icon (self, _tmp1_);
	new_avatar = _tmp2_;
	_tmp4_ = self->priv->_avatar;
	if (_tmp4_ != NULL) {
		GLoadableIcon* _tmp5_;
		_tmp5_ = new_avatar;
		_tmp3_ = _tmp5_ == NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_g_object_unref0 (self->priv->_avatar);
		self->priv->_avatar = NULL;
		g_object_notify ((GObject*) self, "avatar");
	} else {
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		GLoadableIcon* _tmp8_;
		_tmp8_ = self->priv->_avatar;
		if (_tmp8_ == NULL) {
			GLoadableIcon* _tmp9_;
			_tmp9_ = new_avatar;
			_tmp7_ = _tmp9_ != NULL;
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			_tmp6_ = TRUE;
		} else {
			gboolean _tmp10_ = FALSE;
			gboolean _tmp11_ = FALSE;
			GLoadableIcon* _tmp12_;
			_tmp12_ = self->priv->_avatar;
			if (_tmp12_ != NULL) {
				GLoadableIcon* _tmp13_;
				_tmp13_ = new_avatar;
				_tmp11_ = _tmp13_ != NULL;
			} else {
				_tmp11_ = FALSE;
			}
			if (_tmp11_) {
				GLoadableIcon* _tmp14_;
				GLoadableIcon* _tmp15_;
				_tmp14_ = self->priv->_avatar;
				_tmp15_ = new_avatar;
				_tmp10_ = g_icon_equal ((GIcon*) G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, g_loadable_icon_get_type (), GLoadableIcon), (GIcon*) _tmp15_) == FALSE;
			} else {
				_tmp10_ = FALSE;
			}
			_tmp6_ = _tmp10_;
		}
		if (_tmp6_) {
			GLoadableIcon* _tmp16_;
			GLoadableIcon* _tmp17_;
			_tmp16_ = new_avatar;
			_tmp17_ = _g_object_ref0 (_tmp16_);
			_g_object_unref0 (self->priv->_avatar);
			self->priv->_avatar = _tmp17_;
			g_object_notify ((GObject*) self, "avatar");
		}
	}
	_g_object_unref0 (new_avatar);
	__vala_EContactPhoto_free0 (p);
}

static void
_edsf_persona_update_urls (EdsfPersona* self,
                           gboolean create_if_not_exist,
                           gboolean emit_notification)
{
	gboolean _tmp0_ = FALSE;
	FolksSmallSet* _tmp1_;
	FolksSmallSet* new_urls = NULL;
	FolksSmallSet* _tmp7_;
	EVCard* vcard = NULL;
	EContact* _tmp23_;
	EContact* _tmp24_;
	EVCard* _tmp25_;
	GList* _tmp26_;
	FolksSmallSet* _tmp40_;
	FolksSmallSet* _tmp41_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_urls;
	if (_tmp1_ == NULL) {
		_tmp0_ = create_if_not_exist == FALSE;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		if (emit_notification) {
			g_object_notify ((GObject*) self, "urls");
		}
		return;
	} else {
		FolksSmallSet* _tmp2_;
		_tmp2_ = self->priv->_urls;
		if (_tmp2_ == NULL) {
			FolksSmallSet* _tmp3_;
			FolksSmallSet* _tmp4_;
			GeeSet* _tmp5_;
			GeeSet* _tmp6_;
			_tmp3_ = folks_small_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
			_g_object_unref0 (self->priv->_urls);
			self->priv->_urls = _tmp3_;
			_tmp4_ = self->priv->_urls;
			_tmp5_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp4_);
			_tmp6_ = _tmp5_;
			_g_object_unref0 (self->priv->_urls_ro);
			self->priv->_urls_ro = _tmp6_;
		}
	}
	_tmp7_ = folks_small_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	new_urls = _tmp7_;
	{
		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 < mapping_collection_length1; mapping_it = mapping_it + 1) {
			EdsfPersonaUrlTypeMapping mapping = {0};
			mapping = mapping_collection[mapping_it];
			{
				const gchar* url_property = NULL;
				EdsfPersonaUrlTypeMapping _tmp8_;
				const gchar* _tmp9_;
				const gchar* folks_type = NULL;
				EdsfPersonaUrlTypeMapping _tmp10_;
				const gchar* _tmp11_;
				const gchar* u = NULL;
				const gchar* _tmp12_;
				const gchar* _tmp13_;
				gboolean _tmp14_ = FALSE;
				const gchar* _tmp15_;
				_tmp8_ = mapping;
				_tmp9_ = _tmp8_.vcard_field_name;
				url_property = _tmp9_;
				_tmp10_ = mapping;
				_tmp11_ = _tmp10_.folks_type;
				folks_type = _tmp11_;
				_tmp12_ = url_property;
				_tmp13_ = _edsf_persona_get_string_property (self, _tmp12_);
				u = _tmp13_;
				_tmp15_ = u;
				if (_tmp15_ != NULL) {
					const gchar* _tmp16_;
					_tmp16_ = u;
					_tmp14_ = g_strcmp0 (_tmp16_, "") != 0;
				} else {
					_tmp14_ = FALSE;
				}
				if (_tmp14_) {
					FolksUrlFieldDetails* fd_u = NULL;
					const gchar* _tmp17_;
					FolksUrlFieldDetails* _tmp18_;
					FolksUrlFieldDetails* _tmp19_;
					const gchar* _tmp20_;
					FolksSmallSet* _tmp21_;
					FolksUrlFieldDetails* _tmp22_;
					_tmp17_ = u;
					_tmp18_ = folks_url_field_details_new ((const gchar*) _tmp17_, NULL);
					fd_u = _tmp18_;
					_tmp19_ = fd_u;
					_tmp20_ = folks_type;
					folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp19_, FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE, _tmp20_);
					_tmp21_ = new_urls;
					_tmp22_ = fd_u;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp21_, _tmp22_);
					_g_object_unref0 (fd_u);
				}
			}
		}
	}
	_tmp23_ = edsf_persona_get_contact (self);
	_tmp24_ = _tmp23_;
	vcard = G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, e_vcard_get_type (), EVCard);
	_tmp25_ = vcard;
	_tmp26_ = e_vcard_get_attributes (_tmp25_);
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp26_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				EVCardAttribute* _tmp27_;
				const gchar* _tmp28_;
				_tmp27_ = attr;
				_tmp28_ = e_vcard_attribute_get_name (_tmp27_);
				if (g_strcmp0 (_tmp28_, "X-URIS") == 0) {
					const gchar* val = NULL;
					EVCardAttribute* _tmp29_;
					const gchar* _tmp30_;
					gboolean _tmp31_ = FALSE;
					const gchar* _tmp32_;
					FolksUrlFieldDetails* url_fd = NULL;
					const gchar* _tmp34_;
					FolksUrlFieldDetails* _tmp35_;
					FolksUrlFieldDetails* _tmp36_;
					EVCardAttribute* _tmp37_;
					FolksSmallSet* _tmp38_;
					FolksUrlFieldDetails* _tmp39_;
					_tmp29_ = attr;
					_tmp30_ = edsf_persona_get_vcard_attr_value (self, _tmp29_);
					val = _tmp30_;
					_tmp32_ = val;
					if (_tmp32_ == NULL) {
						_tmp31_ = TRUE;
					} else {
						const gchar* _tmp33_;
						_tmp33_ = val;
						_tmp31_ = g_strcmp0 ((const gchar*) _tmp33_, "") == 0;
					}
					if (_tmp31_) {
						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);
				}
			}
		}
	}
	_tmp40_ = new_urls;
	_tmp41_ = self->priv->_urls;
	if (!folks_utils_set_afd_equal ((GeeSet*) _tmp40_, (GeeSet*) _tmp41_)) {
		FolksSmallSet* _tmp42_;
		FolksSmallSet* _tmp43_;
		FolksSmallSet* _tmp44_;
		GeeSet* _tmp45_;
		GeeSet* _tmp46_;
		_tmp42_ = new_urls;
		_tmp43_ = _g_object_ref0 (_tmp42_);
		_g_object_unref0 (self->priv->_urls);
		self->priv->_urls = _tmp43_;
		_tmp44_ = new_urls;
		_tmp45_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp44_);
		_tmp46_ = _tmp45_;
		_g_object_unref0 (self->priv->_urls_ro);
		self->priv->_urls_ro = _tmp46_;
		if (emit_notification) {
			g_object_notify ((GObject*) self, "urls");
		}
	}
	_g_object_unref0 (new_urls);
}

static void
_edsf_persona_update_im_addresses (EdsfPersona* self)
{
	GHashTable* im_eds_map = NULL;
	GHashTable* _tmp0_;
	GeeHashMultiMap* new_im_addresses = NULL;
	GeeHashMultiMap* _tmp1_;
	GHashTable* _tmp2_;
	GList* _tmp3_;
	GeeHashMultiMap* _tmp70_;
	GeeHashMultiMap* _tmp71_;
	GError* _inner_error0_ = 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, (GDestroyNotify) g_free, FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	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;
			{
				GList* addresses = NULL;
				EContact* _tmp4_;
				EContact* _tmp5_;
				GHashTable* _tmp6_;
				const gchar* _tmp7_;
				gconstpointer _tmp8_;
				GList* _tmp9_;
				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_, (EContactField) ((gintptr) _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* attr = NULL;
						attr = (EVCardAttribute*) attr_it->data;
						{
							{
								const gchar* addr = NULL;
								EVCardAttribute* _tmp11_;
								const gchar* _tmp12_;
								gboolean _tmp13_ = FALSE;
								const gchar* _tmp14_;
								gchar* normalised_addr = NULL;
								const gchar* _tmp16_;
								const gchar* _tmp17_;
								gchar* _tmp18_;
								const gchar* _tmp19_;
								FolksImFieldDetails* im_fd = NULL;
								const gchar* _tmp20_;
								FolksImFieldDetails* _tmp21_;
								GeeHashMultiMap* _tmp22_;
								const gchar* _tmp23_;
								FolksImFieldDetails* _tmp24_;
								_tmp11_ = attr;
								_tmp12_ = edsf_persona_get_vcard_attr_value (self, _tmp11_);
								addr = _tmp12_;
								_tmp14_ = addr;
								if (_tmp14_ == NULL) {
									_tmp13_ = TRUE;
								} else {
									const gchar* _tmp15_;
									_tmp15_ = addr;
									_tmp13_ = g_strcmp0 ((const gchar*) _tmp15_, "") == 0;
								}
								if (_tmp13_) {
									continue;
								}
								_tmp16_ = addr;
								_tmp17_ = im_proto;
								_tmp18_ = folks_im_details_normalise_im_address ((const gchar*) _tmp16_, _tmp17_, &_inner_error0_);
								normalised_addr = _tmp18_;
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									if (_inner_error0_->domain == FOLKS_IM_DETAILS_ERROR) {
										goto __catch0_folks_im_details_error;
									}
									(addresses == NULL) ? NULL : (addresses = (_g_list_free___vala_EVCardAttribute_free0_ (addresses), NULL));
									(im_proto_collection == NULL) ? NULL : (im_proto_collection = (g_list_free (im_proto_collection), NULL));
									_g_object_unref0 (new_im_addresses);
									g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
									g_clear_error (&_inner_error0_);
									return;
								}
								_tmp19_ = normalised_addr;
								if (g_strcmp0 (_tmp19_, "") == 0) {
									_g_free0 (normalised_addr);
									continue;
								}
								_tmp20_ = normalised_addr;
								_tmp21_ = folks_im_field_details_new (_tmp20_, NULL);
								im_fd = _tmp21_;
								_tmp22_ = new_im_addresses;
								_tmp23_ = im_proto;
								_tmp24_ = im_fd;
								gee_multi_map_set ((GeeMultiMap*) _tmp22_, _tmp23_, _tmp24_);
								_g_object_unref0 (im_fd);
								_g_free0 (normalised_addr);
							}
							goto __finally0;
							__catch0_folks_im_details_error:
							{
								GError* e = NULL;
								GError* _tmp25_;
								const gchar* _tmp26_;
								e = _inner_error0_;
								_inner_error0_ = NULL;
								_tmp25_ = e;
								_tmp26_ = _tmp25_->message;
								g_warning ("edsf-persona.vala:1708: Problem when trying to normalise address: %s\n", _tmp26_);
								_g_error_free0 (e);
							}
							__finally0:
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								(addresses == NULL) ? NULL : (addresses = (_g_list_free___vala_EVCardAttribute_free0_ (addresses), NULL));
								(im_proto_collection == NULL) ? NULL : (im_proto_collection = (g_list_free (im_proto_collection), NULL));
								_g_object_unref0 (new_im_addresses);
								g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
								g_clear_error (&_inner_error0_);
								return;
							}
						}
					}
				}
				(addresses == NULL) ? NULL : (addresses = (_g_list_free___vala_EVCardAttribute_free0_ (addresses), NULL));
			}
		}
		(im_proto_collection == NULL) ? NULL : (im_proto_collection = (g_list_free (im_proto_collection), NULL));
	}
	{
		FolksSmallSet* _email_list = NULL;
		FolksSmallSet* _tmp27_;
		gint _email_size = 0;
		FolksSmallSet* _tmp28_;
		gint _tmp29_;
		gint _tmp30_;
		gint _email_index = 0;
		_tmp27_ = self->priv->_email_addresses;
		_email_list = _tmp27_;
		_tmp28_ = _email_list;
		_tmp29_ = gee_collection_get_size ((GeeCollection*) _tmp28_);
		_tmp30_ = _tmp29_;
		_email_size = _tmp30_;
		_email_index = -1;
		while (TRUE) {
			gint _tmp31_;
			gint _tmp32_;
			FolksEmailFieldDetails* email = NULL;
			FolksSmallSet* _tmp33_;
			gconstpointer _tmp34_;
			FolksEmailFieldDetails* _tmp35_;
			const gchar* _proto = NULL;
			FolksEmailFieldDetails* _tmp36_;
			gconstpointer _tmp37_;
			gconstpointer _tmp38_;
			const gchar* _tmp39_;
			const gchar* _tmp40_;
			_email_index = _email_index + 1;
			_tmp31_ = _email_index;
			_tmp32_ = _email_size;
			if (!(_tmp31_ < _tmp32_)) {
				break;
			}
			_tmp33_ = _email_list;
			_tmp34_ = folks_small_set_get (_tmp33_, _email_index);
			_tmp35_ = _g_object_ref0 ((FolksEmailFieldDetails*) _tmp34_);
			email = _tmp35_;
			_tmp36_ = email;
			_tmp37_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp36_);
			_tmp38_ = _tmp37_;
			_tmp39_ = _edsf_persona_im_proto_from_addr (self, (const gchar*) _tmp38_);
			_proto = _tmp39_;
			_tmp40_ = _proto;
			if (_tmp40_ != NULL) {
				const gchar* proto = NULL;
				const gchar* _tmp41_;
				gboolean exists = FALSE;
				GeeCollection* current_im_addrs = NULL;
				GeeHashMultiMap* _tmp42_;
				const gchar* _tmp43_;
				GeeCollection* _tmp44_;
				GeeCollection* _tmp45_;
				_tmp41_ = _proto;
				proto = (const gchar*) _tmp41_;
				exists = FALSE;
				_tmp42_ = new_im_addresses;
				_tmp43_ = proto;
				_tmp44_ = gee_multi_map_get ((GeeMultiMap*) _tmp42_, _tmp43_);
				current_im_addrs = _tmp44_;
				_tmp45_ = current_im_addrs;
				if (_tmp45_ != NULL) {
					{
						GeeIterator* _cur_im_it = NULL;
						GeeCollection* _tmp46_;
						GeeIterator* _tmp47_;
						_tmp46_ = current_im_addrs;
						_tmp47_ = gee_iterable_iterator ((GeeIterable*) G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, GEE_TYPE_COLLECTION, GeeCollection));
						_cur_im_it = _tmp47_;
						while (TRUE) {
							GeeIterator* _tmp48_;
							FolksImFieldDetails* cur_im = NULL;
							GeeIterator* _tmp49_;
							gpointer _tmp50_;
							FolksImFieldDetails* _tmp51_;
							gconstpointer _tmp52_;
							gconstpointer _tmp53_;
							FolksEmailFieldDetails* _tmp54_;
							gconstpointer _tmp55_;
							gconstpointer _tmp56_;
							_tmp48_ = _cur_im_it;
							if (!gee_iterator_next (_tmp48_)) {
								break;
							}
							_tmp49_ = _cur_im_it;
							_tmp50_ = gee_iterator_get (_tmp49_);
							cur_im = (FolksImFieldDetails*) _tmp50_;
							_tmp51_ = cur_im;
							_tmp52_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp51_);
							_tmp53_ = _tmp52_;
							_tmp54_ = email;
							_tmp55_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp54_);
							_tmp56_ = _tmp55_;
							if (g_strcmp0 ((const gchar*) _tmp53_, (const gchar*) _tmp56_) == 0) {
								exists = TRUE;
								_g_object_unref0 (cur_im);
								break;
							}
							_g_object_unref0 (cur_im);
						}
						_g_object_unref0 (_cur_im_it);
					}
				}
				if (exists) {
					_g_object_unref0 (current_im_addrs);
					_g_object_unref0 (email);
					continue;
				}
				{
					gchar* normalised_addr = NULL;
					FolksEmailFieldDetails* _tmp57_;
					gconstpointer _tmp58_;
					gconstpointer _tmp59_;
					const gchar* _tmp60_;
					gchar* _tmp61_;
					FolksImFieldDetails* im_fd = NULL;
					const gchar* _tmp62_;
					FolksImFieldDetails* _tmp63_;
					FolksImFieldDetails* _tmp64_;
					GeeHashMultiMap* _tmp65_;
					const gchar* _tmp66_;
					FolksImFieldDetails* _tmp67_;
					_tmp57_ = email;
					_tmp58_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp57_);
					_tmp59_ = _tmp58_;
					_tmp60_ = proto;
					_tmp61_ = folks_im_details_normalise_im_address ((const gchar*) _tmp59_, _tmp60_, &_inner_error0_);
					normalised_addr = _tmp61_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == FOLKS_IM_DETAILS_ERROR) {
							goto __catch1_folks_im_details_error;
						}
						_g_object_unref0 (current_im_addrs);
						_g_object_unref0 (email);
						_g_object_unref0 (new_im_addresses);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
					_tmp62_ = normalised_addr;
					_tmp63_ = folks_im_field_details_new (_tmp62_, NULL);
					im_fd = _tmp63_;
					_tmp64_ = im_fd;
					folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp64_, EDSF_PERSONA_folks_field_attribute_name, "TRUE");
					_tmp65_ = new_im_addresses;
					_tmp66_ = proto;
					_tmp67_ = im_fd;
					gee_multi_map_set ((GeeMultiMap*) _tmp65_, _tmp66_, _tmp67_);
					_g_object_unref0 (im_fd);
					_g_free0 (normalised_addr);
				}
				goto __finally1;
				__catch1_folks_im_details_error:
				{
					GError* e = NULL;
					GError* _tmp68_;
					const gchar* _tmp69_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp68_ = e;
					_tmp69_ = _tmp68_->message;
					g_warning ("edsf-persona.vala:1765: Problem when trying to normalise address: %s\n", _tmp69_);
					_g_error_free0 (e);
				}
				__finally1:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (current_im_addrs);
					_g_object_unref0 (email);
					_g_object_unref0 (new_im_addresses);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
				_g_object_unref0 (current_im_addrs);
			}
			_g_object_unref0 (email);
		}
	}
	_tmp70_ = new_im_addresses;
	_tmp71_ = self->priv->_im_addresses;
	if (!folks_utils_multi_map_str_afd_equal ((GeeMultiMap*) _tmp70_, (GeeMultiMap*) _tmp71_)) {
		GeeHashMultiMap* _tmp72_;
		GeeHashMultiMap* _tmp73_;
		_tmp72_ = new_im_addresses;
		_tmp73_ = _g_object_ref0 (_tmp72_);
		_g_object_unref0 (self->priv->_im_addresses);
		self->priv->_im_addresses = _tmp73_;
		g_object_notify ((GObject*) self, "im-addresses");
	}
	_g_object_unref0 (new_im_addresses);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static inline void
_g_list_free__g_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_free0_);
}

static void
_edsf_persona_update_groups (EdsfPersona* self,
                             gboolean create_if_not_exist,
                             gboolean emit_notification)
{
	gboolean _tmp0_ = FALSE;
	FolksSmallSet* _tmp1_;
	GList* category_names = NULL;
	EContact* _tmp2_;
	gpointer _tmp3_;
	FolksSmallSet* new_categories = NULL;
	FolksSmallSet* _tmp4_;
	gboolean any_added_categories = FALSE;
	GList* _tmp5_;
	gboolean any_removed_categories = FALSE;
	FolksSmallSet* _tmp16_;
	FolksSmallSet* _tmp32_;
	FolksSmallSet* _tmp33_;
	FolksSmallSet* _tmp34_;
	GeeSet* _tmp35_;
	GeeSet* _tmp36_;
	EdsfPersonaStore* store = NULL;
	FolksPersonaStore* _tmp37_;
	FolksPersonaStore* _tmp38_;
	gboolean in_google_personal_group = FALSE;
	gboolean should_notify_sysgroups = FALSE;
	EdsfPersonaStore* _tmp39_;
	gboolean old_is_favourite = FALSE;
	EdsfPersonaStore* _tmp78_;
	gboolean _tmp81_ = FALSE;
	gboolean _tmp82_ = FALSE;
	gboolean _tmp83_ = FALSE;
	gboolean _tmp84_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_groups;
	if (_tmp1_ == NULL) {
		_tmp0_ = create_if_not_exist == FALSE;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		if (emit_notification) {
			g_object_notify ((GObject*) self, "groups");
		}
		return;
	}
	_tmp2_ = self->priv->_contact;
	_tmp3_ = e_contact_get (_tmp2_, E_CONTACT_CATEGORY_LIST);
	category_names = (GList*) _tmp3_;
	_tmp4_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	new_categories = _tmp4_;
	any_added_categories = FALSE;
	_tmp5_ = category_names;
	{
		GList* category_name_collection = NULL;
		GList* category_name_it = NULL;
		category_name_collection = _tmp5_;
		for (category_name_it = category_name_collection; category_name_it != NULL; category_name_it = category_name_it->next) {
			const gchar* category_name = NULL;
			category_name = (const gchar*) category_name_it->data;
			{
				gboolean _tmp6_ = FALSE;
				FolksPersonaStore* _tmp7_;
				FolksPersonaStore* _tmp8_;
				FolksSmallSet* _tmp10_;
				const gchar* _tmp11_;
				gboolean _tmp12_ = FALSE;
				FolksSmallSet* _tmp13_;
				_tmp7_ = folks_persona_get_store ((FolksPersona*) self);
				_tmp8_ = _tmp7_;
				if (_edsf_persona_store_is_google_contacts_address_book (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore))) {
					const gchar* _tmp9_;
					_tmp9_ = category_name;
					_tmp6_ = g_strcmp0 (_tmp9_, EDSF_PERSONA_STORE_android_favourite_group_name) == 0;
				} else {
					_tmp6_ = FALSE;
				}
				if (_tmp6_) {
					continue;
				}
				_tmp10_ = new_categories;
				_tmp11_ = category_name;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, _tmp11_);
				_tmp13_ = self->priv->_groups;
				if (_tmp13_ == NULL) {
					_tmp12_ = TRUE;
				} else {
					FolksSmallSet* _tmp14_;
					const gchar* _tmp15_;
					_tmp14_ = self->priv->_groups;
					_tmp15_ = category_name;
					_tmp12_ = !gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp14_, _tmp15_);
				}
				if (_tmp12_) {
					any_added_categories = TRUE;
				}
			}
		}
	}
	any_removed_categories = FALSE;
	_tmp16_ = self->priv->_groups;
	if (_tmp16_ != NULL) {
		{
			FolksSmallSet* _category_name_list = NULL;
			FolksSmallSet* _tmp17_;
			gint _category_name_size = 0;
			FolksSmallSet* _tmp18_;
			gint _tmp19_;
			gint _tmp20_;
			gint _category_name_index = 0;
			_tmp17_ = self->priv->_groups;
			_category_name_list = _tmp17_;
			_tmp18_ = _category_name_list;
			_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
			_tmp20_ = _tmp19_;
			_category_name_size = _tmp20_;
			_category_name_index = -1;
			while (TRUE) {
				gint _tmp21_;
				gint _tmp22_;
				gchar* category_name = NULL;
				FolksSmallSet* _tmp23_;
				gconstpointer _tmp24_;
				gchar* _tmp25_;
				gboolean _tmp26_ = FALSE;
				FolksPersonaStore* _tmp27_;
				FolksPersonaStore* _tmp28_;
				FolksSmallSet* _tmp30_;
				const gchar* _tmp31_;
				_category_name_index = _category_name_index + 1;
				_tmp21_ = _category_name_index;
				_tmp22_ = _category_name_size;
				if (!(_tmp21_ < _tmp22_)) {
					break;
				}
				_tmp23_ = _category_name_list;
				_tmp24_ = folks_small_set_get (_tmp23_, _category_name_index);
				_tmp25_ = g_strdup ((const gchar*) _tmp24_);
				category_name = _tmp25_;
				_tmp27_ = folks_persona_get_store ((FolksPersona*) self);
				_tmp28_ = _tmp27_;
				if (_edsf_persona_store_is_google_contacts_address_book (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore))) {
					const gchar* _tmp29_;
					_tmp29_ = category_name;
					_tmp26_ = g_strcmp0 (_tmp29_, EDSF_PERSONA_STORE_android_favourite_group_name) == 0;
				} else {
					_tmp26_ = FALSE;
				}
				if (_tmp26_) {
					_g_free0 (category_name);
					continue;
				}
				_tmp30_ = new_categories;
				_tmp31_ = category_name;
				if (!gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp30_, _tmp31_)) {
					any_removed_categories = TRUE;
				}
				_g_free0 (category_name);
			}
		}
	}
	_tmp32_ = new_categories;
	_tmp33_ = _g_object_ref0 (_tmp32_);
	_g_object_unref0 (self->priv->_groups);
	self->priv->_groups = _tmp33_;
	_tmp34_ = self->priv->_groups;
	_tmp35_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp34_);
	_tmp36_ = _tmp35_;
	_g_object_unref0 (self->priv->_groups_ro);
	self->priv->_groups_ro = _tmp36_;
	_tmp37_ = folks_persona_get_store ((FolksPersona*) self);
	_tmp38_ = _tmp37_;
	store = G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore);
	in_google_personal_group = FALSE;
	should_notify_sysgroups = FALSE;
	_tmp39_ = store;
	if (_edsf_persona_store_is_google_contacts_address_book (_tmp39_)) {
		EVCard* vcard = NULL;
		EContact* _tmp40_;
		EContact* _tmp41_;
		EVCardAttribute* attr = NULL;
		EVCard* _tmp42_;
		EVCardAttribute* _tmp43_;
		EVCardAttribute* _tmp44_;
		_tmp40_ = edsf_persona_get_contact (self);
		_tmp41_ = _tmp40_;
		vcard = G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, e_vcard_get_type (), EVCard);
		_tmp42_ = vcard;
		_tmp43_ = e_vcard_get_attribute (_tmp42_, "X-GOOGLE-SYSTEM-GROUP-IDS");
		attr = _tmp43_;
		_tmp44_ = attr;
		if (_tmp44_ != NULL) {
			GList* system_group_ids = NULL;
			EVCardAttribute* _tmp45_;
			GList* _tmp46_;
			FolksSmallSet* new_sysgroups = NULL;
			FolksSmallSet* _tmp47_;
			gboolean any_added_sysgroups = FALSE;
			GList* _tmp48_;
			gboolean any_removed_sysgroups = FALSE;
			FolksSmallSet* _tmp55_;
			FolksSmallSet* _tmp67_;
			FolksSmallSet* _tmp68_;
			FolksSmallSet* _tmp69_;
			FolksSmallSet* _tmp70_;
			GeeSet* _tmp71_;
			GeeSet* _tmp72_;
			gboolean _tmp73_ = FALSE;
			_tmp45_ = attr;
			_tmp46_ = e_vcard_attribute_get_values (_tmp45_);
			system_group_ids = _tmp46_;
			_tmp47_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
			new_sysgroups = _tmp47_;
			any_added_sysgroups = FALSE;
			_tmp48_ = system_group_ids;
			{
				GList* system_group_id_collection = NULL;
				GList* system_group_id_it = NULL;
				system_group_id_collection = _tmp48_;
				for (system_group_id_it = system_group_id_collection; system_group_id_it != NULL; system_group_id_it = system_group_id_it->next) {
					const gchar* system_group_id = NULL;
					system_group_id = (const gchar*) system_group_id_it->data;
					{
						FolksSmallSet* _tmp49_;
						const gchar* _tmp50_;
						gboolean _tmp51_ = FALSE;
						FolksSmallSet* _tmp52_;
						_tmp49_ = new_sysgroups;
						_tmp50_ = system_group_id;
						gee_abstract_collection_add ((GeeAbstractCollection*) _tmp49_, _tmp50_);
						_tmp52_ = self->priv->_system_groups;
						if (_tmp52_ == NULL) {
							_tmp51_ = TRUE;
						} else {
							FolksSmallSet* _tmp53_;
							const gchar* _tmp54_;
							_tmp53_ = self->priv->_system_groups;
							_tmp54_ = system_group_id;
							_tmp51_ = !gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp53_, _tmp54_);
						}
						if (_tmp51_) {
							any_added_sysgroups = TRUE;
						}
					}
				}
			}
			any_removed_sysgroups = FALSE;
			_tmp55_ = self->priv->_system_groups;
			if (_tmp55_ != NULL) {
				{
					FolksSmallSet* _system_group_id_list = NULL;
					FolksSmallSet* _tmp56_;
					gint _system_group_id_size = 0;
					FolksSmallSet* _tmp57_;
					gint _tmp58_;
					gint _tmp59_;
					gint _system_group_id_index = 0;
					_tmp56_ = self->priv->_system_groups;
					_system_group_id_list = _tmp56_;
					_tmp57_ = _system_group_id_list;
					_tmp58_ = gee_collection_get_size ((GeeCollection*) _tmp57_);
					_tmp59_ = _tmp58_;
					_system_group_id_size = _tmp59_;
					_system_group_id_index = -1;
					while (TRUE) {
						gint _tmp60_;
						gint _tmp61_;
						gchar* system_group_id = NULL;
						FolksSmallSet* _tmp62_;
						gconstpointer _tmp63_;
						gchar* _tmp64_;
						FolksSmallSet* _tmp65_;
						const gchar* _tmp66_;
						_system_group_id_index = _system_group_id_index + 1;
						_tmp60_ = _system_group_id_index;
						_tmp61_ = _system_group_id_size;
						if (!(_tmp60_ < _tmp61_)) {
							break;
						}
						_tmp62_ = _system_group_id_list;
						_tmp63_ = folks_small_set_get (_tmp62_, _system_group_id_index);
						_tmp64_ = g_strdup ((const gchar*) _tmp63_);
						system_group_id = _tmp64_;
						_tmp65_ = new_sysgroups;
						_tmp66_ = system_group_id;
						if (!gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp65_, _tmp66_)) {
							any_removed_sysgroups = TRUE;
						}
						_g_free0 (system_group_id);
					}
				}
			}
			_tmp67_ = new_sysgroups;
			if (gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp67_, EDSF_PERSONA_GOOGLE_PERSONAL_GROUP_NAME)) {
				in_google_personal_group = TRUE;
			}
			_tmp68_ = new_sysgroups;
			_tmp69_ = _g_object_ref0 (_tmp68_);
			_g_object_unref0 (self->priv->_system_groups);
			self->priv->_system_groups = _tmp69_;
			_tmp70_ = new_sysgroups;
			_tmp71_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp70_);
			_tmp72_ = _tmp71_;
			_g_object_unref0 (self->priv->_system_groups_ro);
			self->priv->_system_groups_ro = _tmp72_;
			if (any_added_sysgroups) {
				_tmp73_ = TRUE;
			} else {
				_tmp73_ = any_removed_sysgroups;
			}
			if (_tmp73_) {
				should_notify_sysgroups = TRUE;
			}
			_g_object_unref0 (new_sysgroups);
		} else {
			FolksSmallSet* _tmp74_;
			FolksSmallSet* _tmp75_;
			GeeSet* _tmp76_;
			GeeSet* _tmp77_;
			_tmp74_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
			_g_object_unref0 (self->priv->_system_groups);
			self->priv->_system_groups = _tmp74_;
			_tmp75_ = self->priv->_system_groups;
			_tmp76_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp75_);
			_tmp77_ = _tmp76_;
			_g_object_unref0 (self->priv->_system_groups_ro);
			self->priv->_system_groups_ro = _tmp77_;
		}
	}
	old_is_favourite = self->priv->_is_favourite;
	_tmp78_ = store;
	if (_edsf_persona_store_is_google_contacts_address_book (_tmp78_)) {
		GList* _tmp79_;
		self->priv->_is_favourite = FALSE;
		_tmp79_ = category_names;
		{
			GList* category_name_collection = NULL;
			GList* category_name_it = NULL;
			category_name_collection = _tmp79_;
			for (category_name_it = category_name_collection; category_name_it != NULL; category_name_it = category_name_it->next) {
				const gchar* category_name = NULL;
				category_name = (const gchar*) category_name_it->data;
				{
					const gchar* _tmp80_;
					_tmp80_ = category_name;
					if (g_strcmp0 (_tmp80_, EDSF_PERSONA_STORE_android_favourite_group_name) == 0) {
						self->priv->_is_favourite = TRUE;
					}
				}
			}
		}
	}
	g_object_freeze_notify ((GObject*) self);
	if (any_added_categories) {
		_tmp82_ = TRUE;
	} else {
		_tmp82_ = any_removed_categories;
	}
	if (_tmp82_) {
		_tmp81_ = emit_notification;
	} else {
		_tmp81_ = FALSE;
	}
	if (_tmp81_) {
		g_object_notify ((GObject*) self, "groups");
	}
	if (should_notify_sysgroups) {
		_tmp83_ = emit_notification;
	} else {
		_tmp83_ = FALSE;
	}
	if (_tmp83_) {
		g_object_notify ((GObject*) self, "system-groups");
	}
	if (self->priv->_is_favourite != old_is_favourite) {
		_tmp84_ = emit_notification;
	} else {
		_tmp84_ = FALSE;
	}
	if (_tmp84_) {
		g_object_notify ((GObject*) self, "is-favourite");
	}
	if (in_google_personal_group != self->priv->_in_google_personal_group) {
		self->priv->_in_google_personal_group = in_google_personal_group;
		if (emit_notification) {
			g_object_notify ((GObject*) self, "in-google-personal-group");
		}
	}
	g_object_thaw_notify ((GObject*) self);
	_g_object_unref0 (new_categories);
	(category_names == NULL) ? NULL : (category_names = (_g_list_free__g_free0_ (category_names), NULL));
}

/**
   * build a table of im protocols / im protocol aliases
   */
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* _tmp0_;
	GHashTable* _tmp14_;
	GHashTable* result;
	_tmp0_ = edsf_persona__im_eds_map;
	if (_tmp0_ == NULL) {
		GHashTable* table = NULL;
		GHashFunc _tmp1_;
		GEqualFunc _tmp2_;
		GHashTable* _tmp3_;
		GHashTable* _tmp4_;
		GHashTable* _tmp5_;
		GHashTable* _tmp6_;
		GHashTable* _tmp7_;
		GHashTable* _tmp8_;
		GHashTable* _tmp9_;
		GHashTable* _tmp10_;
		GHashTable* _tmp11_;
		GHashTable* _tmp12_;
		GHashTable* _tmp13_;
		_tmp1_ = g_str_hash;
		_tmp2_ = g_str_equal;
		_tmp3_ = g_hash_table_new_full (_tmp1_, _tmp2_, NULL, NULL);
		table = _tmp3_;
		_tmp4_ = table;
		g_hash_table_insert (_tmp4_, "aim", (gpointer) ((gintptr) E_CONTACT_IM_AIM));
		_tmp5_ = table;
		g_hash_table_insert (_tmp5_, "yahoo", (gpointer) ((gintptr) E_CONTACT_IM_YAHOO));
		_tmp6_ = table;
		g_hash_table_insert (_tmp6_, "groupwise", (gpointer) ((gintptr) E_CONTACT_IM_GROUPWISE));
		_tmp7_ = table;
		g_hash_table_insert (_tmp7_, "jabber", (gpointer) ((gintptr) E_CONTACT_IM_JABBER));
		_tmp8_ = table;
		g_hash_table_insert (_tmp8_, "msn", (gpointer) ((gintptr) E_CONTACT_IM_MSN));
		_tmp9_ = table;
		g_hash_table_insert (_tmp9_, "icq", (gpointer) ((gintptr) E_CONTACT_IM_ICQ));
		_tmp10_ = table;
		g_hash_table_insert (_tmp10_, "gadugadu", (gpointer) ((gintptr) E_CONTACT_IM_GADUGADU));
		_tmp11_ = table;
		g_hash_table_insert (_tmp11_, "skype", (gpointer) ((gintptr) E_CONTACT_IM_SKYPE));
		_tmp12_ = table;
		_tmp13_ = _g_hash_table_ref0 (_tmp12_);
		_g_hash_table_unref0 (edsf_persona__im_eds_map);
		edsf_persona__im_eds_map = _tmp13_;
		_g_hash_table_unref0 (table);
	}
	_tmp14_ = edsf_persona__im_eds_map;
	result = (GHashTable*) _tmp14_;
	return result;
}

static void
_edsf_persona_update_phones (EdsfPersona* self,
                             gboolean create_if_not_exist,
                             gboolean emit_notification)
{
	gboolean _tmp0_ = FALSE;
	FolksSmallSet* _tmp1_;
	FolksSmallSet* new_phone_numbers = NULL;
	FolksSmallSet* _tmp7_;
	GList* attrs = NULL;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GList* _tmp10_;
	GList* _tmp11_;
	FolksSmallSet* _tmp23_;
	FolksSmallSet* _tmp24_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_phone_numbers;
	if (_tmp1_ == NULL) {
		_tmp0_ = create_if_not_exist == FALSE;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		g_object_notify ((GObject*) self, "phone-numbers");
		return;
	} else {
		FolksSmallSet* _tmp2_;
		_tmp2_ = self->priv->_phone_numbers;
		if (_tmp2_ == NULL) {
			FolksSmallSet* _tmp3_;
			FolksSmallSet* _tmp4_;
			GeeSet* _tmp5_;
			GeeSet* _tmp6_;
			_tmp3_ = folks_small_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
			_g_object_unref0 (self->priv->_phone_numbers);
			self->priv->_phone_numbers = _tmp3_;
			_tmp4_ = self->priv->_phone_numbers;
			_tmp5_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp4_);
			_tmp6_ = _tmp5_;
			_g_object_unref0 (self->priv->_phone_numbers_ro);
			self->priv->_phone_numbers_ro = _tmp6_;
		}
	}
	_tmp7_ = folks_small_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	new_phone_numbers = _tmp7_;
	_tmp8_ = edsf_persona_get_contact (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = e_contact_get_attributes (_tmp9_, E_CONTACT_TEL);
	attrs = _tmp10_;
	_tmp11_ = attrs;
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp11_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				const gchar* val = NULL;
				EVCardAttribute* _tmp12_;
				const gchar* _tmp13_;
				gboolean _tmp14_ = FALSE;
				const gchar* _tmp15_;
				FolksPhoneFieldDetails* phone_fd = NULL;
				const gchar* _tmp17_;
				FolksPhoneFieldDetails* _tmp18_;
				FolksPhoneFieldDetails* _tmp19_;
				EVCardAttribute* _tmp20_;
				FolksSmallSet* _tmp21_;
				FolksPhoneFieldDetails* _tmp22_;
				_tmp12_ = attr;
				_tmp13_ = edsf_persona_get_vcard_attr_value (self, _tmp12_);
				val = _tmp13_;
				_tmp15_ = val;
				if (_tmp15_ == NULL) {
					_tmp14_ = TRUE;
				} else {
					const gchar* _tmp16_;
					_tmp16_ = val;
					_tmp14_ = g_strcmp0 ((const gchar*) _tmp16_, "") == 0;
				}
				if (_tmp14_) {
					continue;
				}
				_tmp17_ = val;
				_tmp18_ = folks_phone_field_details_new ((const gchar*) _tmp17_, NULL);
				phone_fd = _tmp18_;
				_tmp19_ = phone_fd;
				_tmp20_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp19_, _tmp20_);
				_tmp21_ = new_phone_numbers;
				_tmp22_ = phone_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp21_, _tmp22_);
				_g_object_unref0 (phone_fd);
			}
		}
	}
	_tmp23_ = self->priv->_phone_numbers;
	_tmp24_ = new_phone_numbers;
	if (!folks_utils_set_string_afd_equal ((GeeSet*) _tmp23_, (GeeSet*) _tmp24_)) {
		FolksSmallSet* _tmp25_;
		FolksSmallSet* _tmp26_;
		FolksSmallSet* _tmp27_;
		GeeSet* _tmp28_;
		GeeSet* _tmp29_;
		_tmp25_ = new_phone_numbers;
		_tmp26_ = _g_object_ref0 (_tmp25_);
		_g_object_unref0 (self->priv->_phone_numbers);
		self->priv->_phone_numbers = _tmp26_;
		_tmp27_ = new_phone_numbers;
		_tmp28_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp27_);
		_tmp29_ = _tmp28_;
		_g_object_unref0 (self->priv->_phone_numbers_ro);
		self->priv->_phone_numbers_ro = _tmp29_;
		if (emit_notification) {
			g_object_notify ((GObject*) self, "phone-numbers");
		}
	}
	(attrs == NULL) ? NULL : (attrs = (_g_list_free___vala_EVCardAttribute_free0_ (attrs), NULL));
	_g_object_unref0 (new_phone_numbers);
}

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

static void
_edsf_persona_update_addresses (EdsfPersona* self,
                                gboolean create_if_not_exist,
                                gboolean emit_notification)
{
	gboolean _tmp0_ = FALSE;
	FolksSmallSet* _tmp1_;
	FolksSmallSet* new_postal_addresses = NULL;
	FolksSmallSet* _tmp7_;
	GList* attrs = NULL;
	EContact* _tmp8_;
	EContact* _tmp9_;
	GList* _tmp10_;
	GList* _tmp11_;
	FolksSmallSet* _tmp21_;
	FolksSmallSet* _tmp22_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_postal_addresses;
	if (_tmp1_ == NULL) {
		_tmp0_ = create_if_not_exist == FALSE;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		if (emit_notification) {
			g_object_notify ((GObject*) self, "postal-addresses");
		}
		return;
	} else {
		FolksSmallSet* _tmp2_;
		_tmp2_ = self->priv->_postal_addresses;
		if (_tmp2_ == NULL) {
			FolksSmallSet* _tmp3_;
			FolksSmallSet* _tmp4_;
			GeeSet* _tmp5_;
			GeeSet* _tmp6_;
			_tmp3_ = folks_small_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
			_g_object_unref0 (self->priv->_postal_addresses);
			self->priv->_postal_addresses = _tmp3_;
			_tmp4_ = self->priv->_postal_addresses;
			_tmp5_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp4_);
			_tmp6_ = _tmp5_;
			_g_object_unref0 (self->priv->_postal_addresses_ro);
			self->priv->_postal_addresses_ro = _tmp6_;
		}
	}
	_tmp7_ = folks_small_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	new_postal_addresses = _tmp7_;
	_tmp8_ = edsf_persona_get_contact (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = e_contact_get_attributes (_tmp9_, E_CONTACT_ADDRESS);
	attrs = _tmp10_;
	_tmp11_ = attrs;
	{
		GList* attr_collection = NULL;
		GList* attr_it = NULL;
		attr_collection = _tmp11_;
		for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
			EVCardAttribute* attr = NULL;
			attr = (EVCardAttribute*) attr_it->data;
			{
				FolksPostalAddress* address = NULL;
				EVCardAttribute* _tmp12_;
				FolksPostalAddress* _tmp13_;
				FolksPostalAddress* _tmp14_;
				FolksPostalAddressFieldDetails* pa_fd = NULL;
				FolksPostalAddress* _tmp15_;
				FolksPostalAddressFieldDetails* _tmp16_;
				FolksPostalAddressFieldDetails* _tmp17_;
				EVCardAttribute* _tmp18_;
				FolksSmallSet* _tmp19_;
				FolksPostalAddressFieldDetails* _tmp20_;
				_tmp12_ = attr;
				_tmp13_ = _edsf_persona_postal_address_from_attribute (self, _tmp12_);
				address = _tmp13_;
				_tmp14_ = address;
				if (folks_postal_address_is_empty (_tmp14_)) {
					_g_object_unref0 (address);
					continue;
				}
				_tmp15_ = address;
				_tmp16_ = folks_postal_address_field_details_new (_tmp15_, NULL);
				pa_fd = _tmp16_;
				_tmp17_ = pa_fd;
				_tmp18_ = attr;
				_edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp17_, _tmp18_);
				_tmp19_ = new_postal_addresses;
				_tmp20_ = pa_fd;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, _tmp20_);
				_g_object_unref0 (pa_fd);
				_g_object_unref0 (address);
			}
		}
	}
	_tmp21_ = new_postal_addresses;
	_tmp22_ = self->priv->_postal_addresses;
	if (!folks_internal_equal_sets (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, (GeeSet*) _tmp21_, (GeeSet*) _tmp22_)) {
		FolksSmallSet* _tmp23_;
		FolksSmallSet* _tmp24_;
		FolksSmallSet* _tmp25_;
		GeeSet* _tmp26_;
		GeeSet* _tmp27_;
		_tmp23_ = new_postal_addresses;
		_tmp24_ = _g_object_ref0 (_tmp23_);
		_g_object_unref0 (self->priv->_postal_addresses);
		self->priv->_postal_addresses = _tmp24_;
		_tmp25_ = new_postal_addresses;
		_tmp26_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp25_);
		_tmp27_ = _tmp26_;
		_g_object_unref0 (self->priv->_postal_addresses_ro);
		self->priv->_postal_addresses_ro = _tmp27_;
		if (emit_notification) {
			g_object_notify ((GObject*) self, "postal-addresses");
		}
	}
	(attrs == NULL) ? NULL : (attrs = (_g_list_free___vala_EVCardAttribute_free0_ (attrs), NULL));
	_g_object_unref0 (new_postal_addresses);
}

static void
_edsf_persona_update_local_ids (EdsfPersona* self)
{
	FolksSmallSet* new_local_ids = NULL;
	FolksSmallSet* _tmp0_;
	EVCardAttribute* ids = NULL;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EVCardAttribute* _tmp3_;
	EVCardAttribute* _tmp4_;
	FolksSmallSet* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	FolksSmallSet* _tmp14_;
	GeeSet* _tmp15_;
	GeeSet* _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, 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");
	ids = _tmp3_;
	_tmp4_ = ids;
	if (_tmp4_ != NULL) {
		GList* ids_v = NULL;
		EVCardAttribute* _tmp5_;
		GList* _tmp6_;
		GList* _tmp7_;
		_tmp5_ = ids;
		_tmp6_ = e_vcard_attribute_get_values ((EVCardAttribute*) _tmp5_);
		ids_v = _tmp6_;
		_tmp7_ = ids_v;
		{
			GList* local_id_collection = NULL;
			GList* local_id_it = NULL;
			local_id_collection = _tmp7_;
			for (local_id_it = local_id_collection; local_id_it != NULL; local_id_it = local_id_it->next) {
				const gchar* local_id = NULL;
				local_id = (const gchar*) local_id_it->data;
				{
					const gchar* _tmp8_;
					_tmp8_ = local_id;
					if (g_strcmp0 (_tmp8_, "") != 0) {
						FolksSmallSet* _tmp9_;
						const gchar* _tmp10_;
						_tmp9_ = new_local_ids;
						_tmp10_ = local_id;
						gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp10_);
					}
				}
			}
		}
	}
	_tmp11_ = new_local_ids;
	_tmp12_ = folks_persona_get_iid ((FolksPersona*) self);
	_tmp13_ = _tmp12_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp13_);
	_tmp14_ = new_local_ids;
	_tmp15_ = folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self);
	_tmp16_ = _tmp15_;
	if (!folks_internal_equal_sets (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, (GeeSet*) _tmp14_, _tmp16_)) {
		FolksSmallSet* _tmp17_;
		FolksSmallSet* _tmp18_;
		FolksSmallSet* _tmp19_;
		GeeSet* _tmp20_;
		GeeSet* _tmp21_;
		_tmp17_ = new_local_ids;
		_tmp18_ = _g_object_ref0 (_tmp17_);
		_g_object_unref0 (self->priv->_local_ids);
		self->priv->_local_ids = _tmp18_;
		_tmp19_ = self->priv->_local_ids;
		_tmp20_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp19_);
		_tmp21_ = _tmp20_;
		_g_object_unref0 (self->priv->_local_ids_ro);
		self->priv->_local_ids_ro = _tmp21_;
		g_object_notify ((GObject*) self, "local-ids");
	}
	_g_object_unref0 (new_local_ids);
}

static EContactGeo*
_vala_EContactGeo_copy (EContactGeo* self)
{
	return g_boxed_copy (e_contact_geo_get_type (), self);
}

static void
_vala_EContactGeo_free (EContactGeo* self)
{
	g_boxed_free (e_contact_geo_get_type (), self);
}

static void
_edsf_persona_update_location (EdsfPersona* self)
{
	EContactGeo* _geo = NULL;
	gpointer _tmp0_;
	EContactGeo* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _edsf_persona_get_property (self, e_contact_geo_get_type (), (GBoxedCopyFunc) _vala_EContactGeo_copy, (GDestroyNotify) _vala_EContactGeo_free, "geo");
	_geo = (EContactGeo*) _tmp0_;
	_tmp1_ = _geo;
	if (_tmp1_ != NULL) {
		gboolean _tmp2_ = FALSE;
		FolksLocation* _tmp3_;
		_tmp3_ = self->priv->_location;
		if (_tmp3_ == NULL) {
			_tmp2_ = TRUE;
		} else {
			FolksLocation* _tmp4_;
			EContactGeo* _tmp5_;
			EContactGeo* _tmp6_;
			_tmp4_ = self->priv->_location;
			_tmp5_ = _geo;
			_tmp6_ = _geo;
			_tmp2_ = !folks_location_equal_coordinates (_tmp4_, _tmp5_->latitude, _tmp6_->longitude);
		}
		if (_tmp2_) {
			FolksLocation* _tmp7_;
			_tmp7_ = self->priv->_location;
			if (_tmp7_ != NULL) {
				FolksLocation* _tmp8_;
				EContactGeo* _tmp9_;
				FolksLocation* _tmp10_;
				EContactGeo* _tmp11_;
				_tmp8_ = self->priv->_location;
				_tmp9_ = _geo;
				_tmp8_->latitude = _tmp9_->latitude;
				_tmp10_ = self->priv->_location;
				_tmp11_ = _geo;
				_tmp10_->longitude = _tmp11_->longitude;
			} else {
				EContactGeo* _tmp12_;
				EContactGeo* _tmp13_;
				FolksLocation* _tmp14_;
				_tmp12_ = _geo;
				_tmp13_ = _geo;
				_tmp14_ = folks_location_new (_tmp12_->latitude, _tmp13_->longitude);
				_g_object_unref0 (self->priv->_location);
				self->priv->_location = _tmp14_;
			}
			g_object_notify ((GObject*) self, "location");
		}
	} else {
		FolksLocation* _tmp15_;
		_tmp15_ = self->priv->_location;
		if (_tmp15_ != NULL) {
			_g_object_unref0 (self->priv->_location);
			self->priv->_location = NULL;
			g_object_notify ((GObject*) self, "location");
		}
	}
	__vala_EContactGeo_free0 (_geo);
}

static void
_edsf_persona_update_favourite (EdsfPersona* self)
{
	gboolean is_fav = FALSE;
	EVCardAttribute* fav = NULL;
	EContact* _tmp0_;
	EContact* _tmp1_;
	EVCardAttribute* _tmp2_;
	EVCardAttribute* _tmp3_;
	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");
	fav = _tmp2_;
	_tmp3_ = fav;
	if (_tmp3_ != NULL) {
		const gchar* val = NULL;
		EVCardAttribute* _tmp4_;
		const gchar* _tmp5_;
		gboolean _tmp6_ = FALSE;
		const gchar* _tmp7_;
		_tmp4_ = fav;
		_tmp5_ = edsf_persona_get_vcard_attr_value (self, (EVCardAttribute*) _tmp4_);
		val = _tmp5_;
		_tmp7_ = val;
		if (_tmp7_ != NULL) {
			const gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp8_ = val;
			_tmp9_ = g_utf8_strdown ((const gchar*) _tmp8_, (gssize) -1);
			_tmp10_ = _tmp9_;
			_tmp6_ = g_strcmp0 (_tmp10_, "true") == 0;
			_g_free0 (_tmp10_);
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			is_fav = TRUE;
		}
	}
	if (is_fav != self->priv->_is_favourite) {
		self->priv->_is_favourite = is_fav;
		g_object_notify ((GObject*) self, "is-favourite");
	}
}

static void
_edsf_persona_update_anti_links (EdsfPersona* self)
{
	FolksSmallSet* new_anti_links = NULL;
	FolksSmallSet* _tmp0_;
	EVCard* vcard = NULL;
	EContact* _tmp1_;
	EContact* _tmp2_;
	EVCard* _tmp3_;
	GList* _tmp4_;
	FolksSmallSet* _tmp14_;
	FolksSmallSet* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	new_anti_links = _tmp0_;
	_tmp1_ = edsf_persona_get_contact (self);
	_tmp2_ = _tmp1_;
	vcard = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, e_vcard_get_type (), EVCard);
	_tmp3_ = vcard;
	_tmp4_ = e_vcard_get_attributes (_tmp3_);
	{
		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_;
				const gchar* _tmp6_;
				const gchar* val = NULL;
				EVCardAttribute* _tmp7_;
				const gchar* _tmp8_;
				gboolean _tmp9_ = FALSE;
				const gchar* _tmp10_;
				FolksSmallSet* _tmp12_;
				const gchar* _tmp13_;
				_tmp5_ = attr;
				_tmp6_ = e_vcard_attribute_get_name (_tmp5_);
				if (g_strcmp0 (_tmp6_, EDSF_PERSONA_STORE_anti_links_attribute_name) != 0) {
					continue;
				}
				_tmp7_ = attr;
				_tmp8_ = edsf_persona_get_vcard_attr_value (self, _tmp7_);
				val = _tmp8_;
				_tmp10_ = val;
				if (_tmp10_ == NULL) {
					_tmp9_ = TRUE;
				} else {
					const gchar* _tmp11_;
					_tmp11_ = val;
					_tmp9_ = g_strcmp0 ((const gchar*) _tmp11_, "") == 0;
				}
				if (_tmp9_) {
					continue;
				}
				_tmp12_ = new_anti_links;
				_tmp13_ = val;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, (const gchar*) _tmp13_);
			}
		}
	}
	_tmp14_ = new_anti_links;
	_tmp15_ = self->priv->_anti_links;
	if (!folks_internal_equal_sets (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, (GeeSet*) _tmp14_, (GeeSet*) _tmp15_)) {
		FolksSmallSet* _tmp16_;
		FolksSmallSet* _tmp17_;
		FolksSmallSet* _tmp18_;
		GeeSet* _tmp19_;
		GeeSet* _tmp20_;
		_tmp16_ = new_anti_links;
		_tmp17_ = _g_object_ref0 (_tmp16_);
		_g_object_unref0 (self->priv->_anti_links);
		self->priv->_anti_links = _tmp17_;
		_tmp18_ = new_anti_links;
		_tmp19_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp18_);
		_tmp20_ = _tmp19_;
		_g_object_unref0 (self->priv->_anti_links_ro);
		self->priv->_anti_links_ro = _tmp20_;
		g_object_notify ((GObject*) self, "anti-links");
	}
	_g_object_unref0 (new_anti_links);
}

gpointer
_edsf_persona_get_property_from_contact (GType t_type,
                                         GBoxedCopyFunc t_dup_func,
                                         GDestroyNotify t_destroy_func,
                                         EContact* contact,
                                         const gchar* prop_name)
{
	gpointer prop_value = NULL;
	gpointer _tmp0_;
	gpointer result;
	g_return_val_if_fail (contact != NULL, NULL);
	g_return_val_if_fail (prop_name != NULL, NULL);
	prop_value = NULL;
	_tmp0_ = e_contact_get (contact, e_contact_field_id (prop_name));
	((prop_value == NULL) || (t_destroy_func == NULL)) ? NULL : (prop_value = (t_destroy_func (prop_value), NULL));
	prop_value = _tmp0_;
	result = prop_value;
	return result;
}

static gpointer
_edsf_persona_get_property (EdsfPersona* self,
                            GType t_type,
                            GBoxedCopyFunc t_dup_func,
                            GDestroyNotify t_destroy_func,
                            const gchar* prop_name)
{
	EContact* _tmp0_;
	EContact* _tmp1_;
	gpointer _tmp2_;
	gpointer result;
	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_ = _edsf_persona_get_property_from_contact (t_type, (GBoxedCopyFunc) t_dup_func, (GDestroyNotify) t_destroy_func, _tmp1_, prop_name);
	result = _tmp2_;
	return result;
}

static const gchar*
_edsf_persona_get_string_property (EdsfPersona* self,
                                   const gchar* prop_name)
{
	EContactField field = 0;
	EContact* _tmp0_;
	EContact* _tmp1_;
	gconstpointer _tmp2_;
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (prop_name != NULL, NULL);
	field = e_contact_field_id (prop_name);
	g_return_val_if_fail (e_contact_field_is_string (field), NULL);
	_tmp0_ = edsf_persona_get_contact (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = e_contact_get_const (_tmp1_, field);
	result = (const gchar*) _tmp2_;
	return result;
}

static const gchar*
edsf_persona_get_vcard_attr_value (EdsfPersona* self,
                                   EVCardAttribute* attr)
{
	GList* values = NULL;
	GList* _tmp0_;
	const gchar* _tmp1_ = NULL;
	GList* _tmp2_;
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (attr != NULL, NULL);
	_tmp0_ = e_vcard_attribute_get_values (attr);
	values = _tmp0_;
	_tmp2_ = values;
	if (_tmp2_ != NULL) {
		GList* _tmp3_;
		gconstpointer _tmp4_;
		_tmp3_ = values;
		_tmp4_ = _tmp3_->data;
		_tmp1_ = (const gchar*) _tmp4_;
	} else {
		_tmp1_ = NULL;
	}
	result = _tmp1_;
	return result;
}

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

static const gchar*
_edsf_persona_im_proto_from_addr (EdsfPersona* self,
                                  const gchar* addr)
{
	gchar** tokens = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint tokens_length1;
	gint _tokens_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	const gchar* domain = NULL;
	gchar** _tmp3_;
	gint _tmp3__length1;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar** _tmp7_;
	gchar** _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	gchar** _tmp10_;
	gint _tmp10__length1;
	const gchar* _tmp11_;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_ = FALSE;
	const gchar* _tmp14_;
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (addr != NULL, NULL);
	if (string_index_of (addr, "@", 0) == -1) {
		result = NULL;
		return result;
	}
	_tmp1_ = _tmp0_ = g_strsplit (addr, "@", 2);
	tokens = _tmp1_;
	tokens_length1 = _vala_array_length (_tmp0_);
	_tokens_size_ = tokens_length1;
	_tmp2_ = tokens;
	_tmp2__length1 = tokens_length1;
	if (_tmp2__length1 != 2) {
		result = NULL;
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	_tmp3_ = tokens;
	_tmp3__length1 = tokens_length1;
	_tmp4_ = _tmp3_[1];
	domain = _tmp4_;
	_tmp5_ = domain;
	if (string_index_of (_tmp5_, ".", 0) == -1) {
		result = NULL;
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	_tmp6_ = domain;
	_tmp8_ = _tmp7_ = g_strsplit (_tmp6_, ".", 2);
	tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
	tokens = _tmp8_;
	tokens_length1 = _vala_array_length (_tmp7_);
	_tokens_size_ = tokens_length1;
	_tmp9_ = tokens;
	_tmp9__length1 = tokens_length1;
	if (_tmp9__length1 != 2) {
		result = NULL;
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	_tmp10_ = tokens;
	_tmp10__length1 = tokens_length1;
	_tmp11_ = _tmp10_[0];
	domain = _tmp11_;
	_tmp14_ = domain;
	if (g_strcmp0 (_tmp14_, "msn") == 0) {
		_tmp13_ = TRUE;
	} else {
		const gchar* _tmp15_;
		_tmp15_ = domain;
		_tmp13_ = g_strcmp0 (_tmp15_, "hotmail") == 0;
	}
	if (_tmp13_) {
		_tmp12_ = TRUE;
	} else {
		const gchar* _tmp16_;
		_tmp16_ = domain;
		_tmp12_ = g_strcmp0 (_tmp16_, "live") == 0;
	}
	if (_tmp12_) {
		result = "msn";
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		return result;
	} else {
		gboolean _tmp17_ = FALSE;
		const gchar* _tmp18_;
		_tmp18_ = domain;
		if (g_strcmp0 (_tmp18_, "gmail") == 0) {
			_tmp17_ = TRUE;
		} else {
			const gchar* _tmp19_;
			_tmp19_ = domain;
			_tmp17_ = g_strcmp0 (_tmp19_, "googlemail") == 0;
		}
		if (_tmp17_) {
			result = "jabber";
			tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
			return result;
		} else {
			const gchar* _tmp20_;
			_tmp20_ = domain;
			if (g_strcmp0 (_tmp20_, "yahoo") == 0) {
				result = "yahoo";
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				return result;
			}
		}
	}
	result = NULL;
	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_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_contact);
	self->priv->_contact = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, edsf_persona_properties[EDSF_PERSONA_CONTACT_PROPERTY]);
}

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;
	self = (EdsfPersona*) base;
	folks_web_service_details_change_web_service_addresses ((FolksWebServiceDetails*) self, value, NULL, NULL);
}

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

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

static FolksLocation*
edsf_persona_real_get_location (FolksLocationDetails* base)
{
	FolksLocation* result;
	EdsfPersona* self;
	FolksLocation* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_location;
	result = _tmp0_;
	return result;
}

static void
edsf_persona_real_set_location (FolksLocationDetails* base,
                                FolksLocation* value)
{
	EdsfPersona* self;
	self = (EdsfPersona*) base;
	folks_location_details_change_location ((FolksLocationDetails*) self, value, NULL, NULL);
}

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

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

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

static void
edsf_persona_real_set_phone_numbers (FolksPhoneDetails* base,
                                     GeeSet* value)
{
	EdsfPersona* self;
	self = (EdsfPersona*) base;
	folks_phone_details_change_phone_numbers ((FolksPhoneDetails*) self, value, 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;
	self = (EdsfPersona*) base;
	folks_email_details_change_email_addresses ((FolksEmailDetails*) self, value, NULL, NULL);
}

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

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

static gchar**
edsf_persona_real_get_linkable_properties (FolksPersona* base,
                                           gint* 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,
                                            gint* result_length1)
{
	gchar** result;
	EdsfPersona* self;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gint _tmp3_ = 0;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
	self = (EdsfPersona*) base;
	_tmp0_ = folks_persona_get_store ((FolksPersona*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = folks_persona_store_get_always_writeable_properties (_tmp1_, &_tmp3_);
	_tmp2__length1 = _tmp3_;
	_tmp4_ = _tmp2_;
	_tmp4__length1 = _tmp2__length1;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _tmp4__length1;
	if (result_length1) {
		*result_length1 = _tmp5__length1;
	}
	result = _tmp5_;
	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;
	self = (EdsfPersona*) base;
	folks_avatar_details_change_avatar ((FolksAvatarDetails*) self, value, 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;
	self = (EdsfPersona*) base;
	folks_name_details_change_structured_name ((FolksNameDetails*) self, value, 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)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = edsf_persona_get_contact_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_contact_id);
		self->priv->_contact_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, edsf_persona_properties[EDSF_PERSONA_CONTACT_ID_PROPERTY]);
	}
}

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;
	self = (EdsfPersona*) base;
	folks_name_details_change_full_name ((FolksNameDetails*) self, value, 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;
	self = (EdsfPersona*) base;
	folks_name_details_change_nickname ((FolksNameDetails*) self, value, NULL, NULL);
}

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

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

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

static void
edsf_persona_real_set_urls (FolksUrlDetails* base,
                            GeeSet* value)
{
	EdsfPersona* self;
	self = (EdsfPersona*) base;
	folks_url_details_change_urls ((FolksUrlDetails*) self, value, 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;
	self = (EdsfPersona*) base;
	folks_im_details_change_im_addresses ((FolksImDetails*) self, value, NULL, NULL);
}

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

static void
edsf_persona_real_set_groups (FolksGroupDetails* base,
                              GeeSet* value)
{
	EdsfPersona* self;
	self = (EdsfPersona*) base;
	folks_group_details_change_groups ((FolksGroupDetails*) self, value, 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;
	self = (EdsfPersona*) base;
	folks_birthday_details_change_calendar_event_id ((FolksBirthdayDetails*) self, value, 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;
	self = (EdsfPersona*) base;
	folks_birthday_details_change_birthday ((FolksBirthdayDetails*) self, value, NULL, NULL);
}

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

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

static gboolean
edsf_persona_real_get_is_favourite (FolksFavouriteDetails* base)
{
	gboolean result;
	EdsfPersona* self;
	self = (EdsfPersona*) base;
	_edsf_persona_update_groups (self, TRUE, FALSE);
	result = self->priv->_is_favourite;
	return result;
}

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

static GeeSet*
edsf_persona_real_get_anti_links (FolksAntiLinkable* base)
{
	GeeSet* result;
	EdsfPersona* self;
	GeeSet* _tmp0_;
	self = (EdsfPersona*) base;
	_tmp0_ = self->priv->_anti_links_ro;
	result = _tmp0_;
	return result;
}

static void
edsf_persona_real_set_anti_links (FolksAntiLinkable* base,
                                  GeeSet* value)
{
	EdsfPersona* self;
	self = (EdsfPersona*) base;
	folks_anti_linkable_change_anti_links ((FolksAntiLinkable*) self, value, NULL, NULL);
}

GeeSet*
edsf_persona_get_system_groups (EdsfPersona* self)
{
	GeeSet* result;
	GeeSet* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_edsf_persona_update_groups (self, TRUE, TRUE);
	_tmp0_ = self->priv->_system_groups_ro;
	result = _tmp0_;
	return result;
}

void
edsf_persona_set_system_groups (EdsfPersona* self,
                                GeeSet* value)
{
	g_return_if_fail (self != NULL);
	edsf_persona_change_system_groups (self, value, NULL, NULL);
}

gboolean
edsf_persona_get_in_google_personal_group (EdsfPersona* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_edsf_persona_update_groups (self, TRUE, TRUE);
	result = self->priv->_in_google_personal_group;
	return result;
}

void
edsf_persona_set_in_google_personal_group (EdsfPersona* self,
                                           gboolean value)
{
	g_return_if_fail (self != NULL);
	edsf_persona_change_in_google_personal_group (self, value, NULL, NULL);
}

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

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

static GType
edsf_persona_url_type_mapping_get_type_once (void)
{
	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);
	return edsf_persona_url_type_mapping_type_id;
}

GType
edsf_persona_url_type_mapping_get_type (void)
{
	static volatile gsize edsf_persona_url_type_mapping_type_id__once = 0;
	if (g_once_init_enter (&edsf_persona_url_type_mapping_type_id__once)) {
		GType edsf_persona_url_type_mapping_type_id;
		edsf_persona_url_type_mapping_type_id = edsf_persona_url_type_mapping_get_type_once ();
		g_once_init_leave (&edsf_persona_url_type_mapping_type_id__once, edsf_persona_url_type_mapping_type_id);
	}
	return edsf_persona_url_type_mapping_type_id__once;
}

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_;
	FolksSmallSet* _tmp2_;
	FolksSmallSet* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	FolksSmallSet* _tmp6_;
	FolksSmallSet* _tmp7_;
	GeeSet* _tmp8_;
	GeeSet* _tmp9_;
	FolksSmallSet* _tmp10_;
	FolksSmallSet* _tmp11_;
	GeeSet* _tmp12_;
	GeeSet* _tmp13_;
	FolksSmallSet* _tmp14_;
	FolksSmallSet* _tmp15_;
	GeeSet* _tmp16_;
	GeeSet* _tmp17_;
	FolksSmallSet* _tmp18_;
	FolksSmallSet* _tmp19_;
	GeeSet* _tmp20_;
	GeeSet* _tmp21_;
	FolksSmallSet* _tmp22_;
	FolksSmallSet* _tmp23_;
	GeeSet* _tmp24_;
	GeeSet* _tmp25_;
	GeeHashMultiMap* _tmp26_;
	FolksSmallSet* _tmp27_;
	FolksSmallSet* _tmp28_;
	GeeSet* _tmp29_;
	GeeSet* _tmp30_;
	FolksSmallSet* _tmp31_;
	FolksSmallSet* _tmp32_;
	GeeSet* _tmp33_;
	GeeSet* _tmp34_;
	FolksSmallSet* _tmp35_;
	FolksSmallSet* _tmp36_;
	GeeSet* _tmp37_;
	GeeSet* _tmp38_;
	EContact* _tmp39_;
	parent_class = G_OBJECT_CLASS (edsf_persona_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EDSF_TYPE_PERSONA, EdsfPersona);
	_tmp0_ = folks_persona_get_iid ((FolksPersona*) self);
	_tmp1_ = _tmp0_;
	g_debug ("edsf-persona.vala:1025: Creating new Edsf.Persona with IID '%s'", _tmp1_);
	self->priv->_gender = FOLKS_GENDER_UNSPECIFIED;
	_tmp2_ = folks_small_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	_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_ = folks_small_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	_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_ = folks_small_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	_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_ = folks_small_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	_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_ = folks_small_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	_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_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, 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_;
	_g_object_unref0 (self->priv->_location);
	self->priv->_location = NULL;
	_tmp26_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	_g_object_unref0 (self->priv->_web_service_addresses);
	self->priv->_web_service_addresses = _tmp26_;
	_tmp27_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, 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_ = folks_small_set_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	_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_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->_anti_links);
	self->priv->_anti_links = _tmp35_;
	_tmp36_ = self->priv->_anti_links;
	_tmp37_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp36_);
	_tmp38_ = _tmp37_;
	_g_object_unref0 (self->priv->_anti_links_ro);
	self->priv->_anti_links_ro = _tmp38_;
	_tmp39_ = self->priv->_contact;
	_edsf_persona_update (self, _tmp39_);
	return obj;
}

static void
edsf_persona_class_init (EdsfPersonaClass * klass,
                         gpointer klass_data)
{
	GTimeZone* _tmp0_;
	edsf_persona_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &EdsfPersona_private_offset);
	((FolksPersonaClass *) klass)->linkable_property_to_links = (void (*) (FolksPersona*, const gchar*, FolksPersonaLinkablePropertyCallback, gpointer)) 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_PROPERTY, edsf_persona_properties[EDSF_PERSONA_CONTACT_PROPERTY] = g_param_spec_object ("contact", "contact", "contact", e_contact_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	/**
	   * {@inheritDoc}
	   *
	   * This is stored in the X-FOLKS-WEB-SERVICES-IDS vCard field in EDS.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_WEB_SERVICE_ADDRESSES_PROPERTY, edsf_persona_properties[EDSF_PERSONA_WEB_SERVICE_ADDRESSES_PROPERTY] = g_param_spec_object ("web-service-addresses", "web-service-addresses", "web-service-addresses", GEE_TYPE_MULTI_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * IDs used to link {@link Edsf.Persona}s.
	   *
	   * This is stored in the X-FOLKS-CONTACTS-IDS vCard field in EDS.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LOCAL_IDS_PROPERTY, edsf_persona_properties[EDSF_PERSONA_LOCAL_IDS_PROPERTY] = g_param_spec_object ("local-ids", "local-ids", "local-ids", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.9.2
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LOCATION_PROPERTY, edsf_persona_properties[EDSF_PERSONA_LOCATION_PROPERTY] = g_param_spec_object ("location", "location", "location", FOLKS_TYPE_LOCATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * 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_PROPERTY, edsf_persona_properties[EDSF_PERSONA_POSTAL_ADDRESSES_PROPERTY] = g_param_spec_object ("postal-addresses", "postal-addresses", "postal-addresses", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_PHONE_NUMBERS_PROPERTY, edsf_persona_properties[EDSF_PERSONA_PHONE_NUMBERS_PROPERTY] = g_param_spec_object ("phone-numbers", "phone-numbers", "phone-numbers", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_EMAIL_ADDRESSES_PROPERTY, edsf_persona_properties[EDSF_PERSONA_EMAIL_ADDRESSES_PROPERTY] = g_param_spec_object ("email-addresses", "email-addresses", "email-addresses", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_NOTES_PROPERTY, edsf_persona_properties[EDSF_PERSONA_NOTES_PROPERTY] = g_param_spec_object ("notes", "notes", "notes", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LINKABLE_PROPERTIES_PROPERTY, edsf_persona_properties[EDSF_PERSONA_LINKABLE_PROPERTIES_PROPERTY] = g_param_spec_boxed ("linkable-properties", "linkable-properties", "linkable-properties", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_WRITEABLE_PROPERTIES_PROPERTY, edsf_persona_properties[EDSF_PERSONA_WRITEABLE_PROPERTIES_PROPERTY] = g_param_spec_boxed ("writeable-properties", "writeable-properties", "writeable-properties", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | 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_PROPERTY, edsf_persona_properties[EDSF_PERSONA_AVATAR_PROPERTY] = g_param_spec_object ("avatar", "avatar", "avatar", g_loadable_icon_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STRUCTURED_NAME_PROPERTY, edsf_persona_properties[EDSF_PERSONA_STRUCTURED_NAME_PROPERTY] = g_param_spec_object ("structured-name", "structured-name", "structured-name", FOLKS_TYPE_STRUCTURED_NAME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * The e-d-s contact uid
	   *
	   * This is guaranteed to be a non-empty string, unique within the persona
	   * store.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_CONTACT_ID_PROPERTY, edsf_persona_properties[EDSF_PERSONA_CONTACT_ID_PROPERTY] = g_param_spec_string ("contact-id", "contact-id", "contact-id", NULL, G_PARAM_STATIC_STRINGS | 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_PROPERTY, edsf_persona_properties[EDSF_PERSONA_FULL_NAME_PROPERTY] = g_param_spec_string ("full-name", "full-name", "full-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_NICKNAME_PROPERTY, edsf_persona_properties[EDSF_PERSONA_NICKNAME_PROPERTY] = g_param_spec_string ("nickname", "nickname", "nickname", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * This is stored in the {@link Edsf.Persona.gender_attribute_name} vCard
	   * field in EDS.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_GENDER_PROPERTY, edsf_persona_properties[EDSF_PERSONA_GENDER_PROPERTY] = g_param_spec_enum ("gender", "gender", "gender", FOLKS_TYPE_GENDER, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * This is stored in the X-URIS vCard field in EDS.
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_URLS_PROPERTY, edsf_persona_properties[EDSF_PERSONA_URLS_PROPERTY] = g_param_spec_object ("urls", "urls", "urls", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_IM_ADDRESSES_PROPERTY, edsf_persona_properties[EDSF_PERSONA_IM_ADDRESSES_PROPERTY] = g_param_spec_object ("im-addresses", "im-addresses", "im-addresses", GEE_TYPE_MULTI_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_GROUPS_PROPERTY, edsf_persona_properties[EDSF_PERSONA_GROUPS_PROPERTY] = g_param_spec_object ("groups", "groups", "groups", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@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_PROPERTY, edsf_persona_properties[EDSF_PERSONA_CALENDAR_EVENT_ID_PROPERTY] = g_param_spec_string ("calendar-event-id", "calendar-event-id", "calendar-event-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.2
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_BIRTHDAY_PROPERTY, edsf_persona_properties[EDSF_PERSONA_BIRTHDAY_PROPERTY] = g_param_spec_boxed ("birthday", "birthday", "birthday", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * This is stored in the X-ROLES vCard field in EDS.
	   *
	   * @since 0.6.2
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_ROLES_PROPERTY, edsf_persona_properties[EDSF_PERSONA_ROLES_PROPERTY] = g_param_spec_object ("roles", "roles", "roles", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * Whether this contact is a user-defined favourite.
	   *
	   * This is stored in the X-FOLKS-FAVOURITE vCard field in EDS.
	   *
	   * @since 0.6.5
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_IS_FAVOURITE_PROPERTY, edsf_persona_properties[EDSF_PERSONA_IS_FAVOURITE_PROPERTY] = g_param_spec_boolean ("is-favourite", "is-favourite", "is-favourite", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.7.3
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_ANTI_LINKS_PROPERTY, edsf_persona_properties[EDSF_PERSONA_ANTI_LINKS_PROPERTY] = g_param_spec_object ("anti-links", "anti-links", "anti-links", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * The complete set of system group identifiers the contact belongs to.
	   * See {@link Persona.change_system_groups} for details.
	   *
	   * This is stored in the X-GOOGLE-SYSTEM-GROUP-IDS vCard field in EDS.
	   *
	   * @since 0.9.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_SYSTEM_GROUPS_PROPERTY, edsf_persona_properties[EDSF_PERSONA_SYSTEM_GROUPS_PROPERTY] = g_param_spec_object ("system-groups", "system-groups", "system-groups", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	/**
	   * Whether this contact is in the “My Contacts” section of the user’s address
	   * book, rather than the “Other” section.
	   *
	   * @since 0.7.3
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_IN_GOOGLE_PERSONAL_GROUP_PROPERTY, edsf_persona_properties[EDSF_PERSONA_IN_GOOGLE_PERSONAL_GROUP_PROPERTY] = g_param_spec_boolean ("in-google-personal-group", "in-google-personal-group", "in-google-personal-group", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_EXPLICIT_NOTIFY));
	_tmp0_ = g_time_zone_new_local ();
	edsf_persona__local_time_zone = _tmp0_;
}

static void
edsf_persona_folks_anti_linkable_interface_init (FolksAntiLinkableIface * iface,
                                                 gpointer iface_data)
{
	edsf_persona_folks_anti_linkable_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_anti_links = (void (*) (FolksAntiLinkable*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_anti_links;
	iface->change_anti_links_finish = (void (*) (FolksAntiLinkable*, GAsyncResult*, GError**)) edsf_persona_change_anti_links_finish;
	iface->get_anti_links = edsf_persona_real_get_anti_links;
	iface->set_anti_links = edsf_persona_real_set_anti_links;
}

static void
edsf_persona_folks_avatar_details_interface_init (FolksAvatarDetailsIface * iface,
                                                  gpointer iface_data)
{
	edsf_persona_folks_avatar_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_avatar = (void (*) (FolksAvatarDetails*, GLoadableIcon*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_avatar;
	iface->change_avatar_finish = (void (*) (FolksAvatarDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                    gpointer iface_data)
{
	edsf_persona_folks_birthday_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_birthday = (void (*) (FolksBirthdayDetails*, GDateTime*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_birthday;
	iface->change_birthday_finish = (void (*) (FolksBirthdayDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                 gpointer iface_data)
{
	edsf_persona_folks_email_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_email_addresses = (void (*) (FolksEmailDetails*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_email_addresses;
	iface->change_email_addresses_finish = (void (*) (FolksEmailDetails*, GAsyncResult*, GError**)) edsf_persona_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_extended_info_interface_init (FolksExtendedInfoIface * iface,
                                                 gpointer iface_data)
{
	edsf_persona_folks_extended_info_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_extended_field = (FolksExtendedFieldDetails* (*) (FolksExtendedInfo*, const gchar*)) edsf_persona_real_get_extended_field;
	iface->change_extended_field = (void (*) (FolksExtendedInfo*, const gchar*, FolksExtendedFieldDetails*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_extended_field;
	iface->change_extended_field_finish = (void (*) (FolksExtendedInfo*, GAsyncResult*, GError**)) edsf_persona_change_extended_field_finish;
	iface->remove_extended_field = (void (*) (FolksExtendedInfo*, const gchar*, GAsyncReadyCallback, gpointer)) edsf_persona_real_remove_extended_field;
	iface->remove_extended_field_finish = (void (*) (FolksExtendedInfo*, GAsyncResult*, GError**)) edsf_persona_remove_extended_field_finish;
}

static void
edsf_persona_folks_favourite_details_interface_init (FolksFavouriteDetailsIface * iface,
                                                     gpointer iface_data)
{
	edsf_persona_folks_favourite_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_is_favourite = (void (*) (FolksFavouriteDetails*, gboolean, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_is_favourite;
	iface->change_is_favourite_finish = (void (*) (FolksFavouriteDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                  gpointer iface_data)
{
	edsf_persona_folks_gender_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_gender = (void (*) (FolksGenderDetails*, FolksGender, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_gender;
	iface->change_gender_finish = (void (*) (FolksGenderDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                 gpointer iface_data)
{
	edsf_persona_folks_group_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_group = (void (*) (FolksGroupDetails*, const gchar*, gboolean, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_group;
	iface->change_group_finish = (void (*) (FolksGroupDetails*, GAsyncResult*, GError**)) edsf_persona_change_group_finish;
	iface->change_groups = (void (*) (FolksGroupDetails*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_groups;
	iface->change_groups_finish = (void (*) (FolksGroupDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                              gpointer iface_data)
{
	edsf_persona_folks_im_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_im_addresses = (void (*) (FolksImDetails*, GeeMultiMap*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_im_addresses;
	iface->change_im_addresses_finish = (void (*) (FolksImDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                    gpointer iface_data)
{
	edsf_persona_folks_local_id_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_local_ids = (void (*) (FolksLocalIdDetails*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_local_ids;
	iface->change_local_ids_finish = (void (*) (FolksLocalIdDetails*, GAsyncResult*, GError**)) edsf_persona_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_location_details_interface_init (FolksLocationDetailsIface * iface,
                                                    gpointer iface_data)
{
	edsf_persona_folks_location_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_location = (void (*) (FolksLocationDetails*, FolksLocation*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_location;
	iface->change_location_finish = (void (*) (FolksLocationDetails*, GAsyncResult*, GError**)) edsf_persona_change_location_finish;
	iface->get_location = edsf_persona_real_get_location;
	iface->set_location = edsf_persona_real_set_location;
}

static void
edsf_persona_folks_name_details_interface_init (FolksNameDetailsIface * iface,
                                                gpointer iface_data)
{
	edsf_persona_folks_name_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_structured_name = (void (*) (FolksNameDetails*, FolksStructuredName*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_structured_name;
	iface->change_structured_name_finish = (void (*) (FolksNameDetails*, GAsyncResult*, GError**)) edsf_persona_change_structured_name_finish;
	iface->change_full_name = (void (*) (FolksNameDetails*, const gchar*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_full_name;
	iface->change_full_name_finish = (void (*) (FolksNameDetails*, GAsyncResult*, GError**)) edsf_persona_change_full_name_finish;
	iface->change_nickname = (void (*) (FolksNameDetails*, const gchar*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_nickname;
	iface->change_nickname_finish = (void (*) (FolksNameDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                gpointer iface_data)
{
	edsf_persona_folks_note_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_notes = (void (*) (FolksNoteDetails*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_notes;
	iface->change_notes_finish = (void (*) (FolksNoteDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                 gpointer iface_data)
{
	edsf_persona_folks_phone_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_phone_numbers = (void (*) (FolksPhoneDetails*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_phone_numbers;
	iface->change_phone_numbers_finish = (void (*) (FolksPhoneDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                gpointer iface_data)
{
	edsf_persona_folks_role_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_roles = (void (*) (FolksRoleDetails*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_roles;
	iface->change_roles_finish = (void (*) (FolksRoleDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                               gpointer iface_data)
{
	edsf_persona_folks_url_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_urls = (void (*) (FolksUrlDetails*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_urls;
	iface->change_urls_finish = (void (*) (FolksUrlDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                          gpointer iface_data)
{
	edsf_persona_folks_postal_address_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_postal_addresses = (void (*) (FolksPostalAddressDetails*, GeeSet*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_postal_addresses;
	iface->change_postal_addresses_finish = (void (*) (FolksPostalAddressDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                                                       gpointer iface_data)
{
	edsf_persona_folks_web_service_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_web_service_addresses = (void (*) (FolksWebServiceDetails*, GeeMultiMap*, GAsyncReadyCallback, gpointer)) edsf_persona_real_change_web_service_addresses;
	iface->change_web_service_addresses_finish = (void (*) (FolksWebServiceDetails*, GAsyncResult*, GError**)) edsf_persona_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,
                            gpointer klass)
{
	FolksSmallSet* _tmp0_;
	FolksSmallSet* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GeeHashMultiMap* _tmp4_;
	self->priv = edsf_persona_get_instance_private (self);
	_tmp0_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->_local_ids = _tmp0_;
	self->priv->_location = NULL;
	self->priv->_postal_addresses = NULL;
	self->priv->_postal_addresses_ro = NULL;
	self->priv->_phone_numbers = NULL;
	self->priv->_phone_numbers_ro = NULL;
	_tmp1_ = folks_small_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	self->priv->_email_addresses = _tmp1_;
	self->priv->_notes = NULL;
	self->priv->_notes_ro = NULL;
	self->priv->_avatar = NULL;
	self->priv->_structured_name = NULL;
	_tmp2_ = g_strdup ("");
	self->priv->_full_name = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_nickname = _tmp3_;
	self->priv->_urls = NULL;
	self->priv->_urls_ro = NULL;
	_tmp4_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, _folks_abstract_field_details_hash_static_gee_hash_data_func, NULL, NULL, _folks_abstract_field_details_equal_static_gee_equal_data_func, NULL, NULL);
	self->priv->_im_addresses = _tmp4_;
	self->priv->_groups = NULL;
	self->priv->_groups_ro = NULL;
	self->priv->_birthday = NULL;
	self->priv->_roles = NULL;
	self->priv->_roles_ro = NULL;
	self->priv->_is_favourite = FALSE;
	self->priv->_system_groups = NULL;
	self->priv->_system_groups_ro = NULL;
}

static void
edsf_persona_finalize (GObject * obj)
{
	EdsfPersona * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EDSF_TYPE_PERSONA, EdsfPersona);
	_tmp0_ = folks_persona_get_uid ((FolksPersona*) self);
	_tmp1_ = _tmp0_;
	g_debug ("edsf-persona.vala:1114: Destroying Edsf.Persona '%s': %p", _tmp1_, self);
	_g_object_unref0 (self->priv->_contact);
	_g_object_unref0 (self->priv->_web_service_addresses);
	_g_object_unref0 (self->priv->_local_ids);
	_g_object_unref0 (self->priv->_local_ids_ro);
	_g_object_unref0 (self->priv->_location);
	_g_object_unref0 (self->priv->_postal_addresses);
	_g_object_unref0 (self->priv->_postal_addresses_ro);
	_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->_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_unref0 (self->priv->_anti_links);
	_g_object_unref0 (self->priv->_anti_links_ro);
	_g_object_unref0 (self->priv->_system_groups);
	_g_object_unref0 (self->priv->_system_groups_ro);
	G_OBJECT_CLASS (edsf_persona_parent_class)->finalize (obj);
}

/**
 * A persona subclass which represents a single EDS contact.
 *
 * Each {@link Edsf.Persona} instance represents a single EDS {@link E.Contact}.
 * When the contact is modified (either by this folks client, or a different
 * client), the {@link Edsf.Persona} remains the same, but is assigned a new
 * {@link E.Contact}. It then updates its properties from this new contact.
 */
static GType
edsf_persona_get_type_once (void)
{
	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_anti_linkable_info = { (GInterfaceInitFunc) edsf_persona_folks_anti_linkable_interface_init, (GInterfaceFinalizeFunc) NULL, 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_extended_info_info = { (GInterfaceInitFunc) edsf_persona_folks_extended_info_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_location_details_info = { (GInterfaceInitFunc) edsf_persona_folks_location_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_ANTI_LINKABLE, &folks_anti_linkable_info);
	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_EXTENDED_INFO, &folks_extended_info_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_LOCATION_DETAILS, &folks_location_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);
	EdsfPersona_private_offset = g_type_add_instance_private (edsf_persona_type_id, sizeof (EdsfPersonaPrivate));
	return edsf_persona_type_id;
}

GType
edsf_persona_get_type (void)
{
	static volatile gsize edsf_persona_type_id__once = 0;
	if (g_once_init_enter (&edsf_persona_type_id__once)) {
		GType edsf_persona_type_id;
		edsf_persona_type_id = edsf_persona_get_type_once ();
		g_once_init_leave (&edsf_persona_type_id__once, edsf_persona_type_id);
	}
	return edsf_persona_type_id__once;
}

static void
_vala_edsf_persona_get_property (GObject * object,
                                 guint property_id,
                                 GValue * value,
                                 GParamSpec * pspec)
{
	EdsfPersona * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, EDSF_TYPE_PERSONA, EdsfPersona);
	switch (property_id) {
		case EDSF_PERSONA_CONTACT_PROPERTY:
		g_value_set_object (value, edsf_persona_get_contact (self));
		break;
		case EDSF_PERSONA_WEB_SERVICE_ADDRESSES_PROPERTY:
		g_value_set_object (value, folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) self));
		break;
		case EDSF_PERSONA_LOCAL_IDS_PROPERTY:
		g_value_set_object (value, folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self));
		break;
		case EDSF_PERSONA_LOCATION_PROPERTY:
		g_value_set_object (value, folks_location_details_get_location ((FolksLocationDetails*) self));
		break;
		case EDSF_PERSONA_POSTAL_ADDRESSES_PROPERTY:
		g_value_set_object (value, folks_postal_address_details_get_postal_addresses ((FolksPostalAddressDetails*) self));
		break;
		case EDSF_PERSONA_PHONE_NUMBERS_PROPERTY:
		g_value_set_object (value, folks_phone_details_get_phone_numbers ((FolksPhoneDetails*) self));
		break;
		case EDSF_PERSONA_EMAIL_ADDRESSES_PROPERTY:
		g_value_set_object (value, folks_email_details_get_email_addresses ((FolksEmailDetails*) self));
		break;
		case EDSF_PERSONA_NOTES_PROPERTY:
		g_value_set_object (value, folks_note_details_get_notes ((FolksNoteDetails*) self));
		break;
		case EDSF_PERSONA_LINKABLE_PROPERTIES_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, folks_persona_get_linkable_properties ((FolksPersona*) self, &length));
		}
		break;
		case EDSF_PERSONA_WRITEABLE_PROPERTIES_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, folks_persona_get_writeable_properties ((FolksPersona*) self, &length));
		}
		break;
		case EDSF_PERSONA_AVATAR_PROPERTY:
		g_value_set_object (value, folks_avatar_details_get_avatar ((FolksAvatarDetails*) self));
		break;
		case EDSF_PERSONA_STRUCTURED_NAME_PROPERTY:
		g_value_set_object (value, folks_name_details_get_structured_name ((FolksNameDetails*) self));
		break;
		case EDSF_PERSONA_CONTACT_ID_PROPERTY:
		g_value_set_string (value, edsf_persona_get_contact_id (self));
		break;
		case EDSF_PERSONA_FULL_NAME_PROPERTY:
		g_value_set_string (value, folks_name_details_get_full_name ((FolksNameDetails*) self));
		break;
		case EDSF_PERSONA_NICKNAME_PROPERTY:
		g_value_set_string (value, folks_name_details_get_nickname ((FolksNameDetails*) self));
		break;
		case EDSF_PERSONA_GENDER_PROPERTY:
		g_value_set_enum (value, folks_gender_details_get_gender ((FolksGenderDetails*) self));
		break;
		case EDSF_PERSONA_URLS_PROPERTY:
		g_value_set_object (value, folks_url_details_get_urls ((FolksUrlDetails*) self));
		break;
		case EDSF_PERSONA_IM_ADDRESSES_PROPERTY:
		g_value_set_object (value, folks_im_details_get_im_addresses ((FolksImDetails*) self));
		break;
		case EDSF_PERSONA_GROUPS_PROPERTY:
		g_value_set_object (value, folks_group_details_get_groups ((FolksGroupDetails*) self));
		break;
		case EDSF_PERSONA_CALENDAR_EVENT_ID_PROPERTY:
		g_value_set_string (value, folks_birthday_details_get_calendar_event_id ((FolksBirthdayDetails*) self));
		break;
		case EDSF_PERSONA_BIRTHDAY_PROPERTY:
		g_value_set_boxed (value, folks_birthday_details_get_birthday ((FolksBirthdayDetails*) self));
		break;
		case EDSF_PERSONA_ROLES_PROPERTY:
		g_value_set_object (value, folks_role_details_get_roles ((FolksRoleDetails*) self));
		break;
		case EDSF_PERSONA_IS_FAVOURITE_PROPERTY:
		g_value_set_boolean (value, folks_favourite_details_get_is_favourite ((FolksFavouriteDetails*) self));
		break;
		case EDSF_PERSONA_ANTI_LINKS_PROPERTY:
		g_value_set_object (value, folks_anti_linkable_get_anti_links ((FolksAntiLinkable*) self));
		break;
		case EDSF_PERSONA_SYSTEM_GROUPS_PROPERTY:
		g_value_set_object (value, edsf_persona_get_system_groups (self));
		break;
		case EDSF_PERSONA_IN_GOOGLE_PERSONAL_GROUP_PROPERTY:
		g_value_set_boolean (value, edsf_persona_get_in_google_personal_group (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 = G_TYPE_CHECK_INSTANCE_CAST (object, EDSF_TYPE_PERSONA, EdsfPersona);
	switch (property_id) {
		case EDSF_PERSONA_CONTACT_PROPERTY:
		edsf_persona_set_contact (self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_WEB_SERVICE_ADDRESSES_PROPERTY:
		folks_web_service_details_set_web_service_addresses ((FolksWebServiceDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_LOCAL_IDS_PROPERTY:
		folks_local_id_details_set_local_ids ((FolksLocalIdDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_LOCATION_PROPERTY:
		folks_location_details_set_location ((FolksLocationDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_POSTAL_ADDRESSES_PROPERTY:
		folks_postal_address_details_set_postal_addresses ((FolksPostalAddressDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_PHONE_NUMBERS_PROPERTY:
		folks_phone_details_set_phone_numbers ((FolksPhoneDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_EMAIL_ADDRESSES_PROPERTY:
		folks_email_details_set_email_addresses ((FolksEmailDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_NOTES_PROPERTY:
		folks_note_details_set_notes ((FolksNoteDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_AVATAR_PROPERTY:
		folks_avatar_details_set_avatar ((FolksAvatarDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_STRUCTURED_NAME_PROPERTY:
		folks_name_details_set_structured_name ((FolksNameDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_CONTACT_ID_PROPERTY:
		edsf_persona_set_contact_id (self, g_value_get_string (value));
		break;
		case EDSF_PERSONA_FULL_NAME_PROPERTY:
		folks_name_details_set_full_name ((FolksNameDetails*) self, g_value_get_string (value));
		break;
		case EDSF_PERSONA_NICKNAME_PROPERTY:
		folks_name_details_set_nickname ((FolksNameDetails*) self, g_value_get_string (value));
		break;
		case EDSF_PERSONA_GENDER_PROPERTY:
		folks_gender_details_set_gender ((FolksGenderDetails*) self, g_value_get_enum (value));
		break;
		case EDSF_PERSONA_URLS_PROPERTY:
		folks_url_details_set_urls ((FolksUrlDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_IM_ADDRESSES_PROPERTY:
		folks_im_details_set_im_addresses ((FolksImDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_GROUPS_PROPERTY:
		folks_group_details_set_groups ((FolksGroupDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_CALENDAR_EVENT_ID_PROPERTY:
		folks_birthday_details_set_calendar_event_id ((FolksBirthdayDetails*) self, g_value_get_string (value));
		break;
		case EDSF_PERSONA_BIRTHDAY_PROPERTY:
		folks_birthday_details_set_birthday ((FolksBirthdayDetails*) self, g_value_get_boxed (value));
		break;
		case EDSF_PERSONA_ROLES_PROPERTY:
		folks_role_details_set_roles ((FolksRoleDetails*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_IS_FAVOURITE_PROPERTY:
		folks_favourite_details_set_is_favourite ((FolksFavouriteDetails*) self, g_value_get_boolean (value));
		break;
		case EDSF_PERSONA_ANTI_LINKS_PROPERTY:
		folks_anti_linkable_set_anti_links ((FolksAntiLinkable*) self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_SYSTEM_GROUPS_PROPERTY:
		edsf_persona_set_system_groups (self, g_value_get_object (value));
		break;
		case EDSF_PERSONA_IN_GOOGLE_PERSONAL_GROUP_PROPERTY:
		edsf_persona_set_in_google_personal_group (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,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

