/* tpf-persona-store-cache.c generated by valac 0.16.0, the Vala compiler
 * generated from tpf-persona-store-cache.vala, do not modify */

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


#define TPF_TYPE_PERSONA_STORE_CACHE (tpf_persona_store_cache_get_type ())
#define TPF_PERSONA_STORE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TPF_TYPE_PERSONA_STORE_CACHE, TpfPersonaStoreCache))
#define TPF_PERSONA_STORE_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TPF_TYPE_PERSONA_STORE_CACHE, TpfPersonaStoreCacheClass))
#define TPF_IS_PERSONA_STORE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TPF_TYPE_PERSONA_STORE_CACHE))
#define TPF_IS_PERSONA_STORE_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TPF_TYPE_PERSONA_STORE_CACHE))
#define TPF_PERSONA_STORE_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TPF_TYPE_PERSONA_STORE_CACHE, TpfPersonaStoreCacheClass))

typedef struct _TpfPersonaStoreCache TpfPersonaStoreCache;
typedef struct _TpfPersonaStoreCacheClass TpfPersonaStoreCacheClass;
typedef struct _TpfPersonaStoreCachePrivate TpfPersonaStoreCachePrivate;

#define TPF_TYPE_PERSONA_STORE (tpf_persona_store_get_type ())
#define TPF_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TPF_TYPE_PERSONA_STORE, TpfPersonaStore))
#define TPF_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TPF_TYPE_PERSONA_STORE, TpfPersonaStoreClass))
#define TPF_IS_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TPF_TYPE_PERSONA_STORE))
#define TPF_IS_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TPF_TYPE_PERSONA_STORE))
#define TPF_PERSONA_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TPF_TYPE_PERSONA_STORE, TpfPersonaStoreClass))

typedef struct _TpfPersonaStore TpfPersonaStore;
typedef struct _TpfPersonaStoreClass TpfPersonaStoreClass;

#define TPF_TYPE_PERSONA (tpf_persona_get_type ())
#define TPF_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TPF_TYPE_PERSONA, TpfPersona))
#define TPF_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TPF_TYPE_PERSONA, TpfPersonaClass))
#define TPF_IS_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TPF_TYPE_PERSONA))
#define TPF_IS_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TPF_TYPE_PERSONA))
#define TPF_PERSONA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TPF_TYPE_PERSONA, TpfPersonaClass))

typedef struct _TpfPersona TpfPersona;
typedef struct _TpfPersonaClass TpfPersonaClass;
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block1Data Block1Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

struct _TpfPersonaStoreCache {
	FolksObjectCache parent_instance;
	TpfPersonaStoreCachePrivate * priv;
};

struct _TpfPersonaStoreCacheClass {
	FolksObjectCacheClass parent_class;
};

struct _TpfPersonaStoreCachePrivate {
	TpfPersonaStore* _store;
};

typedef void (*TpfPersonaStoreCacheAfdDeserialisationCallback) (const gchar* val, GeeHashMultiMap* parameters, void* user_data);
struct _Block1Data {
	int _ref_count_;
	TpfPersonaStoreCache * self;
	GeeHashSet* email_address_set;
	GeeHashSet* phone_number_set;
	GeeHashSet* url_set;
};


static gpointer tpf_persona_store_cache_parent_class = NULL;

GType tpf_persona_store_cache_get_type (void) G_GNUC_CONST;
GType tpf_persona_store_get_type (void) G_GNUC_CONST;
#define TPF_PERSONA_STORE_CACHE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPF_TYPE_PERSONA_STORE_CACHE, TpfPersonaStoreCachePrivate))
enum  {
	TPF_PERSONA_STORE_CACHE_DUMMY_PROPERTY,
	TPF_PERSONA_STORE_CACHE_STORE
};
#define TPF_PERSONA_STORE_CACHE__FILE_FORMAT_VERSION ((guint8) 2)
TpfPersonaStoreCache* tpf_persona_store_cache_new (TpfPersonaStore* store);
TpfPersonaStoreCache* tpf_persona_store_cache_construct (GType object_type, TpfPersonaStore* store);
GType tpf_persona_get_type (void) G_GNUC_CONST;
static GVariantType* tpf_persona_store_cache_real_get_serialised_object_type (FolksObjectCache* base, guint8 object_version);
static guint8 tpf_persona_store_cache_real_get_serialised_object_version (FolksObjectCache* base);
static GVariant** tpf_persona_store_cache_serialise_abstract_field_details (TpfPersonaStoreCache* self, GeeSet* field_details_set, int* result_length1);
static GVariant* _variant_new1 (const gchar* value);
static GVariant* tpf_persona_store_cache_real_serialise_object (FolksObjectCache* base, TpfPersona* persona);
gboolean tpf_persona_get_is_in_contact_list (TpfPersona* self);
static void tpf_persona_store_cache_deserialise_abstract_field_details (TpfPersonaStoreCache* self, GVariant* input_variants, TpfPersonaStoreCacheAfdDeserialisationCallback cb, void* cb_target);
static TpfPersona* tpf_persona_store_cache_real_deserialise_object (FolksObjectCache* base, GVariant* variant, guint8 object_version);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void ___lambda3_ (Block1Data* _data1_, const gchar* v, GeeHashMultiMap* p);
static void ____lambda3__tpf_persona_store_cache_afd_deserialisation_callback (const gchar* val, GeeHashMultiMap* parameters, gpointer self);
static void ___lambda4_ (Block1Data* _data1_, const gchar* v, GeeHashMultiMap* p);
static void ____lambda4__tpf_persona_store_cache_afd_deserialisation_callback (const gchar* val, GeeHashMultiMap* parameters, gpointer self);
static void ___lambda5_ (Block1Data* _data1_, const gchar* v, GeeHashMultiMap* p);
static void ____lambda5__tpf_persona_store_cache_afd_deserialisation_callback (const gchar* val, GeeHashMultiMap* parameters, gpointer self);
TpfPersona* tpf_persona_new_from_cache (TpfPersonaStore* store, const gchar* uid, const gchar* iid, const gchar* im_address, const gchar* protocol, GeeHashSet* groups, gboolean is_favourite, const gchar* alias, gboolean is_in_contact_list, gboolean is_user, GLoadableIcon* avatar, GDateTime* birthday, const gchar* full_name, GeeHashSet* email_addresses, GeeHashSet* phone_numbers, GeeHashSet* urls);
TpfPersona* tpf_persona_construct_from_cache (GType object_type, TpfPersonaStore* store, const gchar* uid, const gchar* iid, const gchar* im_address, const gchar* protocol, GeeHashSet* groups, gboolean is_favourite, const gchar* alias, gboolean is_in_contact_list, gboolean is_user, GLoadableIcon* avatar, GDateTime* birthday, const gchar* full_name, GeeHashSet* email_addresses, GeeHashSet* phone_numbers, GeeHashSet* urls);
TpfPersonaStore* tpf_persona_store_cache_get_store (TpfPersonaStoreCache* self);
static void tpf_persona_store_cache_set_store (TpfPersonaStoreCache* self, TpfPersonaStore* value);
static void tpf_persona_store_cache_finalize (GObject* obj);
static void _vala_tpf_persona_store_cache_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_tpf_persona_store_cache_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);


TpfPersonaStoreCache* tpf_persona_store_cache_construct (GType object_type, TpfPersonaStore* store) {
	TpfPersonaStoreCache * self = NULL;
	TpfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	TpfPersonaStore* _tmp3_;
	g_return_val_if_fail (store != NULL, NULL);
	_tmp0_ = store;
	_tmp1_ = folks_persona_store_get_id ((FolksPersonaStore*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = store;
	self = (TpfPersonaStoreCache*) g_object_new (object_type, "t_type", TPF_TYPE_PERSONA, "t_dup_func", (GBoxedCopyFunc) g_object_ref, "t_destroy_func", g_object_unref, "type-id", "tpf-persona-stores", "id", _tmp2_, "store", _tmp3_, NULL);
	return self;
}


TpfPersonaStoreCache* tpf_persona_store_cache_new (TpfPersonaStore* store) {
	return tpf_persona_store_cache_construct (TPF_TYPE_PERSONA_STORE_CACHE, store);
}


static gpointer _g_variant_type_copy0 (gpointer self) {
	return self ? g_variant_type_copy (self) : NULL;
}


static GVariantType* tpf_persona_store_cache_real_get_serialised_object_type (FolksObjectCache* base, guint8 object_version) {
	TpfPersonaStoreCache * self;
	GVariantType* result = NULL;
	guint8 _tmp0_;
	guint8 _tmp1_;
	guint8 _tmp2_;
	self = (TpfPersonaStoreCache*) base;
	_tmp0_ = object_version;
	_tmp1_ = G_MAXUINT8;
	if (_tmp0_ == _tmp1_) {
		object_version = TPF_PERSONA_STORE_CACHE__FILE_FORMAT_VERSION;
	}
	_tmp2_ = object_version;
	if (((gint) _tmp2_) == 1) {
		const GVariantType* _tmp3_;
		GVariantType* _tmp4_;
		const GVariantType* _tmp5_;
		GVariantType* _tmp6_;
		const GVariantType* _tmp7_;
		GVariantType* _tmp8_;
		const GVariantType* _tmp9_;
		GVariantType* _tmp10_;
		const GVariantType* _tmp11_;
		GVariantType* _tmp12_;
		const GVariantType* _tmp13_;
		GVariantType* _tmp14_;
		const GVariantType* _tmp15_;
		GVariantType* _tmp16_;
		const GVariantType* _tmp17_;
		GVariantType* _tmp18_;
		const GVariantType* _tmp19_;
		GVariantType* _tmp20_;
		const GVariantType* _tmp21_;
		GVariantType* _tmp22_;
		GVariantType** _tmp23_ = NULL;
		GVariantType** _tmp24_;
		gint _tmp24__length1;
		GVariantType* _tmp25_;
		GVariantType* _tmp26_;
		_tmp3_ = G_VARIANT_TYPE_STRING;
		_tmp4_ = _g_variant_type_copy0 (_tmp3_);
		_tmp5_ = G_VARIANT_TYPE_STRING;
		_tmp6_ = _g_variant_type_copy0 (_tmp5_);
		_tmp7_ = G_VARIANT_TYPE_STRING;
		_tmp8_ = _g_variant_type_copy0 (_tmp7_);
		_tmp9_ = G_VARIANT_TYPE_STRING;
		_tmp10_ = _g_variant_type_copy0 (_tmp9_);
		_tmp11_ = G_VARIANT_TYPE_STRING;
		_tmp12_ = g_variant_type_new_array (_tmp11_);
		_tmp13_ = G_VARIANT_TYPE_BOOLEAN;
		_tmp14_ = _g_variant_type_copy0 (_tmp13_);
		_tmp15_ = G_VARIANT_TYPE_STRING;
		_tmp16_ = _g_variant_type_copy0 (_tmp15_);
		_tmp17_ = G_VARIANT_TYPE_BOOLEAN;
		_tmp18_ = _g_variant_type_copy0 (_tmp17_);
		_tmp19_ = G_VARIANT_TYPE_BOOLEAN;
		_tmp20_ = _g_variant_type_copy0 (_tmp19_);
		_tmp21_ = G_VARIANT_TYPE_STRING;
		_tmp22_ = g_variant_type_new_maybe (_tmp21_);
		_tmp23_ = g_new0 (GVariantType*, 10 + 1);
		_tmp23_[0] = _tmp4_;
		_tmp23_[1] = _tmp6_;
		_tmp23_[2] = _tmp8_;
		_tmp23_[3] = _tmp10_;
		_tmp23_[4] = _tmp12_;
		_tmp23_[5] = _tmp14_;
		_tmp23_[6] = _tmp16_;
		_tmp23_[7] = _tmp18_;
		_tmp23_[8] = _tmp20_;
		_tmp23_[9] = _tmp22_;
		_tmp24_ = _tmp23_;
		_tmp24__length1 = 10;
		_tmp25_ = g_variant_type_new_tuple (_tmp24_, 10);
		_tmp26_ = _tmp25_;
		_tmp24_ = (_vala_array_free (_tmp24_, _tmp24__length1, (GDestroyNotify) g_variant_type_free), NULL);
		result = _tmp26_;
		return result;
	} else {
		gboolean _tmp27_ = FALSE;
		guint8 _tmp28_;
		gboolean _tmp31_;
		_tmp28_ = object_version;
		if (((gint) _tmp28_) == 2) {
			_tmp27_ = TRUE;
		} else {
			guint8 _tmp29_;
			guint8 _tmp30_;
			_tmp29_ = object_version;
			_tmp30_ = G_MAXUINT8;
			_tmp27_ = _tmp29_ == _tmp30_;
		}
		_tmp31_ = _tmp27_;
		if (_tmp31_) {
			const GVariantType* _tmp32_;
			GVariantType* _tmp33_;
			const GVariantType* _tmp34_;
			GVariantType* _tmp35_;
			const GVariantType* _tmp36_;
			GVariantType* _tmp37_;
			const GVariantType* _tmp38_;
			GVariantType* _tmp39_;
			const GVariantType* _tmp40_;
			GVariantType* _tmp41_;
			const GVariantType* _tmp42_;
			GVariantType* _tmp43_;
			const GVariantType* _tmp44_;
			GVariantType* _tmp45_;
			const GVariantType* _tmp46_;
			GVariantType* _tmp47_;
			const GVariantType* _tmp48_;
			GVariantType* _tmp49_;
			const GVariantType* _tmp50_;
			GVariantType* _tmp51_;
			const GVariantType* _tmp52_;
			GVariantType* _tmp53_;
			const GVariantType* _tmp54_;
			GVariantType* _tmp55_;
			const GVariantType* _tmp56_;
			GVariantType* _tmp57_;
			const GVariantType* _tmp58_;
			GVariantType* _tmp59_;
			const GVariantType* _tmp60_;
			GVariantType* _tmp61_;
			GVariantType** _tmp62_ = NULL;
			GVariantType** _tmp63_;
			gint _tmp63__length1;
			GVariantType* _tmp64_;
			GVariantType* _tmp65_;
			GVariantType* _tmp66_;
			GVariantType** _tmp67_ = NULL;
			GVariantType** _tmp68_;
			gint _tmp68__length1;
			GVariantType* _tmp69_;
			GVariantType* _tmp70_;
			GVariantType* _tmp71_;
			const GVariantType* _tmp72_;
			GVariantType* _tmp73_;
			const GVariantType* _tmp74_;
			GVariantType* _tmp75_;
			const GVariantType* _tmp76_;
			GVariantType* _tmp77_;
			GVariantType** _tmp78_ = NULL;
			GVariantType** _tmp79_;
			gint _tmp79__length1;
			GVariantType* _tmp80_;
			GVariantType* _tmp81_;
			GVariantType* _tmp82_;
			GVariantType** _tmp83_ = NULL;
			GVariantType** _tmp84_;
			gint _tmp84__length1;
			GVariantType* _tmp85_;
			GVariantType* _tmp86_;
			GVariantType* _tmp87_;
			const GVariantType* _tmp88_;
			GVariantType* _tmp89_;
			const GVariantType* _tmp90_;
			GVariantType* _tmp91_;
			const GVariantType* _tmp92_;
			GVariantType* _tmp93_;
			GVariantType** _tmp94_ = NULL;
			GVariantType** _tmp95_;
			gint _tmp95__length1;
			GVariantType* _tmp96_;
			GVariantType* _tmp97_;
			GVariantType* _tmp98_;
			GVariantType** _tmp99_ = NULL;
			GVariantType** _tmp100_;
			gint _tmp100__length1;
			GVariantType* _tmp101_;
			GVariantType* _tmp102_;
			GVariantType* _tmp103_;
			GVariantType** _tmp104_ = NULL;
			GVariantType** _tmp105_;
			gint _tmp105__length1;
			GVariantType* _tmp106_;
			GVariantType* _tmp107_;
			_tmp32_ = G_VARIANT_TYPE_STRING;
			_tmp33_ = _g_variant_type_copy0 (_tmp32_);
			_tmp34_ = G_VARIANT_TYPE_STRING;
			_tmp35_ = _g_variant_type_copy0 (_tmp34_);
			_tmp36_ = G_VARIANT_TYPE_STRING;
			_tmp37_ = _g_variant_type_copy0 (_tmp36_);
			_tmp38_ = G_VARIANT_TYPE_STRING;
			_tmp39_ = _g_variant_type_copy0 (_tmp38_);
			_tmp40_ = G_VARIANT_TYPE_STRING;
			_tmp41_ = g_variant_type_new_array (_tmp40_);
			_tmp42_ = G_VARIANT_TYPE_BOOLEAN;
			_tmp43_ = _g_variant_type_copy0 (_tmp42_);
			_tmp44_ = G_VARIANT_TYPE_STRING;
			_tmp45_ = _g_variant_type_copy0 (_tmp44_);
			_tmp46_ = G_VARIANT_TYPE_BOOLEAN;
			_tmp47_ = _g_variant_type_copy0 (_tmp46_);
			_tmp48_ = G_VARIANT_TYPE_BOOLEAN;
			_tmp49_ = _g_variant_type_copy0 (_tmp48_);
			_tmp50_ = G_VARIANT_TYPE_STRING;
			_tmp51_ = g_variant_type_new_maybe (_tmp50_);
			_tmp52_ = G_VARIANT_TYPE_INT64;
			_tmp53_ = g_variant_type_new_maybe (_tmp52_);
			_tmp54_ = G_VARIANT_TYPE_STRING;
			_tmp55_ = _g_variant_type_copy0 (_tmp54_);
			_tmp56_ = G_VARIANT_TYPE_STRING;
			_tmp57_ = _g_variant_type_copy0 (_tmp56_);
			_tmp58_ = G_VARIANT_TYPE_STRING;
			_tmp59_ = _g_variant_type_copy0 (_tmp58_);
			_tmp60_ = G_VARIANT_TYPE_STRING;
			_tmp61_ = _g_variant_type_copy0 (_tmp60_);
			_tmp62_ = g_new0 (GVariantType*, 2 + 1);
			_tmp62_[0] = _tmp59_;
			_tmp62_[1] = _tmp61_;
			_tmp63_ = _tmp62_;
			_tmp63__length1 = 2;
			_tmp64_ = g_variant_type_new_tuple (_tmp63_, 2);
			_tmp65_ = _tmp64_;
			_tmp66_ = g_variant_type_new_array (_tmp65_);
			_tmp67_ = g_new0 (GVariantType*, 2 + 1);
			_tmp67_[0] = _tmp57_;
			_tmp67_[1] = _tmp66_;
			_tmp68_ = _tmp67_;
			_tmp68__length1 = 2;
			_tmp69_ = g_variant_type_new_tuple (_tmp68_, 2);
			_tmp70_ = _tmp69_;
			_tmp71_ = g_variant_type_new_array (_tmp70_);
			_tmp72_ = G_VARIANT_TYPE_STRING;
			_tmp73_ = _g_variant_type_copy0 (_tmp72_);
			_tmp74_ = G_VARIANT_TYPE_STRING;
			_tmp75_ = _g_variant_type_copy0 (_tmp74_);
			_tmp76_ = G_VARIANT_TYPE_STRING;
			_tmp77_ = _g_variant_type_copy0 (_tmp76_);
			_tmp78_ = g_new0 (GVariantType*, 2 + 1);
			_tmp78_[0] = _tmp75_;
			_tmp78_[1] = _tmp77_;
			_tmp79_ = _tmp78_;
			_tmp79__length1 = 2;
			_tmp80_ = g_variant_type_new_tuple (_tmp79_, 2);
			_tmp81_ = _tmp80_;
			_tmp82_ = g_variant_type_new_array (_tmp81_);
			_tmp83_ = g_new0 (GVariantType*, 2 + 1);
			_tmp83_[0] = _tmp73_;
			_tmp83_[1] = _tmp82_;
			_tmp84_ = _tmp83_;
			_tmp84__length1 = 2;
			_tmp85_ = g_variant_type_new_tuple (_tmp84_, 2);
			_tmp86_ = _tmp85_;
			_tmp87_ = g_variant_type_new_array (_tmp86_);
			_tmp88_ = G_VARIANT_TYPE_STRING;
			_tmp89_ = _g_variant_type_copy0 (_tmp88_);
			_tmp90_ = G_VARIANT_TYPE_STRING;
			_tmp91_ = _g_variant_type_copy0 (_tmp90_);
			_tmp92_ = G_VARIANT_TYPE_STRING;
			_tmp93_ = _g_variant_type_copy0 (_tmp92_);
			_tmp94_ = g_new0 (GVariantType*, 2 + 1);
			_tmp94_[0] = _tmp91_;
			_tmp94_[1] = _tmp93_;
			_tmp95_ = _tmp94_;
			_tmp95__length1 = 2;
			_tmp96_ = g_variant_type_new_tuple (_tmp95_, 2);
			_tmp97_ = _tmp96_;
			_tmp98_ = g_variant_type_new_array (_tmp97_);
			_tmp99_ = g_new0 (GVariantType*, 2 + 1);
			_tmp99_[0] = _tmp89_;
			_tmp99_[1] = _tmp98_;
			_tmp100_ = _tmp99_;
			_tmp100__length1 = 2;
			_tmp101_ = g_variant_type_new_tuple (_tmp100_, 2);
			_tmp102_ = _tmp101_;
			_tmp103_ = g_variant_type_new_array (_tmp102_);
			_tmp104_ = g_new0 (GVariantType*, 15 + 1);
			_tmp104_[0] = _tmp33_;
			_tmp104_[1] = _tmp35_;
			_tmp104_[2] = _tmp37_;
			_tmp104_[3] = _tmp39_;
			_tmp104_[4] = _tmp41_;
			_tmp104_[5] = _tmp43_;
			_tmp104_[6] = _tmp45_;
			_tmp104_[7] = _tmp47_;
			_tmp104_[8] = _tmp49_;
			_tmp104_[9] = _tmp51_;
			_tmp104_[10] = _tmp53_;
			_tmp104_[11] = _tmp55_;
			_tmp104_[12] = _tmp71_;
			_tmp104_[13] = _tmp87_;
			_tmp104_[14] = _tmp103_;
			_tmp105_ = _tmp104_;
			_tmp105__length1 = 15;
			_tmp106_ = g_variant_type_new_tuple (_tmp105_, 15);
			_tmp107_ = _tmp106_;
			_tmp105_ = (_vala_array_free (_tmp105_, _tmp105__length1, (GDestroyNotify) g_variant_type_free), NULL);
			_g_variant_type_free0 (_tmp102_);
			_tmp100_ = (_vala_array_free (_tmp100_, _tmp100__length1, (GDestroyNotify) g_variant_type_free), NULL);
			_g_variant_type_free0 (_tmp97_);
			_tmp95_ = (_vala_array_free (_tmp95_, _tmp95__length1, (GDestroyNotify) g_variant_type_free), NULL);
			_g_variant_type_free0 (_tmp86_);
			_tmp84_ = (_vala_array_free (_tmp84_, _tmp84__length1, (GDestroyNotify) g_variant_type_free), NULL);
			_g_variant_type_free0 (_tmp81_);
			_tmp79_ = (_vala_array_free (_tmp79_, _tmp79__length1, (GDestroyNotify) g_variant_type_free), NULL);
			_g_variant_type_free0 (_tmp70_);
			_tmp68_ = (_vala_array_free (_tmp68_, _tmp68__length1, (GDestroyNotify) g_variant_type_free), NULL);
			_g_variant_type_free0 (_tmp65_);
			_tmp63_ = (_vala_array_free (_tmp63_, _tmp63__length1, (GDestroyNotify) g_variant_type_free), NULL);
			result = _tmp107_;
			return result;
		}
	}
	result = NULL;
	return result;
}


static guint8 tpf_persona_store_cache_real_get_serialised_object_version (FolksObjectCache* base) {
	TpfPersonaStoreCache * self;
	guint8 result = 0U;
	self = (TpfPersonaStoreCache*) base;
	result = TPF_PERSONA_STORE_CACHE__FILE_FORMAT_VERSION;
	return result;
}


static GVariant* _variant_new1 (const gchar* value) {
	return g_variant_ref_sink (g_variant_new_string (value));
}


static GVariant** tpf_persona_store_cache_serialise_abstract_field_details (TpfPersonaStoreCache* self, GeeSet* field_details_set, int* result_length1) {
	GVariant** result = NULL;
	GeeSet* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GVariant** _tmp3_ = NULL;
	GVariant** output_variants;
	gint output_variants_length1;
	gint _output_variants_size_;
	guint i;
	GVariant** _tmp74_;
	gint _tmp74__length1;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (field_details_set != NULL, NULL);
	_tmp0_ = field_details_set;
	_tmp1_ = gee_collection_get_size ((GeeCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_new0 (GVariant*, _tmp2_ + 1);
	output_variants = _tmp3_;
	output_variants_length1 = _tmp2_;
	_output_variants_size_ = output_variants_length1;
	i = (guint) 0;
	{
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _afd_it;
		_tmp4_ = field_details_set;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_afd_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gboolean _tmp7_ = FALSE;
			GeeIterator* _tmp8_;
			gpointer _tmp9_ = NULL;
			FolksAbstractFieldDetails* afd;
			FolksAbstractFieldDetails* _tmp10_;
			GeeMultiMap* _tmp11_;
			GeeMultiMap* _tmp12_;
			gint _tmp13_;
			gint _tmp14_;
			GVariant** _tmp15_ = NULL;
			GVariant** parameters;
			gint parameters_length1;
			gint _parameters_size_;
			guint f;
			GVariant** _tmp52_;
			gint _tmp52__length1;
			guint _tmp53_;
			FolksAbstractFieldDetails* _tmp54_;
			gconstpointer _tmp55_;
			const gchar* _tmp56_;
			GVariant* _tmp57_;
			const GVariantType* _tmp58_;
			GVariantType* _tmp59_;
			const GVariantType* _tmp60_;
			GVariantType* _tmp61_;
			GVariantType** _tmp62_ = NULL;
			GVariantType** _tmp63_;
			gint _tmp63__length1;
			GVariantType* _tmp64_;
			GVariantType* _tmp65_;
			GVariant** _tmp66_;
			gint _tmp66__length1;
			GVariant* _tmp67_;
			GVariant* _tmp68_;
			GVariant** _tmp69_ = NULL;
			GVariant** _tmp70_;
			gint _tmp70__length1;
			GVariant* _tmp71_;
			GVariant* _tmp72_;
			GVariant* _tmp73_;
			_tmp6_ = _afd_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _afd_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			afd = (FolksAbstractFieldDetails*) _tmp9_;
			_tmp10_ = afd;
			_tmp11_ = folks_abstract_field_details_get_parameters (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = gee_multi_map_get_size (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = g_new0 (GVariant*, _tmp14_ + 1);
			parameters = _tmp15_;
			parameters_length1 = _tmp14_;
			_parameters_size_ = parameters_length1;
			f = (guint) 0;
			{
				FolksAbstractFieldDetails* _tmp16_;
				GeeMultiMap* _tmp17_;
				GeeMultiMap* _tmp18_;
				GeeSet* _tmp19_ = NULL;
				GeeSet* _tmp20_;
				GeeIterator* _tmp21_ = NULL;
				GeeIterator* _tmp22_;
				GeeIterator* _key_it;
				_tmp16_ = afd;
				_tmp17_ = folks_abstract_field_details_get_parameters (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = gee_multi_map_get_keys (_tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = gee_iterable_iterator ((GeeIterable*) _tmp20_);
				_tmp22_ = _tmp21_;
				_g_object_unref0 (_tmp20_);
				_key_it = _tmp22_;
				while (TRUE) {
					GeeIterator* _tmp23_;
					gboolean _tmp24_ = FALSE;
					GeeIterator* _tmp25_;
					gpointer _tmp26_ = NULL;
					gchar* key;
					_tmp23_ = _key_it;
					_tmp24_ = gee_iterator_next (_tmp23_);
					if (!_tmp24_) {
						break;
					}
					_tmp25_ = _key_it;
					_tmp26_ = gee_iterator_get (_tmp25_);
					key = (gchar*) _tmp26_;
					{
						FolksAbstractFieldDetails* _tmp27_;
						GeeMultiMap* _tmp28_;
						GeeMultiMap* _tmp29_;
						const gchar* _tmp30_;
						GeeCollection* _tmp31_ = NULL;
						GeeCollection* _tmp32_;
						GeeIterator* _tmp33_ = NULL;
						GeeIterator* _tmp34_;
						GeeIterator* _val_it;
						_tmp27_ = afd;
						_tmp28_ = folks_abstract_field_details_get_parameters (_tmp27_);
						_tmp29_ = _tmp28_;
						_tmp30_ = key;
						_tmp31_ = gee_multi_map_get (_tmp29_, _tmp30_);
						_tmp32_ = _tmp31_;
						_tmp33_ = gee_iterable_iterator ((GeeIterable*) _tmp32_);
						_tmp34_ = _tmp33_;
						_g_object_unref0 (_tmp32_);
						_val_it = _tmp34_;
						while (TRUE) {
							GeeIterator* _tmp35_;
							gboolean _tmp36_ = FALSE;
							GeeIterator* _tmp37_;
							gpointer _tmp38_ = NULL;
							gchar* val;
							GVariant** _tmp39_;
							gint _tmp39__length1;
							guint _tmp40_;
							const gchar* _tmp41_;
							GVariant* _tmp42_;
							GVariant* _tmp43_;
							const gchar* _tmp44_;
							GVariant* _tmp45_;
							GVariant* _tmp46_;
							GVariant** _tmp47_ = NULL;
							GVariant** _tmp48_;
							gint _tmp48__length1;
							GVariant* _tmp49_;
							GVariant* _tmp50_;
							GVariant* _tmp51_;
							_tmp35_ = _val_it;
							_tmp36_ = gee_iterator_next (_tmp35_);
							if (!_tmp36_) {
								break;
							}
							_tmp37_ = _val_it;
							_tmp38_ = gee_iterator_get (_tmp37_);
							val = (gchar*) _tmp38_;
							_tmp39_ = parameters;
							_tmp39__length1 = parameters_length1;
							_tmp40_ = f;
							f = _tmp40_ + 1;
							_tmp41_ = key;
							_tmp42_ = g_variant_new_string (_tmp41_);
							_tmp43_ = g_variant_ref_sink (_tmp42_);
							_tmp44_ = val;
							_tmp45_ = g_variant_new_string (_tmp44_);
							_tmp46_ = g_variant_ref_sink (_tmp45_);
							_tmp47_ = g_new0 (GVariant*, 2 + 1);
							_tmp47_[0] = _tmp43_;
							_tmp47_[1] = _tmp46_;
							_tmp48_ = _tmp47_;
							_tmp48__length1 = 2;
							_tmp49_ = g_variant_new_tuple (_tmp48_, 2);
							_tmp50_ = g_variant_ref_sink (_tmp49_);
							_g_variant_unref0 (_tmp39_[_tmp40_]);
							_tmp39_[_tmp40_] = _tmp50_;
							_tmp51_ = _tmp39_[_tmp40_];
							_tmp48_ = (_vala_array_free (_tmp48_, _tmp48__length1, (GDestroyNotify) g_variant_unref), NULL);
							_g_free0 (val);
						}
						_g_object_unref0 (_val_it);
					}
					_g_free0 (key);
				}
				_g_object_unref0 (_key_it);
			}
			_tmp52_ = output_variants;
			_tmp52__length1 = output_variants_length1;
			_tmp53_ = i;
			i = _tmp53_ + 1;
			_tmp54_ = afd;
			_tmp55_ = folks_abstract_field_details_get_value (_tmp54_);
			_tmp56_ = _tmp55_;
			_tmp57_ = _variant_new1 ((const gchar*) _tmp56_);
			_tmp58_ = G_VARIANT_TYPE_STRING;
			_tmp59_ = _g_variant_type_copy0 (_tmp58_);
			_tmp60_ = G_VARIANT_TYPE_STRING;
			_tmp61_ = _g_variant_type_copy0 (_tmp60_);
			_tmp62_ = g_new0 (GVariantType*, 2 + 1);
			_tmp62_[0] = _tmp59_;
			_tmp62_[1] = _tmp61_;
			_tmp63_ = _tmp62_;
			_tmp63__length1 = 2;
			_tmp64_ = g_variant_type_new_tuple (_tmp63_, 2);
			_tmp65_ = _tmp64_;
			_tmp66_ = parameters;
			_tmp66__length1 = parameters_length1;
			_tmp67_ = g_variant_new_array (_tmp65_, _tmp66_, _tmp66__length1);
			_tmp68_ = g_variant_ref_sink (_tmp67_);
			_tmp69_ = g_new0 (GVariant*, 2 + 1);
			_tmp69_[0] = _tmp57_;
			_tmp69_[1] = _tmp68_;
			_tmp70_ = _tmp69_;
			_tmp70__length1 = 2;
			_tmp71_ = g_variant_new_tuple (_tmp70_, 2);
			_tmp72_ = g_variant_ref_sink (_tmp71_);
			_g_variant_unref0 (_tmp52_[_tmp53_]);
			_tmp52_[_tmp53_] = _tmp72_;
			_tmp73_ = _tmp52_[_tmp53_];
			_tmp70_ = (_vala_array_free (_tmp70_, _tmp70__length1, (GDestroyNotify) g_variant_unref), NULL);
			_g_variant_type_free0 (_tmp65_);
			_tmp63_ = (_vala_array_free (_tmp63_, _tmp63__length1, (GDestroyNotify) g_variant_type_free), NULL);
			parameters = (_vala_array_free (parameters, parameters_length1, (GDestroyNotify) g_variant_unref), NULL);
			_g_object_unref0 (afd);
		}
		_g_object_unref0 (_afd_it);
	}
	_tmp74_ = output_variants;
	_tmp74__length1 = output_variants_length1;
	if (result_length1) {
		*result_length1 = _tmp74__length1;
	}
	result = _tmp74_;
	return result;
}


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


static gpointer _g_variant_ref0 (gpointer self) {
	return self ? g_variant_ref (self) : NULL;
}


static GVariant* tpf_persona_store_cache_real_serialise_object (FolksObjectCache* base, TpfPersona* persona) {
	TpfPersonaStoreCache * self;
	GVariant* result = NULL;
	TpfPersona* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	GVariant** _tmp5_ = NULL;
	GVariant** groups;
	gint groups_length1;
	gint _groups_size_;
	guint i;
	gchar* im_protocol;
	GFile* _tmp31_ = NULL;
	gboolean _tmp32_ = FALSE;
	TpfPersona* _tmp33_;
	GLoadableIcon* _tmp34_;
	GLoadableIcon* _tmp35_;
	gboolean _tmp39_;
	GFile* _tmp44_;
	GFile* _tmp45_;
	GFile* avatar_file;
	GVariant* _tmp46_ = NULL;
	GFile* _tmp47_;
	GVariant* _tmp53_;
	GVariant* _tmp54_;
	GVariant* avatar_variant;
	GVariant* _tmp55_ = NULL;
	TpfPersona* _tmp56_;
	GDateTime* _tmp57_;
	GDateTime* _tmp58_;
	GVariant* _tmp65_;
	GVariant* _tmp66_;
	GVariant* birthday_variant;
	TpfPersona* _tmp67_;
	GeeSet* _tmp68_;
	GeeSet* _tmp69_;
	gint _tmp70_ = 0;
	GVariant** _tmp71_ = NULL;
	GVariant** email_addresses;
	gint email_addresses_length1;
	gint _email_addresses_size_;
	TpfPersona* _tmp72_;
	GeeSet* _tmp73_;
	GeeSet* _tmp74_;
	gint _tmp75_ = 0;
	GVariant** _tmp76_ = NULL;
	GVariant** phone_numbers;
	gint phone_numbers_length1;
	gint _phone_numbers_size_;
	TpfPersona* _tmp77_;
	GeeSet* _tmp78_;
	GeeSet* _tmp79_;
	gint _tmp80_ = 0;
	GVariant** _tmp81_ = NULL;
	GVariant** urls;
	gint urls_length1;
	gint _urls_size_;
	TpfPersona* _tmp82_;
	const gchar* _tmp83_;
	const gchar* _tmp84_;
	GVariant* _tmp85_;
	GVariant* _tmp86_;
	TpfPersona* _tmp87_;
	const gchar* _tmp88_;
	const gchar* _tmp89_;
	GVariant* _tmp90_;
	GVariant* _tmp91_;
	TpfPersona* _tmp92_;
	const gchar* _tmp93_;
	const gchar* _tmp94_;
	GVariant* _tmp95_;
	GVariant* _tmp96_;
	const gchar* _tmp97_;
	GVariant* _tmp98_;
	GVariant* _tmp99_;
	const GVariantType* _tmp100_;
	GVariant** _tmp101_;
	gint _tmp101__length1;
	GVariant* _tmp102_;
	GVariant* _tmp103_;
	TpfPersona* _tmp104_;
	gboolean _tmp105_;
	gboolean _tmp106_;
	GVariant* _tmp107_;
	GVariant* _tmp108_;
	TpfPersona* _tmp109_;
	const gchar* _tmp110_;
	const gchar* _tmp111_;
	GVariant* _tmp112_;
	GVariant* _tmp113_;
	TpfPersona* _tmp114_;
	gboolean _tmp115_;
	gboolean _tmp116_;
	GVariant* _tmp117_;
	GVariant* _tmp118_;
	TpfPersona* _tmp119_;
	gboolean _tmp120_;
	gboolean _tmp121_;
	GVariant* _tmp122_;
	GVariant* _tmp123_;
	const GVariantType* _tmp124_;
	GVariant* _tmp125_;
	GVariant* _tmp126_;
	GVariant* _tmp127_;
	const GVariantType* _tmp128_;
	GVariant* _tmp129_;
	GVariant* _tmp130_;
	TpfPersona* _tmp131_;
	const gchar* _tmp132_;
	const gchar* _tmp133_;
	GVariant* _tmp134_;
	GVariant* _tmp135_;
	const GVariantType* _tmp136_;
	GVariantType* _tmp137_;
	const GVariantType* _tmp138_;
	GVariantType* _tmp139_;
	const GVariantType* _tmp140_;
	GVariantType* _tmp141_;
	GVariantType** _tmp142_ = NULL;
	GVariantType** _tmp143_;
	gint _tmp143__length1;
	GVariantType* _tmp144_;
	GVariantType* _tmp145_;
	GVariantType* _tmp146_;
	GVariantType** _tmp147_ = NULL;
	GVariantType** _tmp148_;
	gint _tmp148__length1;
	GVariantType* _tmp149_;
	GVariantType* _tmp150_;
	GVariant* _tmp151_;
	GVariant* _tmp152_;
	const GVariantType* _tmp153_;
	GVariantType* _tmp154_;
	const GVariantType* _tmp155_;
	GVariantType* _tmp156_;
	const GVariantType* _tmp157_;
	GVariantType* _tmp158_;
	GVariantType** _tmp159_ = NULL;
	GVariantType** _tmp160_;
	gint _tmp160__length1;
	GVariantType* _tmp161_;
	GVariantType* _tmp162_;
	GVariantType* _tmp163_;
	GVariantType** _tmp164_ = NULL;
	GVariantType** _tmp165_;
	gint _tmp165__length1;
	GVariantType* _tmp166_;
	GVariantType* _tmp167_;
	GVariant* _tmp168_;
	GVariant* _tmp169_;
	const GVariantType* _tmp170_;
	GVariantType* _tmp171_;
	const GVariantType* _tmp172_;
	GVariantType* _tmp173_;
	const GVariantType* _tmp174_;
	GVariantType* _tmp175_;
	GVariantType** _tmp176_ = NULL;
	GVariantType** _tmp177_;
	gint _tmp177__length1;
	GVariantType* _tmp178_;
	GVariantType* _tmp179_;
	GVariantType* _tmp180_;
	GVariantType** _tmp181_ = NULL;
	GVariantType** _tmp182_;
	gint _tmp182__length1;
	GVariantType* _tmp183_;
	GVariantType* _tmp184_;
	GVariant* _tmp185_;
	GVariant* _tmp186_;
	GVariant** _tmp187_ = NULL;
	GVariant** _tmp188_;
	gint _tmp188__length1;
	GVariant* _tmp189_;
	GVariant* _tmp190_;
	GVariant* _tmp191_;
	self = (TpfPersonaStoreCache*) base;
	g_return_val_if_fail (persona != NULL, NULL);
	_tmp0_ = persona;
	_tmp1_ = folks_group_details_get_groups ((FolksGroupDetails*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_new0 (GVariant*, _tmp4_ + 1);
	groups = _tmp5_;
	groups_length1 = _tmp4_;
	_groups_size_ = groups_length1;
	i = (guint) 0;
	{
		TpfPersona* _tmp6_;
		GeeSet* _tmp7_;
		GeeSet* _tmp8_;
		GeeIterator* _tmp9_ = NULL;
		GeeIterator* _group_it;
		_tmp6_ = persona;
		_tmp7_ = folks_group_details_get_groups ((FolksGroupDetails*) _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_);
		_group_it = _tmp9_;
		while (TRUE) {
			GeeIterator* _tmp10_;
			gboolean _tmp11_ = FALSE;
			GeeIterator* _tmp12_;
			gpointer _tmp13_ = NULL;
			gchar* group;
			GVariant** _tmp14_;
			gint _tmp14__length1;
			guint _tmp15_;
			const gchar* _tmp16_;
			GVariant* _tmp17_;
			GVariant* _tmp18_;
			GVariant* _tmp19_;
			_tmp10_ = _group_it;
			_tmp11_ = gee_iterator_next (_tmp10_);
			if (!_tmp11_) {
				break;
			}
			_tmp12_ = _group_it;
			_tmp13_ = gee_iterator_get (_tmp12_);
			group = (gchar*) _tmp13_;
			_tmp14_ = groups;
			_tmp14__length1 = groups_length1;
			_tmp15_ = i;
			i = _tmp15_ + 1;
			_tmp16_ = group;
			_tmp17_ = g_variant_new_string (_tmp16_);
			_tmp18_ = g_variant_ref_sink (_tmp17_);
			_g_variant_unref0 (_tmp14_[_tmp15_]);
			_tmp14_[_tmp15_] = _tmp18_;
			_tmp19_ = _tmp14_[_tmp15_];
			_g_free0 (group);
		}
		_g_object_unref0 (_group_it);
	}
	im_protocol = NULL;
	{
		TpfPersona* _tmp20_;
		GeeMultiMap* _tmp21_;
		GeeMultiMap* _tmp22_;
		GeeSet* _tmp23_ = NULL;
		GeeSet* _tmp24_;
		GeeIterator* _tmp25_ = NULL;
		GeeIterator* _tmp26_;
		GeeIterator* _protocol_it;
		_tmp20_ = persona;
		_tmp21_ = folks_im_details_get_im_addresses ((FolksImDetails*) _tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = gee_multi_map_get_keys (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = gee_iterable_iterator ((GeeIterable*) _tmp24_);
		_tmp26_ = _tmp25_;
		_g_object_unref0 (_tmp24_);
		_protocol_it = _tmp26_;
		while (TRUE) {
			gboolean _tmp27_ = FALSE;
			gpointer _tmp28_ = NULL;
			gchar* protocol;
			const gchar* _tmp29_;
			gchar* _tmp30_;
			_tmp27_ = gee_iterator_next (_protocol_it);
			if (!_tmp27_) {
				break;
			}
			_tmp28_ = gee_iterator_get (_protocol_it);
			protocol = (gchar*) _tmp28_;
			_tmp29_ = protocol;
			_tmp30_ = g_strdup (_tmp29_);
			_g_free0 (im_protocol);
			im_protocol = _tmp30_;
			_g_free0 (protocol);
			break;
		}
		_g_object_unref0 (_protocol_it);
	}
	_tmp33_ = persona;
	_tmp34_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp33_);
	_tmp35_ = _tmp34_;
	if (_tmp35_ != NULL) {
		TpfPersona* _tmp36_;
		GLoadableIcon* _tmp37_;
		GLoadableIcon* _tmp38_;
		_tmp36_ = persona;
		_tmp37_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp36_);
		_tmp38_ = _tmp37_;
		_tmp32_ = G_IS_FILE_ICON (_tmp38_);
	} else {
		_tmp32_ = FALSE;
	}
	_tmp39_ = _tmp32_;
	if (_tmp39_) {
		TpfPersona* _tmp40_;
		GLoadableIcon* _tmp41_;
		GLoadableIcon* _tmp42_;
		GFile* _tmp43_ = NULL;
		_tmp40_ = persona;
		_tmp41_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp40_);
		_tmp42_ = _tmp41_;
		_tmp43_ = g_file_icon_get_file (G_IS_FILE_ICON (_tmp42_) ? ((GFileIcon*) _tmp42_) : NULL);
		_tmp31_ = _tmp43_;
	} else {
		_tmp31_ = NULL;
	}
	_tmp44_ = _tmp31_;
	_tmp45_ = _g_object_ref0 (_tmp44_);
	avatar_file = _tmp45_;
	_tmp47_ = avatar_file;
	if (_tmp47_ != NULL) {
		GFile* _tmp48_;
		gchar* _tmp49_ = NULL;
		gchar* _tmp50_;
		GVariant* _tmp51_;
		GVariant* _tmp52_;
		_tmp48_ = avatar_file;
		_tmp49_ = g_file_get_uri (_tmp48_);
		_tmp50_ = _tmp49_;
		_tmp51_ = g_variant_new_string (_tmp50_);
		_tmp52_ = g_variant_ref_sink (_tmp51_);
		_g_variant_unref0 (_tmp46_);
		_tmp46_ = _tmp52_;
		_g_free0 (_tmp50_);
	} else {
		_g_variant_unref0 (_tmp46_);
		_tmp46_ = NULL;
	}
	_tmp53_ = _tmp46_;
	_tmp54_ = _g_variant_ref0 (_tmp53_);
	avatar_variant = _tmp54_;
	_tmp56_ = persona;
	_tmp57_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _tmp56_);
	_tmp58_ = _tmp57_;
	if (_tmp58_ != NULL) {
		TpfPersona* _tmp59_;
		GDateTime* _tmp60_;
		GDateTime* _tmp61_;
		gint64 _tmp62_ = 0LL;
		GVariant* _tmp63_;
		GVariant* _tmp64_;
		_tmp59_ = persona;
		_tmp60_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _tmp59_);
		_tmp61_ = _tmp60_;
		_tmp62_ = g_date_time_to_unix (_tmp61_);
		_tmp63_ = g_variant_new_int64 (_tmp62_);
		_tmp64_ = g_variant_ref_sink (_tmp63_);
		_g_variant_unref0 (_tmp55_);
		_tmp55_ = _tmp64_;
	} else {
		_g_variant_unref0 (_tmp55_);
		_tmp55_ = NULL;
	}
	_tmp65_ = _tmp55_;
	_tmp66_ = _g_variant_ref0 (_tmp65_);
	birthday_variant = _tmp66_;
	_tmp67_ = persona;
	_tmp68_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp67_);
	_tmp69_ = _tmp68_;
	_tmp71_ = tpf_persona_store_cache_serialise_abstract_field_details (self, _tmp69_, &_tmp70_);
	email_addresses = _tmp71_;
	email_addresses_length1 = _tmp70_;
	_email_addresses_size_ = email_addresses_length1;
	_tmp72_ = persona;
	_tmp73_ = folks_phone_details_get_phone_numbers ((FolksPhoneDetails*) _tmp72_);
	_tmp74_ = _tmp73_;
	_tmp76_ = tpf_persona_store_cache_serialise_abstract_field_details (self, _tmp74_, &_tmp75_);
	phone_numbers = _tmp76_;
	phone_numbers_length1 = _tmp75_;
	_phone_numbers_size_ = phone_numbers_length1;
	_tmp77_ = persona;
	_tmp78_ = folks_url_details_get_urls ((FolksUrlDetails*) _tmp77_);
	_tmp79_ = _tmp78_;
	_tmp81_ = tpf_persona_store_cache_serialise_abstract_field_details (self, _tmp79_, &_tmp80_);
	urls = _tmp81_;
	urls_length1 = _tmp80_;
	_urls_size_ = urls_length1;
	_tmp82_ = persona;
	_tmp83_ = folks_persona_get_uid ((FolksPersona*) _tmp82_);
	_tmp84_ = _tmp83_;
	_tmp85_ = g_variant_new_string (_tmp84_);
	_tmp86_ = g_variant_ref_sink (_tmp85_);
	_tmp87_ = persona;
	_tmp88_ = folks_persona_get_iid ((FolksPersona*) _tmp87_);
	_tmp89_ = _tmp88_;
	_tmp90_ = g_variant_new_string (_tmp89_);
	_tmp91_ = g_variant_ref_sink (_tmp90_);
	_tmp92_ = persona;
	_tmp93_ = folks_persona_get_display_id ((FolksPersona*) _tmp92_);
	_tmp94_ = _tmp93_;
	_tmp95_ = g_variant_new_string (_tmp94_);
	_tmp96_ = g_variant_ref_sink (_tmp95_);
	_tmp97_ = im_protocol;
	_tmp98_ = g_variant_new_string (_tmp97_);
	_tmp99_ = g_variant_ref_sink (_tmp98_);
	_tmp100_ = G_VARIANT_TYPE_STRING;
	_tmp101_ = groups;
	_tmp101__length1 = groups_length1;
	_tmp102_ = g_variant_new_array (_tmp100_, _tmp101_, _tmp101__length1);
	_tmp103_ = g_variant_ref_sink (_tmp102_);
	_tmp104_ = persona;
	_tmp105_ = folks_favourite_details_get_is_favourite ((FolksFavouriteDetails*) _tmp104_);
	_tmp106_ = _tmp105_;
	_tmp107_ = g_variant_new_boolean (_tmp106_);
	_tmp108_ = g_variant_ref_sink (_tmp107_);
	_tmp109_ = persona;
	_tmp110_ = folks_alias_details_get_alias ((FolksAliasDetails*) _tmp109_);
	_tmp111_ = _tmp110_;
	_tmp112_ = g_variant_new_string (_tmp111_);
	_tmp113_ = g_variant_ref_sink (_tmp112_);
	_tmp114_ = persona;
	_tmp115_ = tpf_persona_get_is_in_contact_list (_tmp114_);
	_tmp116_ = _tmp115_;
	_tmp117_ = g_variant_new_boolean (_tmp116_);
	_tmp118_ = g_variant_ref_sink (_tmp117_);
	_tmp119_ = persona;
	_tmp120_ = folks_persona_get_is_user ((FolksPersona*) _tmp119_);
	_tmp121_ = _tmp120_;
	_tmp122_ = g_variant_new_boolean (_tmp121_);
	_tmp123_ = g_variant_ref_sink (_tmp122_);
	_tmp124_ = G_VARIANT_TYPE_STRING;
	_tmp125_ = avatar_variant;
	_tmp126_ = g_variant_new_maybe (_tmp124_, _tmp125_);
	_tmp127_ = g_variant_ref_sink (_tmp126_);
	_tmp128_ = G_VARIANT_TYPE_INT64;
	_tmp129_ = g_variant_new_maybe (_tmp128_, birthday_variant);
	_tmp130_ = g_variant_ref_sink (_tmp129_);
	_tmp131_ = persona;
	_tmp132_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp131_);
	_tmp133_ = _tmp132_;
	_tmp134_ = g_variant_new_string (_tmp133_);
	_tmp135_ = g_variant_ref_sink (_tmp134_);
	_tmp136_ = G_VARIANT_TYPE_STRING;
	_tmp137_ = _g_variant_type_copy0 (_tmp136_);
	_tmp138_ = G_VARIANT_TYPE_STRING;
	_tmp139_ = _g_variant_type_copy0 (_tmp138_);
	_tmp140_ = G_VARIANT_TYPE_STRING;
	_tmp141_ = _g_variant_type_copy0 (_tmp140_);
	_tmp142_ = g_new0 (GVariantType*, 2 + 1);
	_tmp142_[0] = _tmp139_;
	_tmp142_[1] = _tmp141_;
	_tmp143_ = _tmp142_;
	_tmp143__length1 = 2;
	_tmp144_ = g_variant_type_new_tuple (_tmp143_, 2);
	_tmp145_ = _tmp144_;
	_tmp146_ = g_variant_type_new_array (_tmp145_);
	_tmp147_ = g_new0 (GVariantType*, 2 + 1);
	_tmp147_[0] = _tmp137_;
	_tmp147_[1] = _tmp146_;
	_tmp148_ = _tmp147_;
	_tmp148__length1 = 2;
	_tmp149_ = g_variant_type_new_tuple (_tmp148_, 2);
	_tmp150_ = _tmp149_;
	_tmp151_ = g_variant_new_array (_tmp150_, email_addresses, email_addresses_length1);
	_tmp152_ = g_variant_ref_sink (_tmp151_);
	_tmp153_ = G_VARIANT_TYPE_STRING;
	_tmp154_ = _g_variant_type_copy0 (_tmp153_);
	_tmp155_ = G_VARIANT_TYPE_STRING;
	_tmp156_ = _g_variant_type_copy0 (_tmp155_);
	_tmp157_ = G_VARIANT_TYPE_STRING;
	_tmp158_ = _g_variant_type_copy0 (_tmp157_);
	_tmp159_ = g_new0 (GVariantType*, 2 + 1);
	_tmp159_[0] = _tmp156_;
	_tmp159_[1] = _tmp158_;
	_tmp160_ = _tmp159_;
	_tmp160__length1 = 2;
	_tmp161_ = g_variant_type_new_tuple (_tmp160_, 2);
	_tmp162_ = _tmp161_;
	_tmp163_ = g_variant_type_new_array (_tmp162_);
	_tmp164_ = g_new0 (GVariantType*, 2 + 1);
	_tmp164_[0] = _tmp154_;
	_tmp164_[1] = _tmp163_;
	_tmp165_ = _tmp164_;
	_tmp165__length1 = 2;
	_tmp166_ = g_variant_type_new_tuple (_tmp165_, 2);
	_tmp167_ = _tmp166_;
	_tmp168_ = g_variant_new_array (_tmp167_, phone_numbers, phone_numbers_length1);
	_tmp169_ = g_variant_ref_sink (_tmp168_);
	_tmp170_ = G_VARIANT_TYPE_STRING;
	_tmp171_ = _g_variant_type_copy0 (_tmp170_);
	_tmp172_ = G_VARIANT_TYPE_STRING;
	_tmp173_ = _g_variant_type_copy0 (_tmp172_);
	_tmp174_ = G_VARIANT_TYPE_STRING;
	_tmp175_ = _g_variant_type_copy0 (_tmp174_);
	_tmp176_ = g_new0 (GVariantType*, 2 + 1);
	_tmp176_[0] = _tmp173_;
	_tmp176_[1] = _tmp175_;
	_tmp177_ = _tmp176_;
	_tmp177__length1 = 2;
	_tmp178_ = g_variant_type_new_tuple (_tmp177_, 2);
	_tmp179_ = _tmp178_;
	_tmp180_ = g_variant_type_new_array (_tmp179_);
	_tmp181_ = g_new0 (GVariantType*, 2 + 1);
	_tmp181_[0] = _tmp171_;
	_tmp181_[1] = _tmp180_;
	_tmp182_ = _tmp181_;
	_tmp182__length1 = 2;
	_tmp183_ = g_variant_type_new_tuple (_tmp182_, 2);
	_tmp184_ = _tmp183_;
	_tmp185_ = g_variant_new_array (_tmp184_, urls, urls_length1);
	_tmp186_ = g_variant_ref_sink (_tmp185_);
	_tmp187_ = g_new0 (GVariant*, 15 + 1);
	_tmp187_[0] = _tmp86_;
	_tmp187_[1] = _tmp91_;
	_tmp187_[2] = _tmp96_;
	_tmp187_[3] = _tmp99_;
	_tmp187_[4] = _tmp103_;
	_tmp187_[5] = _tmp108_;
	_tmp187_[6] = _tmp113_;
	_tmp187_[7] = _tmp118_;
	_tmp187_[8] = _tmp123_;
	_tmp187_[9] = _tmp127_;
	_tmp187_[10] = _tmp130_;
	_tmp187_[11] = _tmp135_;
	_tmp187_[12] = _tmp152_;
	_tmp187_[13] = _tmp169_;
	_tmp187_[14] = _tmp186_;
	_tmp188_ = _tmp187_;
	_tmp188__length1 = 15;
	_tmp189_ = g_variant_new_tuple (_tmp188_, 15);
	_tmp190_ = g_variant_ref_sink (_tmp189_);
	_tmp191_ = _tmp190_;
	_tmp188_ = (_vala_array_free (_tmp188_, _tmp188__length1, (GDestroyNotify) g_variant_unref), NULL);
	_g_variant_type_free0 (_tmp184_);
	_tmp182_ = (_vala_array_free (_tmp182_, _tmp182__length1, (GDestroyNotify) g_variant_type_free), NULL);
	_g_variant_type_free0 (_tmp179_);
	_tmp177_ = (_vala_array_free (_tmp177_, _tmp177__length1, (GDestroyNotify) g_variant_type_free), NULL);
	_g_variant_type_free0 (_tmp167_);
	_tmp165_ = (_vala_array_free (_tmp165_, _tmp165__length1, (GDestroyNotify) g_variant_type_free), NULL);
	_g_variant_type_free0 (_tmp162_);
	_tmp160_ = (_vala_array_free (_tmp160_, _tmp160__length1, (GDestroyNotify) g_variant_type_free), NULL);
	_g_variant_type_free0 (_tmp150_);
	_tmp148_ = (_vala_array_free (_tmp148_, _tmp148__length1, (GDestroyNotify) g_variant_type_free), NULL);
	_g_variant_type_free0 (_tmp145_);
	_tmp143_ = (_vala_array_free (_tmp143_, _tmp143__length1, (GDestroyNotify) g_variant_type_free), NULL);
	result = _tmp191_;
	urls = (_vala_array_free (urls, urls_length1, (GDestroyNotify) g_variant_unref), NULL);
	phone_numbers = (_vala_array_free (phone_numbers, phone_numbers_length1, (GDestroyNotify) g_variant_unref), NULL);
	email_addresses = (_vala_array_free (email_addresses, email_addresses_length1, (GDestroyNotify) g_variant_unref), NULL);
	_g_variant_unref0 (birthday_variant);
	_g_variant_unref0 (_tmp55_);
	_g_variant_unref0 (avatar_variant);
	_g_variant_unref0 (_tmp46_);
	_g_object_unref0 (avatar_file);
	_g_free0 (im_protocol);
	groups = (_vala_array_free (groups, groups_length1, (GDestroyNotify) g_variant_unref), NULL);
	return result;
}


static void tpf_persona_store_cache_deserialise_abstract_field_details (TpfPersonaStoreCache* self, GVariant* input_variants, TpfPersonaStoreCacheAfdDeserialisationCallback cb, void* cb_target) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (input_variants != NULL);
	{
		guint i;
		i = (guint) 0;
		{
			gboolean _tmp0_;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp1_;
				guint _tmp3_;
				GVariant* _tmp4_;
				gsize _tmp5_ = 0UL;
				GVariant* _tmp6_;
				guint _tmp7_;
				GVariant* _tmp8_ = NULL;
				GVariant* input_variant;
				GVariant* _tmp9_;
				GVariant* _tmp10_ = NULL;
				GVariant* _tmp11_;
				const gchar* _tmp12_ = NULL;
				gchar* _tmp13_;
				gchar* _tmp14_;
				gchar* val;
				GeeHashMultiMap* _tmp15_;
				GeeHashMultiMap* parameters;
				GVariant* _tmp16_;
				GVariant* _tmp17_ = NULL;
				GVariant* params_variants;
				TpfPersonaStoreCacheAfdDeserialisationCallback _tmp36_;
				void* _tmp36__target;
				const gchar* _tmp37_;
				GeeHashMultiMap* _tmp38_;
				_tmp1_ = _tmp0_;
				if (!_tmp1_) {
					guint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp3_ = i;
				_tmp4_ = input_variants;
				_tmp5_ = g_variant_n_children (_tmp4_);
				if (!(((gsize) _tmp3_) < _tmp5_)) {
					break;
				}
				_tmp6_ = input_variants;
				_tmp7_ = i;
				_tmp8_ = g_variant_get_child_value (_tmp6_, (gsize) _tmp7_);
				input_variant = _tmp8_;
				_tmp9_ = input_variant;
				_tmp10_ = g_variant_get_child_value (_tmp9_, (gsize) 0);
				_tmp11_ = _tmp10_;
				_tmp12_ = g_variant_get_string (_tmp11_, NULL);
				_tmp13_ = g_strdup (_tmp12_);
				_tmp14_ = _tmp13_;
				_g_variant_unref0 (_tmp11_);
				val = _tmp14_;
				_tmp15_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL);
				parameters = _tmp15_;
				_tmp16_ = input_variant;
				_tmp17_ = g_variant_get_child_value (_tmp16_, (gsize) 1);
				params_variants = _tmp17_;
				{
					guint f;
					f = (guint) 0;
					{
						gboolean _tmp18_;
						_tmp18_ = TRUE;
						while (TRUE) {
							gboolean _tmp19_;
							guint _tmp21_;
							GVariant* _tmp22_;
							gsize _tmp23_ = 0UL;
							GVariant* _tmp24_;
							guint _tmp25_;
							GVariant* _tmp26_ = NULL;
							GVariant* params_variant;
							GeeHashMultiMap* _tmp27_;
							GVariant* _tmp28_;
							GVariant* _tmp29_ = NULL;
							GVariant* _tmp30_;
							const gchar* _tmp31_ = NULL;
							GVariant* _tmp32_;
							GVariant* _tmp33_ = NULL;
							GVariant* _tmp34_;
							const gchar* _tmp35_ = NULL;
							_tmp19_ = _tmp18_;
							if (!_tmp19_) {
								guint _tmp20_;
								_tmp20_ = f;
								f = _tmp20_ + 1;
							}
							_tmp18_ = FALSE;
							_tmp21_ = f;
							_tmp22_ = params_variants;
							_tmp23_ = g_variant_n_children (_tmp22_);
							if (!(((gsize) _tmp21_) < _tmp23_)) {
								break;
							}
							_tmp24_ = params_variants;
							_tmp25_ = f;
							_tmp26_ = g_variant_get_child_value (_tmp24_, (gsize) _tmp25_);
							params_variant = _tmp26_;
							_tmp27_ = parameters;
							_tmp28_ = params_variant;
							_tmp29_ = g_variant_get_child_value (_tmp28_, (gsize) 0);
							_tmp30_ = _tmp29_;
							_tmp31_ = g_variant_get_string (_tmp30_, NULL);
							_tmp32_ = params_variant;
							_tmp33_ = g_variant_get_child_value (_tmp32_, (gsize) 1);
							_tmp34_ = _tmp33_;
							_tmp35_ = g_variant_get_string (_tmp34_, NULL);
							gee_multi_map_set ((GeeMultiMap*) _tmp27_, _tmp31_, _tmp35_);
							_g_variant_unref0 (_tmp34_);
							_g_variant_unref0 (_tmp30_);
							_g_variant_unref0 (params_variant);
						}
					}
				}
				_tmp36_ = cb;
				_tmp36__target = cb_target;
				_tmp37_ = val;
				_tmp38_ = parameters;
				_tmp36_ (_tmp37_, _tmp38_, _tmp36__target);
				_g_variant_unref0 (params_variants);
				_g_object_unref0 (parameters);
				_g_free0 (val);
				_g_variant_unref0 (input_variant);
			}
		}
	}
}


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


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		TpfPersonaStoreCache * self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->url_set);
		_g_object_unref0 (_data1_->phone_number_set);
		_g_object_unref0 (_data1_->email_address_set);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static void ___lambda3_ (Block1Data* _data1_, const gchar* v, GeeHashMultiMap* p) {
	TpfPersonaStoreCache * self;
	GeeHashSet* _tmp0_;
	const gchar* _tmp1_;
	GeeHashMultiMap* _tmp2_;
	FolksEmailFieldDetails* _tmp3_;
	FolksEmailFieldDetails* _tmp4_;
	self = _data1_->self;
	g_return_if_fail (v != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = _data1_->email_address_set;
	_tmp1_ = v;
	_tmp2_ = p;
	_tmp3_ = folks_email_field_details_new (_tmp1_, (GeeMultiMap*) _tmp2_);
	_tmp4_ = _tmp3_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, _tmp4_);
	_g_object_unref0 (_tmp4_);
}


static void ____lambda3__tpf_persona_store_cache_afd_deserialisation_callback (const gchar* val, GeeHashMultiMap* parameters, gpointer self) {
	___lambda3_ (self, val, parameters);
}


static void ___lambda4_ (Block1Data* _data1_, const gchar* v, GeeHashMultiMap* p) {
	TpfPersonaStoreCache * self;
	GeeHashSet* _tmp0_;
	const gchar* _tmp1_;
	GeeHashMultiMap* _tmp2_;
	FolksPhoneFieldDetails* _tmp3_;
	FolksPhoneFieldDetails* _tmp4_;
	self = _data1_->self;
	g_return_if_fail (v != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = _data1_->phone_number_set;
	_tmp1_ = v;
	_tmp2_ = p;
	_tmp3_ = folks_phone_field_details_new (_tmp1_, (GeeMultiMap*) _tmp2_);
	_tmp4_ = _tmp3_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, _tmp4_);
	_g_object_unref0 (_tmp4_);
}


static void ____lambda4__tpf_persona_store_cache_afd_deserialisation_callback (const gchar* val, GeeHashMultiMap* parameters, gpointer self) {
	___lambda4_ (self, val, parameters);
}


static void ___lambda5_ (Block1Data* _data1_, const gchar* v, GeeHashMultiMap* p) {
	TpfPersonaStoreCache * self;
	GeeHashSet* _tmp0_;
	const gchar* _tmp1_;
	GeeHashMultiMap* _tmp2_;
	FolksUrlFieldDetails* _tmp3_;
	FolksUrlFieldDetails* _tmp4_;
	self = _data1_->self;
	g_return_if_fail (v != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = _data1_->url_set;
	_tmp1_ = v;
	_tmp2_ = p;
	_tmp3_ = folks_url_field_details_new (_tmp1_, (GeeMultiMap*) _tmp2_);
	_tmp4_ = _tmp3_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, _tmp4_);
	_g_object_unref0 (_tmp4_);
}


static void ____lambda5__tpf_persona_store_cache_afd_deserialisation_callback (const gchar* val, GeeHashMultiMap* parameters, gpointer self) {
	___lambda5_ (self, val, parameters);
}


static TpfPersona* tpf_persona_store_cache_real_deserialise_object (FolksObjectCache* base, GVariant* variant, guint8 object_version) {
	TpfPersonaStoreCache * self;
	TpfPersona* result = NULL;
	Block1Data* _data1_;
	GVariant* _tmp0_;
	GVariant* _tmp1_ = NULL;
	GVariant* _tmp2_;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* uid;
	GVariant* _tmp6_;
	GVariant* _tmp7_ = NULL;
	GVariant* _tmp8_;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* iid;
	GVariant* _tmp12_;
	GVariant* _tmp13_ = NULL;
	GVariant* _tmp14_;
	const gchar* _tmp15_ = NULL;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* display_id;
	GVariant* _tmp18_;
	GVariant* _tmp19_ = NULL;
	GVariant* _tmp20_;
	const gchar* _tmp21_ = NULL;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* im_protocol;
	GVariant* _tmp24_;
	GVariant* _tmp25_ = NULL;
	GVariant* groups;
	GVariant* _tmp26_;
	GVariant* _tmp27_ = NULL;
	GVariant* _tmp28_;
	gboolean _tmp29_ = FALSE;
	gboolean _tmp30_;
	gboolean is_favourite;
	GVariant* _tmp31_;
	GVariant* _tmp32_ = NULL;
	GVariant* _tmp33_;
	const gchar* _tmp34_ = NULL;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* alias;
	GVariant* _tmp37_;
	GVariant* _tmp38_ = NULL;
	GVariant* _tmp39_;
	gboolean _tmp40_ = FALSE;
	gboolean _tmp41_;
	gboolean is_in_contact_list;
	GVariant* _tmp42_;
	GVariant* _tmp43_ = NULL;
	GVariant* _tmp44_;
	gboolean _tmp45_ = FALSE;
	gboolean _tmp46_;
	gboolean is_user;
	GVariant* _tmp47_;
	GVariant* _tmp48_ = NULL;
	GVariant* _tmp49_;
	GVariant* _tmp50_ = NULL;
	GVariant* _tmp51_;
	GVariant* avatar_variant;
	GeeHashSet* _tmp52_;
	GeeHashSet* group_set;
	GFileIcon* _tmp65_ = NULL;
	GVariant* _tmp66_;
	GFileIcon* _tmp72_;
	GFileIcon* _tmp73_;
	GFileIcon* avatar;
	GDateTime* birthday;
	guint8 _tmp74_;
	gchar* _tmp84_;
	gchar* full_name;
	guint8 _tmp85_;
	GeeHashSet* _tmp91_;
	GeeHashSet* _tmp92_;
	GeeHashSet* _tmp93_;
	guint8 _tmp94_;
	TpfPersonaStore* _tmp104_;
	const gchar* _tmp105_;
	const gchar* _tmp106_;
	const gchar* _tmp107_;
	const gchar* _tmp108_;
	GeeHashSet* _tmp109_;
	gboolean _tmp110_;
	const gchar* _tmp111_;
	gboolean _tmp112_;
	gboolean _tmp113_;
	GFileIcon* _tmp114_;
	GDateTime* _tmp115_;
	const gchar* _tmp116_;
	GeeHashSet* _tmp117_;
	GeeHashSet* _tmp118_;
	GeeHashSet* _tmp119_;
	TpfPersona* _tmp120_;
	self = (TpfPersonaStoreCache*) base;
	g_return_val_if_fail (variant != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = variant;
	_tmp1_ = g_variant_get_child_value (_tmp0_, (gsize) 0);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_variant_get_string (_tmp2_, NULL);
	_tmp4_ = g_strdup (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_variant_unref0 (_tmp2_);
	uid = _tmp5_;
	_tmp6_ = variant;
	_tmp7_ = g_variant_get_child_value (_tmp6_, (gsize) 1);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_variant_get_string (_tmp8_, NULL);
	_tmp10_ = g_strdup (_tmp9_);
	_tmp11_ = _tmp10_;
	_g_variant_unref0 (_tmp8_);
	iid = _tmp11_;
	_tmp12_ = variant;
	_tmp13_ = g_variant_get_child_value (_tmp12_, (gsize) 2);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_variant_get_string (_tmp14_, NULL);
	_tmp16_ = g_strdup (_tmp15_);
	_tmp17_ = _tmp16_;
	_g_variant_unref0 (_tmp14_);
	display_id = _tmp17_;
	_tmp18_ = variant;
	_tmp19_ = g_variant_get_child_value (_tmp18_, (gsize) 3);
	_tmp20_ = _tmp19_;
	_tmp21_ = g_variant_get_string (_tmp20_, NULL);
	_tmp22_ = g_strdup (_tmp21_);
	_tmp23_ = _tmp22_;
	_g_variant_unref0 (_tmp20_);
	im_protocol = _tmp23_;
	_tmp24_ = variant;
	_tmp25_ = g_variant_get_child_value (_tmp24_, (gsize) 4);
	groups = _tmp25_;
	_tmp26_ = variant;
	_tmp27_ = g_variant_get_child_value (_tmp26_, (gsize) 5);
	_tmp28_ = _tmp27_;
	_tmp29_ = g_variant_get_boolean (_tmp28_);
	_tmp30_ = _tmp29_;
	_g_variant_unref0 (_tmp28_);
	is_favourite = _tmp30_;
	_tmp31_ = variant;
	_tmp32_ = g_variant_get_child_value (_tmp31_, (gsize) 6);
	_tmp33_ = _tmp32_;
	_tmp34_ = g_variant_get_string (_tmp33_, NULL);
	_tmp35_ = g_strdup (_tmp34_);
	_tmp36_ = _tmp35_;
	_g_variant_unref0 (_tmp33_);
	alias = _tmp36_;
	_tmp37_ = variant;
	_tmp38_ = g_variant_get_child_value (_tmp37_, (gsize) 7);
	_tmp39_ = _tmp38_;
	_tmp40_ = g_variant_get_boolean (_tmp39_);
	_tmp41_ = _tmp40_;
	_g_variant_unref0 (_tmp39_);
	is_in_contact_list = _tmp41_;
	_tmp42_ = variant;
	_tmp43_ = g_variant_get_child_value (_tmp42_, (gsize) 8);
	_tmp44_ = _tmp43_;
	_tmp45_ = g_variant_get_boolean (_tmp44_);
	_tmp46_ = _tmp45_;
	_g_variant_unref0 (_tmp44_);
	is_user = _tmp46_;
	_tmp47_ = variant;
	_tmp48_ = g_variant_get_child_value (_tmp47_, (gsize) 9);
	_tmp49_ = _tmp48_;
	_tmp50_ = g_variant_get_maybe (_tmp49_);
	_tmp51_ = _tmp50_;
	_g_variant_unref0 (_tmp49_);
	avatar_variant = _tmp51_;
	_tmp52_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	group_set = _tmp52_;
	{
		guint i;
		i = (guint) 0;
		{
			gboolean _tmp53_;
			_tmp53_ = TRUE;
			while (TRUE) {
				gboolean _tmp54_;
				guint _tmp56_;
				GVariant* _tmp57_;
				gsize _tmp58_ = 0UL;
				GeeHashSet* _tmp59_;
				GVariant* _tmp60_;
				guint _tmp61_;
				GVariant* _tmp62_ = NULL;
				GVariant* _tmp63_;
				const gchar* _tmp64_ = NULL;
				_tmp54_ = _tmp53_;
				if (!_tmp54_) {
					guint _tmp55_;
					_tmp55_ = i;
					i = _tmp55_ + 1;
				}
				_tmp53_ = FALSE;
				_tmp56_ = i;
				_tmp57_ = groups;
				_tmp58_ = g_variant_n_children (_tmp57_);
				if (!(((gsize) _tmp56_) < _tmp58_)) {
					break;
				}
				_tmp59_ = group_set;
				_tmp60_ = groups;
				_tmp61_ = i;
				_tmp62_ = g_variant_get_child_value (_tmp60_, (gsize) _tmp61_);
				_tmp63_ = _tmp62_;
				_tmp64_ = g_variant_get_string (_tmp63_, NULL);
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp59_, _tmp64_);
				_g_variant_unref0 (_tmp63_);
			}
		}
	}
	_tmp66_ = avatar_variant;
	if (_tmp66_ != NULL) {
		GVariant* _tmp67_;
		const gchar* _tmp68_ = NULL;
		GFile* _tmp69_ = NULL;
		GFile* _tmp70_;
		GFileIcon* _tmp71_;
		_tmp67_ = avatar_variant;
		_tmp68_ = g_variant_get_string (_tmp67_, NULL);
		_tmp69_ = g_file_new_for_uri (_tmp68_);
		_tmp70_ = _tmp69_;
		_tmp71_ = (GFileIcon*) g_file_icon_new (_tmp70_);
		_g_object_unref0 (_tmp65_);
		_tmp65_ = _tmp71_;
		_g_object_unref0 (_tmp70_);
	} else {
		_g_object_unref0 (_tmp65_);
		_tmp65_ = NULL;
	}
	_tmp72_ = _tmp65_;
	_tmp73_ = _g_object_ref0 (_tmp72_);
	avatar = _tmp73_;
	birthday = NULL;
	_tmp74_ = object_version;
	if (((gint) _tmp74_) == 2) {
		GVariant* _tmp75_;
		GVariant* _tmp76_ = NULL;
		GVariant* _tmp77_;
		GVariant* _tmp78_ = NULL;
		GVariant* _tmp79_;
		GVariant* birthday_variant;
		GVariant* _tmp80_;
		_tmp75_ = variant;
		_tmp76_ = g_variant_get_child_value (_tmp75_, (gsize) 10);
		_tmp77_ = _tmp76_;
		_tmp78_ = g_variant_get_maybe (_tmp77_);
		_tmp79_ = _tmp78_;
		_g_variant_unref0 (_tmp77_);
		birthday_variant = _tmp79_;
		_tmp80_ = birthday_variant;
		if (_tmp80_ != NULL) {
			GVariant* _tmp81_;
			gint64 _tmp82_ = 0LL;
			GDateTime* _tmp83_;
			_tmp81_ = birthday_variant;
			_tmp82_ = g_variant_get_int64 (_tmp81_);
			_tmp83_ = g_date_time_new_from_unix_utc (_tmp82_);
			_g_date_time_unref0 (birthday);
			birthday = _tmp83_;
		}
		_g_variant_unref0 (birthday_variant);
	}
	_tmp84_ = g_strdup ("");
	full_name = _tmp84_;
	_tmp85_ = object_version;
	if (((gint) _tmp85_) == 2) {
		GVariant* _tmp86_;
		GVariant* _tmp87_ = NULL;
		GVariant* _tmp88_;
		const gchar* _tmp89_ = NULL;
		gchar* _tmp90_;
		_tmp86_ = variant;
		_tmp87_ = g_variant_get_child_value (_tmp86_, (gsize) 11);
		_tmp88_ = _tmp87_;
		_tmp89_ = g_variant_get_string (_tmp88_, NULL);
		_tmp90_ = g_strdup (_tmp89_);
		_g_free0 (full_name);
		full_name = _tmp90_;
		_g_variant_unref0 (_tmp88_);
	}
	_tmp91_ = gee_hash_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_data1_->email_address_set = _tmp91_;
	_tmp92_ = gee_hash_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_data1_->phone_number_set = _tmp92_;
	_tmp93_ = gee_hash_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	_data1_->url_set = _tmp93_;
	_tmp94_ = object_version;
	if (((gint) _tmp94_) == 2) {
		GVariant* _tmp95_;
		GVariant* _tmp96_ = NULL;
		GVariant* _tmp97_;
		GVariant* _tmp98_;
		GVariant* _tmp99_ = NULL;
		GVariant* _tmp100_;
		GVariant* _tmp101_;
		GVariant* _tmp102_ = NULL;
		GVariant* _tmp103_;
		_tmp95_ = variant;
		_tmp96_ = g_variant_get_child_value (_tmp95_, (gsize) 12);
		_tmp97_ = _tmp96_;
		tpf_persona_store_cache_deserialise_abstract_field_details (self, _tmp97_, ____lambda3__tpf_persona_store_cache_afd_deserialisation_callback, _data1_);
		_g_variant_unref0 (_tmp97_);
		_tmp98_ = variant;
		_tmp99_ = g_variant_get_child_value (_tmp98_, (gsize) 13);
		_tmp100_ = _tmp99_;
		tpf_persona_store_cache_deserialise_abstract_field_details (self, _tmp100_, ____lambda4__tpf_persona_store_cache_afd_deserialisation_callback, _data1_);
		_g_variant_unref0 (_tmp100_);
		_tmp101_ = variant;
		_tmp102_ = g_variant_get_child_value (_tmp101_, (gsize) 14);
		_tmp103_ = _tmp102_;
		tpf_persona_store_cache_deserialise_abstract_field_details (self, _tmp103_, ____lambda5__tpf_persona_store_cache_afd_deserialisation_callback, _data1_);
		_g_variant_unref0 (_tmp103_);
	}
	_tmp104_ = self->priv->_store;
	_tmp105_ = uid;
	_tmp106_ = iid;
	_tmp107_ = display_id;
	_tmp108_ = im_protocol;
	_tmp109_ = group_set;
	_tmp110_ = is_favourite;
	_tmp111_ = alias;
	_tmp112_ = is_in_contact_list;
	_tmp113_ = is_user;
	_tmp114_ = avatar;
	_tmp115_ = birthday;
	_tmp116_ = full_name;
	_tmp117_ = _data1_->email_address_set;
	_tmp118_ = _data1_->phone_number_set;
	_tmp119_ = _data1_->url_set;
	_tmp120_ = tpf_persona_new_from_cache (_tmp104_, _tmp105_, _tmp106_, _tmp107_, _tmp108_, _tmp109_, _tmp110_, _tmp111_, _tmp112_, _tmp113_, (GLoadableIcon*) _tmp114_, _tmp115_, _tmp116_, _tmp117_, _tmp118_, _tmp119_);
	result = _tmp120_;
	_g_free0 (full_name);
	_g_date_time_unref0 (birthday);
	_g_object_unref0 (avatar);
	_g_object_unref0 (_tmp65_);
	_g_object_unref0 (group_set);
	_g_variant_unref0 (avatar_variant);
	_g_free0 (alias);
	_g_variant_unref0 (groups);
	_g_free0 (im_protocol);
	_g_free0 (display_id);
	_g_free0 (iid);
	_g_free0 (uid);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return result;
}


TpfPersonaStore* tpf_persona_store_cache_get_store (TpfPersonaStoreCache* self) {
	TpfPersonaStore* result;
	TpfPersonaStore* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_store;
	result = _tmp0_;
	return result;
}


static void tpf_persona_store_cache_set_store (TpfPersonaStoreCache* self, TpfPersonaStore* value) {
	TpfPersonaStore* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_store = _tmp0_;
	g_object_notify ((GObject *) self, "store");
}


static void tpf_persona_store_cache_class_init (TpfPersonaStoreCacheClass * klass) {
	tpf_persona_store_cache_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (TpfPersonaStoreCachePrivate));
	FOLKS_OBJECT_CACHE_CLASS (klass)->get_serialised_object_type = tpf_persona_store_cache_real_get_serialised_object_type;
	FOLKS_OBJECT_CACHE_CLASS (klass)->get_serialised_object_version = tpf_persona_store_cache_real_get_serialised_object_version;
	FOLKS_OBJECT_CACHE_CLASS (klass)->serialise_object = tpf_persona_store_cache_real_serialise_object;
	FOLKS_OBJECT_CACHE_CLASS (klass)->deserialise_object = tpf_persona_store_cache_real_deserialise_object;
	G_OBJECT_CLASS (klass)->get_property = _vala_tpf_persona_store_cache_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tpf_persona_store_cache_set_property;
	G_OBJECT_CLASS (klass)->finalize = tpf_persona_store_cache_finalize;
	/**
	   * The {@link Tpf.PersonaStore} associated with this cache.
	   *
	   * @since 0.6.6
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), TPF_PERSONA_STORE_CACHE_STORE, g_param_spec_object ("store", "store", "store", TPF_TYPE_PERSONA_STORE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void tpf_persona_store_cache_instance_init (TpfPersonaStoreCache * self) {
	self->priv = TPF_PERSONA_STORE_CACHE_GET_PRIVATE (self);
}


static void tpf_persona_store_cache_finalize (GObject* obj) {
	TpfPersonaStoreCache * self;
	self = TPF_PERSONA_STORE_CACHE (obj);
	G_OBJECT_CLASS (tpf_persona_store_cache_parent_class)->finalize (obj);
}


/**
 * An object cache class which implements caching of sets of
 * {@link Tpf.Persona}s from a given {@link Tpf.PersonaStore}.
 *
 * Each {@link Tpf.Persona} is stored as a serialised {@link Variant} which is
 * a tuple containing the following fields:
 *  # UID (`s`)
 *  # IID (`s`)
 *  # IM address (`s`)
 *  # Protocol (`s`)
 *  # Set of group names (`as`)
 *  # Favourite? (`b`)
 *  # Alias (`s`)
 *  # In contact list? (`b`)
 *  # Avatar file URI (`s`)
 *  # Birthday date as a Unix timestamp (`s`)
 *  # Set of e-mail addresses and parameters (`a(sa(ss))`)
 *  # Full name (`s`)
 *
 * @since 0.6.0
 */
GType tpf_persona_store_cache_get_type (void) {
	static volatile gsize tpf_persona_store_cache_type_id__volatile = 0;
	if (g_once_init_enter (&tpf_persona_store_cache_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TpfPersonaStoreCacheClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tpf_persona_store_cache_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TpfPersonaStoreCache), 0, (GInstanceInitFunc) tpf_persona_store_cache_instance_init, NULL };
		GType tpf_persona_store_cache_type_id;
		tpf_persona_store_cache_type_id = g_type_register_static (FOLKS_TYPE_OBJECT_CACHE, "TpfPersonaStoreCache", &g_define_type_info, 0);
		g_once_init_leave (&tpf_persona_store_cache_type_id__volatile, tpf_persona_store_cache_type_id);
	}
	return tpf_persona_store_cache_type_id__volatile;
}


static void _vala_tpf_persona_store_cache_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	TpfPersonaStoreCache * self;
	self = TPF_PERSONA_STORE_CACHE (object);
	switch (property_id) {
		case TPF_PERSONA_STORE_CACHE_STORE:
		g_value_set_object (value, tpf_persona_store_cache_get_store (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_tpf_persona_store_cache_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	TpfPersonaStoreCache * self;
	self = TPF_PERSONA_STORE_CACHE (object);
	switch (property_id) {
		case TPF_PERSONA_STORE_CACHE_STORE:
		tpf_persona_store_cache_set_store (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);
}



