/* contacts-contact.c generated by valac 0.30.0.38-a55d, the Vala compiler
 * generated from contacts-contact.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <folks/folks.h>
#include <pango/pango.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gee.h>
#include <folks/folks-telepathy.h>
#include <gio/gio.h>
#include <geocode-glib/geocode-glib.h>
#include <glib/gi18n-lib.h>
#include <config.h>
#include <telepathy-glib/telepathy-glib.h>
#include <cairo.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <contacts-esd-setup.h>
#include <folks/folks-eds.h>
#include <gobject/gvaluecollector.h>


#define CONTACTS_TYPE_CONTACT_PRESENCE (contacts_contact_presence_get_type ())
#define CONTACTS_CONTACT_PRESENCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_PRESENCE, ContactsContactPresence))
#define CONTACTS_CONTACT_PRESENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_PRESENCE, ContactsContactPresenceClass))
#define CONTACTS_IS_CONTACT_PRESENCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_PRESENCE))
#define CONTACTS_IS_CONTACT_PRESENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_PRESENCE))
#define CONTACTS_CONTACT_PRESENCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_PRESENCE, ContactsContactPresenceClass))

typedef struct _ContactsContactPresence ContactsContactPresence;
typedef struct _ContactsContactPresenceClass ContactsContactPresenceClass;
typedef struct _ContactsContactPresencePrivate ContactsContactPresencePrivate;

#define CONTACTS_TYPE_CONTACT (contacts_contact_get_type ())
#define CONTACTS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT, ContactsContact))
#define CONTACTS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT, ContactsContactClass))
#define CONTACTS_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT))
#define CONTACTS_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT))
#define CONTACTS_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT, ContactsContactClass))

typedef struct _ContactsContact ContactsContact;
typedef struct _ContactsContactClass ContactsContactClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ContactsContactPrivate ContactsContactPrivate;

#define CONTACTS_TYPE_STORE (contacts_store_get_type ())
#define CONTACTS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_STORE, ContactsStore))
#define CONTACTS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_STORE, ContactsStoreClass))
#define CONTACTS_IS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_STORE))
#define CONTACTS_IS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_STORE))
#define CONTACTS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_STORE, ContactsStoreClass))

typedef struct _ContactsStore ContactsStore;
typedef struct _ContactsStoreClass ContactsStoreClass;
typedef struct _Block12Data Block12Data;

#define CONTACTS_CONTACT_TYPE_CONTACT_DATA_REF (contacts_contact_contact_data_ref_get_type ())
typedef struct _ContactsContactContactDataRef ContactsContactContactDataRef;

#define CONTACTS_CONTACT_TYPE_IM_DISPLAY (contacts_contact_im_display_get_type ())
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define CONTACTS_TYPE_FAKE_PERSONA (contacts_fake_persona_get_type ())
#define CONTACTS_FAKE_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersona))
#define CONTACTS_FAKE_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersonaClass))
#define CONTACTS_IS_FAKE_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_FAKE_PERSONA))
#define CONTACTS_IS_FAKE_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_FAKE_PERSONA))
#define CONTACTS_FAKE_PERSONA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersonaClass))

typedef struct _ContactsFakePersona ContactsFakePersona;
typedef struct _ContactsFakePersonaClass ContactsFakePersonaClass;
#define _t_destroy_func0(var) (((var == NULL) || (t_destroy_func == NULL)) ? NULL : (var = (t_destroy_func (var), NULL)))
typedef struct _Block13Data Block13Data;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _ContactsContactGeocodeAddressData ContactsContactGeocodeAddressData;

#define CONTACTS_CONTACT_TYPE_IM_DATA (contacts_contact_im_data_get_type ())
typedef struct _ContactsContactImData ContactsContactImData;
typedef struct _Block14Data Block14Data;
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define CONTACTS_TYPE_TYPESET (contacts_typeset_get_type ())
#define CONTACTS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSet))
#define CONTACTS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))
#define CONTACTS_IS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_TYPESET))
#define CONTACTS_IS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_TYPESET))
#define CONTACTS_TYPESET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))

typedef struct _ContactsTypeSet ContactsTypeSet;
typedef struct _ContactsTypeSetClass ContactsTypeSetClass;
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
#define _gtk_icon_info_free0(var) ((var == NULL) ? NULL : (var = (gtk_icon_info_free (var), NULL)))
#define _cairo_pattern_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_pattern_destroy (var), NULL)))
typedef struct _ContactsContactRemovePersonasData ContactsContactRemovePersonasData;
typedef struct _ContactsContactEnsurePrimaryPersonaData ContactsContactEnsurePrimaryPersonaData;
typedef struct _ContactsContactSetIndividualPropertyData ContactsContactSetIndividualPropertyData;
typedef struct _ContactsContactCreatePrimaryPersonaForDetailsData ContactsContactCreatePrimaryPersonaForDetailsData;
typedef struct _ContactsContactSetPersonaPropertyData ContactsContactSetPersonaPropertyData;
typedef struct _Block15Data Block15Data;

#define CONTACTS_TYPE_FAKE_PERSONA_STORE (contacts_fake_persona_store_get_type ())
#define CONTACTS_FAKE_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_FAKE_PERSONA_STORE, ContactsFakePersonaStore))
#define CONTACTS_FAKE_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_FAKE_PERSONA_STORE, ContactsFakePersonaStoreClass))
#define CONTACTS_IS_FAKE_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_FAKE_PERSONA_STORE))
#define CONTACTS_IS_FAKE_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_FAKE_PERSONA_STORE))
#define CONTACTS_FAKE_PERSONA_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_FAKE_PERSONA_STORE, ContactsFakePersonaStoreClass))

typedef struct _ContactsFakePersonaStore ContactsFakePersonaStore;
typedef struct _ContactsFakePersonaStoreClass ContactsFakePersonaStoreClass;
typedef struct _ContactsFakePersonaStorePrivate ContactsFakePersonaStorePrivate;
typedef struct _ContactsFakePersonaStorePrepareData ContactsFakePersonaStorePrepareData;
typedef struct _ContactsFakePersonaStoreAddPersonaFromDetailsData ContactsFakePersonaStoreAddPersonaFromDetailsData;
typedef struct _ContactsFakePersonaStoreRemovePersonaData ContactsFakePersonaStoreRemovePersonaData;
typedef struct _ContactsFakePersonaPrivate ContactsFakePersonaPrivate;

#define CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL (contacts_fake_persona_prop_val_get_type ())
#define CONTACTS_FAKE_PERSONA_PROP_VAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL, ContactsFakePersonaPropVal))
#define CONTACTS_FAKE_PERSONA_PROP_VAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL, ContactsFakePersonaPropValClass))
#define CONTACTS_FAKE_PERSONA_IS_PROP_VAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL))
#define CONTACTS_FAKE_PERSONA_IS_PROP_VAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL))
#define CONTACTS_FAKE_PERSONA_PROP_VAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL, ContactsFakePersonaPropValClass))

typedef struct _ContactsFakePersonaPropVal ContactsFakePersonaPropVal;
typedef struct _ContactsFakePersonaPropValClass ContactsFakePersonaPropValClass;
typedef struct _ContactsFakePersonaPropValPrivate ContactsFakePersonaPropValPrivate;
#define _contacts_fake_persona_prop_val_unref0(var) ((var == NULL) ? NULL : (var = (contacts_fake_persona_prop_val_unref (var), NULL)))
typedef struct _ContactsFakePersonaMakeRealAndSetData ContactsFakePersonaMakeRealAndSetData;
typedef struct _ContactsFakePersonaParamSpecPropVal ContactsFakePersonaParamSpecPropVal;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

typedef enum  {
	CONTACT_ERROR_NOT_IMPLEMENTED,
	CONTACT_ERROR_NO_PRIMARY
} ContactError;
#define CONTACT_ERROR contact_error_quark ()
struct _ContactsContactPresence {
	GtkGrid parent_instance;
	ContactsContactPresencePrivate * priv;
};

struct _ContactsContactPresenceClass {
	GtkGridClass parent_class;
};

struct _ContactsContactPresencePrivate {
	ContactsContact* contact;
	GtkImage* image;
	GtkImage* phone_image;
	GtkLabel* label;
	gchar* last_class;
};

struct _ContactsContact {
	GObject parent_instance;
	ContactsContactPrivate * priv;
	ContactsStore* store;
	gboolean is_main;
	FolksPresenceType presence_type;
	gchar* presence_message;
	gboolean is_phone;
	FolksIndividual* individual;
	FolksPersona* fake_persona;
};

struct _ContactsContactClass {
	GObjectClass parent_class;
};

struct _Block12Data {
	int _ref_count_;
	ContactsContactPresence* self;
	gulong id;
	gulong id2;
	ContactsContact* contact;
};

struct _ContactsContactContactDataRef {
	void* key;
	void* data;
};

struct _ContactsContactPrivate {
	ContactsContactContactDataRef* refs;
	gint refs_length1;
	gint _refs_size_;
	guint changed_id;
	gboolean changed_personas;
	GdkPixbuf* _small_avatar;
	GVariant* _avatar_icon_data;
	gchar* filter_data;
	gboolean _is_hidden;
	gboolean _is_hidden_uptodate;
	gboolean _is_hidden_to_delete;
};

typedef enum  {
	CONTACTS_CONTACT_IM_DISPLAY_DEFAULT,
	CONTACTS_CONTACT_IM_DISPLAY_ALIAS_SERVICE
} ContactsContactImDisplay;

struct _Block13Data {
	int _ref_count_;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	GeocodePlace* place;
	GeocodeForward* forward;
	gpointer _async_data_;
};

struct _ContactsContactGeocodeAddressData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksPostalAddress* addr;
	GeocodePlace* result;
	Block13Data* _data13_;
	GHashTable* params;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	FolksPostalAddress* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gboolean _tmp6_;
	GHashTable* _tmp7_;
	gchar* _tmp8_;
	FolksPostalAddress* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	GValue* _tmp12_;
	FolksPostalAddress* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gboolean _tmp16_;
	GHashTable* _tmp17_;
	gchar* _tmp18_;
	FolksPostalAddress* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	GValue* _tmp22_;
	FolksPostalAddress* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	gboolean _tmp26_;
	GHashTable* _tmp27_;
	gchar* _tmp28_;
	FolksPostalAddress* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	GValue* _tmp32_;
	FolksPostalAddress* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	gboolean _tmp36_;
	GHashTable* _tmp37_;
	gchar* _tmp38_;
	FolksPostalAddress* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	GValue* _tmp42_;
	GHashTable* _tmp43_;
	GeocodeForward* _tmp44_;
	GeocodePlace* _tmp45_;
};

struct _ContactsContactImData {
	const gchar* service;
	const gchar* display_name;
	ContactsContactImDisplay display;
};

struct _Block14Data {
	int _ref_count_;
	ContactsContact* self;
	TpfPersona* tp;
	GtkImage* i;
	gchar* last_class;
	gulong id1;
	gulong id2;
};

struct _ContactsContactRemovePersonasData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsContact* self;
	GeeHashSet* personas;
	GeeHashSet* _tmp0_;
	GeeIterator* _p_it;
	FolksIndividual* _tmp1_;
	GeeSet* _tmp2_;
	GeeSet* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _tmp5_;
	gboolean _tmp6_;
	FolksPersona* p;
	GeeIterator* _tmp7_;
	gpointer _tmp8_;
	gboolean _tmp9_;
	FolksPersona* _tmp10_;
	FolksPersonaStore* _tmp11_;
	FolksPersonaStore* _tmp12_;
	FolksMaybeBool _tmp13_;
	FolksMaybeBool _tmp14_;
	FolksPersona* _tmp15_;
	GeeHashSet* _tmp16_;
	FolksPersona* _tmp17_;
	GeeIterator* _persona_it;
	GeeHashSet* _tmp18_;
	GeeIterator* _tmp19_;
	GeeIterator* _tmp20_;
	gboolean _tmp21_;
	FolksPersona* persona;
	GeeIterator* _tmp22_;
	gpointer _tmp23_;
	FolksPersona* _tmp24_;
	FolksPersonaStore* _tmp25_;
	FolksPersonaStore* _tmp26_;
	FolksPersona* _tmp27_;
	GError * _inner_error_;
};

struct _ContactsContactEnsurePrimaryPersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsContact* self;
	FolksPersona* result;
	FolksPersona* p;
	FolksPersona* _tmp0_;
	FolksPersona* _tmp1_;
	GeeHashSet* persona_set;
	GeeHashSet* _tmp2_;
	GeeHashSet* _tmp3_;
	FolksIndividual* _tmp4_;
	GeeSet* _tmp5_;
	GeeSet* _tmp6_;
	GeeHashSet* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	GeeHashSet* _tmp10_;
	ContactsFakePersona* _tmp11_;
	ContactsFakePersona* _tmp12_;
	ContactsStore* _tmp13_;
	FolksIndividualAggregator* _tmp14_;
	FolksIndividualAggregator* _tmp15_;
	GeeHashSet* _tmp16_;
	FolksPersona* _tmp17_;
	FolksPersona* _tmp18_;
	const gchar* _tmp19_;
	GError* _tmp20_;
	GError * _inner_error_;
};

struct _ContactsContactSetIndividualPropertyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsContact* contact;
	gchar* property_name;
	GValue value;
	FolksPersona* result;
	gboolean did_set;
	FolksPersona** personas_copy;
	ContactsContact* _tmp0_;
	FolksIndividual* _tmp1_;
	GeeSet* _tmp2_;
	GeeSet* _tmp3_;
	gint _tmp4_;
	gpointer* _tmp5_;
	gint personas_copy_length1;
	gint _personas_copy_size_;
	FolksPersona** _tmp6_;
	gint _tmp6__length1;
	FolksPersona** p_collection;
	gint p_collection_length1;
	gint _p_collection_size_;
	gint p_it;
	FolksPersona* _tmp7_;
	FolksPersona* p;
	const gchar* _tmp8_;
	FolksPersona* _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	gchar** _tmp11_;
	gint _tmp11__length1;
	FolksPersona* _tmp12_;
	const gchar* _tmp13_;
	GValue _tmp14_;
	gboolean _tmp15_;
	ContactsFakePersona* fake;
	ContactsContact* _tmp16_;
	ContactsFakePersona* _tmp17_;
	FolksPersona* _tmp18_;
	ContactsFakePersona* _tmp19_;
	const gchar* _tmp20_;
	GValue _tmp21_;
	FolksPersona* _tmp22_;
	FolksPersona* _tmp23_;
	GError * _inner_error_;
};

struct _ContactsContactCreatePrimaryPersonaForDetailsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksPersonaStore* store;
	GHashTable* details;
	FolksPersona* result;
	FolksPersona* p;
	FolksPersonaStore* _tmp0_;
	GHashTable* _tmp1_;
	FolksPersona* _tmp2_;
	GError * _inner_error_;
};

struct _ContactsContactSetPersonaPropertyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FolksPersona* persona;
	gchar* property_name;
	GValue new_value;
	FolksPersona* _tmp0_;
	ContactsFakePersona* fake;
	FolksPersona* _tmp1_;
	ContactsFakePersona* _tmp2_;
	ContactsFakePersona* _tmp3_;
	const gchar* _tmp4_;
	GValue _tmp5_;
	FolksPersona* _tmp6_;
	FolksPersona* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	GQuark _tmp11_;
	FolksPersona* _tmp12_;
	GValue _tmp13_;
	FolksPersona* _tmp14_;
	GValue _tmp15_;
	FolksPersona* _tmp16_;
	GValue _tmp17_;
	FolksPersona* _tmp18_;
	GValue _tmp19_;
	FolksPersona* _tmp20_;
	GValue _tmp21_;
	FolksPersona* _tmp22_;
	GValue _tmp23_;
	FolksPersona* _tmp24_;
	GValue _tmp25_;
	FolksPersona* _tmp26_;
	GValue _tmp27_;
	FolksPersona* _tmp28_;
	GValue _tmp29_;
	FolksPersona* _tmp30_;
	GValue _tmp31_;
	FolksPersona* _tmp32_;
	GValue _tmp33_;
	FolksPersona* _tmp34_;
	GValue _tmp35_;
	FolksPersona* _tmp36_;
	GValue _tmp37_;
	FolksPersona* _tmp38_;
	GValue _tmp39_;
	FolksPersona* _tmp40_;
	GValue _tmp41_;
	FolksPersona* _tmp42_;
	GValue _tmp43_;
	FolksPersona* _tmp44_;
	GValue _tmp45_;
	FolksPersona* _tmp46_;
	GValue _tmp47_;
	FolksPersona* _tmp48_;
	GValue _tmp49_;
	const gchar* _tmp50_;
	GError * _inner_error_;
};

struct _Block15Data {
	int _ref_count_;
	ContactsContact* self;
	gulong id;
	GtkWidget* w;
	GtkCallback callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
};

struct _ContactsFakePersonaStore {
	FolksPersonaStore parent_instance;
	ContactsFakePersonaStorePrivate * priv;
};

struct _ContactsFakePersonaStoreClass {
	FolksPersonaStoreClass parent_class;
};

struct _ContactsFakePersonaStorePrivate {
	GeeHashMap* _personas;
	GeeMap* _personas_ro;
	gchar** _always_writeable_properties;
	gint _always_writeable_properties_length1;
	gint __always_writeable_properties_size_;
};

struct _ContactsFakePersonaStorePrepareData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsFakePersonaStore* self;
};

struct _ContactsFakePersonaStoreAddPersonaFromDetailsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsFakePersonaStore* self;
	GHashTable* details;
	FolksPersona* result;
};

struct _ContactsFakePersonaStoreRemovePersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsFakePersonaStore* self;
	FolksPersona* persona;
};

struct _ContactsFakePersona {
	FolksPersona parent_instance;
	ContactsFakePersonaPrivate * priv;
	ContactsContact* contact;
};

struct _ContactsFakePersonaClass {
	FolksPersonaClass parent_class;
};

struct _ContactsFakePersonaPrivate {
	GeeArrayList* prop_vals;
	gboolean now_real;
	gboolean has_full_name;
};

struct _ContactsFakePersonaPropVal {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ContactsFakePersonaPropValPrivate * priv;
	gchar* property;
	GValue value;
};

struct _ContactsFakePersonaPropValClass {
	GTypeClass parent_class;
	void (*finalize) (ContactsFakePersonaPropVal *self);
};

struct _ContactsFakePersonaMakeRealAndSetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	ContactsFakePersona* self;
	gchar* property;
	GValue value;
	FolksPersona* result;
	ContactsFakePersonaPropVal* v;
	ContactsFakePersonaPropVal* _tmp0_;
	ContactsFakePersonaPropVal* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	ContactsFakePersonaPropVal* _tmp4_;
	GValue _tmp5_;
	GValue _tmp6_;
	const gchar* _tmp7_;
	GeeArrayList* _tmp8_;
	GeeArrayList* _tmp9_;
	GeeArrayList* _tmp10_;
	ContactsFakePersonaPropVal* _tmp11_;
	FolksPersona* p;
	ContactsContact* _tmp12_;
	FolksPersona* _tmp13_;
	gboolean _tmp14_;
	FolksPersona* _tmp15_;
	ContactsContact* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	GeeArrayList* _pv_list;
	GeeArrayList* _tmp19_;
	GeeArrayList* _tmp20_;
	gint _pv_size;
	GeeArrayList* _tmp21_;
	gint _tmp22_;
	gint _tmp23_;
	gint _pv_index;
	gint _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	ContactsFakePersonaPropVal* pv;
	GeeArrayList* _tmp27_;
	gint _tmp28_;
	gpointer _tmp29_;
	FolksPersona* _tmp30_;
	ContactsFakePersonaPropVal* _tmp31_;
	const gchar* _tmp32_;
	ContactsFakePersonaPropVal* _tmp33_;
	GValue _tmp34_;
	gboolean _tmp35_;
	GeeArrayList* _tmp36_;
	ContactsFakePersonaPropVal* _tmp37_;
	GError * _inner_error_;
};

struct _ContactsFakePersonaParamSpecPropVal {
	GParamSpec parent_instance;
};


static gpointer contacts_contact_presence_parent_class = NULL;
static gpointer contacts_contact_parent_class = NULL;
static GdkPixbuf* contacts_contact_fallback_pixbuf_default;
static GdkPixbuf* contacts_contact_fallback_pixbuf_default = NULL;
extern gchar** contacts_contact_sorted_properties;
extern gint contacts_contact_sorted_properties_length1;
gchar** contacts_contact_sorted_properties = NULL;
gint contacts_contact_sorted_properties_length1 = 0;
static gpointer contacts_fake_persona_store_parent_class = NULL;
extern ContactsFakePersonaStore* contacts_fake_persona_store__the_store;
ContactsFakePersonaStore* contacts_fake_persona_store__the_store = NULL;
static gpointer contacts_fake_persona_parent_class = NULL;
static gpointer contacts_fake_persona_prop_val_parent_class = NULL;

GQuark contact_error_quark (void);
GType contacts_contact_presence_get_type (void) G_GNUC_CONST;
GType contacts_contact_get_type (void) G_GNUC_CONST;
#define CONTACTS_CONTACT_PRESENCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_CONTACT_PRESENCE, ContactsContactPresencePrivate))
enum  {
	CONTACTS_CONTACT_PRESENCE_DUMMY_PROPERTY
};
static void contacts_contact_presence_update_presence_widgets (ContactsContactPresence* self);
GType contacts_store_get_type (void) G_GNUC_CONST;
gchar* contacts_contact_presence_to_icon_full (FolksPresenceType presence);
gchar* contacts_contact_presence_to_class (FolksPresenceType presence);
ContactsContactPresence* contacts_contact_presence_new (ContactsContact* contact);
ContactsContactPresence* contacts_contact_presence_construct (GType object_type, ContactsContact* contact);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static void __lambda8_ (ContactsContactPresence* self);
static void ___lambda8__contacts_contact_presence_changed (ContactsContact* _sender, gpointer self);
static void __lambda9_ (ContactsContactPresence* self);
static void ___lambda9__contacts_contact_personas_changed (ContactsContact* _sender, gpointer self);
static void __lambda10_ (Block12Data* _data12_);
static void ___lambda10__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void contacts_contact_presence_finalize (GObject* obj);
static GType contacts_contact_contact_data_ref_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static ContactsContactContactDataRef* contacts_contact_contact_data_ref_dup (const ContactsContactContactDataRef* self);
static void contacts_contact_contact_data_ref_free (ContactsContactContactDataRef* self);
#define CONTACTS_CONTACT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_CONTACT, ContactsContactPrivate))
enum  {
	CONTACTS_CONTACT_DUMMY_PROPERTY,
	CONTACTS_CONTACT_SMALL_AVATAR,
	CONTACTS_CONTACT_AVATAR_ICON_DATA,
	CONTACTS_CONTACT_DISPLAY_NAME,
	CONTACTS_CONTACT_INITIAL_LETTER,
	CONTACTS_CONTACT_IS_HIDDEN
};
GType contacts_contact_im_display_get_type (void) G_GNUC_CONST;
#define CONTACTS_CONTACT_LIST_AVATAR_SIZE 48
#define CONTACTS_CONTACT_SMALL_AVATAR_SIZE 54
gchar* contacts_contact_get_secondary_string (ContactsContact* self, gchar*** sources, int* sources_length1);
gboolean contacts_is_set (const gchar* str);
gboolean contacts_contact_persona_has_writable_property (FolksPersona* persona, const gchar* property);
GType contacts_fake_persona_get_type (void) G_GNUC_CONST;
gchar* contacts_contact_get_display_name_for_persona (FolksPersona* persona);
static gboolean _contacts_contact_get_is_hidden (ContactsContact* self);
void contacts_contact_hide (ContactsContact* self);
void contacts_contact_queue_changed (ContactsContact* self, gboolean is_persona_change);
void contacts_contact_show (ContactsContact* self);
ContactsContact* contacts_contact_from_individual (FolksIndividual* i);
static void contacts_contact_persona_notify_cb (ContactsContact* self, GParamSpec* pspec);
static void contacts_contact_connect_persona (ContactsContact* self, FolksPersona* p);
static void _contacts_contact_persona_notify_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void contacts_contact_disconnect_persona (ContactsContact* self, FolksPersona* p);
gconstpointer contacts_contact_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key);
void contacts_contact_set_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key, gpointer data);
void contacts_contact_remove_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key);
gboolean contacts_contact_persona_is_main (FolksPersona* persona);
gboolean contacts_contact_persona_is_google_other (FolksPersona* persona);
static gboolean contacts_contact_calc_is_main (ContactsContact* self);
ContactsContact* contacts_contact_new (ContactsStore* store, FolksIndividual* i);
ContactsContact* contacts_contact_construct (GType object_type, ContactsStore* store, FolksIndividual* i);
static void __lambda4_ (ContactsContact* self, GeeSet* added, GeeSet* removed);
static void ___lambda4__folks_individual_personas_changed (FolksIndividual* _sender, GeeSet* added, GeeSet* removed, gpointer self);
static void contacts_contact_update (ContactsContact* self);
static void contacts_contact_notify_cb (ContactsContact* self, GParamSpec* pspec);
static void _contacts_contact_notify_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
void contacts_contact_replace_individual (ContactsContact* self, FolksIndividual* new_individual);
void contacts_contact_remove (ContactsContact* self);
static void contacts_contact_unqueue_changed (ContactsContact* self);
gboolean contacts_contact_has_email (ContactsContact* self, const gchar* email_address);
gboolean contacts_contact_has_birthday (ContactsContact* self);
gboolean contacts_contact_has_nickname (ContactsContact* self);
gboolean contacts_contact_has_notes (ContactsContact* self);
GeeList* contacts_contact_get_personas_for_display (ContactsContact* self);
gboolean contacts_contact_contains_strings (ContactsContact* self, gchar** strings, int strings_length1);
gchar* contacts_contact_presence_to_icon_symbolic (FolksPresenceType presence);
gchar* contacts_contact_presence_to_icon_symbolic_full (FolksPresenceType presence);
gchar* contacts_contact_presence_to_icon (FolksPresenceType presence);
static gchar* contacts_contact_get_first_string (GeeCollection* collection);
static gboolean contacts_contact_has_pref (FolksAbstractFieldDetails* details);
gint contacts_contact_compare_fields (void* _a, void* _b);
GeeArrayList* contacts_contact_sort_fields (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GeeCollection* fields);
static gint _contacts_contact_compare_fields_gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
static void contacts_contact_geocode_address_data_free (gpointer _data);
void contacts_contact_geocode_address (FolksPostalAddress* addr, GAsyncReadyCallback _callback_, gpointer _user_data_);
GeocodePlace* contacts_contact_geocode_address_finish (GAsyncResult* _res_);
static gboolean contacts_contact_geocode_address_co (ContactsContactGeocodeAddressData* _data_);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static gboolean _contacts_contact_geocode_address_co_gsource_func (gpointer self);
static void _g_free0_ (gpointer var);
static void _vala_GValue_free (GValue* self);
static void __vala_GValue_free0_ (gpointer var);
static void __lambda7_ (Block13Data* _data13_, GObject* object, GAsyncResult* res);
static void ___lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
gchar** contacts_contact_format_address (FolksPostalAddress* addr, int* result_length1);
static void _vala_array_add2 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add3 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add4 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add5 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add9 (gchar*** array, int* length, int* size, gchar* value);
TpfPersona* contacts_contact_find_im_persona (ContactsContact* self, const gchar* protocol, const gchar* im_address);
gchar* contacts_contact_format_im_service (const gchar* service, ContactsContactImDisplay* display);
static GType contacts_contact_im_data_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static ContactsContactImData* contacts_contact_im_data_dup (const ContactsContactImData* self);
static void contacts_contact_im_data_free (ContactsContactImData* self);
gchar* contacts_contact_format_im_name (TpfPersona* persona, const gchar* protocol, const gchar* id);
GtkWidget* contacts_contact_create_merged_presence_widget (ContactsContact* self);
GtkWidget* contacts_contact_create_presence_widget (ContactsContact* self, const gchar* protocol, const gchar* im_address);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static void __lambda11_ (Block14Data* _data14_, GParamSpec* pspec);
static void ___lambda11__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda12_ (Block14Data* _data14_, GParamSpec* pspec);
static void ___lambda12__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda13_ (Block14Data* _data14_);
static void ___lambda13__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static gboolean contacts_contact_changed_cb (ContactsContact* self);
static gboolean _contacts_contact_changed_cb_gsource_func (gpointer self);
static gboolean contacts_contact_get_is_phone (FolksPersona* persona);
static void contacts_contact_update_presence (ContactsContact* self);
static void contacts_contact_update_filter_data (ContactsContact* self);
gchar* contacts_utils_canonicalize_for_search (const gchar* str);
GType contacts_typeset_get_type (void) G_GNUC_CONST;
ContactsTypeSet* contacts_typeset_get_general (void);
void contacts_typeset_type_seen (ContactsTypeSet* self, FolksAbstractFieldDetails* detail);
ContactsTypeSet* contacts_typeset_get_phone (void);
static GdkPixbuf* contacts_contact_load_icon (ContactsContact* self, GLoadableIcon* file, gint size);
GdkPixbuf* contacts_contact_frame_icon (GdkPixbuf* icon);
void contacts_utils_cairo_rounded_box (cairo_t* cr, gint x, gint y, gint width, gint height, gint radius);
GdkPixbuf* contacts_contact_draw_fallback_avatar (gint size, ContactsContact* contact);
gboolean contacts_contact_can_remove_personas (ContactsContact* self);
static void contacts_contact_remove_personas_data_free (gpointer _data);
void contacts_contact_remove_personas (ContactsContact* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void contacts_contact_remove_personas_finish (ContactsContact* self, GAsyncResult* _res_, GError** error);
static gboolean contacts_contact_remove_personas_co (ContactsContactRemovePersonasData* _data_);
static void contacts_contact_remove_personas_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void contacts_contact_ensure_primary_persona_data_free (gpointer _data);
void contacts_contact_ensure_primary_persona (ContactsContact* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
FolksPersona* contacts_contact_ensure_primary_persona_finish (ContactsContact* self, GAsyncResult* _res_, GError** error);
static gboolean contacts_contact_ensure_primary_persona_co (ContactsContactEnsurePrimaryPersonaData* _data_);
FolksPersona* contacts_contact_find_primary_persona (ContactsContact* self);
ContactsFakePersona* contacts_fake_persona_new (ContactsContact* contact);
ContactsFakePersona* contacts_fake_persona_construct (GType object_type, ContactsContact* contact);
FolksIndividualAggregator* contacts_store_get_aggregator (ContactsStore* self);
static void contacts_contact_ensure_primary_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
FolksPersona* contacts_contact_find_persona_from_store (ContactsContact* self, FolksPersonaStore* store);
static gint __lambda6_ (ContactsContact* self, FolksPersona* a, FolksPersona* b);
static gboolean contacts_contact_persona_is_google (FolksPersona* persona);
static gint ___lambda6__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
FolksPersona* contacts_contact_find_persona_from_uid (ContactsContact* self, const gchar* uid);
gchar* contacts_contact_format_persona_stores (ContactsContact* self);
gchar* contacts_contact_format_persona_store_name_for_contact (FolksPersona* persona);
gchar* contacts_contact_format_persona_store_name (FolksPersonaStore* store);
gboolean contacts_contact_has_mainable_persona (ContactsContact* self);
static gboolean contacts_contact_non_linkable (ContactsContact* self);
gboolean contacts_contact_persona_is_google_profile (FolksPersona* persona);
gboolean contacts_contact_suggest_link_to (ContactsContact* self, ContactsContact* other);
gboolean contacts_store_may_suggest_link (ContactsStore* self, ContactsContact* a, ContactsContact* b);
gchar** contacts_contact_sort_persona_properties (gchar** props, int props_length1, int* result_length1);
static gint __lambda14_ (const gchar* a, const gchar* b);
static gint ___lambda14__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
static void contacts_contact_set_individual_property_data_free (gpointer _data);
void contacts_contact_set_individual_property (ContactsContact* contact, const gchar* property_name, GValue* value, GAsyncReadyCallback _callback_, gpointer _user_data_);
FolksPersona* contacts_contact_set_individual_property_finish (GAsyncResult* _res_, GError** error);
static gboolean contacts_contact_set_individual_property_co (ContactsContactSetIndividualPropertyData* _data_);
static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
void contacts_contact_set_persona_property (FolksPersona* persona, const gchar* property_name, GValue* new_value, GAsyncReadyCallback _callback_, gpointer _user_data_);
void contacts_contact_set_persona_property_finish (GAsyncResult* _res_, GError** error);
static void contacts_contact_set_individual_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void contacts_fake_persona_make_real_and_set (ContactsFakePersona* self, const gchar* property, GValue* value, GAsyncReadyCallback _callback_, gpointer _user_data_);
FolksPersona* contacts_fake_persona_make_real_and_set_finish (ContactsFakePersona* self, GAsyncResult* _res_, GError** error);
TpAccount* contacts_contact_is_callable (ContactsContact* self, const gchar* proto, const gchar* id);
static void contacts_contact_create_primary_persona_for_details_data_free (gpointer _data);
void contacts_contact_create_primary_persona_for_details (FolksPersonaStore* store, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_);
FolksPersona* contacts_contact_create_primary_persona_for_details_finish (GAsyncResult* _res_, GError** error);
static gboolean contacts_contact_create_primary_persona_for_details_co (ContactsContactCreatePrimaryPersonaForDetailsData* _data_);
static void contacts_contact_create_primary_persona_for_details_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void contacts_contact_set_persona_property_data_free (gpointer _data);
static gboolean contacts_contact_set_persona_property_co (ContactsContactSetPersonaPropertyData* _data_);
static void contacts_contact_set_persona_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static void __lambda15_ (Block15Data* _data15_);
static void ___lambda15__contacts_contact_changed (ContactsContact* _sender, gpointer self);
static void __lambda16_ (Block15Data* _data15_);
static void ___lambda16__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
void contacts_contact_fetch_contact_info (ContactsContact* self);
GdkPixbuf* contacts_contact_get_small_avatar (ContactsContact* self);
GVariant* contacts_contact_get_avatar_icon_data (ContactsContact* self);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
gunichar contacts_contact_get_initial_letter (ContactsContact* self);
gboolean contacts_contact_get_is_hidden (ContactsContact* self);
static void contacts_contact_finalize (GObject* obj);
static void _vala_contacts_contact_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
GType contacts_fake_persona_store_get_type (void) G_GNUC_CONST;
#define CONTACTS_FAKE_PERSONA_STORE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_FAKE_PERSONA_STORE, ContactsFakePersonaStorePrivate))
enum  {
	CONTACTS_FAKE_PERSONA_STORE_DUMMY_PROPERTY,
	CONTACTS_FAKE_PERSONA_STORE_TYPE_ID,
	CONTACTS_FAKE_PERSONA_STORE_PERSONAS,
	CONTACTS_FAKE_PERSONA_STORE_CAN_ADD_PERSONAS,
	CONTACTS_FAKE_PERSONA_STORE_CAN_ALIAS_PERSONAS,
	CONTACTS_FAKE_PERSONA_STORE_CAN_GROUP_PERSONAS,
	CONTACTS_FAKE_PERSONA_STORE_CAN_REMOVE_PERSONAS,
	CONTACTS_FAKE_PERSONA_STORE_IS_PREPARED,
	CONTACTS_FAKE_PERSONA_STORE_IS_QUIESCENT,
	CONTACTS_FAKE_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES
};
ContactsFakePersonaStore* contacts_fake_persona_store_the_store (void);
ContactsFakePersonaStore* contacts_fake_persona_store_new (void);
ContactsFakePersonaStore* contacts_fake_persona_store_construct (GType object_type);
static void contacts_fake_persona_store_real_prepare_data_free (gpointer _data);
static void contacts_fake_persona_store_real_prepare (FolksPersonaStore* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean contacts_fake_persona_store_real_prepare_co (ContactsFakePersonaStorePrepareData* _data_);
static void contacts_fake_persona_store_real_add_persona_from_details_data_free (gpointer _data);
static void contacts_fake_persona_store_real_add_persona_from_details (FolksPersonaStore* base, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean contacts_fake_persona_store_real_add_persona_from_details_co (ContactsFakePersonaStoreAddPersonaFromDetailsData* _data_);
static void contacts_fake_persona_store_real_remove_persona_data_free (gpointer _data);
static void contacts_fake_persona_store_real_remove_persona (FolksPersonaStore* base, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean contacts_fake_persona_store_real_remove_persona_co (ContactsFakePersonaStoreRemovePersonaData* _data_);
static void contacts_fake_persona_store_finalize (GObject* obj);
static void _vala_contacts_fake_persona_store_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static gpointer contacts_fake_persona_prop_val_ref (gpointer instance);
static void contacts_fake_persona_prop_val_unref (gpointer instance);
static GParamSpec* contacts_fake_persona_param_spec_prop_val (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void contacts_fake_persona_value_set_prop_val (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void contacts_fake_persona_value_take_prop_val (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer contacts_fake_persona_value_get_prop_val (const GValue* value) G_GNUC_UNUSED;
static GType contacts_fake_persona_prop_val_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define CONTACTS_FAKE_PERSONA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersonaPrivate))
enum  {
	CONTACTS_FAKE_PERSONA_DUMMY_PROPERTY,
	CONTACTS_FAKE_PERSONA_LINKABLE_PROPERTIES,
	CONTACTS_FAKE_PERSONA_WRITEABLE_PROPERTIES
};
ContactsFakePersona* contacts_fake_persona_maybe_create_for (ContactsContact* contact);
static void contacts_fake_persona_make_real_and_set_data_free (gpointer _data);
static gboolean contacts_fake_persona_make_real_and_set_co (ContactsFakePersonaMakeRealAndSetData* _data_);
static ContactsFakePersonaPropVal* contacts_fake_persona_prop_val_new (void);
static ContactsFakePersonaPropVal* contacts_fake_persona_prop_val_construct (GType object_type);
static void contacts_fake_persona_make_real_and_set_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
enum  {
	CONTACTS_FAKE_PERSONA_PROP_VAL_DUMMY_PROPERTY
};
static void contacts_fake_persona_prop_val_finalize (ContactsFakePersonaPropVal* obj);
static void contacts_fake_persona_finalize (GObject* obj);
static void _vala_contacts_fake_persona_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

static GRegex* _tmp_regex_0 = NULL;
static const gchar* CONTACTS_FAKE_PERSONA__linkable_properties[0] = {};
static const gchar* CONTACTS_FAKE_PERSONA__writeable_properties[0] = {};

GQuark contact_error_quark (void) {
	return g_quark_from_static_string ("contact_error-quark");
}


static void contacts_contact_presence_update_presence_widgets (ContactsContactPresence* self) {
	FolksPresenceType type = 0;
	gchar* message = NULL;
	gboolean is_phone = FALSE;
	ContactsContact* _tmp0_ = NULL;
	FolksPresenceType _tmp1_ = 0;
	ContactsContact* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	ContactsContact* _tmp5_ = NULL;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	FolksPresenceType _tmp10_ = 0;
	GtkImage* _tmp19_ = NULL;
	FolksPresenceType _tmp20_ = 0;
	gchar* _tmp21_ = NULL;
	gchar* _tmp22_ = NULL;
	const gchar* _tmp23_ = NULL;
	FolksPresenceType _tmp27_ = 0;
	gchar* _tmp28_ = NULL;
	GtkImage* _tmp29_ = NULL;
	GtkStyleContext* _tmp30_ = NULL;
	const gchar* _tmp31_ = NULL;
	GtkImage* _tmp32_ = NULL;
	GtkLabel* _tmp33_ = NULL;
	GtkImage* _tmp34_ = NULL;
	const gchar* _tmp35_ = NULL;
	gint _tmp36_ = 0;
	gint _tmp37_ = 0;
	GtkLabel* _tmp41_ = NULL;
	const gchar* _tmp42_ = NULL;
	gchar* _tmp43_ = NULL;
	gchar* _tmp44_ = NULL;
	GtkLabel* _tmp45_ = NULL;
	gboolean _tmp46_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->contact;
	_tmp1_ = _tmp0_->presence_type;
	type = _tmp1_;
	_tmp2_ = self->priv->contact;
	_tmp3_ = _tmp2_->presence_message;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (message);
	message = _tmp4_;
	_tmp5_ = self->priv->contact;
	_tmp6_ = _tmp5_->is_phone;
	is_phone = _tmp6_;
	_tmp10_ = type;
	if (_tmp10_ == FOLKS_PRESENCE_TYPE_UNSET) {
		_tmp9_ = TRUE;
	} else {
		FolksPresenceType _tmp11_ = 0;
		_tmp11_ = type;
		_tmp9_ = _tmp11_ == FOLKS_PRESENCE_TYPE_ERROR;
	}
	if (_tmp9_) {
		_tmp8_ = TRUE;
	} else {
		FolksPresenceType _tmp12_ = 0;
		_tmp12_ = type;
		_tmp8_ = _tmp12_ == FOLKS_PRESENCE_TYPE_OFFLINE;
	}
	if (_tmp8_) {
		_tmp7_ = TRUE;
	} else {
		FolksPresenceType _tmp13_ = 0;
		_tmp13_ = type;
		_tmp7_ = _tmp13_ == FOLKS_PRESENCE_TYPE_UNKNOWN;
	}
	if (_tmp7_) {
		GtkImage* _tmp14_ = NULL;
		GtkImage* _tmp15_ = NULL;
		GtkLabel* _tmp16_ = NULL;
		GtkLabel* _tmp17_ = NULL;
		GtkImage* _tmp18_ = NULL;
		_tmp14_ = self->priv->image;
		gtk_image_clear (_tmp14_);
		_tmp15_ = self->priv->image;
		gtk_widget_hide ((GtkWidget*) _tmp15_);
		_tmp16_ = self->priv->label;
		gtk_widget_hide ((GtkWidget*) _tmp16_);
		_tmp17_ = self->priv->label;
		gtk_label_set_text (_tmp17_, "");
		_tmp18_ = self->priv->phone_image;
		gtk_widget_hide ((GtkWidget*) _tmp18_);
		_g_free0 (message);
		return;
	}
	_tmp19_ = self->priv->image;
	_tmp20_ = type;
	_tmp21_ = contacts_contact_presence_to_icon_full (_tmp20_);
	_tmp22_ = _tmp21_;
	gtk_image_set_from_icon_name (_tmp19_, _tmp22_, GTK_ICON_SIZE_MENU);
	_g_free0 (_tmp22_);
	_tmp23_ = self->priv->last_class;
	if (_tmp23_ != NULL) {
		GtkImage* _tmp24_ = NULL;
		GtkStyleContext* _tmp25_ = NULL;
		const gchar* _tmp26_ = NULL;
		_tmp24_ = self->priv->image;
		_tmp25_ = gtk_widget_get_style_context ((GtkWidget*) _tmp24_);
		_tmp26_ = self->priv->last_class;
		gtk_style_context_remove_class (_tmp25_, _tmp26_);
	}
	_tmp27_ = type;
	_tmp28_ = contacts_contact_presence_to_class (_tmp27_);
	_g_free0 (self->priv->last_class);
	self->priv->last_class = _tmp28_;
	_tmp29_ = self->priv->image;
	_tmp30_ = gtk_widget_get_style_context ((GtkWidget*) _tmp29_);
	_tmp31_ = self->priv->last_class;
	gtk_style_context_add_class (_tmp30_, _tmp31_);
	_tmp32_ = self->priv->image;
	gtk_widget_show ((GtkWidget*) _tmp32_);
	_tmp33_ = self->priv->label;
	gtk_widget_show ((GtkWidget*) _tmp33_);
	_tmp34_ = self->priv->phone_image;
	gtk_widget_show ((GtkWidget*) _tmp34_);
	_tmp35_ = message;
	_tmp36_ = strlen (_tmp35_);
	_tmp37_ = _tmp36_;
	if (_tmp37_ == 0) {
		FolksPresenceType _tmp38_ = 0;
		const gchar* _tmp39_ = NULL;
		gchar* _tmp40_ = NULL;
		_tmp38_ = type;
		_tmp39_ = folks_presence_details_get_default_message_from_type (_tmp38_);
		_tmp40_ = g_strdup (_tmp39_);
		_g_free0 (message);
		message = _tmp40_;
	}
	_tmp41_ = self->priv->label;
	_tmp42_ = message;
	_tmp43_ = g_markup_printf_escaped ("<span font='11px'>%s</span>", _tmp42_);
	_tmp44_ = _tmp43_;
	gtk_label_set_markup (_tmp41_, _tmp44_);
	_g_free0 (_tmp44_);
	_tmp45_ = self->priv->label;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp45_, 3);
	_tmp46_ = is_phone;
	if (_tmp46_) {
		GtkImage* _tmp47_ = NULL;
		_tmp47_ = self->priv->phone_image;
		gtk_widget_show ((GtkWidget*) _tmp47_);
	} else {
		GtkImage* _tmp48_ = NULL;
		_tmp48_ = self->priv->phone_image;
		gtk_widget_hide ((GtkWidget*) _tmp48_);
	}
	_g_free0 (message);
}


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


static Block12Data* block12_data_ref (Block12Data* _data12_) {
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}


static void block12_data_unref (void * _userdata_) {
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		ContactsContactPresence* self;
		self = _data12_->self;
		_g_object_unref0 (_data12_->contact);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}


static void __lambda8_ (ContactsContactPresence* self) {
	contacts_contact_presence_update_presence_widgets (self);
}


static void ___lambda8__contacts_contact_presence_changed (ContactsContact* _sender, gpointer self) {
	__lambda8_ ((ContactsContactPresence*) self);
}


static void __lambda9_ (ContactsContactPresence* self) {
	contacts_contact_presence_update_presence_widgets (self);
}


static void ___lambda9__contacts_contact_personas_changed (ContactsContact* _sender, gpointer self) {
	__lambda9_ ((ContactsContactPresence*) self);
}


static void __lambda10_ (Block12Data* _data12_) {
	ContactsContactPresence* self;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	self = _data12_->self;
	_tmp0_ = _data12_->contact;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _data12_->id);
	_tmp1_ = _data12_->contact;
	g_signal_handler_disconnect ((GObject*) _tmp1_, _data12_->id2);
}


static void ___lambda10__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda10_ (self);
}


ContactsContactPresence* contacts_contact_presence_construct (GType object_type, ContactsContact* contact) {
	ContactsContactPresence * self = NULL;
	Block12Data* _data12_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContact* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	GtkImage* _tmp4_ = NULL;
	GtkImage* _tmp5_ = NULL;
	GtkImage* _tmp6_ = NULL;
	GtkLabel* _tmp7_ = NULL;
	GtkLabel* _tmp8_ = NULL;
	GtkLabel* _tmp9_ = NULL;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* _tmp11_ = NULL;
	GtkImage* _tmp12_ = NULL;
	GtkImage* _tmp13_ = NULL;
	GtkImage* _tmp14_ = NULL;
	GtkImage* _tmp15_ = NULL;
	ContactsContact* _tmp16_ = NULL;
	gulong _tmp17_ = 0UL;
	ContactsContact* _tmp18_ = NULL;
	gulong _tmp19_ = 0UL;
	g_return_val_if_fail (contact != NULL, NULL);
	_data12_ = g_slice_new0 (Block12Data);
	_data12_->_ref_count_ = 1;
	_tmp0_ = contact;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data12_->contact);
	_data12_->contact = _tmp1_;
	self = (ContactsContactPresence*) g_object_new (object_type, NULL);
	_data12_->self = g_object_ref (self);
	_tmp2_ = _data12_->contact;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->contact);
	self->priv->contact = _tmp3_;
	gtk_grid_set_column_spacing ((GtkGrid*) self, (guint) 4);
	_tmp4_ = (GtkImage*) gtk_image_new ();
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->image);
	self->priv->image = _tmp4_;
	_tmp5_ = self->priv->image;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp5_, TRUE);
	_tmp6_ = self->priv->image;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp6_);
	_tmp7_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->label);
	self->priv->label = _tmp7_;
	_tmp8_ = self->priv->label;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp8_, TRUE);
	_tmp9_ = self->priv->label;
	gtk_label_set_ellipsize (_tmp9_, PANGO_ELLIPSIZE_END);
	_tmp10_ = self->priv->label;
	gtk_label_set_xalign (_tmp10_, 0.0f);
	_tmp11_ = self->priv->label;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp11_);
	_tmp12_ = (GtkImage*) gtk_image_new ();
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->phone_image);
	self->priv->phone_image = _tmp12_;
	_tmp13_ = self->priv->phone_image;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp13_, TRUE);
	_tmp14_ = self->priv->phone_image;
	gtk_image_set_from_icon_name (_tmp14_, "phone-symbolic", GTK_ICON_SIZE_MENU);
	_tmp15_ = self->priv->phone_image;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp15_);
	contacts_contact_presence_update_presence_widgets (self);
	_tmp16_ = _data12_->contact;
	_tmp17_ = g_signal_connect_object (_tmp16_, "presence-changed", (GCallback) ___lambda8__contacts_contact_presence_changed, self, 0);
	_data12_->id = _tmp17_;
	_tmp18_ = _data12_->contact;
	_tmp19_ = g_signal_connect_object (_tmp18_, "personas-changed", (GCallback) ___lambda9__contacts_contact_personas_changed, self, 0);
	_data12_->id2 = _tmp19_;
	g_signal_connect_data ((GtkWidget*) self, "destroy", (GCallback) ___lambda10__gtk_widget_destroy, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
	block12_data_unref (_data12_);
	_data12_ = NULL;
	return self;
}


ContactsContactPresence* contacts_contact_presence_new (ContactsContact* contact) {
	return contacts_contact_presence_construct (CONTACTS_TYPE_CONTACT_PRESENCE, contact);
}


static void contacts_contact_presence_class_init (ContactsContactPresenceClass * klass) {
	contacts_contact_presence_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsContactPresencePrivate));
	G_OBJECT_CLASS (klass)->finalize = contacts_contact_presence_finalize;
}


static void contacts_contact_presence_instance_init (ContactsContactPresence * self) {
	self->priv = CONTACTS_CONTACT_PRESENCE_GET_PRIVATE (self);
}


static void contacts_contact_presence_finalize (GObject* obj) {
	ContactsContactPresence * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_CONTACT_PRESENCE, ContactsContactPresence);
	_g_object_unref0 (self->priv->contact);
	_g_object_unref0 (self->priv->image);
	_g_object_unref0 (self->priv->phone_image);
	_g_object_unref0 (self->priv->label);
	_g_free0 (self->priv->last_class);
	G_OBJECT_CLASS (contacts_contact_presence_parent_class)->finalize (obj);
}


GType contacts_contact_presence_get_type (void) {
	static volatile gsize contacts_contact_presence_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_presence_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsContactPresenceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_contact_presence_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsContactPresence), 0, (GInstanceInitFunc) contacts_contact_presence_instance_init, NULL };
		GType contacts_contact_presence_type_id;
		contacts_contact_presence_type_id = g_type_register_static (gtk_grid_get_type (), "ContactsContactPresence", &g_define_type_info, 0);
		g_once_init_leave (&contacts_contact_presence_type_id__volatile, contacts_contact_presence_type_id);
	}
	return contacts_contact_presence_type_id__volatile;
}


GType contacts_contact_im_display_get_type (void) {
	static volatile gsize contacts_contact_im_display_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_im_display_type_id__volatile)) {
		static const GEnumValue values[] = {{CONTACTS_CONTACT_IM_DISPLAY_DEFAULT, "CONTACTS_CONTACT_IM_DISPLAY_DEFAULT", "default"}, {CONTACTS_CONTACT_IM_DISPLAY_ALIAS_SERVICE, "CONTACTS_CONTACT_IM_DISPLAY_ALIAS_SERVICE", "alias-service"}, {0, NULL, NULL}};
		GType contacts_contact_im_display_type_id;
		contacts_contact_im_display_type_id = g_enum_register_static ("ContactsContactImDisplay", values);
		g_once_init_leave (&contacts_contact_im_display_type_id__volatile, contacts_contact_im_display_type_id);
	}
	return contacts_contact_im_display_type_id__volatile;
}


gchar* contacts_contact_get_secondary_string (ContactsContact* self, gchar*** sources, int* sources_length1) {
	gchar** _vala_sources = NULL;
	int _vala_sources_length1 = 0;
	gchar* result = NULL;
	gchar* nick = NULL;
	FolksIndividual* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->individual;
	_tmp1_ = folks_name_details_get_nickname ((FolksNameDetails*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	nick = _tmp3_;
	_tmp4_ = nick;
	_tmp5_ = contacts_is_set (_tmp4_);
	if (_tmp5_) {
		gchar** _tmp6_ = NULL;
		gchar** _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		gchar* _tmp11_ = NULL;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		_tmp6_ = g_new0 (gchar*, 1 + 1);
		_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
		_vala_sources = _tmp6_;
		_vala_sources_length1 = 1;
		_tmp7_ = _vala_sources;
		_tmp7__length1 = _vala_sources_length1;
		_tmp8_ = g_strdup ("nickname");
		_g_free0 (_tmp7_[0]);
		_tmp7_[0] = _tmp8_;
		_tmp9_ = _tmp7_[0];
		_tmp10_ = nick;
		_tmp11_ = g_strconcat ("\xE2\x80\x9C", _tmp10_, NULL);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_strconcat (_tmp12_, "\xE2\x80\x9D", NULL);
		_tmp14_ = _tmp13_;
		_g_free0 (_tmp12_);
		result = _tmp14_;
		_g_free0 (nick);
		if (sources) {
			*sources = _vala_sources;
		} else {
			_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
		}
		if (sources_length1) {
			*sources_length1 = _vala_sources_length1;
		}
		return result;
	}
	{
		GeeIterator* _role_detail_it = NULL;
		FolksIndividual* _tmp15_ = NULL;
		GeeSet* _tmp16_ = NULL;
		GeeSet* _tmp17_ = NULL;
		GeeIterator* _tmp18_ = NULL;
		_tmp15_ = self->individual;
		_tmp16_ = folks_role_details_get_roles ((FolksRoleDetails*) _tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = gee_iterable_iterator ((GeeIterable*) _tmp17_);
		_role_detail_it = _tmp18_;
		while (TRUE) {
			GeeIterator* _tmp19_ = NULL;
			gboolean _tmp20_ = FALSE;
			FolksRoleFieldDetails* role_detail = NULL;
			GeeIterator* _tmp21_ = NULL;
			gpointer _tmp22_ = NULL;
			FolksRole* role = NULL;
			FolksRoleFieldDetails* _tmp23_ = NULL;
			gconstpointer _tmp24_ = NULL;
			FolksRole* _tmp25_ = NULL;
			FolksRole* _tmp26_ = NULL;
			FolksRole* _tmp27_ = NULL;
			const gchar* _tmp28_ = NULL;
			const gchar* _tmp29_ = NULL;
			gboolean _tmp30_ = FALSE;
			_tmp19_ = _role_detail_it;
			_tmp20_ = gee_iterator_next (_tmp19_);
			if (!_tmp20_) {
				break;
			}
			_tmp21_ = _role_detail_it;
			_tmp22_ = gee_iterator_get (_tmp21_);
			role_detail = (FolksRoleFieldDetails*) _tmp22_;
			_tmp23_ = role_detail;
			_tmp24_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = _g_object_ref0 ((FolksRole*) _tmp25_);
			role = _tmp26_;
			_tmp27_ = role;
			_tmp28_ = folks_role_get_organisation_name (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp30_ = contacts_is_set (_tmp29_);
			if (_tmp30_) {
				FolksRole* _tmp31_ = NULL;
				const gchar* _tmp32_ = NULL;
				const gchar* _tmp33_ = NULL;
				gboolean _tmp34_ = FALSE;
				_tmp31_ = role;
				_tmp32_ = folks_role_get_title (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = contacts_is_set (_tmp33_);
				if (_tmp34_) {
					gchar** _tmp35_ = NULL;
					gchar** _tmp36_ = NULL;
					gint _tmp36__length1 = 0;
					gchar* _tmp37_ = NULL;
					gchar* _tmp38_ = NULL;
					gchar** _tmp39_ = NULL;
					gint _tmp39__length1 = 0;
					gchar* _tmp40_ = NULL;
					gchar* _tmp41_ = NULL;
					FolksRole* _tmp42_ = NULL;
					const gchar* _tmp43_ = NULL;
					const gchar* _tmp44_ = NULL;
					FolksRole* _tmp45_ = NULL;
					const gchar* _tmp46_ = NULL;
					const gchar* _tmp47_ = NULL;
					gchar* _tmp48_ = NULL;
					_tmp35_ = g_new0 (gchar*, 2 + 1);
					_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
					_vala_sources = _tmp35_;
					_vala_sources_length1 = 2;
					_tmp36_ = _vala_sources;
					_tmp36__length1 = _vala_sources_length1;
					_tmp37_ = g_strdup ("title");
					_g_free0 (_tmp36_[0]);
					_tmp36_[0] = _tmp37_;
					_tmp38_ = _tmp36_[0];
					_tmp39_ = _vala_sources;
					_tmp39__length1 = _vala_sources_length1;
					_tmp40_ = g_strdup ("organisation-name");
					_g_free0 (_tmp39_[1]);
					_tmp39_[1] = _tmp40_;
					_tmp41_ = _tmp39_[1];
					_tmp42_ = role;
					_tmp43_ = folks_role_get_title (_tmp42_);
					_tmp44_ = _tmp43_;
					_tmp45_ = role;
					_tmp46_ = folks_role_get_organisation_name (_tmp45_);
					_tmp47_ = _tmp46_;
					_tmp48_ = g_strdup_printf ("%s, %s", _tmp44_, _tmp47_);
					result = _tmp48_;
					_g_object_unref0 (role);
					_g_object_unref0 (role_detail);
					_g_object_unref0 (_role_detail_it);
					_g_free0 (nick);
					if (sources) {
						*sources = _vala_sources;
					} else {
						_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
					}
					if (sources_length1) {
						*sources_length1 = _vala_sources_length1;
					}
					return result;
				} else {
					FolksRole* _tmp49_ = NULL;
					const gchar* _tmp50_ = NULL;
					const gchar* _tmp51_ = NULL;
					gboolean _tmp52_ = FALSE;
					_tmp49_ = role;
					_tmp50_ = folks_role_get_role (_tmp49_);
					_tmp51_ = _tmp50_;
					_tmp52_ = contacts_is_set (_tmp51_);
					if (_tmp52_) {
						gchar** _tmp53_ = NULL;
						gchar** _tmp54_ = NULL;
						gint _tmp54__length1 = 0;
						gchar* _tmp55_ = NULL;
						gchar* _tmp56_ = NULL;
						gchar** _tmp57_ = NULL;
						gint _tmp57__length1 = 0;
						gchar* _tmp58_ = NULL;
						gchar* _tmp59_ = NULL;
						FolksRole* _tmp60_ = NULL;
						const gchar* _tmp61_ = NULL;
						const gchar* _tmp62_ = NULL;
						FolksRole* _tmp63_ = NULL;
						const gchar* _tmp64_ = NULL;
						const gchar* _tmp65_ = NULL;
						gchar* _tmp66_ = NULL;
						_tmp53_ = g_new0 (gchar*, 2 + 1);
						_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
						_vala_sources = _tmp53_;
						_vala_sources_length1 = 2;
						_tmp54_ = _vala_sources;
						_tmp54__length1 = _vala_sources_length1;
						_tmp55_ = g_strdup ("role");
						_g_free0 (_tmp54_[0]);
						_tmp54_[0] = _tmp55_;
						_tmp56_ = _tmp54_[0];
						_tmp57_ = _vala_sources;
						_tmp57__length1 = _vala_sources_length1;
						_tmp58_ = g_strdup ("organisation-name");
						_g_free0 (_tmp57_[1]);
						_tmp57_[1] = _tmp58_;
						_tmp59_ = _tmp57_[1];
						_tmp60_ = role;
						_tmp61_ = folks_role_get_role (_tmp60_);
						_tmp62_ = _tmp61_;
						_tmp63_ = role;
						_tmp64_ = folks_role_get_organisation_name (_tmp63_);
						_tmp65_ = _tmp64_;
						_tmp66_ = g_strdup_printf ("%s, %s", _tmp62_, _tmp65_);
						result = _tmp66_;
						_g_object_unref0 (role);
						_g_object_unref0 (role_detail);
						_g_object_unref0 (_role_detail_it);
						_g_free0 (nick);
						if (sources) {
							*sources = _vala_sources;
						} else {
							_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
						}
						if (sources_length1) {
							*sources_length1 = _vala_sources_length1;
						}
						return result;
					} else {
						gchar** _tmp67_ = NULL;
						gchar** _tmp68_ = NULL;
						gint _tmp68__length1 = 0;
						gchar* _tmp69_ = NULL;
						gchar* _tmp70_ = NULL;
						FolksRole* _tmp71_ = NULL;
						const gchar* _tmp72_ = NULL;
						const gchar* _tmp73_ = NULL;
						gchar* _tmp74_ = NULL;
						_tmp67_ = g_new0 (gchar*, 0 + 1);
						_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
						_vala_sources = _tmp67_;
						_vala_sources_length1 = 0;
						_tmp68_ = _vala_sources;
						_tmp68__length1 = _vala_sources_length1;
						_tmp69_ = g_strdup ("organisation-name");
						_g_free0 (_tmp68_[0]);
						_tmp68_[0] = _tmp69_;
						_tmp70_ = _tmp68_[0];
						_tmp71_ = role;
						_tmp72_ = folks_role_get_organisation_name (_tmp71_);
						_tmp73_ = _tmp72_;
						_tmp74_ = g_strdup (_tmp73_);
						result = _tmp74_;
						_g_object_unref0 (role);
						_g_object_unref0 (role_detail);
						_g_object_unref0 (_role_detail_it);
						_g_free0 (nick);
						if (sources) {
							*sources = _vala_sources;
						} else {
							_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
						}
						if (sources_length1) {
							*sources_length1 = _vala_sources_length1;
						}
						return result;
					}
				}
			} else {
				FolksRole* _tmp75_ = NULL;
				const gchar* _tmp76_ = NULL;
				const gchar* _tmp77_ = NULL;
				gboolean _tmp78_ = FALSE;
				_tmp75_ = role;
				_tmp76_ = folks_role_get_title (_tmp75_);
				_tmp77_ = _tmp76_;
				_tmp78_ = contacts_is_set (_tmp77_);
				if (_tmp78_) {
					gchar** _tmp79_ = NULL;
					gchar** _tmp80_ = NULL;
					gint _tmp80__length1 = 0;
					gchar* _tmp81_ = NULL;
					gchar* _tmp82_ = NULL;
					FolksRole* _tmp83_ = NULL;
					const gchar* _tmp84_ = NULL;
					const gchar* _tmp85_ = NULL;
					gchar* _tmp86_ = NULL;
					_tmp79_ = g_new0 (gchar*, 0 + 1);
					_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
					_vala_sources = _tmp79_;
					_vala_sources_length1 = 0;
					_tmp80_ = _vala_sources;
					_tmp80__length1 = _vala_sources_length1;
					_tmp81_ = g_strdup ("title");
					_g_free0 (_tmp80_[0]);
					_tmp80_[0] = _tmp81_;
					_tmp82_ = _tmp80_[0];
					_tmp83_ = role;
					_tmp84_ = folks_role_get_title (_tmp83_);
					_tmp85_ = _tmp84_;
					_tmp86_ = g_strdup (_tmp85_);
					result = _tmp86_;
					_g_object_unref0 (role);
					_g_object_unref0 (role_detail);
					_g_object_unref0 (_role_detail_it);
					_g_free0 (nick);
					if (sources) {
						*sources = _vala_sources;
					} else {
						_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
					}
					if (sources_length1) {
						*sources_length1 = _vala_sources_length1;
					}
					return result;
				} else {
					FolksRole* _tmp87_ = NULL;
					const gchar* _tmp88_ = NULL;
					const gchar* _tmp89_ = NULL;
					gboolean _tmp90_ = FALSE;
					_tmp87_ = role;
					_tmp88_ = folks_role_get_role (_tmp87_);
					_tmp89_ = _tmp88_;
					_tmp90_ = contacts_is_set (_tmp89_);
					if (_tmp90_) {
						gchar** _tmp91_ = NULL;
						gchar** _tmp92_ = NULL;
						gint _tmp92__length1 = 0;
						gchar* _tmp93_ = NULL;
						gchar* _tmp94_ = NULL;
						FolksRole* _tmp95_ = NULL;
						const gchar* _tmp96_ = NULL;
						const gchar* _tmp97_ = NULL;
						gchar* _tmp98_ = NULL;
						_tmp91_ = g_new0 (gchar*, 0 + 1);
						_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
						_vala_sources = _tmp91_;
						_vala_sources_length1 = 0;
						_tmp92_ = _vala_sources;
						_tmp92__length1 = _vala_sources_length1;
						_tmp93_ = g_strdup ("role");
						_g_free0 (_tmp92_[0]);
						_tmp92_[0] = _tmp93_;
						_tmp94_ = _tmp92_[0];
						_tmp95_ = role;
						_tmp96_ = folks_role_get_role (_tmp95_);
						_tmp97_ = _tmp96_;
						_tmp98_ = g_strdup (_tmp97_);
						result = _tmp98_;
						_g_object_unref0 (role);
						_g_object_unref0 (role_detail);
						_g_object_unref0 (_role_detail_it);
						_g_free0 (nick);
						if (sources) {
							*sources = _vala_sources;
						} else {
							_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
						}
						if (sources_length1) {
							*sources_length1 = _vala_sources_length1;
						}
						return result;
					}
				}
			}
			_g_object_unref0 (role);
			_g_object_unref0 (role_detail);
		}
		_g_object_unref0 (_role_detail_it);
	}
	_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
	_vala_sources = NULL;
	_vala_sources_length1 = 0;
	result = NULL;
	_g_free0 (nick);
	if (sources) {
		*sources = _vala_sources;
	} else {
		_vala_sources = (_vala_array_free (_vala_sources, _vala_sources_length1, (GDestroyNotify) g_free), NULL);
	}
	if (sources_length1) {
		*sources_length1 = _vala_sources_length1;
	}
	return result;
}


gboolean contacts_contact_persona_has_writable_property (FolksPersona* persona, const gchar* property) {
	gboolean result = FALSE;
	FolksPersona* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	g_return_val_if_fail (persona != NULL, FALSE);
	g_return_val_if_fail (property != NULL, FALSE);
	_tmp0_ = persona;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CONTACTS_TYPE_FAKE_PERSONA)) {
		result = TRUE;
		return result;
	}
	_tmp1_ = persona;
	_tmp2_ = folks_persona_get_writeable_properties (_tmp1_, &_tmp2__length1);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp2__length1;
	{
		gchar** p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
		p_collection = _tmp3_;
		p_collection_length1 = _tmp3__length1;
		for (p_it = 0; p_it < _tmp3__length1; p_it = p_it + 1) {
			const gchar* p = NULL;
			p = p_collection[p_it];
			{
				const gchar* _tmp4_ = NULL;
				const gchar* _tmp5_ = NULL;
				_tmp4_ = p;
				_tmp5_ = property;
				if (g_strcmp0 (_tmp4_, _tmp5_) == 0) {
					result = TRUE;
					return result;
				}
			}
		}
	}
	result = FALSE;
	return result;
}


gchar* contacts_contact_get_display_name_for_persona (FolksPersona* persona) {
	gchar* result = NULL;
	FolksNameDetails* name_details = NULL;
	FolksPersona* _tmp0_ = NULL;
	FolksNameDetails* _tmp1_ = NULL;
	FolksAliasDetails* alias_details = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksAliasDetails* _tmp3_ = NULL;
	FolksEmailDetails* email_details = NULL;
	FolksPersona* _tmp4_ = NULL;
	FolksEmailDetails* _tmp5_ = NULL;
	FolksNameDetails* _tmp6_ = NULL;
	FolksAliasDetails* _tmp14_ = NULL;
	FolksNameDetails* _tmp22_ = NULL;
	FolksEmailDetails* _tmp30_ = NULL;
	gchar* _tmp45_ = NULL;
	g_return_val_if_fail (persona != NULL, NULL);
	_tmp0_ = persona;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _tmp0_) : NULL);
	name_details = _tmp1_;
	_tmp2_ = persona;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, FOLKS_TYPE_ALIAS_DETAILS) ? ((FolksAliasDetails*) _tmp2_) : NULL);
	alias_details = _tmp3_;
	_tmp4_ = persona;
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, FOLKS_TYPE_EMAIL_DETAILS) ? ((FolksEmailDetails*) _tmp4_) : NULL);
	email_details = _tmp5_;
	_tmp6_ = name_details;
	if (_tmp6_ != NULL) {
		const gchar* name = NULL;
		FolksNameDetails* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
		const gchar* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		gboolean _tmp11_ = FALSE;
		_tmp7_ = name_details;
		_tmp8_ = folks_name_details_get_full_name (_tmp7_);
		_tmp9_ = _tmp8_;
		name = _tmp9_;
		_tmp10_ = name;
		_tmp11_ = contacts_is_set (_tmp10_);
		if (_tmp11_) {
			const gchar* _tmp12_ = NULL;
			gchar* _tmp13_ = NULL;
			_tmp12_ = name;
			_tmp13_ = g_strdup (_tmp12_);
			result = _tmp13_;
			_g_object_unref0 (email_details);
			_g_object_unref0 (alias_details);
			_g_object_unref0 (name_details);
			return result;
		}
	}
	_tmp14_ = alias_details;
	if (_tmp14_ != NULL) {
		const gchar* alias = NULL;
		FolksAliasDetails* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		const gchar* _tmp18_ = NULL;
		gboolean _tmp19_ = FALSE;
		_tmp15_ = alias_details;
		_tmp16_ = folks_alias_details_get_alias (_tmp15_);
		_tmp17_ = _tmp16_;
		alias = _tmp17_;
		_tmp18_ = alias;
		_tmp19_ = contacts_is_set (_tmp18_);
		if (_tmp19_) {
			const gchar* _tmp20_ = NULL;
			gchar* _tmp21_ = NULL;
			_tmp20_ = alias;
			_tmp21_ = g_strdup (_tmp20_);
			result = _tmp21_;
			_g_object_unref0 (email_details);
			_g_object_unref0 (alias_details);
			_g_object_unref0 (name_details);
			return result;
		}
	}
	_tmp22_ = name_details;
	if (_tmp22_ != NULL) {
		const gchar* nickname = NULL;
		FolksNameDetails* _tmp23_ = NULL;
		const gchar* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
		const gchar* _tmp26_ = NULL;
		gboolean _tmp27_ = FALSE;
		_tmp23_ = name_details;
		_tmp24_ = folks_name_details_get_nickname (_tmp23_);
		_tmp25_ = _tmp24_;
		nickname = _tmp25_;
		_tmp26_ = nickname;
		_tmp27_ = contacts_is_set (_tmp26_);
		if (_tmp27_) {
			const gchar* _tmp28_ = NULL;
			gchar* _tmp29_ = NULL;
			_tmp28_ = nickname;
			_tmp29_ = g_strdup (_tmp28_);
			result = _tmp29_;
			_g_object_unref0 (email_details);
			_g_object_unref0 (alias_details);
			_g_object_unref0 (name_details);
			return result;
		}
	}
	_tmp30_ = email_details;
	if (_tmp30_ != NULL) {
		{
			GeeIterator* _email_it = NULL;
			FolksEmailDetails* _tmp31_ = NULL;
			GeeSet* _tmp32_ = NULL;
			GeeSet* _tmp33_ = NULL;
			GeeIterator* _tmp34_ = NULL;
			_tmp31_ = email_details;
			_tmp32_ = folks_email_details_get_email_addresses (_tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = gee_iterable_iterator ((GeeIterable*) _tmp33_);
			_email_it = _tmp34_;
			while (TRUE) {
				GeeIterator* _tmp35_ = NULL;
				gboolean _tmp36_ = FALSE;
				FolksEmailFieldDetails* email = NULL;
				GeeIterator* _tmp37_ = NULL;
				gpointer _tmp38_ = NULL;
				gchar* e = NULL;
				FolksEmailFieldDetails* _tmp39_ = NULL;
				gconstpointer _tmp40_ = NULL;
				const gchar* _tmp41_ = NULL;
				gchar* _tmp42_ = NULL;
				const gchar* _tmp43_ = NULL;
				gboolean _tmp44_ = FALSE;
				_tmp35_ = _email_it;
				_tmp36_ = gee_iterator_next (_tmp35_);
				if (!_tmp36_) {
					break;
				}
				_tmp37_ = _email_it;
				_tmp38_ = gee_iterator_get (_tmp37_);
				email = (FolksEmailFieldDetails*) _tmp38_;
				_tmp39_ = email;
				_tmp40_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp39_);
				_tmp41_ = _tmp40_;
				_tmp42_ = g_strdup ((const gchar*) _tmp41_);
				e = _tmp42_;
				_tmp43_ = e;
				_tmp44_ = contacts_is_set (_tmp43_);
				if (_tmp44_) {
					result = e;
					_g_object_unref0 (email);
					_g_object_unref0 (_email_it);
					_g_object_unref0 (email_details);
					_g_object_unref0 (alias_details);
					_g_object_unref0 (name_details);
					return result;
				}
				_g_free0 (e);
				_g_object_unref0 (email);
			}
			_g_object_unref0 (_email_it);
		}
	}
	_tmp45_ = g_strdup ("");
	result = _tmp45_;
	_g_object_unref0 (email_details);
	_g_object_unref0 (alias_details);
	_g_object_unref0 (name_details);
	return result;
}


static gboolean _contacts_contact_get_is_hidden (ContactsContact* self) {
	gboolean result = FALSE;
	FolksIndividual* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	GeeSet* personas = NULL;
	FolksIndividual* _tmp4_ = NULL;
	GeeSet* _tmp5_ = NULL;
	GeeSet* _tmp6_ = NULL;
	GeeSet* _tmp7_ = NULL;
	GeeIterator* i = NULL;
	GeeSet* _tmp8_ = NULL;
	GeeIterator* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
	GeeIterator* _tmp11_ = NULL;
	gboolean _tmp12_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->individual;
	_tmp1_ = folks_individual_get_is_user (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		result = TRUE;
		return result;
	}
	_tmp3_ = self->priv->_is_hidden_to_delete;
	if (_tmp3_) {
		result = TRUE;
		return result;
	}
	_tmp4_ = self->individual;
	_tmp5_ = folks_individual_get_personas (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	personas = _tmp7_;
	_tmp8_ = personas;
	_tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_);
	i = _tmp9_;
	_tmp11_ = i;
	_tmp12_ = gee_iterator_next (_tmp11_);
	if (_tmp12_) {
		GeeIterator* _tmp13_ = NULL;
		gboolean _tmp14_ = FALSE;
		_tmp13_ = i;
		_tmp14_ = gee_iterator_has_next (_tmp13_);
		_tmp10_ = !_tmp14_;
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		FolksPersona* persona = NULL;
		GeeIterator* _tmp15_ = NULL;
		gpointer _tmp16_ = NULL;
		FolksPersonaStore* store = NULL;
		FolksPersona* _tmp17_ = NULL;
		FolksPersonaStore* _tmp18_ = NULL;
		FolksPersonaStore* _tmp19_ = NULL;
		FolksPersonaStore* _tmp20_ = NULL;
		FolksPersonaStore* _tmp21_ = NULL;
		const gchar* _tmp22_ = NULL;
		const gchar* _tmp23_ = NULL;
		gboolean _tmp24_ = FALSE;
		FolksPersonaStore* _tmp25_ = NULL;
		const gchar* _tmp26_ = NULL;
		const gchar* _tmp27_ = NULL;
		_tmp15_ = i;
		_tmp16_ = gee_iterator_get (_tmp15_);
		persona = (FolksPersona*) _tmp16_;
		_tmp17_ = persona;
		_tmp18_ = folks_persona_get_store (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = _g_object_ref0 (_tmp19_);
		store = _tmp20_;
		_tmp21_ = store;
		_tmp22_ = folks_persona_store_get_type_id (_tmp21_);
		_tmp23_ = _tmp22_;
		if (g_strcmp0 (_tmp23_, "key-file") == 0) {
			result = TRUE;
			_g_object_unref0 (store);
			_g_object_unref0 (persona);
			_g_object_unref0 (i);
			_g_object_unref0 (personas);
			return result;
		}
		_tmp25_ = store;
		_tmp26_ = folks_persona_store_get_type_id (_tmp25_);
		_tmp27_ = _tmp26_;
		if (g_strcmp0 (_tmp27_, "telepathy") == 0) {
			FolksPersonaStore* _tmp28_ = NULL;
			FolksPersonaStoreTrust _tmp29_ = 0;
			FolksPersonaStoreTrust _tmp30_ = 0;
			_tmp28_ = store;
			_tmp29_ = folks_persona_store_get_trust_level (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp24_ = _tmp30_ == FOLKS_PERSONA_STORE_TRUST_NONE;
		} else {
			_tmp24_ = FALSE;
		}
		if (_tmp24_) {
			result = TRUE;
			_g_object_unref0 (store);
			_g_object_unref0 (persona);
			_g_object_unref0 (i);
			_g_object_unref0 (personas);
			return result;
		}
		_g_object_unref0 (store);
		_g_object_unref0 (persona);
	}
	result = FALSE;
	_g_object_unref0 (i);
	_g_object_unref0 (personas);
	return result;
}


void contacts_contact_hide (ContactsContact* self) {
	g_return_if_fail (self != NULL);
	self->priv->_is_hidden_to_delete = TRUE;
	contacts_contact_queue_changed (self, FALSE);
}


void contacts_contact_show (ContactsContact* self) {
	g_return_if_fail (self != NULL);
	self->priv->_is_hidden_to_delete = FALSE;
	contacts_contact_queue_changed (self, FALSE);
}


ContactsContact* contacts_contact_from_individual (FolksIndividual* i) {
	ContactsContact* result = NULL;
	FolksIndividual* _tmp0_ = NULL;
	gconstpointer _tmp1_ = NULL;
	ContactsContact* _tmp2_ = NULL;
	g_return_val_if_fail (i != NULL, NULL);
	_tmp0_ = i;
	_tmp1_ = g_object_get_data ((GObject*) _tmp0_, "contact");
	_tmp2_ = _g_object_ref0 ((ContactsContact*) _tmp1_);
	result = _tmp2_;
	return result;
}


static void contacts_contact_persona_notify_cb (ContactsContact* self, GParamSpec* pspec) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (pspec != NULL);
	g_signal_emit_by_name (self, "presence-changed");
	contacts_contact_queue_changed (self, FALSE);
}


static void _contacts_contact_persona_notify_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	contacts_contact_persona_notify_cb ((ContactsContact*) self, pspec);
}


static void contacts_contact_connect_persona (ContactsContact* self, FolksPersona* p) {
	FolksPersona* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	TpfPersona* tp = NULL;
	FolksPersona* _tmp2_ = NULL;
	TpfPersona* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	TpfPersona* _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = p;
	g_signal_connect_object ((GObject*) _tmp0_, "notify::presence-type", (GCallback) _contacts_contact_persona_notify_cb_g_object_notify, self, 0);
	_tmp1_ = p;
	g_signal_connect_object ((GObject*) _tmp1_, "notify::presence-message", (GCallback) _contacts_contact_persona_notify_cb_g_object_notify, self, 0);
	_tmp2_ = p;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, TPF_TYPE_PERSONA) ? ((TpfPersona*) _tmp2_) : NULL);
	tp = _tmp3_;
	_tmp5_ = tp;
	if (_tmp5_ != NULL) {
		TpfPersona* _tmp6_ = NULL;
		TpContact* _tmp7_ = NULL;
		TpContact* _tmp8_ = NULL;
		_tmp6_ = tp;
		_tmp7_ = tpf_persona_get_contact (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_ != NULL;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		TpfPersona* _tmp9_ = NULL;
		TpContact* _tmp10_ = NULL;
		TpContact* _tmp11_ = NULL;
		_tmp9_ = tp;
		_tmp10_ = tpf_persona_get_contact (_tmp9_);
		_tmp11_ = _tmp10_;
		g_signal_connect_object ((GObject*) _tmp11_, "notify::client-types", (GCallback) _contacts_contact_persona_notify_cb_g_object_notify, self, 0);
	}
	_g_object_unref0 (tp);
}


static void contacts_contact_disconnect_persona (ContactsContact* self, FolksPersona* p) {
	FolksIndividual* _tmp0_ = NULL;
	TpfPersona* tp = NULL;
	FolksPersona* _tmp1_ = NULL;
	TpfPersona* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	TpfPersona* _tmp4_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = self->individual;
	g_signal_handlers_disconnect_by_func (_tmp0_, (void*) contacts_contact_persona_notify_cb, self);
	_tmp1_ = p;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, TPF_TYPE_PERSONA) ? ((TpfPersona*) _tmp1_) : NULL);
	tp = _tmp2_;
	_tmp4_ = tp;
	if (_tmp4_ != NULL) {
		TpfPersona* _tmp5_ = NULL;
		TpContact* _tmp6_ = NULL;
		TpContact* _tmp7_ = NULL;
		_tmp5_ = tp;
		_tmp6_ = tpf_persona_get_contact (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		TpfPersona* _tmp8_ = NULL;
		TpContact* _tmp9_ = NULL;
		TpContact* _tmp10_ = NULL;
		_tmp8_ = tp;
		_tmp9_ = tpf_persona_get_contact (_tmp8_);
		_tmp10_ = _tmp9_;
		g_signal_handlers_disconnect_by_func (_tmp10_, (void*) contacts_contact_persona_notify_cb, self);
	}
	_g_object_unref0 (tp);
}


gconstpointer contacts_contact_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key) {
	gconstpointer result = NULL;
	ContactsContactContactDataRef* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->refs;
	_tmp0__length1 = self->priv->refs_length1;
	{
		ContactsContactContactDataRef* data_ref_collection = NULL;
		gint data_ref_collection_length1 = 0;
		gint _data_ref_collection_size_ = 0;
		gint data_ref_it = 0;
		data_ref_collection = _tmp0_;
		data_ref_collection_length1 = _tmp0__length1;
		for (data_ref_it = 0; data_ref_it < _tmp0__length1; data_ref_it = data_ref_it + 1) {
			ContactsContactContactDataRef* data_ref = NULL;
			data_ref = &data_ref_collection[data_ref_it];
			{
				ContactsContactContactDataRef* _tmp1_ = NULL;
				void* _tmp2_ = NULL;
				void* _tmp3_ = NULL;
				_tmp1_ = data_ref;
				_tmp2_ = (*_tmp1_).key;
				_tmp3_ = key;
				if (_tmp2_ == _tmp3_) {
					ContactsContactContactDataRef* _tmp4_ = NULL;
					void* _tmp5_ = NULL;
					_tmp4_ = data_ref;
					_tmp5_ = (*_tmp4_).data;
					result = (gconstpointer*) _tmp5_;
					return result;
				}
			}
		}
	}
	result = NULL;
	return result;
}


void contacts_contact_set_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key, gpointer data) {
	gint i = 0;
	ContactsContactContactDataRef* _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gint _tmp1_ = 0;
	ContactsContactContactDataRef* _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	void* _tmp3_ = NULL;
	ContactsContactContactDataRef* _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	gpointer _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->refs;
	_tmp0__length1 = self->priv->refs_length1;
	i = _tmp0__length1;
	_tmp1_ = i + 1;
	self->priv->refs = g_renew (ContactsContactContactDataRef, self->priv->refs, i + 1);
	(_tmp1_ > self->priv->refs_length1) ? memset (self->priv->refs + self->priv->refs_length1, 0, sizeof (ContactsContactContactDataRef) * (_tmp1_ - self->priv->refs_length1)) : NULL;
	self->priv->refs_length1 = _tmp1_;
	self->priv->_refs_size_ = _tmp1_;
	_tmp2_ = self->priv->refs;
	_tmp2__length1 = self->priv->refs_length1;
	_tmp3_ = key;
	_tmp2_[i].key = _tmp3_;
	_tmp4_ = self->priv->refs;
	_tmp4__length1 = self->priv->refs_length1;
	_tmp5_ = data;
	data = NULL;
	_tmp4_[i].data = (void*) _tmp5_;
	_t_destroy_func0 (data);
}


void contacts_contact_remove_lookup (ContactsContact* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, void* key) {
	gint i = 0;
	g_return_if_fail (self != NULL);
	{
		gboolean _tmp0_ = FALSE;
		i = 0;
		_tmp0_ = TRUE;
		while (TRUE) {
			gint _tmp2_ = 0;
			ContactsContactContactDataRef* _tmp3_ = NULL;
			gint _tmp3__length1 = 0;
			ContactsContactContactDataRef* _tmp4_ = NULL;
			gint _tmp4__length1 = 0;
			gint _tmp5_ = 0;
			ContactsContactContactDataRef _tmp6_ = {0};
			void* _tmp7_ = NULL;
			void* _tmp8_ = NULL;
			if (!_tmp0_) {
				gint _tmp1_ = 0;
				_tmp1_ = i;
				i = _tmp1_ + 1;
			}
			_tmp0_ = FALSE;
			_tmp2_ = i;
			_tmp3_ = self->priv->refs;
			_tmp3__length1 = self->priv->refs_length1;
			if (!(_tmp2_ < _tmp3__length1)) {
				break;
			}
			_tmp4_ = self->priv->refs;
			_tmp4__length1 = self->priv->refs_length1;
			_tmp5_ = i;
			_tmp6_ = _tmp4_[_tmp5_];
			_tmp7_ = _tmp6_.key;
			_tmp8_ = key;
			if (_tmp7_ == _tmp8_) {
				gpointer old_val = NULL;
				ContactsContactContactDataRef* _tmp9_ = NULL;
				gint _tmp9__length1 = 0;
				gint _tmp10_ = 0;
				void* _tmp11_ = NULL;
				gconstpointer _tmp12_ = NULL;
				ContactsContactContactDataRef* _tmp24_ = NULL;
				gint _tmp24__length1 = 0;
				gint _tmp25_ = 0;
				_tmp9_ = self->priv->refs;
				_tmp9__length1 = self->priv->refs_length1;
				_tmp10_ = i;
				_tmp11_ = _tmp9_[_tmp10_].data;
				_tmp9_[_tmp10_].data = NULL;
				old_val = _tmp11_;
				_tmp12_ = old_val;
				{
					gint j = 0;
					gint _tmp13_ = 0;
					_tmp13_ = i;
					j = _tmp13_ + 1;
					{
						gboolean _tmp14_ = FALSE;
						_tmp14_ = TRUE;
						while (TRUE) {
							gint _tmp16_ = 0;
							ContactsContactContactDataRef* _tmp17_ = NULL;
							gint _tmp17__length1 = 0;
							ContactsContactContactDataRef* _tmp18_ = NULL;
							gint _tmp18__length1 = 0;
							gint _tmp19_ = 0;
							ContactsContactContactDataRef* _tmp20_ = NULL;
							gint _tmp20__length1 = 0;
							gint _tmp21_ = 0;
							ContactsContactContactDataRef _tmp22_ = {0};
							ContactsContactContactDataRef _tmp23_ = {0};
							if (!_tmp14_) {
								gint _tmp15_ = 0;
								_tmp15_ = j;
								j = _tmp15_ + 1;
							}
							_tmp14_ = FALSE;
							_tmp16_ = j;
							_tmp17_ = self->priv->refs;
							_tmp17__length1 = self->priv->refs_length1;
							if (!(_tmp16_ < _tmp17__length1)) {
								break;
							}
							_tmp18_ = self->priv->refs;
							_tmp18__length1 = self->priv->refs_length1;
							_tmp19_ = j;
							_tmp20_ = self->priv->refs;
							_tmp20__length1 = self->priv->refs_length1;
							_tmp21_ = j;
							_tmp22_ = _tmp20_[_tmp21_];
							_tmp18_[_tmp19_ - 1] = _tmp22_;
							_tmp23_ = _tmp18_[_tmp19_ - 1];
						}
					}
				}
				_tmp24_ = self->priv->refs;
				_tmp24__length1 = self->priv->refs_length1;
				_tmp25_ = _tmp24__length1 - 1;
				self->priv->refs = g_renew (ContactsContactContactDataRef, self->priv->refs, _tmp24__length1 - 1);
				(_tmp25_ > self->priv->refs_length1) ? memset (self->priv->refs + self->priv->refs_length1, 0, sizeof (ContactsContactContactDataRef) * (_tmp25_ - self->priv->refs_length1)) : NULL;
				self->priv->refs_length1 = _tmp25_;
				self->priv->_refs_size_ = _tmp25_;
				_t_destroy_func0 (old_val);
				return;
			}
		}
	}
}


gboolean contacts_contact_persona_is_main (FolksPersona* persona) {
	gboolean result = FALSE;
	FolksPersonaStore* store = NULL;
	FolksPersona* _tmp0_ = NULL;
	FolksPersonaStore* _tmp1_ = NULL;
	FolksPersonaStore* _tmp2_ = NULL;
	FolksPersonaStore* _tmp3_ = NULL;
	FolksPersonaStore* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	FolksPersona* _tmp7_ = NULL;
	gboolean _tmp8_ = FALSE;
	g_return_val_if_fail (persona != NULL, FALSE);
	_tmp0_ = persona;
	_tmp1_ = folks_persona_get_store (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	store = _tmp3_;
	_tmp4_ = store;
	_tmp5_ = folks_persona_store_get_is_primary_store (_tmp4_);
	_tmp6_ = _tmp5_;
	if (!_tmp6_) {
		result = FALSE;
		_g_object_unref0 (store);
		return result;
	}
	_tmp7_ = persona;
	_tmp8_ = contacts_contact_persona_is_google_other (_tmp7_);
	if (_tmp8_) {
		result = FALSE;
		_g_object_unref0 (store);
		return result;
	}
	result = TRUE;
	_g_object_unref0 (store);
	return result;
}


static gboolean contacts_contact_calc_is_main (ContactsContact* self) {
	gboolean result = FALSE;
	gboolean res = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	res = FALSE;
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			FolksPersona* _tmp8_ = NULL;
			gboolean _tmp9_ = FALSE;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp8_ = p;
			_tmp9_ = contacts_contact_persona_is_main (_tmp8_);
			if (_tmp9_) {
				res = TRUE;
			}
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	result = res;
	return result;
}


static void __lambda4_ (ContactsContact* self, GeeSet* added, GeeSet* removed) {
	g_return_if_fail (added != NULL);
	g_return_if_fail (removed != NULL);
	{
		GeeIterator* _p_it = NULL;
		GeeSet* _tmp0_ = NULL;
		GeeIterator* _tmp1_ = NULL;
		_tmp0_ = added;
		_tmp1_ = gee_iterable_iterator ((GeeIterable*) _tmp0_);
		_p_it = _tmp1_;
		while (TRUE) {
			GeeIterator* _tmp2_ = NULL;
			gboolean _tmp3_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp4_ = NULL;
			gpointer _tmp5_ = NULL;
			FolksPersona* _tmp6_ = NULL;
			_tmp2_ = _p_it;
			_tmp3_ = gee_iterator_next (_tmp2_);
			if (!_tmp3_) {
				break;
			}
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_get (_tmp4_);
			p = (FolksPersona*) _tmp5_;
			_tmp6_ = p;
			contacts_contact_connect_persona (self, _tmp6_);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	{
		GeeIterator* _p_it = NULL;
		GeeSet* _tmp7_ = NULL;
		GeeIterator* _tmp8_ = NULL;
		_tmp7_ = removed;
		_tmp8_ = gee_iterable_iterator ((GeeIterable*) _tmp7_);
		_p_it = _tmp8_;
		while (TRUE) {
			GeeIterator* _tmp9_ = NULL;
			gboolean _tmp10_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp11_ = NULL;
			gpointer _tmp12_ = NULL;
			FolksPersona* _tmp13_ = NULL;
			_tmp9_ = _p_it;
			_tmp10_ = gee_iterator_next (_tmp9_);
			if (!_tmp10_) {
				break;
			}
			_tmp11_ = _p_it;
			_tmp12_ = gee_iterator_get (_tmp11_);
			p = (FolksPersona*) _tmp12_;
			_tmp13_ = p;
			contacts_contact_disconnect_persona (self, _tmp13_);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	contacts_contact_queue_changed (self, TRUE);
}


static void ___lambda4__folks_individual_personas_changed (FolksIndividual* _sender, GeeSet* added, GeeSet* removed, gpointer self) {
	__lambda4_ ((ContactsContact*) self, added, removed);
}


static void _contacts_contact_notify_cb_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	contacts_contact_notify_cb ((ContactsContact*) self, pspec);
}


ContactsContact* contacts_contact_construct (GType object_type, ContactsStore* store, FolksIndividual* i) {
	ContactsContact * self = NULL;
	ContactsStore* _tmp0_ = NULL;
	ContactsStore* _tmp1_ = NULL;
	FolksIndividual* _tmp2_ = NULL;
	FolksIndividual* _tmp3_ = NULL;
	FolksIndividual* _tmp4_ = NULL;
	ContactsContact* _tmp5_ = NULL;
	ContactsContactContactDataRef* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	FolksIndividual* _tmp17_ = NULL;
	FolksIndividual* _tmp18_ = NULL;
	g_return_val_if_fail (store != NULL, NULL);
	g_return_val_if_fail (i != NULL, NULL);
	self = (ContactsContact*) g_object_new (object_type, NULL);
	_tmp0_ = store;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->store);
	self->store = _tmp1_;
	_tmp2_ = i;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->individual);
	self->individual = _tmp3_;
	_tmp4_ = self->individual;
	_tmp5_ = _g_object_ref0 (self);
	g_object_set_data_full ((GObject*) _tmp4_, "contact", _tmp5_, g_object_unref);
	_tmp6_ = g_new0 (ContactsContactContactDataRef, 0);
	self->priv->refs = (g_free (self->priv->refs), NULL);
	self->priv->refs = _tmp6_;
	self->priv->refs_length1 = 0;
	self->priv->_refs_size_ = self->priv->refs_length1;
	_tmp7_ = contacts_contact_calc_is_main (self);
	self->is_main = _tmp7_;
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp8_ = NULL;
		GeeSet* _tmp9_ = NULL;
		GeeSet* _tmp10_ = NULL;
		GeeIterator* _tmp11_ = NULL;
		_tmp8_ = self->individual;
		_tmp9_ = folks_individual_get_personas (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = gee_iterable_iterator ((GeeIterable*) _tmp10_);
		_p_it = _tmp11_;
		while (TRUE) {
			GeeIterator* _tmp12_ = NULL;
			gboolean _tmp13_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp14_ = NULL;
			gpointer _tmp15_ = NULL;
			FolksPersona* _tmp16_ = NULL;
			_tmp12_ = _p_it;
			_tmp13_ = gee_iterator_next (_tmp12_);
			if (!_tmp13_) {
				break;
			}
			_tmp14_ = _p_it;
			_tmp15_ = gee_iterator_get (_tmp14_);
			p = (FolksPersona*) _tmp15_;
			_tmp16_ = p;
			contacts_contact_connect_persona (self, _tmp16_);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	_tmp17_ = self->individual;
	g_signal_connect_object (_tmp17_, "personas-changed", (GCallback) ___lambda4__folks_individual_personas_changed, self, 0);
	contacts_contact_update (self);
	_tmp18_ = self->individual;
	g_signal_connect_object ((GObject*) _tmp18_, "notify", (GCallback) _contacts_contact_notify_cb_g_object_notify, self, 0);
	return self;
}


ContactsContact* contacts_contact_new (ContactsStore* store, FolksIndividual* i) {
	return contacts_contact_construct (CONTACTS_TYPE_CONTACT, store, i);
}


void contacts_contact_replace_individual (ContactsContact* self, FolksIndividual* new_individual) {
	FolksIndividual* _tmp9_ = NULL;
	guint _tmp10_ = 0U;
	FolksIndividual* _tmp11_ = NULL;
	FolksIndividual* _tmp12_ = NULL;
	FolksIndividual* _tmp13_ = NULL;
	ContactsContact* _tmp14_ = NULL;
	FolksIndividual* _tmp24_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_individual != NULL);
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			FolksPersona* _tmp8_ = NULL;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp8_ = p;
			contacts_contact_disconnect_persona (self, _tmp8_);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	_tmp9_ = self->individual;
	g_signal_parse_name ("notify", G_TYPE_OBJECT, &_tmp10_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((GObject*) _tmp9_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp10_, 0, NULL, (GCallback) _contacts_contact_notify_cb_g_object_notify, self);
	_tmp11_ = new_individual;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_g_object_unref0 (self->individual);
	self->individual = _tmp12_;
	_tmp13_ = self->individual;
	_tmp14_ = _g_object_ref0 (self);
	g_object_set_data_full ((GObject*) _tmp13_, "contact", _tmp14_, g_object_unref);
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp15_ = NULL;
		GeeSet* _tmp16_ = NULL;
		GeeSet* _tmp17_ = NULL;
		GeeIterator* _tmp18_ = NULL;
		_tmp15_ = self->individual;
		_tmp16_ = folks_individual_get_personas (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = gee_iterable_iterator ((GeeIterable*) _tmp17_);
		_p_it = _tmp18_;
		while (TRUE) {
			GeeIterator* _tmp19_ = NULL;
			gboolean _tmp20_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp21_ = NULL;
			gpointer _tmp22_ = NULL;
			FolksPersona* _tmp23_ = NULL;
			_tmp19_ = _p_it;
			_tmp20_ = gee_iterator_next (_tmp19_);
			if (!_tmp20_) {
				break;
			}
			_tmp21_ = _p_it;
			_tmp22_ = gee_iterator_get (_tmp21_);
			p = (FolksPersona*) _tmp22_;
			_tmp23_ = p;
			contacts_contact_connect_persona (self, _tmp23_);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	_g_object_unref0 (self->priv->_small_avatar);
	self->priv->_small_avatar = NULL;
	_g_variant_unref0 (self->priv->_avatar_icon_data);
	self->priv->_avatar_icon_data = NULL;
	_tmp24_ = self->individual;
	g_signal_connect_object ((GObject*) _tmp24_, "notify", (GCallback) _contacts_contact_notify_cb_g_object_notify, self, 0);
	contacts_contact_queue_changed (self, TRUE);
}


void contacts_contact_remove (ContactsContact* self) {
	FolksIndividual* _tmp9_ = NULL;
	guint _tmp10_ = 0U;
	g_return_if_fail (self != NULL);
	contacts_contact_unqueue_changed (self);
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			FolksPersona* _tmp8_ = NULL;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp8_ = p;
			contacts_contact_disconnect_persona (self, _tmp8_);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	_tmp9_ = self->individual;
	g_signal_parse_name ("notify", G_TYPE_OBJECT, &_tmp10_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((GObject*) _tmp9_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp10_, 0, NULL, (GCallback) _contacts_contact_notify_cb_g_object_notify, self);
}


gboolean contacts_contact_has_email (ContactsContact* self, const gchar* email_address) {
	gboolean result = FALSE;
	GeeSet* addrs = NULL;
	FolksIndividual* _tmp0_ = NULL;
	GeeSet* _tmp1_ = NULL;
	GeeSet* _tmp2_ = NULL;
	GeeSet* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (email_address != NULL, FALSE);
	_tmp0_ = self->individual;
	_tmp1_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	addrs = _tmp3_;
	{
		GeeIterator* _detail_it = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		_tmp4_ = addrs;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_detail_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			FolksEmailFieldDetails* detail = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			FolksEmailFieldDetails* _tmp10_ = NULL;
			gconstpointer _tmp11_ = NULL;
			const gchar* _tmp12_ = NULL;
			const gchar* _tmp13_ = NULL;
			_tmp6_ = _detail_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _detail_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			detail = (FolksEmailFieldDetails*) _tmp9_;
			_tmp10_ = detail;
			_tmp11_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = email_address;
			if (g_strcmp0 ((const gchar*) _tmp12_, _tmp13_) == 0) {
				result = TRUE;
				_g_object_unref0 (detail);
				_g_object_unref0 (_detail_it);
				_g_object_unref0 (addrs);
				return result;
			}
			_g_object_unref0 (detail);
		}
		_g_object_unref0 (_detail_it);
	}
	result = FALSE;
	_g_object_unref0 (addrs);
	return result;
}


gboolean contacts_contact_has_birthday (ContactsContact* self) {
	gboolean result = FALSE;
	FolksIndividual* _tmp0_ = NULL;
	GDateTime* _tmp1_ = NULL;
	GDateTime* _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->individual;
	_tmp1_ = folks_birthday_details_get_birthday ((FolksBirthdayDetails*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_ != NULL;
	return result;
}


gboolean contacts_contact_has_nickname (ContactsContact* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	FolksIndividual* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->individual;
	_tmp2_ = folks_name_details_get_nickname ((FolksNameDetails*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		FolksIndividual* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		_tmp4_ = self->individual;
		_tmp5_ = folks_name_details_get_nickname ((FolksNameDetails*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = g_strcmp0 (_tmp6_, "") != 0;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


gboolean contacts_contact_has_notes (ContactsContact* self) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GeeList* _p_list = NULL;
		GeeList* _tmp0_ = NULL;
		gint _p_size = 0;
		GeeList* _tmp1_ = NULL;
		gint _tmp2_ = 0;
		gint _tmp3_ = 0;
		gint _p_index = 0;
		_tmp0_ = contacts_contact_get_personas_for_display (self);
		_p_list = _tmp0_;
		_tmp1_ = _p_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_p_size = _tmp3_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp4_ = 0;
			gint _tmp5_ = 0;
			gint _tmp6_ = 0;
			FolksPersona* p = NULL;
			GeeList* _tmp7_ = NULL;
			gint _tmp8_ = 0;
			gpointer _tmp9_ = NULL;
			FolksNoteDetails* note_details = NULL;
			FolksPersona* _tmp10_ = NULL;
			FolksNoteDetails* _tmp11_ = NULL;
			FolksNoteDetails* _tmp12_ = NULL;
			_tmp4_ = _p_index;
			_p_index = _tmp4_ + 1;
			_tmp5_ = _p_index;
			_tmp6_ = _p_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _p_list;
			_tmp8_ = _p_index;
			_tmp9_ = gee_list_get (_tmp7_, _tmp8_);
			p = (FolksPersona*) _tmp9_;
			_tmp10_ = p;
			_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, FOLKS_TYPE_NOTE_DETAILS) ? ((FolksNoteDetails*) _tmp10_) : NULL);
			note_details = _tmp11_;
			_tmp12_ = note_details;
			if (_tmp12_ != NULL) {
				{
					GeeIterator* _note_it = NULL;
					FolksNoteDetails* _tmp13_ = NULL;
					GeeSet* _tmp14_ = NULL;
					GeeSet* _tmp15_ = NULL;
					GeeIterator* _tmp16_ = NULL;
					_tmp13_ = note_details;
					_tmp14_ = folks_note_details_get_notes (_tmp13_);
					_tmp15_ = _tmp14_;
					_tmp16_ = gee_iterable_iterator ((GeeIterable*) _tmp15_);
					_note_it = _tmp16_;
					while (TRUE) {
						GeeIterator* _tmp17_ = NULL;
						gboolean _tmp18_ = FALSE;
						FolksNoteFieldDetails* note = NULL;
						GeeIterator* _tmp19_ = NULL;
						gpointer _tmp20_ = NULL;
						FolksNoteFieldDetails* _tmp21_ = NULL;
						gconstpointer _tmp22_ = NULL;
						const gchar* _tmp23_ = NULL;
						_tmp17_ = _note_it;
						_tmp18_ = gee_iterator_next (_tmp17_);
						if (!_tmp18_) {
							break;
						}
						_tmp19_ = _note_it;
						_tmp20_ = gee_iterator_get (_tmp19_);
						note = (FolksNoteFieldDetails*) _tmp20_;
						_tmp21_ = note;
						_tmp22_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp21_);
						_tmp23_ = _tmp22_;
						if (g_strcmp0 ((const gchar*) _tmp23_, "") != 0) {
							result = TRUE;
							_g_object_unref0 (note);
							_g_object_unref0 (_note_it);
							_g_object_unref0 (note_details);
							_g_object_unref0 (p);
							_g_object_unref0 (_p_list);
							return result;
						}
						_g_object_unref0 (note);
					}
					_g_object_unref0 (_note_it);
				}
			}
			_g_object_unref0 (note_details);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_list);
	}
	result = FALSE;
	return result;
}


static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = needle;
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
	result = _tmp1_ != NULL;
	return result;
}


gboolean contacts_contact_contains_strings (ContactsContact* self, gchar** strings, int strings_length1) {
	gboolean result = FALSE;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = strings;
	_tmp0__length1 = strings_length1;
	{
		gchar** i_collection = NULL;
		gint i_collection_length1 = 0;
		gint _i_collection_size_ = 0;
		gint i_it = 0;
		i_collection = _tmp0_;
		i_collection_length1 = _tmp0__length1;
		for (i_it = 0; i_it < _tmp0__length1; i_it = i_it + 1) {
			gchar* _tmp1_ = NULL;
			gchar* i = NULL;
			_tmp1_ = g_strdup (i_collection[i_it]);
			i = _tmp1_;
			{
				const gchar* _tmp2_ = NULL;
				const gchar* _tmp3_ = NULL;
				gboolean _tmp4_ = FALSE;
				_tmp2_ = self->priv->filter_data;
				_tmp3_ = i;
				_tmp4_ = string_contains (_tmp2_, _tmp3_);
				if (!_tmp4_) {
					result = FALSE;
					_g_free0 (i);
					return result;
				}
				_g_free0 (i);
			}
		}
	}
	result = TRUE;
	return result;
}


gchar* contacts_contact_presence_to_icon_symbolic (FolksPresenceType presence) {
	gchar* result = NULL;
	gchar* iconname = NULL;
	FolksPresenceType _tmp0_ = 0;
	iconname = NULL;
	_tmp0_ = presence;
	switch (_tmp0_) {
		default:
		case FOLKS_PRESENCE_TYPE_OFFLINE:
		case FOLKS_PRESENCE_TYPE_UNSET:
		case FOLKS_PRESENCE_TYPE_ERROR:
		case FOLKS_PRESENCE_TYPE_UNKNOWN:
		{
			break;
		}
		case FOLKS_PRESENCE_TYPE_AVAILABLE:
		{
			gchar* _tmp1_ = NULL;
			_tmp1_ = g_strdup ("user-available-symbolic");
			_g_free0 (iconname);
			iconname = _tmp1_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_AWAY:
		case FOLKS_PRESENCE_TYPE_EXTENDED_AWAY:
		{
			gchar* _tmp2_ = NULL;
			_tmp2_ = g_strdup ("user-away-symbolic");
			_g_free0 (iconname);
			iconname = _tmp2_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_BUSY:
		{
			gchar* _tmp3_ = NULL;
			_tmp3_ = g_strdup ("user-busy-symbolic");
			_g_free0 (iconname);
			iconname = _tmp3_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_HIDDEN:
		{
			gchar* _tmp4_ = NULL;
			_tmp4_ = g_strdup ("user-invisible-symbolic");
			_g_free0 (iconname);
			iconname = _tmp4_;
			break;
		}
	}
	result = iconname;
	return result;
}


gchar* contacts_contact_presence_to_icon_symbolic_full (FolksPresenceType presence) {
	gchar* result = NULL;
	gchar* iconname = NULL;
	FolksPresenceType _tmp0_ = 0;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	_tmp0_ = presence;
	_tmp1_ = contacts_contact_presence_to_icon_symbolic (_tmp0_);
	iconname = _tmp1_;
	_tmp2_ = iconname;
	if (_tmp2_ != NULL) {
		result = iconname;
		return result;
	}
	_tmp3_ = g_strdup ("user-offline-symbolic");
	result = _tmp3_;
	_g_free0 (iconname);
	return result;
}


gchar* contacts_contact_presence_to_icon (FolksPresenceType presence) {
	gchar* result = NULL;
	gchar* iconname = NULL;
	FolksPresenceType _tmp0_ = 0;
	iconname = NULL;
	_tmp0_ = presence;
	switch (_tmp0_) {
		default:
		case FOLKS_PRESENCE_TYPE_OFFLINE:
		case FOLKS_PRESENCE_TYPE_UNSET:
		case FOLKS_PRESENCE_TYPE_ERROR:
		case FOLKS_PRESENCE_TYPE_UNKNOWN:
		{
			break;
		}
		case FOLKS_PRESENCE_TYPE_AVAILABLE:
		{
			gchar* _tmp1_ = NULL;
			_tmp1_ = g_strdup ("user-available");
			_g_free0 (iconname);
			iconname = _tmp1_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_AWAY:
		case FOLKS_PRESENCE_TYPE_EXTENDED_AWAY:
		{
			gchar* _tmp2_ = NULL;
			_tmp2_ = g_strdup ("user-away");
			_g_free0 (iconname);
			iconname = _tmp2_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_BUSY:
		{
			gchar* _tmp3_ = NULL;
			_tmp3_ = g_strdup ("user-busy");
			_g_free0 (iconname);
			iconname = _tmp3_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_HIDDEN:
		{
			gchar* _tmp4_ = NULL;
			_tmp4_ = g_strdup ("user-invisible");
			_g_free0 (iconname);
			iconname = _tmp4_;
			break;
		}
	}
	result = iconname;
	return result;
}


gchar* contacts_contact_presence_to_icon_full (FolksPresenceType presence) {
	gchar* result = NULL;
	gchar* iconname = NULL;
	FolksPresenceType _tmp0_ = 0;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	_tmp0_ = presence;
	_tmp1_ = contacts_contact_presence_to_icon (_tmp0_);
	iconname = _tmp1_;
	_tmp2_ = iconname;
	if (_tmp2_ != NULL) {
		result = iconname;
		return result;
	}
	_tmp3_ = g_strdup ("user-offline");
	result = _tmp3_;
	_g_free0 (iconname);
	return result;
}


gchar* contacts_contact_presence_to_class (FolksPresenceType presence) {
	gchar* result = NULL;
	gchar* classname = NULL;
	FolksPresenceType _tmp0_ = 0;
	classname = NULL;
	_tmp0_ = presence;
	switch (_tmp0_) {
		default:
		case FOLKS_PRESENCE_TYPE_HIDDEN:
		case FOLKS_PRESENCE_TYPE_OFFLINE:
		case FOLKS_PRESENCE_TYPE_UNSET:
		case FOLKS_PRESENCE_TYPE_ERROR:
		{
			gchar* _tmp1_ = NULL;
			_tmp1_ = g_strdup ("presence-icon-offline");
			_g_free0 (classname);
			classname = _tmp1_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_AVAILABLE:
		case FOLKS_PRESENCE_TYPE_UNKNOWN:
		{
			gchar* _tmp2_ = NULL;
			_tmp2_ = g_strdup ("presence-icon-available");
			_g_free0 (classname);
			classname = _tmp2_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_AWAY:
		case FOLKS_PRESENCE_TYPE_EXTENDED_AWAY:
		{
			gchar* _tmp3_ = NULL;
			_tmp3_ = g_strdup ("presence-icon-away");
			_g_free0 (classname);
			classname = _tmp3_;
			break;
		}
		case FOLKS_PRESENCE_TYPE_BUSY:
		{
			gchar* _tmp4_ = NULL;
			_tmp4_ = g_strdup ("presence-icon-busy");
			_g_free0 (classname);
			classname = _tmp4_;
			break;
		}
	}
	result = classname;
	return result;
}


static gchar* contacts_contact_get_first_string (GeeCollection* collection) {
	gchar* result = NULL;
	GeeCollection* _tmp0_ = NULL;
	_tmp0_ = collection;
	if (_tmp0_ != NULL) {
		GeeIterator* i = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeIterator* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		gboolean _tmp4_ = FALSE;
		_tmp1_ = collection;
		_tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_);
		i = _tmp2_;
		_tmp3_ = i;
		_tmp4_ = gee_iterator_next (_tmp3_);
		if (_tmp4_) {
			GeeIterator* _tmp5_ = NULL;
			gpointer _tmp6_ = NULL;
			_tmp5_ = i;
			_tmp6_ = gee_iterator_get (_tmp5_);
			result = (gchar*) _tmp6_;
			_g_object_unref0 (i);
			return result;
		}
		_g_object_unref0 (i);
	}
	result = NULL;
	return result;
}


static gboolean contacts_contact_has_pref (FolksAbstractFieldDetails* details) {
	gboolean result = FALSE;
	FolksAbstractFieldDetails* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	GeeCollection* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	g_return_val_if_fail (details != NULL, FALSE);
	_tmp0_ = details;
	_tmp1_ = folks_abstract_field_details_get_parameter_values (_tmp0_, "x-evolution-ui-slot");
	_tmp2_ = _tmp1_;
	_tmp3_ = contacts_contact_get_first_string (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strcmp0 (_tmp4_, "1") == 0;
	_g_free0 (_tmp4_);
	_g_object_unref0 (_tmp2_);
	if (_tmp5_) {
		result = TRUE;
		return result;
	}
	{
		GeeIterator* _param_it = NULL;
		FolksAbstractFieldDetails* _tmp6_ = NULL;
		GeeMultiMap* _tmp7_ = NULL;
		GeeMultiMap* _tmp8_ = NULL;
		GeeCollection* _tmp9_ = NULL;
		GeeCollection* _tmp10_ = NULL;
		GeeIterator* _tmp11_ = NULL;
		GeeIterator* _tmp12_ = NULL;
		_tmp6_ = details;
		_tmp7_ = folks_abstract_field_details_get_parameters (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_multi_map_get (_tmp8_, "type");
		_tmp10_ = _tmp9_;
		_tmp11_ = gee_iterable_iterator ((GeeIterable*) _tmp10_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (_tmp10_);
		_param_it = _tmp12_;
		while (TRUE) {
			GeeIterator* _tmp13_ = NULL;
			gboolean _tmp14_ = FALSE;
			gchar* param = NULL;
			GeeIterator* _tmp15_ = NULL;
			gpointer _tmp16_ = NULL;
			const gchar* _tmp17_ = NULL;
			gint _tmp18_ = 0;
			_tmp13_ = _param_it;
			_tmp14_ = gee_iterator_next (_tmp13_);
			if (!_tmp14_) {
				break;
			}
			_tmp15_ = _param_it;
			_tmp16_ = gee_iterator_get (_tmp15_);
			param = (gchar*) _tmp16_;
			_tmp17_ = param;
			_tmp18_ = g_ascii_strcasecmp (_tmp17_, "PREF");
			if (_tmp18_ == 0) {
				result = TRUE;
				_g_free0 (param);
				_g_object_unref0 (_param_it);
				return result;
			}
			_g_free0 (param);
		}
		_g_object_unref0 (_param_it);
	}
	result = FALSE;
	return result;
}


gint contacts_contact_compare_fields (void* _a, void* _b) {
	gint result = 0;
	FolksAbstractFieldDetails* a = NULL;
	void* _tmp0_ = NULL;
	FolksAbstractFieldDetails* b = NULL;
	void* _tmp1_ = NULL;
	gboolean first_a = FALSE;
	FolksAbstractFieldDetails* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	gboolean first_b = FALSE;
	FolksAbstractFieldDetails* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp9_ = FALSE;
	FolksAbstractFieldDetails* _tmp10_ = NULL;
	_tmp0_ = _a;
	a = (FolksAbstractFieldDetails*) _tmp0_;
	_tmp1_ = _b;
	b = (FolksAbstractFieldDetails*) _tmp1_;
	_tmp2_ = a;
	_tmp3_ = contacts_contact_has_pref (_tmp2_);
	first_a = _tmp3_;
	_tmp4_ = b;
	_tmp5_ = contacts_contact_has_pref (_tmp4_);
	first_b = _tmp5_;
	_tmp6_ = first_a;
	_tmp7_ = first_b;
	if (_tmp6_ != _tmp7_) {
		gboolean _tmp8_ = FALSE;
		_tmp8_ = first_a;
		if (_tmp8_) {
			result = -1;
			return result;
		} else {
			result = 1;
			return result;
		}
	}
	_tmp10_ = a;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, FOLKS_TYPE_EMAIL_FIELD_DETAILS)) {
		_tmp9_ = TRUE;
	} else {
		FolksAbstractFieldDetails* _tmp11_ = NULL;
		_tmp11_ = a;
		_tmp9_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, FOLKS_TYPE_PHONE_FIELD_DETAILS);
	}
	if (_tmp9_) {
		FolksAbstractFieldDetails* aa = NULL;
		FolksAbstractFieldDetails* _tmp12_ = NULL;
		FolksAbstractFieldDetails* _tmp13_ = NULL;
		FolksAbstractFieldDetails* bb = NULL;
		FolksAbstractFieldDetails* _tmp14_ = NULL;
		FolksAbstractFieldDetails* _tmp15_ = NULL;
		GCompareFunc _tmp16_ = NULL;
		FolksAbstractFieldDetails* _tmp17_ = NULL;
		gconstpointer _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		FolksAbstractFieldDetails* _tmp20_ = NULL;
		gconstpointer _tmp21_ = NULL;
		const gchar* _tmp22_ = NULL;
		gint _tmp23_ = 0;
		_tmp12_ = a;
		_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, FOLKS_TYPE_ABSTRACT_FIELD_DETAILS) ? ((FolksAbstractFieldDetails*) _tmp12_) : NULL);
		aa = _tmp13_;
		_tmp14_ = b;
		_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, FOLKS_TYPE_ABSTRACT_FIELD_DETAILS) ? ((FolksAbstractFieldDetails*) _tmp14_) : NULL);
		bb = _tmp15_;
		_tmp16_ = g_strcmp0;
		_tmp17_ = aa;
		_tmp18_ = folks_abstract_field_details_get_value (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = bb;
		_tmp21_ = folks_abstract_field_details_get_value (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = _tmp16_ ((const gchar*) _tmp19_, (const gchar*) _tmp22_);
		result = _tmp23_;
		_g_object_unref0 (bb);
		_g_object_unref0 (aa);
		return result;
	}
	g_warning ("contacts-contact.vala:642: Unsupported AbstractFieldDetails value type");
	result = 0;
	return result;
}


static gint _contacts_contact_compare_fields_gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = contacts_contact_compare_fields (a, b);
	return result;
}


GeeArrayList* contacts_contact_sort_fields (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GeeCollection* fields) {
	GeeArrayList* result = NULL;
	GeeArrayList* res = NULL;
	GeeArrayList* _tmp0_ = NULL;
	GeeCollection* _tmp1_ = NULL;
	g_return_val_if_fail (fields != NULL, NULL);
	_tmp0_ = gee_array_list_new (t_type, (GBoxedCopyFunc) t_dup_func, t_destroy_func, NULL, NULL, NULL);
	res = _tmp0_;
	_tmp1_ = fields;
	gee_array_list_add_all (res, _tmp1_);
	gee_list_sort ((GeeList*) res, _contacts_contact_compare_fields_gcompare_data_func, NULL, NULL);
	result = res;
	return result;
}


static void contacts_contact_geocode_address_data_free (gpointer _data) {
	ContactsContactGeocodeAddressData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->addr);
	_g_object_unref0 (_data_->result);
	g_slice_free (ContactsContactGeocodeAddressData, _data_);
}


void contacts_contact_geocode_address (FolksPostalAddress* addr, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsContactGeocodeAddressData* _data_;
	FolksPostalAddress* _tmp0_ = NULL;
	FolksPostalAddress* _tmp1_ = NULL;
	_data_ = g_slice_new0 (ContactsContactGeocodeAddressData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, contacts_contact_geocode_address);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_contact_geocode_address_data_free);
	_tmp0_ = addr;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data_->addr);
	_data_->addr = _tmp1_;
	contacts_contact_geocode_address_co (_data_);
}


GeocodePlace* contacts_contact_geocode_address_finish (GAsyncResult* _res_) {
	GeocodePlace* result;
	ContactsContactGeocodeAddressData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static Block13Data* block13_data_ref (Block13Data* _data13_) {
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}


static void block13_data_unref (void * _userdata_) {
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		_g_object_unref0 (_data13_->forward);
		_g_object_unref0 (_data13_->place);
		(_data13_->callback_target_destroy_notify == NULL) ? NULL : (_data13_->callback_target_destroy_notify (_data13_->callback_target), NULL);
		_data13_->callback = NULL;
		_data13_->callback_target = NULL;
		_data13_->callback_target_destroy_notify = NULL;
		g_slice_free (Block13Data, _data13_);
	}
}


static gboolean _contacts_contact_geocode_address_co_gsource_func (gpointer self) {
	gboolean result;
	result = contacts_contact_geocode_address_co (self);
	return result;
}


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


static void _vala_GValue_free (GValue* self) {
	g_value_unset (self);
	g_free (self);
}


static void __vala_GValue_free0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL));
}


static void __lambda7_ (Block13Data* _data13_, GObject* object, GAsyncResult* res) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (res != NULL);
	{
		GList* places = NULL;
		GAsyncResult* _tmp0_ = NULL;
		GList* _tmp1_ = NULL;
		gconstpointer _tmp2_ = NULL;
		GeocodePlace* _tmp3_ = NULL;
		GSourceFunc _tmp4_ = NULL;
		void* _tmp4__target = NULL;
		_tmp0_ = res;
		_tmp1_ = geocode_forward_search_finish (_data13_->forward, _tmp0_, &_inner_error_);
		places = _tmp1_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch3_g_error;
		}
		_tmp2_ = g_list_nth_data (places, (guint) 0);
		_tmp3_ = _g_object_ref0 ((GeocodePlace*) _tmp2_);
		_g_object_unref0 (_data13_->place);
		_data13_->place = _tmp3_;
		_tmp4_ = _data13_->callback;
		_tmp4__target = _data13_->callback_target;
		_tmp4_ (_tmp4__target);
		_g_list_free0 (places);
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* e = NULL;
		GSourceFunc _tmp5_ = NULL;
		void* _tmp5__target = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_debug ("contacts-contact.vala:679: No geocode result found for contact");
		_tmp5_ = _data13_->callback;
		_tmp5__target = _data13_->callback_target;
		_tmp5_ (_tmp5__target);
		_g_error_free0 (e);
	}
	__finally3:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ___lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda7_ (self, source_object, res);
	block13_data_unref (self);
}


static gboolean contacts_contact_geocode_address_co (ContactsContactGeocodeAddressData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data13_ = g_slice_new0 (Block13Data);
	_data_->_data13_->_ref_count_ = 1;
	_data_->_data13_->_async_data_ = _data_;
	_data_->_data13_->callback = _contacts_contact_geocode_address_co_gsource_func;
	_data_->_data13_->callback_target = _data_;
	_data_->_data13_->callback_target_destroy_notify = NULL;
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = g_str_hash;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = g_str_equal;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, __vala_GValue_free0_);
	_data_->params = _data_->_tmp2_;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->addr;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = folks_postal_address_get_street (_data_->_tmp3_);
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = FALSE;
	_data_->_tmp6_ = contacts_is_set (_data_->_tmp5_);
	if (_data_->_tmp6_) {
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = _data_->params;
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = g_strdup ("street");
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = _data_->addr;
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = folks_postal_address_get_street (_data_->_tmp9_);
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = g_new0 (GValue, 1);
		g_value_init (_data_->_tmp12_, G_TYPE_STRING);
		g_value_set_string (_data_->_tmp12_, _data_->_tmp11_);
		g_hash_table_insert (_data_->_tmp7_, _data_->_tmp8_, _data_->_tmp12_);
	}
	_data_->_tmp13_ = NULL;
	_data_->_tmp13_ = _data_->addr;
	_data_->_tmp14_ = NULL;
	_data_->_tmp14_ = folks_postal_address_get_locality (_data_->_tmp13_);
	_data_->_tmp15_ = NULL;
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = FALSE;
	_data_->_tmp16_ = contacts_is_set (_data_->_tmp15_);
	if (_data_->_tmp16_) {
		_data_->_tmp17_ = NULL;
		_data_->_tmp17_ = _data_->params;
		_data_->_tmp18_ = NULL;
		_data_->_tmp18_ = g_strdup ("locality");
		_data_->_tmp19_ = NULL;
		_data_->_tmp19_ = _data_->addr;
		_data_->_tmp20_ = NULL;
		_data_->_tmp20_ = folks_postal_address_get_locality (_data_->_tmp19_);
		_data_->_tmp21_ = NULL;
		_data_->_tmp21_ = _data_->_tmp20_;
		_data_->_tmp22_ = NULL;
		_data_->_tmp22_ = g_new0 (GValue, 1);
		g_value_init (_data_->_tmp22_, G_TYPE_STRING);
		g_value_set_string (_data_->_tmp22_, _data_->_tmp21_);
		g_hash_table_insert (_data_->_tmp17_, _data_->_tmp18_, _data_->_tmp22_);
	}
	_data_->_tmp23_ = NULL;
	_data_->_tmp23_ = _data_->addr;
	_data_->_tmp24_ = NULL;
	_data_->_tmp24_ = folks_postal_address_get_region (_data_->_tmp23_);
	_data_->_tmp25_ = NULL;
	_data_->_tmp25_ = _data_->_tmp24_;
	_data_->_tmp26_ = FALSE;
	_data_->_tmp26_ = contacts_is_set (_data_->_tmp25_);
	if (_data_->_tmp26_) {
		_data_->_tmp27_ = NULL;
		_data_->_tmp27_ = _data_->params;
		_data_->_tmp28_ = NULL;
		_data_->_tmp28_ = g_strdup ("region");
		_data_->_tmp29_ = NULL;
		_data_->_tmp29_ = _data_->addr;
		_data_->_tmp30_ = NULL;
		_data_->_tmp30_ = folks_postal_address_get_region (_data_->_tmp29_);
		_data_->_tmp31_ = NULL;
		_data_->_tmp31_ = _data_->_tmp30_;
		_data_->_tmp32_ = NULL;
		_data_->_tmp32_ = g_new0 (GValue, 1);
		g_value_init (_data_->_tmp32_, G_TYPE_STRING);
		g_value_set_string (_data_->_tmp32_, _data_->_tmp31_);
		g_hash_table_insert (_data_->_tmp27_, _data_->_tmp28_, _data_->_tmp32_);
	}
	_data_->_tmp33_ = NULL;
	_data_->_tmp33_ = _data_->addr;
	_data_->_tmp34_ = NULL;
	_data_->_tmp34_ = folks_postal_address_get_country (_data_->_tmp33_);
	_data_->_tmp35_ = NULL;
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_tmp36_ = FALSE;
	_data_->_tmp36_ = contacts_is_set (_data_->_tmp35_);
	if (_data_->_tmp36_) {
		_data_->_tmp37_ = NULL;
		_data_->_tmp37_ = _data_->params;
		_data_->_tmp38_ = NULL;
		_data_->_tmp38_ = g_strdup ("country");
		_data_->_tmp39_ = NULL;
		_data_->_tmp39_ = _data_->addr;
		_data_->_tmp40_ = NULL;
		_data_->_tmp40_ = folks_postal_address_get_country (_data_->_tmp39_);
		_data_->_tmp41_ = NULL;
		_data_->_tmp41_ = _data_->_tmp40_;
		_data_->_tmp42_ = NULL;
		_data_->_tmp42_ = g_new0 (GValue, 1);
		g_value_init (_data_->_tmp42_, G_TYPE_STRING);
		g_value_set_string (_data_->_tmp42_, _data_->_tmp41_);
		g_hash_table_insert (_data_->_tmp37_, _data_->_tmp38_, _data_->_tmp42_);
	}
	_data_->_data13_->place = NULL;
	_data_->_tmp43_ = NULL;
	_data_->_tmp43_ = _data_->params;
	_data_->_tmp44_ = NULL;
	_data_->_tmp44_ = geocode_forward_new_for_params (_data_->_tmp43_);
	_data_->_data13_->forward = _data_->_tmp44_;
	geocode_forward_search_async (_data_->_data13_->forward, NULL, ___lambda7__gasync_ready_callback, block13_data_ref (_data_->_data13_));
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp45_ = NULL;
	_data_->_tmp45_ = _g_object_ref0 (_data_->_data13_->place);
	_data_->result = _data_->_tmp45_;
	_g_hash_table_unref0 (_data_->params);
	block13_data_unref (_data_->_data13_);
	_data_->_data13_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_hash_table_unref0 (_data_->params);
	block13_data_unref (_data_->_data13_);
	_data_->_data13_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void _vala_array_add3 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add4 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add5 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add9 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


gchar** contacts_contact_format_address (FolksPostalAddress* addr, int* result_length1) {
	gchar** result = NULL;
	gchar** lines = NULL;
	gchar** _tmp0_ = NULL;
	gint lines_length1 = 0;
	gint _lines_size_ = 0;
	FolksPostalAddress* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	FolksPostalAddress* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	gboolean _tmp13_ = FALSE;
	FolksPostalAddress* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	const gchar* _tmp21_ = NULL;
	gboolean _tmp22_ = FALSE;
	FolksPostalAddress* _tmp28_ = NULL;
	const gchar* _tmp29_ = NULL;
	const gchar* _tmp30_ = NULL;
	gboolean _tmp31_ = FALSE;
	FolksPostalAddress* _tmp37_ = NULL;
	const gchar* _tmp38_ = NULL;
	const gchar* _tmp39_ = NULL;
	gboolean _tmp40_ = FALSE;
	FolksPostalAddress* _tmp46_ = NULL;
	const gchar* _tmp47_ = NULL;
	const gchar* _tmp48_ = NULL;
	gboolean _tmp49_ = FALSE;
	FolksPostalAddress* _tmp55_ = NULL;
	const gchar* _tmp56_ = NULL;
	const gchar* _tmp57_ = NULL;
	gboolean _tmp58_ = FALSE;
	FolksPostalAddress* _tmp64_ = NULL;
	const gchar* _tmp65_ = NULL;
	const gchar* _tmp66_ = NULL;
	gboolean _tmp67_ = FALSE;
	gchar** _tmp73_ = NULL;
	gint _tmp73__length1 = 0;
	g_return_val_if_fail (addr != NULL, NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	lines = _tmp0_;
	lines_length1 = 0;
	_lines_size_ = lines_length1;
	_tmp1_ = addr;
	_tmp2_ = folks_postal_address_get_street (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = contacts_is_set (_tmp3_);
	if (_tmp4_) {
		gchar** _tmp5_ = NULL;
		gint _tmp5__length1 = 0;
		FolksPostalAddress* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		_tmp5_ = lines;
		_tmp5__length1 = lines_length1;
		_tmp6_ = addr;
		_tmp7_ = folks_postal_address_get_street (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strdup (_tmp8_);
		_vala_array_add2 (&lines, &lines_length1, &_lines_size_, _tmp9_);
	}
	_tmp10_ = addr;
	_tmp11_ = folks_postal_address_get_extension (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = contacts_is_set (_tmp12_);
	if (_tmp13_) {
		gchar** _tmp14_ = NULL;
		gint _tmp14__length1 = 0;
		FolksPostalAddress* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		gchar* _tmp18_ = NULL;
		_tmp14_ = lines;
		_tmp14__length1 = lines_length1;
		_tmp15_ = addr;
		_tmp16_ = folks_postal_address_get_extension (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = g_strdup (_tmp17_);
		_vala_array_add3 (&lines, &lines_length1, &_lines_size_, _tmp18_);
	}
	_tmp19_ = addr;
	_tmp20_ = folks_postal_address_get_locality (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = contacts_is_set (_tmp21_);
	if (_tmp22_) {
		gchar** _tmp23_ = NULL;
		gint _tmp23__length1 = 0;
		FolksPostalAddress* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
		const gchar* _tmp26_ = NULL;
		gchar* _tmp27_ = NULL;
		_tmp23_ = lines;
		_tmp23__length1 = lines_length1;
		_tmp24_ = addr;
		_tmp25_ = folks_postal_address_get_locality (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = g_strdup (_tmp26_);
		_vala_array_add4 (&lines, &lines_length1, &_lines_size_, _tmp27_);
	}
	_tmp28_ = addr;
	_tmp29_ = folks_postal_address_get_region (_tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = contacts_is_set (_tmp30_);
	if (_tmp31_) {
		gchar** _tmp32_ = NULL;
		gint _tmp32__length1 = 0;
		FolksPostalAddress* _tmp33_ = NULL;
		const gchar* _tmp34_ = NULL;
		const gchar* _tmp35_ = NULL;
		gchar* _tmp36_ = NULL;
		_tmp32_ = lines;
		_tmp32__length1 = lines_length1;
		_tmp33_ = addr;
		_tmp34_ = folks_postal_address_get_region (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp36_ = g_strdup (_tmp35_);
		_vala_array_add5 (&lines, &lines_length1, &_lines_size_, _tmp36_);
	}
	_tmp37_ = addr;
	_tmp38_ = folks_postal_address_get_postal_code (_tmp37_);
	_tmp39_ = _tmp38_;
	_tmp40_ = contacts_is_set (_tmp39_);
	if (_tmp40_) {
		gchar** _tmp41_ = NULL;
		gint _tmp41__length1 = 0;
		FolksPostalAddress* _tmp42_ = NULL;
		const gchar* _tmp43_ = NULL;
		const gchar* _tmp44_ = NULL;
		gchar* _tmp45_ = NULL;
		_tmp41_ = lines;
		_tmp41__length1 = lines_length1;
		_tmp42_ = addr;
		_tmp43_ = folks_postal_address_get_postal_code (_tmp42_);
		_tmp44_ = _tmp43_;
		_tmp45_ = g_strdup (_tmp44_);
		_vala_array_add6 (&lines, &lines_length1, &_lines_size_, _tmp45_);
	}
	_tmp46_ = addr;
	_tmp47_ = folks_postal_address_get_po_box (_tmp46_);
	_tmp48_ = _tmp47_;
	_tmp49_ = contacts_is_set (_tmp48_);
	if (_tmp49_) {
		gchar** _tmp50_ = NULL;
		gint _tmp50__length1 = 0;
		FolksPostalAddress* _tmp51_ = NULL;
		const gchar* _tmp52_ = NULL;
		const gchar* _tmp53_ = NULL;
		gchar* _tmp54_ = NULL;
		_tmp50_ = lines;
		_tmp50__length1 = lines_length1;
		_tmp51_ = addr;
		_tmp52_ = folks_postal_address_get_po_box (_tmp51_);
		_tmp53_ = _tmp52_;
		_tmp54_ = g_strdup (_tmp53_);
		_vala_array_add7 (&lines, &lines_length1, &_lines_size_, _tmp54_);
	}
	_tmp55_ = addr;
	_tmp56_ = folks_postal_address_get_country (_tmp55_);
	_tmp57_ = _tmp56_;
	_tmp58_ = contacts_is_set (_tmp57_);
	if (_tmp58_) {
		gchar** _tmp59_ = NULL;
		gint _tmp59__length1 = 0;
		FolksPostalAddress* _tmp60_ = NULL;
		const gchar* _tmp61_ = NULL;
		const gchar* _tmp62_ = NULL;
		gchar* _tmp63_ = NULL;
		_tmp59_ = lines;
		_tmp59__length1 = lines_length1;
		_tmp60_ = addr;
		_tmp61_ = folks_postal_address_get_country (_tmp60_);
		_tmp62_ = _tmp61_;
		_tmp63_ = g_strdup (_tmp62_);
		_vala_array_add8 (&lines, &lines_length1, &_lines_size_, _tmp63_);
	}
	_tmp64_ = addr;
	_tmp65_ = folks_postal_address_get_address_format (_tmp64_);
	_tmp66_ = _tmp65_;
	_tmp67_ = contacts_is_set (_tmp66_);
	if (_tmp67_) {
		gchar** _tmp68_ = NULL;
		gint _tmp68__length1 = 0;
		FolksPostalAddress* _tmp69_ = NULL;
		const gchar* _tmp70_ = NULL;
		const gchar* _tmp71_ = NULL;
		gchar* _tmp72_ = NULL;
		_tmp68_ = lines;
		_tmp68__length1 = lines_length1;
		_tmp69_ = addr;
		_tmp70_ = folks_postal_address_get_address_format (_tmp69_);
		_tmp71_ = _tmp70_;
		_tmp72_ = g_strdup (_tmp71_);
		_vala_array_add9 (&lines, &lines_length1, &_lines_size_, _tmp72_);
	}
	_tmp73_ = lines;
	_tmp73__length1 = lines_length1;
	if (result_length1) {
		*result_length1 = _tmp73__length1;
	}
	result = _tmp73_;
	return result;
}


TpfPersona* contacts_contact_find_im_persona (ContactsContact* self, const gchar* protocol, const gchar* im_address) {
	TpfPersona* result = NULL;
	gchar* iid = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (protocol != NULL, NULL);
	g_return_val_if_fail (im_address != NULL, NULL);
	_tmp0_ = protocol;
	_tmp1_ = g_strconcat (_tmp0_, ":", NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = im_address;
	_tmp4_ = g_strconcat (_tmp2_, _tmp3_, NULL);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp2_);
	iid = _tmp5_;
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp6_ = NULL;
		GeeSet* _tmp7_ = NULL;
		GeeSet* _tmp8_ = NULL;
		GeeIterator* _tmp9_ = NULL;
		_tmp6_ = self->individual;
		_tmp7_ = folks_individual_get_personas (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_);
		_p_it = _tmp9_;
		while (TRUE) {
			GeeIterator* _tmp10_ = NULL;
			gboolean _tmp11_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp12_ = NULL;
			gpointer _tmp13_ = NULL;
			TpfPersona* tp = NULL;
			FolksPersona* _tmp14_ = NULL;
			TpfPersona* _tmp15_ = NULL;
			gboolean _tmp16_ = FALSE;
			TpfPersona* _tmp17_ = NULL;
			_tmp10_ = _p_it;
			_tmp11_ = gee_iterator_next (_tmp10_);
			if (!_tmp11_) {
				break;
			}
			_tmp12_ = _p_it;
			_tmp13_ = gee_iterator_get (_tmp12_);
			p = (FolksPersona*) _tmp13_;
			_tmp14_ = p;
			_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, TPF_TYPE_PERSONA) ? ((TpfPersona*) _tmp14_) : NULL);
			tp = _tmp15_;
			_tmp17_ = tp;
			if (_tmp17_ != NULL) {
				TpfPersona* _tmp18_ = NULL;
				const gchar* _tmp19_ = NULL;
				const gchar* _tmp20_ = NULL;
				const gchar* _tmp21_ = NULL;
				_tmp18_ = tp;
				_tmp19_ = folks_persona_get_iid ((FolksPersona*) _tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = iid;
				_tmp16_ = g_strcmp0 (_tmp20_, _tmp21_) == 0;
			} else {
				_tmp16_ = FALSE;
			}
			if (_tmp16_) {
				result = tp;
				_g_object_unref0 (p);
				_g_object_unref0 (_p_it);
				_g_free0 (iid);
				return result;
			}
			_g_object_unref0 (tp);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	result = NULL;
	_g_free0 (iid);
	return result;
}


gchar* contacts_contact_format_im_service (const gchar* service, ContactsContactImDisplay* display) {
	ContactsContactImDisplay _vala_display = 0;
	gchar* result = NULL;
	static const ContactsContactImData data[] = {{"google-talk", "Google Talk"}, {"ovi-chat", "Ovi Chat"}, {"facebook", "Facebook", CONTACTS_CONTACT_IM_DISPLAY_ALIAS_SERVICE}, {"lj-talk", "Livejournal"}, {"aim", "AOL Instant Messenger"}, {"gadugadu", "Gadu-Gadu"}, {"groupwise", "Novell Groupwise"}, {"icq", "ICQ"}, {"irc", "IRC"}, {"jabber", "Jabber"}, {"local-xmpp", "Local network"}, {"msn", "Windows Live Messenger"}, {"myspace", "MySpace"}, {"mxit", "MXit"}, {"napster", "Napster"}, {"qq", "Tencent QQ"}, {"sametime", "IBM Lotus Sametime"}, {"silc", "SILC"}, {"sip", "sip"}, {"skype", "Skype"}, {"tel", "Telephony"}, {"trepia", "Trepia"}, {"yahoo", "Yahoo! Messenger"}, {"yahoojp", "Yahoo! Messenger"}, {"zephyr", "Zephyr"}};
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	g_return_val_if_fail (service != NULL, NULL);
	{
		ContactsContactImData* d_collection = NULL;
		gint d_collection_length1 = 0;
		gint _d_collection_size_ = 0;
		gint d_it = 0;
		d_collection = data;
		d_collection_length1 = G_N_ELEMENTS (data);
		for (d_it = 0; d_it < G_N_ELEMENTS (data); d_it = d_it + 1) {
			ContactsContactImData d = {0};
			d = d_collection[d_it];
			{
				ContactsContactImData _tmp0_ = {0};
				const gchar* _tmp1_ = NULL;
				const gchar* _tmp2_ = NULL;
				_tmp0_ = d;
				_tmp1_ = _tmp0_.service;
				_tmp2_ = service;
				if (g_strcmp0 (_tmp1_, _tmp2_) == 0) {
					ContactsContactImData _tmp3_ = {0};
					ContactsContactImDisplay _tmp4_ = 0;
					ContactsContactImData _tmp5_ = {0};
					const gchar* _tmp6_ = NULL;
					const gchar* _tmp7_ = NULL;
					gchar* _tmp8_ = NULL;
					_tmp3_ = d;
					_tmp4_ = _tmp3_.display;
					_vala_display = _tmp4_;
					_tmp5_ = d;
					_tmp6_ = _tmp5_.display_name;
					_tmp7_ = g_dgettext (GETTEXT_PACKAGE, _tmp6_);
					_tmp8_ = g_strdup (_tmp7_);
					result = _tmp8_;
					if (display) {
						*display = _vala_display;
					}
					return result;
				}
			}
		}
	}
	_vala_display = CONTACTS_CONTACT_IM_DISPLAY_DEFAULT;
	_tmp9_ = service;
	_tmp10_ = g_strdup (_tmp9_);
	result = _tmp10_;
	if (display) {
		*display = _vala_display;
	}
	return result;
}


gchar* contacts_contact_format_im_name (TpfPersona* persona, const gchar* protocol, const gchar* id) {
	gchar* result = NULL;
	gchar* service = NULL;
	TpfPersona* _tmp0_ = NULL;
	gboolean _tmp11_ = FALSE;
	const gchar* _tmp12_ = NULL;
	ContactsContactImDisplay display = 0;
	gchar* display_name = NULL;
	const gchar* _tmp16_ = NULL;
	ContactsContactImDisplay _tmp17_ = 0;
	gchar* _tmp18_ = NULL;
	ContactsContactImDisplay _tmp19_ = 0;
	g_return_val_if_fail (protocol != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	service = NULL;
	_tmp0_ = persona;
	if (_tmp0_ != NULL) {
		TpAccount* account = NULL;
		TpfPersona* _tmp1_ = NULL;
		FolksPersonaStore* _tmp2_ = NULL;
		FolksPersonaStore* _tmp3_ = NULL;
		TpAccount* _tmp4_ = NULL;
		TpAccount* _tmp5_ = NULL;
		TpAccount* _tmp6_ = NULL;
		TpAccount* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
		const gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		_tmp1_ = persona;
		_tmp2_ = folks_persona_get_store ((FolksPersona*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = tpf_persona_store_get_account (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, TPF_TYPE_PERSONA_STORE) ? ((TpfPersonaStore*) _tmp3_) : NULL);
		_tmp5_ = _tmp4_;
		_tmp6_ = _g_object_ref0 (_tmp5_);
		account = _tmp6_;
		_tmp7_ = account;
		_tmp8_ = tp_account_get_service (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = g_strdup (_tmp9_);
		_g_free0 (service);
		service = _tmp10_;
		_g_object_unref0 (account);
	}
	_tmp12_ = service;
	if (_tmp12_ == NULL) {
		_tmp11_ = TRUE;
	} else {
		const gchar* _tmp13_ = NULL;
		_tmp13_ = service;
		_tmp11_ = g_strcmp0 (_tmp13_, "") == 0;
	}
	if (_tmp11_) {
		const gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		_tmp14_ = protocol;
		_tmp15_ = g_strdup (_tmp14_);
		_g_free0 (service);
		service = _tmp15_;
	}
	_tmp16_ = service;
	_tmp18_ = contacts_contact_format_im_service (_tmp16_, &_tmp17_);
	display = _tmp17_;
	display_name = _tmp18_;
	_tmp19_ = display;
	switch (_tmp19_) {
		default:
		case CONTACTS_CONTACT_IM_DISPLAY_DEFAULT:
		{
			const gchar* _tmp20_ = NULL;
			gchar* _tmp21_ = NULL;
			gchar* _tmp22_ = NULL;
			const gchar* _tmp23_ = NULL;
			gchar* _tmp24_ = NULL;
			gchar* _tmp25_ = NULL;
			gchar* _tmp26_ = NULL;
			gchar* _tmp27_ = NULL;
			_tmp20_ = id;
			_tmp21_ = g_strconcat (_tmp20_, " (", NULL);
			_tmp22_ = _tmp21_;
			_tmp23_ = display_name;
			_tmp24_ = g_strconcat (_tmp22_, _tmp23_, NULL);
			_tmp25_ = _tmp24_;
			_tmp26_ = g_strconcat (_tmp25_, ")", NULL);
			_tmp27_ = _tmp26_;
			_g_free0 (_tmp25_);
			_g_free0 (_tmp22_);
			result = _tmp27_;
			_g_free0 (display_name);
			_g_free0 (service);
			return result;
		}
		case CONTACTS_CONTACT_IM_DISPLAY_ALIAS_SERVICE:
		{
			TpfPersona* _tmp28_ = NULL;
			const gchar* _tmp29_ = NULL;
			const gchar* _tmp30_ = NULL;
			gchar* _tmp31_ = NULL;
			gchar* _tmp32_ = NULL;
			const gchar* _tmp33_ = NULL;
			gchar* _tmp34_ = NULL;
			gchar* _tmp35_ = NULL;
			gchar* _tmp36_ = NULL;
			gchar* _tmp37_ = NULL;
			_tmp28_ = persona;
			_tmp29_ = folks_alias_details_get_alias ((FolksAliasDetails*) _tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = g_strconcat (_tmp30_, " (", NULL);
			_tmp32_ = _tmp31_;
			_tmp33_ = display_name;
			_tmp34_ = g_strconcat (_tmp32_, _tmp33_, NULL);
			_tmp35_ = _tmp34_;
			_tmp36_ = g_strconcat (_tmp35_, ")", NULL);
			_tmp37_ = _tmp36_;
			_g_free0 (_tmp35_);
			_g_free0 (_tmp32_);
			result = _tmp37_;
			_g_free0 (display_name);
			_g_free0 (service);
			return result;
		}
	}
	_g_free0 (display_name);
	_g_free0 (service);
}


GtkWidget* contacts_contact_create_merged_presence_widget (ContactsContact* self) {
	GtkWidget* result = NULL;
	ContactsContactPresence* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = contacts_contact_presence_new (self);
	g_object_ref_sink (_tmp0_);
	result = (GtkWidget*) _tmp0_;
	return result;
}


static Block14Data* block14_data_ref (Block14Data* _data14_) {
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}


static void block14_data_unref (void * _userdata_) {
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		ContactsContact* self;
		self = _data14_->self;
		_g_free0 (_data14_->last_class);
		_g_object_unref0 (_data14_->i);
		_g_object_unref0 (_data14_->tp);
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}


static void __lambda11_ (Block14Data* _data14_, GParamSpec* pspec) {
	ContactsContact* self;
	GtkImage* _tmp0_ = NULL;
	TpfPersona* _tmp1_ = NULL;
	FolksPresenceType _tmp2_ = 0;
	FolksPresenceType _tmp3_ = 0;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	GtkImage* _tmp6_ = NULL;
	GtkStyleContext* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	TpfPersona* _tmp9_ = NULL;
	FolksPresenceType _tmp10_ = 0;
	FolksPresenceType _tmp11_ = 0;
	gchar* _tmp12_ = NULL;
	GtkImage* _tmp13_ = NULL;
	GtkStyleContext* _tmp14_ = NULL;
	const gchar* _tmp15_ = NULL;
	self = _data14_->self;
	g_return_if_fail (pspec != NULL);
	_tmp0_ = _data14_->i;
	_tmp1_ = _data14_->tp;
	_tmp2_ = folks_presence_details_get_presence_type ((FolksPresenceDetails*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = contacts_contact_presence_to_icon_full (_tmp3_);
	_tmp5_ = _tmp4_;
	gtk_image_set_from_icon_name (_tmp0_, _tmp5_, GTK_ICON_SIZE_MENU);
	_g_free0 (_tmp5_);
	_tmp6_ = _data14_->i;
	_tmp7_ = gtk_widget_get_style_context ((GtkWidget*) _tmp6_);
	_tmp8_ = _data14_->last_class;
	gtk_style_context_remove_class (_tmp7_, _tmp8_);
	_tmp9_ = _data14_->tp;
	_tmp10_ = folks_presence_details_get_presence_type ((FolksPresenceDetails*) _tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = contacts_contact_presence_to_class (_tmp11_);
	_g_free0 (_data14_->last_class);
	_data14_->last_class = _tmp12_;
	_tmp13_ = _data14_->i;
	_tmp14_ = gtk_widget_get_style_context ((GtkWidget*) _tmp13_);
	_tmp15_ = _data14_->last_class;
	gtk_style_context_add_class (_tmp14_, _tmp15_);
}


static void ___lambda11__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda11_ (self, pspec);
}


static void __lambda12_ (Block14Data* _data14_, GParamSpec* pspec) {
	ContactsContact* self;
	GtkImage* _tmp0_ = NULL;
	TpfPersona* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	self = _data14_->self;
	g_return_if_fail (pspec != NULL);
	_tmp0_ = _data14_->i;
	_tmp1_ = _data14_->tp;
	_tmp2_ = folks_presence_details_get_presence_message ((FolksPresenceDetails*) _tmp1_);
	_tmp3_ = _tmp2_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp0_, _tmp3_);
}


static void ___lambda12__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda12_ (self, pspec);
}


static void __lambda13_ (Block14Data* _data14_) {
	ContactsContact* self;
	TpfPersona* _tmp0_ = NULL;
	gulong _tmp1_ = 0UL;
	TpfPersona* _tmp2_ = NULL;
	gulong _tmp3_ = 0UL;
	self = _data14_->self;
	_tmp0_ = _data14_->tp;
	_tmp1_ = _data14_->id1;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _tmp1_);
	_tmp2_ = _data14_->tp;
	_tmp3_ = _data14_->id2;
	g_signal_handler_disconnect ((GObject*) _tmp2_, _tmp3_);
}


static void ___lambda13__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda13_ (self);
}


GtkWidget* contacts_contact_create_presence_widget (ContactsContact* self, const gchar* protocol, const gchar* im_address) {
	GtkWidget* result = NULL;
	Block14Data* _data14_;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	TpfPersona* _tmp2_ = NULL;
	TpfPersona* _tmp3_ = NULL;
	GtkImage* _tmp4_ = NULL;
	GtkImage* _tmp5_ = NULL;
	TpfPersona* _tmp6_ = NULL;
	FolksPresenceType _tmp7_ = 0;
	FolksPresenceType _tmp8_ = 0;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	TpfPersona* _tmp11_ = NULL;
	FolksPresenceType _tmp12_ = 0;
	FolksPresenceType _tmp13_ = 0;
	gchar* _tmp14_ = NULL;
	GtkImage* _tmp15_ = NULL;
	GtkStyleContext* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	GtkImage* _tmp18_ = NULL;
	TpfPersona* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	const gchar* _tmp21_ = NULL;
	TpfPersona* _tmp22_ = NULL;
	gulong _tmp23_ = 0UL;
	TpfPersona* _tmp24_ = NULL;
	gulong _tmp25_ = 0UL;
	GtkImage* _tmp26_ = NULL;
	GtkImage* _tmp27_ = NULL;
	GtkWidget* _tmp28_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (protocol != NULL, NULL);
	g_return_val_if_fail (im_address != NULL, NULL);
	_data14_ = g_slice_new0 (Block14Data);
	_data14_->_ref_count_ = 1;
	_data14_->self = g_object_ref (self);
	_tmp0_ = protocol;
	_tmp1_ = im_address;
	_tmp2_ = contacts_contact_find_im_persona (self, _tmp0_, _tmp1_);
	_data14_->tp = _tmp2_;
	_tmp3_ = _data14_->tp;
	if (_tmp3_ == NULL) {
		result = NULL;
		block14_data_unref (_data14_);
		_data14_ = NULL;
		return result;
	}
	_tmp4_ = (GtkImage*) gtk_image_new ();
	g_object_ref_sink (_tmp4_);
	_data14_->i = _tmp4_;
	_tmp5_ = _data14_->i;
	_tmp6_ = _data14_->tp;
	_tmp7_ = folks_presence_details_get_presence_type ((FolksPresenceDetails*) _tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = contacts_contact_presence_to_icon_full (_tmp8_);
	_tmp10_ = _tmp9_;
	gtk_image_set_from_icon_name (_tmp5_, _tmp10_, GTK_ICON_SIZE_MENU);
	_g_free0 (_tmp10_);
	_tmp11_ = _data14_->tp;
	_tmp12_ = folks_presence_details_get_presence_type ((FolksPresenceDetails*) _tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = contacts_contact_presence_to_class (_tmp13_);
	_data14_->last_class = _tmp14_;
	_tmp15_ = _data14_->i;
	_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) _tmp15_);
	_tmp17_ = _data14_->last_class;
	gtk_style_context_add_class (_tmp16_, _tmp17_);
	_tmp18_ = _data14_->i;
	_tmp19_ = _data14_->tp;
	_tmp20_ = folks_presence_details_get_presence_message ((FolksPresenceDetails*) _tmp19_);
	_tmp21_ = _tmp20_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp18_, _tmp21_);
	_tmp22_ = _data14_->tp;
	_tmp23_ = g_signal_connect_data ((GObject*) _tmp22_, "notify::presence-type", (GCallback) ___lambda11__g_object_notify, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
	_data14_->id1 = _tmp23_;
	_tmp24_ = _data14_->tp;
	_tmp25_ = g_signal_connect_data ((GObject*) _tmp24_, "notify::presence-message", (GCallback) ___lambda12__g_object_notify, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
	_data14_->id2 = _tmp25_;
	_tmp26_ = _data14_->i;
	g_signal_connect_data ((GtkWidget*) _tmp26_, "destroy", (GCallback) ___lambda13__gtk_widget_destroy, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
	_tmp27_ = _data14_->i;
	_tmp28_ = _g_object_ref0 ((GtkWidget*) _tmp27_);
	result = _tmp28_;
	block14_data_unref (_data14_);
	_data14_ = NULL;
	return result;
}


static gboolean contacts_contact_changed_cb (ContactsContact* self) {
	gboolean result = FALSE;
	gboolean changed_personas = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	self->priv->changed_id = (guint) 0;
	_tmp0_ = self->priv->changed_personas;
	changed_personas = _tmp0_;
	self->priv->changed_personas = FALSE;
	_tmp1_ = contacts_contact_calc_is_main (self);
	self->is_main = _tmp1_;
	contacts_contact_update (self);
	g_signal_emit_by_name (self, "changed");
	_tmp2_ = changed_personas;
	if (_tmp2_) {
		g_signal_emit_by_name (self, "personas-changed");
	}
	result = FALSE;
	return result;
}


static void contacts_contact_unqueue_changed (ContactsContact* self) {
	guint _tmp0_ = 0U;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->changed_id;
	if (_tmp0_ != ((guint) 0)) {
		guint _tmp1_ = 0U;
		_tmp1_ = self->priv->changed_id;
		g_source_remove (_tmp1_);
		self->priv->changed_id = (guint) 0;
	}
}


static gboolean _contacts_contact_changed_cb_gsource_func (gpointer self) {
	gboolean result;
	result = contacts_contact_changed_cb ((ContactsContact*) self);
	return result;
}


void contacts_contact_queue_changed (ContactsContact* self, gboolean is_persona_change) {
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	guint _tmp2_ = 0U;
	guint _tmp3_ = 0U;
	g_return_if_fail (self != NULL);
	self->priv->_is_hidden_uptodate = FALSE;
	_tmp0_ = self->priv->changed_personas;
	_tmp1_ = is_persona_change;
	self->priv->changed_personas = _tmp0_ | _tmp1_;
	_tmp2_ = self->priv->changed_id;
	if (_tmp2_ != ((guint) 0)) {
		return;
	}
	_tmp3_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _contacts_contact_changed_cb_gsource_func, g_object_ref (self), g_object_unref);
	self->priv->changed_id = _tmp3_;
}


static void contacts_contact_notify_cb (ContactsContact* self, GParamSpec* pspec) {
	GParamSpec* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pspec != NULL);
	_tmp0_ = pspec;
	_tmp1_ = g_param_spec_get_name (_tmp0_);
	if (g_strcmp0 (_tmp1_, "avatar") == 0) {
		_g_object_unref0 (self->priv->_small_avatar);
		self->priv->_small_avatar = NULL;
		_g_variant_unref0 (self->priv->_avatar_icon_data);
		self->priv->_avatar_icon_data = NULL;
	}
	contacts_contact_queue_changed (self, FALSE);
}


static gboolean contacts_contact_get_is_phone (FolksPersona* persona) {
	gboolean result = FALSE;
	TpfPersona* tp = NULL;
	FolksPersona* _tmp0_ = NULL;
	TpfPersona* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	TpfPersona* _tmp3_ = NULL;
	gchar** types = NULL;
	TpfPersona* _tmp7_ = NULL;
	TpContact* _tmp8_ = NULL;
	TpContact* _tmp9_ = NULL;
	gchar** _tmp10_ = NULL;
	gint _tmp10__length1 = 0;
	gchar** _tmp11_ = NULL;
	gint _tmp11__length1 = 0;
	gint types_length1 = 0;
	gint _types_size_ = 0;
	gboolean _tmp12_ = FALSE;
	gchar** _tmp13_ = NULL;
	gint _tmp13__length1 = 0;
	g_return_val_if_fail (persona != NULL, FALSE);
	_tmp0_ = persona;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, TPF_TYPE_PERSONA) ? ((TpfPersona*) _tmp0_) : NULL);
	tp = _tmp1_;
	_tmp3_ = tp;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		TpfPersona* _tmp4_ = NULL;
		TpContact* _tmp5_ = NULL;
		TpContact* _tmp6_ = NULL;
		_tmp4_ = tp;
		_tmp5_ = tpf_persona_get_contact (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp2_ = _tmp6_ == NULL;
	}
	if (_tmp2_) {
		result = FALSE;
		_g_object_unref0 (tp);
		return result;
	}
	_tmp7_ = tp;
	_tmp8_ = tpf_persona_get_contact (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = tp_contact_get_client_types (_tmp9_);
	_tmp10__length1 = _vala_array_length (_tmp10_);
	_tmp11_ = _tmp10_;
	_tmp11__length1 = _tmp10__length1;
	types = _tmp11_;
	types_length1 = _tmp11__length1;
	_types_size_ = types_length1;
	_tmp13_ = types;
	_tmp13__length1 = types_length1;
	if (_tmp13_ != NULL) {
		gchar** _tmp14_ = NULL;
		gint _tmp14__length1 = 0;
		const gchar* _tmp15_ = NULL;
		_tmp14_ = types;
		_tmp14__length1 = types_length1;
		_tmp15_ = _tmp14_[0];
		_tmp12_ = g_strcmp0 (_tmp15_, "phone") == 0;
	} else {
		_tmp12_ = FALSE;
	}
	result = _tmp12_;
	_g_object_unref0 (tp);
	return result;
}


static void contacts_contact_update_presence (ContactsContact* self) {
	const gchar* _tmp34_ = NULL;
	g_return_if_fail (self != NULL);
	_g_free0 (self->presence_message);
	self->presence_message = NULL;
	self->presence_type = FOLKS_PRESENCE_TYPE_UNSET;
	self->is_phone = FALSE;
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			FolksPersona* _tmp8_ = NULL;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp8_ = p;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, FOLKS_TYPE_PRESENCE_DETAILS)) {
				FolksPresenceDetails* presence = NULL;
				FolksPersona* _tmp9_ = NULL;
				gboolean p_is_phone = FALSE;
				FolksPersona* _tmp10_ = NULL;
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
				FolksPresenceDetails* _tmp13_ = NULL;
				FolksPresenceType _tmp14_ = 0;
				FolksPresenceType _tmp15_ = 0;
				FolksPresenceType _tmp16_ = 0;
				gint _tmp17_ = 0;
				_tmp9_ = p;
				presence = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, FOLKS_TYPE_PRESENCE_DETAILS, FolksPresenceDetails);
				_tmp10_ = p;
				_tmp11_ = contacts_contact_get_is_phone (_tmp10_);
				p_is_phone = _tmp11_;
				_tmp13_ = presence;
				_tmp14_ = folks_presence_details_get_presence_type (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = self->presence_type;
				_tmp17_ = folks_presence_details_typecmp (_tmp15_, _tmp16_);
				if (_tmp17_ > 0) {
					_tmp12_ = TRUE;
				} else {
					gboolean _tmp18_ = FALSE;
					gboolean _tmp19_ = FALSE;
					FolksPresenceDetails* _tmp20_ = NULL;
					FolksPresenceType _tmp21_ = 0;
					FolksPresenceType _tmp22_ = 0;
					FolksPresenceType _tmp23_ = 0;
					_tmp20_ = presence;
					_tmp21_ = folks_presence_details_get_presence_type (_tmp20_);
					_tmp22_ = _tmp21_;
					_tmp23_ = self->presence_type;
					if (_tmp22_ == _tmp23_) {
						gboolean _tmp24_ = FALSE;
						_tmp24_ = self->is_phone;
						_tmp19_ = _tmp24_;
					} else {
						_tmp19_ = FALSE;
					}
					if (_tmp19_) {
						gboolean _tmp25_ = FALSE;
						_tmp25_ = p_is_phone;
						_tmp18_ = !_tmp25_;
					} else {
						_tmp18_ = FALSE;
					}
					_tmp12_ = _tmp18_;
				}
				if (_tmp12_) {
					FolksPresenceDetails* _tmp26_ = NULL;
					FolksPresenceType _tmp27_ = 0;
					FolksPresenceType _tmp28_ = 0;
					FolksPresenceDetails* _tmp29_ = NULL;
					const gchar* _tmp30_ = NULL;
					const gchar* _tmp31_ = NULL;
					gchar* _tmp32_ = NULL;
					gboolean _tmp33_ = FALSE;
					_tmp26_ = presence;
					_tmp27_ = folks_presence_details_get_presence_type (_tmp26_);
					_tmp28_ = _tmp27_;
					self->presence_type = _tmp28_;
					_tmp29_ = presence;
					_tmp30_ = folks_presence_details_get_presence_message (_tmp29_);
					_tmp31_ = _tmp30_;
					_tmp32_ = g_strdup (_tmp31_);
					_g_free0 (self->presence_message);
					self->presence_message = _tmp32_;
					_tmp33_ = p_is_phone;
					self->is_phone = _tmp33_;
				}
			}
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	_tmp34_ = self->presence_message;
	if (_tmp34_ == NULL) {
		gchar* _tmp35_ = NULL;
		_tmp35_ = g_strdup ("");
		_g_free0 (self->presence_message);
		self->presence_message = _tmp35_;
	}
}


static void contacts_contact_update_filter_data (ContactsContact* self) {
	GString* builder = NULL;
	GString* _tmp0_ = NULL;
	FolksIndividual* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	FolksIndividual* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	FolksIndividual* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	const gchar* _tmp23_ = NULL;
	GeeMultiMap* im_addresses = NULL;
	FolksIndividual* _tmp31_ = NULL;
	GeeMultiMap* _tmp32_ = NULL;
	GeeMultiMap* _tmp33_ = NULL;
	GeeMultiMap* _tmp34_ = NULL;
	GeeSet* emails = NULL;
	FolksIndividual* _tmp53_ = NULL;
	GeeSet* _tmp54_ = NULL;
	GeeSet* _tmp55_ = NULL;
	GeeSet* _tmp56_ = NULL;
	GeeSet* phone_numbers = NULL;
	FolksIndividual* _tmp70_ = NULL;
	GeeSet* _tmp71_ = NULL;
	GeeSet* _tmp72_ = NULL;
	GeeSet* _tmp73_ = NULL;
	GString* _tmp87_ = NULL;
	const gchar* _tmp88_ = NULL;
	gchar* _tmp89_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_string_new ("");
	builder = _tmp0_;
	_tmp1_ = self->individual;
	_tmp2_ = folks_alias_details_get_alias ((FolksAliasDetails*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		GString* _tmp4_ = NULL;
		FolksIndividual* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		GString* _tmp10_ = NULL;
		_tmp4_ = builder;
		_tmp5_ = self->individual;
		_tmp6_ = folks_alias_details_get_alias ((FolksAliasDetails*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = contacts_utils_canonicalize_for_search (_tmp7_);
		_tmp9_ = _tmp8_;
		g_string_append (_tmp4_, _tmp9_);
		_g_free0 (_tmp9_);
		_tmp10_ = builder;
		g_string_append_unichar (_tmp10_, (gunichar) ' ');
	}
	_tmp11_ = self->individual;
	_tmp12_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_ != NULL) {
		GString* _tmp14_ = NULL;
		FolksIndividual* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		gchar* _tmp18_ = NULL;
		gchar* _tmp19_ = NULL;
		GString* _tmp20_ = NULL;
		_tmp14_ = builder;
		_tmp15_ = self->individual;
		_tmp16_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = contacts_utils_canonicalize_for_search (_tmp17_);
		_tmp19_ = _tmp18_;
		g_string_append (_tmp14_, _tmp19_);
		_g_free0 (_tmp19_);
		_tmp20_ = builder;
		g_string_append_unichar (_tmp20_, (gunichar) ' ');
	}
	_tmp21_ = self->individual;
	_tmp22_ = folks_name_details_get_nickname ((FolksNameDetails*) _tmp21_);
	_tmp23_ = _tmp22_;
	if (_tmp23_ != NULL) {
		GString* _tmp24_ = NULL;
		FolksIndividual* _tmp25_ = NULL;
		const gchar* _tmp26_ = NULL;
		const gchar* _tmp27_ = NULL;
		gchar* _tmp28_ = NULL;
		gchar* _tmp29_ = NULL;
		GString* _tmp30_ = NULL;
		_tmp24_ = builder;
		_tmp25_ = self->individual;
		_tmp26_ = folks_name_details_get_nickname ((FolksNameDetails*) _tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = contacts_utils_canonicalize_for_search (_tmp27_);
		_tmp29_ = _tmp28_;
		g_string_append (_tmp24_, _tmp29_);
		_g_free0 (_tmp29_);
		_tmp30_ = builder;
		g_string_append_unichar (_tmp30_, (gunichar) ' ');
	}
	_tmp31_ = self->individual;
	_tmp32_ = folks_im_details_get_im_addresses ((FolksImDetails*) _tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = _g_object_ref0 (_tmp33_);
	im_addresses = _tmp34_;
	{
		GeeIterator* _detail_it = NULL;
		GeeMultiMap* _tmp35_ = NULL;
		GeeCollection* _tmp36_ = NULL;
		GeeCollection* _tmp37_ = NULL;
		GeeIterator* _tmp38_ = NULL;
		GeeIterator* _tmp39_ = NULL;
		_tmp35_ = im_addresses;
		_tmp36_ = gee_multi_map_get_values (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp38_ = gee_iterable_iterator ((GeeIterable*) _tmp37_);
		_tmp39_ = _tmp38_;
		_g_object_unref0 (_tmp37_);
		_detail_it = _tmp39_;
		while (TRUE) {
			GeeIterator* _tmp40_ = NULL;
			gboolean _tmp41_ = FALSE;
			FolksImFieldDetails* detail = NULL;
			GeeIterator* _tmp42_ = NULL;
			gpointer _tmp43_ = NULL;
			gchar* addr = NULL;
			FolksImFieldDetails* _tmp44_ = NULL;
			gconstpointer _tmp45_ = NULL;
			const gchar* _tmp46_ = NULL;
			gchar* _tmp47_ = NULL;
			GString* _tmp48_ = NULL;
			const gchar* _tmp49_ = NULL;
			gchar* _tmp50_ = NULL;
			gchar* _tmp51_ = NULL;
			GString* _tmp52_ = NULL;
			_tmp40_ = _detail_it;
			_tmp41_ = gee_iterator_next (_tmp40_);
			if (!_tmp41_) {
				break;
			}
			_tmp42_ = _detail_it;
			_tmp43_ = gee_iterator_get (_tmp42_);
			detail = (FolksImFieldDetails*) _tmp43_;
			_tmp44_ = detail;
			_tmp45_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp44_);
			_tmp46_ = _tmp45_;
			_tmp47_ = g_strdup ((const gchar*) _tmp46_);
			addr = _tmp47_;
			_tmp48_ = builder;
			_tmp49_ = addr;
			_tmp50_ = g_utf8_casefold (_tmp49_, (gssize) -1);
			_tmp51_ = _tmp50_;
			g_string_append (_tmp48_, _tmp51_);
			_g_free0 (_tmp51_);
			_tmp52_ = builder;
			g_string_append_unichar (_tmp52_, (gunichar) ' ');
			_g_free0 (addr);
			_g_object_unref0 (detail);
		}
		_g_object_unref0 (_detail_it);
	}
	_tmp53_ = self->individual;
	_tmp54_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp53_);
	_tmp55_ = _tmp54_;
	_tmp56_ = _g_object_ref0 (_tmp55_);
	emails = _tmp56_;
	{
		GeeIterator* _email_it = NULL;
		GeeSet* _tmp57_ = NULL;
		GeeIterator* _tmp58_ = NULL;
		_tmp57_ = emails;
		_tmp58_ = gee_iterable_iterator ((GeeIterable*) _tmp57_);
		_email_it = _tmp58_;
		while (TRUE) {
			GeeIterator* _tmp59_ = NULL;
			gboolean _tmp60_ = FALSE;
			FolksEmailFieldDetails* email = NULL;
			GeeIterator* _tmp61_ = NULL;
			gpointer _tmp62_ = NULL;
			GString* _tmp63_ = NULL;
			FolksEmailFieldDetails* _tmp64_ = NULL;
			gconstpointer _tmp65_ = NULL;
			const gchar* _tmp66_ = NULL;
			gchar* _tmp67_ = NULL;
			gchar* _tmp68_ = NULL;
			GString* _tmp69_ = NULL;
			_tmp59_ = _email_it;
			_tmp60_ = gee_iterator_next (_tmp59_);
			if (!_tmp60_) {
				break;
			}
			_tmp61_ = _email_it;
			_tmp62_ = gee_iterator_get (_tmp61_);
			email = (FolksEmailFieldDetails*) _tmp62_;
			_tmp63_ = builder;
			_tmp64_ = email;
			_tmp65_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp64_);
			_tmp66_ = _tmp65_;
			_tmp67_ = g_utf8_casefold ((const gchar*) _tmp66_, (gssize) -1);
			_tmp68_ = _tmp67_;
			g_string_append (_tmp63_, _tmp68_);
			_g_free0 (_tmp68_);
			_tmp69_ = builder;
			g_string_append_unichar (_tmp69_, (gunichar) ' ');
			_g_object_unref0 (email);
		}
		_g_object_unref0 (_email_it);
	}
	_tmp70_ = self->individual;
	_tmp71_ = folks_phone_details_get_phone_numbers ((FolksPhoneDetails*) _tmp70_);
	_tmp72_ = _tmp71_;
	_tmp73_ = _g_object_ref0 (_tmp72_);
	phone_numbers = _tmp73_;
	{
		GeeIterator* _phone_it = NULL;
		GeeSet* _tmp74_ = NULL;
		GeeIterator* _tmp75_ = NULL;
		_tmp74_ = phone_numbers;
		_tmp75_ = gee_iterable_iterator ((GeeIterable*) _tmp74_);
		_phone_it = _tmp75_;
		while (TRUE) {
			GeeIterator* _tmp76_ = NULL;
			gboolean _tmp77_ = FALSE;
			FolksPhoneFieldDetails* phone = NULL;
			GeeIterator* _tmp78_ = NULL;
			gpointer _tmp79_ = NULL;
			GString* _tmp80_ = NULL;
			FolksPhoneFieldDetails* _tmp81_ = NULL;
			gconstpointer _tmp82_ = NULL;
			const gchar* _tmp83_ = NULL;
			gchar* _tmp84_ = NULL;
			gchar* _tmp85_ = NULL;
			GString* _tmp86_ = NULL;
			_tmp76_ = _phone_it;
			_tmp77_ = gee_iterator_next (_tmp76_);
			if (!_tmp77_) {
				break;
			}
			_tmp78_ = _phone_it;
			_tmp79_ = gee_iterator_get (_tmp78_);
			phone = (FolksPhoneFieldDetails*) _tmp79_;
			_tmp80_ = builder;
			_tmp81_ = phone;
			_tmp82_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp81_);
			_tmp83_ = _tmp82_;
			_tmp84_ = g_utf8_casefold ((const gchar*) _tmp83_, (gssize) -1);
			_tmp85_ = _tmp84_;
			g_string_append (_tmp80_, _tmp85_);
			_g_free0 (_tmp85_);
			_tmp86_ = builder;
			g_string_append_unichar (_tmp86_, (gunichar) ' ');
			_g_object_unref0 (phone);
		}
		_g_object_unref0 (_phone_it);
	}
	_tmp87_ = builder;
	_tmp88_ = _tmp87_->str;
	_tmp89_ = g_strdup (_tmp88_);
	_g_free0 (self->priv->filter_data);
	self->priv->filter_data = _tmp89_;
	_g_object_unref0 (phone_numbers);
	_g_object_unref0 (emails);
	_g_object_unref0 (im_addresses);
	_g_string_free0 (builder);
}


static void contacts_contact_update (ContactsContact* self) {
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _email_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_email_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksEmailFieldDetails* email = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			ContactsTypeSet* _tmp8_ = NULL;
			ContactsTypeSet* _tmp9_ = NULL;
			FolksEmailFieldDetails* _tmp10_ = NULL;
			_tmp4_ = _email_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _email_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			email = (FolksEmailFieldDetails*) _tmp7_;
			_tmp8_ = contacts_typeset_get_general ();
			_tmp9_ = _tmp8_;
			_tmp10_ = email;
			contacts_typeset_type_seen (_tmp9_, (FolksAbstractFieldDetails*) _tmp10_);
			_g_object_unref0 (email);
		}
		_g_object_unref0 (_email_it);
	}
	{
		GeeIterator* _phone_it = NULL;
		FolksIndividual* _tmp11_ = NULL;
		GeeSet* _tmp12_ = NULL;
		GeeSet* _tmp13_ = NULL;
		GeeIterator* _tmp14_ = NULL;
		_tmp11_ = self->individual;
		_tmp12_ = folks_phone_details_get_phone_numbers ((FolksPhoneDetails*) _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
		_phone_it = _tmp14_;
		while (TRUE) {
			GeeIterator* _tmp15_ = NULL;
			gboolean _tmp16_ = FALSE;
			FolksPhoneFieldDetails* phone = NULL;
			GeeIterator* _tmp17_ = NULL;
			gpointer _tmp18_ = NULL;
			ContactsTypeSet* _tmp19_ = NULL;
			ContactsTypeSet* _tmp20_ = NULL;
			FolksPhoneFieldDetails* _tmp21_ = NULL;
			_tmp15_ = _phone_it;
			_tmp16_ = gee_iterator_next (_tmp15_);
			if (!_tmp16_) {
				break;
			}
			_tmp17_ = _phone_it;
			_tmp18_ = gee_iterator_get (_tmp17_);
			phone = (FolksPhoneFieldDetails*) _tmp18_;
			_tmp19_ = contacts_typeset_get_phone ();
			_tmp20_ = _tmp19_;
			_tmp21_ = phone;
			contacts_typeset_type_seen (_tmp20_, (FolksAbstractFieldDetails*) _tmp21_);
			_g_object_unref0 (phone);
		}
		_g_object_unref0 (_phone_it);
	}
	contacts_contact_update_presence (self);
	contacts_contact_update_filter_data (self);
}


static GdkPixbuf* contacts_contact_load_icon (ContactsContact* self, GLoadableIcon* file, gint size) {
	GdkPixbuf* result = NULL;
	GdkPixbuf* res = NULL;
	GLoadableIcon* _tmp0_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	res = NULL;
	_tmp0_ = file;
	if (_tmp0_ != NULL) {
		{
			GCancellable* c = NULL;
			GCancellable* _tmp1_ = NULL;
			GInputStream* stream = NULL;
			GLoadableIcon* _tmp2_ = NULL;
			gint _tmp3_ = 0;
			GCancellable* _tmp4_ = NULL;
			GInputStream* _tmp5_ = NULL;
			GdkPixbuf* _tmp6_ = NULL;
			GInputStream* _tmp7_ = NULL;
			gint _tmp8_ = 0;
			gint _tmp9_ = 0;
			GCancellable* _tmp10_ = NULL;
			GdkPixbuf* _tmp11_ = NULL;
			GdkPixbuf* _tmp12_ = NULL;
			_tmp1_ = g_cancellable_new ();
			c = _tmp1_;
			_tmp2_ = file;
			_tmp3_ = size;
			_tmp4_ = c;
			_tmp5_ = g_loadable_icon_load (_tmp2_, _tmp3_, NULL, _tmp4_, &_inner_error_);
			stream = _tmp5_;
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				_g_object_unref0 (c);
				goto __catch4_g_error;
			}
			_tmp7_ = stream;
			_tmp8_ = size;
			_tmp9_ = size;
			_tmp10_ = c;
			_tmp11_ = gdk_pixbuf_new_from_stream_at_scale (_tmp7_, _tmp8_, _tmp9_, TRUE, _tmp10_, &_inner_error_);
			_tmp6_ = _tmp11_;
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				_g_object_unref0 (stream);
				_g_object_unref0 (c);
				goto __catch4_g_error;
			}
			_tmp12_ = _tmp6_;
			_tmp6_ = NULL;
			_g_object_unref0 (res);
			res = _tmp12_;
			_g_object_unref0 (_tmp6_);
			_g_object_unref0 (stream);
			_g_object_unref0 (c);
		}
		goto __finally4;
		__catch4_g_error:
		{
			GError* e = NULL;
			GError* _tmp13_ = NULL;
			const gchar* _tmp14_ = NULL;
			e = _inner_error_;
			_inner_error_ = NULL;
			_tmp13_ = e;
			_tmp14_ = _tmp13_->message;
			g_warning ("contacts-contact.vala:959: error loading avatar %s\n", _tmp14_);
			_g_error_free0 (e);
		}
		__finally4:
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_object_unref0 (res);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	result = res;
	return result;
}


GdkPixbuf* contacts_contact_frame_icon (GdkPixbuf* icon) {
	GdkPixbuf* result = NULL;
	gint w = 0;
	GdkPixbuf* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gint h = 0;
	GdkPixbuf* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	cairo_surface_t* cst = NULL;
	cairo_surface_t* _tmp4_ = NULL;
	cairo_t* cr = NULL;
	cairo_t* _tmp5_ = NULL;
	GdkPixbuf* _tmp6_ = NULL;
	GdkPixbuf* _tmp7_ = NULL;
	g_return_val_if_fail (icon != NULL, NULL);
	_tmp0_ = icon;
	_tmp1_ = gdk_pixbuf_get_width (_tmp0_);
	w = _tmp1_;
	_tmp2_ = icon;
	_tmp3_ = gdk_pixbuf_get_height (_tmp2_);
	h = _tmp3_;
	_tmp4_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, w, h);
	cst = _tmp4_;
	_tmp5_ = cairo_create (cst);
	cr = _tmp5_;
	cairo_set_source_rgba (cr, (gdouble) 0, (gdouble) 0, (gdouble) 0, (gdouble) 0);
	cairo_rectangle (cr, (gdouble) 0, (gdouble) 0, (gdouble) w, (gdouble) h);
	cairo_fill (cr);
	_tmp6_ = icon;
	gdk_cairo_set_source_pixbuf (cr, _tmp6_, (gdouble) 0, (gdouble) 0);
	contacts_utils_cairo_rounded_box (cr, 0, 0, w, h, 4);
	cairo_fill (cr);
	_tmp7_ = gdk_pixbuf_get_from_surface (cst, 0, 0, w, h);
	result = _tmp7_;
	_cairo_destroy0 (cr);
	_cairo_surface_destroy0 (cst);
	return result;
}


GdkPixbuf* contacts_contact_draw_fallback_avatar (gint size, ContactsContact* contact) {
	GdkPixbuf* result = NULL;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_ = 0;
	GdkPixbuf* pixbuf = NULL;
	gint _tmp42_ = 0;
	GdkPixbuf* _tmp45_ = NULL;
	cairo_surface_t* cst = NULL;
	gint _tmp46_ = 0;
	gint _tmp47_ = 0;
	cairo_surface_t* _tmp48_ = NULL;
	cairo_surface_t* _tmp49_ = NULL;
	gint _tmp50_ = 0;
	gint _tmp51_ = 0;
	GdkPixbuf* _tmp52_ = NULL;
	GError * _inner_error_ = NULL;
	_tmp1_ = size;
	if (_tmp1_ == CONTACTS_CONTACT_SMALL_AVATAR_SIZE) {
		GdkPixbuf* _tmp2_ = NULL;
		_tmp2_ = contacts_contact_fallback_pixbuf_default;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GdkPixbuf* _tmp3_ = NULL;
		GdkPixbuf* _tmp4_ = NULL;
		_tmp3_ = contacts_contact_fallback_pixbuf_default;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		result = _tmp4_;
		return result;
	}
	pixbuf = NULL;
	{
		cairo_surface_t* cst = NULL;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		cairo_surface_t* _tmp7_ = NULL;
		cairo_t* cr = NULL;
		cairo_surface_t* _tmp8_ = NULL;
		cairo_t* _tmp9_ = NULL;
		cairo_pattern_t* pat = NULL;
		gint _tmp10_ = 0;
		cairo_pattern_t* _tmp11_ = NULL;
		cairo_pattern_t* _tmp12_ = NULL;
		cairo_pattern_t* _tmp13_ = NULL;
		cairo_t* _tmp14_ = NULL;
		cairo_pattern_t* _tmp15_ = NULL;
		cairo_t* _tmp16_ = NULL;
		gint avatar_size = 0;
		gint _tmp17_ = 0;
		GtkIconInfo* icon_info = NULL;
		GtkIconTheme* _tmp18_ = NULL;
		gint _tmp19_ = 0;
		GtkIconInfo* _tmp20_ = NULL;
		GtkIconInfo* _tmp21_ = NULL;
		cairo_surface_t* _tmp38_ = NULL;
		gint _tmp39_ = 0;
		gint _tmp40_ = 0;
		GdkPixbuf* _tmp41_ = NULL;
		_tmp5_ = size;
		_tmp6_ = size;
		_tmp7_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp5_, _tmp6_);
		cst = _tmp7_;
		_tmp8_ = cst;
		_tmp9_ = cairo_create (_tmp8_);
		cr = _tmp9_;
		_tmp10_ = size;
		_tmp11_ = cairo_pattern_create_linear ((gdouble) 0, (gdouble) 0, (gdouble) 0, (gdouble) _tmp10_);
		pat = _tmp11_;
		_tmp12_ = pat;
		cairo_pattern_add_color_stop_rgb (_tmp12_, (gdouble) 0, 0.937, 0.937, 0.937);
		_tmp13_ = pat;
		cairo_pattern_add_color_stop_rgb (_tmp13_, (gdouble) 1, 0.969, 0.969, 0.969);
		_tmp14_ = cr;
		_tmp15_ = pat;
		cairo_set_source (_tmp14_, _tmp15_);
		_tmp16_ = cr;
		cairo_paint (_tmp16_);
		_tmp17_ = size;
		avatar_size = (gint) (_tmp17_ * 0.3);
		_tmp18_ = gtk_icon_theme_get_default ();
		_tmp19_ = avatar_size;
		_tmp20_ = gtk_icon_theme_lookup_icon (_tmp18_, "avatar-default-symbolic", _tmp19_, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
		icon_info = _tmp20_;
		_tmp21_ = icon_info;
		if (_tmp21_ != NULL) {
			GdkPixbuf* _tmp22_ = NULL;
			GtkIconInfo* _tmp23_ = NULL;
			GdkPixbuf* _tmp24_ = NULL;
			cairo_t* _tmp25_ = NULL;
			gint _tmp26_ = 0;
			gint _tmp27_ = 0;
			gint _tmp28_ = 0;
			gint _tmp29_ = 0;
			cairo_t* _tmp30_ = NULL;
			gint _tmp31_ = 0;
			gint _tmp32_ = 0;
			gint _tmp33_ = 0;
			gint _tmp34_ = 0;
			gint _tmp35_ = 0;
			gint _tmp36_ = 0;
			cairo_t* _tmp37_ = NULL;
			_tmp23_ = icon_info;
			_tmp24_ = gtk_icon_info_load_icon (_tmp23_, &_inner_error_);
			_tmp22_ = _tmp24_;
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				_gtk_icon_info_free0 (icon_info);
				_cairo_pattern_destroy0 (pat);
				_cairo_destroy0 (cr);
				_cairo_surface_destroy0 (cst);
				goto __catch5_g_error;
			}
			_tmp25_ = cr;
			_tmp26_ = size;
			_tmp27_ = avatar_size;
			_tmp28_ = size;
			_tmp29_ = avatar_size;
			gdk_cairo_set_source_pixbuf (_tmp25_, _tmp22_, (gdouble) ((_tmp26_ - _tmp27_) / 2), (gdouble) ((_tmp28_ - _tmp29_) / 2));
			_tmp30_ = cr;
			_tmp31_ = size;
			_tmp32_ = avatar_size;
			_tmp33_ = size;
			_tmp34_ = avatar_size;
			_tmp35_ = avatar_size;
			_tmp36_ = avatar_size;
			cairo_rectangle (_tmp30_, (gdouble) ((_tmp31_ - _tmp32_) / 2), (gdouble) ((_tmp33_ - _tmp34_) / 2), (gdouble) _tmp35_, (gdouble) _tmp36_);
			_tmp37_ = cr;
			cairo_fill (_tmp37_);
			_g_object_unref0 (_tmp22_);
		}
		_tmp38_ = cst;
		_tmp39_ = size;
		_tmp40_ = size;
		_tmp41_ = gdk_pixbuf_get_from_surface (_tmp38_, 0, 0, _tmp39_, _tmp40_);
		_g_object_unref0 (pixbuf);
		pixbuf = _tmp41_;
		_gtk_icon_info_free0 (icon_info);
		_cairo_pattern_destroy0 (pat);
		_cairo_destroy0 (cr);
		_cairo_surface_destroy0 (cst);
	}
	goto __finally5;
	__catch5_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally5:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (pixbuf);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp42_ = size;
	if (_tmp42_ == CONTACTS_CONTACT_SMALL_AVATAR_SIZE) {
		GdkPixbuf* _tmp43_ = NULL;
		GdkPixbuf* _tmp44_ = NULL;
		_tmp43_ = pixbuf;
		_tmp44_ = _g_object_ref0 (_tmp43_);
		_g_object_unref0 (contacts_contact_fallback_pixbuf_default);
		contacts_contact_fallback_pixbuf_default = _tmp44_;
	}
	_tmp45_ = pixbuf;
	if (_tmp45_ != NULL) {
		result = pixbuf;
		return result;
	}
	_tmp46_ = size;
	_tmp47_ = size;
	_tmp48_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp46_, _tmp47_);
	cst = _tmp48_;
	_tmp49_ = cst;
	_tmp50_ = size;
	_tmp51_ = size;
	_tmp52_ = gdk_pixbuf_get_from_surface (_tmp49_, 0, 0, _tmp50_, _tmp51_);
	result = _tmp52_;
	_cairo_surface_destroy0 (cst);
	_g_object_unref0 (pixbuf);
	return result;
}


gboolean contacts_contact_can_remove_personas (ContactsContact* self) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			FolksPersona* _tmp9_ = NULL;
			FolksPersonaStore* _tmp10_ = NULL;
			FolksPersonaStore* _tmp11_ = NULL;
			FolksMaybeBool _tmp12_ = 0;
			FolksMaybeBool _tmp13_ = 0;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp9_ = p;
			_tmp10_ = folks_persona_get_store (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = folks_persona_store_get_can_remove_personas (_tmp11_);
			_tmp13_ = _tmp12_;
			if (_tmp13_ == FOLKS_MAYBE_BOOL_TRUE) {
				FolksPersona* _tmp14_ = NULL;
				_tmp14_ = p;
				_tmp8_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, TPF_TYPE_PERSONA);
			} else {
				_tmp8_ = FALSE;
			}
			if (_tmp8_) {
				result = TRUE;
				_g_object_unref0 (p);
				_g_object_unref0 (_p_it);
				return result;
			}
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	result = FALSE;
	return result;
}


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


void contacts_contact_remove_personas (ContactsContact* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsContactRemovePersonasData* _data_;
	ContactsContact* _tmp0_ = NULL;
	_data_ = g_slice_new0 (ContactsContactRemovePersonasData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, contacts_contact_remove_personas);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_contact_remove_personas_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	contacts_contact_remove_personas_co (_data_);
}


void contacts_contact_remove_personas_finish (ContactsContact* self, GAsyncResult* _res_, GError** error) {
	ContactsContactRemovePersonasData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void contacts_contact_remove_personas_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ContactsContactRemovePersonasData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_contact_remove_personas_co (_data_);
}


static gboolean contacts_contact_remove_personas_co (ContactsContactRemovePersonasData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = gee_hash_set_new (FOLKS_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->personas = _data_->_tmp0_;
	{
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _data_->self->individual;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = folks_individual_get_personas (_data_->_tmp1_);
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp3_);
		_data_->_p_it = _data_->_tmp4_;
		while (TRUE) {
			_data_->_tmp5_ = NULL;
			_data_->_tmp5_ = _data_->_p_it;
			_data_->_tmp6_ = FALSE;
			_data_->_tmp6_ = gee_iterator_next (_data_->_tmp5_);
			if (!_data_->_tmp6_) {
				break;
			}
			_data_->_tmp7_ = NULL;
			_data_->_tmp7_ = _data_->_p_it;
			_data_->_tmp8_ = NULL;
			_data_->_tmp8_ = gee_iterator_get (_data_->_tmp7_);
			_data_->p = (FolksPersona*) _data_->_tmp8_;
			_data_->_tmp10_ = NULL;
			_data_->_tmp10_ = _data_->p;
			_data_->_tmp11_ = NULL;
			_data_->_tmp11_ = folks_persona_get_store (_data_->_tmp10_);
			_data_->_tmp12_ = NULL;
			_data_->_tmp12_ = _data_->_tmp11_;
			_data_->_tmp13_ = 0;
			_data_->_tmp13_ = folks_persona_store_get_can_remove_personas (_data_->_tmp12_);
			_data_->_tmp14_ = 0;
			_data_->_tmp14_ = _data_->_tmp13_;
			if (_data_->_tmp14_ == FOLKS_MAYBE_BOOL_TRUE) {
				_data_->_tmp15_ = NULL;
				_data_->_tmp15_ = _data_->p;
				_data_->_tmp9_ = !G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp15_, TPF_TYPE_PERSONA);
			} else {
				_data_->_tmp9_ = FALSE;
			}
			if (_data_->_tmp9_) {
				_data_->_tmp16_ = NULL;
				_data_->_tmp16_ = _data_->personas;
				_data_->_tmp17_ = NULL;
				_data_->_tmp17_ = _data_->p;
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp16_, _data_->_tmp17_);
			}
			_g_object_unref0 (_data_->p);
		}
		_g_object_unref0 (_data_->_p_it);
	}
	{
		_data_->_tmp18_ = NULL;
		_data_->_tmp18_ = _data_->personas;
		_data_->_tmp19_ = NULL;
		_data_->_tmp19_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp18_);
		_data_->_persona_it = _data_->_tmp19_;
		while (TRUE) {
			_data_->_tmp20_ = NULL;
			_data_->_tmp20_ = _data_->_persona_it;
			_data_->_tmp21_ = FALSE;
			_data_->_tmp21_ = gee_iterator_next (_data_->_tmp20_);
			if (!_data_->_tmp21_) {
				break;
			}
			_data_->_tmp22_ = NULL;
			_data_->_tmp22_ = _data_->_persona_it;
			_data_->_tmp23_ = NULL;
			_data_->_tmp23_ = gee_iterator_get (_data_->_tmp22_);
			_data_->persona = (FolksPersona*) _data_->_tmp23_;
			_data_->_tmp24_ = NULL;
			_data_->_tmp24_ = _data_->persona;
			_data_->_tmp25_ = NULL;
			_data_->_tmp25_ = folks_persona_get_store (_data_->_tmp24_);
			_data_->_tmp26_ = NULL;
			_data_->_tmp26_ = _data_->_tmp25_;
			_data_->_tmp27_ = NULL;
			_data_->_tmp27_ = _data_->persona;
			_data_->_state_ = 1;
			folks_persona_store_remove_persona (_data_->_tmp26_, _data_->_tmp27_, contacts_contact_remove_personas_ready, _data_);
			return FALSE;
			_state_1:
			folks_persona_store_remove_persona_finish (_data_->_tmp26_, _data_->_res_, &_data_->_inner_error_);
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
				if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
					g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
					g_error_free (_data_->_inner_error_);
					_g_object_unref0 (_data_->persona);
					_g_object_unref0 (_data_->_persona_it);
					_g_object_unref0 (_data_->personas);
					if (_data_->_state_ == 0) {
						g_simple_async_result_complete_in_idle (_data_->_async_result);
					} else {
						g_simple_async_result_complete (_data_->_async_result);
					}
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_object_unref0 (_data_->persona);
					_g_object_unref0 (_data_->_persona_it);
					_g_object_unref0 (_data_->personas);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
					g_clear_error (&_data_->_inner_error_);
					return FALSE;
				}
			}
			_g_object_unref0 (_data_->persona);
		}
		_g_object_unref0 (_data_->_persona_it);
	}
	_g_object_unref0 (_data_->personas);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void contacts_contact_ensure_primary_persona_data_free (gpointer _data) {
	ContactsContactEnsurePrimaryPersonaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ContactsContactEnsurePrimaryPersonaData, _data_);
}


void contacts_contact_ensure_primary_persona (ContactsContact* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsContactEnsurePrimaryPersonaData* _data_;
	ContactsContact* _tmp0_ = NULL;
	_data_ = g_slice_new0 (ContactsContactEnsurePrimaryPersonaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, contacts_contact_ensure_primary_persona);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_contact_ensure_primary_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	contacts_contact_ensure_primary_persona_co (_data_);
}


FolksPersona* contacts_contact_ensure_primary_persona_finish (ContactsContact* self, GAsyncResult* _res_, GError** error) {
	FolksPersona* result;
	ContactsContactEnsurePrimaryPersonaData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void contacts_contact_ensure_primary_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ContactsContactEnsurePrimaryPersonaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_contact_ensure_primary_persona_co (_data_);
}


static gboolean contacts_contact_ensure_primary_persona_co (ContactsContactEnsurePrimaryPersonaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = contacts_contact_find_primary_persona (_data_->self);
	_data_->p = _data_->_tmp0_;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->p;
	if (_data_->_tmp1_ != NULL) {
		_data_->result = _data_->p;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = gee_hash_set_new (FOLKS_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->persona_set = _data_->_tmp2_;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->persona_set;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->self->individual;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = folks_individual_get_personas (_data_->_tmp4_);
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = _data_->_tmp5_;
	gee_collection_add_all ((GeeCollection*) _data_->_tmp3_, (GeeCollection*) _data_->_tmp6_);
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = _data_->persona_set;
	_data_->_tmp8_ = 0;
	_data_->_tmp8_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp7_);
	_data_->_tmp9_ = 0;
	_data_->_tmp9_ = _data_->_tmp8_;
	if (_data_->_tmp9_ == 1) {
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = _data_->persona_set;
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = contacts_fake_persona_new (_data_->self);
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = _data_->_tmp11_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp10_, (FolksPersona*) _data_->_tmp12_);
		_g_object_unref0 (_data_->_tmp12_);
	}
	_data_->_tmp13_ = NULL;
	_data_->_tmp13_ = _data_->self->store;
	_data_->_tmp14_ = NULL;
	_data_->_tmp14_ = contacts_store_get_aggregator (_data_->_tmp13_);
	_data_->_tmp15_ = NULL;
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = NULL;
	_data_->_tmp16_ = _data_->persona_set;
	_data_->_state_ = 1;
	folks_individual_aggregator_link_personas (_data_->_tmp15_, (GeeSet*) _data_->_tmp16_, contacts_contact_ensure_primary_persona_ready, _data_);
	return FALSE;
	_state_1:
	folks_individual_aggregator_link_personas_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		if (((_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->persona_set);
			_g_object_unref0 (_data_->p);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->persona_set);
			_g_object_unref0 (_data_->p);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp17_ = NULL;
	_data_->_tmp17_ = contacts_contact_find_primary_persona (_data_->self);
	_g_object_unref0 (_data_->p);
	_data_->p = _data_->_tmp17_;
	_data_->_tmp18_ = NULL;
	_data_->_tmp18_ = _data_->p;
	if (_data_->_tmp18_ == NULL) {
		_data_->_tmp19_ = NULL;
		_data_->_tmp19_ = _ ("Unexpected internal error: created contact was not found");
		_data_->_tmp20_ = NULL;
		_data_->_tmp20_ = g_error_new_literal (CONTACT_ERROR, CONTACT_ERROR_NO_PRIMARY, _data_->_tmp19_);
		_data_->_inner_error_ = _data_->_tmp20_;
		if (((_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->persona_set);
			_g_object_unref0 (_data_->p);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->persona_set);
			_g_object_unref0 (_data_->p);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->result = _data_->p;
	_g_object_unref0 (_data_->persona_set);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->persona_set);
	_g_object_unref0 (_data_->p);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


FolksPersona* contacts_contact_find_persona_from_store (ContactsContact* self, FolksPersonaStore* store) {
	FolksPersona* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (store != NULL, NULL);
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			FolksPersona* _tmp8_ = NULL;
			FolksPersonaStore* _tmp9_ = NULL;
			FolksPersonaStore* _tmp10_ = NULL;
			FolksPersonaStore* _tmp11_ = NULL;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp8_ = p;
			_tmp9_ = folks_persona_get_store (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = store;
			if (_tmp10_ == _tmp11_) {
				result = p;
				_g_object_unref0 (_p_it);
				return result;
			}
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	result = NULL;
	return result;
}


static gint __lambda6_ (ContactsContact* self, FolksPersona* a, FolksPersona* b) {
	gint result = 0;
	FolksPersona* persona_a = NULL;
	FolksPersona* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	FolksPersona* persona_b = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksPersona* _tmp3_ = NULL;
	FolksPersonaStore* store_a = NULL;
	FolksPersona* _tmp4_ = NULL;
	FolksPersonaStore* _tmp5_ = NULL;
	FolksPersonaStore* _tmp6_ = NULL;
	FolksPersonaStore* _tmp7_ = NULL;
	FolksPersonaStore* store_b = NULL;
	FolksPersona* _tmp8_ = NULL;
	FolksPersonaStore* _tmp9_ = NULL;
	FolksPersonaStore* _tmp10_ = NULL;
	FolksPersonaStore* _tmp11_ = NULL;
	FolksPersonaStore* _tmp12_ = NULL;
	FolksPersonaStore* _tmp13_ = NULL;
	gboolean _tmp26_ = FALSE;
	FolksPersonaStore* _tmp27_ = NULL;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	FolksPersonaStore* _tmp33_ = NULL;
	gboolean _tmp34_ = FALSE;
	gboolean _tmp35_ = FALSE;
	FolksPersonaStore* _tmp36_ = NULL;
	gboolean _tmp37_ = FALSE;
	gboolean _tmp38_ = FALSE;
	gboolean _tmp39_ = FALSE;
	FolksPersonaStore* _tmp40_ = NULL;
	const gchar* _tmp41_ = NULL;
	const gchar* _tmp42_ = NULL;
	FolksPersonaStore* _tmp54_ = NULL;
	const gchar* _tmp55_ = NULL;
	const gchar* _tmp56_ = NULL;
	FolksPersonaStore* _tmp57_ = NULL;
	const gchar* _tmp58_ = NULL;
	const gchar* _tmp59_ = NULL;
	GCompareFunc _tmp60_ = NULL;
	FolksPersonaStore* _tmp61_ = NULL;
	const gchar* _tmp62_ = NULL;
	const gchar* _tmp63_ = NULL;
	FolksPersonaStore* _tmp64_ = NULL;
	const gchar* _tmp65_ = NULL;
	const gchar* _tmp66_ = NULL;
	gint _tmp67_ = 0;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = a;
	_tmp1_ = _g_object_ref0 ((FolksPersona*) _tmp0_);
	persona_a = _tmp1_;
	_tmp2_ = b;
	_tmp3_ = _g_object_ref0 ((FolksPersona*) _tmp2_);
	persona_b = _tmp3_;
	_tmp4_ = persona_a;
	_tmp5_ = folks_persona_get_store (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	store_a = _tmp7_;
	_tmp8_ = persona_b;
	_tmp9_ = folks_persona_get_store (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _g_object_ref0 (_tmp10_);
	store_b = _tmp11_;
	_tmp12_ = store_a;
	_tmp13_ = store_b;
	if (_tmp12_ == _tmp13_) {
		FolksPersona* _tmp14_ = NULL;
		gboolean _tmp15_ = FALSE;
		_tmp14_ = persona_a;
		_tmp15_ = contacts_contact_persona_is_google (_tmp14_);
		if (_tmp15_) {
			gboolean _tmp16_ = FALSE;
			FolksPersona* _tmp17_ = NULL;
			gboolean _tmp18_ = FALSE;
			gboolean _tmp21_ = FALSE;
			FolksPersona* _tmp22_ = NULL;
			gboolean _tmp23_ = FALSE;
			_tmp17_ = persona_a;
			_tmp18_ = contacts_contact_persona_is_google_other (_tmp17_);
			if (_tmp18_) {
				FolksPersona* _tmp19_ = NULL;
				gboolean _tmp20_ = FALSE;
				_tmp19_ = persona_b;
				_tmp20_ = contacts_contact_persona_is_google_other (_tmp19_);
				_tmp16_ = !_tmp20_;
			} else {
				_tmp16_ = FALSE;
			}
			if (_tmp16_) {
				result = 1;
				_g_object_unref0 (store_b);
				_g_object_unref0 (store_a);
				_g_object_unref0 (persona_b);
				_g_object_unref0 (persona_a);
				return result;
			}
			_tmp22_ = persona_a;
			_tmp23_ = contacts_contact_persona_is_google_other (_tmp22_);
			if (!_tmp23_) {
				FolksPersona* _tmp24_ = NULL;
				gboolean _tmp25_ = FALSE;
				_tmp24_ = persona_b;
				_tmp25_ = contacts_contact_persona_is_google_other (_tmp24_);
				_tmp21_ = _tmp25_;
			} else {
				_tmp21_ = FALSE;
			}
			if (_tmp21_) {
				result = -1;
				_g_object_unref0 (store_b);
				_g_object_unref0 (store_a);
				_g_object_unref0 (persona_b);
				_g_object_unref0 (persona_a);
				return result;
			}
		}
		result = 0;
		_g_object_unref0 (store_b);
		_g_object_unref0 (store_a);
		_g_object_unref0 (persona_b);
		_g_object_unref0 (persona_a);
		return result;
	}
	_tmp27_ = store_a;
	_tmp28_ = folks_persona_store_get_is_primary_store (_tmp27_);
	_tmp29_ = _tmp28_;
	if (_tmp29_) {
		FolksPersonaStore* _tmp30_ = NULL;
		gboolean _tmp31_ = FALSE;
		gboolean _tmp32_ = FALSE;
		_tmp30_ = store_b;
		_tmp31_ = folks_persona_store_get_is_primary_store (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp26_ = _tmp32_;
	} else {
		_tmp26_ = FALSE;
	}
	if (_tmp26_) {
		result = 0;
		_g_object_unref0 (store_b);
		_g_object_unref0 (store_a);
		_g_object_unref0 (persona_b);
		_g_object_unref0 (persona_a);
		return result;
	}
	_tmp33_ = store_a;
	_tmp34_ = folks_persona_store_get_is_primary_store (_tmp33_);
	_tmp35_ = _tmp34_;
	if (_tmp35_) {
		result = -1;
		_g_object_unref0 (store_b);
		_g_object_unref0 (store_a);
		_g_object_unref0 (persona_b);
		_g_object_unref0 (persona_a);
		return result;
	}
	_tmp36_ = store_b;
	_tmp37_ = folks_persona_store_get_is_primary_store (_tmp36_);
	_tmp38_ = _tmp37_;
	if (_tmp38_) {
		result = 1;
		_g_object_unref0 (store_b);
		_g_object_unref0 (store_a);
		_g_object_unref0 (persona_b);
		_g_object_unref0 (persona_a);
		return result;
	}
	_tmp40_ = store_a;
	_tmp41_ = folks_persona_store_get_type_id (_tmp40_);
	_tmp42_ = _tmp41_;
	if (g_strcmp0 (_tmp42_, "eds") == 0) {
		FolksPersonaStore* _tmp43_ = NULL;
		const gchar* _tmp44_ = NULL;
		const gchar* _tmp45_ = NULL;
		_tmp43_ = store_b;
		_tmp44_ = folks_persona_store_get_type_id (_tmp43_);
		_tmp45_ = _tmp44_;
		_tmp39_ = g_strcmp0 (_tmp45_, "eds") == 0;
	} else {
		_tmp39_ = FALSE;
	}
	if (_tmp39_) {
		GCompareFunc _tmp46_ = NULL;
		FolksPersonaStore* _tmp47_ = NULL;
		const gchar* _tmp48_ = NULL;
		const gchar* _tmp49_ = NULL;
		FolksPersonaStore* _tmp50_ = NULL;
		const gchar* _tmp51_ = NULL;
		const gchar* _tmp52_ = NULL;
		gint _tmp53_ = 0;
		_tmp46_ = g_strcmp0;
		_tmp47_ = store_a;
		_tmp48_ = folks_persona_store_get_id (_tmp47_);
		_tmp49_ = _tmp48_;
		_tmp50_ = store_b;
		_tmp51_ = folks_persona_store_get_id (_tmp50_);
		_tmp52_ = _tmp51_;
		_tmp53_ = _tmp46_ (_tmp49_, _tmp52_);
		result = _tmp53_;
		_g_object_unref0 (store_b);
		_g_object_unref0 (store_a);
		_g_object_unref0 (persona_b);
		_g_object_unref0 (persona_a);
		return result;
	}
	_tmp54_ = store_a;
	_tmp55_ = folks_persona_store_get_type_id (_tmp54_);
	_tmp56_ = _tmp55_;
	if (g_strcmp0 (_tmp56_, "eds") == 0) {
		result = -1;
		_g_object_unref0 (store_b);
		_g_object_unref0 (store_a);
		_g_object_unref0 (persona_b);
		_g_object_unref0 (persona_a);
		return result;
	}
	_tmp57_ = store_b;
	_tmp58_ = folks_persona_store_get_type_id (_tmp57_);
	_tmp59_ = _tmp58_;
	if (g_strcmp0 (_tmp59_, "eds") == 0) {
		result = 1;
		_g_object_unref0 (store_b);
		_g_object_unref0 (store_a);
		_g_object_unref0 (persona_b);
		_g_object_unref0 (persona_a);
		return result;
	}
	_tmp60_ = g_strcmp0;
	_tmp61_ = store_a;
	_tmp62_ = folks_persona_store_get_id (_tmp61_);
	_tmp63_ = _tmp62_;
	_tmp64_ = store_b;
	_tmp65_ = folks_persona_store_get_id (_tmp64_);
	_tmp66_ = _tmp65_;
	_tmp67_ = _tmp60_ (_tmp63_, _tmp66_);
	result = _tmp67_;
	_g_object_unref0 (store_b);
	_g_object_unref0 (store_a);
	_g_object_unref0 (persona_b);
	_g_object_unref0 (persona_a);
	return result;
}


static gint ___lambda6__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = __lambda6_ ((ContactsContact*) self, (FolksPersona*) a, (FolksPersona*) b);
	return result;
}


GeeList* contacts_contact_get_personas_for_display (ContactsContact* self) {
	GeeList* result = NULL;
	GCompareDataFunc compare_persona_by_store = NULL;
	void* compare_persona_by_store_target = NULL;
	GDestroyNotify compare_persona_by_store_target_destroy_notify = NULL;
	GeeArrayList* persona_list = NULL;
	GeeArrayList* _tmp0_ = NULL;
	gint i = 0;
	GeeArrayList* _tmp1_ = NULL;
	FolksIndividual* _tmp2_ = NULL;
	GeeSet* _tmp3_ = NULL;
	GeeSet* _tmp4_ = NULL;
	GeeArrayList* _tmp23_ = NULL;
	GCompareDataFunc _tmp24_ = NULL;
	void* _tmp24__target = NULL;
	GDestroyNotify _tmp24__target_destroy_notify = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	compare_persona_by_store = ___lambda6__gcompare_data_func;
	compare_persona_by_store_target = g_object_ref (self);
	compare_persona_by_store_target_destroy_notify = g_object_unref;
	_tmp0_ = gee_array_list_new (FOLKS_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	persona_list = _tmp0_;
	i = 0;
	_tmp1_ = persona_list;
	_tmp2_ = self->individual;
	_tmp3_ = folks_individual_get_personas (_tmp2_);
	_tmp4_ = _tmp3_;
	gee_array_list_add_all (_tmp1_, (GeeCollection*) _tmp4_);
	while (TRUE) {
		gint _tmp5_ = 0;
		GeeArrayList* _tmp6_ = NULL;
		gint _tmp7_ = 0;
		gint _tmp8_ = 0;
		GeeArrayList* _tmp9_ = NULL;
		gint _tmp10_ = 0;
		gpointer _tmp11_ = NULL;
		FolksPersona* _tmp12_ = NULL;
		FolksPersonaStore* _tmp13_ = NULL;
		FolksPersonaStore* _tmp14_ = NULL;
		const gchar* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		gboolean _tmp17_ = FALSE;
		_tmp5_ = i;
		_tmp6_ = persona_list;
		_tmp7_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp6_);
		_tmp8_ = _tmp7_;
		if (!(_tmp5_ < _tmp8_)) {
			break;
		}
		_tmp9_ = persona_list;
		_tmp10_ = i;
		_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _tmp10_);
		_tmp12_ = (FolksPersona*) _tmp11_;
		_tmp13_ = folks_persona_get_store (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = folks_persona_store_get_type_id (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = g_strcmp0 (_tmp16_, "key-file") == 0;
		_g_object_unref0 (_tmp12_);
		if (_tmp17_) {
			GeeArrayList* _tmp18_ = NULL;
			gint _tmp19_ = 0;
			gpointer _tmp20_ = NULL;
			FolksPersona* _tmp21_ = NULL;
			_tmp18_ = persona_list;
			_tmp19_ = i;
			_tmp20_ = gee_abstract_list_remove_at ((GeeAbstractList*) _tmp18_, _tmp19_);
			_tmp21_ = (FolksPersona*) _tmp20_;
			_g_object_unref0 (_tmp21_);
		} else {
			gint _tmp22_ = 0;
			_tmp22_ = i;
			i = _tmp22_ + 1;
		}
	}
	_tmp23_ = persona_list;
	_tmp24_ = compare_persona_by_store;
	_tmp24__target = compare_persona_by_store_target;
	_tmp24__target_destroy_notify = compare_persona_by_store_target_destroy_notify;
	compare_persona_by_store_target_destroy_notify = NULL;
	gee_list_sort ((GeeList*) _tmp23_, _tmp24_, _tmp24__target, _tmp24__target_destroy_notify);
	result = (GeeList*) persona_list;
	(compare_persona_by_store_target_destroy_notify == NULL) ? NULL : (compare_persona_by_store_target_destroy_notify (compare_persona_by_store_target), NULL);
	compare_persona_by_store = NULL;
	compare_persona_by_store_target = NULL;
	compare_persona_by_store_target_destroy_notify = NULL;
	return result;
}


FolksPersona* contacts_contact_find_primary_persona (ContactsContact* self) {
	FolksPersona* result = NULL;
	ContactsStore* _tmp0_ = NULL;
	FolksIndividualAggregator* _tmp1_ = NULL;
	FolksIndividualAggregator* _tmp2_ = NULL;
	FolksPersonaStore* _tmp3_ = NULL;
	FolksPersonaStore* _tmp4_ = NULL;
	ContactsStore* _tmp5_ = NULL;
	FolksIndividualAggregator* _tmp6_ = NULL;
	FolksIndividualAggregator* _tmp7_ = NULL;
	FolksPersonaStore* _tmp8_ = NULL;
	FolksPersonaStore* _tmp9_ = NULL;
	FolksPersona* _tmp10_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->store;
	_tmp1_ = contacts_store_get_aggregator (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = folks_individual_aggregator_get_primary_store (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp5_ = self->store;
	_tmp6_ = contacts_store_get_aggregator (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = folks_individual_aggregator_get_primary_store (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = contacts_contact_find_persona_from_store (self, _tmp9_);
	result = _tmp10_;
	return result;
}


FolksPersona* contacts_contact_find_persona_from_uid (ContactsContact* self, const gchar* uid) {
	FolksPersona* result = NULL;
	gboolean _tmp12_ = FALSE;
	const gchar* _tmp13_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (uid != NULL, NULL);
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			FolksPersona* _tmp8_ = NULL;
			const gchar* _tmp9_ = NULL;
			const gchar* _tmp10_ = NULL;
			const gchar* _tmp11_ = NULL;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp8_ = p;
			_tmp9_ = folks_persona_get_uid (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = uid;
			if (g_strcmp0 (_tmp10_, _tmp11_) == 0) {
				result = p;
				_g_object_unref0 (_p_it);
				return result;
			}
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	_tmp13_ = uid;
	if (g_strcmp0 (_tmp13_, "uid-fake-persona") == 0) {
		FolksPersona* _tmp14_ = NULL;
		_tmp14_ = self->fake_persona;
		_tmp12_ = _tmp14_ != NULL;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		FolksPersona* _tmp15_ = NULL;
		FolksPersona* _tmp16_ = NULL;
		_tmp15_ = self->fake_persona;
		_tmp16_ = _g_object_ref0 (_tmp15_);
		result = _tmp16_;
		return result;
	}
	result = NULL;
	return result;
}


gchar* contacts_contact_format_persona_stores (ContactsContact* self) {
	gchar* result = NULL;
	gchar* stores = NULL;
	gchar* _tmp0_ = NULL;
	gboolean first = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("");
	stores = _tmp0_;
	first = TRUE;
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		_tmp1_ = self->individual;
		_tmp2_ = folks_individual_get_personas (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_p_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_ = NULL;
			gboolean _tmp6_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp7_ = NULL;
			gpointer _tmp8_ = NULL;
			gboolean _tmp9_ = FALSE;
			const gchar* _tmp12_ = NULL;
			FolksPersona* _tmp13_ = NULL;
			gchar* _tmp14_ = NULL;
			gchar* _tmp15_ = NULL;
			gchar* _tmp16_ = NULL;
			_tmp5_ = _p_it;
			_tmp6_ = gee_iterator_next (_tmp5_);
			if (!_tmp6_) {
				break;
			}
			_tmp7_ = _p_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			p = (FolksPersona*) _tmp8_;
			_tmp9_ = first;
			if (!_tmp9_) {
				const gchar* _tmp10_ = NULL;
				gchar* _tmp11_ = NULL;
				_tmp10_ = stores;
				_tmp11_ = g_strconcat (_tmp10_, ", ", NULL);
				_g_free0 (stores);
				stores = _tmp11_;
			}
			_tmp12_ = stores;
			_tmp13_ = p;
			_tmp14_ = contacts_contact_format_persona_store_name_for_contact (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = g_strconcat (_tmp12_, _tmp15_, NULL);
			_g_free0 (stores);
			stores = _tmp16_;
			_g_free0 (_tmp15_);
			first = FALSE;
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	result = stores;
	return result;
}


gchar* contacts_contact_format_persona_store_name (FolksPersonaStore* store) {
	gchar* result = NULL;
	FolksPersonaStore* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	FolksPersonaStore* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	FolksPersonaStore* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	const gchar* _tmp23_ = NULL;
	gchar* _tmp24_ = NULL;
	g_return_val_if_fail (store != NULL, NULL);
	_tmp0_ = store;
	_tmp1_ = folks_persona_store_get_type_id (_tmp0_);
	_tmp2_ = _tmp1_;
	if (g_strcmp0 (_tmp2_, "eds") == 0) {
		const gchar* eds_name = NULL;
		FolksPersonaStore* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		const gchar* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		_tmp3_ = store;
		_tmp4_ = folks_persona_store_get_id (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = contacts_lookup_esource_name_by_uid (_tmp5_);
		eds_name = _tmp6_;
		_tmp7_ = eds_name;
		if (_tmp7_ != NULL) {
			const gchar* _tmp8_ = NULL;
			gchar* _tmp9_ = NULL;
			_tmp8_ = eds_name;
			_tmp9_ = g_strdup (_tmp8_);
			result = _tmp9_;
			return result;
		}
	}
	_tmp10_ = store;
	_tmp11_ = folks_persona_store_get_type_id (_tmp10_);
	_tmp12_ = _tmp11_;
	if (g_strcmp0 (_tmp12_, "telepathy") == 0) {
		TpAccount* account = NULL;
		FolksPersonaStore* _tmp13_ = NULL;
		TpAccount* _tmp14_ = NULL;
		TpAccount* _tmp15_ = NULL;
		TpAccount* _tmp16_ = NULL;
		TpAccount* _tmp17_ = NULL;
		const gchar* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		gchar* _tmp20_ = NULL;
		_tmp13_ = store;
		_tmp14_ = tpf_persona_store_get_account (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, TPF_TYPE_PERSONA_STORE) ? ((TpfPersonaStore*) _tmp13_) : NULL);
		_tmp15_ = _tmp14_;
		_tmp16_ = _g_object_ref0 (_tmp15_);
		account = _tmp16_;
		_tmp17_ = account;
		_tmp18_ = tp_account_get_service (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = contacts_contact_format_im_service (_tmp19_, NULL);
		result = _tmp20_;
		_g_object_unref0 (account);
		return result;
	}
	_tmp21_ = store;
	_tmp22_ = folks_persona_store_get_display_name (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = g_strdup (_tmp23_);
	result = _tmp24_;
	return result;
}


gboolean contacts_contact_has_mainable_persona (ContactsContact* self) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			FolksPersona* _tmp9_ = NULL;
			FolksPersonaStore* _tmp10_ = NULL;
			FolksPersonaStore* _tmp11_ = NULL;
			const gchar* _tmp12_ = NULL;
			const gchar* _tmp13_ = NULL;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp9_ = p;
			_tmp10_ = folks_persona_get_store (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = folks_persona_store_get_type_id (_tmp11_);
			_tmp13_ = _tmp12_;
			if (g_strcmp0 (_tmp13_, "eds") == 0) {
				FolksPersona* _tmp14_ = NULL;
				gboolean _tmp15_ = FALSE;
				_tmp14_ = p;
				_tmp15_ = contacts_contact_persona_is_google_other (_tmp14_);
				_tmp8_ = !_tmp15_;
			} else {
				_tmp8_ = FALSE;
			}
			if (_tmp8_) {
				result = TRUE;
				_g_object_unref0 (p);
				_g_object_unref0 (_p_it);
				return result;
			}
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	result = FALSE;
	return result;
}


static gboolean contacts_contact_non_linkable (ContactsContact* self) {
	gboolean result = FALSE;
	gboolean all_unlinkable = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	all_unlinkable = TRUE;
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			FolksPersona* _tmp9_ = NULL;
			gboolean _tmp10_ = FALSE;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp9_ = p;
			_tmp10_ = contacts_contact_persona_is_google_other (_tmp9_);
			if (!_tmp10_) {
				_tmp8_ = TRUE;
			} else {
				FolksPersona* _tmp11_ = NULL;
				gboolean _tmp12_ = FALSE;
				_tmp11_ = p;
				_tmp12_ = contacts_contact_persona_is_google_profile (_tmp11_);
				_tmp8_ = _tmp12_;
			}
			if (_tmp8_) {
				all_unlinkable = FALSE;
			}
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	result = all_unlinkable;
	return result;
}


gboolean contacts_contact_suggest_link_to (ContactsContact* self, ContactsContact* other) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ContactsStore* _tmp4_ = NULL;
	ContactsContact* _tmp5_ = NULL;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (other != NULL, FALSE);
	_tmp1_ = contacts_contact_non_linkable (self);
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ContactsContact* _tmp2_ = NULL;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = other;
		_tmp3_ = contacts_contact_non_linkable (_tmp2_);
		_tmp0_ = _tmp3_;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp4_ = self->store;
	_tmp5_ = other;
	_tmp6_ = contacts_store_may_suggest_link (_tmp4_, self, _tmp5_);
	if (!_tmp6_) {
		result = FALSE;
		return result;
	}
	_tmp8_ = self->is_main;
	if (!_tmp8_) {
		_tmp7_ = TRUE;
	} else {
		ContactsContact* _tmp9_ = NULL;
		gboolean _tmp10_ = FALSE;
		_tmp9_ = other;
		_tmp10_ = contacts_contact_has_mainable_persona (_tmp9_);
		_tmp7_ = !_tmp10_;
	}
	result = _tmp7_;
	return result;
}


static gboolean contacts_contact_persona_is_google (FolksPersona* persona) {
	gboolean result = FALSE;
	FolksPersonaStore* store = NULL;
	FolksPersona* _tmp0_ = NULL;
	FolksPersonaStore* _tmp1_ = NULL;
	FolksPersonaStore* _tmp2_ = NULL;
	FolksPersonaStore* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	FolksPersonaStore* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	g_return_val_if_fail (persona != NULL, FALSE);
	_tmp0_ = persona;
	_tmp1_ = folks_persona_get_store (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	store = _tmp3_;
	_tmp5_ = store;
	_tmp6_ = folks_persona_store_get_type_id (_tmp5_);
	_tmp7_ = _tmp6_;
	if (g_strcmp0 (_tmp7_, "eds") == 0) {
		FolksPersonaStore* _tmp8_ = NULL;
		const gchar* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		gboolean _tmp11_ = FALSE;
		_tmp8_ = store;
		_tmp9_ = folks_persona_store_get_id (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = contacts_esource_uid_is_google (_tmp10_);
		_tmp4_ = _tmp11_;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		result = TRUE;
		_g_object_unref0 (store);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (store);
	return result;
}


/**
   * Return true only for personas which are in a Google address book, but which
   * are not in the user's "My Contacts" group in the address book.
   */
gboolean contacts_contact_persona_is_google_other (FolksPersona* persona) {
	gboolean result = FALSE;
	FolksPersona* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	EdsfPersona* p = NULL;
	FolksPersona* _tmp2_ = NULL;
	EdsfPersona* _tmp3_ = NULL;
	EdsfPersona* _tmp4_ = NULL;
	g_return_val_if_fail (persona != NULL, FALSE);
	_tmp0_ = persona;
	_tmp1_ = contacts_contact_persona_is_google (_tmp0_);
	if (!_tmp1_) {
		result = FALSE;
		return result;
	}
	_tmp2_ = persona;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, EDSF_TYPE_PERSONA) ? ((EdsfPersona*) _tmp2_) : NULL);
	p = _tmp3_;
	_tmp4_ = p;
	if (_tmp4_ != NULL) {
		EdsfPersona* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		_tmp5_ = p;
		_tmp6_ = edsf_persona_get_in_google_personal_group (_tmp5_);
		_tmp7_ = _tmp6_;
		result = !_tmp7_;
		_g_object_unref0 (p);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (p);
	return result;
}


static inline GRegex* _thread_safe_regex_init (GRegex** re, const gchar * pattern, GRegexMatchFlags match_options) {
	if (g_once_init_enter ((volatile gsize*) re)) {
		GRegex* val = g_regex_new (pattern, match_options, 0, NULL);
		g_once_init_leave ((volatile gsize*) re, (gsize) val);
	}
	return *re;
}


gboolean contacts_contact_persona_is_google_profile (FolksPersona* persona) {
	gboolean result = FALSE;
	FolksPersona* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	FolksUrlDetails* u = NULL;
	FolksPersona* _tmp2_ = NULL;
	FolksUrlDetails* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	FolksUrlDetails* _tmp5_ = NULL;
	g_return_val_if_fail (persona != NULL, FALSE);
	_tmp0_ = persona;
	_tmp1_ = contacts_contact_persona_is_google_other (_tmp0_);
	if (!_tmp1_) {
		result = FALSE;
		return result;
	}
	_tmp2_ = persona;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, FOLKS_TYPE_URL_DETAILS) ? ((FolksUrlDetails*) _tmp2_) : NULL);
	u = _tmp3_;
	_tmp5_ = u;
	if (_tmp5_ != NULL) {
		FolksUrlDetails* _tmp6_ = NULL;
		GeeSet* _tmp7_ = NULL;
		GeeSet* _tmp8_ = NULL;
		gint _tmp9_ = 0;
		gint _tmp10_ = 0;
		_tmp6_ = u;
		_tmp7_ = folks_url_details_get_urls (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp4_ = _tmp10_ == 1;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		{
			GeeIterator* _url_it = NULL;
			FolksUrlDetails* _tmp11_ = NULL;
			GeeSet* _tmp12_ = NULL;
			GeeSet* _tmp13_ = NULL;
			GeeIterator* _tmp14_ = NULL;
			_tmp11_ = u;
			_tmp12_ = folks_url_details_get_urls (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
			_url_it = _tmp14_;
			while (TRUE) {
				GeeIterator* _tmp15_ = NULL;
				gboolean _tmp16_ = FALSE;
				FolksUrlFieldDetails* url = NULL;
				GeeIterator* _tmp17_ = NULL;
				gpointer _tmp18_ = NULL;
				FolksUrlFieldDetails* _tmp19_ = NULL;
				gconstpointer _tmp20_ = NULL;
				const gchar* _tmp21_ = NULL;
				gboolean _tmp22_ = FALSE;
				_tmp15_ = _url_it;
				_tmp16_ = gee_iterator_next (_tmp15_);
				if (!_tmp16_) {
					break;
				}
				_tmp17_ = _url_it;
				_tmp18_ = gee_iterator_get (_tmp17_);
				url = (FolksUrlFieldDetails*) _tmp18_;
				_tmp19_ = url;
				_tmp20_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = g_regex_match (_thread_safe_regex_init (&_tmp_regex_0, "https?:\\/\\/www.google.com\\/profiles\\/[0-9]+$", 0), (const gchar*) _tmp21_, 0, NULL);
				if (_tmp22_) {
					result = TRUE;
					_g_object_unref0 (url);
					_g_object_unref0 (_url_it);
					_g_object_unref0 (u);
					return result;
				}
				_g_object_unref0 (url);
			}
			_g_object_unref0 (_url_it);
		}
	}
	result = FALSE;
	_g_object_unref0 (u);
	return result;
}


gchar* contacts_contact_format_persona_store_name_for_contact (FolksPersona* persona) {
	gchar* result = NULL;
	FolksPersonaStore* store = NULL;
	FolksPersona* _tmp0_ = NULL;
	FolksPersonaStore* _tmp1_ = NULL;
	FolksPersonaStore* _tmp2_ = NULL;
	FolksPersonaStore* _tmp3_ = NULL;
	FolksPersonaStore* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	FolksPersonaStore* _tmp22_ = NULL;
	const gchar* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	FolksPersonaStore* _tmp33_ = NULL;
	const gchar* _tmp34_ = NULL;
	const gchar* _tmp35_ = NULL;
	gchar* _tmp36_ = NULL;
	g_return_val_if_fail (persona != NULL, NULL);
	_tmp0_ = persona;
	_tmp1_ = folks_persona_get_store (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	store = _tmp3_;
	_tmp4_ = store;
	_tmp5_ = folks_persona_store_get_type_id (_tmp4_);
	_tmp6_ = _tmp5_;
	if (g_strcmp0 (_tmp6_, "eds") == 0) {
		FolksPersona* _tmp7_ = NULL;
		gboolean _tmp8_ = FALSE;
		const gchar* eds_name = NULL;
		FolksPersonaStore* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
		const gchar* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		_tmp7_ = persona;
		_tmp8_ = contacts_contact_persona_is_google_profile (_tmp7_);
		if (_tmp8_) {
			const gchar* _tmp9_ = NULL;
			gchar* _tmp10_ = NULL;
			_tmp9_ = _ ("Google Circles");
			_tmp10_ = g_strdup (_tmp9_);
			result = _tmp10_;
			_g_object_unref0 (store);
			return result;
		} else {
			FolksPersona* _tmp11_ = NULL;
			gboolean _tmp12_ = FALSE;
			_tmp11_ = persona;
			_tmp12_ = contacts_contact_persona_is_google_other (_tmp11_);
			if (_tmp12_) {
				const gchar* _tmp13_ = NULL;
				gchar* _tmp14_ = NULL;
				_tmp13_ = _ ("Google");
				_tmp14_ = g_strdup (_tmp13_);
				result = _tmp14_;
				_g_object_unref0 (store);
				return result;
			}
		}
		_tmp15_ = store;
		_tmp16_ = folks_persona_store_get_id (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = contacts_lookup_esource_name_by_uid_for_contact (_tmp17_);
		eds_name = _tmp18_;
		_tmp19_ = eds_name;
		if (_tmp19_ != NULL) {
			const gchar* _tmp20_ = NULL;
			gchar* _tmp21_ = NULL;
			_tmp20_ = eds_name;
			_tmp21_ = g_strdup (_tmp20_);
			result = _tmp21_;
			_g_object_unref0 (store);
			return result;
		}
	}
	_tmp22_ = store;
	_tmp23_ = folks_persona_store_get_type_id (_tmp22_);
	_tmp24_ = _tmp23_;
	if (g_strcmp0 (_tmp24_, "telepathy") == 0) {
		TpAccount* account = NULL;
		FolksPersonaStore* _tmp25_ = NULL;
		TpAccount* _tmp26_ = NULL;
		TpAccount* _tmp27_ = NULL;
		TpAccount* _tmp28_ = NULL;
		TpAccount* _tmp29_ = NULL;
		const gchar* _tmp30_ = NULL;
		const gchar* _tmp31_ = NULL;
		gchar* _tmp32_ = NULL;
		_tmp25_ = store;
		_tmp26_ = tpf_persona_store_get_account (G_TYPE_CHECK_INSTANCE_TYPE (_tmp25_, TPF_TYPE_PERSONA_STORE) ? ((TpfPersonaStore*) _tmp25_) : NULL);
		_tmp27_ = _tmp26_;
		_tmp28_ = _g_object_ref0 (_tmp27_);
		account = _tmp28_;
		_tmp29_ = account;
		_tmp30_ = tp_account_get_service (_tmp29_);
		_tmp31_ = _tmp30_;
		_tmp32_ = contacts_contact_format_im_service (_tmp31_, NULL);
		result = _tmp32_;
		_g_object_unref0 (account);
		_g_object_unref0 (store);
		return result;
	}
	_tmp33_ = store;
	_tmp34_ = folks_persona_store_get_display_name (_tmp33_);
	_tmp35_ = _tmp34_;
	_tmp36_ = g_strdup (_tmp35_);
	result = _tmp36_;
	_g_object_unref0 (store);
	return result;
}


static gint __lambda14_ (const gchar* a, const gchar* b) {
	gint result = 0;
	GeeHashMap* sorted_map = NULL;
	GeeHashMap* _tmp0_ = NULL;
	gint i = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gchar* a_str = NULL;
	const gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* b_str = NULL;
	const gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	GeeHashMap* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	gboolean _tmp14_ = FALSE;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_INT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	sorted_map = _tmp0_;
	i = 0;
	_tmp1_ = contacts_contact_sorted_properties;
	_tmp1__length1 = contacts_contact_sorted_properties_length1;
	{
		gchar** p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
		p_collection = _tmp1_;
		p_collection_length1 = _tmp1__length1;
		for (p_it = 0; p_it < _tmp1__length1; p_it = p_it + 1) {
			gchar* _tmp2_ = NULL;
			gchar* p = NULL;
			_tmp2_ = g_strdup (p_collection[p_it]);
			p = _tmp2_;
			{
				GeeHashMap* _tmp3_ = NULL;
				const gchar* _tmp4_ = NULL;
				gint _tmp5_ = 0;
				gint _tmp6_ = 0;
				_tmp3_ = sorted_map;
				_tmp4_ = p;
				_tmp5_ = i;
				i = _tmp5_ + 1;
				_tmp6_ = i;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _tmp4_, _tmp6_);
				_g_free0 (p);
			}
		}
	}
	_tmp7_ = a;
	_tmp8_ = g_strdup ((const gchar*) _tmp7_);
	a_str = _tmp8_;
	_tmp9_ = b;
	_tmp10_ = g_strdup ((const gchar*) _tmp9_);
	b_str = _tmp10_;
	_tmp12_ = sorted_map;
	_tmp13_ = a_str;
	_tmp14_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp12_, _tmp13_);
	if (_tmp14_) {
		GeeHashMap* _tmp15_ = NULL;
		const gchar* _tmp16_ = NULL;
		gboolean _tmp17_ = FALSE;
		_tmp15_ = sorted_map;
		_tmp16_ = b_str;
		_tmp17_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp15_, _tmp16_);
		_tmp11_ = _tmp17_;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		GeeHashMap* _tmp18_ = NULL;
		const gchar* _tmp19_ = NULL;
		gpointer _tmp20_ = NULL;
		GeeHashMap* _tmp21_ = NULL;
		const gchar* _tmp22_ = NULL;
		gpointer _tmp23_ = NULL;
		GeeHashMap* _tmp24_ = NULL;
		const gchar* _tmp25_ = NULL;
		gpointer _tmp26_ = NULL;
		GeeHashMap* _tmp27_ = NULL;
		const gchar* _tmp28_ = NULL;
		gpointer _tmp29_ = NULL;
		_tmp18_ = sorted_map;
		_tmp19_ = a_str;
		_tmp20_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp18_, _tmp19_);
		_tmp21_ = sorted_map;
		_tmp22_ = b_str;
		_tmp23_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp21_, _tmp22_);
		if (((gint) ((gintptr) _tmp20_)) < ((gint) ((gintptr) _tmp23_))) {
			result = -1;
			_g_free0 (b_str);
			_g_free0 (a_str);
			_g_object_unref0 (sorted_map);
			return result;
		}
		_tmp24_ = sorted_map;
		_tmp25_ = a_str;
		_tmp26_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp24_, _tmp25_);
		_tmp27_ = sorted_map;
		_tmp28_ = b_str;
		_tmp29_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp27_, _tmp28_);
		if (((gint) ((gintptr) _tmp26_)) > ((gint) ((gintptr) _tmp29_))) {
			result = 1;
			_g_free0 (b_str);
			_g_free0 (a_str);
			_g_object_unref0 (sorted_map);
			return result;
		}
		result = 0;
		_g_free0 (b_str);
		_g_free0 (a_str);
		_g_object_unref0 (sorted_map);
		return result;
	} else {
		GeeHashMap* _tmp30_ = NULL;
		const gchar* _tmp31_ = NULL;
		gboolean _tmp32_ = FALSE;
		_tmp30_ = sorted_map;
		_tmp31_ = a_str;
		_tmp32_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp30_, _tmp31_);
		if (_tmp32_) {
			result = -1;
			_g_free0 (b_str);
			_g_free0 (a_str);
			_g_object_unref0 (sorted_map);
			return result;
		} else {
			GeeHashMap* _tmp33_ = NULL;
			const gchar* _tmp34_ = NULL;
			gboolean _tmp35_ = FALSE;
			_tmp33_ = sorted_map;
			_tmp34_ = b_str;
			_tmp35_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp33_, _tmp34_);
			if (_tmp35_) {
				result = 1;
				_g_free0 (b_str);
				_g_free0 (a_str);
				_g_object_unref0 (sorted_map);
				return result;
			} else {
				const gchar* _tmp36_ = NULL;
				const gchar* _tmp37_ = NULL;
				const gchar* _tmp38_ = NULL;
				const gchar* _tmp39_ = NULL;
				_tmp36_ = a_str;
				_tmp37_ = b_str;
				if (g_strcmp0 (_tmp36_, _tmp37_) < 0) {
					result = -1;
					_g_free0 (b_str);
					_g_free0 (a_str);
					_g_object_unref0 (sorted_map);
					return result;
				}
				_tmp38_ = a_str;
				_tmp39_ = b_str;
				if (g_strcmp0 (_tmp38_, _tmp39_) > 0) {
					result = 1;
					_g_free0 (b_str);
					_g_free0 (a_str);
					_g_object_unref0 (sorted_map);
					return result;
				}
				result = 0;
				_g_free0 (b_str);
				_g_free0 (a_str);
				_g_object_unref0 (sorted_map);
				return result;
			}
		}
	}
	_g_free0 (b_str);
	_g_free0 (a_str);
	_g_object_unref0 (sorted_map);
}


static gint ___lambda14__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = __lambda14_ ((const gchar*) a, (const gchar*) b);
	return result;
}


gchar** contacts_contact_sort_persona_properties (gchar** props, int props_length1, int* result_length1) {
	gchar** result = NULL;
	GCompareDataFunc compare_properties = NULL;
	void* compare_properties_target = NULL;
	GDestroyNotify compare_properties_target_destroy_notify = NULL;
	GeeArrayList* sorted_props = NULL;
	GeeArrayList* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	GeeArrayList* _tmp5_ = NULL;
	GCompareDataFunc _tmp6_ = NULL;
	void* _tmp6__target = NULL;
	GDestroyNotify _tmp6__target_destroy_notify = NULL;
	GeeArrayList* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	gpointer* _tmp9_ = NULL;
	gchar** _tmp10_ = NULL;
	gint _tmp10__length1 = 0;
	compare_properties = ___lambda14__gcompare_data_func;
	compare_properties_target = NULL;
	compare_properties_target_destroy_notify = NULL;
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
	sorted_props = _tmp0_;
	_tmp1_ = props;
	_tmp1__length1 = props_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp1_;
		s_collection_length1 = _tmp1__length1;
		for (s_it = 0; s_it < _tmp1__length1; s_it = s_it + 1) {
			gchar* _tmp2_ = NULL;
			gchar* s = NULL;
			_tmp2_ = g_strdup (s_collection[s_it]);
			s = _tmp2_;
			{
				GeeArrayList* _tmp3_ = NULL;
				const gchar* _tmp4_ = NULL;
				_tmp3_ = sorted_props;
				_tmp4_ = s;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, _tmp4_);
				_g_free0 (s);
			}
		}
	}
	_tmp5_ = sorted_props;
	_tmp6_ = compare_properties;
	_tmp6__target = compare_properties_target;
	_tmp6__target_destroy_notify = compare_properties_target_destroy_notify;
	compare_properties_target_destroy_notify = NULL;
	gee_list_sort ((GeeList*) _tmp5_, _tmp6_, _tmp6__target, _tmp6__target_destroy_notify);
	_tmp7_ = sorted_props;
	_tmp9_ = gee_collection_to_array ((GeeCollection*) _tmp7_, &_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp10__length1 = _tmp8_;
	if (result_length1) {
		*result_length1 = _tmp10__length1;
	}
	result = _tmp10_;
	_g_object_unref0 (sorted_props);
	(compare_properties_target_destroy_notify == NULL) ? NULL : (compare_properties_target_destroy_notify (compare_properties_target), NULL);
	compare_properties = NULL;
	compare_properties_target = NULL;
	compare_properties_target_destroy_notify = NULL;
	return result;
}


static void contacts_contact_set_individual_property_data_free (gpointer _data) {
	ContactsContactSetIndividualPropertyData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->contact);
	_g_free0 (_data_->property_name);
	G_IS_VALUE (&_data_->value) ? (g_value_unset (&_data_->value), NULL) : NULL;
	_g_object_unref0 (_data_->result);
	g_slice_free (ContactsContactSetIndividualPropertyData, _data_);
}


void contacts_contact_set_individual_property (ContactsContact* contact, const gchar* property_name, GValue* value, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsContactSetIndividualPropertyData* _data_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GValue _tmp4_ = {0};
	GValue _tmp5_ = {0};
	_data_ = g_slice_new0 (ContactsContactSetIndividualPropertyData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, contacts_contact_set_individual_property);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_contact_set_individual_property_data_free);
	_tmp0_ = contact;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data_->contact);
	_data_->contact = _tmp1_;
	_tmp2_ = property_name;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (_data_->property_name);
	_data_->property_name = _tmp3_;
	_tmp4_ = *value;
	if (G_IS_VALUE (&_tmp4_)) {
		g_value_init (&_tmp5_, G_VALUE_TYPE (&_tmp4_));
		g_value_copy (&_tmp4_, &_tmp5_);
	} else {
		_tmp5_ = _tmp4_;
	}
	G_IS_VALUE (&_data_->value) ? (g_value_unset (&_data_->value), NULL) : NULL;
	_data_->value = _tmp5_;
	contacts_contact_set_individual_property_co (_data_);
}


FolksPersona* contacts_contact_set_individual_property_finish (GAsyncResult* _res_, GError** error) {
	FolksPersona* result;
	ContactsContactSetIndividualPropertyData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) {
	int i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}


static void contacts_contact_set_individual_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ContactsContactSetIndividualPropertyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_contact_set_individual_property_co (_data_);
}


static gboolean contacts_contact_set_individual_property_co (ContactsContactSetIndividualPropertyData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->did_set = FALSE;
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->contact;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->_tmp0_->individual;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = folks_individual_get_personas (_data_->_tmp1_);
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = 0;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = gee_collection_to_array ((GeeCollection*) _data_->_tmp3_, &_data_->_tmp4_);
	_data_->personas_copy_length1 = 0;
	_data_->_personas_copy_size_ = 0;
	_data_->personas_copy = _data_->_tmp5_;
	_data_->personas_copy_length1 = _data_->_tmp4_;
	_data_->_personas_copy_size_ = _data_->personas_copy_length1;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6__length1 = 0;
	_data_->_tmp6_ = _data_->personas_copy;
	_data_->_tmp6__length1 = _data_->personas_copy_length1;
	{
		_data_->p_collection_length1 = 0;
		_data_->_p_collection_size_ = 0;
		_data_->p_collection = _data_->_tmp6_;
		_data_->p_collection_length1 = _data_->_tmp6__length1;
		for (_data_->p_it = 0; _data_->p_it < _data_->_tmp6__length1; _data_->p_it = _data_->p_it + 1) {
			_data_->_tmp7_ = NULL;
			_data_->_tmp7_ = _g_object_ref0 (_data_->p_collection[_data_->p_it]);
			_data_->p = _data_->_tmp7_;
			{
				_data_->_tmp8_ = NULL;
				_data_->_tmp8_ = _data_->property_name;
				_data_->_tmp9_ = NULL;
				_data_->_tmp9_ = _data_->p;
				_data_->_tmp10_ = NULL;
				_data_->_tmp10__length1 = 0;
				_data_->_tmp10_ = folks_persona_get_writeable_properties (_data_->_tmp9_, &_data_->_tmp10__length1);
				_data_->_tmp11_ = NULL;
				_data_->_tmp11__length1 = 0;
				_data_->_tmp11_ = _data_->_tmp10_;
				_data_->_tmp11__length1 = _data_->_tmp10__length1;
				if (_vala_string_array_contains (_data_->_tmp11_, _data_->_tmp11__length1, _data_->_tmp8_)) {
					_data_->did_set = TRUE;
					_data_->_tmp12_ = NULL;
					_data_->_tmp12_ = _data_->p;
					_data_->_tmp13_ = NULL;
					_data_->_tmp13_ = _data_->property_name;
					memset (&_data_->_tmp14_, 0, sizeof (GValue));
					_data_->_tmp14_ = _data_->value;
					_data_->_state_ = 1;
					contacts_contact_set_persona_property (_data_->_tmp12_, _data_->_tmp13_, &_data_->_tmp14_, contacts_contact_set_individual_property_ready, _data_);
					return FALSE;
					_state_1:
					contacts_contact_set_persona_property_finish (_data_->_res_, &_data_->_inner_error_);
					if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						_g_object_unref0 (_data_->p);
						_data_->personas_copy = (_vala_array_free (_data_->personas_copy, _data_->personas_copy_length1, (GDestroyNotify) g_object_unref), NULL);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
				}
				_g_object_unref0 (_data_->p);
			}
		}
	}
	_data_->_tmp15_ = FALSE;
	_data_->_tmp15_ = _data_->did_set;
	if (!_data_->_tmp15_) {
		_data_->_tmp16_ = NULL;
		_data_->_tmp16_ = _data_->contact;
		_data_->_tmp17_ = NULL;
		_data_->_tmp17_ = contacts_fake_persona_new (_data_->_tmp16_);
		_data_->fake = _data_->_tmp17_;
		_data_->_tmp19_ = NULL;
		_data_->_tmp19_ = _data_->fake;
		_data_->_tmp20_ = NULL;
		_data_->_tmp20_ = _data_->property_name;
		memset (&_data_->_tmp21_, 0, sizeof (GValue));
		_data_->_tmp21_ = _data_->value;
		_data_->_state_ = 2;
		contacts_fake_persona_make_real_and_set (_data_->_tmp19_, _data_->_tmp20_, &_data_->_tmp21_, contacts_contact_set_individual_property_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp22_ = NULL;
		_data_->_tmp22_ = contacts_fake_persona_make_real_and_set_finish (_data_->_tmp19_, _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp18_ = _data_->_tmp22_;
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->fake);
			_data_->personas_copy = (_vala_array_free (_data_->personas_copy, _data_->personas_copy_length1, (GDestroyNotify) g_object_unref), NULL);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp23_ = NULL;
		_data_->_tmp23_ = _data_->_tmp18_;
		_data_->_tmp18_ = NULL;
		_data_->result = _data_->_tmp23_;
		_g_object_unref0 (_data_->_tmp18_);
		_g_object_unref0 (_data_->fake);
		_data_->personas_copy = (_vala_array_free (_data_->personas_copy, _data_->personas_copy_length1, (GDestroyNotify) g_object_unref), NULL);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = NULL;
	_data_->personas_copy = (_vala_array_free (_data_->personas_copy, _data_->personas_copy_length1, (GDestroyNotify) g_object_unref), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_data_->personas_copy = (_vala_array_free (_data_->personas_copy, _data_->personas_copy_length1, (GDestroyNotify) g_object_unref), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


TpAccount* contacts_contact_is_callable (ContactsContact* self, const gchar* proto, const gchar* id) {
	TpAccount* result = NULL;
	TpfPersona* t_persona = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	TpfPersona* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	TpfPersona* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (proto != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = proto;
	_tmp1_ = id;
	_tmp2_ = contacts_contact_find_im_persona (self, _tmp0_, _tmp1_);
	t_persona = _tmp2_;
	_tmp4_ = t_persona;
	if (_tmp4_ != NULL) {
		TpfPersona* _tmp5_ = NULL;
		TpContact* _tmp6_ = NULL;
		TpContact* _tmp7_ = NULL;
		_tmp5_ = t_persona;
		_tmp6_ = tpf_persona_get_contact (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		TpCapabilities* caps = NULL;
		TpfPersona* _tmp8_ = NULL;
		TpContact* _tmp9_ = NULL;
		TpContact* _tmp10_ = NULL;
		TpCapabilities* _tmp11_ = NULL;
		TpCapabilities* _tmp12_ = NULL;
		gboolean _tmp13_ = FALSE;
		_tmp8_ = t_persona;
		_tmp9_ = tpf_persona_get_contact (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = tp_contact_get_capabilities (_tmp10_);
		caps = _tmp11_;
		_tmp12_ = caps;
		_tmp13_ = tp_capabilities_supports_audio_call (_tmp12_, TP_HANDLE_TYPE_CONTACT);
		if (_tmp13_) {
			TpfPersona* _tmp14_ = NULL;
			FolksPersonaStore* _tmp15_ = NULL;
			FolksPersonaStore* _tmp16_ = NULL;
			TpAccount* _tmp17_ = NULL;
			TpAccount* _tmp18_ = NULL;
			TpAccount* _tmp19_ = NULL;
			_tmp14_ = t_persona;
			_tmp15_ = folks_persona_get_store ((FolksPersona*) _tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = tpf_persona_store_get_account (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, TPF_TYPE_PERSONA_STORE) ? ((TpfPersonaStore*) _tmp16_) : NULL);
			_tmp18_ = _tmp17_;
			_tmp19_ = _g_object_ref0 (_tmp18_);
			result = _tmp19_;
			_g_object_unref0 (t_persona);
			return result;
		}
	}
	result = NULL;
	_g_object_unref0 (t_persona);
	return result;
}


static void contacts_contact_create_primary_persona_for_details_data_free (gpointer _data) {
	ContactsContactCreatePrimaryPersonaForDetailsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->store);
	_g_hash_table_unref0 (_data_->details);
	_g_object_unref0 (_data_->result);
	g_slice_free (ContactsContactCreatePrimaryPersonaForDetailsData, _data_);
}


static gpointer _g_hash_table_ref0 (gpointer self) {
	return self ? g_hash_table_ref (self) : NULL;
}


void contacts_contact_create_primary_persona_for_details (FolksPersonaStore* store, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsContactCreatePrimaryPersonaForDetailsData* _data_;
	FolksPersonaStore* _tmp0_ = NULL;
	FolksPersonaStore* _tmp1_ = NULL;
	GHashTable* _tmp2_ = NULL;
	GHashTable* _tmp3_ = NULL;
	_data_ = g_slice_new0 (ContactsContactCreatePrimaryPersonaForDetailsData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, contacts_contact_create_primary_persona_for_details);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_contact_create_primary_persona_for_details_data_free);
	_tmp0_ = store;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data_->store);
	_data_->store = _tmp1_;
	_tmp2_ = details;
	_tmp3_ = _g_hash_table_ref0 (_tmp2_);
	_g_hash_table_unref0 (_data_->details);
	_data_->details = _tmp3_;
	contacts_contact_create_primary_persona_for_details_co (_data_);
}


FolksPersona* contacts_contact_create_primary_persona_for_details_finish (GAsyncResult* _res_, GError** error) {
	FolksPersona* result;
	ContactsContactCreatePrimaryPersonaForDetailsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void contacts_contact_create_primary_persona_for_details_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ContactsContactCreatePrimaryPersonaForDetailsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_contact_create_primary_persona_for_details_co (_data_);
}


static gboolean contacts_contact_create_primary_persona_for_details_co (ContactsContactCreatePrimaryPersonaForDetailsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->store;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->details;
	_data_->_state_ = 1;
	folks_persona_store_add_persona_from_details (_data_->_tmp0_, _data_->_tmp1_, contacts_contact_create_primary_persona_for_details_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = folks_persona_store_add_persona_from_details_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error_);
	_data_->p = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->p;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->p);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void contacts_contact_set_persona_property_data_free (gpointer _data) {
	ContactsContactSetPersonaPropertyData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->property_name);
	G_IS_VALUE (&_data_->new_value) ? (g_value_unset (&_data_->new_value), NULL) : NULL;
	g_slice_free (ContactsContactSetPersonaPropertyData, _data_);
}


void contacts_contact_set_persona_property (FolksPersona* persona, const gchar* property_name, GValue* new_value, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsContactSetPersonaPropertyData* _data_;
	FolksPersona* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GValue _tmp4_ = {0};
	GValue _tmp5_ = {0};
	_data_ = g_slice_new0 (ContactsContactSetPersonaPropertyData);
	_data_->_async_result = g_simple_async_result_new (NULL, _callback_, _user_data_, contacts_contact_set_persona_property);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_contact_set_persona_property_data_free);
	_tmp0_ = persona;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp1_;
	_tmp2_ = property_name;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (_data_->property_name);
	_data_->property_name = _tmp3_;
	_tmp4_ = *new_value;
	if (G_IS_VALUE (&_tmp4_)) {
		g_value_init (&_tmp5_, G_VALUE_TYPE (&_tmp4_));
		g_value_copy (&_tmp4_, &_tmp5_);
	} else {
		_tmp5_ = _tmp4_;
	}
	G_IS_VALUE (&_data_->new_value) ? (g_value_unset (&_data_->new_value), NULL) : NULL;
	_data_->new_value = _tmp5_;
	contacts_contact_set_persona_property_co (_data_);
}


void contacts_contact_set_persona_property_finish (GAsyncResult* _res_, GError** error) {
	ContactsContactSetPersonaPropertyData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void contacts_contact_set_persona_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ContactsContactSetPersonaPropertyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_contact_set_persona_property_co (_data_);
}


static gboolean contacts_contact_set_persona_property_co (ContactsContactSetPersonaPropertyData* _data_) {
	static GQuark _tmp10_label0 = 0;
	static GQuark _tmp10_label1 = 0;
	static GQuark _tmp10_label2 = 0;
	static GQuark _tmp10_label3 = 0;
	static GQuark _tmp10_label4 = 0;
	static GQuark _tmp10_label5 = 0;
	static GQuark _tmp10_label6 = 0;
	static GQuark _tmp10_label7 = 0;
	static GQuark _tmp10_label8 = 0;
	static GQuark _tmp10_label9 = 0;
	static GQuark _tmp10_label10 = 0;
	static GQuark _tmp10_label11 = 0;
	static GQuark _tmp10_label12 = 0;
	static GQuark _tmp10_label13 = 0;
	static GQuark _tmp10_label14 = 0;
	static GQuark _tmp10_label15 = 0;
	static GQuark _tmp10_label16 = 0;
	static GQuark _tmp10_label17 = 0;
	static GQuark _tmp10_label18 = 0;
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		case 9:
		goto _state_9;
		case 10:
		goto _state_10;
		case 11:
		goto _state_11;
		case 12:
		goto _state_12;
		case 13:
		goto _state_13;
		case 14:
		goto _state_14;
		case 15:
		goto _state_15;
		case 16:
		goto _state_16;
		case 17:
		goto _state_17;
		case 18:
		goto _state_18;
		case 19:
		goto _state_19;
		case 20:
		goto _state_20;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->persona;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp0_, CONTACTS_TYPE_FAKE_PERSONA)) {
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = _data_->persona;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp1_, CONTACTS_TYPE_FAKE_PERSONA) ? ((ContactsFakePersona*) _data_->_tmp1_) : NULL);
		_data_->fake = _data_->_tmp2_;
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = _data_->fake;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = _data_->property_name;
		memset (&_data_->_tmp5_, 0, sizeof (GValue));
		_data_->_tmp5_ = _data_->new_value;
		_data_->_state_ = 1;
		contacts_fake_persona_make_real_and_set (_data_->_tmp3_, _data_->_tmp4_, &_data_->_tmp5_, contacts_contact_set_persona_property_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = contacts_fake_persona_make_real_and_set_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = _data_->_tmp6_;
		_g_object_unref0 (_data_->_tmp7_);
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_data_->_inner_error_);
				_g_object_unref0 (_data_->fake);
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_object_unref0 (_data_->fake);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
				g_clear_error (&_data_->_inner_error_);
				return FALSE;
			}
		}
		_g_object_unref0 (_data_->fake);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = _data_->property_name;
	_data_->_tmp9_ = NULL;
	_data_->_tmp11_ = 0U;
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp11_ = (NULL == _data_->_tmp9_) ? 0 : g_quark_from_string (_data_->_tmp9_);
	if (_data_->_tmp11_ == ((0 != _tmp10_label0) ? _tmp10_label0 : (_tmp10_label0 = g_quark_from_static_string ("alias")))) {
		switch (0) {
			default:
			{
				_data_->_tmp12_ = NULL;
				_data_->_tmp12_ = _data_->persona;
				memset (&_data_->_tmp13_, 0, sizeof (GValue));
				_data_->_tmp13_ = _data_->new_value;
				_data_->_state_ = 2;
				folks_alias_details_change_alias (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp12_, FOLKS_TYPE_ALIAS_DETAILS) ? ((FolksAliasDetails*) _data_->_tmp12_) : NULL, g_value_get_string (&_data_->_tmp13_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_2:
				folks_alias_details_change_alias_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp12_, FOLKS_TYPE_ALIAS_DETAILS) ? ((FolksAliasDetails*) _data_->_tmp12_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label1) ? _tmp10_label1 : (_tmp10_label1 = g_quark_from_static_string ("avatar")))) {
		switch (0) {
			default:
			{
				_data_->_tmp14_ = NULL;
				_data_->_tmp14_ = _data_->persona;
				memset (&_data_->_tmp15_, 0, sizeof (GValue));
				_data_->_tmp15_ = _data_->new_value;
				_data_->_state_ = 3;
				folks_avatar_details_change_avatar (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp14_, FOLKS_TYPE_AVATAR_DETAILS) ? ((FolksAvatarDetails*) _data_->_tmp14_) : NULL, g_value_get_object (&_data_->_tmp15_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_3:
				folks_avatar_details_change_avatar_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp14_, FOLKS_TYPE_AVATAR_DETAILS) ? ((FolksAvatarDetails*) _data_->_tmp14_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label2) ? _tmp10_label2 : (_tmp10_label2 = g_quark_from_static_string ("birthday")))) {
		switch (0) {
			default:
			{
				_data_->_tmp16_ = NULL;
				_data_->_tmp16_ = _data_->persona;
				memset (&_data_->_tmp17_, 0, sizeof (GValue));
				_data_->_tmp17_ = _data_->new_value;
				_data_->_state_ = 4;
				folks_birthday_details_change_birthday (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp16_, FOLKS_TYPE_BIRTHDAY_DETAILS) ? ((FolksBirthdayDetails*) _data_->_tmp16_) : NULL, g_value_get_boxed (&_data_->_tmp17_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_4:
				folks_birthday_details_change_birthday_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp16_, FOLKS_TYPE_BIRTHDAY_DETAILS) ? ((FolksBirthdayDetails*) _data_->_tmp16_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label3) ? _tmp10_label3 : (_tmp10_label3 = g_quark_from_static_string ("calendar-event-id")))) {
		switch (0) {
			default:
			{
				_data_->_tmp18_ = NULL;
				_data_->_tmp18_ = _data_->persona;
				memset (&_data_->_tmp19_, 0, sizeof (GValue));
				_data_->_tmp19_ = _data_->new_value;
				_data_->_state_ = 5;
				folks_birthday_details_change_calendar_event_id (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp18_, FOLKS_TYPE_BIRTHDAY_DETAILS) ? ((FolksBirthdayDetails*) _data_->_tmp18_) : NULL, g_value_get_string (&_data_->_tmp19_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_5:
				folks_birthday_details_change_calendar_event_id_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp18_, FOLKS_TYPE_BIRTHDAY_DETAILS) ? ((FolksBirthdayDetails*) _data_->_tmp18_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label4) ? _tmp10_label4 : (_tmp10_label4 = g_quark_from_static_string ("email-addresses")))) {
		switch (0) {
			default:
			{
				_data_->_tmp20_ = NULL;
				_data_->_tmp20_ = _data_->persona;
				memset (&_data_->_tmp21_, 0, sizeof (GValue));
				_data_->_tmp21_ = _data_->new_value;
				_data_->_state_ = 6;
				folks_email_details_change_email_addresses (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp20_, FOLKS_TYPE_EMAIL_DETAILS) ? ((FolksEmailDetails*) _data_->_tmp20_) : NULL, g_value_get_object (&_data_->_tmp21_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_6:
				folks_email_details_change_email_addresses_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp20_, FOLKS_TYPE_EMAIL_DETAILS) ? ((FolksEmailDetails*) _data_->_tmp20_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label5) ? _tmp10_label5 : (_tmp10_label5 = g_quark_from_static_string ("is-favourite")))) {
		switch (0) {
			default:
			{
				_data_->_tmp22_ = NULL;
				_data_->_tmp22_ = _data_->persona;
				memset (&_data_->_tmp23_, 0, sizeof (GValue));
				_data_->_tmp23_ = _data_->new_value;
				_data_->_state_ = 7;
				folks_favourite_details_change_is_favourite (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp22_, FOLKS_TYPE_FAVOURITE_DETAILS) ? ((FolksFavouriteDetails*) _data_->_tmp22_) : NULL, g_value_get_boolean (&_data_->_tmp23_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_7:
				folks_favourite_details_change_is_favourite_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp22_, FOLKS_TYPE_FAVOURITE_DETAILS) ? ((FolksFavouriteDetails*) _data_->_tmp22_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label6) ? _tmp10_label6 : (_tmp10_label6 = g_quark_from_static_string ("gender")))) {
		switch (0) {
			default:
			{
				_data_->_tmp24_ = NULL;
				_data_->_tmp24_ = _data_->persona;
				memset (&_data_->_tmp25_, 0, sizeof (GValue));
				_data_->_tmp25_ = _data_->new_value;
				_data_->_state_ = 8;
				folks_gender_details_change_gender (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp24_, FOLKS_TYPE_GENDER_DETAILS) ? ((FolksGenderDetails*) _data_->_tmp24_) : NULL, g_value_get_enum (&_data_->_tmp25_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_8:
				folks_gender_details_change_gender_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp24_, FOLKS_TYPE_GENDER_DETAILS) ? ((FolksGenderDetails*) _data_->_tmp24_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label7) ? _tmp10_label7 : (_tmp10_label7 = g_quark_from_static_string ("groups")))) {
		switch (0) {
			default:
			{
				_data_->_tmp26_ = NULL;
				_data_->_tmp26_ = _data_->persona;
				memset (&_data_->_tmp27_, 0, sizeof (GValue));
				_data_->_tmp27_ = _data_->new_value;
				_data_->_state_ = 9;
				folks_group_details_change_groups (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp26_, FOLKS_TYPE_GROUP_DETAILS) ? ((FolksGroupDetails*) _data_->_tmp26_) : NULL, g_value_get_object (&_data_->_tmp27_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_9:
				folks_group_details_change_groups_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp26_, FOLKS_TYPE_GROUP_DETAILS) ? ((FolksGroupDetails*) _data_->_tmp26_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label8) ? _tmp10_label8 : (_tmp10_label8 = g_quark_from_static_string ("im-addresses")))) {
		switch (0) {
			default:
			{
				_data_->_tmp28_ = NULL;
				_data_->_tmp28_ = _data_->persona;
				memset (&_data_->_tmp29_, 0, sizeof (GValue));
				_data_->_tmp29_ = _data_->new_value;
				_data_->_state_ = 10;
				folks_im_details_change_im_addresses (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp28_, FOLKS_TYPE_IM_DETAILS) ? ((FolksImDetails*) _data_->_tmp28_) : NULL, g_value_get_object (&_data_->_tmp29_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_10:
				folks_im_details_change_im_addresses_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp28_, FOLKS_TYPE_IM_DETAILS) ? ((FolksImDetails*) _data_->_tmp28_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label9) ? _tmp10_label9 : (_tmp10_label9 = g_quark_from_static_string ("local-ids")))) {
		switch (0) {
			default:
			{
				_data_->_tmp30_ = NULL;
				_data_->_tmp30_ = _data_->persona;
				memset (&_data_->_tmp31_, 0, sizeof (GValue));
				_data_->_tmp31_ = _data_->new_value;
				_data_->_state_ = 11;
				folks_local_id_details_change_local_ids (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp30_, FOLKS_TYPE_LOCAL_ID_DETAILS) ? ((FolksLocalIdDetails*) _data_->_tmp30_) : NULL, g_value_get_object (&_data_->_tmp31_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_11:
				folks_local_id_details_change_local_ids_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp30_, FOLKS_TYPE_LOCAL_ID_DETAILS) ? ((FolksLocalIdDetails*) _data_->_tmp30_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label10) ? _tmp10_label10 : (_tmp10_label10 = g_quark_from_static_string ("structured-name")))) {
		switch (0) {
			default:
			{
				_data_->_tmp32_ = NULL;
				_data_->_tmp32_ = _data_->persona;
				memset (&_data_->_tmp33_, 0, sizeof (GValue));
				_data_->_tmp33_ = _data_->new_value;
				_data_->_state_ = 12;
				folks_name_details_change_structured_name (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp32_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _data_->_tmp32_) : NULL, g_value_get_object (&_data_->_tmp33_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_12:
				folks_name_details_change_structured_name_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp32_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _data_->_tmp32_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label11) ? _tmp10_label11 : (_tmp10_label11 = g_quark_from_static_string ("full-name")))) {
		switch (0) {
			default:
			{
				_data_->_tmp34_ = NULL;
				_data_->_tmp34_ = _data_->persona;
				memset (&_data_->_tmp35_, 0, sizeof (GValue));
				_data_->_tmp35_ = _data_->new_value;
				_data_->_state_ = 13;
				folks_name_details_change_full_name (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp34_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _data_->_tmp34_) : NULL, g_value_get_string (&_data_->_tmp35_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_13:
				folks_name_details_change_full_name_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp34_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _data_->_tmp34_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label12) ? _tmp10_label12 : (_tmp10_label12 = g_quark_from_static_string ("nickname")))) {
		switch (0) {
			default:
			{
				_data_->_tmp36_ = NULL;
				_data_->_tmp36_ = _data_->persona;
				memset (&_data_->_tmp37_, 0, sizeof (GValue));
				_data_->_tmp37_ = _data_->new_value;
				_data_->_state_ = 14;
				folks_name_details_change_nickname (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp36_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _data_->_tmp36_) : NULL, g_value_get_string (&_data_->_tmp37_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_14:
				folks_name_details_change_nickname_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp36_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _data_->_tmp36_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label13) ? _tmp10_label13 : (_tmp10_label13 = g_quark_from_static_string ("notes")))) {
		switch (0) {
			default:
			{
				_data_->_tmp38_ = NULL;
				_data_->_tmp38_ = _data_->persona;
				memset (&_data_->_tmp39_, 0, sizeof (GValue));
				_data_->_tmp39_ = _data_->new_value;
				_data_->_state_ = 15;
				folks_note_details_change_notes (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp38_, FOLKS_TYPE_NOTE_DETAILS) ? ((FolksNoteDetails*) _data_->_tmp38_) : NULL, g_value_get_object (&_data_->_tmp39_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_15:
				folks_note_details_change_notes_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp38_, FOLKS_TYPE_NOTE_DETAILS) ? ((FolksNoteDetails*) _data_->_tmp38_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label14) ? _tmp10_label14 : (_tmp10_label14 = g_quark_from_static_string ("phone-numbers")))) {
		switch (0) {
			default:
			{
				_data_->_tmp40_ = NULL;
				_data_->_tmp40_ = _data_->persona;
				memset (&_data_->_tmp41_, 0, sizeof (GValue));
				_data_->_tmp41_ = _data_->new_value;
				_data_->_state_ = 16;
				folks_phone_details_change_phone_numbers (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp40_, FOLKS_TYPE_PHONE_DETAILS) ? ((FolksPhoneDetails*) _data_->_tmp40_) : NULL, g_value_get_object (&_data_->_tmp41_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_16:
				folks_phone_details_change_phone_numbers_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp40_, FOLKS_TYPE_PHONE_DETAILS) ? ((FolksPhoneDetails*) _data_->_tmp40_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label15) ? _tmp10_label15 : (_tmp10_label15 = g_quark_from_static_string ("postal-addresses")))) {
		switch (0) {
			default:
			{
				_data_->_tmp42_ = NULL;
				_data_->_tmp42_ = _data_->persona;
				memset (&_data_->_tmp43_, 0, sizeof (GValue));
				_data_->_tmp43_ = _data_->new_value;
				_data_->_state_ = 17;
				folks_postal_address_details_change_postal_addresses (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp42_, FOLKS_TYPE_POSTAL_ADDRESS_DETAILS) ? ((FolksPostalAddressDetails*) _data_->_tmp42_) : NULL, g_value_get_object (&_data_->_tmp43_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_17:
				folks_postal_address_details_change_postal_addresses_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp42_, FOLKS_TYPE_POSTAL_ADDRESS_DETAILS) ? ((FolksPostalAddressDetails*) _data_->_tmp42_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label16) ? _tmp10_label16 : (_tmp10_label16 = g_quark_from_static_string ("roles")))) {
		switch (0) {
			default:
			{
				_data_->_tmp44_ = NULL;
				_data_->_tmp44_ = _data_->persona;
				memset (&_data_->_tmp45_, 0, sizeof (GValue));
				_data_->_tmp45_ = _data_->new_value;
				_data_->_state_ = 18;
				folks_role_details_change_roles (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp44_, FOLKS_TYPE_ROLE_DETAILS) ? ((FolksRoleDetails*) _data_->_tmp44_) : NULL, g_value_get_object (&_data_->_tmp45_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_18:
				folks_role_details_change_roles_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp44_, FOLKS_TYPE_ROLE_DETAILS) ? ((FolksRoleDetails*) _data_->_tmp44_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label17) ? _tmp10_label17 : (_tmp10_label17 = g_quark_from_static_string ("urls")))) {
		switch (0) {
			default:
			{
				_data_->_tmp46_ = NULL;
				_data_->_tmp46_ = _data_->persona;
				memset (&_data_->_tmp47_, 0, sizeof (GValue));
				_data_->_tmp47_ = _data_->new_value;
				_data_->_state_ = 19;
				folks_url_details_change_urls (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp46_, FOLKS_TYPE_URL_DETAILS) ? ((FolksUrlDetails*) _data_->_tmp46_) : NULL, g_value_get_object (&_data_->_tmp47_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_19:
				folks_url_details_change_urls_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp46_, FOLKS_TYPE_URL_DETAILS) ? ((FolksUrlDetails*) _data_->_tmp46_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else if (_data_->_tmp11_ == ((0 != _tmp10_label18) ? _tmp10_label18 : (_tmp10_label18 = g_quark_from_static_string ("web-service-addresses")))) {
		switch (0) {
			default:
			{
				_data_->_tmp48_ = NULL;
				_data_->_tmp48_ = _data_->persona;
				memset (&_data_->_tmp49_, 0, sizeof (GValue));
				_data_->_tmp49_ = _data_->new_value;
				_data_->_state_ = 20;
				folks_web_service_details_change_web_service_addresses (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp48_, FOLKS_TYPE_WEB_SERVICE_DETAILS) ? ((FolksWebServiceDetails*) _data_->_tmp48_) : NULL, g_value_get_object (&_data_->_tmp49_), contacts_contact_set_persona_property_ready, _data_);
				return FALSE;
				_state_20:
				folks_web_service_details_change_web_service_addresses_finish (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp48_, FOLKS_TYPE_WEB_SERVICE_DETAILS) ? ((FolksWebServiceDetails*) _data_->_tmp48_) : NULL, _data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if ((((_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) || (_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR)) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				_data_->_tmp50_ = NULL;
				_data_->_tmp50_ = _data_->property_name;
				g_critical ("contacts-contact.vala:1423: Unknown property '%s' in Contact.set_perso" \
"na_property().", _data_->_tmp50_);
				break;
			}
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static Block15Data* block15_data_ref (Block15Data* _data15_) {
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}


static void block15_data_unref (void * _userdata_) {
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		ContactsContact* self;
		self = _data15_->self;
		_g_object_unref0 (_data15_->w);
		(_data15_->callback_target_destroy_notify == NULL) ? NULL : (_data15_->callback_target_destroy_notify (_data15_->callback_target), NULL);
		_data15_->callback = NULL;
		_data15_->callback_target = NULL;
		_data15_->callback_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}


static void __lambda15_ (Block15Data* _data15_) {
	ContactsContact* self;
	GtkCallback _tmp0_ = NULL;
	void* _tmp0__target = NULL;
	GtkWidget* _tmp1_ = NULL;
	self = _data15_->self;
	_tmp0_ = _data15_->callback;
	_tmp0__target = _data15_->callback_target;
	_tmp1_ = _data15_->w;
	_tmp0_ (_tmp1_, _tmp0__target);
}


static void ___lambda15__contacts_contact_changed (ContactsContact* _sender, gpointer self) {
	__lambda15_ (self);
}


static void __lambda16_ (Block15Data* _data15_) {
	ContactsContact* self;
	self = _data15_->self;
	g_signal_handler_disconnect ((GObject*) self, _data15_->id);
}


static void ___lambda16__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda16_ (self);
}


void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify) {
	Block15Data* _data15_;
	GtkWidget* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkCallback _tmp2_ = NULL;
	void* _tmp2__target = NULL;
	GtkCallback _tmp3_ = NULL;
	void* _tmp3__target = NULL;
	GtkWidget* _tmp4_ = NULL;
	gulong _tmp5_ = 0UL;
	GtkWidget* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (w != NULL);
	_data15_ = g_slice_new0 (Block15Data);
	_data15_->_ref_count_ = 1;
	_data15_->self = g_object_ref (self);
	_tmp0_ = w;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data15_->w);
	_data15_->w = _tmp1_;
	_tmp2_ = callback;
	_tmp2__target = callback_target;
	(_data15_->callback_target_destroy_notify == NULL) ? NULL : (_data15_->callback_target_destroy_notify (_data15_->callback_target), NULL);
	_data15_->callback = NULL;
	_data15_->callback_target = NULL;
	_data15_->callback_target_destroy_notify = NULL;
	_data15_->callback = _tmp2_;
	_data15_->callback_target = _tmp2__target;
	_data15_->callback_target_destroy_notify = callback_target_destroy_notify;
	_tmp3_ = _data15_->callback;
	_tmp3__target = _data15_->callback_target;
	_tmp4_ = _data15_->w;
	_tmp3_ (_tmp4_, _tmp3__target);
	_tmp5_ = g_signal_connect_data (self, "changed", (GCallback) ___lambda15__contacts_contact_changed, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
	_data15_->id = _tmp5_;
	_tmp6_ = _data15_->w;
	g_signal_connect_data (_tmp6_, "destroy", (GCallback) ___lambda16__gtk_widget_destroy, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
	block15_data_unref (_data15_);
	_data15_ = NULL;
}


void contacts_contact_fetch_contact_info (ContactsContact* self) {
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _p_it = NULL;
		FolksIndividual* _tmp0_ = NULL;
		GeeSet* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeIterator* _tmp3_ = NULL;
		_tmp0_ = self->individual;
		_tmp1_ = folks_individual_get_personas (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_p_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_ = NULL;
			gboolean _tmp5_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp6_ = NULL;
			gpointer _tmp7_ = NULL;
			TpfPersona* tp = NULL;
			FolksPersona* _tmp8_ = NULL;
			TpfPersona* _tmp9_ = NULL;
			TpfPersona* _tmp10_ = NULL;
			_tmp4_ = _p_it;
			_tmp5_ = gee_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _p_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			p = (FolksPersona*) _tmp7_;
			_tmp8_ = p;
			_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, TPF_TYPE_PERSONA) ? ((TpfPersona*) _tmp8_) : NULL);
			tp = _tmp9_;
			_tmp10_ = tp;
			if (_tmp10_ != NULL) {
				TpfPersona* _tmp11_ = NULL;
				TpContact* _tmp12_ = NULL;
				TpContact* _tmp13_ = NULL;
				_tmp11_ = tp;
				_tmp12_ = tpf_persona_get_contact (_tmp11_);
				_tmp13_ = _tmp12_;
				tp_contact_request_contact_info_async (_tmp13_, NULL, NULL, NULL);
			}
			_g_object_unref0 (tp);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
}


GdkPixbuf* contacts_contact_get_small_avatar (ContactsContact* self) {
	GdkPixbuf* result;
	GdkPixbuf* _tmp0_ = NULL;
	GdkPixbuf* _tmp9_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_small_avatar;
	if (_tmp0_ == NULL) {
		GdkPixbuf* pixbuf = NULL;
		FolksIndividual* _tmp1_ = NULL;
		GLoadableIcon* _tmp2_ = NULL;
		GLoadableIcon* _tmp3_ = NULL;
		GdkPixbuf* _tmp4_ = NULL;
		GdkPixbuf* _tmp5_ = NULL;
		GdkPixbuf* _tmp7_ = NULL;
		GdkPixbuf* _tmp8_ = NULL;
		_tmp1_ = self->individual;
		_tmp2_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = contacts_contact_load_icon (self, _tmp3_, CONTACTS_CONTACT_SMALL_AVATAR_SIZE);
		pixbuf = _tmp4_;
		_tmp5_ = pixbuf;
		if (_tmp5_ == NULL) {
			GdkPixbuf* _tmp6_ = NULL;
			_tmp6_ = contacts_contact_draw_fallback_avatar (CONTACTS_CONTACT_SMALL_AVATAR_SIZE, self);
			_g_object_unref0 (pixbuf);
			pixbuf = _tmp6_;
		}
		_tmp7_ = pixbuf;
		_tmp8_ = contacts_contact_frame_icon (_tmp7_);
		_g_object_unref0 (self->priv->_small_avatar);
		self->priv->_small_avatar = _tmp8_;
		_g_object_unref0 (pixbuf);
	}
	_tmp9_ = self->priv->_small_avatar;
	result = _tmp9_;
	return result;
}


GVariant* contacts_contact_get_avatar_icon_data (ContactsContact* self) {
	GVariant* result;
	FolksIndividual* _tmp0_ = NULL;
	GLoadableIcon* _tmp1_ = NULL;
	GLoadableIcon* _tmp2_ = NULL;
	GVariant* _tmp3_ = NULL;
	GVariant* _tmp9_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->individual;
	_tmp1_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp3_ = self->priv->_avatar_icon_data;
	if (_tmp3_ == NULL) {
		GdkPixbuf* _tmp4_ = NULL;
		GdkPixbuf* _tmp5_ = NULL;
		GdkPixbuf* _tmp6_ = NULL;
		GdkPixbuf* _tmp7_ = NULL;
		GVariant* _tmp8_ = NULL;
		_tmp4_ = contacts_contact_get_small_avatar (self);
		_tmp5_ = _tmp4_;
		if (_tmp5_ == NULL) {
			result = NULL;
			return result;
		}
		_tmp6_ = contacts_contact_get_small_avatar (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_icon_serialize ((GIcon*) _tmp7_);
		_g_variant_unref0 (self->priv->_avatar_icon_data);
		self->priv->_avatar_icon_data = _tmp8_;
	}
	_tmp9_ = self->priv->_avatar_icon_data;
	result = _tmp9_;
	return result;
}


const gchar* contacts_contact_get_display_name (ContactsContact* self) {
	const gchar* result;
	const gchar* name = NULL;
	FolksIndividual* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	const gchar* alias = NULL;
	FolksIndividual* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	gboolean _tmp10_ = FALSE;
	const gchar* nickname = NULL;
	FolksIndividual* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	const gchar* _tmp15_ = NULL;
	gboolean _tmp16_ = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->individual;
	_tmp1_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp0_);
	_tmp2_ = _tmp1_;
	name = _tmp2_;
	_tmp3_ = name;
	_tmp4_ = contacts_is_set (_tmp3_);
	if (_tmp4_) {
		const gchar* _tmp5_ = NULL;
		_tmp5_ = name;
		result = _tmp5_;
		return result;
	}
	_tmp6_ = self->individual;
	_tmp7_ = folks_alias_details_get_alias ((FolksAliasDetails*) _tmp6_);
	_tmp8_ = _tmp7_;
	alias = _tmp8_;
	_tmp9_ = alias;
	_tmp10_ = contacts_is_set (_tmp9_);
	if (_tmp10_) {
		const gchar* _tmp11_ = NULL;
		_tmp11_ = alias;
		result = _tmp11_;
		return result;
	}
	_tmp12_ = self->individual;
	_tmp13_ = folks_name_details_get_nickname ((FolksNameDetails*) _tmp12_);
	_tmp14_ = _tmp13_;
	nickname = _tmp14_;
	_tmp15_ = nickname;
	_tmp16_ = contacts_is_set (_tmp15_);
	if (_tmp16_) {
		const gchar* _tmp17_ = NULL;
		_tmp17_ = nickname;
		result = _tmp17_;
		return result;
	}
	{
		GeeIterator* _email_it = NULL;
		FolksIndividual* _tmp18_ = NULL;
		GeeSet* _tmp19_ = NULL;
		GeeSet* _tmp20_ = NULL;
		GeeIterator* _tmp21_ = NULL;
		_tmp18_ = self->individual;
		_tmp19_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = gee_iterable_iterator ((GeeIterable*) _tmp20_);
		_email_it = _tmp21_;
		while (TRUE) {
			GeeIterator* _tmp22_ = NULL;
			gboolean _tmp23_ = FALSE;
			FolksEmailFieldDetails* email = NULL;
			GeeIterator* _tmp24_ = NULL;
			gpointer _tmp25_ = NULL;
			gchar* e = NULL;
			FolksEmailFieldDetails* _tmp26_ = NULL;
			gconstpointer _tmp27_ = NULL;
			const gchar* _tmp28_ = NULL;
			gchar* _tmp29_ = NULL;
			const gchar* _tmp30_ = NULL;
			gboolean _tmp31_ = FALSE;
			_tmp22_ = _email_it;
			_tmp23_ = gee_iterator_next (_tmp22_);
			if (!_tmp23_) {
				break;
			}
			_tmp24_ = _email_it;
			_tmp25_ = gee_iterator_get (_tmp24_);
			email = (FolksEmailFieldDetails*) _tmp25_;
			_tmp26_ = email;
			_tmp27_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = g_strdup ((const gchar*) _tmp28_);
			e = _tmp29_;
			_tmp30_ = e;
			_tmp31_ = contacts_is_set (_tmp30_);
			if (_tmp31_) {
				FolksEmailFieldDetails* _tmp32_ = NULL;
				gconstpointer _tmp33_ = NULL;
				const gchar* _tmp34_ = NULL;
				_tmp32_ = email;
				_tmp33_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp32_);
				_tmp34_ = _tmp33_;
				result = (const gchar*) _tmp34_;
				_g_free0 (e);
				_g_object_unref0 (email);
				_g_object_unref0 (_email_it);
				return result;
			}
			_g_free0 (e);
			_g_object_unref0 (email);
		}
		_g_object_unref0 (_email_it);
	}
	result = "";
	return result;
}


static gunichar string_get_char (const gchar* self, glong index) {
	gunichar result = 0U;
	glong _tmp0_ = 0L;
	gunichar _tmp1_ = 0U;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = index;
	_tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_);
	result = _tmp1_;
	return result;
}


gunichar contacts_contact_get_initial_letter (ContactsContact* self) {
	gunichar result;
	gchar* name = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gint _tmp4_ = 0;
	gint _tmp5_ = 0;
	const gchar* _tmp6_ = NULL;
	gunichar _tmp7_ = 0U;
	gunichar _tmp8_ = 0U;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = contacts_contact_get_display_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup (_tmp1_);
	name = _tmp2_;
	_tmp3_ = name;
	_tmp4_ = strlen (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == 0) {
		result = (gunichar) 0;
		_g_free0 (name);
		return result;
	}
	_tmp6_ = name;
	_tmp7_ = string_get_char (_tmp6_, (glong) 0);
	_tmp8_ = g_unichar_totitle (_tmp7_);
	result = _tmp8_;
	_g_free0 (name);
	return result;
}


gboolean contacts_contact_get_is_hidden (ContactsContact* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp2_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_hidden_uptodate;
	if (!_tmp0_) {
		gboolean _tmp1_ = FALSE;
		_tmp1_ = _contacts_contact_get_is_hidden (self);
		self->priv->_is_hidden = _tmp1_;
		self->priv->_is_hidden_uptodate = TRUE;
	}
	_tmp2_ = self->priv->_is_hidden;
	result = _tmp2_;
	return result;
}


static ContactsContactContactDataRef* contacts_contact_contact_data_ref_dup (const ContactsContactContactDataRef* self) {
	ContactsContactContactDataRef* dup;
	dup = g_new0 (ContactsContactContactDataRef, 1);
	memcpy (dup, self, sizeof (ContactsContactContactDataRef));
	return dup;
}


static void contacts_contact_contact_data_ref_free (ContactsContactContactDataRef* self) {
	g_free (self);
}


static GType contacts_contact_contact_data_ref_get_type (void) {
	static volatile gsize contacts_contact_contact_data_ref_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_contact_data_ref_type_id__volatile)) {
		GType contacts_contact_contact_data_ref_type_id;
		contacts_contact_contact_data_ref_type_id = g_boxed_type_register_static ("ContactsContactContactDataRef", (GBoxedCopyFunc) contacts_contact_contact_data_ref_dup, (GBoxedFreeFunc) contacts_contact_contact_data_ref_free);
		g_once_init_leave (&contacts_contact_contact_data_ref_type_id__volatile, contacts_contact_contact_data_ref_type_id);
	}
	return contacts_contact_contact_data_ref_type_id__volatile;
}


static ContactsContactImData* contacts_contact_im_data_dup (const ContactsContactImData* self) {
	ContactsContactImData* dup;
	dup = g_new0 (ContactsContactImData, 1);
	memcpy (dup, self, sizeof (ContactsContactImData));
	return dup;
}


static void contacts_contact_im_data_free (ContactsContactImData* self) {
	g_free (self);
}


static GType contacts_contact_im_data_get_type (void) {
	static volatile gsize contacts_contact_im_data_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_im_data_type_id__volatile)) {
		GType contacts_contact_im_data_type_id;
		contacts_contact_im_data_type_id = g_boxed_type_register_static ("ContactsContactImData", (GBoxedCopyFunc) contacts_contact_im_data_dup, (GBoxedFreeFunc) contacts_contact_im_data_free);
		g_once_init_leave (&contacts_contact_im_data_type_id__volatile, contacts_contact_im_data_type_id);
	}
	return contacts_contact_im_data_type_id__volatile;
}


static void contacts_contact_class_init (ContactsContactClass * klass) {
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar** _tmp8_ = NULL;
	contacts_contact_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsContactPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_contacts_contact_get_property;
	G_OBJECT_CLASS (klass)->finalize = contacts_contact_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_SMALL_AVATAR, g_param_spec_object ("small-avatar", "small-avatar", "small-avatar", GDK_TYPE_PIXBUF, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_AVATAR_ICON_DATA, g_param_spec_variant ("avatar-icon-data", "avatar-icon-data", "avatar-icon-data", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_DISPLAY_NAME, g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_INITIAL_LETTER, g_param_spec_uint ("initial-letter", "initial-letter", "initial-letter", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_IS_HIDDEN, g_param_spec_boolean ("is-hidden", "is-hidden", "is-hidden", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_signal_new ("presence_changed", CONTACTS_TYPE_CONTACT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("changed", CONTACTS_TYPE_CONTACT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	g_signal_new ("personas_changed", CONTACTS_TYPE_CONTACT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	_tmp0_ = g_strdup ("email-addresses");
	_tmp1_ = g_strdup ("phone-numbers");
	_tmp2_ = g_strdup ("im-addresses");
	_tmp3_ = g_strdup ("urls");
	_tmp4_ = g_strdup ("nickname");
	_tmp5_ = g_strdup ("birthday");
	_tmp6_ = g_strdup ("notes");
	_tmp7_ = g_strdup ("postal-addresses");
	_tmp8_ = g_new0 (gchar*, 8 + 1);
	_tmp8_[0] = _tmp0_;
	_tmp8_[1] = _tmp1_;
	_tmp8_[2] = _tmp2_;
	_tmp8_[3] = _tmp3_;
	_tmp8_[4] = _tmp4_;
	_tmp8_[5] = _tmp5_;
	_tmp8_[6] = _tmp6_;
	_tmp8_[7] = _tmp7_;
	contacts_contact_sorted_properties = _tmp8_;
	contacts_contact_sorted_properties_length1 = 8;
}


static void contacts_contact_instance_init (ContactsContact * self) {
	self->priv = CONTACTS_CONTACT_GET_PRIVATE (self);
	self->fake_persona = NULL;
}


static void contacts_contact_finalize (GObject* obj) {
	ContactsContact * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_CONTACT, ContactsContact);
	_g_object_unref0 (self->store);
	_g_free0 (self->presence_message);
	self->priv->refs = (g_free (self->priv->refs), NULL);
	_g_object_unref0 (self->individual);
	_g_object_unref0 (self->fake_persona);
	_g_object_unref0 (self->priv->_small_avatar);
	_g_variant_unref0 (self->priv->_avatar_icon_data);
	_g_free0 (self->priv->filter_data);
	G_OBJECT_CLASS (contacts_contact_parent_class)->finalize (obj);
}


GType contacts_contact_get_type (void) {
	static volatile gsize contacts_contact_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsContactClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_contact_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsContact), 0, (GInstanceInitFunc) contacts_contact_instance_init, NULL };
		GType contacts_contact_type_id;
		contacts_contact_type_id = g_type_register_static (G_TYPE_OBJECT, "ContactsContact", &g_define_type_info, 0);
		g_once_init_leave (&contacts_contact_type_id__volatile, contacts_contact_type_id);
	}
	return contacts_contact_type_id__volatile;
}


static void _vala_contacts_contact_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ContactsContact * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_CONTACT, ContactsContact);
	switch (property_id) {
		case CONTACTS_CONTACT_SMALL_AVATAR:
		g_value_set_object (value, contacts_contact_get_small_avatar (self));
		break;
		case CONTACTS_CONTACT_AVATAR_ICON_DATA:
		g_value_set_variant (value, contacts_contact_get_avatar_icon_data (self));
		break;
		case CONTACTS_CONTACT_DISPLAY_NAME:
		g_value_set_string (value, contacts_contact_get_display_name (self));
		break;
		case CONTACTS_CONTACT_INITIAL_LETTER:
		g_value_set_uint (value, contacts_contact_get_initial_letter (self));
		break;
		case CONTACTS_CONTACT_IS_HIDDEN:
		g_value_set_boolean (value, contacts_contact_get_is_hidden (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


ContactsFakePersonaStore* contacts_fake_persona_store_the_store (void) {
	ContactsFakePersonaStore* result = NULL;
	ContactsFakePersonaStore* _tmp0_ = NULL;
	ContactsFakePersonaStore* _tmp2_ = NULL;
	ContactsFakePersonaStore* _tmp3_ = NULL;
	_tmp0_ = contacts_fake_persona_store__the_store;
	if (_tmp0_ == NULL) {
		ContactsFakePersonaStore* _tmp1_ = NULL;
		_tmp1_ = contacts_fake_persona_store_new ();
		_g_object_unref0 (contacts_fake_persona_store__the_store);
		contacts_fake_persona_store__the_store = _tmp1_;
	}
	_tmp2_ = contacts_fake_persona_store__the_store;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}


ContactsFakePersonaStore* contacts_fake_persona_store_construct (GType object_type) {
	ContactsFakePersonaStore * self = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GeeHashMap* _tmp1_ = NULL;
	GeeMap* _tmp2_ = NULL;
	GeeMap* _tmp3_ = NULL;
	self = (ContactsFakePersonaStore*) g_object_new (object_type, "id", "uri", "display-name", "fake store", NULL);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->_personas);
	self->priv->_personas = _tmp0_;
	_tmp1_ = self->priv->_personas;
	_tmp2_ = gee_abstract_map_get_read_only_view ((GeeAbstractMap*) _tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (self->priv->_personas_ro);
	self->priv->_personas_ro = _tmp3_;
	return self;
}


ContactsFakePersonaStore* contacts_fake_persona_store_new (void) {
	return contacts_fake_persona_store_construct (CONTACTS_TYPE_FAKE_PERSONA_STORE);
}


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


static void contacts_fake_persona_store_real_prepare (FolksPersonaStore* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsFakePersonaStore * self;
	ContactsFakePersonaStorePrepareData* _data_;
	ContactsFakePersonaStore* _tmp0_ = NULL;
	self = (ContactsFakePersonaStore*) base;
	_data_ = g_slice_new0 (ContactsFakePersonaStorePrepareData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, contacts_fake_persona_store_real_prepare);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_fake_persona_store_real_prepare_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	contacts_fake_persona_store_real_prepare_co (_data_);
}


static void contacts_fake_persona_store_real_prepare_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	ContactsFakePersonaStorePrepareData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean contacts_fake_persona_store_real_prepare_co (ContactsFakePersonaStorePrepareData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void contacts_fake_persona_store_real_add_persona_from_details_data_free (gpointer _data) {
	ContactsFakePersonaStoreAddPersonaFromDetailsData* _data_;
	_data_ = _data;
	_g_hash_table_unref0 (_data_->details);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ContactsFakePersonaStoreAddPersonaFromDetailsData, _data_);
}


static void contacts_fake_persona_store_real_add_persona_from_details (FolksPersonaStore* base, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsFakePersonaStore * self;
	ContactsFakePersonaStoreAddPersonaFromDetailsData* _data_;
	ContactsFakePersonaStore* _tmp0_ = NULL;
	GHashTable* _tmp1_ = NULL;
	GHashTable* _tmp2_ = NULL;
	self = (ContactsFakePersonaStore*) base;
	_data_ = g_slice_new0 (ContactsFakePersonaStoreAddPersonaFromDetailsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, contacts_fake_persona_store_real_add_persona_from_details);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_fake_persona_store_real_add_persona_from_details_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = details;
	_tmp2_ = _g_hash_table_ref0 (_tmp1_);
	_g_hash_table_unref0 (_data_->details);
	_data_->details = _tmp2_;
	contacts_fake_persona_store_real_add_persona_from_details_co (_data_);
}


static FolksPersona* contacts_fake_persona_store_real_add_persona_from_details_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	FolksPersona* result;
	ContactsFakePersonaStoreAddPersonaFromDetailsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static gboolean contacts_fake_persona_store_real_add_persona_from_details_co (ContactsFakePersonaStoreAddPersonaFromDetailsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->result = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void contacts_fake_persona_store_real_remove_persona_data_free (gpointer _data) {
	ContactsFakePersonaStoreRemovePersonaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->self);
	g_slice_free (ContactsFakePersonaStoreRemovePersonaData, _data_);
}


static void contacts_fake_persona_store_real_remove_persona (FolksPersonaStore* base, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsFakePersonaStore * self;
	ContactsFakePersonaStoreRemovePersonaData* _data_;
	ContactsFakePersonaStore* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	self = (ContactsFakePersonaStore*) base;
	_data_ = g_slice_new0 (ContactsFakePersonaStoreRemovePersonaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, contacts_fake_persona_store_real_remove_persona);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_fake_persona_store_real_remove_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (_data_->persona);
	_data_->persona = _tmp2_;
	contacts_fake_persona_store_real_remove_persona_co (_data_);
}


static void contacts_fake_persona_store_real_remove_persona_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	ContactsFakePersonaStoreRemovePersonaData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean contacts_fake_persona_store_real_remove_persona_co (ContactsFakePersonaStoreRemovePersonaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static const gchar* contacts_fake_persona_store_real_get_type_id (FolksPersonaStore* base) {
	const gchar* result;
	ContactsFakePersonaStore* self;
	self = (ContactsFakePersonaStore*) base;
	result = "fake";
	return result;
}


static GeeMap* contacts_fake_persona_store_real_get_personas (FolksPersonaStore* base) {
	GeeMap* result;
	ContactsFakePersonaStore* self;
	GeeMap* _tmp0_ = NULL;
	self = (ContactsFakePersonaStore*) base;
	_tmp0_ = self->priv->_personas_ro;
	result = _tmp0_;
	return result;
}


static FolksMaybeBool contacts_fake_persona_store_real_get_can_add_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	ContactsFakePersonaStore* self;
	self = (ContactsFakePersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_FALSE;
	return result;
}


static FolksMaybeBool contacts_fake_persona_store_real_get_can_alias_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	ContactsFakePersonaStore* self;
	self = (ContactsFakePersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_FALSE;
	return result;
}


static FolksMaybeBool contacts_fake_persona_store_real_get_can_group_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	ContactsFakePersonaStore* self;
	self = (ContactsFakePersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_FALSE;
	return result;
}


static FolksMaybeBool contacts_fake_persona_store_real_get_can_remove_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	ContactsFakePersonaStore* self;
	self = (ContactsFakePersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_FALSE;
	return result;
}


static gboolean contacts_fake_persona_store_real_get_is_prepared (FolksPersonaStore* base) {
	gboolean result;
	ContactsFakePersonaStore* self;
	self = (ContactsFakePersonaStore*) base;
	result = TRUE;
	return result;
}


static gboolean contacts_fake_persona_store_real_get_is_quiescent (FolksPersonaStore* base) {
	gboolean result;
	ContactsFakePersonaStore* self;
	self = (ContactsFakePersonaStore*) base;
	result = TRUE;
	return result;
}


static gchar** contacts_fake_persona_store_real_get_always_writeable_properties (FolksPersonaStore* base, int* result_length1) {
	gchar** result;
	ContactsFakePersonaStore* self;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	self = (ContactsFakePersonaStore*) base;
	_tmp0_ = self->priv->_always_writeable_properties;
	_tmp0__length1 = self->priv->_always_writeable_properties_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


static void contacts_fake_persona_store_class_init (ContactsFakePersonaStoreClass * klass) {
	contacts_fake_persona_store_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsFakePersonaStorePrivate));
	((FolksPersonaStoreClass *) klass)->prepare = contacts_fake_persona_store_real_prepare;
	((FolksPersonaStoreClass *) klass)->prepare_finish = contacts_fake_persona_store_real_prepare_finish;
	((FolksPersonaStoreClass *) klass)->add_persona_from_details = contacts_fake_persona_store_real_add_persona_from_details;
	((FolksPersonaStoreClass *) klass)->add_persona_from_details_finish = contacts_fake_persona_store_real_add_persona_from_details_finish;
	((FolksPersonaStoreClass *) klass)->remove_persona = contacts_fake_persona_store_real_remove_persona;
	((FolksPersonaStoreClass *) klass)->remove_persona_finish = contacts_fake_persona_store_real_remove_persona_finish;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_type_id = contacts_fake_persona_store_real_get_type_id;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_personas = contacts_fake_persona_store_real_get_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_add_personas = contacts_fake_persona_store_real_get_can_add_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_alias_personas = contacts_fake_persona_store_real_get_can_alias_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_group_personas = contacts_fake_persona_store_real_get_can_group_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_remove_personas = contacts_fake_persona_store_real_get_can_remove_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_is_prepared = contacts_fake_persona_store_real_get_is_prepared;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_is_quiescent = contacts_fake_persona_store_real_get_is_quiescent;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_always_writeable_properties = contacts_fake_persona_store_real_get_always_writeable_properties;
	G_OBJECT_CLASS (klass)->get_property = _vala_contacts_fake_persona_store_get_property;
	G_OBJECT_CLASS (klass)->finalize = contacts_fake_persona_store_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_TYPE_ID, g_param_spec_string ("type-id", "type-id", "type-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_PERSONAS, g_param_spec_object ("personas", "personas", "personas", GEE_TYPE_MAP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_CAN_ADD_PERSONAS, g_param_spec_enum ("can-add-personas", "can-add-personas", "can-add-personas", FOLKS_TYPE_MAYBE_BOOL, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_CAN_ALIAS_PERSONAS, g_param_spec_enum ("can-alias-personas", "can-alias-personas", "can-alias-personas", FOLKS_TYPE_MAYBE_BOOL, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_CAN_GROUP_PERSONAS, g_param_spec_enum ("can-group-personas", "can-group-personas", "can-group-personas", FOLKS_TYPE_MAYBE_BOOL, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_CAN_REMOVE_PERSONAS, g_param_spec_enum ("can-remove-personas", "can-remove-personas", "can-remove-personas", FOLKS_TYPE_MAYBE_BOOL, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_IS_PREPARED, g_param_spec_boolean ("is-prepared", "is-prepared", "is-prepared", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_IS_QUIESCENT, g_param_spec_boolean ("is-quiescent", "is-quiescent", "is-quiescent", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES, g_param_spec_boxed ("always-writeable-properties", "always-writeable-properties", "always-writeable-properties", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void contacts_fake_persona_store_instance_init (ContactsFakePersonaStore * self) {
	gchar** _tmp0_ = NULL;
	self->priv = CONTACTS_FAKE_PERSONA_STORE_GET_PRIVATE (self);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	self->priv->_always_writeable_properties = _tmp0_;
	self->priv->_always_writeable_properties_length1 = 0;
	self->priv->__always_writeable_properties_size_ = self->priv->_always_writeable_properties_length1;
}


static void contacts_fake_persona_store_finalize (GObject* obj) {
	ContactsFakePersonaStore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_FAKE_PERSONA_STORE, ContactsFakePersonaStore);
	_g_object_unref0 (self->priv->_personas);
	_g_object_unref0 (self->priv->_personas_ro);
	self->priv->_always_writeable_properties = (_vala_array_free (self->priv->_always_writeable_properties, self->priv->_always_writeable_properties_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (contacts_fake_persona_store_parent_class)->finalize (obj);
}


GType contacts_fake_persona_store_get_type (void) {
	static volatile gsize contacts_fake_persona_store_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_fake_persona_store_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsFakePersonaStoreClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_fake_persona_store_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsFakePersonaStore), 0, (GInstanceInitFunc) contacts_fake_persona_store_instance_init, NULL };
		GType contacts_fake_persona_store_type_id;
		contacts_fake_persona_store_type_id = g_type_register_static (FOLKS_TYPE_PERSONA_STORE, "ContactsFakePersonaStore", &g_define_type_info, 0);
		g_once_init_leave (&contacts_fake_persona_store_type_id__volatile, contacts_fake_persona_store_type_id);
	}
	return contacts_fake_persona_store_type_id__volatile;
}


static void _vala_contacts_fake_persona_store_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ContactsFakePersonaStore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_FAKE_PERSONA_STORE, ContactsFakePersonaStore);
	switch (property_id) {
		case CONTACTS_FAKE_PERSONA_STORE_TYPE_ID:
		g_value_set_string (value, folks_persona_store_get_type_id ((FolksPersonaStore*) self));
		break;
		case CONTACTS_FAKE_PERSONA_STORE_PERSONAS:
		g_value_set_object (value, folks_persona_store_get_personas ((FolksPersonaStore*) self));
		break;
		case CONTACTS_FAKE_PERSONA_STORE_CAN_ADD_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_add_personas ((FolksPersonaStore*) self));
		break;
		case CONTACTS_FAKE_PERSONA_STORE_CAN_ALIAS_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_alias_personas ((FolksPersonaStore*) self));
		break;
		case CONTACTS_FAKE_PERSONA_STORE_CAN_GROUP_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_group_personas ((FolksPersonaStore*) self));
		break;
		case CONTACTS_FAKE_PERSONA_STORE_CAN_REMOVE_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_remove_personas ((FolksPersonaStore*) self));
		break;
		case CONTACTS_FAKE_PERSONA_STORE_IS_PREPARED:
		g_value_set_boolean (value, folks_persona_store_get_is_prepared ((FolksPersonaStore*) self));
		break;
		case CONTACTS_FAKE_PERSONA_STORE_IS_QUIESCENT:
		g_value_set_boolean (value, folks_persona_store_get_is_quiescent ((FolksPersonaStore*) self));
		break;
		case CONTACTS_FAKE_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_store_get_always_writeable_properties ((FolksPersonaStore*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


ContactsFakePersona* contacts_fake_persona_maybe_create_for (ContactsContact* contact) {
	ContactsFakePersona* result = NULL;
	FolksPersona* primary_persona = NULL;
	ContactsContact* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	FolksPersona* _tmp2_ = NULL;
	ContactsContact* _tmp29_ = NULL;
	ContactsFakePersona* _tmp30_ = NULL;
	g_return_val_if_fail (contact != NULL, NULL);
	_tmp0_ = contact;
	_tmp1_ = contacts_contact_find_primary_persona (_tmp0_);
	primary_persona = _tmp1_;
	_tmp2_ = primary_persona;
	if (_tmp2_ != NULL) {
		result = NULL;
		_g_object_unref0 (primary_persona);
		return result;
	}
	{
		GeeIterator* _p_it = NULL;
		ContactsContact* _tmp3_ = NULL;
		FolksIndividual* _tmp4_ = NULL;
		GeeSet* _tmp5_ = NULL;
		GeeSet* _tmp6_ = NULL;
		GeeIterator* _tmp7_ = NULL;
		_tmp3_ = contact;
		_tmp4_ = _tmp3_->individual;
		_tmp5_ = folks_individual_get_personas (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_);
		_p_it = _tmp7_;
		while (TRUE) {
			GeeIterator* _tmp8_ = NULL;
			gboolean _tmp9_ = FALSE;
			FolksPersona* p = NULL;
			GeeIterator* _tmp10_ = NULL;
			gpointer _tmp11_ = NULL;
			gboolean _tmp12_ = FALSE;
			gboolean _tmp13_ = FALSE;
			FolksPersona* _tmp14_ = NULL;
			FolksPersonaStore* _tmp15_ = NULL;
			FolksPersonaStore* _tmp16_ = NULL;
			const gchar* _tmp17_ = NULL;
			const gchar* _tmp18_ = NULL;
			_tmp8_ = _p_it;
			_tmp9_ = gee_iterator_next (_tmp8_);
			if (!_tmp9_) {
				break;
			}
			_tmp10_ = _p_it;
			_tmp11_ = gee_iterator_get (_tmp10_);
			p = (FolksPersona*) _tmp11_;
			_tmp14_ = p;
			_tmp15_ = folks_persona_get_store (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = folks_persona_store_get_type_id (_tmp16_);
			_tmp18_ = _tmp17_;
			if (g_strcmp0 (_tmp18_, "eds") == 0) {
				FolksPersona* _tmp19_ = NULL;
				FolksPersonaStore* _tmp20_ = NULL;
				FolksPersonaStore* _tmp21_ = NULL;
				FolksMaybeBool _tmp22_ = 0;
				FolksMaybeBool _tmp23_ = 0;
				_tmp19_ = p;
				_tmp20_ = folks_persona_get_store (_tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = folks_persona_store_get_can_add_personas (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp13_ = _tmp23_ == FOLKS_MAYBE_BOOL_TRUE;
			} else {
				_tmp13_ = FALSE;
			}
			if (_tmp13_) {
				FolksPersona* _tmp24_ = NULL;
				FolksPersonaStore* _tmp25_ = NULL;
				FolksPersonaStore* _tmp26_ = NULL;
				FolksMaybeBool _tmp27_ = 0;
				FolksMaybeBool _tmp28_ = 0;
				_tmp24_ = p;
				_tmp25_ = folks_persona_get_store (_tmp24_);
				_tmp26_ = _tmp25_;
				_tmp27_ = folks_persona_store_get_can_remove_personas (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp12_ = _tmp28_ == FOLKS_MAYBE_BOOL_TRUE;
			} else {
				_tmp12_ = FALSE;
			}
			if (_tmp12_) {
				result = NULL;
				_g_object_unref0 (p);
				_g_object_unref0 (_p_it);
				_g_object_unref0 (primary_persona);
				return result;
			}
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_it);
	}
	_tmp29_ = contact;
	_tmp30_ = contacts_fake_persona_new (_tmp29_);
	result = _tmp30_;
	_g_object_unref0 (primary_persona);
	return result;
}


static void contacts_fake_persona_make_real_and_set_data_free (gpointer _data) {
	ContactsFakePersonaMakeRealAndSetData* _data_;
	_data_ = _data;
	_g_free0 (_data_->property);
	G_IS_VALUE (&_data_->value) ? (g_value_unset (&_data_->value), NULL) : NULL;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ContactsFakePersonaMakeRealAndSetData, _data_);
}


void contacts_fake_persona_make_real_and_set (ContactsFakePersona* self, const gchar* property, GValue* value, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	ContactsFakePersonaMakeRealAndSetData* _data_;
	ContactsFakePersona* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GValue _tmp3_ = {0};
	GValue _tmp4_ = {0};
	_data_ = g_slice_new0 (ContactsFakePersonaMakeRealAndSetData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, contacts_fake_persona_make_real_and_set);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, contacts_fake_persona_make_real_and_set_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = property;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->property);
	_data_->property = _tmp2_;
	_tmp3_ = *value;
	if (G_IS_VALUE (&_tmp3_)) {
		g_value_init (&_tmp4_, G_VALUE_TYPE (&_tmp3_));
		g_value_copy (&_tmp3_, &_tmp4_);
	} else {
		_tmp4_ = _tmp3_;
	}
	G_IS_VALUE (&_data_->value) ? (g_value_unset (&_data_->value), NULL) : NULL;
	_data_->value = _tmp4_;
	contacts_fake_persona_make_real_and_set_co (_data_);
}


FolksPersona* contacts_fake_persona_make_real_and_set_finish (ContactsFakePersona* self, GAsyncResult* _res_, GError** error) {
	FolksPersona* result;
	ContactsFakePersonaMakeRealAndSetData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void contacts_fake_persona_make_real_and_set_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	ContactsFakePersonaMakeRealAndSetData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	contacts_fake_persona_make_real_and_set_co (_data_);
}


static gboolean contacts_fake_persona_make_real_and_set_co (ContactsFakePersonaMakeRealAndSetData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = contacts_fake_persona_prop_val_new ();
	_data_->v = _data_->_tmp0_;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->v;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _data_->property;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup (_data_->_tmp2_);
	_g_free0 (_data_->_tmp1_->property);
	_data_->_tmp1_->property = _data_->_tmp3_;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->v;
	memset (&_data_->_tmp5_, 0, sizeof (GValue));
	_data_->_tmp5_ = _data_->value;
	memset (&_data_->_tmp6_, 0, sizeof (GValue));
	if (G_IS_VALUE (&_data_->_tmp5_)) {
		g_value_init (&_data_->_tmp6_, G_VALUE_TYPE (&_data_->_tmp5_));
		g_value_copy (&_data_->_tmp5_, &_data_->_tmp6_);
	} else {
		_data_->_tmp6_ = _data_->_tmp5_;
	}
	G_IS_VALUE (&_data_->_tmp4_->value) ? (g_value_unset (&_data_->_tmp4_->value), NULL) : NULL;
	_data_->_tmp4_->value = _data_->_tmp6_;
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = _data_->property;
	if (g_strcmp0 (_data_->_tmp7_, "full-name") == 0) {
		_data_->self->priv->has_full_name = TRUE;
	}
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = _data_->self->priv->prop_vals;
	if (_data_->_tmp8_ == NULL) {
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = gee_array_list_new (CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL, (GBoxedCopyFunc) contacts_fake_persona_prop_val_ref, contacts_fake_persona_prop_val_unref, NULL, NULL, NULL);
		_g_object_unref0 (_data_->self->priv->prop_vals);
		_data_->self->priv->prop_vals = _data_->_tmp9_;
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = _data_->self->priv->prop_vals;
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = _data_->v;
		gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp10_, _data_->_tmp11_);
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = _data_->self->contact;
		_data_->_state_ = 1;
		contacts_contact_ensure_primary_persona (_data_->_tmp12_, contacts_fake_persona_make_real_and_set_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp13_ = NULL;
		_data_->_tmp13_ = contacts_contact_ensure_primary_persona_finish (_data_->_tmp12_, _data_->_res_, &_data_->_inner_error_);
		_data_->p = _data_->_tmp13_;
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
			if (((_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_data_->_inner_error_);
				_contacts_fake_persona_prop_val_unref0 (_data_->v);
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_contacts_fake_persona_prop_val_unref0 (_data_->v);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
				g_clear_error (&_data_->_inner_error_);
				return FALSE;
			}
		}
		_data_->_tmp14_ = FALSE;
		_data_->_tmp14_ = _data_->self->priv->has_full_name;
		if (!_data_->_tmp14_) {
			_data_->_tmp15_ = NULL;
			_data_->_tmp15_ = _data_->p;
			_data_->_tmp16_ = NULL;
			_data_->_tmp16_ = _data_->self->contact;
			_data_->_tmp17_ = NULL;
			_data_->_tmp17_ = contacts_contact_get_display_name (_data_->_tmp16_);
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = _data_->_tmp17_;
			g_object_set ((GObject*) _data_->_tmp15_, "full-name", _data_->_tmp18_, NULL);
		}
		{
			_data_->_tmp19_ = NULL;
			_data_->_tmp19_ = _data_->self->priv->prop_vals;
			_data_->_tmp20_ = NULL;
			_data_->_tmp20_ = _g_object_ref0 (_data_->_tmp19_);
			_data_->_pv_list = _data_->_tmp20_;
			_data_->_tmp21_ = NULL;
			_data_->_tmp21_ = _data_->_pv_list;
			_data_->_tmp22_ = 0;
			_data_->_tmp22_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp21_);
			_data_->_tmp23_ = 0;
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->_pv_size = _data_->_tmp23_;
			_data_->_pv_index = -1;
			while (TRUE) {
				_data_->_tmp24_ = 0;
				_data_->_tmp24_ = _data_->_pv_index;
				_data_->_pv_index = _data_->_tmp24_ + 1;
				_data_->_tmp25_ = 0;
				_data_->_tmp25_ = _data_->_pv_index;
				_data_->_tmp26_ = 0;
				_data_->_tmp26_ = _data_->_pv_size;
				if (!(_data_->_tmp25_ < _data_->_tmp26_)) {
					break;
				}
				_data_->_tmp27_ = NULL;
				_data_->_tmp27_ = _data_->_pv_list;
				_data_->_tmp28_ = 0;
				_data_->_tmp28_ = _data_->_pv_index;
				_data_->_tmp29_ = NULL;
				_data_->_tmp29_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp27_, _data_->_tmp28_);
				_data_->pv = (ContactsFakePersonaPropVal*) _data_->_tmp29_;
				_data_->_tmp30_ = NULL;
				_data_->_tmp30_ = _data_->p;
				_data_->_tmp31_ = NULL;
				_data_->_tmp31_ = _data_->pv;
				_data_->_tmp32_ = NULL;
				_data_->_tmp32_ = _data_->_tmp31_->property;
				_data_->_tmp33_ = NULL;
				_data_->_tmp33_ = _data_->pv;
				memset (&_data_->_tmp34_, 0, sizeof (GValue));
				_data_->_tmp34_ = _data_->_tmp33_->value;
				_data_->_state_ = 2;
				contacts_contact_set_persona_property (_data_->_tmp30_, _data_->_tmp32_, &_data_->_tmp34_, contacts_fake_persona_make_real_and_set_ready, _data_);
				return FALSE;
				_state_2:
				contacts_contact_set_persona_property_finish (_data_->_res_, &_data_->_inner_error_);
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
					if (((_data_->_inner_error_->domain == FOLKS_INDIVIDUAL_AGGREGATOR_ERROR) || (_data_->_inner_error_->domain == CONTACT_ERROR)) || (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR)) {
						g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
						g_error_free (_data_->_inner_error_);
						_contacts_fake_persona_prop_val_unref0 (_data_->pv);
						_g_object_unref0 (_data_->_pv_list);
						_g_object_unref0 (_data_->p);
						_contacts_fake_persona_prop_val_unref0 (_data_->v);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					} else {
						_contacts_fake_persona_prop_val_unref0 (_data_->pv);
						_g_object_unref0 (_data_->_pv_list);
						_g_object_unref0 (_data_->p);
						_contacts_fake_persona_prop_val_unref0 (_data_->v);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
				}
				_contacts_fake_persona_prop_val_unref0 (_data_->pv);
			}
			_g_object_unref0 (_data_->_pv_list);
		}
		_data_->self->priv->now_real = TRUE;
		_data_->result = _data_->p;
		_contacts_fake_persona_prop_val_unref0 (_data_->v);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		_data_->_tmp35_ = FALSE;
		_data_->_tmp35_ = _data_->self->priv->now_real;
		_vala_assert (!_data_->_tmp35_, "!now_real");
		_data_->_tmp36_ = NULL;
		_data_->_tmp36_ = _data_->self->priv->prop_vals;
		_data_->_tmp37_ = NULL;
		_data_->_tmp37_ = _data_->v;
		gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp36_, _data_->_tmp37_);
		_data_->result = NULL;
		_contacts_fake_persona_prop_val_unref0 (_data_->v);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_contacts_fake_persona_prop_val_unref0 (_data_->v);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


ContactsFakePersona* contacts_fake_persona_construct (GType object_type, ContactsContact* contact) {
	ContactsFakePersona * self = NULL;
	FolksPersonaStore* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsStore* _tmp2_ = NULL;
	FolksIndividualAggregator* _tmp3_ = NULL;
	FolksIndividualAggregator* _tmp4_ = NULL;
	FolksPersonaStore* _tmp5_ = NULL;
	FolksPersonaStore* _tmp6_ = NULL;
	FolksPersonaStore* _tmp7_ = NULL;
	FolksPersonaStore* _tmp9_ = NULL;
	FolksPersonaStore* _tmp10_ = NULL;
	ContactsContact* _tmp11_ = NULL;
	ContactsContact* _tmp12_ = NULL;
	ContactsContact* _tmp13_ = NULL;
	FolksPersona* _tmp14_ = NULL;
	g_return_val_if_fail (contact != NULL, NULL);
	_tmp1_ = contact;
	_tmp2_ = _tmp1_->store;
	_tmp3_ = contacts_store_get_aggregator (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = folks_individual_aggregator_get_primary_store (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	_tmp0_ = _tmp7_;
	if (_tmp0_ == NULL) {
		ContactsFakePersonaStore* _tmp8_ = NULL;
		_tmp8_ = contacts_fake_persona_store_the_store ();
		_g_object_unref0 (_tmp0_);
		_tmp0_ = (FolksPersonaStore*) _tmp8_;
	}
	_tmp9_ = _tmp0_;
	_tmp0_ = NULL;
	_tmp10_ = _tmp9_;
	self = (ContactsFakePersona*) g_object_new (object_type, "display-id", "display_id", "uid", "uid-fake-persona", "iid", "iid", "store", _tmp10_, "is-user", FALSE, NULL);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = contact;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_g_object_unref0 (self->contact);
	self->contact = _tmp12_;
	_tmp13_ = self->contact;
	_tmp14_ = _g_object_ref0 ((FolksPersona*) self);
	_g_object_unref0 (_tmp13_->fake_persona);
	_tmp13_->fake_persona = _tmp14_;
	_g_object_unref0 (_tmp0_);
	return self;
}


ContactsFakePersona* contacts_fake_persona_new (ContactsContact* contact) {
	return contacts_fake_persona_construct (CONTACTS_TYPE_FAKE_PERSONA, contact);
}


static gchar** contacts_fake_persona_real_get_linkable_properties (FolksPersona* base, int* result_length1) {
	gchar** result;
	ContactsFakePersona* self;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	self = (ContactsFakePersona*) base;
	_tmp0_ = CONTACTS_FAKE_PERSONA__linkable_properties;
	_tmp0__length1 = G_N_ELEMENTS (CONTACTS_FAKE_PERSONA__linkable_properties);
	if (result_length1) {
		*result_length1 = _tmp0__length1;
	}
	result = _tmp0_;
	return result;
}


static gchar** contacts_fake_persona_real_get_writeable_properties (FolksPersona* base, int* result_length1) {
	gchar** result;
	ContactsFakePersona* self;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	self = (ContactsFakePersona*) base;
	_tmp0_ = CONTACTS_FAKE_PERSONA__writeable_properties;
	_tmp0__length1 = G_N_ELEMENTS (CONTACTS_FAKE_PERSONA__writeable_properties);
	if (result_length1) {
		*result_length1 = _tmp0__length1;
	}
	result = _tmp0_;
	return result;
}


static ContactsFakePersonaPropVal* contacts_fake_persona_prop_val_construct (GType object_type) {
	ContactsFakePersonaPropVal* self = NULL;
	self = (ContactsFakePersonaPropVal*) g_type_create_instance (object_type);
	return self;
}


static ContactsFakePersonaPropVal* contacts_fake_persona_prop_val_new (void) {
	return contacts_fake_persona_prop_val_construct (CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL);
}


static void contacts_fake_persona_value_prop_val_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void contacts_fake_persona_value_prop_val_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		contacts_fake_persona_prop_val_unref (value->data[0].v_pointer);
	}
}


static void contacts_fake_persona_value_prop_val_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = contacts_fake_persona_prop_val_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer contacts_fake_persona_value_prop_val_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* contacts_fake_persona_value_prop_val_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		ContactsFakePersonaPropVal* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = contacts_fake_persona_prop_val_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* contacts_fake_persona_value_prop_val_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	ContactsFakePersonaPropVal** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = contacts_fake_persona_prop_val_ref (value->data[0].v_pointer);
	}
	return NULL;
}


static GParamSpec* contacts_fake_persona_param_spec_prop_val (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ContactsFakePersonaParamSpecPropVal* spec;
	g_return_val_if_fail (g_type_is_a (object_type, CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


static gpointer contacts_fake_persona_value_get_prop_val (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL), NULL);
	return value->data[0].v_pointer;
}


static void contacts_fake_persona_value_set_prop_val (GValue* value, gpointer v_object) {
	ContactsFakePersonaPropVal* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		contacts_fake_persona_prop_val_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		contacts_fake_persona_prop_val_unref (old);
	}
}


static void contacts_fake_persona_value_take_prop_val (GValue* value, gpointer v_object) {
	ContactsFakePersonaPropVal* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		contacts_fake_persona_prop_val_unref (old);
	}
}


static void contacts_fake_persona_prop_val_class_init (ContactsFakePersonaPropValClass * klass) {
	contacts_fake_persona_prop_val_parent_class = g_type_class_peek_parent (klass);
	((ContactsFakePersonaPropValClass *) klass)->finalize = contacts_fake_persona_prop_val_finalize;
}


static void contacts_fake_persona_prop_val_instance_init (ContactsFakePersonaPropVal * self) {
	self->ref_count = 1;
}


static void contacts_fake_persona_prop_val_finalize (ContactsFakePersonaPropVal* obj) {
	ContactsFakePersonaPropVal * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_FAKE_PERSONA_TYPE_PROP_VAL, ContactsFakePersonaPropVal);
	g_signal_handlers_destroy (self);
	_g_free0 (self->property);
	G_IS_VALUE (&self->value) ? (g_value_unset (&self->value), NULL) : NULL;
}


static GType contacts_fake_persona_prop_val_get_type (void) {
	static volatile gsize contacts_fake_persona_prop_val_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_fake_persona_prop_val_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { contacts_fake_persona_value_prop_val_init, contacts_fake_persona_value_prop_val_free_value, contacts_fake_persona_value_prop_val_copy_value, contacts_fake_persona_value_prop_val_peek_pointer, "p", contacts_fake_persona_value_prop_val_collect_value, "p", contacts_fake_persona_value_prop_val_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (ContactsFakePersonaPropValClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_fake_persona_prop_val_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsFakePersonaPropVal), 0, (GInstanceInitFunc) contacts_fake_persona_prop_val_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType contacts_fake_persona_prop_val_type_id;
		contacts_fake_persona_prop_val_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ContactsFakePersonaPropVal", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&contacts_fake_persona_prop_val_type_id__volatile, contacts_fake_persona_prop_val_type_id);
	}
	return contacts_fake_persona_prop_val_type_id__volatile;
}


static gpointer contacts_fake_persona_prop_val_ref (gpointer instance) {
	ContactsFakePersonaPropVal* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


static void contacts_fake_persona_prop_val_unref (gpointer instance) {
	ContactsFakePersonaPropVal* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		CONTACTS_FAKE_PERSONA_PROP_VAL_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void contacts_fake_persona_class_init (ContactsFakePersonaClass * klass) {
	contacts_fake_persona_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsFakePersonaPrivate));
	FOLKS_PERSONA_CLASS (klass)->get_linkable_properties = contacts_fake_persona_real_get_linkable_properties;
	FOLKS_PERSONA_CLASS (klass)->get_writeable_properties = contacts_fake_persona_real_get_writeable_properties;
	G_OBJECT_CLASS (klass)->get_property = _vala_contacts_fake_persona_get_property;
	G_OBJECT_CLASS (klass)->finalize = contacts_fake_persona_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_LINKABLE_PROPERTIES, g_param_spec_boxed ("linkable-properties", "linkable-properties", "linkable-properties", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_FAKE_PERSONA_WRITEABLE_PROPERTIES, g_param_spec_boxed ("writeable-properties", "writeable-properties", "writeable-properties", G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void contacts_fake_persona_instance_init (ContactsFakePersona * self) {
	self->priv = CONTACTS_FAKE_PERSONA_GET_PRIVATE (self);
}


static void contacts_fake_persona_finalize (GObject* obj) {
	ContactsFakePersona * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersona);
	_g_object_unref0 (self->contact);
	_g_object_unref0 (self->priv->prop_vals);
	G_OBJECT_CLASS (contacts_fake_persona_parent_class)->finalize (obj);
}


GType contacts_fake_persona_get_type (void) {
	static volatile gsize contacts_fake_persona_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_fake_persona_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsFakePersonaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_fake_persona_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsFakePersona), 0, (GInstanceInitFunc) contacts_fake_persona_instance_init, NULL };
		GType contacts_fake_persona_type_id;
		contacts_fake_persona_type_id = g_type_register_static (FOLKS_TYPE_PERSONA, "ContactsFakePersona", &g_define_type_info, 0);
		g_once_init_leave (&contacts_fake_persona_type_id__volatile, contacts_fake_persona_type_id);
	}
	return contacts_fake_persona_type_id__volatile;
}


static void _vala_contacts_fake_persona_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ContactsFakePersona * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersona);
	switch (property_id) {
		case CONTACTS_FAKE_PERSONA_LINKABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_get_linkable_properties ((FolksPersona*) self, &length));
		}
		break;
		case CONTACTS_FAKE_PERSONA_WRITEABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_get_writeable_properties ((FolksPersona*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


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


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



