/* kf-persona.c generated by valac 0.35.3.10-6b27, the Vala compiler
 * generated from kf-persona.vala, do not modify */

/*
 * Copyright (C) 2010 Collabora Ltd.
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *       Philip Withnall <philip.withnall@collabora.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include <folks/folks.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <folks/small-set.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <folks-internal.h>


#define FOLKS_BACKENDS_KF_TYPE_PERSONA (folks_backends_kf_persona_get_type ())
#define FOLKS_BACKENDS_KF_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_BACKENDS_KF_TYPE_PERSONA, FolksBackendsKfPersona))
#define FOLKS_BACKENDS_KF_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_BACKENDS_KF_TYPE_PERSONA, FolksBackendsKfPersonaClass))
#define FOLKS_BACKENDS_KF_IS_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_BACKENDS_KF_TYPE_PERSONA))
#define FOLKS_BACKENDS_KF_IS_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_BACKENDS_KF_TYPE_PERSONA))
#define FOLKS_BACKENDS_KF_PERSONA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_BACKENDS_KF_TYPE_PERSONA, FolksBackendsKfPersonaClass))

typedef struct _FolksBackendsKfPersona FolksBackendsKfPersona;
typedef struct _FolksBackendsKfPersonaClass FolksBackendsKfPersonaClass;
typedef struct _FolksBackendsKfPersonaPrivate FolksBackendsKfPersonaPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE (folks_backends_kf_persona_store_get_type ())
#define FOLKS_BACKENDS_KF_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore))
#define FOLKS_BACKENDS_KF_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStoreClass))
#define FOLKS_BACKENDS_KF_IS_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE))
#define FOLKS_BACKENDS_KF_IS_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE))
#define FOLKS_BACKENDS_KF_PERSONA_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStoreClass))

typedef struct _FolksBackendsKfPersonaStore FolksBackendsKfPersonaStore;
typedef struct _FolksBackendsKfPersonaStoreClass FolksBackendsKfPersonaStoreClass;
typedef struct _FolksBackendsKfPersonaChangeAliasData FolksBackendsKfPersonaChangeAliasData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _FolksBackendsKfPersonaChangeImAddressesData FolksBackendsKfPersonaChangeImAddressesData;
typedef struct _FolksBackendsKfPersonaChangeWebServiceAddressesData FolksBackendsKfPersonaChangeWebServiceAddressesData;
typedef struct _FolksBackendsKfPersonaChangeAntiLinksData FolksBackendsKfPersonaChangeAntiLinksData;

struct _FolksBackendsKfPersona {
	FolksPersona parent_instance;
	FolksBackendsKfPersonaPrivate * priv;
};

struct _FolksBackendsKfPersonaClass {
	FolksPersonaClass parent_class;
};

struct _FolksBackendsKfPersonaPrivate {
	GeeHashMultiMap* _im_addresses;
	GeeHashMultiMap* _web_service_addresses;
	gchar* _alias;
	FolksSmallSet* _anti_links;
	GeeSet* _anti_links_ro;
};

struct _FolksBackendsKfPersonaChangeAliasData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksBackendsKfPersona* self;
	gchar* alias;
	const gchar* _tmp0_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GKeyFile* key_file;
	FolksPersonaStore* _tmp7_;
	FolksPersonaStore* _tmp8_;
	GKeyFile* _tmp9_;
	GKeyFile* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	FolksPersonaStore* _tmp14_;
	FolksPersonaStore* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
};

struct _FolksBackendsKfPersonaChangeImAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksBackendsKfPersona* self;
	GeeMultiMap* im_addresses;
	GKeyFile* key_file;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GKeyFile* _tmp2_;
	GeeIterator* _protocol1_it;
	GeeHashMultiMap* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	GeeIterator* _tmp6_;
	GeeIterator* _tmp7_;
	GeeIterator* _tmp8_;
	gboolean _tmp9_;
	gchar* protocol1;
	GeeIterator* _tmp10_;
	gpointer _tmp11_;
	GKeyFile* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	GError* e1;
	GeeHashMultiMap* new_im_addresses;
	GeeHashMultiMap* _tmp16_;
	GeeIterator* _protocol2_it;
	GeeMultiMap* _tmp17_;
	GeeSet* _tmp18_;
	GeeSet* _tmp19_;
	GeeIterator* _tmp20_;
	GeeIterator* _tmp21_;
	GeeIterator* _tmp22_;
	gboolean _tmp23_;
	gchar* protocol2;
	GeeIterator* _tmp24_;
	gpointer _tmp25_;
	GeeCollection* addresses;
	GeeMultiMap* _tmp26_;
	const gchar* _tmp27_;
	GeeCollection* _tmp28_;
	FolksSmallSet* normalised_addresses;
	FolksSmallSet* _tmp29_;
	GeeIterator* _im_fd_it;
	GeeCollection* _tmp30_;
	GeeIterator* _tmp31_;
	GeeIterator* _tmp32_;
	gboolean _tmp33_;
	FolksImFieldDetails* im_fd;
	GeeIterator* _tmp34_;
	gpointer _tmp35_;
	gchar* normalised_address;
	gchar* _tmp36_;
	FolksImFieldDetails* _tmp37_;
	gconstpointer _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	GError* e2;
	FolksImFieldDetails* _tmp43_;
	gconstpointer _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	GError* _tmp47_;
	const gchar* _tmp48_;
	GError* _tmp49_;
	FolksSmallSet* _tmp50_;
	const gchar* _tmp51_;
	FolksImFieldDetails* new_im_fd;
	const gchar* _tmp52_;
	FolksImFieldDetails* _tmp53_;
	GeeHashMultiMap* _tmp54_;
	const gchar* _tmp55_;
	FolksImFieldDetails* _tmp56_;
	gchar** addrs;
	FolksSmallSet* _tmp57_;
	gint _tmp58_;
	gpointer* _tmp59_;
	gint addrs_length1;
	gint _addrs_size_;
	FolksSmallSet* _tmp60_;
	gint _tmp61_;
	gint _tmp62_;
	gint _tmp63_;
	GKeyFile* _tmp64_;
	const gchar* _tmp65_;
	const gchar* _tmp66_;
	const gchar* _tmp67_;
	gchar** _tmp68_;
	gint _tmp68__length1;
	FolksPersonaStore* _tmp69_;
	FolksPersonaStore* _tmp70_;
	GeeHashMultiMap* _tmp71_;
	GeeHashMultiMap* _tmp72_;
	GError * _inner_error_;
};

struct _FolksBackendsKfPersonaChangeWebServiceAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksBackendsKfPersona* self;
	GeeMultiMap* web_service_addresses;
	GKeyFile* key_file;
	FolksPersonaStore* _tmp0_;
	FolksPersonaStore* _tmp1_;
	GKeyFile* _tmp2_;
	GeeIterator* _web_service1_it;
	GeeHashMultiMap* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	GeeIterator* _tmp6_;
	GeeIterator* _tmp7_;
	GeeIterator* _tmp8_;
	gboolean _tmp9_;
	gchar* web_service1;
	GeeIterator* _tmp10_;
	gpointer _tmp11_;
	GKeyFile* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	GError* e;
	GeeHashMultiMap* new_web_service_addresses;
	GeeHashMultiMap* _tmp18_;
	GeeIterator* _web_service2_it;
	GeeMultiMap* _tmp19_;
	GeeSet* _tmp20_;
	GeeSet* _tmp21_;
	GeeIterator* _tmp22_;
	GeeIterator* _tmp23_;
	GeeIterator* _tmp24_;
	gboolean _tmp25_;
	gchar* web_service2;
	GeeIterator* _tmp26_;
	gpointer _tmp27_;
	GeeCollection* ws_fds;
	GeeMultiMap* _tmp28_;
	const gchar* _tmp29_;
	GeeCollection* _tmp30_;
	gchar** addrs;
	gchar** _tmp31_;
	gint addrs_length1;
	gint _addrs_size_;
	GeeIterator* _ws_fd1_it;
	GeeCollection* _tmp32_;
	GeeIterator* _tmp33_;
	GeeIterator* _tmp34_;
	gboolean _tmp35_;
	FolksWebServiceFieldDetails* ws_fd1;
	GeeIterator* _tmp36_;
	gpointer _tmp37_;
	gchar** _tmp38_;
	gint _tmp38__length1;
	FolksWebServiceFieldDetails* _tmp39_;
	gconstpointer _tmp40_;
	const gchar* _tmp41_;
	gchar* _tmp42_;
	GKeyFile* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar** _tmp49_;
	gint _tmp49__length1;
	GeeIterator* _ws_fd2_it;
	GeeCollection* _tmp50_;
	GeeIterator* _tmp51_;
	GeeIterator* _tmp52_;
	gboolean _tmp53_;
	FolksWebServiceFieldDetails* ws_fd2;
	GeeIterator* _tmp54_;
	gpointer _tmp55_;
	GeeHashMultiMap* _tmp56_;
	const gchar* _tmp57_;
	FolksWebServiceFieldDetails* _tmp58_;
	FolksPersonaStore* _tmp59_;
	FolksPersonaStore* _tmp60_;
	GeeHashMultiMap* _tmp61_;
	GeeHashMultiMap* _tmp62_;
	GError * _inner_error_;
};

struct _FolksBackendsKfPersonaChangeAntiLinksData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksBackendsKfPersona* self;
	GeeSet* anti_links;
	GeeSet* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	gboolean _tmp3_;
	GKeyFile* key_file;
	FolksPersonaStore* _tmp4_;
	FolksPersonaStore* _tmp5_;
	GKeyFile* _tmp6_;
	GeeSet* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	GKeyFile* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	GeeSet* _tmp13_;
	gint _tmp14_;
	gpointer* _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	FolksPersonaStore* _tmp17_;
	FolksPersonaStore* _tmp18_;
	FolksSmallSet* _tmp19_;
	FolksSmallSet* _tmp20_;
	GeeSet* _tmp21_;
};


static gpointer folks_backends_kf_persona_parent_class = NULL;
static FolksAliasDetailsIface * folks_backends_kf_persona_folks_alias_details_parent_iface = NULL;
static FolksAntiLinkableIface * folks_backends_kf_persona_folks_anti_linkable_parent_iface = NULL;
static FolksImDetailsIface * folks_backends_kf_persona_folks_im_details_parent_iface = NULL;
static FolksWebServiceDetailsIface * folks_backends_kf_persona_folks_web_service_details_parent_iface = NULL;

GType folks_backends_kf_persona_get_type (void) G_GNUC_CONST;
#define FOLKS_BACKENDS_KF_PERSONA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FOLKS_BACKENDS_KF_TYPE_PERSONA, FolksBackendsKfPersonaPrivate))
enum  {
	FOLKS_BACKENDS_KF_PERSONA_DUMMY_PROPERTY,
	FOLKS_BACKENDS_KF_PERSONA_LINKABLE_PROPERTIES,
	FOLKS_BACKENDS_KF_PERSONA_WRITEABLE_PROPERTIES,
	FOLKS_BACKENDS_KF_PERSONA_ALIAS,
	FOLKS_BACKENDS_KF_PERSONA_IM_ADDRESSES,
	FOLKS_BACKENDS_KF_PERSONA_WEB_SERVICE_ADDRESSES,
	FOLKS_BACKENDS_KF_PERSONA_ANTI_LINKS
};
static void folks_backends_kf_persona_real_change_alias_data_free (gpointer _data);
static void folks_backends_kf_persona_real_change_alias (FolksAliasDetails* base, const gchar* alias, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean folks_backends_kf_persona_real_change_alias_co (FolksBackendsKfPersonaChangeAliasData* _data_);
GType folks_backends_kf_persona_store_get_type (void) G_GNUC_CONST;
GKeyFile* folks_backends_kf_persona_store_get_key_file (FolksBackendsKfPersonaStore* self);
void folks_backends_kf_persona_store_save_key_file (FolksBackendsKfPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void folks_backends_kf_persona_store_save_key_file_finish (FolksBackendsKfPersonaStore* self, GAsyncResult* _res_);
static void folks_backends_kf_persona_change_alias_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void folks_backends_kf_persona_real_change_im_addresses_data_free (gpointer _data);
static void folks_backends_kf_persona_real_change_im_addresses (FolksImDetails* base, GeeMultiMap* im_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean folks_backends_kf_persona_real_change_im_addresses_co (FolksBackendsKfPersonaChangeImAddressesData* _data_);
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 folks_backends_kf_persona_change_im_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void folks_backends_kf_persona_real_change_web_service_addresses_data_free (gpointer _data);
static void folks_backends_kf_persona_real_change_web_service_addresses (FolksWebServiceDetails* base, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean folks_backends_kf_persona_real_change_web_service_addresses_co (FolksBackendsKfPersonaChangeWebServiceAddressesData* _data_);
static void _vala_array_add2 (gchar** * array, int* length, int* size, gchar* value);
static void folks_backends_kf_persona_change_web_service_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void folks_backends_kf_persona_real_change_anti_links_data_free (gpointer _data);
static void folks_backends_kf_persona_real_change_anti_links (FolksAntiLinkable* base, GeeSet* anti_links, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean folks_backends_kf_persona_real_change_anti_links_co (FolksBackendsKfPersonaChangeAntiLinksData* _data_);
#define FOLKS_BACKENDS_KF_PERSONA_STORE_anti_links_key_name "__anti-links"
static void folks_backends_kf_persona_change_anti_links_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
FolksBackendsKfPersona* folks_backends_kf_persona_new (const gchar* id, FolksPersonaStore* store);
FolksBackendsKfPersona* folks_backends_kf_persona_construct (GType object_type, const gchar* id, FolksPersonaStore* store);
static void folks_backends_kf_persona_real_linkable_property_to_links (FolksPersona* base, const gchar* prop_name, FolksPersonaLinkablePropertyCallback callback, void* callback_target);
static GObject * folks_backends_kf_persona_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void folks_backends_kf_persona_finalize (GObject * obj);
static void _vala_folks_backends_kf_persona_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_folks_backends_kf_persona_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

static const gchar* FOLKS_BACKENDS_KF_PERSONA__linkable_properties[3] = {"im-addresses", "web-service-addresses", NULL};
static const gchar* FOLKS_BACKENDS_KF_PERSONA__writeable_properties[5] = {"alias", "im-addresses", "web-service-addresses", "anti-links", NULL};

static void folks_backends_kf_persona_real_change_alias_data_free (gpointer _data) {
	FolksBackendsKfPersonaChangeAliasData* _data_;
	_data_ = _data;
	_g_free0 (_data_->alias);
	_g_object_unref0 (_data_->self);
	g_slice_free (FolksBackendsKfPersonaChangeAliasData, _data_);
}


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


static void folks_backends_kf_persona_real_change_alias (FolksAliasDetails* base, const gchar* alias, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FolksBackendsKfPersona * self;
	FolksBackendsKfPersonaChangeAliasData* _data_;
	FolksBackendsKfPersona* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	self = (FolksBackendsKfPersona*) base;
	_data_ = g_slice_new0 (FolksBackendsKfPersonaChangeAliasData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, folks_backends_kf_persona_real_change_alias);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, folks_backends_kf_persona_real_change_alias_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = alias;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->alias);
	_data_->alias = _tmp2_;
	folks_backends_kf_persona_real_change_alias_co (_data_);
}


static void folks_backends_kf_persona_real_change_alias_finish (FolksAliasDetails* base, GAsyncResult* _res_, GError** error) {
	FolksBackendsKfPersonaChangeAliasData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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


static gboolean folks_backends_kf_persona_real_change_alias_co (FolksBackendsKfPersonaChangeAliasData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->alias;
	if (_data_->_tmp0_ == NULL) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("");
		_g_free0 (_data_->alias);
		_data_->alias = _tmp1_;
	}
	_data_->_tmp2_ = _data_->self->priv->_alias;
	_data_->_tmp3_ = _data_->alias;
	if (g_strcmp0 (_data_->_tmp2_, _data_->_tmp3_) == 0) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = folks_persona_get_uid ((FolksPersona*) _data_->self);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->alias;
	g_debug ("kf-persona.vala:103: Setting alias of Kf.Persona '%s' to '%s'.", _data_->_tmp5_, _data_->_tmp6_);
	_data_->_tmp7_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = folks_backends_kf_persona_store_get_key_file (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp8_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore));
	_data_->key_file = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->key_file;
	_data_->_tmp11_ = folks_persona_get_display_id ((FolksPersona*) _data_->self);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->alias;
	g_key_file_set_string (_data_->_tmp10_, _data_->_tmp12_, "__alias", _data_->_tmp13_);
	_data_->_tmp14_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_state_ = 1;
	folks_backends_kf_persona_store_save_key_file (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp15_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore), folks_backends_kf_persona_change_alias_ready, _data_);
	return FALSE;
	_state_1:
	folks_backends_kf_persona_store_save_key_file_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp15_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore), _data_->_res_);
	_data_->_tmp16_ = _data_->alias;
	_data_->_tmp17_ = g_strdup (_data_->_tmp16_);
	_g_free0 (_data_->self->priv->_alias);
	_data_->self->priv->_alias = _data_->_tmp17_;
	g_object_notify ((GObject*) _data_->self, "alias");
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void folks_backends_kf_persona_real_change_im_addresses (FolksImDetails* base, GeeMultiMap* im_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FolksBackendsKfPersona * self;
	FolksBackendsKfPersonaChangeImAddressesData* _data_;
	FolksBackendsKfPersona* _tmp0_;
	GeeMultiMap* _tmp1_;
	GeeMultiMap* _tmp2_;
	self = (FolksBackendsKfPersona*) base;
	_data_ = g_slice_new0 (FolksBackendsKfPersonaChangeImAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, folks_backends_kf_persona_real_change_im_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, folks_backends_kf_persona_real_change_im_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = im_addresses;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->im_addresses);
	_data_->im_addresses = _tmp2_;
	folks_backends_kf_persona_real_change_im_addresses_co (_data_);
}


static void folks_backends_kf_persona_real_change_im_addresses_finish (FolksImDetails* base, GAsyncResult* _res_, GError** error) {
	FolksBackendsKfPersonaChangeImAddressesData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static 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 folks_backends_kf_persona_change_im_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	FolksBackendsKfPersonaChangeImAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	folks_backends_kf_persona_real_change_im_addresses_co (_data_);
}


static gboolean folks_backends_kf_persona_real_change_im_addresses_co (FolksBackendsKfPersonaChangeImAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = folks_backends_kf_persona_store_get_key_file (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore));
	_data_->key_file = _data_->_tmp2_;
	{
		_data_->_tmp3_ = _data_->self->priv->_im_addresses;
		_data_->_tmp4_ = gee_multi_map_get_keys ((GeeMultiMap*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_g_object_unref0 (_data_->_tmp5_);
		_data_->_protocol1_it = _data_->_tmp7_;
		while (TRUE) {
			_data_->_tmp8_ = _data_->_protocol1_it;
			_data_->_tmp9_ = gee_iterator_next (_data_->_tmp8_);
			if (!_data_->_tmp9_) {
				break;
			}
			_data_->_tmp10_ = _data_->_protocol1_it;
			_data_->_tmp11_ = gee_iterator_get (_data_->_tmp10_);
			_data_->protocol1 = (gchar*) _data_->_tmp11_;
			{
				_data_->_tmp12_ = _data_->key_file;
				_data_->_tmp13_ = folks_persona_get_display_id ((FolksPersona*) _data_->self);
				_data_->_tmp14_ = _data_->_tmp13_;
				_data_->_tmp15_ = _data_->protocol1;
				g_key_file_remove_key (_data_->_tmp12_, _data_->_tmp14_, _data_->_tmp15_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if (_data_->_inner_error_->domain == G_KEY_FILE_ERROR) {
						goto __catch2_g_key_file_error;
					}
					_g_free0 (_data_->protocol1);
					_g_object_unref0 (_data_->_protocol1_it);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
					g_clear_error (&_data_->_inner_error_);
					return FALSE;
				}
			}
			goto __finally2;
			__catch2_g_key_file_error:
			{
				_data_->e1 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				_g_error_free0 (_data_->e1);
			}
			__finally2:
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
					g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
					_g_free0 (_data_->protocol1);
					_g_object_unref0 (_data_->_protocol1_it);
					if (_data_->_state_ == 0) {
						g_simple_async_result_complete_in_idle (_data_->_async_result);
					} else {
						g_simple_async_result_complete (_data_->_async_result);
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_free0 (_data_->protocol1);
					_g_object_unref0 (_data_->_protocol1_it);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
					g_clear_error (&_data_->_inner_error_);
					return FALSE;
				}
			}
			_g_free0 (_data_->protocol1);
		}
		_g_object_unref0 (_data_->_protocol1_it);
	}
	_data_->_tmp16_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, 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);
	_data_->new_im_addresses = _data_->_tmp16_;
	{
		_data_->_tmp17_ = _data_->im_addresses;
		_data_->_tmp18_ = gee_multi_map_get_keys (_data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_tmp20_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp19_);
		_data_->_tmp21_ = _data_->_tmp20_;
		_g_object_unref0 (_data_->_tmp19_);
		_data_->_protocol2_it = _data_->_tmp21_;
		while (TRUE) {
			_data_->_tmp22_ = _data_->_protocol2_it;
			_data_->_tmp23_ = gee_iterator_next (_data_->_tmp22_);
			if (!_data_->_tmp23_) {
				break;
			}
			_data_->_tmp24_ = _data_->_protocol2_it;
			_data_->_tmp25_ = gee_iterator_get (_data_->_tmp24_);
			_data_->protocol2 = (gchar*) _data_->_tmp25_;
			_data_->_tmp26_ = _data_->im_addresses;
			_data_->_tmp27_ = _data_->protocol2;
			_data_->_tmp28_ = gee_multi_map_get (_data_->_tmp26_, _data_->_tmp27_);
			_data_->addresses = _data_->_tmp28_;
			_data_->_tmp29_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
			_data_->normalised_addresses = _data_->_tmp29_;
			{
				_data_->_tmp30_ = _data_->addresses;
				_data_->_tmp31_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp30_);
				_data_->_im_fd_it = _data_->_tmp31_;
				while (TRUE) {
					_data_->_tmp32_ = _data_->_im_fd_it;
					_data_->_tmp33_ = gee_iterator_next (_data_->_tmp32_);
					if (!_data_->_tmp33_) {
						break;
					}
					_data_->_tmp34_ = _data_->_im_fd_it;
					_data_->_tmp35_ = gee_iterator_get (_data_->_tmp34_);
					_data_->im_fd = (FolksImFieldDetails*) _data_->_tmp35_;
					{
						_data_->_tmp37_ = _data_->im_fd;
						_data_->_tmp38_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp37_);
						_data_->_tmp39_ = _data_->_tmp38_;
						_data_->_tmp40_ = _data_->protocol2;
						_data_->_tmp41_ = folks_im_details_normalise_im_address ((const gchar*) _data_->_tmp39_, _data_->_tmp40_, &_data_->_inner_error_);
						_data_->_tmp36_ = _data_->_tmp41_;
						if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
							if (_data_->_inner_error_->domain == FOLKS_IM_DETAILS_ERROR) {
								goto __catch3_folks_im_details_error;
							}
							_g_free0 (_data_->normalised_address);
							_g_object_unref0 (_data_->im_fd);
							_g_object_unref0 (_data_->_im_fd_it);
							_g_object_unref0 (_data_->normalised_addresses);
							_g_object_unref0 (_data_->addresses);
							_g_free0 (_data_->protocol2);
							_g_object_unref0 (_data_->_protocol2_it);
							_g_object_unref0 (_data_->new_im_addresses);
							g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
							g_clear_error (&_data_->_inner_error_);
							return FALSE;
						}
						_data_->_tmp42_ = _data_->_tmp36_;
						_data_->_tmp36_ = NULL;
						_g_free0 (_data_->normalised_address);
						_data_->normalised_address = _data_->_tmp42_;
						_g_free0 (_data_->_tmp36_);
					}
					goto __finally3;
					__catch3_folks_im_details_error:
					{
						_data_->e2 = _data_->_inner_error_;
						_data_->_inner_error_ = NULL;
						_data_->_tmp43_ = _data_->im_fd;
						_data_->_tmp44_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp43_);
						_data_->_tmp45_ = _data_->_tmp44_;
						_data_->_tmp46_ = _data_->protocol2;
						_data_->_tmp47_ = _data_->e2;
						_data_->_tmp48_ = _data_->_tmp47_->message;
						_data_->_tmp49_ = g_error_new (FOLKS_PROPERTY_ERROR, FOLKS_PROPERTY_ERROR_INVALID_VALUE, _ ("Invalid IM address ‘%s’ for protocol ‘%s’: %s"), (const gchar*) _data_->_tmp45_, _data_->_tmp46_, _data_->_tmp48_);
						_data_->_inner_error_ = _data_->_tmp49_;
						_g_error_free0 (_data_->e2);
						goto __finally3;
					}
					__finally3:
					if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
						if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
							g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
							_g_free0 (_data_->normalised_address);
							_g_object_unref0 (_data_->im_fd);
							_g_object_unref0 (_data_->_im_fd_it);
							_g_object_unref0 (_data_->normalised_addresses);
							_g_object_unref0 (_data_->addresses);
							_g_free0 (_data_->protocol2);
							_g_object_unref0 (_data_->_protocol2_it);
							_g_object_unref0 (_data_->new_im_addresses);
							if (_data_->_state_ == 0) {
								g_simple_async_result_complete_in_idle (_data_->_async_result);
							} else {
								g_simple_async_result_complete (_data_->_async_result);
							}
							g_object_unref (_data_->_async_result);
							return FALSE;
						} else {
							_g_free0 (_data_->normalised_address);
							_g_object_unref0 (_data_->im_fd);
							_g_object_unref0 (_data_->_im_fd_it);
							_g_object_unref0 (_data_->normalised_addresses);
							_g_object_unref0 (_data_->addresses);
							_g_free0 (_data_->protocol2);
							_g_object_unref0 (_data_->_protocol2_it);
							_g_object_unref0 (_data_->new_im_addresses);
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
							g_clear_error (&_data_->_inner_error_);
							return FALSE;
						}
					}
					_data_->_tmp50_ = _data_->normalised_addresses;
					_data_->_tmp51_ = _data_->normalised_address;
					gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp50_, _data_->_tmp51_);
					_data_->_tmp52_ = _data_->normalised_address;
					_data_->_tmp53_ = folks_im_field_details_new (_data_->_tmp52_, NULL);
					_data_->new_im_fd = _data_->_tmp53_;
					_data_->_tmp54_ = _data_->new_im_addresses;
					_data_->_tmp55_ = _data_->protocol2;
					_data_->_tmp56_ = _data_->new_im_fd;
					gee_multi_map_set ((GeeMultiMap*) _data_->_tmp54_, _data_->_tmp55_, _data_->_tmp56_);
					_g_object_unref0 (_data_->new_im_fd);
					_g_free0 (_data_->normalised_address);
					_g_object_unref0 (_data_->im_fd);
				}
				_g_object_unref0 (_data_->_im_fd_it);
			}
			_data_->_tmp57_ = _data_->normalised_addresses;
			_data_->_tmp59_ = gee_collection_to_array ((GeeCollection*) _data_->_tmp57_, &_data_->_tmp58_);
			_data_->addrs = (gchar**) _data_->_tmp59_;
			_data_->addrs_length1 = (_data_->_tmp58_ * sizeof (gchar*)) / sizeof (gchar*);
			_data_->_addrs_size_ = _data_->addrs_length1;
			_data_->_tmp60_ = _data_->normalised_addresses;
			_data_->_tmp61_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp60_);
			_data_->_tmp62_ = _data_->_tmp61_;
			_data_->addrs_length1 = _data_->_tmp62_;
			_data_->_tmp63_ = _data_->addrs_length1;
			_data_->_tmp64_ = _data_->key_file;
			_data_->_tmp65_ = folks_persona_get_display_id ((FolksPersona*) _data_->self);
			_data_->_tmp66_ = _data_->_tmp65_;
			_data_->_tmp67_ = _data_->protocol2;
			_data_->_tmp68_ = _data_->addrs;
			_data_->_tmp68__length1 = _data_->addrs_length1;
			g_key_file_set_string_list (_data_->_tmp64_, _data_->_tmp66_, _data_->_tmp67_, (const gchar* const*) _data_->_tmp68_, _data_->_tmp68__length1);
			_data_->addrs = (_vala_array_free (_data_->addrs, _data_->addrs_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (_data_->normalised_addresses);
			_g_object_unref0 (_data_->addresses);
			_g_free0 (_data_->protocol2);
		}
		_g_object_unref0 (_data_->_protocol2_it);
	}
	_data_->_tmp69_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp70_ = _data_->_tmp69_;
	_data_->_state_ = 1;
	folks_backends_kf_persona_store_save_key_file (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp70_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore), folks_backends_kf_persona_change_im_addresses_ready, _data_);
	return FALSE;
	_state_1:
	folks_backends_kf_persona_store_save_key_file_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp70_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore), _data_->_res_);
	_data_->_tmp71_ = _data_->new_im_addresses;
	_data_->_tmp72_ = _g_object_ref0 (_data_->_tmp71_);
	_g_object_unref0 (_data_->self->priv->_im_addresses);
	_data_->self->priv->_im_addresses = _data_->_tmp72_;
	g_object_notify ((GObject*) _data_->self, "im-addresses");
	_g_object_unref0 (_data_->new_im_addresses);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void folks_backends_kf_persona_real_change_web_service_addresses (FolksWebServiceDetails* base, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FolksBackendsKfPersona * self;
	FolksBackendsKfPersonaChangeWebServiceAddressesData* _data_;
	FolksBackendsKfPersona* _tmp0_;
	GeeMultiMap* _tmp1_;
	GeeMultiMap* _tmp2_;
	self = (FolksBackendsKfPersona*) base;
	_data_ = g_slice_new0 (FolksBackendsKfPersonaChangeWebServiceAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, folks_backends_kf_persona_real_change_web_service_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, folks_backends_kf_persona_real_change_web_service_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = web_service_addresses;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->web_service_addresses);
	_data_->web_service_addresses = _tmp2_;
	folks_backends_kf_persona_real_change_web_service_addresses_co (_data_);
}


static void folks_backends_kf_persona_real_change_web_service_addresses_finish (FolksWebServiceDetails* base, GAsyncResult* _res_, GError** error) {
	FolksBackendsKfPersonaChangeWebServiceAddressesData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


/**
   * {@inheritDoc}
   *
   * @since 0.6.2
   */
static void _vala_array_add2 (gchar** * array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void folks_backends_kf_persona_change_web_service_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	FolksBackendsKfPersonaChangeWebServiceAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	folks_backends_kf_persona_real_change_web_service_addresses_co (_data_);
}


static gboolean folks_backends_kf_persona_real_change_web_service_addresses_co (FolksBackendsKfPersonaChangeWebServiceAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = folks_backends_kf_persona_store_get_key_file (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore));
	_data_->key_file = _data_->_tmp2_;
	{
		_data_->_tmp3_ = _data_->self->priv->_web_service_addresses;
		_data_->_tmp4_ = gee_multi_map_get_keys ((GeeMultiMap*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_g_object_unref0 (_data_->_tmp5_);
		_data_->_web_service1_it = _data_->_tmp7_;
		while (TRUE) {
			_data_->_tmp8_ = _data_->_web_service1_it;
			_data_->_tmp9_ = gee_iterator_next (_data_->_tmp8_);
			if (!_data_->_tmp9_) {
				break;
			}
			_data_->_tmp10_ = _data_->_web_service1_it;
			_data_->_tmp11_ = gee_iterator_get (_data_->_tmp10_);
			_data_->web_service1 = (gchar*) _data_->_tmp11_;
			{
				_data_->_tmp12_ = _data_->key_file;
				_data_->_tmp13_ = folks_persona_get_display_id ((FolksPersona*) _data_->self);
				_data_->_tmp14_ = _data_->_tmp13_;
				_data_->_tmp15_ = _data_->web_service1;
				_data_->_tmp16_ = g_strconcat ("web-service.", _data_->_tmp15_, NULL);
				_data_->_tmp17_ = _data_->_tmp16_;
				g_key_file_remove_key (_data_->_tmp12_, _data_->_tmp14_, _data_->_tmp17_, &_data_->_inner_error_);
				_g_free0 (_data_->_tmp17_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if (_data_->_inner_error_->domain == G_KEY_FILE_ERROR) {
						goto __catch4_g_key_file_error;
					}
					_g_free0 (_data_->web_service1);
					_g_object_unref0 (_data_->_web_service1_it);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
					g_clear_error (&_data_->_inner_error_);
					return FALSE;
				}
			}
			goto __finally4;
			__catch4_g_key_file_error:
			{
				_data_->e = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				_g_error_free0 (_data_->e);
			}
			__finally4:
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
					g_simple_async_result_take_error (_data_->_async_result, _data_->_inner_error_);
					_g_free0 (_data_->web_service1);
					_g_object_unref0 (_data_->_web_service1_it);
					if (_data_->_state_ == 0) {
						g_simple_async_result_complete_in_idle (_data_->_async_result);
					} else {
						g_simple_async_result_complete (_data_->_async_result);
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_free0 (_data_->web_service1);
					_g_object_unref0 (_data_->_web_service1_it);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
					g_clear_error (&_data_->_inner_error_);
					return FALSE;
				}
			}
			_g_free0 (_data_->web_service1);
		}
		_g_object_unref0 (_data_->_web_service1_it);
	}
	_data_->_tmp18_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, 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);
	_data_->new_web_service_addresses = _data_->_tmp18_;
	{
		_data_->_tmp19_ = _data_->web_service_addresses;
		_data_->_tmp20_ = gee_multi_map_get_keys (_data_->_tmp19_);
		_data_->_tmp21_ = _data_->_tmp20_;
		_data_->_tmp22_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_g_object_unref0 (_data_->_tmp21_);
		_data_->_web_service2_it = _data_->_tmp23_;
		while (TRUE) {
			_data_->_tmp24_ = _data_->_web_service2_it;
			_data_->_tmp25_ = gee_iterator_next (_data_->_tmp24_);
			if (!_data_->_tmp25_) {
				break;
			}
			_data_->_tmp26_ = _data_->_web_service2_it;
			_data_->_tmp27_ = gee_iterator_get (_data_->_tmp26_);
			_data_->web_service2 = (gchar*) _data_->_tmp27_;
			_data_->_tmp28_ = _data_->web_service_addresses;
			_data_->_tmp29_ = _data_->web_service2;
			_data_->_tmp30_ = gee_multi_map_get (_data_->_tmp28_, _data_->_tmp29_);
			_data_->ws_fds = _data_->_tmp30_;
			_data_->_tmp31_ = g_new0 (gchar*, 0 + 1);
			_data_->addrs = _data_->_tmp31_;
			_data_->addrs_length1 = 0;
			_data_->_addrs_size_ = _data_->addrs_length1;
			{
				_data_->_tmp32_ = _data_->ws_fds;
				_data_->_tmp33_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp32_);
				_data_->_ws_fd1_it = _data_->_tmp33_;
				while (TRUE) {
					_data_->_tmp34_ = _data_->_ws_fd1_it;
					_data_->_tmp35_ = gee_iterator_next (_data_->_tmp34_);
					if (!_data_->_tmp35_) {
						break;
					}
					_data_->_tmp36_ = _data_->_ws_fd1_it;
					_data_->_tmp37_ = gee_iterator_get (_data_->_tmp36_);
					_data_->ws_fd1 = (FolksWebServiceFieldDetails*) _data_->_tmp37_;
					_data_->_tmp38_ = _data_->addrs;
					_data_->_tmp38__length1 = _data_->addrs_length1;
					_data_->_tmp39_ = _data_->ws_fd1;
					_data_->_tmp40_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp39_);
					_data_->_tmp41_ = _data_->_tmp40_;
					_data_->_tmp42_ = g_strdup ((const gchar*) _data_->_tmp41_);
					_vala_array_add2 (&_data_->addrs, &_data_->addrs_length1, &_data_->_addrs_size_, _data_->_tmp42_);
					_g_object_unref0 (_data_->ws_fd1);
				}
				_g_object_unref0 (_data_->_ws_fd1_it);
			}
			_data_->_tmp43_ = _data_->key_file;
			_data_->_tmp44_ = folks_persona_get_display_id ((FolksPersona*) _data_->self);
			_data_->_tmp45_ = _data_->_tmp44_;
			_data_->_tmp46_ = _data_->web_service2;
			_data_->_tmp47_ = g_strconcat ("web-service.", _data_->_tmp46_, NULL);
			_data_->_tmp48_ = _data_->_tmp47_;
			_data_->_tmp49_ = _data_->addrs;
			_data_->_tmp49__length1 = _data_->addrs_length1;
			g_key_file_set_string_list (_data_->_tmp43_, _data_->_tmp45_, _data_->_tmp48_, (const gchar* const*) _data_->_tmp49_, _data_->_tmp49__length1);
			_g_free0 (_data_->_tmp48_);
			{
				_data_->_tmp50_ = _data_->ws_fds;
				_data_->_tmp51_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp50_);
				_data_->_ws_fd2_it = _data_->_tmp51_;
				while (TRUE) {
					_data_->_tmp52_ = _data_->_ws_fd2_it;
					_data_->_tmp53_ = gee_iterator_next (_data_->_tmp52_);
					if (!_data_->_tmp53_) {
						break;
					}
					_data_->_tmp54_ = _data_->_ws_fd2_it;
					_data_->_tmp55_ = gee_iterator_get (_data_->_tmp54_);
					_data_->ws_fd2 = (FolksWebServiceFieldDetails*) _data_->_tmp55_;
					_data_->_tmp56_ = _data_->new_web_service_addresses;
					_data_->_tmp57_ = _data_->web_service2;
					_data_->_tmp58_ = _data_->ws_fd2;
					gee_multi_map_set ((GeeMultiMap*) _data_->_tmp56_, _data_->_tmp57_, _data_->_tmp58_);
					_g_object_unref0 (_data_->ws_fd2);
				}
				_g_object_unref0 (_data_->_ws_fd2_it);
			}
			_data_->addrs = (_vala_array_free (_data_->addrs, _data_->addrs_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (_data_->ws_fds);
			_g_free0 (_data_->web_service2);
		}
		_g_object_unref0 (_data_->_web_service2_it);
	}
	_data_->_tmp59_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp60_ = _data_->_tmp59_;
	_data_->_state_ = 1;
	folks_backends_kf_persona_store_save_key_file (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp60_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore), folks_backends_kf_persona_change_web_service_addresses_ready, _data_);
	return FALSE;
	_state_1:
	folks_backends_kf_persona_store_save_key_file_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp60_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore), _data_->_res_);
	_data_->_tmp61_ = _data_->new_web_service_addresses;
	_data_->_tmp62_ = _g_object_ref0 (_data_->_tmp61_);
	_g_object_unref0 (_data_->self->priv->_web_service_addresses);
	_data_->self->priv->_web_service_addresses = _data_->_tmp62_;
	g_object_notify ((GObject*) _data_->self, "web-service-addresses");
	_g_object_unref0 (_data_->new_web_service_addresses);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void folks_backends_kf_persona_real_change_anti_links (FolksAntiLinkable* base, GeeSet* anti_links, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FolksBackendsKfPersona * self;
	FolksBackendsKfPersonaChangeAntiLinksData* _data_;
	FolksBackendsKfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	self = (FolksBackendsKfPersona*) base;
	_data_ = g_slice_new0 (FolksBackendsKfPersonaChangeAntiLinksData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, folks_backends_kf_persona_real_change_anti_links);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, folks_backends_kf_persona_real_change_anti_links_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = anti_links;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->anti_links);
	_data_->anti_links = _tmp2_;
	folks_backends_kf_persona_real_change_anti_links_co (_data_);
}


static void folks_backends_kf_persona_real_change_anti_links_finish (FolksAntiLinkable* base, GAsyncResult* _res_, GError** error) {
	FolksBackendsKfPersonaChangeAntiLinksData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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


static gboolean folks_backends_kf_persona_real_change_anti_links_co (FolksBackendsKfPersonaChangeAntiLinksData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->anti_links;
	_data_->_tmp1_ = folks_anti_linkable_get_anti_links ((FolksAntiLinkable*) _data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = folks_internal_equal_sets (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _data_->_tmp0_, _data_->_tmp2_);
	if (_data_->_tmp3_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = folks_backends_kf_persona_store_get_key_file (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore));
	_data_->key_file = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->anti_links;
	_data_->_tmp8_ = folks_persona_get_uid ((FolksPersona*) _data_->self);
	_data_->_tmp9_ = _data_->_tmp8_;
	gee_collection_remove ((GeeCollection*) _data_->_tmp7_, _data_->_tmp9_);
	_data_->_tmp10_ = _data_->key_file;
	_data_->_tmp11_ = folks_persona_get_display_id ((FolksPersona*) _data_->self);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->anti_links;
	_data_->_tmp15_ = gee_collection_to_array ((GeeCollection*) _data_->_tmp13_, &_data_->_tmp14_);
	_data_->_tmp16_ = _data_->_tmp15_;
	_data_->_tmp16__length1 = _data_->_tmp14_;
	g_key_file_set_string_list (_data_->_tmp10_, _data_->_tmp12_, FOLKS_BACKENDS_KF_PERSONA_STORE_anti_links_key_name, (const gchar* const*) _data_->_tmp16_, _data_->_tmp14_);
	_data_->_tmp16_ = (_vala_array_free (_data_->_tmp16_, _data_->_tmp16__length1, (GDestroyNotify) g_free), NULL);
	_data_->_tmp17_ = folks_persona_get_store ((FolksPersona*) _data_->self);
	_data_->_tmp18_ = _data_->_tmp17_;
	_data_->_state_ = 1;
	folks_backends_kf_persona_store_save_key_file (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp18_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore), folks_backends_kf_persona_change_anti_links_ready, _data_);
	return FALSE;
	_state_1:
	folks_backends_kf_persona_store_save_key_file_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp18_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore), _data_->_res_);
	_data_->_tmp19_ = _data_->self->priv->_anti_links;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _data_->_tmp19_);
	_data_->_tmp20_ = _data_->self->priv->_anti_links;
	_data_->_tmp21_ = _data_->anti_links;
	gee_collection_add_all ((GeeCollection*) _data_->_tmp20_, (GeeCollection*) _data_->_tmp21_);
	g_object_notify ((GObject*) _data_->self, "anti-links");
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


/**
   * Create a new persona.
   *
   * Create a new persona for the {@link PersonaStore} ``store``, representing
   * the Persona given by the group ``uid`` in the key file ``key_file``.
   */
FolksBackendsKfPersona* folks_backends_kf_persona_construct (GType object_type, const gchar* id, FolksPersonaStore* store) {
	FolksBackendsKfPersona * self = NULL;
	gchar* iid;
	FolksPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* uid;
	FolksPersonaStore* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	FolksPersonaStore* _tmp14_;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (store != NULL, NULL);
	_tmp0_ = store;
	_tmp1_ = folks_persona_store_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (_tmp2_, ":", NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = id;
	_tmp6_ = g_strconcat (_tmp4_, _tmp5_, NULL);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp4_);
	iid = _tmp7_;
	_tmp8_ = store;
	_tmp9_ = folks_persona_store_get_id (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = id;
	_tmp12_ = folks_persona_build_uid ("key-file", _tmp10_, _tmp11_);
	uid = _tmp12_;
	_tmp13_ = id;
	_tmp14_ = store;
	self = (FolksBackendsKfPersona*) g_object_new (object_type, "display-id", _tmp13_, "iid", iid, "uid", uid, "store", _tmp14_, "is-user", FALSE, NULL);
	_g_free0 (uid);
	_g_free0 (iid);
	return self;
}


FolksBackendsKfPersona* folks_backends_kf_persona_new (const gchar* id, FolksPersonaStore* store) {
	return folks_backends_kf_persona_construct (FOLKS_BACKENDS_KF_TYPE_PERSONA, id, store);
}


/**
   * {@inheritDoc}
   */
static void folks_backends_kf_persona_real_linkable_property_to_links (FolksPersona* base, const gchar* prop_name, FolksPersonaLinkablePropertyCallback callback, void* callback_target) {
	FolksBackendsKfPersona * self;
	const gchar* _tmp0_;
	self = (FolksBackendsKfPersona*) base;
	g_return_if_fail (prop_name != NULL);
	_tmp0_ = prop_name;
	if (g_strcmp0 (_tmp0_, "im-addresses") == 0) {
		GeeMapIterator* iter;
		GeeHashMultiMap* _tmp1_;
		GeeMapIterator* _tmp2_;
		_tmp1_ = self->priv->_im_addresses;
		_tmp2_ = gee_multi_map_map_iterator ((GeeMultiMap*) _tmp1_);
		iter = _tmp2_;
		while (TRUE) {
			GeeMapIterator* _tmp3_;
			gboolean _tmp4_;
			FolksPersonaLinkablePropertyCallback _tmp5_;
			void* _tmp5__target;
			GeeMapIterator* _tmp6_;
			gpointer _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			GeeMapIterator* _tmp11_;
			gpointer _tmp12_;
			FolksImFieldDetails* _tmp13_;
			gconstpointer _tmp14_;
			const gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			_tmp3_ = iter;
			_tmp4_ = gee_map_iterator_next (_tmp3_);
			if (!_tmp4_) {
				break;
			}
			_tmp5_ = callback;
			_tmp5__target = callback_target;
			_tmp6_ = iter;
			_tmp7_ = gee_map_iterator_get_key (_tmp6_);
			_tmp8_ = (gchar*) _tmp7_;
			_tmp9_ = g_strconcat (_tmp8_, ":", NULL);
			_tmp10_ = _tmp9_;
			_tmp11_ = iter;
			_tmp12_ = gee_map_iterator_get_value (_tmp11_);
			_tmp13_ = (FolksImFieldDetails*) _tmp12_;
			_tmp14_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = g_strconcat (_tmp10_, (const gchar*) _tmp15_, NULL);
			_tmp17_ = _tmp16_;
			_tmp5_ (_tmp17_, _tmp5__target);
			_g_free0 (_tmp17_);
			_g_object_unref0 (_tmp13_);
			_g_free0 (_tmp10_);
			_g_free0 (_tmp8_);
		}
		_g_object_unref0 (iter);
	} else {
		const gchar* _tmp18_;
		_tmp18_ = prop_name;
		if (g_strcmp0 (_tmp18_, "web-service-addresses") == 0) {
			GeeMapIterator* iter;
			GeeMultiMap* _tmp19_;
			GeeMultiMap* _tmp20_;
			GeeMapIterator* _tmp21_;
			_tmp19_ = folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) self);
			_tmp20_ = _tmp19_;
			_tmp21_ = gee_multi_map_map_iterator (_tmp20_);
			iter = _tmp21_;
			while (TRUE) {
				GeeMapIterator* _tmp22_;
				gboolean _tmp23_;
				FolksPersonaLinkablePropertyCallback _tmp24_;
				void* _tmp24__target;
				GeeMapIterator* _tmp25_;
				gpointer _tmp26_;
				gchar* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				GeeMapIterator* _tmp30_;
				gpointer _tmp31_;
				FolksWebServiceFieldDetails* _tmp32_;
				gconstpointer _tmp33_;
				const gchar* _tmp34_;
				gchar* _tmp35_;
				gchar* _tmp36_;
				_tmp22_ = iter;
				_tmp23_ = gee_map_iterator_next (_tmp22_);
				if (!_tmp23_) {
					break;
				}
				_tmp24_ = callback;
				_tmp24__target = callback_target;
				_tmp25_ = iter;
				_tmp26_ = gee_map_iterator_get_key (_tmp25_);
				_tmp27_ = (gchar*) _tmp26_;
				_tmp28_ = g_strconcat (_tmp27_, ":", NULL);
				_tmp29_ = _tmp28_;
				_tmp30_ = iter;
				_tmp31_ = gee_map_iterator_get_value (_tmp30_);
				_tmp32_ = (FolksWebServiceFieldDetails*) _tmp31_;
				_tmp33_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp32_);
				_tmp34_ = _tmp33_;
				_tmp35_ = g_strconcat (_tmp29_, (const gchar*) _tmp34_, NULL);
				_tmp36_ = _tmp35_;
				_tmp24_ (_tmp36_, _tmp24__target);
				_g_free0 (_tmp36_);
				_g_object_unref0 (_tmp32_);
				_g_free0 (_tmp29_);
				_g_free0 (_tmp27_);
			}
			_g_object_unref0 (iter);
		} else {
			const gchar* _tmp37_;
			FolksPersonaLinkablePropertyCallback _tmp38_;
			void* _tmp38__target;
			_tmp37_ = prop_name;
			_tmp38_ = callback;
			_tmp38__target = callback_target;
			FOLKS_PERSONA_CLASS (folks_backends_kf_persona_parent_class)->linkable_property_to_links (G_TYPE_CHECK_INSTANCE_CAST (self, FOLKS_TYPE_PERSONA, FolksPersona), _tmp37_, _tmp38_, _tmp38__target);
		}
	}
}


static gchar** folks_backends_kf_persona_real_get_linkable_properties (FolksPersona* base, int* result_length1) {
	gchar** result;
	FolksBackendsKfPersona* self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	self = (FolksBackendsKfPersona*) base;
	_tmp0_ = FOLKS_BACKENDS_KF_PERSONA__linkable_properties;
	_tmp0__length1 = G_N_ELEMENTS (FOLKS_BACKENDS_KF_PERSONA__linkable_properties);
	if (result_length1) {
		*result_length1 = _tmp0__length1;
	}
	result = _tmp0_;
	return result;
}


static gchar** folks_backends_kf_persona_real_get_writeable_properties (FolksPersona* base, int* result_length1) {
	gchar** result;
	FolksBackendsKfPersona* self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	self = (FolksBackendsKfPersona*) base;
	_tmp0_ = FOLKS_BACKENDS_KF_PERSONA__writeable_properties;
	_tmp0__length1 = G_N_ELEMENTS (FOLKS_BACKENDS_KF_PERSONA__writeable_properties);
	if (result_length1) {
		*result_length1 = _tmp0__length1;
	}
	result = _tmp0_;
	return result;
}


static const gchar* folks_backends_kf_persona_real_get_alias (FolksAliasDetails* base) {
	const gchar* result;
	FolksBackendsKfPersona* self;
	const gchar* _tmp0_;
	self = (FolksBackendsKfPersona*) base;
	_tmp0_ = self->priv->_alias;
	result = _tmp0_;
	return result;
}


static void folks_backends_kf_persona_real_set_alias (FolksAliasDetails* base, const gchar* value) {
	FolksBackendsKfPersona* self;
	const gchar* _tmp0_;
	self = (FolksBackendsKfPersona*) base;
	_tmp0_ = value;
	folks_alias_details_change_alias ((FolksAliasDetails*) self, _tmp0_, NULL, NULL);
}


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


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


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


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


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


static void folks_backends_kf_persona_real_set_anti_links (FolksAntiLinkable* base, GeeSet* value) {
	FolksBackendsKfPersona* self;
	GeeSet* _tmp0_;
	self = (FolksBackendsKfPersona*) base;
	_tmp0_ = value;
	folks_anti_linkable_change_anti_links ((FolksAntiLinkable*) self, _tmp0_, NULL, NULL);
}


static GObject * folks_backends_kf_persona_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	FolksBackendsKfPersona * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GeeHashMultiMap* _tmp6_;
	GeeHashMultiMap* _tmp7_;
	FolksSmallSet* _tmp8_;
	FolksSmallSet* _tmp9_;
	GeeSet* _tmp10_;
	GeeSet* _tmp11_;
	GKeyFile* key_file;
	FolksPersonaStore* _tmp12_;
	FolksPersonaStore* _tmp13_;
	GKeyFile* _tmp14_;
	GError * _inner_error_ = NULL;
	parent_class = G_OBJECT_CLASS (folks_backends_kf_persona_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FOLKS_BACKENDS_KF_TYPE_PERSONA, FolksBackendsKfPersona);
	_tmp0_ = folks_persona_get_uid ((FolksPersona*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = folks_persona_get_iid ((FolksPersona*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = folks_persona_get_display_id ((FolksPersona*) self);
	_tmp5_ = _tmp4_;
	g_debug ("kf-persona.vala:326: Adding key-file Persona '%s' (IID '%s', group '%s" \
"')", _tmp1_, _tmp3_, _tmp5_);
	_tmp6_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, 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->_im_addresses);
	self->priv->_im_addresses = _tmp6_;
	_tmp7_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, 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 = _tmp7_;
	_tmp8_ = folks_small_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->_anti_links);
	self->priv->_anti_links = _tmp8_;
	_tmp9_ = self->priv->_anti_links;
	_tmp10_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp9_);
	_tmp11_ = _tmp10_;
	_g_object_unref0 (self->priv->_anti_links_ro);
	self->priv->_anti_links_ro = _tmp11_;
	_tmp12_ = folks_persona_get_store ((FolksPersona*) self);
	_tmp13_ = _tmp12_;
	_tmp14_ = folks_backends_kf_persona_store_get_key_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, FOLKS_BACKENDS_KF_TYPE_PERSONA_STORE, FolksBackendsKfPersonaStore));
	key_file = _tmp14_;
	{
		gchar** keys;
		GKeyFile* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		gsize _tmp18_;
		gchar** _tmp19_;
		gint keys_length1;
		gint _keys_size_;
		gchar** _tmp20_;
		gint _tmp20__length1;
		_tmp15_ = key_file;
		_tmp16_ = folks_persona_get_display_id ((FolksPersona*) self);
		_tmp17_ = _tmp16_;
		_tmp19_ = g_key_file_get_keys (_tmp15_, _tmp17_, &_tmp18_, &_inner_error_);
		keys = _tmp19_;
		keys_length1 = _tmp18_;
		_keys_size_ = keys_length1;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_KEY_FILE_ERROR) {
				goto __catch5_g_key_file_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
		}
		_tmp20_ = keys;
		_tmp20__length1 = keys_length1;
		{
			gchar** key_collection = NULL;
			gint key_collection_length1 = 0;
			gint _key_collection_size_ = 0;
			gint key_it = 0;
			key_collection = _tmp20_;
			key_collection_length1 = _tmp20__length1;
			for (key_it = 0; key_it < _tmp20__length1; key_it = key_it + 1) {
				const gchar* key = NULL;
				key = key_collection[key_it];
				{
					const gchar* _tmp21_;
					const gchar* _tmp32_;
					gchar** decomposed_key;
					const gchar* _tmp45_;
					gchar** _tmp46_;
					gchar** _tmp47_;
					gint decomposed_key_length1;
					gint _decomposed_key_size_;
					gboolean _tmp48_ = FALSE;
					gchar** _tmp49_;
					gint _tmp49__length1;
					const gchar* protocol;
					const gchar* _tmp67_;
					gchar** im_addresses;
					GKeyFile* _tmp68_;
					const gchar* _tmp69_;
					const gchar* _tmp70_;
					const gchar* _tmp71_;
					gsize _tmp72_;
					gchar** _tmp73_;
					gint im_addresses_length1;
					gint _im_addresses_size_;
					gchar** _tmp74_;
					gint _tmp74__length1;
					_tmp21_ = key;
					if (g_strcmp0 (_tmp21_, "__alias") == 0) {
						gchar* _tmp22_;
						GKeyFile* _tmp23_;
						const gchar* _tmp24_;
						const gchar* _tmp25_;
						const gchar* _tmp26_;
						gchar* _tmp27_;
						gchar* _tmp28_;
						const gchar* _tmp29_;
						const gchar* _tmp31_;
						_tmp23_ = key_file;
						_tmp24_ = folks_persona_get_display_id ((FolksPersona*) self);
						_tmp25_ = _tmp24_;
						_tmp26_ = key;
						_tmp27_ = g_key_file_get_string (_tmp23_, _tmp25_, _tmp26_, &_inner_error_);
						_tmp22_ = _tmp27_;
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
							if (_inner_error_->domain == G_KEY_FILE_ERROR) {
								goto __catch5_g_key_file_error;
							}
							keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
							g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
							g_clear_error (&_inner_error_);
						}
						_tmp28_ = _tmp22_;
						_tmp22_ = NULL;
						_g_free0 (self->priv->_alias);
						self->priv->_alias = _tmp28_;
						_tmp29_ = self->priv->_alias;
						if (_tmp29_ == NULL) {
							gchar* _tmp30_;
							_tmp30_ = g_strdup ("");
							_g_free0 (self->priv->_alias);
							self->priv->_alias = _tmp30_;
						}
						_tmp31_ = self->priv->_alias;
						g_debug ("kf-persona.vala:357:     Loaded alias '%s'.", _tmp31_);
						_g_free0 (_tmp22_);
						continue;
					}
					_tmp32_ = key;
					if (g_strcmp0 (_tmp32_, FOLKS_BACKENDS_KF_PERSONA_STORE_anti_links_key_name) == 0) {
						gchar** anti_link_array;
						GKeyFile* _tmp33_;
						const gchar* _tmp34_;
						const gchar* _tmp35_;
						const gchar* _tmp36_;
						gsize _tmp37_;
						gchar** _tmp38_;
						gint anti_link_array_length1;
						gint _anti_link_array_size_;
						gchar** _tmp39_;
						gint _tmp39__length1;
						_tmp33_ = key_file;
						_tmp34_ = folks_persona_get_display_id ((FolksPersona*) self);
						_tmp35_ = _tmp34_;
						_tmp36_ = key;
						_tmp38_ = g_key_file_get_string_list (_tmp33_, _tmp35_, _tmp36_, &_tmp37_, &_inner_error_);
						anti_link_array = _tmp38_;
						anti_link_array_length1 = _tmp37_;
						_anti_link_array_size_ = anti_link_array_length1;
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
							if (_inner_error_->domain == G_KEY_FILE_ERROR) {
								goto __catch5_g_key_file_error;
							}
							keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
							g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
							g_clear_error (&_inner_error_);
						}
						_tmp39_ = anti_link_array;
						_tmp39__length1 = anti_link_array_length1;
						if (_tmp39_ != NULL) {
							gchar** _tmp40_;
							gint _tmp40__length1;
							gchar** _tmp44_;
							gint _tmp44__length1;
							_tmp40_ = anti_link_array;
							_tmp40__length1 = anti_link_array_length1;
							{
								gchar** anti_link_collection = NULL;
								gint anti_link_collection_length1 = 0;
								gint _anti_link_collection_size_ = 0;
								gint anti_link_it = 0;
								anti_link_collection = _tmp40_;
								anti_link_collection_length1 = _tmp40__length1;
								for (anti_link_it = 0; anti_link_it < _tmp40__length1; anti_link_it = anti_link_it + 1) {
									gchar* _tmp41_;
									gchar* anti_link = NULL;
									_tmp41_ = g_strdup (anti_link_collection[anti_link_it]);
									anti_link = _tmp41_;
									{
										FolksSmallSet* _tmp42_;
										const gchar* _tmp43_;
										_tmp42_ = self->priv->_anti_links;
										_tmp43_ = anti_link;
										gee_abstract_collection_add ((GeeAbstractCollection*) _tmp42_, _tmp43_);
										_g_free0 (anti_link);
									}
								}
							}
							_tmp44_ = anti_link_array;
							_tmp44__length1 = anti_link_array_length1;
							g_debug ("kf-persona.vala:374:     Loaded %u anti-links.", (guint) _tmp44__length1);
							anti_link_array = (_vala_array_free (anti_link_array, anti_link_array_length1, (GDestroyNotify) g_free), NULL);
							continue;
						}
						anti_link_array = (_vala_array_free (anti_link_array, anti_link_array_length1, (GDestroyNotify) g_free), NULL);
					}
					_tmp45_ = key;
					_tmp47_ = _tmp46_ = g_strsplit (_tmp45_, ".", 2);
					decomposed_key = _tmp47_;
					decomposed_key_length1 = _vala_array_length (_tmp46_);
					_decomposed_key_size_ = decomposed_key_length1;
					_tmp49_ = decomposed_key;
					_tmp49__length1 = decomposed_key_length1;
					if (_tmp49__length1 == 2) {
						gchar** _tmp50_;
						gint _tmp50__length1;
						const gchar* _tmp51_;
						_tmp50_ = decomposed_key;
						_tmp50__length1 = decomposed_key_length1;
						_tmp51_ = _tmp50_[0];
						_tmp48_ = g_strcmp0 (_tmp51_, "web-service") == 0;
					} else {
						_tmp48_ = FALSE;
					}
					if (_tmp48_) {
						const gchar* web_service;
						gchar** _tmp52_;
						gint _tmp52__length1;
						const gchar* _tmp53_;
						gchar** web_service_addresses;
						GKeyFile* _tmp54_;
						const gchar* _tmp55_;
						const gchar* _tmp56_;
						const gchar* _tmp57_;
						gsize _tmp58_;
						gchar** _tmp59_;
						gint web_service_addresses_length1;
						gint _web_service_addresses_size_;
						gchar** _tmp60_;
						gint _tmp60__length1;
						_tmp52_ = decomposed_key;
						_tmp52__length1 = decomposed_key_length1;
						_tmp53_ = _tmp52_[1];
						web_service = _tmp53_;
						_tmp54_ = key_file;
						_tmp55_ = folks_persona_get_display_id ((FolksPersona*) self);
						_tmp56_ = _tmp55_;
						_tmp57_ = web_service;
						_tmp59_ = g_key_file_get_string_list (_tmp54_, _tmp56_, _tmp57_, &_tmp58_, &_inner_error_);
						web_service_addresses = _tmp59_;
						web_service_addresses_length1 = _tmp58_;
						_web_service_addresses_size_ = web_service_addresses_length1;
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
							keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
							if (_inner_error_->domain == G_KEY_FILE_ERROR) {
								goto __catch5_g_key_file_error;
							}
							decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
							keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
							g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
							g_clear_error (&_inner_error_);
						}
						_tmp60_ = web_service_addresses;
						_tmp60__length1 = web_service_addresses_length1;
						{
							gchar** web_service_address_collection = NULL;
							gint web_service_address_collection_length1 = 0;
							gint _web_service_address_collection_size_ = 0;
							gint web_service_address_it = 0;
							web_service_address_collection = _tmp60_;
							web_service_address_collection_length1 = _tmp60__length1;
							for (web_service_address_it = 0; web_service_address_it < _tmp60__length1; web_service_address_it = web_service_address_it + 1) {
								gchar* _tmp61_;
								gchar* web_service_address = NULL;
								_tmp61_ = g_strdup (web_service_address_collection[web_service_address_it]);
								web_service_address = _tmp61_;
								{
									GeeHashMultiMap* _tmp62_;
									const gchar* _tmp63_;
									const gchar* _tmp64_;
									FolksWebServiceFieldDetails* _tmp65_;
									FolksWebServiceFieldDetails* _tmp66_;
									_tmp62_ = self->priv->_web_service_addresses;
									_tmp63_ = web_service;
									_tmp64_ = web_service_address;
									_tmp65_ = folks_web_service_field_details_new (_tmp64_, NULL);
									_tmp66_ = _tmp65_;
									gee_multi_map_set ((GeeMultiMap*) _tmp62_, _tmp63_, _tmp66_);
									_g_object_unref0 (_tmp66_);
									_g_free0 (web_service_address);
								}
							}
						}
						web_service_addresses = (_vala_array_free (web_service_addresses, web_service_addresses_length1, (GDestroyNotify) g_free), NULL);
						decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
						continue;
					}
					_tmp67_ = key;
					protocol = _tmp67_;
					_tmp68_ = key_file;
					_tmp69_ = folks_persona_get_display_id ((FolksPersona*) self);
					_tmp70_ = _tmp69_;
					_tmp71_ = protocol;
					_tmp73_ = g_key_file_get_string_list (_tmp68_, _tmp70_, _tmp71_, &_tmp72_, &_inner_error_);
					im_addresses = _tmp73_;
					im_addresses_length1 = _tmp72_;
					_im_addresses_size_ = im_addresses_length1;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
						keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
						if (_inner_error_->domain == G_KEY_FILE_ERROR) {
							goto __catch5_g_key_file_error;
						}
						decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
						keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
						g_clear_error (&_inner_error_);
					}
					_tmp74_ = im_addresses;
					_tmp74__length1 = im_addresses_length1;
					{
						gchar** im_address_collection = NULL;
						gint im_address_collection_length1 = 0;
						gint _im_address_collection_size_ = 0;
						gint im_address_it = 0;
						im_address_collection = _tmp74_;
						im_address_collection_length1 = _tmp74__length1;
						for (im_address_it = 0; im_address_it < _tmp74__length1; im_address_it = im_address_it + 1) {
							gchar* _tmp75_;
							gchar* im_address = NULL;
							_tmp75_ = g_strdup (im_address_collection[im_address_it]);
							im_address = _tmp75_;
							{
								gchar* address = NULL;
								FolksImFieldDetails* im_fd;
								const gchar* _tmp83_;
								FolksImFieldDetails* _tmp84_;
								GeeHashMultiMap* _tmp85_;
								const gchar* _tmp86_;
								FolksImFieldDetails* _tmp87_;
								{
									gchar* _tmp76_;
									const gchar* _tmp77_;
									const gchar* _tmp78_;
									gchar* _tmp79_;
									gchar* _tmp80_;
									_tmp77_ = im_address;
									_tmp78_ = protocol;
									_tmp79_ = folks_im_details_normalise_im_address (_tmp77_, _tmp78_, &_inner_error_);
									_tmp76_ = _tmp79_;
									if (G_UNLIKELY (_inner_error_ != NULL)) {
										if (_inner_error_->domain == FOLKS_IM_DETAILS_ERROR) {
											goto __catch6_folks_im_details_error;
										}
										_g_free0 (address);
										_g_free0 (im_address);
										im_addresses = (_vala_array_free (im_addresses, im_addresses_length1, (GDestroyNotify) g_free), NULL);
										decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
										keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
										g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
										g_clear_error (&_inner_error_);
									}
									_tmp80_ = _tmp76_;
									_tmp76_ = NULL;
									_g_free0 (address);
									address = _tmp80_;
									_g_free0 (_tmp76_);
								}
								goto __finally6;
								__catch6_folks_im_details_error:
								{
									GError* e = NULL;
									GError* _tmp81_;
									const gchar* _tmp82_;
									e = _inner_error_;
									_inner_error_ = NULL;
									_tmp81_ = e;
									_tmp82_ = _tmp81_->message;
									g_warning ("kf-persona.vala:414: %s", _tmp82_);
									_g_error_free0 (e);
									_g_free0 (address);
									_g_free0 (im_address);
									continue;
								}
								__finally6:
								if (G_UNLIKELY (_inner_error_ != NULL)) {
									_g_free0 (address);
									_g_free0 (im_address);
									im_addresses = (_vala_array_free (im_addresses, im_addresses_length1, (GDestroyNotify) g_free), NULL);
									decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
									keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
									if (_inner_error_->domain == G_KEY_FILE_ERROR) {
										goto __catch5_g_key_file_error;
									}
									_g_free0 (address);
									_g_free0 (im_address);
									im_addresses = (_vala_array_free (im_addresses, im_addresses_length1, (GDestroyNotify) g_free), NULL);
									decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
									keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
									g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
									g_clear_error (&_inner_error_);
								}
								_tmp83_ = address;
								_tmp84_ = folks_im_field_details_new (_tmp83_, NULL);
								im_fd = _tmp84_;
								_tmp85_ = self->priv->_im_addresses;
								_tmp86_ = protocol;
								_tmp87_ = im_fd;
								gee_multi_map_set ((GeeMultiMap*) _tmp85_, _tmp86_, _tmp87_);
								_g_object_unref0 (im_fd);
								_g_free0 (address);
								_g_free0 (im_address);
							}
						}
					}
					im_addresses = (_vala_array_free (im_addresses, im_addresses_length1, (GDestroyNotify) g_free), NULL);
					decomposed_key = (_vala_array_free (decomposed_key, decomposed_key_length1, (GDestroyNotify) g_free), NULL);
				}
			}
		}
		keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
	}
	goto __finally5;
	__catch5_g_key_file_error:
	{
		GError* e = NULL;
		GError* _tmp88_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp88_ = e;
		if (!g_error_matches (_tmp88_, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
			GError* _tmp89_;
			const gchar* _tmp90_;
			_tmp89_ = e;
			_tmp90_ = _tmp89_->message;
			g_warning (_ ("Couldn’t load data from key file: %s"), _tmp90_);
		}
		_g_error_free0 (e);
	}
	__finally5:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
	}
	return obj;
}


static void folks_backends_kf_persona_class_init (FolksBackendsKfPersonaClass * klass) {
	folks_backends_kf_persona_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (FolksBackendsKfPersonaPrivate));
	((FolksPersonaClass *) klass)->linkable_property_to_links = folks_backends_kf_persona_real_linkable_property_to_links;
	FOLKS_PERSONA_CLASS (klass)->get_linkable_properties = folks_backends_kf_persona_real_get_linkable_properties;
	FOLKS_PERSONA_CLASS (klass)->get_writeable_properties = folks_backends_kf_persona_real_get_writeable_properties;
	G_OBJECT_CLASS (klass)->get_property = _vala_folks_backends_kf_persona_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_folks_backends_kf_persona_set_property;
	G_OBJECT_CLASS (klass)->constructor = folks_backends_kf_persona_constructor;
	G_OBJECT_CLASS (klass)->finalize = folks_backends_kf_persona_finalize;
	/**
	   * {@inheritDoc}
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_BACKENDS_KF_PERSONA_LINKABLE_PROPERTIES, g_param_spec_boxed ("linkable-properties", "linkable-properties", "linkable-properties", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.0
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_BACKENDS_KF_PERSONA_WRITEABLE_PROPERTIES, g_param_spec_boxed ("writeable-properties", "writeable-properties", "writeable-properties", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.1.15
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_BACKENDS_KF_PERSONA_ALIAS, g_param_spec_string ("alias", "alias", "alias", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_BACKENDS_KF_PERSONA_IM_ADDRESSES, g_param_spec_object ("im-addresses", "im-addresses", "im-addresses", GEE_TYPE_MULTI_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_BACKENDS_KF_PERSONA_WEB_SERVICE_ADDRESSES, g_param_spec_object ("web-service-addresses", "web-service-addresses", "web-service-addresses", GEE_TYPE_MULTI_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.7.3
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), FOLKS_BACKENDS_KF_PERSONA_ANTI_LINKS, g_param_spec_object ("anti-links", "anti-links", "anti-links", GEE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void folks_backends_kf_persona_folks_alias_details_interface_init (FolksAliasDetailsIface * iface) {
	folks_backends_kf_persona_folks_alias_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_alias = (void (*) (FolksAliasDetails *, const gchar*, GError**)) folks_backends_kf_persona_real_change_alias;
	iface->change_alias_finish = folks_backends_kf_persona_real_change_alias_finish;
	iface->get_alias = folks_backends_kf_persona_real_get_alias;
	iface->set_alias = folks_backends_kf_persona_real_set_alias;
}


static void folks_backends_kf_persona_folks_anti_linkable_interface_init (FolksAntiLinkableIface * iface) {
	folks_backends_kf_persona_folks_anti_linkable_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_anti_links = (void (*) (FolksAntiLinkable *, GeeSet*, GError**)) folks_backends_kf_persona_real_change_anti_links;
	iface->change_anti_links_finish = folks_backends_kf_persona_real_change_anti_links_finish;
	iface->get_anti_links = folks_backends_kf_persona_real_get_anti_links;
	iface->set_anti_links = folks_backends_kf_persona_real_set_anti_links;
}


static void folks_backends_kf_persona_folks_im_details_interface_init (FolksImDetailsIface * iface) {
	folks_backends_kf_persona_folks_im_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_im_addresses = (void (*) (FolksImDetails *, GeeMultiMap*, GError**)) folks_backends_kf_persona_real_change_im_addresses;
	iface->change_im_addresses_finish = folks_backends_kf_persona_real_change_im_addresses_finish;
	iface->get_im_addresses = folks_backends_kf_persona_real_get_im_addresses;
	iface->set_im_addresses = folks_backends_kf_persona_real_set_im_addresses;
}


static void folks_backends_kf_persona_folks_web_service_details_interface_init (FolksWebServiceDetailsIface * iface) {
	folks_backends_kf_persona_folks_web_service_details_parent_iface = g_type_interface_peek_parent (iface);
	iface->change_web_service_addresses = (void (*) (FolksWebServiceDetails *, GeeMultiMap*, GError**)) folks_backends_kf_persona_real_change_web_service_addresses;
	iface->change_web_service_addresses_finish = folks_backends_kf_persona_real_change_web_service_addresses_finish;
	iface->get_web_service_addresses = folks_backends_kf_persona_real_get_web_service_addresses;
	iface->set_web_service_addresses = folks_backends_kf_persona_real_set_web_service_addresses;
}


static void folks_backends_kf_persona_instance_init (FolksBackendsKfPersona * self) {
	gchar* _tmp0_;
	self->priv = FOLKS_BACKENDS_KF_PERSONA_GET_PRIVATE (self);
	_tmp0_ = g_strdup ("");
	self->priv->_alias = _tmp0_;
}


static void folks_backends_kf_persona_finalize (GObject * obj) {
	FolksBackendsKfPersona * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FOLKS_BACKENDS_KF_TYPE_PERSONA, FolksBackendsKfPersona);
	_g_object_unref0 (self->priv->_im_addresses);
	_g_object_unref0 (self->priv->_web_service_addresses);
	_g_free0 (self->priv->_alias);
	_g_object_unref0 (self->priv->_anti_links);
	_g_object_unref0 (self->priv->_anti_links_ro);
	G_OBJECT_CLASS (folks_backends_kf_persona_parent_class)->finalize (obj);
}


/**
 * A persona subclass which represents a single persona from a simple key file.
 *
 * @since 0.1.13
 */
GType folks_backends_kf_persona_get_type (void) {
	static volatile gsize folks_backends_kf_persona_type_id__volatile = 0;
	if (g_once_init_enter (&folks_backends_kf_persona_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FolksBackendsKfPersonaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_backends_kf_persona_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksBackendsKfPersona), 0, (GInstanceInitFunc) folks_backends_kf_persona_instance_init, NULL };
		static const GInterfaceInfo folks_alias_details_info = { (GInterfaceInitFunc) folks_backends_kf_persona_folks_alias_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_anti_linkable_info = { (GInterfaceInitFunc) folks_backends_kf_persona_folks_anti_linkable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_im_details_info = { (GInterfaceInitFunc) folks_backends_kf_persona_folks_im_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo folks_web_service_details_info = { (GInterfaceInitFunc) folks_backends_kf_persona_folks_web_service_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType folks_backends_kf_persona_type_id;
		folks_backends_kf_persona_type_id = g_type_register_static (FOLKS_TYPE_PERSONA, "FolksBackendsKfPersona", &g_define_type_info, 0);
		g_type_add_interface_static (folks_backends_kf_persona_type_id, FOLKS_TYPE_ALIAS_DETAILS, &folks_alias_details_info);
		g_type_add_interface_static (folks_backends_kf_persona_type_id, FOLKS_TYPE_ANTI_LINKABLE, &folks_anti_linkable_info);
		g_type_add_interface_static (folks_backends_kf_persona_type_id, FOLKS_TYPE_IM_DETAILS, &folks_im_details_info);
		g_type_add_interface_static (folks_backends_kf_persona_type_id, FOLKS_TYPE_WEB_SERVICE_DETAILS, &folks_web_service_details_info);
		g_once_init_leave (&folks_backends_kf_persona_type_id__volatile, folks_backends_kf_persona_type_id);
	}
	return folks_backends_kf_persona_type_id__volatile;
}


static void _vala_folks_backends_kf_persona_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	FolksBackendsKfPersona * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FOLKS_BACKENDS_KF_TYPE_PERSONA, FolksBackendsKfPersona);
	switch (property_id) {
		case FOLKS_BACKENDS_KF_PERSONA_LINKABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_get_linkable_properties ((FolksPersona*) self, &length));
		}
		break;
		case FOLKS_BACKENDS_KF_PERSONA_WRITEABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_get_writeable_properties ((FolksPersona*) self, &length));
		}
		break;
		case FOLKS_BACKENDS_KF_PERSONA_ALIAS:
		g_value_set_string (value, folks_alias_details_get_alias ((FolksAliasDetails*) self));
		break;
		case FOLKS_BACKENDS_KF_PERSONA_IM_ADDRESSES:
		g_value_set_object (value, folks_im_details_get_im_addresses ((FolksImDetails*) self));
		break;
		case FOLKS_BACKENDS_KF_PERSONA_WEB_SERVICE_ADDRESSES:
		g_value_set_object (value, folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) self));
		break;
		case FOLKS_BACKENDS_KF_PERSONA_ANTI_LINKS:
		g_value_set_object (value, folks_anti_linkable_get_anti_links ((FolksAntiLinkable*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_folks_backends_kf_persona_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	FolksBackendsKfPersona * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FOLKS_BACKENDS_KF_TYPE_PERSONA, FolksBackendsKfPersona);
	switch (property_id) {
		case FOLKS_BACKENDS_KF_PERSONA_ALIAS:
		folks_alias_details_set_alias ((FolksAliasDetails*) self, g_value_get_string (value));
		break;
		case FOLKS_BACKENDS_KF_PERSONA_IM_ADDRESSES:
		folks_im_details_set_im_addresses ((FolksImDetails*) self, g_value_get_object (value));
		break;
		case FOLKS_BACKENDS_KF_PERSONA_WEB_SERVICE_ADDRESSES:
		folks_web_service_details_set_web_service_addresses ((FolksWebServiceDetails*) self, g_value_get_object (value));
		break;
		case FOLKS_BACKENDS_KF_PERSONA_ANTI_LINKS:
		folks_anti_linkable_set_anti_links ((FolksAntiLinkable*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


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


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



