/* contact_model.c generated by valac 0.56.19, the Vala compiler
 * generated from contact_model.vala, do not modify */

#include "libdino.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include "xmpp-vala.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	DINO_MODEL_CONVERSATION_DISPLAY_NAME_0_PROPERTY,
	DINO_MODEL_CONVERSATION_DISPLAY_NAME_DISPLAY_NAME_PROPERTY,
	DINO_MODEL_CONVERSATION_DISPLAY_NAME_NUM_PROPERTIES
};
static GParamSpec* dino_model_conversation_display_name_properties[DINO_MODEL_CONVERSATION_DISPLAY_NAME_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	DINO_CONTACT_MODELS_0_PROPERTY,
	DINO_CONTACT_MODELS_ID_PROPERTY,
	DINO_CONTACT_MODELS_NUM_PROPERTIES
};
static GParamSpec* dino_contact_models_properties[DINO_CONTACT_MODELS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _DinoModelConversationDisplayNamePrivate {
	gchar* _display_name;
};

struct _DinoContactModelsPrivate {
	DinoStreamInteractor* stream_interactor;
	GeeHashMap* conversation_models;
};

static gint DinoModelConversationDisplayName_private_offset;
static gpointer dino_model_conversation_display_name_parent_class = NULL;
static gint DinoContactModels_private_offset;
static gpointer dino_contact_models_parent_class = NULL;
DinoModuleIdentity* dino_contact_models_IDENTITY = NULL;
static DinoStreamInteractionModuleIface * dino_contact_models_dino_stream_interaction_module_parent_iface = NULL;

static void dino_model_conversation_display_name_finalize (GObject * obj);
static GType dino_model_conversation_display_name_get_type_once (void);
static void _vala_dino_model_conversation_display_name_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_dino_model_conversation_display_name_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);
static guint _dino_entities_conversation_hash_func_gee_hash_data_func (gconstpointer v,
                                                                gpointer self);
static gboolean _dino_entities_conversation_equals_func_gee_equal_data_func (gconstpointer a,
                                                                      gconstpointer b,
                                                                      gpointer self);
static DinoContactModels* dino_contact_models_new (DinoStreamInteractor* stream_interactor);
static DinoContactModels* dino_contact_models_construct (GType object_type,
                                                  DinoStreamInteractor* stream_interactor);
static void __lambda140_ (DinoContactModels* self,
                   DinoEntitiesAccount* account,
                   XmppJid* jid);
static void dino_contact_models_check_update_models (DinoContactModels* self,
                                              DinoEntitiesAccount* account,
                                              XmppJid* jid,
                                              DinoEntitiesConversationType conversation_ty);
static void ___lambda140__dino_muc_manager_room_info_updated (DinoMucManager* _sender,
                                                       DinoEntitiesAccount* account,
                                                       XmppJid* muc_jid,
                                                       gpointer self);
static void __lambda141_ (DinoContactModels* self,
                   DinoEntitiesAccount* account,
                   XmppJid* room,
                   XmppJid* occupant);
static void ___lambda141__dino_muc_manager_private_room_occupant_updated (DinoMucManager* _sender,
                                                                   DinoEntitiesAccount* account,
                                                                   XmppJid* room,
                                                                   XmppJid* occupant,
                                                                   gpointer self);
static void __lambda142_ (DinoContactModels* self,
                   DinoEntitiesAccount* account,
                   XmppJid* jid,
                   const gchar* subject);
static void ___lambda142__dino_muc_manager_subject_set (DinoMucManager* _sender,
                                                 DinoEntitiesAccount* account,
                                                 XmppJid* jid,
                                                 const gchar* subject,
                                                 gpointer self);
static void __lambda143_ (DinoContactModels* self,
                   DinoEntitiesAccount* account,
                   XmppJid* jid,
                   XmppRosterItem* roster_item);
static void ___lambda143__dino_roster_manager_updated_roster_item (DinoRosterManager* _sender,
                                                            DinoEntitiesAccount* account,
                                                            XmppJid* jid,
                                                            XmppRosterItem* roster_item,
                                                            gpointer self);
static void dino_contact_models_finalize (GObject * obj);
static GType dino_contact_models_get_type_once (void);
static void _vala_dino_contact_models_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_model_conversation_display_name_get_instance_private (DinoModelConversationDisplayName* self)
{
	return G_STRUCT_MEMBER_P (self, DinoModelConversationDisplayName_private_offset);
}

DinoModelConversationDisplayName*
dino_model_conversation_display_name_construct (GType object_type)
{
	DinoModelConversationDisplayName * self = NULL;
	self = (DinoModelConversationDisplayName*) g_object_new (object_type, NULL);
	return self;
}

DinoModelConversationDisplayName*
dino_model_conversation_display_name_new (void)
{
	return dino_model_conversation_display_name_construct (DINO_MODEL_TYPE_CONVERSATION_DISPLAY_NAME);
}

const gchar*
dino_model_conversation_display_name_get_display_name (DinoModelConversationDisplayName* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_name;
	result = _tmp0_;
	return result;
}

void
dino_model_conversation_display_name_set_display_name (DinoModelConversationDisplayName* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_model_conversation_display_name_get_display_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_display_name);
		self->priv->_display_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_model_conversation_display_name_properties[DINO_MODEL_CONVERSATION_DISPLAY_NAME_DISPLAY_NAME_PROPERTY]);
	}
}

static void
dino_model_conversation_display_name_class_init (DinoModelConversationDisplayNameClass * klass,
                                                 gpointer klass_data)
{
	dino_model_conversation_display_name_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoModelConversationDisplayName_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_model_conversation_display_name_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_model_conversation_display_name_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_model_conversation_display_name_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MODEL_CONVERSATION_DISPLAY_NAME_DISPLAY_NAME_PROPERTY, dino_model_conversation_display_name_properties[DINO_MODEL_CONVERSATION_DISPLAY_NAME_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_model_conversation_display_name_instance_init (DinoModelConversationDisplayName * self,
                                                    gpointer klass)
{
	self->priv = dino_model_conversation_display_name_get_instance_private (self);
}

static void
dino_model_conversation_display_name_finalize (GObject * obj)
{
	DinoModelConversationDisplayName * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_MODEL_TYPE_CONVERSATION_DISPLAY_NAME, DinoModelConversationDisplayName);
	_g_free0 (self->priv->_display_name);
	G_OBJECT_CLASS (dino_model_conversation_display_name_parent_class)->finalize (obj);
}

static GType
dino_model_conversation_display_name_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoModelConversationDisplayNameClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_model_conversation_display_name_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoModelConversationDisplayName), 0, (GInstanceInitFunc) dino_model_conversation_display_name_instance_init, NULL };
	GType dino_model_conversation_display_name_type_id;
	dino_model_conversation_display_name_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoModelConversationDisplayName", &g_define_type_info, 0);
	DinoModelConversationDisplayName_private_offset = g_type_add_instance_private (dino_model_conversation_display_name_type_id, sizeof (DinoModelConversationDisplayNamePrivate));
	return dino_model_conversation_display_name_type_id;
}

GType
dino_model_conversation_display_name_get_type (void)
{
	static volatile gsize dino_model_conversation_display_name_type_id__once = 0;
	if (g_once_init_enter (&dino_model_conversation_display_name_type_id__once)) {
		GType dino_model_conversation_display_name_type_id;
		dino_model_conversation_display_name_type_id = dino_model_conversation_display_name_get_type_once ();
		g_once_init_leave (&dino_model_conversation_display_name_type_id__once, dino_model_conversation_display_name_type_id);
	}
	return dino_model_conversation_display_name_type_id__once;
}

static void
_vala_dino_model_conversation_display_name_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	DinoModelConversationDisplayName * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_MODEL_TYPE_CONVERSATION_DISPLAY_NAME, DinoModelConversationDisplayName);
	switch (property_id) {
		case DINO_MODEL_CONVERSATION_DISPLAY_NAME_DISPLAY_NAME_PROPERTY:
		g_value_set_string (value, dino_model_conversation_display_name_get_display_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_model_conversation_display_name_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	DinoModelConversationDisplayName * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_MODEL_TYPE_CONVERSATION_DISPLAY_NAME, DinoModelConversationDisplayName);
	switch (property_id) {
		case DINO_MODEL_CONVERSATION_DISPLAY_NAME_DISPLAY_NAME_PROPERTY:
		dino_model_conversation_display_name_set_display_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_contact_models_get_instance_private (DinoContactModels* self)
{
	return G_STRUCT_MEMBER_P (self, DinoContactModels_private_offset);
}

static guint
_dino_entities_conversation_hash_func_gee_hash_data_func (gconstpointer v,
                                                          gpointer self)
{
	guint result;
	result = dino_entities_conversation_hash_func ((DinoEntitiesConversation*) v);
	return result;
}

static gboolean
_dino_entities_conversation_equals_func_gee_equal_data_func (gconstpointer a,
                                                             gconstpointer b,
                                                             gpointer self)
{
	gboolean result;
	result = dino_entities_conversation_equals_func ((DinoEntitiesConversation*) a, (DinoEntitiesConversation*) b);
	return result;
}

void
dino_contact_models_start (DinoStreamInteractor* stream_interactor)
{
	DinoContactModels* m = NULL;
	DinoContactModels* _tmp0_;
	g_return_if_fail (stream_interactor != NULL);
	_tmp0_ = dino_contact_models_new (stream_interactor);
	m = _tmp0_;
	dino_stream_interactor_add_module (stream_interactor, (DinoStreamInteractionModule*) m);
	_g_object_unref0 (m);
}

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

static void
__lambda140_ (DinoContactModels* self,
              DinoEntitiesAccount* account,
              XmppJid* jid)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	dino_contact_models_check_update_models (self, account, jid, DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT);
}

static void
___lambda140__dino_muc_manager_room_info_updated (DinoMucManager* _sender,
                                                  DinoEntitiesAccount* account,
                                                  XmppJid* muc_jid,
                                                  gpointer self)
{
	__lambda140_ ((DinoContactModels*) self, account, muc_jid);
}

static void
__lambda141_ (DinoContactModels* self,
              DinoEntitiesAccount* account,
              XmppJid* room,
              XmppJid* occupant)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (room != NULL);
	g_return_if_fail (occupant != NULL);
	dino_contact_models_check_update_models (self, account, room, DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT);
}

static void
___lambda141__dino_muc_manager_private_room_occupant_updated (DinoMucManager* _sender,
                                                              DinoEntitiesAccount* account,
                                                              XmppJid* room,
                                                              XmppJid* occupant,
                                                              gpointer self)
{
	__lambda141_ ((DinoContactModels*) self, account, room, occupant);
}

static void
__lambda142_ (DinoContactModels* self,
              DinoEntitiesAccount* account,
              XmppJid* jid,
              const gchar* subject)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	dino_contact_models_check_update_models (self, account, jid, DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT);
}

static void
___lambda142__dino_muc_manager_subject_set (DinoMucManager* _sender,
                                            DinoEntitiesAccount* account,
                                            XmppJid* jid,
                                            const gchar* subject,
                                            gpointer self)
{
	__lambda142_ ((DinoContactModels*) self, account, jid, subject);
}

static void
__lambda143_ (DinoContactModels* self,
              DinoEntitiesAccount* account,
              XmppJid* jid,
              XmppRosterItem* roster_item)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (roster_item != NULL);
	dino_contact_models_check_update_models (self, account, jid, DINO_ENTITIES_CONVERSATION_TYPE_CHAT);
}

static void
___lambda143__dino_roster_manager_updated_roster_item (DinoRosterManager* _sender,
                                                       DinoEntitiesAccount* account,
                                                       XmppJid* jid,
                                                       XmppRosterItem* roster_item,
                                                       gpointer self)
{
	__lambda143_ ((DinoContactModels*) self, account, jid, roster_item);
}

static DinoContactModels*
dino_contact_models_construct (GType object_type,
                               DinoStreamInteractor* stream_interactor)
{
	DinoContactModels * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoMucManager* _tmp3_;
	DinoModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	DinoMucManager* _tmp6_;
	DinoModuleIdentity* _tmp7_;
	gpointer _tmp8_;
	DinoMucManager* _tmp9_;
	DinoModuleIdentity* _tmp10_;
	gpointer _tmp11_;
	DinoRosterManager* _tmp12_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	self = (DinoContactModels*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	_tmp1_ = dino_muc_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoMucManager*) _tmp2_;
	g_signal_connect_object (_tmp3_, "room-info-updated", (GCallback) ___lambda140__dino_muc_manager_room_info_updated, self, 0);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = dino_muc_manager_IDENTITY;
	_tmp5_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
	_tmp6_ = (DinoMucManager*) _tmp5_;
	g_signal_connect_object (_tmp6_, "private-room-occupant-updated", (GCallback) ___lambda141__dino_muc_manager_private_room_occupant_updated, self, 0);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = dino_muc_manager_IDENTITY;
	_tmp8_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp7_);
	_tmp9_ = (DinoMucManager*) _tmp8_;
	g_signal_connect_object (_tmp9_, "subject-set", (GCallback) ___lambda142__dino_muc_manager_subject_set, self, 0);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = dino_roster_manager_IDENTITY;
	_tmp11_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_ROSTER_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp10_);
	_tmp12_ = (DinoRosterManager*) _tmp11_;
	g_signal_connect_object (_tmp12_, "updated-roster-item", (GCallback) ___lambda143__dino_roster_manager_updated_roster_item, self, 0);
	_g_object_unref0 (_tmp12_);
	return self;
}

static DinoContactModels*
dino_contact_models_new (DinoStreamInteractor* stream_interactor)
{
	return dino_contact_models_construct (DINO_TYPE_CONTACT_MODELS, stream_interactor);
}

static void
dino_contact_models_check_update_models (DinoContactModels* self,
                                         DinoEntitiesAccount* account,
                                         XmppJid* jid,
                                         DinoEntitiesConversationType conversation_ty)
{
	DinoEntitiesConversation* conversation = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	DinoEntitiesConversation* _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	DinoModelConversationDisplayName* display_name_model = NULL;
	GeeHashMap* _tmp7_;
	DinoEntitiesConversation* _tmp8_;
	gpointer _tmp9_;
	DinoModelConversationDisplayName* _tmp10_;
	DinoModelConversationDisplayName* _tmp11_;
	DinoStreamInteractor* _tmp12_;
	DinoEntitiesConversation* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_conversation_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoConversationManager*) _tmp2_;
	_tmp4_ = dino_conversation_manager_get_conversation (_tmp3_, jid, account, &conversation_ty);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp3_);
	conversation = _tmp5_;
	_tmp6_ = conversation;
	if (_tmp6_ == NULL) {
		_g_object_unref0 (conversation);
		return;
	}
	_tmp7_ = self->priv->conversation_models;
	_tmp8_ = conversation;
	_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, _tmp8_);
	display_name_model = (DinoModelConversationDisplayName*) _tmp9_;
	_tmp10_ = display_name_model;
	if (_tmp10_ == NULL) {
		_g_object_unref0 (display_name_model);
		_g_object_unref0 (conversation);
		return;
	}
	_tmp11_ = display_name_model;
	_tmp12_ = self->priv->stream_interactor;
	_tmp13_ = conversation;
	_tmp14_ = dino_get_conversation_display_name (_tmp12_, _tmp13_, "%s (%s)");
	_tmp15_ = _tmp14_;
	dino_model_conversation_display_name_set_display_name (_tmp11_, _tmp15_);
	_g_free0 (_tmp15_);
	_g_object_unref0 (display_name_model);
	_g_object_unref0 (conversation);
}

DinoModelConversationDisplayName*
dino_contact_models_get_display_name_model (DinoContactModels* self,
                                            DinoEntitiesConversation* conversation)
{
	GeeHashMap* _tmp0_;
	DinoModelConversationDisplayName* model = NULL;
	DinoModelConversationDisplayName* _tmp3_;
	DinoModelConversationDisplayName* _tmp4_;
	DinoStreamInteractor* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GeeHashMap* _tmp8_;
	DinoModelConversationDisplayName* _tmp9_;
	DinoModelConversationDisplayName* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	_tmp0_ = self->priv->conversation_models;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, conversation)) {
		GeeHashMap* _tmp1_;
		gpointer _tmp2_;
		_tmp1_ = self->priv->conversation_models;
		_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, conversation);
		result = (DinoModelConversationDisplayName*) _tmp2_;
		return result;
	}
	_tmp3_ = dino_model_conversation_display_name_new ();
	model = _tmp3_;
	_tmp4_ = model;
	_tmp5_ = self->priv->stream_interactor;
	_tmp6_ = dino_get_conversation_display_name (_tmp5_, conversation, "%s (%s)");
	_tmp7_ = _tmp6_;
	dino_model_conversation_display_name_set_display_name (_tmp4_, _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = self->priv->conversation_models;
	_tmp9_ = model;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, conversation, _tmp9_);
	result = model;
	return result;
}

static const gchar*
dino_contact_models_real_get_id (DinoStreamInteractionModule* base)
{
	const gchar* result;
	DinoContactModels* self;
	DinoModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (DinoContactModels*) base;
	_tmp0_ = dino_contact_models_IDENTITY;
	_tmp1_ = dino_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
dino_contact_models_class_init (DinoContactModelsClass * klass,
                                gpointer klass_data)
{
	DinoModuleIdentity* _tmp0_;
	dino_contact_models_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoContactModels_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_contact_models_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_contact_models_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_CONTACT_MODELS_ID_PROPERTY, dino_contact_models_properties[DINO_CONTACT_MODELS_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	_tmp0_ = dino_module_identity_new (DINO_TYPE_CONTACT_MODELS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "contact_models");
	dino_contact_models_IDENTITY = _tmp0_;
}

static void
dino_contact_models_dino_stream_interaction_module_interface_init (DinoStreamInteractionModuleIface * iface,
                                                                   gpointer iface_data)
{
	dino_contact_models_dino_stream_interaction_module_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_id = dino_contact_models_real_get_id;
}

static void
dino_contact_models_instance_init (DinoContactModels * self,
                                   gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = dino_contact_models_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (DINO_ENTITIES_TYPE_CONVERSATION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, DINO_MODEL_TYPE_CONVERSATION_DISPLAY_NAME, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_conversation_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_conversation_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->conversation_models = _tmp0_;
}

static void
dino_contact_models_finalize (GObject * obj)
{
	DinoContactModels * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_CONTACT_MODELS, DinoContactModels);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->conversation_models);
	G_OBJECT_CLASS (dino_contact_models_parent_class)->finalize (obj);
}

static GType
dino_contact_models_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoContactModelsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_contact_models_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoContactModels), 0, (GInstanceInitFunc) dino_contact_models_instance_init, NULL };
	static const GInterfaceInfo dino_stream_interaction_module_info = { (GInterfaceInitFunc) dino_contact_models_dino_stream_interaction_module_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_contact_models_type_id;
	dino_contact_models_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoContactModels", &g_define_type_info, 0);
	g_type_add_interface_static (dino_contact_models_type_id, DINO_TYPE_STREAM_INTERACTION_MODULE, &dino_stream_interaction_module_info);
	DinoContactModels_private_offset = g_type_add_instance_private (dino_contact_models_type_id, sizeof (DinoContactModelsPrivate));
	return dino_contact_models_type_id;
}

GType
dino_contact_models_get_type (void)
{
	static volatile gsize dino_contact_models_type_id__once = 0;
	if (g_once_init_enter (&dino_contact_models_type_id__once)) {
		GType dino_contact_models_type_id;
		dino_contact_models_type_id = dino_contact_models_get_type_once ();
		g_once_init_leave (&dino_contact_models_type_id__once, dino_contact_models_type_id);
	}
	return dino_contact_models_type_id__once;
}

static void
_vala_dino_contact_models_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	DinoContactModels * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_TYPE_CONTACT_MODELS, DinoContactModels);
	switch (property_id) {
		case DINO_CONTACT_MODELS_ID_PROPERTY:
		g_value_set_string (value, dino_stream_interaction_module_get_id ((DinoStreamInteractionModule*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

