/* tpf-persona-store-cache.c generated by valac 0.17.6.5-65f99, 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 _Block2Data Block2Data;
#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 _Block2Data {
	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 Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void ___lambda3_ (Block2Data* _data2_, 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_ (Block2Data* _data2_, 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_ (Block2Data* _data2_, 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** _tmp69_;
	gint _tmp69__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** _tmp49_;
			gint _tmp49__length1;
			guint _tmp50_;
			FolksAbstractFieldDetails* _tmp51_;
			gconstpointer _tmp52_;
			const gchar* _tmp53_;
			GVariant* _tmp54_;
			const GVariantType* _tmp55_;
			GVariantType* _tmp56_;
			const GVariantType* _tmp57_;
			GVariantType* _tmp58_;
			GVariantType** _tmp59_ = NULL;
			GVariantType** _tmp60_;
			gint _tmp60__length1;
			GVariantType* _tmp61_;
			GVariantType* _tmp62_;
			GVariant** _tmp63_;
			gint _tmp63__length1;
			GVariant* _tmp64_;
			GVariant** _tmp65_ = NULL;
			GVariant** _tmp66_;
			gint _tmp66__length1;
			GVariant* _tmp67_;
			GVariant* _tmp68_;
			_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_;
							const gchar* _tmp43_;
							GVariant* _tmp44_;
							GVariant** _tmp45_ = NULL;
							GVariant** _tmp46_;
							gint _tmp46__length1;
							GVariant* _tmp47_;
							GVariant* _tmp48_;
							_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_);
							g_variant_ref_sink (_tmp42_);
							_tmp43_ = val;
							_tmp44_ = g_variant_new_string (_tmp43_);
							g_variant_ref_sink (_tmp44_);
							_tmp45_ = g_new0 (GVariant*, 2 + 1);
							_tmp45_[0] = _tmp42_;
							_tmp45_[1] = _tmp44_;
							_tmp46_ = _tmp45_;
							_tmp46__length1 = 2;
							_tmp47_ = g_variant_new_tuple (_tmp46_, 2);
							g_variant_ref_sink (_tmp47_);
							_g_variant_unref0 (_tmp39_[_tmp40_]);
							_tmp39_[_tmp40_] = _tmp47_;
							_tmp48_ = _tmp39_[_tmp40_];
							_tmp46_ = (_vala_array_free (_tmp46_, _tmp46__length1, (GDestroyNotify) g_variant_unref), NULL);
							_g_free0 (val);
						}
						_g_object_unref0 (_val_it);
					}
					_g_free0 (key);
				}
				_g_object_unref0 (_key_it);
			}
			_tmp49_ = output_variants;
			_tmp49__length1 = output_variants_length1;
			_tmp50_ = i;
			i = _tmp50_ + 1;
			_tmp51_ = afd;
			_tmp52_ = folks_abstract_field_details_get_value (_tmp51_);
			_tmp53_ = _tmp52_;
			_tmp54_ = _variant_new1 ((const gchar*) _tmp53_);
			_tmp55_ = G_VARIANT_TYPE_STRING;
			_tmp56_ = _g_variant_type_copy0 (_tmp55_);
			_tmp57_ = G_VARIANT_TYPE_STRING;
			_tmp58_ = _g_variant_type_copy0 (_tmp57_);
			_tmp59_ = g_new0 (GVariantType*, 2 + 1);
			_tmp59_[0] = _tmp56_;
			_tmp59_[1] = _tmp58_;
			_tmp60_ = _tmp59_;
			_tmp60__length1 = 2;
			_tmp61_ = g_variant_type_new_tuple (_tmp60_, 2);
			_tmp62_ = _tmp61_;
			_tmp63_ = parameters;
			_tmp63__length1 = parameters_length1;
			_tmp64_ = g_variant_new_array (_tmp62_, _tmp63_, _tmp63__length1);
			g_variant_ref_sink (_tmp64_);
			_tmp65_ = g_new0 (GVariant*, 2 + 1);
			_tmp65_[0] = _tmp54_;
			_tmp65_[1] = _tmp64_;
			_tmp66_ = _tmp65_;
			_tmp66__length1 = 2;
			_tmp67_ = g_variant_new_tuple (_tmp66_, 2);
			g_variant_ref_sink (_tmp67_);
			_g_variant_unref0 (_tmp49_[_tmp50_]);
			_tmp49_[_tmp50_] = _tmp67_;
			_tmp68_ = _tmp49_[_tmp50_];
			_tmp66_ = (_vala_array_free (_tmp66_, _tmp66__length1, (GDestroyNotify) g_variant_unref), NULL);
			_g_variant_type_free0 (_tmp62_);
			_tmp60_ = (_vala_array_free (_tmp60_, _tmp60__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);
	}
	_tmp69_ = output_variants;
	_tmp69__length1 = output_variants_length1;
	if (result_length1) {
		*result_length1 = _tmp69__length1;
	}
	result = _tmp69_;
	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* _tmp30_ = NULL;
	gboolean _tmp31_ = FALSE;
	TpfPersona* _tmp32_;
	GLoadableIcon* _tmp33_;
	GLoadableIcon* _tmp34_;
	gboolean _tmp38_;
	GFile* _tmp43_;
	GFile* _tmp44_;
	GFile* avatar_file;
	GVariant* _tmp45_ = NULL;
	GFile* _tmp46_;
	GVariant* _tmp51_;
	GVariant* _tmp52_;
	GVariant* avatar_variant;
	GVariant* _tmp53_ = NULL;
	TpfPersona* _tmp54_;
	GDateTime* _tmp55_;
	GDateTime* _tmp56_;
	GVariant* _tmp62_;
	GVariant* _tmp63_;
	GVariant* birthday_variant;
	TpfPersona* _tmp64_;
	GeeSet* _tmp65_;
	GeeSet* _tmp66_;
	gint _tmp67_ = 0;
	GVariant** _tmp68_ = NULL;
	GVariant** email_addresses;
	gint email_addresses_length1;
	gint _email_addresses_size_;
	TpfPersona* _tmp69_;
	GeeSet* _tmp70_;
	GeeSet* _tmp71_;
	gint _tmp72_ = 0;
	GVariant** _tmp73_ = NULL;
	GVariant** phone_numbers;
	gint phone_numbers_length1;
	gint _phone_numbers_size_;
	TpfPersona* _tmp74_;
	GeeSet* _tmp75_;
	GeeSet* _tmp76_;
	gint _tmp77_ = 0;
	GVariant** _tmp78_ = NULL;
	GVariant** urls;
	gint urls_length1;
	gint _urls_size_;
	TpfPersona* _tmp79_;
	const gchar* _tmp80_;
	const gchar* _tmp81_;
	GVariant* _tmp82_;
	TpfPersona* _tmp83_;
	const gchar* _tmp84_;
	const gchar* _tmp85_;
	GVariant* _tmp86_;
	TpfPersona* _tmp87_;
	const gchar* _tmp88_;
	const gchar* _tmp89_;
	GVariant* _tmp90_;
	const gchar* _tmp91_;
	GVariant* _tmp92_;
	const GVariantType* _tmp93_;
	GVariant** _tmp94_;
	gint _tmp94__length1;
	GVariant* _tmp95_;
	TpfPersona* _tmp96_;
	gboolean _tmp97_;
	gboolean _tmp98_;
	GVariant* _tmp99_;
	TpfPersona* _tmp100_;
	const gchar* _tmp101_;
	const gchar* _tmp102_;
	GVariant* _tmp103_;
	TpfPersona* _tmp104_;
	gboolean _tmp105_;
	gboolean _tmp106_;
	GVariant* _tmp107_;
	TpfPersona* _tmp108_;
	gboolean _tmp109_;
	gboolean _tmp110_;
	GVariant* _tmp111_;
	const GVariantType* _tmp112_;
	GVariant* _tmp113_;
	GVariant* _tmp114_;
	const GVariantType* _tmp115_;
	GVariant* _tmp116_;
	TpfPersona* _tmp117_;
	const gchar* _tmp118_;
	const gchar* _tmp119_;
	GVariant* _tmp120_;
	const GVariantType* _tmp121_;
	GVariantType* _tmp122_;
	const GVariantType* _tmp123_;
	GVariantType* _tmp124_;
	const GVariantType* _tmp125_;
	GVariantType* _tmp126_;
	GVariantType** _tmp127_ = NULL;
	GVariantType** _tmp128_;
	gint _tmp128__length1;
	GVariantType* _tmp129_;
	GVariantType* _tmp130_;
	GVariantType* _tmp131_;
	GVariantType** _tmp132_ = NULL;
	GVariantType** _tmp133_;
	gint _tmp133__length1;
	GVariantType* _tmp134_;
	GVariantType* _tmp135_;
	GVariant* _tmp136_;
	const GVariantType* _tmp137_;
	GVariantType* _tmp138_;
	const GVariantType* _tmp139_;
	GVariantType* _tmp140_;
	const GVariantType* _tmp141_;
	GVariantType* _tmp142_;
	GVariantType** _tmp143_ = NULL;
	GVariantType** _tmp144_;
	gint _tmp144__length1;
	GVariantType* _tmp145_;
	GVariantType* _tmp146_;
	GVariantType* _tmp147_;
	GVariantType** _tmp148_ = NULL;
	GVariantType** _tmp149_;
	gint _tmp149__length1;
	GVariantType* _tmp150_;
	GVariantType* _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_ = NULL;
	GVariant** _tmp170_;
	gint _tmp170__length1;
	GVariant* _tmp171_;
	GVariant* _tmp172_;
	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_;
			_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_);
			g_variant_ref_sink (_tmp17_);
			_g_variant_unref0 (_tmp14_[_tmp15_]);
			_tmp14_[_tmp15_] = _tmp17_;
			_tmp18_ = _tmp14_[_tmp15_];
			_g_free0 (group);
		}
		_g_object_unref0 (_group_it);
	}
	im_protocol = NULL;
	{
		TpfPersona* _tmp19_;
		GeeMultiMap* _tmp20_;
		GeeMultiMap* _tmp21_;
		GeeSet* _tmp22_ = NULL;
		GeeSet* _tmp23_;
		GeeIterator* _tmp24_ = NULL;
		GeeIterator* _tmp25_;
		GeeIterator* _protocol_it;
		_tmp19_ = persona;
		_tmp20_ = folks_im_details_get_im_addresses ((FolksImDetails*) _tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = gee_multi_map_get_keys (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = gee_iterable_iterator ((GeeIterable*) _tmp23_);
		_tmp25_ = _tmp24_;
		_g_object_unref0 (_tmp23_);
		_protocol_it = _tmp25_;
		while (TRUE) {
			gboolean _tmp26_ = FALSE;
			gpointer _tmp27_ = NULL;
			gchar* protocol;
			const gchar* _tmp28_;
			gchar* _tmp29_;
			_tmp26_ = gee_iterator_next (_protocol_it);
			if (!_tmp26_) {
				break;
			}
			_tmp27_ = gee_iterator_get (_protocol_it);
			protocol = (gchar*) _tmp27_;
			_tmp28_ = protocol;
			_tmp29_ = g_strdup (_tmp28_);
			_g_free0 (im_protocol);
			im_protocol = _tmp29_;
			_g_free0 (protocol);
			break;
		}
		_g_object_unref0 (_protocol_it);
	}
	_tmp32_ = persona;
	_tmp33_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp32_);
	_tmp34_ = _tmp33_;
	if (_tmp34_ != NULL) {
		TpfPersona* _tmp35_;
		GLoadableIcon* _tmp36_;
		GLoadableIcon* _tmp37_;
		_tmp35_ = persona;
		_tmp36_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp35_);
		_tmp37_ = _tmp36_;
		_tmp31_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp37_, g_file_icon_get_type ());
	} else {
		_tmp31_ = FALSE;
	}
	_tmp38_ = _tmp31_;
	if (_tmp38_) {
		TpfPersona* _tmp39_;
		GLoadableIcon* _tmp40_;
		GLoadableIcon* _tmp41_;
		GFile* _tmp42_ = NULL;
		_tmp39_ = persona;
		_tmp40_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp39_);
		_tmp41_ = _tmp40_;
		_tmp42_ = g_file_icon_get_file (G_TYPE_CHECK_INSTANCE_TYPE (_tmp41_, g_file_icon_get_type ()) ? ((GFileIcon*) _tmp41_) : NULL);
		_tmp30_ = _tmp42_;
	} else {
		_tmp30_ = NULL;
	}
	_tmp43_ = _tmp30_;
	_tmp44_ = _g_object_ref0 (_tmp43_);
	avatar_file = _tmp44_;
	_tmp46_ = avatar_file;
	if (_tmp46_ != NULL) {
		GFile* _tmp47_;
		gchar* _tmp48_ = NULL;
		gchar* _tmp49_;
		GVariant* _tmp50_;
		_tmp47_ = avatar_file;
		_tmp48_ = g_file_get_uri (_tmp47_);
		_tmp49_ = _tmp48_;
		_tmp50_ = g_variant_new_string (_tmp49_);
		g_variant_ref_sink (_tmp50_);
		_g_variant_unref0 (_tmp45_);
		_tmp45_ = _tmp50_;
		_g_free0 (_tmp49_);
	} else {
		_g_variant_unref0 (_tmp45_);
		_tmp45_ = NULL;
	}
	_tmp51_ = _tmp45_;
	_tmp52_ = _g_variant_ref0 (_tmp51_);
	avatar_variant = _tmp52_;
	_tmp54_ = persona;
	_tmp55_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _tmp54_);
	_tmp56_ = _tmp55_;
	if (_tmp56_ != NULL) {
		TpfPersona* _tmp57_;
		GDateTime* _tmp58_;
		GDateTime* _tmp59_;
		gint64 _tmp60_ = 0LL;
		GVariant* _tmp61_;
		_tmp57_ = persona;
		_tmp58_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = g_date_time_to_unix (_tmp59_);
		_tmp61_ = g_variant_new_int64 (_tmp60_);
		g_variant_ref_sink (_tmp61_);
		_g_variant_unref0 (_tmp53_);
		_tmp53_ = _tmp61_;
	} else {
		_g_variant_unref0 (_tmp53_);
		_tmp53_ = NULL;
	}
	_tmp62_ = _tmp53_;
	_tmp63_ = _g_variant_ref0 (_tmp62_);
	birthday_variant = _tmp63_;
	_tmp64_ = persona;
	_tmp65_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp64_);
	_tmp66_ = _tmp65_;
	_tmp68_ = tpf_persona_store_cache_serialise_abstract_field_details (self, _tmp66_, &_tmp67_);
	email_addresses = _tmp68_;
	email_addresses_length1 = _tmp67_;
	_email_addresses_size_ = email_addresses_length1;
	_tmp69_ = persona;
	_tmp70_ = folks_phone_details_get_phone_numbers ((FolksPhoneDetails*) _tmp69_);
	_tmp71_ = _tmp70_;
	_tmp73_ = tpf_persona_store_cache_serialise_abstract_field_details (self, _tmp71_, &_tmp72_);
	phone_numbers = _tmp73_;
	phone_numbers_length1 = _tmp72_;
	_phone_numbers_size_ = phone_numbers_length1;
	_tmp74_ = persona;
	_tmp75_ = folks_url_details_get_urls ((FolksUrlDetails*) _tmp74_);
	_tmp76_ = _tmp75_;
	_tmp78_ = tpf_persona_store_cache_serialise_abstract_field_details (self, _tmp76_, &_tmp77_);
	urls = _tmp78_;
	urls_length1 = _tmp77_;
	_urls_size_ = urls_length1;
	_tmp79_ = persona;
	_tmp80_ = folks_persona_get_uid ((FolksPersona*) _tmp79_);
	_tmp81_ = _tmp80_;
	_tmp82_ = g_variant_new_string (_tmp81_);
	g_variant_ref_sink (_tmp82_);
	_tmp83_ = persona;
	_tmp84_ = folks_persona_get_iid ((FolksPersona*) _tmp83_);
	_tmp85_ = _tmp84_;
	_tmp86_ = g_variant_new_string (_tmp85_);
	g_variant_ref_sink (_tmp86_);
	_tmp87_ = persona;
	_tmp88_ = folks_persona_get_display_id ((FolksPersona*) _tmp87_);
	_tmp89_ = _tmp88_;
	_tmp90_ = g_variant_new_string (_tmp89_);
	g_variant_ref_sink (_tmp90_);
	_tmp91_ = im_protocol;
	_tmp92_ = g_variant_new_string (_tmp91_);
	g_variant_ref_sink (_tmp92_);
	_tmp93_ = G_VARIANT_TYPE_STRING;
	_tmp94_ = groups;
	_tmp94__length1 = groups_length1;
	_tmp95_ = g_variant_new_array (_tmp93_, _tmp94_, _tmp94__length1);
	g_variant_ref_sink (_tmp95_);
	_tmp96_ = persona;
	_tmp97_ = folks_favourite_details_get_is_favourite ((FolksFavouriteDetails*) _tmp96_);
	_tmp98_ = _tmp97_;
	_tmp99_ = g_variant_new_boolean (_tmp98_);
	g_variant_ref_sink (_tmp99_);
	_tmp100_ = persona;
	_tmp101_ = folks_alias_details_get_alias ((FolksAliasDetails*) _tmp100_);
	_tmp102_ = _tmp101_;
	_tmp103_ = g_variant_new_string (_tmp102_);
	g_variant_ref_sink (_tmp103_);
	_tmp104_ = persona;
	_tmp105_ = tpf_persona_get_is_in_contact_list (_tmp104_);
	_tmp106_ = _tmp105_;
	_tmp107_ = g_variant_new_boolean (_tmp106_);
	g_variant_ref_sink (_tmp107_);
	_tmp108_ = persona;
	_tmp109_ = folks_persona_get_is_user ((FolksPersona*) _tmp108_);
	_tmp110_ = _tmp109_;
	_tmp111_ = g_variant_new_boolean (_tmp110_);
	g_variant_ref_sink (_tmp111_);
	_tmp112_ = G_VARIANT_TYPE_STRING;
	_tmp113_ = avatar_variant;
	_tmp114_ = g_variant_new_maybe (_tmp112_, _tmp113_);
	g_variant_ref_sink (_tmp114_);
	_tmp115_ = G_VARIANT_TYPE_INT64;
	_tmp116_ = g_variant_new_maybe (_tmp115_, birthday_variant);
	g_variant_ref_sink (_tmp116_);
	_tmp117_ = persona;
	_tmp118_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp117_);
	_tmp119_ = _tmp118_;
	_tmp120_ = g_variant_new_string (_tmp119_);
	g_variant_ref_sink (_tmp120_);
	_tmp121_ = G_VARIANT_TYPE_STRING;
	_tmp122_ = _g_variant_type_copy0 (_tmp121_);
	_tmp123_ = G_VARIANT_TYPE_STRING;
	_tmp124_ = _g_variant_type_copy0 (_tmp123_);
	_tmp125_ = G_VARIANT_TYPE_STRING;
	_tmp126_ = _g_variant_type_copy0 (_tmp125_);
	_tmp127_ = g_new0 (GVariantType*, 2 + 1);
	_tmp127_[0] = _tmp124_;
	_tmp127_[1] = _tmp126_;
	_tmp128_ = _tmp127_;
	_tmp128__length1 = 2;
	_tmp129_ = g_variant_type_new_tuple (_tmp128_, 2);
	_tmp130_ = _tmp129_;
	_tmp131_ = g_variant_type_new_array (_tmp130_);
	_tmp132_ = g_new0 (GVariantType*, 2 + 1);
	_tmp132_[0] = _tmp122_;
	_tmp132_[1] = _tmp131_;
	_tmp133_ = _tmp132_;
	_tmp133__length1 = 2;
	_tmp134_ = g_variant_type_new_tuple (_tmp133_, 2);
	_tmp135_ = _tmp134_;
	_tmp136_ = g_variant_new_array (_tmp135_, email_addresses, email_addresses_length1);
	g_variant_ref_sink (_tmp136_);
	_tmp137_ = G_VARIANT_TYPE_STRING;
	_tmp138_ = _g_variant_type_copy0 (_tmp137_);
	_tmp139_ = G_VARIANT_TYPE_STRING;
	_tmp140_ = _g_variant_type_copy0 (_tmp139_);
	_tmp141_ = G_VARIANT_TYPE_STRING;
	_tmp142_ = _g_variant_type_copy0 (_tmp141_);
	_tmp143_ = g_new0 (GVariantType*, 2 + 1);
	_tmp143_[0] = _tmp140_;
	_tmp143_[1] = _tmp142_;
	_tmp144_ = _tmp143_;
	_tmp144__length1 = 2;
	_tmp145_ = g_variant_type_new_tuple (_tmp144_, 2);
	_tmp146_ = _tmp145_;
	_tmp147_ = g_variant_type_new_array (_tmp146_);
	_tmp148_ = g_new0 (GVariantType*, 2 + 1);
	_tmp148_[0] = _tmp138_;
	_tmp148_[1] = _tmp147_;
	_tmp149_ = _tmp148_;
	_tmp149__length1 = 2;
	_tmp150_ = g_variant_type_new_tuple (_tmp149_, 2);
	_tmp151_ = _tmp150_;
	_tmp152_ = g_variant_new_array (_tmp151_, phone_numbers, phone_numbers_length1);
	g_variant_ref_sink (_tmp152_);
	_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_, urls, urls_length1);
	g_variant_ref_sink (_tmp168_);
	_tmp169_ = g_new0 (GVariant*, 15 + 1);
	_tmp169_[0] = _tmp82_;
	_tmp169_[1] = _tmp86_;
	_tmp169_[2] = _tmp90_;
	_tmp169_[3] = _tmp92_;
	_tmp169_[4] = _tmp95_;
	_tmp169_[5] = _tmp99_;
	_tmp169_[6] = _tmp103_;
	_tmp169_[7] = _tmp107_;
	_tmp169_[8] = _tmp111_;
	_tmp169_[9] = _tmp114_;
	_tmp169_[10] = _tmp116_;
	_tmp169_[11] = _tmp120_;
	_tmp169_[12] = _tmp136_;
	_tmp169_[13] = _tmp152_;
	_tmp169_[14] = _tmp168_;
	_tmp170_ = _tmp169_;
	_tmp170__length1 = 15;
	_tmp171_ = g_variant_new_tuple (_tmp170_, 15);
	g_variant_ref_sink (_tmp171_);
	_tmp172_ = _tmp171_;
	_tmp170_ = (_vala_array_free (_tmp170_, _tmp170__length1, (GDestroyNotify) g_variant_unref), 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 (_tmp151_);
	_tmp149_ = (_vala_array_free (_tmp149_, _tmp149__length1, (GDestroyNotify) g_variant_type_free), NULL);
	_g_variant_type_free0 (_tmp146_);
	_tmp144_ = (_vala_array_free (_tmp144_, _tmp144__length1, (GDestroyNotify) g_variant_type_free), NULL);
	_g_variant_type_free0 (_tmp135_);
	_tmp133_ = (_vala_array_free (_tmp133_, _tmp133__length1, (GDestroyNotify) g_variant_type_free), NULL);
	_g_variant_type_free0 (_tmp130_);
	_tmp128_ = (_vala_array_free (_tmp128_, _tmp128__length1, (GDestroyNotify) g_variant_type_free), NULL);
	result = _tmp172_;
	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 (_tmp53_);
	_g_variant_unref0 (avatar_variant);
	_g_variant_unref0 (_tmp45_);
	_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 Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


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


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


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


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


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


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


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;
	Block2Data* _data2_;
	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);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->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);
	_data2_->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);
	_data2_->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);
	_data2_->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, _data2_);
		_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, _data2_);
		_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, _data2_);
		_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_ = _data2_->email_address_set;
	_tmp118_ = _data2_->phone_number_set;
	_tmp119_ = _data2_->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);
	block2_data_unref (_data2_);
	_data2_ = 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 = G_TYPE_CHECK_INSTANCE_CAST (obj, TPF_TYPE_PERSONA_STORE_CACHE, TpfPersonaStoreCache);
	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 = G_TYPE_CHECK_INSTANCE_CAST (object, TPF_TYPE_PERSONA_STORE_CACHE, TpfPersonaStoreCache);
	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 = G_TYPE_CHECK_INSTANCE_CAST (object, TPF_TYPE_PERSONA_STORE_CACHE, TpfPersonaStoreCache);
	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);
}



