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

#include <glib-object.h>
#include "libdino.h"
#include <glib.h>
#include <gee.h>
#include <stdlib.h>
#include <string.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_PROVIDER (dino_ui_conversation_summary_content_provider_get_type ())
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_PROVIDER, DinoUiConversationSummaryContentProvider))
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_PROVIDER, DinoUiConversationSummaryContentProviderClass))
#define DINO_UI_CONVERSATION_SUMMARY_IS_CONTENT_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_PROVIDER))
#define DINO_UI_CONVERSATION_SUMMARY_IS_CONTENT_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_PROVIDER))
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_PROVIDER, DinoUiConversationSummaryContentProviderClass))

typedef struct _DinoUiConversationSummaryContentProvider DinoUiConversationSummaryContentProvider;
typedef struct _DinoUiConversationSummaryContentProviderClass DinoUiConversationSummaryContentProviderClass;
typedef struct _DinoUiConversationSummaryContentProviderPrivate DinoUiConversationSummaryContentProviderPrivate;
enum  {
	DINO_UI_CONVERSATION_SUMMARY_CONTENT_PROVIDER_0_PROPERTY,
	DINO_UI_CONVERSATION_SUMMARY_CONTENT_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* dino_ui_conversation_summary_content_provider_properties[DINO_UI_CONVERSATION_SUMMARY_CONTENT_PROVIDER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM (dino_ui_conversation_summary_content_meta_item_get_type ())
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, DinoUiConversationSummaryContentMetaItem))
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, DinoUiConversationSummaryContentMetaItemClass))
#define DINO_UI_CONVERSATION_SUMMARY_IS_CONTENT_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM))
#define DINO_UI_CONVERSATION_SUMMARY_IS_CONTENT_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM))
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, DinoUiConversationSummaryContentMetaItemClass))

typedef struct _DinoUiConversationSummaryContentMetaItem DinoUiConversationSummaryContentMetaItem;
typedef struct _DinoUiConversationSummaryContentMetaItemClass DinoUiConversationSummaryContentMetaItemClass;

#define DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM (dino_ui_conversation_summary_message_meta_item_get_type ())
#define DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM, DinoUiConversationSummaryMessageMetaItem))
#define DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM, DinoUiConversationSummaryMessageMetaItemClass))
#define DINO_UI_CONVERSATION_SUMMARY_IS_MESSAGE_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM))
#define DINO_UI_CONVERSATION_SUMMARY_IS_MESSAGE_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM))
#define DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM, DinoUiConversationSummaryMessageMetaItemClass))

typedef struct _DinoUiConversationSummaryMessageMetaItem DinoUiConversationSummaryMessageMetaItem;
typedef struct _DinoUiConversationSummaryMessageMetaItemClass DinoUiConversationSummaryMessageMetaItemClass;

#define DINO_UI_TYPE_FILE_META_ITEM (dino_ui_file_meta_item_get_type ())
#define DINO_UI_FILE_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_FILE_META_ITEM, DinoUiFileMetaItem))
#define DINO_UI_FILE_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_FILE_META_ITEM, DinoUiFileMetaItemClass))
#define DINO_UI_IS_FILE_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_FILE_META_ITEM))
#define DINO_UI_IS_FILE_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_FILE_META_ITEM))
#define DINO_UI_FILE_META_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_FILE_META_ITEM, DinoUiFileMetaItemClass))

typedef struct _DinoUiFileMetaItem DinoUiFileMetaItem;
typedef struct _DinoUiFileMetaItemClass DinoUiFileMetaItemClass;

#define DINO_UI_TYPE_CALL_META_ITEM (dino_ui_call_meta_item_get_type ())
#define DINO_UI_CALL_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CALL_META_ITEM, DinoUiCallMetaItem))
#define DINO_UI_CALL_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CALL_META_ITEM, DinoUiCallMetaItemClass))
#define DINO_UI_IS_CALL_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CALL_META_ITEM))
#define DINO_UI_IS_CALL_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CALL_META_ITEM))
#define DINO_UI_CALL_META_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CALL_META_ITEM, DinoUiCallMetaItemClass))

typedef struct _DinoUiCallMetaItem DinoUiCallMetaItem;
typedef struct _DinoUiCallMetaItemClass DinoUiCallMetaItemClass;
typedef struct _DinoUiConversationSummaryContentMetaItemPrivate DinoUiConversationSummaryContentMetaItemPrivate;
enum  {
	DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM_0_PROPERTY,
	DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM_NUM_PROPERTIES
};
static GParamSpec* dino_ui_conversation_summary_content_meta_item_properties[DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM_NUM_PROPERTIES];

struct _DinoUiConversationSummaryContentProvider {
	GObject parent_instance;
	DinoUiConversationSummaryContentProviderPrivate * priv;
};

struct _DinoUiConversationSummaryContentProviderClass {
	GObjectClass parent_class;
};

struct _DinoUiConversationSummaryContentProviderPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoEntitiesConversation* current_conversation;
	DinoPluginsConversationItemCollection* item_collection;
};

struct _DinoUiConversationSummaryContentMetaItem {
	DinoPluginsMetaConversationItem parent_instance;
	DinoUiConversationSummaryContentMetaItemPrivate * priv;
	DinoContentItem* content_item;
};

struct _DinoUiConversationSummaryContentMetaItemClass {
	DinoPluginsMetaConversationItemClass parent_class;
};

static gint DinoUiConversationSummaryContentProvider_private_offset;
static gpointer dino_ui_conversation_summary_content_provider_parent_class = NULL;
static DinoContentItemCollectionIface * dino_ui_conversation_summary_content_provider_dino_content_item_collection_parent_iface = NULL;
static gpointer dino_ui_conversation_summary_content_meta_item_parent_class = NULL;

VALA_EXTERN GType dino_ui_conversation_summary_content_provider_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiConversationSummaryContentProvider, g_object_unref)
VALA_EXTERN DinoUiConversationSummaryContentProvider* dino_ui_conversation_summary_content_provider_new (DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiConversationSummaryContentProvider* dino_ui_conversation_summary_content_provider_construct (GType object_type,
                                                                                                   DinoStreamInteractor* stream_interactor);
VALA_EXTERN void dino_ui_conversation_summary_content_provider_init (DinoUiConversationSummaryContentProvider* self,
                                                         DinoPluginsConversationItemCollection* item_collection,
                                                         DinoEntitiesConversation* conversation,
                                                         DinoPluginsWidgetType type);
static void dino_ui_conversation_summary_content_provider_real_insert_item (DinoContentItemCollection* base,
                                                                     DinoContentItem* item);
VALA_EXTERN GType dino_ui_conversation_summary_content_meta_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiConversationSummaryContentMetaItem, g_object_unref)
static DinoUiConversationSummaryContentMetaItem* dino_ui_conversation_summary_content_provider_create_content_meta_item (DinoUiConversationSummaryContentProvider* self,
                                                                                                                  DinoContentItem* content_item);
static void dino_ui_conversation_summary_content_provider_real_remove_item (DinoContentItemCollection* base,
                                                                     DinoContentItem* item);
VALA_EXTERN GeeList* dino_ui_conversation_summary_content_provider_populate_latest (DinoUiConversationSummaryContentProvider* self,
                                                                        DinoEntitiesConversation* conversation,
                                                                        gint n);
VALA_EXTERN GeeList* dino_ui_conversation_summary_content_provider_populate_before (DinoUiConversationSummaryContentProvider* self,
                                                                        DinoEntitiesConversation* conversation,
                                                                        DinoContentItem* before_item,
                                                                        gint n);
VALA_EXTERN GeeList* dino_ui_conversation_summary_content_provider_populate_after (DinoUiConversationSummaryContentProvider* self,
                                                                       DinoEntitiesConversation* conversation,
                                                                       DinoContentItem* after_item,
                                                                       gint n);
VALA_EXTERN DinoUiConversationSummaryContentMetaItem* dino_ui_conversation_summary_content_provider_get_content_meta_item (DinoUiConversationSummaryContentProvider* self,
                                                                                                               DinoContentItem* content_item);
VALA_EXTERN DinoUiConversationSummaryMessageMetaItem* dino_ui_conversation_summary_message_meta_item_new (DinoContentItem* content_item,
                                                                                              DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiConversationSummaryMessageMetaItem* dino_ui_conversation_summary_message_meta_item_construct (GType object_type,
                                                                                                    DinoContentItem* content_item,
                                                                                                    DinoStreamInteractor* stream_interactor);
VALA_EXTERN GType dino_ui_conversation_summary_message_meta_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiConversationSummaryMessageMetaItem, g_object_unref)
VALA_EXTERN DinoUiFileMetaItem* dino_ui_file_meta_item_new (DinoContentItem* content_item,
                                                DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiFileMetaItem* dino_ui_file_meta_item_construct (GType object_type,
                                                      DinoContentItem* content_item,
                                                      DinoStreamInteractor* stream_interactor);
VALA_EXTERN GType dino_ui_file_meta_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiFileMetaItem, g_object_unref)
VALA_EXTERN DinoUiCallMetaItem* dino_ui_call_meta_item_new (DinoContentItem* content_item,
                                                DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiCallMetaItem* dino_ui_call_meta_item_construct (GType object_type,
                                                      DinoContentItem* content_item,
                                                      DinoStreamInteractor* stream_interactor);
VALA_EXTERN GType dino_ui_call_meta_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCallMetaItem, g_object_unref)
static void dino_ui_conversation_summary_content_provider_finalize (GObject * obj);
static GType dino_ui_conversation_summary_content_provider_get_type_once (void);
VALA_EXTERN DinoUiConversationSummaryContentMetaItem* dino_ui_conversation_summary_content_meta_item_construct (GType object_type,
                                                                                                    DinoContentItem* content_item);
static void dino_ui_conversation_summary_content_meta_item_finalize (GObject * obj);
static GType dino_ui_conversation_summary_content_meta_item_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_conversation_summary_content_provider_get_instance_private (DinoUiConversationSummaryContentProvider* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiConversationSummaryContentProvider_private_offset);
}

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

DinoUiConversationSummaryContentProvider*
dino_ui_conversation_summary_content_provider_construct (GType object_type,
                                                         DinoStreamInteractor* stream_interactor)
{
	DinoUiConversationSummaryContentProvider * self = NULL;
	DinoStreamInteractor* _tmp0_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	self = (DinoUiConversationSummaryContentProvider*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	return self;
}

DinoUiConversationSummaryContentProvider*
dino_ui_conversation_summary_content_provider_new (DinoStreamInteractor* stream_interactor)
{
	return dino_ui_conversation_summary_content_provider_construct (DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_PROVIDER, stream_interactor);
}

void
dino_ui_conversation_summary_content_provider_init (DinoUiConversationSummaryContentProvider* self,
                                                    DinoPluginsConversationItemCollection* item_collection,
                                                    DinoEntitiesConversation* conversation,
                                                    DinoPluginsWidgetType type)
{
	DinoEntitiesConversation* _tmp0_;
	DinoEntitiesConversation* _tmp6_;
	DinoPluginsConversationItemCollection* _tmp7_;
	DinoStreamInteractor* _tmp8_;
	DinoModuleIdentity* _tmp9_;
	gpointer _tmp10_;
	DinoContentItemStore* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item_collection != NULL);
	g_return_if_fail (conversation != NULL);
	_tmp0_ = self->priv->current_conversation;
	if (_tmp0_ != NULL) {
		DinoStreamInteractor* _tmp1_;
		DinoModuleIdentity* _tmp2_;
		gpointer _tmp3_;
		DinoContentItemStore* _tmp4_;
		DinoEntitiesConversation* _tmp5_;
		_tmp1_ = self->priv->stream_interactor;
		_tmp2_ = dino_content_item_store_IDENTITY;
		_tmp3_ = dino_stream_interactor_get_module (_tmp1_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
		_tmp4_ = (DinoContentItemStore*) _tmp3_;
		_tmp5_ = self->priv->current_conversation;
		dino_content_item_store_uninit (_tmp4_, _tmp5_, (DinoContentItemCollection*) self);
		_g_object_unref0 (_tmp4_);
	}
	_tmp6_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->current_conversation);
	self->priv->current_conversation = _tmp6_;
	_tmp7_ = _g_object_ref0 (item_collection);
	_g_object_unref0 (self->priv->item_collection);
	self->priv->item_collection = _tmp7_;
	_tmp8_ = self->priv->stream_interactor;
	_tmp9_ = dino_content_item_store_IDENTITY;
	_tmp10_ = dino_stream_interactor_get_module (_tmp8_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp9_);
	_tmp11_ = (DinoContentItemStore*) _tmp10_;
	dino_content_item_store_init (_tmp11_, conversation, (DinoContentItemCollection*) self);
	_g_object_unref0 (_tmp11_);
}

static void
dino_ui_conversation_summary_content_provider_real_insert_item (DinoContentItemCollection* base,
                                                                DinoContentItem* item)
{
	DinoUiConversationSummaryContentProvider * self;
	DinoPluginsConversationItemCollection* _tmp0_;
	DinoUiConversationSummaryContentMetaItem* _tmp1_;
	DinoUiConversationSummaryContentMetaItem* _tmp2_;
	self = (DinoUiConversationSummaryContentProvider*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->item_collection;
	_tmp1_ = dino_ui_conversation_summary_content_provider_create_content_meta_item (self, item);
	_tmp2_ = _tmp1_;
	dino_plugins_conversation_item_collection_insert_item (_tmp0_, (DinoPluginsMetaConversationItem*) _tmp2_);
	_g_object_unref0 (_tmp2_);
}

static void
dino_ui_conversation_summary_content_provider_real_remove_item (DinoContentItemCollection* base,
                                                                DinoContentItem* item)
{
	DinoUiConversationSummaryContentProvider * self;
	self = (DinoUiConversationSummaryContentProvider*) base;
	g_return_if_fail (item != NULL);
}

GeeList*
dino_ui_conversation_summary_content_provider_populate_latest (DinoUiConversationSummaryContentProvider* self,
                                                               DinoEntitiesConversation* conversation,
                                                               gint n)
{
	GeeList* items = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoContentItemStore* _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	GeeList* ret = NULL;
	GeeArrayList* _tmp6_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_content_item_store_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoContentItemStore*) _tmp2_;
	_tmp4_ = dino_content_item_store_get_n_latest (_tmp3_, conversation, n);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp3_);
	items = _tmp5_;
	_tmp6_ = gee_array_list_new (DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	ret = (GeeList*) _tmp6_;
	{
		GeeList* _item_list = NULL;
		GeeList* _tmp7_;
		gint _item_size = 0;
		GeeList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _item_index = 0;
		_tmp7_ = items;
		_item_list = _tmp7_;
		_tmp8_ = _item_list;
		_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		_item_size = _tmp10_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			DinoContentItem* item = NULL;
			GeeList* _tmp13_;
			gpointer _tmp14_;
			GeeList* _tmp15_;
			DinoContentItem* _tmp16_;
			DinoUiConversationSummaryContentMetaItem* _tmp17_;
			DinoUiConversationSummaryContentMetaItem* _tmp18_;
			_item_index = _item_index + 1;
			_tmp11_ = _item_index;
			_tmp12_ = _item_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _item_list;
			_tmp14_ = gee_list_get (_tmp13_, _item_index);
			item = (DinoContentItem*) _tmp14_;
			_tmp15_ = ret;
			_tmp16_ = item;
			_tmp17_ = dino_ui_conversation_summary_content_provider_create_content_meta_item (self, _tmp16_);
			_tmp18_ = _tmp17_;
			gee_collection_add ((GeeCollection*) _tmp15_, _tmp18_);
			_g_object_unref0 (_tmp18_);
			_g_object_unref0 (item);
		}
	}
	result = ret;
	_g_object_unref0 (items);
	return result;
}

GeeList*
dino_ui_conversation_summary_content_provider_populate_before (DinoUiConversationSummaryContentProvider* self,
                                                               DinoEntitiesConversation* conversation,
                                                               DinoContentItem* before_item,
                                                               gint n)
{
	GeeList* ret = NULL;
	GeeArrayList* _tmp0_;
	GeeList* items = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoContentItemStore* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	g_return_val_if_fail (before_item != NULL, NULL);
	_tmp0_ = gee_array_list_new (DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	ret = (GeeList*) _tmp0_;
	_tmp1_ = self->priv->stream_interactor;
	_tmp2_ = dino_content_item_store_IDENTITY;
	_tmp3_ = dino_stream_interactor_get_module (_tmp1_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (DinoContentItemStore*) _tmp3_;
	_tmp5_ = dino_content_item_store_get_before (_tmp4_, conversation, before_item, n);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp4_);
	items = _tmp6_;
	{
		GeeList* _item_list = NULL;
		GeeList* _tmp7_;
		gint _item_size = 0;
		GeeList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _item_index = 0;
		_tmp7_ = items;
		_item_list = _tmp7_;
		_tmp8_ = _item_list;
		_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		_item_size = _tmp10_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			DinoContentItem* item = NULL;
			GeeList* _tmp13_;
			gpointer _tmp14_;
			GeeList* _tmp15_;
			DinoContentItem* _tmp16_;
			DinoUiConversationSummaryContentMetaItem* _tmp17_;
			DinoUiConversationSummaryContentMetaItem* _tmp18_;
			_item_index = _item_index + 1;
			_tmp11_ = _item_index;
			_tmp12_ = _item_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _item_list;
			_tmp14_ = gee_list_get (_tmp13_, _item_index);
			item = (DinoContentItem*) _tmp14_;
			_tmp15_ = ret;
			_tmp16_ = item;
			_tmp17_ = dino_ui_conversation_summary_content_provider_create_content_meta_item (self, _tmp16_);
			_tmp18_ = _tmp17_;
			gee_collection_add ((GeeCollection*) _tmp15_, _tmp18_);
			_g_object_unref0 (_tmp18_);
			_g_object_unref0 (item);
		}
	}
	result = ret;
	_g_object_unref0 (items);
	return result;
}

GeeList*
dino_ui_conversation_summary_content_provider_populate_after (DinoUiConversationSummaryContentProvider* self,
                                                              DinoEntitiesConversation* conversation,
                                                              DinoContentItem* after_item,
                                                              gint n)
{
	GeeList* ret = NULL;
	GeeArrayList* _tmp0_;
	GeeList* items = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoContentItemStore* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	g_return_val_if_fail (after_item != NULL, NULL);
	_tmp0_ = gee_array_list_new (DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	ret = (GeeList*) _tmp0_;
	_tmp1_ = self->priv->stream_interactor;
	_tmp2_ = dino_content_item_store_IDENTITY;
	_tmp3_ = dino_stream_interactor_get_module (_tmp1_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (DinoContentItemStore*) _tmp3_;
	_tmp5_ = dino_content_item_store_get_after (_tmp4_, conversation, after_item, n);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp4_);
	items = _tmp6_;
	{
		GeeList* _item_list = NULL;
		GeeList* _tmp7_;
		gint _item_size = 0;
		GeeList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _item_index = 0;
		_tmp7_ = items;
		_item_list = _tmp7_;
		_tmp8_ = _item_list;
		_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		_item_size = _tmp10_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			DinoContentItem* item = NULL;
			GeeList* _tmp13_;
			gpointer _tmp14_;
			GeeList* _tmp15_;
			DinoContentItem* _tmp16_;
			DinoUiConversationSummaryContentMetaItem* _tmp17_;
			DinoUiConversationSummaryContentMetaItem* _tmp18_;
			_item_index = _item_index + 1;
			_tmp11_ = _item_index;
			_tmp12_ = _item_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _item_list;
			_tmp14_ = gee_list_get (_tmp13_, _item_index);
			item = (DinoContentItem*) _tmp14_;
			_tmp15_ = ret;
			_tmp16_ = item;
			_tmp17_ = dino_ui_conversation_summary_content_provider_create_content_meta_item (self, _tmp16_);
			_tmp18_ = _tmp17_;
			gee_collection_add ((GeeCollection*) _tmp15_, _tmp18_);
			_g_object_unref0 (_tmp18_);
			_g_object_unref0 (item);
		}
	}
	result = ret;
	_g_object_unref0 (items);
	return result;
}

DinoUiConversationSummaryContentMetaItem*
dino_ui_conversation_summary_content_provider_get_content_meta_item (DinoUiConversationSummaryContentProvider* self,
                                                                     DinoContentItem* content_item)
{
	DinoUiConversationSummaryContentMetaItem* _tmp0_;
	DinoUiConversationSummaryContentMetaItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (content_item != NULL, NULL);
	_tmp0_ = dino_ui_conversation_summary_content_provider_create_content_meta_item (self, content_item);
	result = _tmp0_;
	return result;
}

static DinoUiConversationSummaryContentMetaItem*
dino_ui_conversation_summary_content_provider_create_content_meta_item (DinoUiConversationSummaryContentProvider* self,
                                                                        DinoContentItem* content_item)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	DinoUiConversationSummaryContentMetaItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (content_item != NULL, NULL);
	_tmp0_ = dino_content_item_get_type_ (content_item);
	_tmp1_ = _tmp0_;
	if (g_strcmp0 (_tmp1_, DINO_MESSAGE_ITEM_TYPE) == 0) {
		DinoStreamInteractor* _tmp2_;
		DinoUiConversationSummaryMessageMetaItem* _tmp3_;
		_tmp2_ = self->priv->stream_interactor;
		_tmp3_ = dino_ui_conversation_summary_message_meta_item_new (content_item, _tmp2_);
		result = (DinoUiConversationSummaryContentMetaItem*) _tmp3_;
		return result;
	} else {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = dino_content_item_get_type_ (content_item);
		_tmp5_ = _tmp4_;
		if (g_strcmp0 (_tmp5_, DINO_FILE_ITEM_TYPE) == 0) {
			DinoStreamInteractor* _tmp6_;
			DinoUiFileMetaItem* _tmp7_;
			_tmp6_ = self->priv->stream_interactor;
			_tmp7_ = dino_ui_file_meta_item_new (content_item, _tmp6_);
			result = (DinoUiConversationSummaryContentMetaItem*) _tmp7_;
			return result;
		} else {
			const gchar* _tmp8_;
			const gchar* _tmp9_;
			_tmp8_ = dino_content_item_get_type_ (content_item);
			_tmp9_ = _tmp8_;
			if (g_strcmp0 (_tmp9_, DINO_CALL_ITEM_TYPE) == 0) {
				DinoStreamInteractor* _tmp10_;
				DinoUiCallMetaItem* _tmp11_;
				_tmp10_ = self->priv->stream_interactor;
				_tmp11_ = dino_ui_call_meta_item_new (content_item, _tmp10_);
				result = (DinoUiConversationSummaryContentMetaItem*) _tmp11_;
				return result;
			}
		}
	}
	_tmp12_ = dino_content_item_get_type_ (content_item);
	_tmp13_ = _tmp12_;
	g_critical ("content_populator.vala:74: Got unknown content item type %s", _tmp13_);
	result = NULL;
	return result;
}

static void
dino_ui_conversation_summary_content_provider_class_init (DinoUiConversationSummaryContentProviderClass * klass,
                                                          gpointer klass_data)
{
	dino_ui_conversation_summary_content_provider_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiConversationSummaryContentProvider_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_conversation_summary_content_provider_finalize;
}

static void
dino_ui_conversation_summary_content_provider_dino_content_item_collection_interface_init (DinoContentItemCollectionIface * iface,
                                                                                           gpointer iface_data)
{
	dino_ui_conversation_summary_content_provider_dino_content_item_collection_parent_iface = g_type_interface_peek_parent (iface);
	iface->insert_item = (void (*) (DinoContentItemCollection*, DinoContentItem*)) dino_ui_conversation_summary_content_provider_real_insert_item;
	iface->remove_item = (void (*) (DinoContentItemCollection*, DinoContentItem*)) dino_ui_conversation_summary_content_provider_real_remove_item;
}

static void
dino_ui_conversation_summary_content_provider_instance_init (DinoUiConversationSummaryContentProvider * self,
                                                             gpointer klass)
{
	self->priv = dino_ui_conversation_summary_content_provider_get_instance_private (self);
}

static void
dino_ui_conversation_summary_content_provider_finalize (GObject * obj)
{
	DinoUiConversationSummaryContentProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_PROVIDER, DinoUiConversationSummaryContentProvider);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->current_conversation);
	_g_object_unref0 (self->priv->item_collection);
	G_OBJECT_CLASS (dino_ui_conversation_summary_content_provider_parent_class)->finalize (obj);
}

static GType
dino_ui_conversation_summary_content_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiConversationSummaryContentProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_conversation_summary_content_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiConversationSummaryContentProvider), 0, (GInstanceInitFunc) dino_ui_conversation_summary_content_provider_instance_init, NULL };
	static const GInterfaceInfo dino_content_item_collection_info = { (GInterfaceInitFunc) dino_ui_conversation_summary_content_provider_dino_content_item_collection_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_ui_conversation_summary_content_provider_type_id;
	dino_ui_conversation_summary_content_provider_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiConversationSummaryContentProvider", &g_define_type_info, 0);
	g_type_add_interface_static (dino_ui_conversation_summary_content_provider_type_id, DINO_TYPE_CONTENT_ITEM_COLLECTION, &dino_content_item_collection_info);
	DinoUiConversationSummaryContentProvider_private_offset = g_type_add_instance_private (dino_ui_conversation_summary_content_provider_type_id, sizeof (DinoUiConversationSummaryContentProviderPrivate));
	return dino_ui_conversation_summary_content_provider_type_id;
}

GType
dino_ui_conversation_summary_content_provider_get_type (void)
{
	static volatile gsize dino_ui_conversation_summary_content_provider_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_conversation_summary_content_provider_type_id__once)) {
		GType dino_ui_conversation_summary_content_provider_type_id;
		dino_ui_conversation_summary_content_provider_type_id = dino_ui_conversation_summary_content_provider_get_type_once ();
		g_once_init_leave (&dino_ui_conversation_summary_content_provider_type_id__once, dino_ui_conversation_summary_content_provider_type_id);
	}
	return dino_ui_conversation_summary_content_provider_type_id__once;
}

DinoUiConversationSummaryContentMetaItem*
dino_ui_conversation_summary_content_meta_item_construct (GType object_type,
                                                          DinoContentItem* content_item)
{
	DinoUiConversationSummaryContentMetaItem * self = NULL;
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	DinoEntitiesEncryption _tmp6_;
	DinoEntitiesEncryption _tmp7_;
	DinoEntitiesMessageMarked _tmp8_;
	DinoEntitiesMessageMarked _tmp9_;
	DinoContentItem* _tmp10_;
	g_return_val_if_fail (content_item != NULL, NULL);
	self = (DinoUiConversationSummaryContentMetaItem*) dino_plugins_meta_conversation_item_construct (object_type);
	_tmp0_ = dino_content_item_get_jid (content_item);
	_tmp1_ = _tmp0_;
	dino_plugins_meta_conversation_item_set_jid ((DinoPluginsMetaConversationItem*) self, _tmp1_);
	_tmp2_ = dino_content_item_get_time (content_item);
	_tmp3_ = _tmp2_;
	dino_plugins_meta_conversation_item_set_time ((DinoPluginsMetaConversationItem*) self, _tmp3_);
	_tmp4_ = dino_content_item_get_id (content_item);
	_tmp5_ = _tmp4_;
	dino_plugins_meta_conversation_item_set_secondary_sort_indicator ((DinoPluginsMetaConversationItem*) self, _tmp5_);
	_tmp6_ = dino_content_item_get_encryption (content_item);
	_tmp7_ = _tmp6_;
	dino_plugins_meta_conversation_item_set_encryption ((DinoPluginsMetaConversationItem*) self, _tmp7_);
	_tmp8_ = dino_content_item_get_mark (content_item);
	_tmp9_ = _tmp8_;
	dino_plugins_meta_conversation_item_set_mark ((DinoPluginsMetaConversationItem*) self, _tmp9_);
	g_object_bind_property_with_closures ((GObject*) content_item, "mark", (GObject*) self, "mark", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) content_item, "encryption", (GObject*) self, "encryption", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	dino_plugins_meta_conversation_item_set_can_merge ((DinoPluginsMetaConversationItem*) self, TRUE);
	dino_plugins_meta_conversation_item_set_requires_avatar ((DinoPluginsMetaConversationItem*) self, TRUE);
	dino_plugins_meta_conversation_item_set_requires_header ((DinoPluginsMetaConversationItem*) self, TRUE);
	_tmp10_ = _g_object_ref0 (content_item);
	_g_object_unref0 (self->content_item);
	self->content_item = _tmp10_;
	return self;
}

static void
dino_ui_conversation_summary_content_meta_item_class_init (DinoUiConversationSummaryContentMetaItemClass * klass,
                                                           gpointer klass_data)
{
	dino_ui_conversation_summary_content_meta_item_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_conversation_summary_content_meta_item_finalize;
}

static void
dino_ui_conversation_summary_content_meta_item_instance_init (DinoUiConversationSummaryContentMetaItem * self,
                                                              gpointer klass)
{
}

static void
dino_ui_conversation_summary_content_meta_item_finalize (GObject * obj)
{
	DinoUiConversationSummaryContentMetaItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, DinoUiConversationSummaryContentMetaItem);
	_g_object_unref0 (self->content_item);
	G_OBJECT_CLASS (dino_ui_conversation_summary_content_meta_item_parent_class)->finalize (obj);
}

static GType
dino_ui_conversation_summary_content_meta_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiConversationSummaryContentMetaItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_conversation_summary_content_meta_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiConversationSummaryContentMetaItem), 0, (GInstanceInitFunc) dino_ui_conversation_summary_content_meta_item_instance_init, NULL };
	GType dino_ui_conversation_summary_content_meta_item_type_id;
	dino_ui_conversation_summary_content_meta_item_type_id = g_type_register_static (DINO_PLUGINS_TYPE_META_CONVERSATION_ITEM, "DinoUiConversationSummaryContentMetaItem", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return dino_ui_conversation_summary_content_meta_item_type_id;
}

GType
dino_ui_conversation_summary_content_meta_item_get_type (void)
{
	static volatile gsize dino_ui_conversation_summary_content_meta_item_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_conversation_summary_content_meta_item_type_id__once)) {
		GType dino_ui_conversation_summary_content_meta_item_type_id;
		dino_ui_conversation_summary_content_meta_item_type_id = dino_ui_conversation_summary_content_meta_item_get_type_once ();
		g_once_init_leave (&dino_ui_conversation_summary_content_meta_item_type_id__once, dino_ui_conversation_summary_content_meta_item_type_id);
	}
	return dino_ui_conversation_summary_content_meta_item_type_id__once;
}

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;
}

