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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>
#include <glib/gstdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
#include <stdio.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 DC_TYPE_MESSAGE_ROW (dc_message_row_get_type ())
#define DC_MESSAGE_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MESSAGE_ROW, DcMessageRow))
#define DC_MESSAGE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MESSAGE_ROW, DcMessageRowClass))
#define DC_IS_MESSAGE_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MESSAGE_ROW))
#define DC_IS_MESSAGE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MESSAGE_ROW))
#define DC_MESSAGE_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MESSAGE_ROW, DcMessageRowClass))

typedef struct _DcMessageRow DcMessageRow;
typedef struct _DcMessageRowClass DcMessageRowClass;
typedef struct _DcMessageRowPrivate DcMessageRowPrivate;
enum  {
	DC_MESSAGE_ROW_0_PROPERTY,
	DC_MESSAGE_ROW_MESSAGE_ID_PROPERTY,
	DC_MESSAGE_ROW_TIMESTAMP_PROPERTY,
	DC_MESSAGE_ROW_IS_OUTGOING_PROPERTY,
	DC_MESSAGE_ROW_FILE_PATH_PROPERTY,
	DC_MESSAGE_ROW_FILE_NAME_PROPERTY,
	DC_MESSAGE_ROW_MESSAGE_TEXT_PROPERTY,
	DC_MESSAGE_ROW_QUOTE_MSG_ID_PROPERTY,
	DC_MESSAGE_ROW_IS_IMAGE_PROPERTY,
	DC_MESSAGE_ROW_NUM_PROPERTIES
};
static GParamSpec* dc_message_row_properties[DC_MESSAGE_ROW_NUM_PROPERTIES];
typedef enum  {
	DC_MESSAGE_STYLE_BUBBLES = 0,
	DC_MESSAGE_STYLE_IRC = 1
} DcMessageStyle;

#define DC_TYPE_MESSAGE_STYLE (dc_message_style_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))

#define DC_TYPE_MESSAGE (dc_message_get_type ())
#define DC_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MESSAGE, DcMessage))
#define DC_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MESSAGE, DcMessageClass))
#define DC_IS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MESSAGE))
#define DC_IS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MESSAGE))
#define DC_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MESSAGE, DcMessageClass))

typedef struct _DcMessage DcMessage;
typedef struct _DcMessageClass DcMessageClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block14Data Block14Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))
typedef struct _Block15Data Block15Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
enum  {
	DC_MESSAGE_ROW_QUOTE_CLICKED_SIGNAL,
	DC_MESSAGE_ROW_NUM_SIGNALS
};
static guint dc_message_row_signals[DC_MESSAGE_ROW_NUM_SIGNALS] = {0};

struct _DcMessageRow {
	GtkBox parent_instance;
	DcMessageRowPrivate * priv;
};

struct _DcMessageRowClass {
	GtkBoxClass parent_class;
};

struct _DcMessageRowPrivate {
	gint _message_id;
	gint64 _timestamp;
	gboolean _is_outgoing;
	gchar* _file_path;
	gchar* _file_name;
	gchar* _message_text;
	gint _quote_msg_id;
	gboolean _is_image;
};

struct _Block14Data {
	int _ref_count_;
	DcMessageRow* self;
	gint qid;
};

struct _Block15Data {
	int _ref_count_;
	DcMessageRow* self;
	gint qid;
};

static gint DcMessageRow_private_offset;
static gpointer dc_message_row_parent_class = NULL;
VALA_EXTERN DcMessageStyle dc_message_row_style;
DcMessageStyle dc_message_row_style = DC_MESSAGE_STYLE_BUBBLES;
VALA_EXTERN gchar* dc_message_row_self_display_name;
gchar* dc_message_row_self_display_name = NULL;

VALA_EXTERN GType dc_message_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessageRow, g_object_unref)
VALA_EXTERN GType dc_message_style_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void dc_message_row_highlight (DcMessageRow* self);
static gboolean __lambda53_ (DcMessageRow* self);
static gboolean ___lambda53__gsource_func (gpointer self);
VALA_EXTERN GType dc_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessage, g_object_unref)
VALA_EXTERN DcMessageRow* dc_message_row_new (DcMessage* msg,
                                  DcMessage* prev,
                                  GPtrArray* trailing_images,
                                  gboolean is_image_continuation);
VALA_EXTERN DcMessageRow* dc_message_row_construct (GType object_type,
                                        DcMessage* msg,
                                        DcMessage* prev,
                                        GPtrArray* trailing_images,
                                        gboolean is_image_continuation);
VALA_EXTERN gint dc_message_get_id (DcMessage* self);
static void dc_message_row_set_message_id (DcMessageRow* self,
                                    gint value);
VALA_EXTERN gint64 dc_message_get_timestamp (DcMessage* self);
static void dc_message_row_set_timestamp (DcMessageRow* self,
                                   gint64 value);
VALA_EXTERN gboolean dc_message_get_is_outgoing (DcMessage* self);
static void dc_message_row_set_is_outgoing (DcMessageRow* self,
                                     gboolean value);
VALA_EXTERN const gchar* dc_message_get_file_path (DcMessage* self);
static void dc_message_row_set_file_path (DcMessageRow* self,
                                   const gchar* value);
VALA_EXTERN const gchar* dc_message_get_file_name (DcMessage* self);
static void dc_message_row_set_file_name (DcMessageRow* self,
                                   const gchar* value);
VALA_EXTERN const gchar* dc_message_get_text (DcMessage* self);
static void dc_message_row_set_message_text (DcMessageRow* self,
                                      const gchar* value);
VALA_EXTERN gint dc_message_get_quote_msg_id (DcMessage* self);
static void dc_message_row_set_quote_msg_id (DcMessageRow* self,
                                      gint value);
VALA_EXTERN gboolean dc_message_get_is_info (DcMessage* self);
static void dc_message_row_build_info_row (DcMessageRow* self,
                                    DcMessage* msg);
static void dc_message_row_build_irc_row (DcMessageRow* self,
                                   DcMessage* msg,
                                   DcMessage* prev,
                                   GPtrArray* trailing_images,
                                   gboolean is_image_continuation);
VALA_EXTERN const gchar* dc_message_get_sender_name (DcMessage* self);
VALA_EXTERN const gchar* dc_message_get_quote_text (DcMessage* self);
VALA_EXTERN const gchar* dc_message_get_quote_sender_name (DcMessage* self);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static void ____lambda55_ (Block14Data* _data14_);
static void _____lambda55__gtk_button_clicked (GtkButton* _sender,
                                        gpointer self);
VALA_EXTERN gboolean dc_message_row_is_image_file (DcMessage* msg);
static void dc_message_row_set_is_image (DcMessageRow* self,
                                  gboolean value);
static GtkBox* dc_message_row_build_file_indicator (DcMessage* msg);
VALA_EXTERN gchar* dc_markdown_format (const gchar* input);
VALA_EXTERN gboolean dc_message_get_is_pinned (DcMessage* self);
static gchar* dc_message_row_format_timestamp (gint64 ts);
static GtkLabel* dc_message_row_build_tick_indicator (DcMessage* msg);
VALA_EXTERN const gchar* dc_message_get_reactions (DcMessage* self);
static gchar* dc_message_row_effective_sender_name (DcMessage* msg);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static void ____lambda54_ (Block15Data* _data15_);
static void _____lambda54__gtk_button_clicked (GtkButton* _sender,
                                        gpointer self);
static void dc_message_row_append_irc_image (GtkBox* strip,
                                      DcMessage* m);
VALA_EXTERN gboolean dc_message_row_is_image_only_message (DcMessage* m);
VALA_EXTERN gboolean dc_message_row_same_irc_sender (DcMessage* a,
                                         DcMessage* b);
VALA_EXTERN const gchar* dc_message_get_file_mime (DcMessage* self);
VALA_EXTERN const gchar* dc_message_get_view_type (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_failed (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_read (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_delivered (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_pending (DcMessage* self);
VALA_EXTERN gint dc_message_row_get_message_id (DcMessageRow* self);
VALA_EXTERN gint64 dc_message_row_get_timestamp (DcMessageRow* self);
VALA_EXTERN gboolean dc_message_row_get_is_outgoing (DcMessageRow* self);
VALA_EXTERN const gchar* dc_message_row_get_file_path (DcMessageRow* self);
VALA_EXTERN const gchar* dc_message_row_get_file_name (DcMessageRow* self);
VALA_EXTERN const gchar* dc_message_row_get_message_text (DcMessageRow* self);
VALA_EXTERN gint dc_message_row_get_quote_msg_id (DcMessageRow* self);
VALA_EXTERN gboolean dc_message_row_get_is_image (DcMessageRow* self);
static void dc_message_row_finalize (GObject * obj);
static GType dc_message_row_get_type_once (void);
static void _vala_dc_message_row_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_dc_message_row_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static GRegex* _tmp_regex_0 = NULL;
static GRegex* _tmp_regex_1 = NULL;

static inline gpointer
dc_message_row_get_instance_private (DcMessageRow* self)
{
	return G_STRUCT_MEMBER_P (self, DcMessageRow_private_offset);
}

static gboolean
__lambda53_ (DcMessageRow* self)
{
	gboolean result;
	gtk_widget_remove_css_class ((GtkWidget*) self, "message-new");
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda53__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda53_ ((DcMessageRow*) self);
	return result;
}

void
dc_message_row_highlight (DcMessageRow* self)
{
	g_return_if_fail (self != NULL);
	gtk_widget_add_css_class ((GtkWidget*) self, "message-new");
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda53__gsource_func, g_object_ref (self), g_object_unref);
}

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_)) {
		DcMessageRow* self;
		self = _data14_->self;
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}

static void
____lambda55_ (Block14Data* _data14_)
{
	DcMessageRow* self;
	self = _data14_->self;
	g_signal_emit (self, dc_message_row_signals[DC_MESSAGE_ROW_QUOTE_CLICKED_SIGNAL], 0, _data14_->qid);
}

static void
_____lambda55__gtk_button_clicked (GtkButton* _sender,
                                   gpointer self)
{
	____lambda55_ (self);
}

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

DcMessageRow*
dc_message_row_construct (GType object_type,
                          DcMessage* msg,
                          DcMessage* prev,
                          GPtrArray* trailing_images,
                          gboolean is_image_continuation)
{
	DcMessageRow * self = NULL;
	gint _tmp0_;
	gint _tmp1_;
	gint64 _tmp2_;
	gint64 _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	gboolean outgoing = FALSE;
	gboolean _tmp16_;
	gboolean _tmp17_;
	GtkBox* bubble = NULL;
	GtkBox* _tmp18_;
	GtkBox* _tmp19_;
	const gchar* _tmp20_ = NULL;
	GtkBox* _tmp21_;
	gboolean _tmp22_ = FALSE;
	gboolean _tmp23_ = FALSE;
	gboolean _tmp38_ = FALSE;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	gboolean _tmp84_ = FALSE;
	gboolean _tmp85_ = FALSE;
	const gchar* _tmp86_;
	const gchar* _tmp87_;
	gboolean has_file = FALSE;
	gboolean _tmp130_ = FALSE;
	const gchar* _tmp131_;
	const gchar* _tmp132_;
	GtkBox* footer = NULL;
	GtkBox* _tmp159_;
	GtkBox* _tmp160_;
	gboolean _tmp161_;
	gboolean _tmp162_;
	gchar* time_str = NULL;
	gint64 _tmp167_;
	gint64 _tmp168_;
	gchar* _tmp169_;
	GtkLabel* time_lbl = NULL;
	const gchar* _tmp170_;
	GtkLabel* _tmp171_;
	GtkLabel* _tmp172_;
	GtkBox* _tmp173_;
	GtkLabel* _tmp174_;
	GtkBox* _tmp179_;
	GtkBox* _tmp180_;
	gboolean _tmp181_ = FALSE;
	const gchar* _tmp182_;
	const gchar* _tmp183_;
	GtkBox* _tmp225_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (msg != NULL, NULL);
	self = (DcMessageRow*) g_object_new (object_type, "orientation", GTK_ORIENTATION_HORIZONTAL, "spacing", 0, NULL);
	_tmp0_ = dc_message_get_id (msg);
	_tmp1_ = _tmp0_;
	dc_message_row_set_message_id (self, _tmp1_);
	_tmp2_ = dc_message_get_timestamp (msg);
	_tmp3_ = _tmp2_;
	dc_message_row_set_timestamp (self, _tmp3_);
	_tmp4_ = dc_message_get_is_outgoing (msg);
	_tmp5_ = _tmp4_;
	dc_message_row_set_is_outgoing (self, _tmp5_);
	_tmp6_ = dc_message_get_file_path (msg);
	_tmp7_ = _tmp6_;
	dc_message_row_set_file_path (self, _tmp7_);
	_tmp8_ = dc_message_get_file_name (msg);
	_tmp9_ = _tmp8_;
	dc_message_row_set_file_name (self, _tmp9_);
	_tmp10_ = dc_message_get_text (msg);
	_tmp11_ = _tmp10_;
	dc_message_row_set_message_text (self, _tmp11_);
	_tmp12_ = dc_message_get_quote_msg_id (msg);
	_tmp13_ = _tmp12_;
	dc_message_row_set_quote_msg_id (self, _tmp13_);
	_tmp14_ = dc_message_get_is_info (msg);
	_tmp15_ = _tmp14_;
	if (_tmp15_) {
		dc_message_row_build_info_row (self, msg);
		return self;
	}
	if (dc_message_row_style == DC_MESSAGE_STYLE_IRC) {
		dc_message_row_build_irc_row (self, msg, prev, trailing_images, is_image_continuation);
		return self;
	}
	_tmp16_ = dc_message_get_is_outgoing (msg);
	_tmp17_ = _tmp16_;
	outgoing = _tmp17_;
	gtk_widget_set_margin_start ((GtkWidget*) self, 8);
	gtk_widget_set_margin_end ((GtkWidget*) self, 8);
	gtk_widget_set_margin_top ((GtkWidget*) self, 2);
	gtk_widget_set_margin_bottom ((GtkWidget*) self, 2);
	_tmp18_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
	g_object_ref_sink (_tmp18_);
	bubble = _tmp18_;
	_tmp19_ = bubble;
	gtk_widget_add_css_class ((GtkWidget*) _tmp19_, "message-bubble");
	if (outgoing) {
		_tmp20_ = "outgoing";
	} else {
		_tmp20_ = "incoming";
	}
	_tmp21_ = bubble;
	gtk_widget_add_css_class ((GtkWidget*) _tmp21_, _tmp20_);
	if (!outgoing) {
		const gchar* _tmp24_;
		const gchar* _tmp25_;
		_tmp24_ = dc_message_get_sender_name (msg);
		_tmp25_ = _tmp24_;
		_tmp23_ = _tmp25_ != NULL;
	} else {
		_tmp23_ = FALSE;
	}
	if (_tmp23_) {
		const gchar* _tmp26_;
		const gchar* _tmp27_;
		gint _tmp28_;
		gint _tmp29_;
		_tmp26_ = dc_message_get_sender_name (msg);
		_tmp27_ = _tmp26_;
		_tmp28_ = strlen (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp22_ = _tmp29_ > 0;
	} else {
		_tmp22_ = FALSE;
	}
	if (_tmp22_) {
		GtkLabel* sender = NULL;
		const gchar* _tmp30_;
		const gchar* _tmp31_;
		GtkLabel* _tmp32_;
		GtkLabel* _tmp33_;
		GtkLabel* _tmp34_;
		GtkLabel* _tmp35_;
		GtkBox* _tmp36_;
		GtkLabel* _tmp37_;
		_tmp30_ = dc_message_get_sender_name (msg);
		_tmp31_ = _tmp30_;
		_tmp32_ = (GtkLabel*) gtk_label_new (_tmp31_);
		g_object_ref_sink (_tmp32_);
		sender = _tmp32_;
		_tmp33_ = sender;
		gtk_widget_add_css_class ((GtkWidget*) _tmp33_, "message-sender");
		_tmp34_ = sender;
		gtk_widget_set_halign ((GtkWidget*) _tmp34_, GTK_ALIGN_START);
		_tmp35_ = sender;
		gtk_label_set_xalign (_tmp35_, (gfloat) 0);
		_tmp36_ = bubble;
		_tmp37_ = sender;
		gtk_box_append (_tmp36_, (GtkWidget*) _tmp37_);
		_g_object_unref0 (sender);
	}
	_tmp39_ = dc_message_get_quote_text (msg);
	_tmp40_ = _tmp39_;
	if (_tmp40_ != NULL) {
		const gchar* _tmp41_;
		const gchar* _tmp42_;
		gint _tmp43_;
		gint _tmp44_;
		_tmp41_ = dc_message_get_quote_text (msg);
		_tmp42_ = _tmp41_;
		_tmp43_ = strlen (_tmp42_);
		_tmp44_ = _tmp43_;
		_tmp38_ = _tmp44_ > 0;
	} else {
		_tmp38_ = FALSE;
	}
	if (_tmp38_) {
		GtkButton* quote_btn = NULL;
		GtkButton* _tmp45_;
		GtkButton* _tmp46_;
		GtkButton* _tmp47_;
		GtkBox* quote_box = NULL;
		GtkBox* _tmp48_;
		gboolean _tmp49_ = FALSE;
		const gchar* _tmp50_;
		const gchar* _tmp51_;
		GtkLabel* q_text = NULL;
		const gchar* _tmp64_;
		const gchar* _tmp65_;
		GtkLabel* _tmp66_;
		GtkLabel* _tmp67_;
		GtkLabel* _tmp68_;
		GtkLabel* _tmp69_;
		GtkLabel* _tmp70_;
		GtkLabel* _tmp71_;
		GtkLabel* _tmp72_;
		GtkBox* _tmp73_;
		GtkLabel* _tmp74_;
		GtkButton* _tmp75_;
		GtkBox* _tmp76_;
		gint _tmp77_;
		gint _tmp78_;
		GtkBox* _tmp82_;
		GtkButton* _tmp83_;
		_tmp45_ = (GtkButton*) gtk_button_new ();
		g_object_ref_sink (_tmp45_);
		quote_btn = _tmp45_;
		_tmp46_ = quote_btn;
		gtk_widget_add_css_class ((GtkWidget*) _tmp46_, "flat");
		_tmp47_ = quote_btn;
		gtk_widget_add_css_class ((GtkWidget*) _tmp47_, "quote-block");
		_tmp48_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
		g_object_ref_sink (_tmp48_);
		quote_box = _tmp48_;
		_tmp50_ = dc_message_get_quote_sender_name (msg);
		_tmp51_ = _tmp50_;
		if (_tmp51_ != NULL) {
			const gchar* _tmp52_;
			const gchar* _tmp53_;
			gint _tmp54_;
			gint _tmp55_;
			_tmp52_ = dc_message_get_quote_sender_name (msg);
			_tmp53_ = _tmp52_;
			_tmp54_ = strlen (_tmp53_);
			_tmp55_ = _tmp54_;
			_tmp49_ = _tmp55_ > 0;
		} else {
			_tmp49_ = FALSE;
		}
		if (_tmp49_) {
			GtkLabel* q_sender = NULL;
			const gchar* _tmp56_;
			const gchar* _tmp57_;
			GtkLabel* _tmp58_;
			GtkLabel* _tmp59_;
			GtkLabel* _tmp60_;
			GtkLabel* _tmp61_;
			GtkBox* _tmp62_;
			GtkLabel* _tmp63_;
			_tmp56_ = dc_message_get_quote_sender_name (msg);
			_tmp57_ = _tmp56_;
			_tmp58_ = (GtkLabel*) gtk_label_new (_tmp57_);
			g_object_ref_sink (_tmp58_);
			q_sender = _tmp58_;
			_tmp59_ = q_sender;
			gtk_widget_add_css_class ((GtkWidget*) _tmp59_, "quote-sender");
			_tmp60_ = q_sender;
			gtk_widget_set_halign ((GtkWidget*) _tmp60_, GTK_ALIGN_START);
			_tmp61_ = q_sender;
			gtk_label_set_xalign (_tmp61_, (gfloat) 0);
			_tmp62_ = quote_box;
			_tmp63_ = q_sender;
			gtk_box_append (_tmp62_, (GtkWidget*) _tmp63_);
			_g_object_unref0 (q_sender);
		}
		_tmp64_ = dc_message_get_quote_text (msg);
		_tmp65_ = _tmp64_;
		_tmp66_ = (GtkLabel*) gtk_label_new (_tmp65_);
		g_object_ref_sink (_tmp66_);
		q_text = _tmp66_;
		_tmp67_ = q_text;
		gtk_widget_add_css_class ((GtkWidget*) _tmp67_, "quote-text");
		_tmp68_ = q_text;
		gtk_widget_set_halign ((GtkWidget*) _tmp68_, GTK_ALIGN_START);
		_tmp69_ = q_text;
		gtk_label_set_xalign (_tmp69_, (gfloat) 0);
		_tmp70_ = q_text;
		gtk_label_set_ellipsize (_tmp70_, PANGO_ELLIPSIZE_END);
		_tmp71_ = q_text;
		gtk_label_set_max_width_chars (_tmp71_, 40);
		_tmp72_ = q_text;
		gtk_label_set_lines (_tmp72_, 2);
		_tmp73_ = quote_box;
		_tmp74_ = q_text;
		gtk_box_append (_tmp73_, (GtkWidget*) _tmp74_);
		_tmp75_ = quote_btn;
		_tmp76_ = quote_box;
		gtk_button_set_child (_tmp75_, (GtkWidget*) _tmp76_);
		_tmp77_ = dc_message_get_quote_msg_id (msg);
		_tmp78_ = _tmp77_;
		if (_tmp78_ > 0) {
			Block14Data* _data14_;
			gint _tmp79_;
			gint _tmp80_;
			GtkButton* _tmp81_;
			_data14_ = g_slice_new0 (Block14Data);
			_data14_->_ref_count_ = 1;
			_data14_->self = g_object_ref (self);
			_tmp79_ = dc_message_get_quote_msg_id (msg);
			_tmp80_ = _tmp79_;
			_data14_->qid = _tmp80_;
			_tmp81_ = quote_btn;
			g_signal_connect_data (_tmp81_, "clicked", (GCallback) _____lambda55__gtk_button_clicked, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
			block14_data_unref (_data14_);
			_data14_ = NULL;
		}
		_tmp82_ = bubble;
		_tmp83_ = quote_btn;
		gtk_box_append (_tmp82_, (GtkWidget*) _tmp83_);
		_g_object_unref0 (q_text);
		_g_object_unref0 (quote_box);
		_g_object_unref0 (quote_btn);
	}
	_tmp86_ = dc_message_get_file_name (msg);
	_tmp87_ = _tmp86_;
	if (_tmp87_ != NULL) {
		const gchar* _tmp88_;
		const gchar* _tmp89_;
		gint _tmp90_;
		gint _tmp91_;
		_tmp88_ = dc_message_get_file_name (msg);
		_tmp89_ = _tmp88_;
		_tmp90_ = strlen (_tmp89_);
		_tmp91_ = _tmp90_;
		_tmp85_ = _tmp91_ > 0;
	} else {
		_tmp85_ = FALSE;
	}
	if (_tmp85_) {
		_tmp84_ = TRUE;
	} else {
		gboolean _tmp92_ = FALSE;
		const gchar* _tmp93_;
		const gchar* _tmp94_;
		_tmp93_ = dc_message_get_file_path (msg);
		_tmp94_ = _tmp93_;
		if (_tmp94_ != NULL) {
			const gchar* _tmp95_;
			const gchar* _tmp96_;
			gint _tmp97_;
			gint _tmp98_;
			_tmp95_ = dc_message_get_file_path (msg);
			_tmp96_ = _tmp95_;
			_tmp97_ = strlen (_tmp96_);
			_tmp98_ = _tmp97_;
			_tmp92_ = _tmp98_ > 0;
		} else {
			_tmp92_ = FALSE;
		}
		_tmp84_ = _tmp92_;
	}
	has_file = _tmp84_;
	if (has_file) {
		gboolean image_shown = FALSE;
		gboolean _tmp99_ = FALSE;
		gboolean _tmp100_ = FALSE;
		const gchar* _tmp101_;
		const gchar* _tmp102_;
		image_shown = FALSE;
		_tmp101_ = dc_message_get_file_path (msg);
		_tmp102_ = _tmp101_;
		if (_tmp102_ != NULL) {
			const gchar* _tmp103_;
			const gchar* _tmp104_;
			_tmp103_ = dc_message_get_file_path (msg);
			_tmp104_ = _tmp103_;
			_tmp100_ = g_file_test (_tmp104_, G_FILE_TEST_EXISTS);
		} else {
			_tmp100_ = FALSE;
		}
		if (_tmp100_) {
			_tmp99_ = dc_message_row_is_image_file (msg);
		} else {
			_tmp99_ = FALSE;
		}
		if (_tmp99_) {
			dc_message_row_set_is_image (self, TRUE);
			{
				GdkPixbuf* pixbuf = NULL;
				const gchar* _tmp105_;
				const gchar* _tmp106_;
				GdkPixbuf* _tmp107_;
				gint dw = 0;
				GdkPixbuf* _tmp108_;
				gint _tmp109_;
				gint _tmp110_;
				gint dh = 0;
				GdkPixbuf* _tmp111_;
				gint _tmp112_;
				gint _tmp113_;
				GdkTexture* texture = NULL;
				GdkPixbuf* _tmp114_;
				GdkTexture* _tmp115_;
				GtkPicture* picture = NULL;
				GdkTexture* _tmp116_;
				GtkPicture* _tmp117_;
				GtkPicture* _tmp118_;
				GtkPicture* _tmp119_;
				GtkPicture* _tmp120_;
				GtkPicture* _tmp121_;
				GtkBox* _tmp122_;
				GtkPicture* _tmp123_;
				_tmp105_ = dc_message_get_file_path (msg);
				_tmp106_ = _tmp105_;
				_tmp107_ = gdk_pixbuf_new_from_file_at_scale (_tmp106_, 400, 400, TRUE, &_inner_error0_);
				pixbuf = _tmp107_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp108_ = pixbuf;
				_tmp109_ = gdk_pixbuf_get_width (_tmp108_);
				_tmp110_ = _tmp109_;
				dw = _tmp110_;
				_tmp111_ = pixbuf;
				_tmp112_ = gdk_pixbuf_get_height (_tmp111_);
				_tmp113_ = _tmp112_;
				dh = _tmp113_;
				if (dw > 260) {
					dh = (gint) ((((gdouble) dh) * 260.0) / ((gdouble) dw));
					dw = 260;
				}
				_tmp114_ = pixbuf;
				_tmp115_ = gdk_texture_new_for_pixbuf (_tmp114_);
				texture = _tmp115_;
				_tmp116_ = texture;
				_tmp117_ = (GtkPicture*) gtk_picture_new_for_paintable ((GdkPaintable*) _tmp116_);
				g_object_ref_sink (_tmp117_);
				picture = _tmp117_;
				_tmp118_ = picture;
				gtk_picture_set_content_fit (_tmp118_, GTK_CONTENT_FIT_CONTAIN);
				_tmp119_ = picture;
				gtk_picture_set_can_shrink (_tmp119_, FALSE);
				_tmp120_ = picture;
				gtk_widget_set_size_request ((GtkWidget*) _tmp120_, dw, dh);
				_tmp121_ = picture;
				gtk_widget_add_css_class ((GtkWidget*) _tmp121_, "message-image");
				_tmp122_ = bubble;
				_tmp123_ = picture;
				gtk_box_append (_tmp122_, (GtkWidget*) _tmp123_);
				image_shown = TRUE;
				_g_object_unref0 (picture);
				_g_object_unref0 (texture);
				_g_object_unref0 (pixbuf);
			}
			goto __finally0;
			__catch0_g_error:
			{
				GError* e = NULL;
				FILE* _tmp124_;
				GError* _tmp125_;
				const gchar* _tmp126_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp124_ = stderr;
				_tmp125_ = e;
				_tmp126_ = _tmp125_->message;
				fprintf (_tmp124_, "  -> Image load failed: %s\n", _tmp126_);
				_g_error_free0 (e);
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (bubble);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
		}
		if (!image_shown) {
			GtkBox* _tmp127_;
			GtkBox* _tmp128_;
			GtkBox* _tmp129_;
			_tmp127_ = bubble;
			_tmp128_ = dc_message_row_build_file_indicator (msg);
			_tmp129_ = _tmp128_;
			gtk_box_append (_tmp127_, (GtkWidget*) _tmp129_);
			_g_object_unref0 (_tmp129_);
		}
	}
	_tmp131_ = dc_message_get_text (msg);
	_tmp132_ = _tmp131_;
	if (_tmp132_ != NULL) {
		const gchar* _tmp133_;
		const gchar* _tmp134_;
		gint _tmp135_;
		gint _tmp136_;
		_tmp133_ = dc_message_get_text (msg);
		_tmp134_ = _tmp133_;
		_tmp135_ = strlen (_tmp134_);
		_tmp136_ = _tmp135_;
		_tmp130_ = _tmp136_ > 0;
	} else {
		_tmp130_ = FALSE;
	}
	if (_tmp130_) {
		GtkLabel* text = NULL;
		const gchar* _tmp137_;
		const gchar* _tmp138_;
		GtkLabel* _tmp139_;
		GtkLabel* _tmp151_;
		GtkLabel* _tmp152_;
		GtkLabel* _tmp153_;
		GtkLabel* _tmp154_;
		GtkLabel* _tmp155_;
		GtkLabel* _tmp156_;
		GtkBox* _tmp157_;
		GtkLabel* _tmp158_;
		_tmp137_ = dc_message_get_text (msg);
		_tmp138_ = _tmp137_;
		_tmp139_ = (GtkLabel*) gtk_label_new (_tmp138_);
		g_object_ref_sink (_tmp139_);
		text = _tmp139_;
		{
			gchar* markup = NULL;
			const gchar* _tmp140_;
			const gchar* _tmp141_;
			gchar* _tmp142_;
			gchar* probe = NULL;
			const gchar* _tmp143_;
			gchar* _tmp144_;
			PangoAttrList* attrs = NULL;
			gchar* parsed = NULL;
			gunichar accel = 0U;
			const gchar* _tmp145_;
			PangoAttrList* _tmp146_ = NULL;
			gchar* _tmp147_ = NULL;
			gunichar _tmp148_ = 0U;
			GtkLabel* _tmp149_;
			const gchar* _tmp150_;
			_tmp140_ = dc_message_get_text (msg);
			_tmp141_ = _tmp140_;
			_tmp142_ = dc_markdown_format (_tmp141_);
			markup = _tmp142_;
			_tmp143_ = markup;
			_tmp144_ = g_regex_replace (_thread_safe_regex_init (&_tmp_regex_0, "<\\/?a(\\s[^>]*)?>", 0), _tmp143_, (gssize) -1, 0, "", 0, &_inner_error0_);
			probe = _tmp144_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (markup);
				goto __catch1_g_error;
			}
			_tmp145_ = probe;
			pango_parse_markup (_tmp145_, -1, (gunichar) 0, &_tmp146_, &_tmp147_, &_tmp148_, &_inner_error0_);
			_pango_attr_list_unref0 (attrs);
			attrs = _tmp146_;
			_g_free0 (parsed);
			parsed = _tmp147_;
			accel = _tmp148_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (parsed);
				_pango_attr_list_unref0 (attrs);
				_g_free0 (probe);
				_g_free0 (markup);
				goto __catch1_g_error;
			}
			_tmp149_ = text;
			_tmp150_ = markup;
			gtk_label_set_markup (_tmp149_, _tmp150_);
			_g_free0 (parsed);
			_pango_attr_list_unref0 (attrs);
			_g_free0 (probe);
			_g_free0 (markup);
		}
		goto __finally1;
		__catch1_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally1:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (text);
			_g_object_unref0 (bubble);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp151_ = text;
		gtk_label_set_wrap (_tmp151_, TRUE);
		_tmp152_ = text;
		gtk_label_set_wrap_mode (_tmp152_, PANGO_WRAP_WORD_CHAR);
		_tmp153_ = text;
		gtk_widget_set_halign ((GtkWidget*) _tmp153_, GTK_ALIGN_START);
		_tmp154_ = text;
		gtk_label_set_xalign (_tmp154_, (gfloat) 0);
		_tmp155_ = text;
		gtk_label_set_selectable (_tmp155_, TRUE);
		_tmp156_ = text;
		gtk_label_set_max_width_chars (_tmp156_, 50);
		_tmp157_ = bubble;
		_tmp158_ = text;
		gtk_box_append (_tmp157_, (GtkWidget*) _tmp158_);
		_g_object_unref0 (text);
	}
	_tmp159_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
	g_object_ref_sink (_tmp159_);
	footer = _tmp159_;
	_tmp160_ = footer;
	gtk_widget_set_halign ((GtkWidget*) _tmp160_, GTK_ALIGN_END);
	_tmp161_ = dc_message_get_is_pinned (msg);
	_tmp162_ = _tmp161_;
	if (_tmp162_) {
		GtkLabel* pin_icon = NULL;
		GtkLabel* _tmp163_;
		GtkLabel* _tmp164_;
		GtkBox* _tmp165_;
		GtkLabel* _tmp166_;
		_tmp163_ = (GtkLabel*) gtk_label_new ("📌");
		g_object_ref_sink (_tmp163_);
		pin_icon = _tmp163_;
		_tmp164_ = pin_icon;
		gtk_widget_add_css_class ((GtkWidget*) _tmp164_, "message-time");
		_tmp165_ = footer;
		_tmp166_ = pin_icon;
		gtk_box_append (_tmp165_, (GtkWidget*) _tmp166_);
		_g_object_unref0 (pin_icon);
	}
	_tmp167_ = dc_message_get_timestamp (msg);
	_tmp168_ = _tmp167_;
	_tmp169_ = dc_message_row_format_timestamp (_tmp168_);
	time_str = _tmp169_;
	_tmp170_ = time_str;
	_tmp171_ = (GtkLabel*) gtk_label_new (_tmp170_);
	g_object_ref_sink (_tmp171_);
	time_lbl = _tmp171_;
	_tmp172_ = time_lbl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp172_, "message-time");
	_tmp173_ = footer;
	_tmp174_ = time_lbl;
	gtk_box_append (_tmp173_, (GtkWidget*) _tmp174_);
	if (outgoing) {
		GtkLabel* tick = NULL;
		GtkLabel* _tmp175_;
		GtkLabel* _tmp176_;
		_tmp175_ = dc_message_row_build_tick_indicator (msg);
		tick = _tmp175_;
		_tmp176_ = tick;
		if (_tmp176_ != NULL) {
			GtkBox* _tmp177_;
			GtkLabel* _tmp178_;
			_tmp177_ = footer;
			_tmp178_ = tick;
			gtk_box_append (_tmp177_, (GtkWidget*) _tmp178_);
		}
		_g_object_unref0 (tick);
	}
	_tmp179_ = bubble;
	_tmp180_ = footer;
	gtk_box_append (_tmp179_, (GtkWidget*) _tmp180_);
	_tmp182_ = dc_message_get_reactions (msg);
	_tmp183_ = _tmp182_;
	if (_tmp183_ != NULL) {
		const gchar* _tmp184_;
		const gchar* _tmp185_;
		gint _tmp186_;
		gint _tmp187_;
		_tmp184_ = dc_message_get_reactions (msg);
		_tmp185_ = _tmp184_;
		_tmp186_ = strlen (_tmp185_);
		_tmp187_ = _tmp186_;
		_tmp181_ = _tmp187_ > 0;
	} else {
		_tmp181_ = FALSE;
	}
	if (_tmp181_) {
		GtkBox* reactions_box = NULL;
		GtkBox* _tmp188_;
		GtkBox* _tmp189_;
		GtkBox* _tmp190_;
		gchar** parts = NULL;
		const gchar* _tmp191_;
		const gchar* _tmp192_;
		gchar** _tmp193_;
		gchar** _tmp194_;
		gint parts_length1;
		gint _parts_size_;
		gchar** _tmp195_;
		gint _tmp195__length1;
		GtkBox* _tmp220_;
		GtkBox* _tmp221_;
		_tmp188_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
		g_object_ref_sink (_tmp188_);
		reactions_box = _tmp188_;
		_tmp189_ = reactions_box;
		gtk_widget_add_css_class ((GtkWidget*) _tmp189_, "reaction-bar");
		_tmp190_ = reactions_box;
		gtk_widget_set_halign ((GtkWidget*) _tmp190_, GTK_ALIGN_START);
		_tmp191_ = dc_message_get_reactions (msg);
		_tmp192_ = _tmp191_;
		_tmp194_ = _tmp193_ = g_strsplit (_tmp192_, ",", 0);
		parts = _tmp194_;
		parts_length1 = _vala_array_length (_tmp193_);
		_parts_size_ = parts_length1;
		_tmp195_ = parts;
		_tmp195__length1 = parts_length1;
		{
			gchar** part_collection = NULL;
			gint part_collection_length1 = 0;
			gint _part_collection_size_ = 0;
			gint part_it = 0;
			part_collection = _tmp195_;
			part_collection_length1 = _tmp195__length1;
			for (part_it = 0; part_it < part_collection_length1; part_it = part_it + 1) {
				gchar* _tmp196_;
				gchar* part = NULL;
				_tmp196_ = g_strdup (part_collection[part_it]);
				part = _tmp196_;
				{
					gchar** kv = NULL;
					const gchar* _tmp197_;
					gchar** _tmp198_;
					gchar** _tmp199_;
					gint kv_length1;
					gint _kv_size_;
					gchar** _tmp200_;
					gint _tmp200__length1;
					_tmp197_ = part;
					_tmp199_ = _tmp198_ = g_strsplit (_tmp197_, ":", 2);
					kv = _tmp199_;
					kv_length1 = _vala_array_length (_tmp198_);
					_kv_size_ = kv_length1;
					_tmp200_ = kv;
					_tmp200__length1 = kv_length1;
					if (_tmp200__length1 >= 2) {
						gchar* emoji_str = NULL;
						gchar** _tmp201_;
						gint _tmp201__length1;
						const gchar* _tmp202_;
						gchar* _tmp203_;
						gchar* count_str = NULL;
						gchar** _tmp204_;
						gint _tmp204__length1;
						const gchar* _tmp205_;
						gchar* _tmp206_;
						gchar* _tmp207_ = NULL;
						const gchar* _tmp208_;
						gchar* label_text = NULL;
						gchar* _tmp214_;
						GtkLabel* badge = NULL;
						const gchar* _tmp215_;
						GtkLabel* _tmp216_;
						GtkLabel* _tmp217_;
						GtkBox* _tmp218_;
						GtkLabel* _tmp219_;
						_tmp201_ = kv;
						_tmp201__length1 = kv_length1;
						_tmp202_ = _tmp201_[0];
						_tmp203_ = g_strdup (_tmp202_);
						emoji_str = _tmp203_;
						_tmp204_ = kv;
						_tmp204__length1 = kv_length1;
						_tmp205_ = _tmp204_[1];
						_tmp206_ = g_strdup (_tmp205_);
						count_str = _tmp206_;
						_tmp208_ = count_str;
						if (g_strcmp0 (_tmp208_, "1") == 0) {
							const gchar* _tmp209_;
							gchar* _tmp210_;
							_tmp209_ = emoji_str;
							_tmp210_ = g_strdup (_tmp209_);
							_g_free0 (_tmp207_);
							_tmp207_ = _tmp210_;
						} else {
							const gchar* _tmp211_;
							const gchar* _tmp212_;
							gchar* _tmp213_;
							_tmp211_ = emoji_str;
							_tmp212_ = count_str;
							_tmp213_ = g_strdup_printf ("%s %s", _tmp211_, _tmp212_);
							_g_free0 (_tmp207_);
							_tmp207_ = _tmp213_;
						}
						_tmp214_ = _tmp207_;
						_tmp207_ = NULL;
						label_text = _tmp214_;
						_tmp215_ = label_text;
						_tmp216_ = (GtkLabel*) gtk_label_new (_tmp215_);
						g_object_ref_sink (_tmp216_);
						badge = _tmp216_;
						_tmp217_ = badge;
						gtk_widget_add_css_class ((GtkWidget*) _tmp217_, "reaction-badge");
						_tmp218_ = reactions_box;
						_tmp219_ = badge;
						gtk_box_append (_tmp218_, (GtkWidget*) _tmp219_);
						_g_object_unref0 (badge);
						_g_free0 (label_text);
						_g_free0 (_tmp207_);
						_g_free0 (count_str);
						_g_free0 (emoji_str);
					}
					kv = (_vala_array_free (kv, kv_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (part);
				}
			}
		}
		_tmp220_ = bubble;
		_tmp221_ = reactions_box;
		gtk_box_append (_tmp220_, (GtkWidget*) _tmp221_);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (reactions_box);
	}
	if (outgoing) {
		GtkBox* spacer = NULL;
		GtkBox* _tmp222_;
		GtkBox* _tmp223_;
		GtkBox* _tmp224_;
		_tmp222_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
		g_object_ref_sink (_tmp222_);
		spacer = _tmp222_;
		_tmp223_ = spacer;
		gtk_widget_set_hexpand ((GtkWidget*) _tmp223_, TRUE);
		_tmp224_ = spacer;
		gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp224_);
		_g_object_unref0 (spacer);
	}
	_tmp225_ = bubble;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp225_);
	if (!outgoing) {
		GtkBox* spacer = NULL;
		GtkBox* _tmp226_;
		GtkBox* _tmp227_;
		GtkBox* _tmp228_;
		_tmp226_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
		g_object_ref_sink (_tmp226_);
		spacer = _tmp226_;
		_tmp227_ = spacer;
		gtk_widget_set_hexpand ((GtkWidget*) _tmp227_, TRUE);
		_tmp228_ = spacer;
		gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp228_);
		_g_object_unref0 (spacer);
	}
	_g_object_unref0 (time_lbl);
	_g_free0 (time_str);
	_g_object_unref0 (footer);
	_g_object_unref0 (bubble);
	return self;
}

DcMessageRow*
dc_message_row_new (DcMessage* msg,
                    DcMessage* prev,
                    GPtrArray* trailing_images,
                    gboolean is_image_continuation)
{
	return dc_message_row_construct (DC_TYPE_MESSAGE_ROW, msg, prev, trailing_images, is_image_continuation);
}

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_)) {
		DcMessageRow* self;
		self = _data15_->self;
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}

static void
____lambda54_ (Block15Data* _data15_)
{
	DcMessageRow* self;
	self = _data15_->self;
	g_signal_emit (self, dc_message_row_signals[DC_MESSAGE_ROW_QUOTE_CLICKED_SIGNAL], 0, _data15_->qid);
}

static void
_____lambda54__gtk_button_clicked (GtkButton* _sender,
                                   gpointer self)
{
	____lambda54_ (self);
}

static gint
vala_g_ptr_array_get_length (GPtrArray* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = (gint) self->len;
	return result;
}

static void
dc_message_row_build_irc_row (DcMessageRow* self,
                              DcMessage* msg,
                              DcMessage* prev,
                              GPtrArray* trailing_images,
                              gboolean is_image_continuation)
{
	gchar* time_str = NULL;
	gint64 _tmp0_;
	gint64 _tmp1_;
	gchar* _tmp2_;
	GtkLabel* time_lbl = NULL;
	const gchar* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	const gchar* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	GtkLabel* _tmp13_;
	gchar* sender = NULL;
	gchar* _tmp14_;
	GtkLabel* sender_lbl = NULL;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GtkLabel* _tmp20_;
	GtkLabel* _tmp21_;
	GtkLabel* _tmp22_;
	const gchar* _tmp23_ = NULL;
	gboolean _tmp24_;
	gboolean _tmp25_;
	GtkLabel* _tmp26_;
	GtkLabel* _tmp27_;
	GtkLabel* _tmp28_;
	GtkLabel* _tmp29_;
	GtkBox* body = NULL;
	GtkBox* _tmp30_;
	GtkBox* _tmp31_;
	gboolean _tmp32_ = FALSE;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	gboolean _tmp75_ = FALSE;
	gboolean _tmp76_ = FALSE;
	const gchar* _tmp77_;
	const gchar* _tmp78_;
	gboolean has_file = FALSE;
	gboolean image_shown = FALSE;
	gboolean _tmp90_ = FALSE;
	gboolean _tmp91_ = FALSE;
	gboolean _tmp92_ = FALSE;
	gboolean is_img = FALSE;
	gboolean _tmp97_ = FALSE;
	gboolean _tmp98_ = FALSE;
	gboolean _tmp117_ = FALSE;
	gboolean _tmp122_ = FALSE;
	const gchar* _tmp123_;
	const gchar* _tmp124_;
	gboolean _tmp150_ = FALSE;
	const gchar* _tmp151_;
	const gchar* _tmp152_;
	GtkBox* _tmp189_;
	gboolean _tmp190_;
	gboolean _tmp191_;
	gboolean _tmp196_;
	gboolean _tmp197_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (msg != NULL);
	if (is_image_continuation) {
		gtk_widget_add_css_class ((GtkWidget*) self, "message-irc");
		gtk_widget_add_css_class ((GtkWidget*) self, "message-irc-continuation");
		g_object_set ((GtkWidget*) self, "height-request", 0, NULL);
		gtk_widget_set_visible ((GtkWidget*) self, FALSE);
		return;
	}
	gtk_widget_set_margin_start ((GtkWidget*) self, 8);
	gtk_widget_set_margin_end ((GtkWidget*) self, 8);
	gtk_widget_set_margin_top ((GtkWidget*) self, 0);
	gtk_widget_set_margin_bottom ((GtkWidget*) self, 0);
	gtk_box_set_spacing ((GtkBox*) self, 6);
	gtk_widget_add_css_class ((GtkWidget*) self, "message-irc");
	_tmp0_ = dc_message_get_timestamp (msg);
	_tmp1_ = _tmp0_;
	_tmp2_ = dc_message_row_format_timestamp (_tmp1_);
	time_str = _tmp2_;
	_tmp3_ = time_str;
	_tmp4_ = (GtkLabel*) gtk_label_new (_tmp3_);
	g_object_ref_sink (_tmp4_);
	time_lbl = _tmp4_;
	_tmp5_ = time_lbl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp5_, "message-time");
	_tmp6_ = time_lbl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp6_, "irc-time");
	_tmp7_ = time_lbl;
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_START);
	_tmp8_ = time_lbl;
	gtk_label_set_xalign (_tmp8_, (gfloat) 1);
	_tmp9_ = time_lbl;
	_tmp10_ = time_str;
	_tmp11_ = strlen (_tmp10_);
	_tmp12_ = _tmp11_;
	gtk_widget_set_visible ((GtkWidget*) _tmp9_, _tmp12_ > 0);
	_tmp13_ = time_lbl;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp13_);
	_tmp14_ = dc_message_row_effective_sender_name (msg);
	sender = _tmp14_;
	_tmp15_ = sender;
	_tmp16_ = g_strconcat ("<", _tmp15_, NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strconcat (_tmp17_, ">", NULL);
	_tmp19_ = _tmp18_;
	_tmp20_ = (GtkLabel*) gtk_label_new (_tmp19_);
	g_object_ref_sink (_tmp20_);
	_tmp21_ = _tmp20_;
	_g_free0 (_tmp19_);
	_g_free0 (_tmp17_);
	sender_lbl = _tmp21_;
	_tmp22_ = sender_lbl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp22_, "message-sender");
	_tmp24_ = dc_message_get_is_outgoing (msg);
	_tmp25_ = _tmp24_;
	if (_tmp25_) {
		_tmp23_ = "message-sender-self";
	} else {
		_tmp23_ = "message-sender-other";
	}
	_tmp26_ = sender_lbl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp26_, _tmp23_);
	_tmp27_ = sender_lbl;
	gtk_widget_set_valign ((GtkWidget*) _tmp27_, GTK_ALIGN_START);
	_tmp28_ = sender_lbl;
	gtk_label_set_xalign (_tmp28_, (gfloat) 0);
	_tmp29_ = sender_lbl;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp29_);
	_tmp30_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
	g_object_ref_sink (_tmp30_);
	body = _tmp30_;
	_tmp31_ = body;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp31_, TRUE);
	_tmp33_ = dc_message_get_quote_text (msg);
	_tmp34_ = _tmp33_;
	if (_tmp34_ != NULL) {
		const gchar* _tmp35_;
		const gchar* _tmp36_;
		gint _tmp37_;
		gint _tmp38_;
		_tmp35_ = dc_message_get_quote_text (msg);
		_tmp36_ = _tmp35_;
		_tmp37_ = strlen (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp32_ = _tmp38_ > 0;
	} else {
		_tmp32_ = FALSE;
	}
	if (_tmp32_) {
		GtkButton* qbtn = NULL;
		GtkButton* _tmp39_;
		GtkButton* _tmp40_;
		GtkButton* _tmp41_;
		gchar* _tmp42_ = NULL;
		gboolean _tmp43_ = FALSE;
		const gchar* _tmp44_;
		const gchar* _tmp45_;
		GtkLabel* q = NULL;
		const gchar* _tmp54_;
		const gchar* _tmp55_;
		gchar* _tmp56_;
		gchar* _tmp57_;
		GtkLabel* _tmp58_;
		GtkLabel* _tmp59_;
		GtkLabel* _tmp60_;
		GtkLabel* _tmp61_;
		GtkLabel* _tmp62_;
		GtkLabel* _tmp63_;
		GtkLabel* _tmp64_;
		GtkLabel* _tmp65_;
		GtkButton* _tmp66_;
		GtkLabel* _tmp67_;
		gint _tmp68_;
		gint _tmp69_;
		GtkBox* _tmp73_;
		GtkButton* _tmp74_;
		_tmp39_ = (GtkButton*) gtk_button_new ();
		g_object_ref_sink (_tmp39_);
		qbtn = _tmp39_;
		_tmp40_ = qbtn;
		gtk_widget_add_css_class ((GtkWidget*) _tmp40_, "flat");
		_tmp41_ = qbtn;
		gtk_widget_add_css_class ((GtkWidget*) _tmp41_, "quote-block");
		_tmp44_ = dc_message_get_quote_sender_name (msg);
		_tmp45_ = _tmp44_;
		if (_tmp45_ != NULL) {
			const gchar* _tmp46_;
			const gchar* _tmp47_;
			gint _tmp48_;
			gint _tmp49_;
			_tmp46_ = dc_message_get_quote_sender_name (msg);
			_tmp47_ = _tmp46_;
			_tmp48_ = strlen (_tmp47_);
			_tmp49_ = _tmp48_;
			_tmp43_ = _tmp49_ > 0;
		} else {
			_tmp43_ = FALSE;
		}
		if (_tmp43_) {
			const gchar* _tmp50_;
			const gchar* _tmp51_;
			gchar* _tmp52_;
			_tmp50_ = dc_message_get_quote_sender_name (msg);
			_tmp51_ = _tmp50_;
			_tmp52_ = g_strconcat (_tmp51_, ": ", NULL);
			_g_free0 (_tmp42_);
			_tmp42_ = _tmp52_;
		} else {
			gchar* _tmp53_;
			_tmp53_ = g_strdup ("");
			_g_free0 (_tmp42_);
			_tmp42_ = _tmp53_;
		}
		_tmp54_ = dc_message_get_quote_text (msg);
		_tmp55_ = _tmp54_;
		_tmp56_ = g_strconcat (_tmp42_, _tmp55_, NULL);
		_tmp57_ = _tmp56_;
		_tmp58_ = (GtkLabel*) gtk_label_new (_tmp57_);
		g_object_ref_sink (_tmp58_);
		_tmp59_ = _tmp58_;
		_g_free0 (_tmp57_);
		q = _tmp59_;
		_tmp60_ = q;
		gtk_widget_add_css_class ((GtkWidget*) _tmp60_, "quote-text");
		_tmp61_ = q;
		gtk_widget_set_halign ((GtkWidget*) _tmp61_, GTK_ALIGN_START);
		_tmp62_ = q;
		gtk_label_set_xalign (_tmp62_, (gfloat) 0);
		_tmp63_ = q;
		gtk_label_set_ellipsize (_tmp63_, PANGO_ELLIPSIZE_END);
		_tmp64_ = q;
		gtk_label_set_max_width_chars (_tmp64_, 60);
		_tmp65_ = q;
		gtk_label_set_lines (_tmp65_, 1);
		_tmp66_ = qbtn;
		_tmp67_ = q;
		gtk_button_set_child (_tmp66_, (GtkWidget*) _tmp67_);
		_tmp68_ = dc_message_get_quote_msg_id (msg);
		_tmp69_ = _tmp68_;
		if (_tmp69_ > 0) {
			Block15Data* _data15_;
			gint _tmp70_;
			gint _tmp71_;
			GtkButton* _tmp72_;
			_data15_ = g_slice_new0 (Block15Data);
			_data15_->_ref_count_ = 1;
			_data15_->self = g_object_ref (self);
			_tmp70_ = dc_message_get_quote_msg_id (msg);
			_tmp71_ = _tmp70_;
			_data15_->qid = _tmp71_;
			_tmp72_ = qbtn;
			g_signal_connect_data (_tmp72_, "clicked", (GCallback) _____lambda54__gtk_button_clicked, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
			block15_data_unref (_data15_);
			_data15_ = NULL;
		}
		_tmp73_ = body;
		_tmp74_ = qbtn;
		gtk_box_append (_tmp73_, (GtkWidget*) _tmp74_);
		_g_object_unref0 (q);
		_g_free0 (_tmp42_);
		_g_object_unref0 (qbtn);
	}
	_tmp77_ = dc_message_get_file_name (msg);
	_tmp78_ = _tmp77_;
	if (_tmp78_ != NULL) {
		const gchar* _tmp79_;
		const gchar* _tmp80_;
		gint _tmp81_;
		gint _tmp82_;
		_tmp79_ = dc_message_get_file_name (msg);
		_tmp80_ = _tmp79_;
		_tmp81_ = strlen (_tmp80_);
		_tmp82_ = _tmp81_;
		_tmp76_ = _tmp82_ > 0;
	} else {
		_tmp76_ = FALSE;
	}
	if (_tmp76_) {
		_tmp75_ = TRUE;
	} else {
		gboolean _tmp83_ = FALSE;
		const gchar* _tmp84_;
		const gchar* _tmp85_;
		_tmp84_ = dc_message_get_file_path (msg);
		_tmp85_ = _tmp84_;
		if (_tmp85_ != NULL) {
			const gchar* _tmp86_;
			const gchar* _tmp87_;
			gint _tmp88_;
			gint _tmp89_;
			_tmp86_ = dc_message_get_file_path (msg);
			_tmp87_ = _tmp86_;
			_tmp88_ = strlen (_tmp87_);
			_tmp89_ = _tmp88_;
			_tmp83_ = _tmp89_ > 0;
		} else {
			_tmp83_ = FALSE;
		}
		_tmp75_ = _tmp83_;
	}
	has_file = _tmp75_;
	image_shown = FALSE;
	if (has_file) {
		const gchar* _tmp93_;
		const gchar* _tmp94_;
		_tmp93_ = dc_message_get_file_path (msg);
		_tmp94_ = _tmp93_;
		_tmp92_ = _tmp94_ != NULL;
	} else {
		_tmp92_ = FALSE;
	}
	if (_tmp92_) {
		const gchar* _tmp95_;
		const gchar* _tmp96_;
		_tmp95_ = dc_message_get_file_path (msg);
		_tmp96_ = _tmp95_;
		_tmp91_ = g_file_test (_tmp96_, G_FILE_TEST_EXISTS);
	} else {
		_tmp91_ = FALSE;
	}
	if (_tmp91_) {
		_tmp90_ = dc_message_row_is_image_file (msg);
	} else {
		_tmp90_ = FALSE;
	}
	is_img = _tmp90_;
	if (is_img) {
		_tmp98_ = trailing_images != NULL;
	} else {
		_tmp98_ = FALSE;
	}
	if (_tmp98_) {
		gint _tmp99_;
		gint _tmp100_;
		_tmp99_ = vala_g_ptr_array_get_length (trailing_images);
		_tmp100_ = _tmp99_;
		_tmp97_ = _tmp100_ > 0;
	} else {
		_tmp97_ = FALSE;
	}
	if (_tmp97_) {
		GtkBox* strip = NULL;
		GtkBox* _tmp101_;
		GtkBox* _tmp102_;
		GtkBox* _tmp103_;
		GtkBox* _tmp110_;
		GtkBox* _tmp111_;
		dc_message_row_set_is_image (self, TRUE);
		_tmp101_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
		g_object_ref_sink (_tmp101_);
		strip = _tmp101_;
		_tmp102_ = strip;
		gtk_widget_set_halign ((GtkWidget*) _tmp102_, GTK_ALIGN_START);
		_tmp103_ = strip;
		dc_message_row_append_irc_image (_tmp103_, msg);
		{
			guint i = 0U;
			i = (guint) 0;
			{
				gboolean _tmp104_ = FALSE;
				_tmp104_ = TRUE;
				while (TRUE) {
					gint _tmp106_;
					gint _tmp107_;
					GtkBox* _tmp108_;
					gconstpointer _tmp109_;
					if (!_tmp104_) {
						guint _tmp105_;
						_tmp105_ = i;
						i = _tmp105_ + 1;
					}
					_tmp104_ = FALSE;
					_tmp106_ = vala_g_ptr_array_get_length (trailing_images);
					_tmp107_ = _tmp106_;
					if (!(i < ((guint) _tmp107_))) {
						break;
					}
					_tmp108_ = strip;
					_tmp109_ = g_ptr_array_index (trailing_images, i);
					dc_message_row_append_irc_image (_tmp108_, (DcMessage*) _tmp109_);
				}
			}
		}
		_tmp110_ = body;
		_tmp111_ = strip;
		gtk_box_append (_tmp110_, (GtkWidget*) _tmp111_);
		image_shown = TRUE;
		_g_object_unref0 (strip);
	} else {
		if (is_img) {
			GtkBox* single = NULL;
			GtkBox* _tmp112_;
			GtkBox* _tmp113_;
			GtkBox* _tmp114_;
			GtkBox* _tmp115_;
			GtkBox* _tmp116_;
			dc_message_row_set_is_image (self, TRUE);
			_tmp112_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
			g_object_ref_sink (_tmp112_);
			single = _tmp112_;
			_tmp113_ = single;
			gtk_widget_set_halign ((GtkWidget*) _tmp113_, GTK_ALIGN_START);
			_tmp114_ = single;
			dc_message_row_append_irc_image (_tmp114_, msg);
			_tmp115_ = body;
			_tmp116_ = single;
			gtk_box_append (_tmp115_, (GtkWidget*) _tmp116_);
			image_shown = TRUE;
			_g_object_unref0 (single);
		}
	}
	if (has_file) {
		_tmp117_ = !image_shown;
	} else {
		_tmp117_ = FALSE;
	}
	if (_tmp117_) {
		GtkBox* fi = NULL;
		GtkBox* _tmp118_;
		GtkBox* _tmp119_;
		GtkBox* _tmp120_;
		GtkBox* _tmp121_;
		_tmp118_ = dc_message_row_build_file_indicator (msg);
		fi = _tmp118_;
		_tmp119_ = fi;
		gtk_widget_set_halign ((GtkWidget*) _tmp119_, GTK_ALIGN_START);
		_tmp120_ = body;
		_tmp121_ = fi;
		gtk_box_append (_tmp120_, (GtkWidget*) _tmp121_);
		_g_object_unref0 (fi);
	}
	_tmp123_ = dc_message_get_text (msg);
	_tmp124_ = _tmp123_;
	if (_tmp124_ != NULL) {
		const gchar* _tmp125_;
		const gchar* _tmp126_;
		gint _tmp127_;
		gint _tmp128_;
		_tmp125_ = dc_message_get_text (msg);
		_tmp126_ = _tmp125_;
		_tmp127_ = strlen (_tmp126_);
		_tmp128_ = _tmp127_;
		_tmp122_ = _tmp128_ > 0;
	} else {
		_tmp122_ = FALSE;
	}
	if (_tmp122_) {
		GtkLabel* text = NULL;
		const gchar* _tmp129_;
		const gchar* _tmp130_;
		GtkLabel* _tmp131_;
		GtkLabel* _tmp143_;
		GtkLabel* _tmp144_;
		GtkLabel* _tmp145_;
		GtkLabel* _tmp146_;
		GtkLabel* _tmp147_;
		GtkBox* _tmp148_;
		GtkLabel* _tmp149_;
		_tmp129_ = dc_message_get_text (msg);
		_tmp130_ = _tmp129_;
		_tmp131_ = (GtkLabel*) gtk_label_new (_tmp130_);
		g_object_ref_sink (_tmp131_);
		text = _tmp131_;
		{
			gchar* markup = NULL;
			const gchar* _tmp132_;
			const gchar* _tmp133_;
			gchar* _tmp134_;
			gchar* probe = NULL;
			const gchar* _tmp135_;
			gchar* _tmp136_;
			PangoAttrList* attrs = NULL;
			gchar* parsed = NULL;
			gunichar accel = 0U;
			const gchar* _tmp137_;
			PangoAttrList* _tmp138_ = NULL;
			gchar* _tmp139_ = NULL;
			gunichar _tmp140_ = 0U;
			GtkLabel* _tmp141_;
			const gchar* _tmp142_;
			_tmp132_ = dc_message_get_text (msg);
			_tmp133_ = _tmp132_;
			_tmp134_ = dc_markdown_format (_tmp133_);
			markup = _tmp134_;
			_tmp135_ = markup;
			_tmp136_ = g_regex_replace (_thread_safe_regex_init (&_tmp_regex_1, "<\\/?a(\\s[^>]*)?>", 0), _tmp135_, (gssize) -1, 0, "", 0, &_inner_error0_);
			probe = _tmp136_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (markup);
				goto __catch0_g_error;
			}
			_tmp137_ = probe;
			pango_parse_markup (_tmp137_, -1, (gunichar) 0, &_tmp138_, &_tmp139_, &_tmp140_, &_inner_error0_);
			_pango_attr_list_unref0 (attrs);
			attrs = _tmp138_;
			_g_free0 (parsed);
			parsed = _tmp139_;
			accel = _tmp140_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (parsed);
				_pango_attr_list_unref0 (attrs);
				_g_free0 (probe);
				_g_free0 (markup);
				goto __catch0_g_error;
			}
			_tmp141_ = text;
			_tmp142_ = markup;
			gtk_label_set_markup (_tmp141_, _tmp142_);
			_g_free0 (parsed);
			_pango_attr_list_unref0 (attrs);
			_g_free0 (probe);
			_g_free0 (markup);
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (text);
			_g_object_unref0 (body);
			_g_object_unref0 (sender_lbl);
			_g_free0 (sender);
			_g_object_unref0 (time_lbl);
			_g_free0 (time_str);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp143_ = text;
		gtk_label_set_wrap (_tmp143_, TRUE);
		_tmp144_ = text;
		gtk_label_set_wrap_mode (_tmp144_, PANGO_WRAP_WORD_CHAR);
		_tmp145_ = text;
		gtk_widget_set_halign ((GtkWidget*) _tmp145_, GTK_ALIGN_START);
		_tmp146_ = text;
		gtk_label_set_xalign (_tmp146_, (gfloat) 0);
		_tmp147_ = text;
		gtk_label_set_selectable (_tmp147_, TRUE);
		_tmp148_ = body;
		_tmp149_ = text;
		gtk_box_append (_tmp148_, (GtkWidget*) _tmp149_);
		_g_object_unref0 (text);
	}
	_tmp151_ = dc_message_get_reactions (msg);
	_tmp152_ = _tmp151_;
	if (_tmp152_ != NULL) {
		const gchar* _tmp153_;
		const gchar* _tmp154_;
		gint _tmp155_;
		gint _tmp156_;
		_tmp153_ = dc_message_get_reactions (msg);
		_tmp154_ = _tmp153_;
		_tmp155_ = strlen (_tmp154_);
		_tmp156_ = _tmp155_;
		_tmp150_ = _tmp156_ > 0;
	} else {
		_tmp150_ = FALSE;
	}
	if (_tmp150_) {
		GtkBox* reactions_box = NULL;
		GtkBox* _tmp157_;
		GtkBox* _tmp158_;
		GtkBox* _tmp159_;
		gchar** parts = NULL;
		const gchar* _tmp160_;
		const gchar* _tmp161_;
		gchar** _tmp162_;
		gchar** _tmp163_;
		gint parts_length1;
		gint _parts_size_;
		gchar** _tmp164_;
		gint _tmp164__length1;
		GtkBox* _tmp187_;
		GtkBox* _tmp188_;
		_tmp157_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
		g_object_ref_sink (_tmp157_);
		reactions_box = _tmp157_;
		_tmp158_ = reactions_box;
		gtk_widget_add_css_class ((GtkWidget*) _tmp158_, "reaction-bar");
		_tmp159_ = reactions_box;
		gtk_widget_set_halign ((GtkWidget*) _tmp159_, GTK_ALIGN_START);
		_tmp160_ = dc_message_get_reactions (msg);
		_tmp161_ = _tmp160_;
		_tmp163_ = _tmp162_ = g_strsplit (_tmp161_, ",", 0);
		parts = _tmp163_;
		parts_length1 = _vala_array_length (_tmp162_);
		_parts_size_ = parts_length1;
		_tmp164_ = parts;
		_tmp164__length1 = parts_length1;
		{
			gchar** part_collection = NULL;
			gint part_collection_length1 = 0;
			gint _part_collection_size_ = 0;
			gint part_it = 0;
			part_collection = _tmp164_;
			part_collection_length1 = _tmp164__length1;
			for (part_it = 0; part_it < part_collection_length1; part_it = part_it + 1) {
				gchar* _tmp165_;
				gchar* part = NULL;
				_tmp165_ = g_strdup (part_collection[part_it]);
				part = _tmp165_;
				{
					gchar** kv = NULL;
					const gchar* _tmp166_;
					gchar** _tmp167_;
					gchar** _tmp168_;
					gint kv_length1;
					gint _kv_size_;
					gchar** _tmp169_;
					gint _tmp169__length1;
					_tmp166_ = part;
					_tmp168_ = _tmp167_ = g_strsplit (_tmp166_, ":", 2);
					kv = _tmp168_;
					kv_length1 = _vala_array_length (_tmp167_);
					_kv_size_ = kv_length1;
					_tmp169_ = kv;
					_tmp169__length1 = kv_length1;
					if (_tmp169__length1 >= 2) {
						gchar* _tmp170_ = NULL;
						gchar** _tmp171_;
						gint _tmp171__length1;
						const gchar* _tmp172_;
						gchar* label_text = NULL;
						gchar* _tmp181_;
						GtkLabel* badge = NULL;
						const gchar* _tmp182_;
						GtkLabel* _tmp183_;
						GtkLabel* _tmp184_;
						GtkBox* _tmp185_;
						GtkLabel* _tmp186_;
						_tmp171_ = kv;
						_tmp171__length1 = kv_length1;
						_tmp172_ = _tmp171_[1];
						if (g_strcmp0 (_tmp172_, "1") == 0) {
							gchar** _tmp173_;
							gint _tmp173__length1;
							const gchar* _tmp174_;
							gchar* _tmp175_;
							_tmp173_ = kv;
							_tmp173__length1 = kv_length1;
							_tmp174_ = _tmp173_[0];
							_tmp175_ = g_strdup (_tmp174_);
							_g_free0 (_tmp170_);
							_tmp170_ = _tmp175_;
						} else {
							gchar** _tmp176_;
							gint _tmp176__length1;
							const gchar* _tmp177_;
							gchar** _tmp178_;
							gint _tmp178__length1;
							const gchar* _tmp179_;
							gchar* _tmp180_;
							_tmp176_ = kv;
							_tmp176__length1 = kv_length1;
							_tmp177_ = _tmp176_[0];
							_tmp178_ = kv;
							_tmp178__length1 = kv_length1;
							_tmp179_ = _tmp178_[1];
							_tmp180_ = g_strdup_printf ("%s %s", _tmp177_, _tmp179_);
							_g_free0 (_tmp170_);
							_tmp170_ = _tmp180_;
						}
						_tmp181_ = _tmp170_;
						_tmp170_ = NULL;
						label_text = _tmp181_;
						_tmp182_ = label_text;
						_tmp183_ = (GtkLabel*) gtk_label_new (_tmp182_);
						g_object_ref_sink (_tmp183_);
						badge = _tmp183_;
						_tmp184_ = badge;
						gtk_widget_add_css_class ((GtkWidget*) _tmp184_, "reaction-badge");
						_tmp185_ = reactions_box;
						_tmp186_ = badge;
						gtk_box_append (_tmp185_, (GtkWidget*) _tmp186_);
						_g_object_unref0 (badge);
						_g_free0 (label_text);
						_g_free0 (_tmp170_);
					}
					kv = (_vala_array_free (kv, kv_length1, (GDestroyNotify) g_free), NULL);
					_g_free0 (part);
				}
			}
		}
		_tmp187_ = body;
		_tmp188_ = reactions_box;
		gtk_box_append (_tmp187_, (GtkWidget*) _tmp188_);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (reactions_box);
	}
	_tmp189_ = body;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp189_);
	_tmp190_ = dc_message_get_is_outgoing (msg);
	_tmp191_ = _tmp190_;
	if (_tmp191_) {
		GtkLabel* tick = NULL;
		GtkLabel* _tmp192_;
		GtkLabel* _tmp193_;
		_tmp192_ = dc_message_row_build_tick_indicator (msg);
		tick = _tmp192_;
		_tmp193_ = tick;
		if (_tmp193_ != NULL) {
			GtkLabel* _tmp194_;
			GtkLabel* _tmp195_;
			_tmp194_ = tick;
			gtk_widget_set_valign ((GtkWidget*) _tmp194_, GTK_ALIGN_START);
			_tmp195_ = tick;
			gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp195_);
		}
		_g_object_unref0 (tick);
	}
	_tmp196_ = dc_message_get_is_pinned (msg);
	_tmp197_ = _tmp196_;
	if (_tmp197_) {
		GtkLabel* pin_icon = NULL;
		GtkLabel* _tmp198_;
		GtkLabel* _tmp199_;
		GtkLabel* _tmp200_;
		GtkLabel* _tmp201_;
		_tmp198_ = (GtkLabel*) gtk_label_new ("📌");
		g_object_ref_sink (_tmp198_);
		pin_icon = _tmp198_;
		_tmp199_ = pin_icon;
		gtk_widget_add_css_class ((GtkWidget*) _tmp199_, "message-time");
		_tmp200_ = pin_icon;
		gtk_widget_set_valign ((GtkWidget*) _tmp200_, GTK_ALIGN_START);
		_tmp201_ = pin_icon;
		gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp201_);
		_g_object_unref0 (pin_icon);
	}
	_g_object_unref0 (body);
	_g_object_unref0 (sender_lbl);
	_g_free0 (sender);
	_g_object_unref0 (time_lbl);
	_g_free0 (time_str);
}

static void
dc_message_row_append_irc_image (GtkBox* strip,
                                 DcMessage* m)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (strip != NULL);
	g_return_if_fail (m != NULL);
	{
		GdkPixbuf* pixbuf = NULL;
		const gchar* _tmp0_;
		const gchar* _tmp1_;
		GdkPixbuf* _tmp2_;
		gint dw = 0;
		gint _tmp3_;
		gint _tmp4_;
		gint dh = 0;
		gint _tmp5_;
		gint _tmp6_;
		GdkTexture* texture = NULL;
		GdkTexture* _tmp7_;
		GtkPicture* picture = NULL;
		GdkTexture* _tmp8_;
		GtkPicture* _tmp9_;
		GtkPicture* _tmp10_;
		GtkPicture* _tmp11_;
		GtkPicture* _tmp12_;
		GtkPicture* _tmp13_;
		GtkPicture* _tmp14_;
		GtkPicture* _tmp15_;
		GtkPicture* _tmp16_;
		GtkPicture* _tmp17_;
		_tmp0_ = dc_message_get_file_path (m);
		_tmp1_ = _tmp0_;
		_tmp2_ = gdk_pixbuf_new_from_file_at_scale (_tmp1_, 260, 200, TRUE, &_inner_error0_);
		pixbuf = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = gdk_pixbuf_get_width (pixbuf);
		_tmp4_ = _tmp3_;
		dw = _tmp4_;
		_tmp5_ = gdk_pixbuf_get_height (pixbuf);
		_tmp6_ = _tmp5_;
		dh = _tmp6_;
		if (dh < 180) {
			dw = (gint) ((((gdouble) dw) * 180.0) / ((gdouble) dh));
			dh = 180;
		}
		_tmp7_ = gdk_texture_new_for_pixbuf (pixbuf);
		texture = _tmp7_;
		_tmp8_ = texture;
		_tmp9_ = (GtkPicture*) gtk_picture_new_for_paintable ((GdkPaintable*) _tmp8_);
		g_object_ref_sink (_tmp9_);
		picture = _tmp9_;
		_tmp10_ = picture;
		gtk_picture_set_content_fit (_tmp10_, GTK_CONTENT_FIT_CONTAIN);
		_tmp11_ = picture;
		gtk_picture_set_can_shrink (_tmp11_, FALSE);
		_tmp12_ = picture;
		gtk_widget_add_css_class ((GtkWidget*) _tmp12_, "message-image");
		_tmp13_ = picture;
		gtk_widget_add_css_class ((GtkWidget*) _tmp13_, "message-image-irc");
		_tmp14_ = picture;
		gtk_widget_set_size_request ((GtkWidget*) _tmp14_, dw, dh);
		_tmp15_ = picture;
		gtk_widget_set_halign ((GtkWidget*) _tmp15_, GTK_ALIGN_START);
		_tmp16_ = picture;
		gtk_widget_set_valign ((GtkWidget*) _tmp16_, GTK_ALIGN_START);
		_tmp17_ = picture;
		gtk_box_append (strip, (GtkWidget*) _tmp17_);
		_g_object_unref0 (picture);
		_g_object_unref0 (texture);
		_g_object_unref0 (pixbuf);
	}
	goto __finally0;
	__catch0_g_error:
	{
		const gchar* _tmp18_ = NULL;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		GtkLabel* fi = NULL;
		GtkLabel* _tmp21_;
		GtkLabel* _tmp22_;
		GtkLabel* _tmp23_;
		g_clear_error (&_inner_error0_);
		_tmp19_ = dc_message_get_file_name (m);
		_tmp20_ = _tmp19_;
		_tmp18_ = _tmp20_;
		if (_tmp18_ == NULL) {
			_tmp18_ = "image";
		}
		_tmp21_ = (GtkLabel*) gtk_label_new (_tmp18_);
		g_object_ref_sink (_tmp21_);
		fi = _tmp21_;
		_tmp22_ = fi;
		gtk_widget_add_css_class ((GtkWidget*) _tmp22_, "dim-label");
		_tmp23_ = fi;
		gtk_box_append (strip, (GtkWidget*) _tmp23_);
		_g_object_unref0 (fi);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

gboolean
dc_message_row_is_image_only_message (DcMessage* m)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gboolean _tmp12_ = FALSE;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gboolean result;
	g_return_val_if_fail (m != NULL, FALSE);
	if (m == NULL) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp1_;
		gboolean _tmp2_;
		_tmp1_ = dc_message_get_is_info (m);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp4_ = dc_message_get_text (m);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		_tmp6_ = dc_message_get_text (m);
		_tmp7_ = _tmp6_;
		_tmp8_ = string_strip (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = strlen (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp3_ = _tmp11_ > 0;
		_g_free0 (_tmp9_);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		result = FALSE;
		return result;
	}
	_tmp13_ = dc_message_get_file_path (m);
	_tmp14_ = _tmp13_;
	if (_tmp14_ == NULL) {
		_tmp12_ = TRUE;
	} else {
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		_tmp15_ = dc_message_get_file_path (m);
		_tmp16_ = _tmp15_;
		_tmp17_ = strlen (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp12_ = _tmp18_ == 0;
	}
	if (_tmp12_) {
		result = FALSE;
		return result;
	}
	result = dc_message_row_is_image_file (m);
	return result;
}

gboolean
dc_message_row_same_irc_sender (DcMessage* a,
                                DcMessage* b)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_ = NULL;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* an = NULL;
	gchar* _tmp14_;
	const gchar* _tmp15_ = NULL;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar* bn = NULL;
	gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gboolean result;
	g_return_val_if_fail (a != NULL, FALSE);
	g_return_val_if_fail (b != NULL, FALSE);
	_tmp1_ = dc_message_get_is_info (a);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = dc_message_get_is_info (b);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp5_ = dc_message_get_is_outgoing (a);
	_tmp6_ = _tmp5_;
	_tmp7_ = dc_message_get_is_outgoing (b);
	_tmp8_ = _tmp7_;
	if (_tmp6_ != _tmp8_) {
		result = FALSE;
		return result;
	}
	_tmp9_ = dc_message_get_is_outgoing (a);
	_tmp10_ = _tmp9_;
	if (_tmp10_) {
		result = TRUE;
		return result;
	}
	_tmp12_ = dc_message_get_sender_name (a);
	_tmp13_ = _tmp12_;
	_tmp11_ = _tmp13_;
	if (_tmp11_ == NULL) {
		_tmp11_ = "";
	}
	_tmp14_ = g_strdup (_tmp11_);
	an = _tmp14_;
	_tmp16_ = dc_message_get_sender_name (b);
	_tmp17_ = _tmp16_;
	_tmp15_ = _tmp17_;
	if (_tmp15_ == NULL) {
		_tmp15_ = "";
	}
	_tmp18_ = g_strdup (_tmp15_);
	bn = _tmp18_;
	_tmp19_ = an;
	_tmp20_ = bn;
	result = g_strcmp0 (_tmp19_, _tmp20_) == 0;
	_g_free0 (bn);
	_g_free0 (an);
	return result;
}

static gchar*
dc_message_row_effective_sender_name (DcMessage* msg)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	const gchar* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp20_;
	gchar* result;
	g_return_val_if_fail (msg != NULL, NULL);
	_tmp0_ = dc_message_get_is_outgoing (msg);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_ = FALSE;
		const gchar* _tmp3_;
		gchar* _tmp9_;
		_tmp3_ = dc_message_row_self_display_name;
		if (_tmp3_ != NULL) {
			const gchar* _tmp4_;
			gint _tmp5_;
			gint _tmp6_;
			_tmp4_ = dc_message_row_self_display_name;
			_tmp5_ = strlen (_tmp4_);
			_tmp6_ = _tmp5_;
			_tmp2_ = _tmp6_ > 0;
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			const gchar* _tmp7_;
			gchar* _tmp8_;
			_tmp7_ = dc_message_row_self_display_name;
			_tmp8_ = g_strdup (_tmp7_);
			result = _tmp8_;
			return result;
		}
		_tmp9_ = g_strdup ("me");
		result = _tmp9_;
		return result;
	}
	_tmp12_ = dc_message_get_sender_name (msg);
	_tmp13_ = _tmp12_;
	if (_tmp13_ != NULL) {
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		_tmp14_ = dc_message_get_sender_name (msg);
		_tmp15_ = _tmp14_;
		_tmp16_ = strlen (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp11_ = _tmp17_ > 0;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp18_ = dc_message_get_sender_name (msg);
		_tmp19_ = _tmp18_;
		_tmp10_ = _tmp19_;
	} else {
		_tmp10_ = "?";
	}
	_tmp20_ = g_strdup (_tmp10_);
	result = _tmp20_;
	return result;
}

static void
dc_message_row_build_info_row (DcMessageRow* self,
                               DcMessage* msg)
{
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkLabel* label = NULL;
	GtkLabel* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (msg != NULL);
	_tmp1_ = dc_message_get_text (msg);
	_tmp2_ = _tmp1_;
	_tmp0_ = _tmp2_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp3_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp3_);
	label = _tmp3_;
	gtk_widget_add_css_class ((GtkWidget*) label, "dim-label");
	gtk_widget_add_css_class ((GtkWidget*) label, "caption");
	gtk_widget_set_halign ((GtkWidget*) label, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_top ((GtkWidget*) label, 4);
	gtk_widget_set_margin_bottom ((GtkWidget*) label, 4);
	gtk_label_set_wrap (label, TRUE);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) label);
	_g_object_unref0 (label);
}

gboolean
dc_message_row_is_image_file (DcMessage* msg)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gboolean result;
	g_return_val_if_fail (msg != NULL, FALSE);
	_tmp1_ = dc_message_get_file_mime (msg);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = dc_message_get_file_mime (msg);
		_tmp4_ = _tmp3_;
		_tmp0_ = g_str_has_prefix (_tmp4_, "image/");
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	_tmp5_ = dc_message_get_view_type (msg);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		gchar* vt = NULL;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gboolean _tmp10_ = FALSE;
		gboolean _tmp11_ = FALSE;
		const gchar* _tmp12_;
		_tmp7_ = dc_message_get_view_type (msg);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_utf8_strdown (_tmp8_, (gssize) -1);
		vt = _tmp9_;
		_tmp12_ = vt;
		if (g_strcmp0 (_tmp12_, "image") == 0) {
			_tmp11_ = TRUE;
		} else {
			const gchar* _tmp13_;
			_tmp13_ = vt;
			_tmp11_ = g_strcmp0 (_tmp13_, "gif") == 0;
		}
		if (_tmp11_) {
			_tmp10_ = TRUE;
		} else {
			const gchar* _tmp14_;
			_tmp14_ = vt;
			_tmp10_ = g_strcmp0 (_tmp14_, "sticker") == 0;
		}
		if (_tmp10_) {
			result = TRUE;
			_g_free0 (vt);
			return result;
		}
		_g_free0 (vt);
	}
	_tmp15_ = dc_message_get_file_path (msg);
	_tmp16_ = _tmp15_;
	if (_tmp16_ != NULL) {
		gchar* lower = NULL;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		gchar* _tmp19_;
		gboolean _tmp20_ = FALSE;
		gboolean _tmp21_ = FALSE;
		gboolean _tmp22_ = FALSE;
		gboolean _tmp23_ = FALSE;
		gboolean _tmp24_ = FALSE;
		gboolean _tmp25_ = FALSE;
		const gchar* _tmp26_;
		_tmp17_ = dc_message_get_file_path (msg);
		_tmp18_ = _tmp17_;
		_tmp19_ = g_utf8_strdown (_tmp18_, (gssize) -1);
		lower = _tmp19_;
		_tmp26_ = lower;
		if (g_str_has_suffix (_tmp26_, ".jpg")) {
			_tmp25_ = TRUE;
		} else {
			const gchar* _tmp27_;
			_tmp27_ = lower;
			_tmp25_ = g_str_has_suffix (_tmp27_, ".jpeg");
		}
		if (_tmp25_) {
			_tmp24_ = TRUE;
		} else {
			const gchar* _tmp28_;
			_tmp28_ = lower;
			_tmp24_ = g_str_has_suffix (_tmp28_, ".png");
		}
		if (_tmp24_) {
			_tmp23_ = TRUE;
		} else {
			const gchar* _tmp29_;
			_tmp29_ = lower;
			_tmp23_ = g_str_has_suffix (_tmp29_, ".webp");
		}
		if (_tmp23_) {
			_tmp22_ = TRUE;
		} else {
			const gchar* _tmp30_;
			_tmp30_ = lower;
			_tmp22_ = g_str_has_suffix (_tmp30_, ".gif");
		}
		if (_tmp22_) {
			_tmp21_ = TRUE;
		} else {
			const gchar* _tmp31_;
			_tmp31_ = lower;
			_tmp21_ = g_str_has_suffix (_tmp31_, ".bmp");
		}
		if (_tmp21_) {
			_tmp20_ = TRUE;
		} else {
			const gchar* _tmp32_;
			_tmp32_ = lower;
			_tmp20_ = g_str_has_suffix (_tmp32_, ".svg");
		}
		if (_tmp20_) {
			result = TRUE;
			_g_free0 (lower);
			return result;
		}
		_g_free0 (lower);
	}
	result = FALSE;
	return result;
}

static GtkBox*
dc_message_row_build_file_indicator (DcMessage* msg)
{
	GtkBox* file_box = NULL;
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkImage* icon = NULL;
	GtkImage* _tmp2_;
	GtkImage* _tmp3_;
	GtkBox* _tmp4_;
	GtkImage* _tmp5_;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	GtkLabel* fname = NULL;
	GtkLabel* _tmp9_;
	GtkBox* _tmp10_;
	GtkBox* result;
	g_return_val_if_fail (msg != NULL, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp0_);
	file_box = _tmp0_;
	_tmp1_ = file_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "message-attachment");
	_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name ("mail-attachment-symbolic");
	g_object_ref_sink (_tmp2_);
	icon = _tmp2_;
	_tmp3_ = icon;
	gtk_image_set_pixel_size (_tmp3_, 16);
	_tmp4_ = file_box;
	_tmp5_ = icon;
	gtk_box_append (_tmp4_, (GtkWidget*) _tmp5_);
	_tmp7_ = dc_message_get_file_name (msg);
	_tmp8_ = _tmp7_;
	_tmp6_ = _tmp8_;
	if (_tmp6_ == NULL) {
		_tmp6_ = "file";
	}
	_tmp9_ = (GtkLabel*) gtk_label_new (_tmp6_);
	g_object_ref_sink (_tmp9_);
	fname = _tmp9_;
	gtk_widget_add_css_class ((GtkWidget*) fname, "dim-label");
	gtk_label_set_ellipsize (fname, PANGO_ELLIPSIZE_MIDDLE);
	gtk_label_set_max_width_chars (fname, 28);
	_tmp10_ = file_box;
	gtk_box_append (_tmp10_, (GtkWidget*) fname);
	result = file_box;
	_g_object_unref0 (fname);
	_g_object_unref0 (icon);
	return result;
}

static GtkLabel*
dc_message_row_build_tick_indicator (DcMessage* msg)
{
	gchar* glyph = NULL;
	gchar* extra_class = NULL;
	gchar* tooltip = NULL;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GtkLabel* lbl = NULL;
	const gchar* _tmp20_;
	GtkLabel* _tmp21_;
	GtkLabel* _tmp22_;
	GtkLabel* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	GtkLabel* result;
	g_return_val_if_fail (msg != NULL, NULL);
	tooltip = NULL;
	_tmp0_ = dc_message_get_is_failed (msg);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = g_strdup ("⚠");
		_g_free0 (glyph);
		glyph = _tmp2_;
		_tmp3_ = g_strdup ("message-tick-failed");
		_g_free0 (extra_class);
		extra_class = _tmp3_;
		_tmp4_ = g_strdup ("Sending failed");
		_g_free0 (tooltip);
		tooltip = _tmp4_;
	} else {
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp5_ = dc_message_get_is_read (msg);
		_tmp6_ = _tmp5_;
		if (_tmp6_) {
			gchar* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			_tmp7_ = g_strdup ("✓✓");
			_g_free0 (glyph);
			glyph = _tmp7_;
			_tmp8_ = g_strdup ("message-tick-read");
			_g_free0 (extra_class);
			extra_class = _tmp8_;
			_tmp9_ = g_strdup ("Read");
			_g_free0 (tooltip);
			tooltip = _tmp9_;
		} else {
			gboolean _tmp10_;
			gboolean _tmp11_;
			_tmp10_ = dc_message_get_is_delivered (msg);
			_tmp11_ = _tmp10_;
			if (_tmp11_) {
				gchar* _tmp12_;
				gchar* _tmp13_;
				gchar* _tmp14_;
				_tmp12_ = g_strdup ("✓");
				_g_free0 (glyph);
				glyph = _tmp12_;
				_tmp13_ = g_strdup ("message-tick");
				_g_free0 (extra_class);
				extra_class = _tmp13_;
				_tmp14_ = g_strdup ("Delivered");
				_g_free0 (tooltip);
				tooltip = _tmp14_;
			} else {
				gboolean _tmp15_;
				gboolean _tmp16_;
				_tmp15_ = dc_message_get_is_pending (msg);
				_tmp16_ = _tmp15_;
				if (_tmp16_) {
					gchar* _tmp17_;
					gchar* _tmp18_;
					gchar* _tmp19_;
					_tmp17_ = g_strdup ("⧖");
					_g_free0 (glyph);
					glyph = _tmp17_;
					_tmp18_ = g_strdup ("message-tick");
					_g_free0 (extra_class);
					extra_class = _tmp18_;
					_tmp19_ = g_strdup ("Sending…");
					_g_free0 (tooltip);
					tooltip = _tmp19_;
				} else {
					result = NULL;
					_g_free0 (tooltip);
					_g_free0 (extra_class);
					_g_free0 (glyph);
					return result;
				}
			}
		}
	}
	_tmp20_ = glyph;
	_tmp21_ = (GtkLabel*) gtk_label_new (_tmp20_);
	g_object_ref_sink (_tmp21_);
	lbl = _tmp21_;
	_tmp22_ = lbl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp22_, "message-time");
	_tmp23_ = lbl;
	_tmp24_ = extra_class;
	gtk_widget_add_css_class ((GtkWidget*) _tmp23_, _tmp24_);
	_tmp25_ = tooltip;
	if (_tmp25_ != NULL) {
		GtkLabel* _tmp26_;
		const gchar* _tmp27_;
		_tmp26_ = lbl;
		_tmp27_ = tooltip;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp26_, _tmp27_);
	}
	result = lbl;
	_g_free0 (tooltip);
	_g_free0 (extra_class);
	_g_free0 (glyph);
	return result;
}

static gchar*
dc_message_row_format_timestamp (gint64 ts)
{
	GDateTime* dt = NULL;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	if (ts <= ((gint64) 0)) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("");
		result = _tmp0_;
		return result;
	}
	_tmp1_ = g_date_time_new_from_unix_local (ts);
	dt = _tmp1_;
	_tmp2_ = dt;
	_tmp3_ = g_date_time_format (_tmp2_, "%H:%M");
	result = _tmp3_;
	_g_date_time_unref0 (dt);
	return result;
}

gint
dc_message_row_get_message_id (DcMessageRow* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_message_id;
	return result;
}

static void
dc_message_row_set_message_id (DcMessageRow* self,
                               gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_row_get_message_id (self);
	if (old_value != value) {
		self->priv->_message_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_row_properties[DC_MESSAGE_ROW_MESSAGE_ID_PROPERTY]);
	}
}

gint64
dc_message_row_get_timestamp (DcMessageRow* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_timestamp;
	return result;
}

static void
dc_message_row_set_timestamp (DcMessageRow* self,
                              gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_row_get_timestamp (self);
	if (old_value != value) {
		self->priv->_timestamp = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_row_properties[DC_MESSAGE_ROW_TIMESTAMP_PROPERTY]);
	}
}

gboolean
dc_message_row_get_is_outgoing (DcMessageRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_outgoing;
	return result;
}

static void
dc_message_row_set_is_outgoing (DcMessageRow* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_row_get_is_outgoing (self);
	if (old_value != value) {
		self->priv->_is_outgoing = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_row_properties[DC_MESSAGE_ROW_IS_OUTGOING_PROPERTY]);
	}
}

const gchar*
dc_message_row_get_file_path (DcMessageRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_path;
	result = _tmp0_;
	return result;
}

static void
dc_message_row_set_file_path (DcMessageRow* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_row_get_file_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_file_path);
		self->priv->_file_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_row_properties[DC_MESSAGE_ROW_FILE_PATH_PROPERTY]);
	}
}

const gchar*
dc_message_row_get_file_name (DcMessageRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_name;
	result = _tmp0_;
	return result;
}

static void
dc_message_row_set_file_name (DcMessageRow* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_row_get_file_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_file_name);
		self->priv->_file_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_row_properties[DC_MESSAGE_ROW_FILE_NAME_PROPERTY]);
	}
}

const gchar*
dc_message_row_get_message_text (DcMessageRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_message_text;
	result = _tmp0_;
	return result;
}

static void
dc_message_row_set_message_text (DcMessageRow* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_row_get_message_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_message_text);
		self->priv->_message_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_row_properties[DC_MESSAGE_ROW_MESSAGE_TEXT_PROPERTY]);
	}
}

gint
dc_message_row_get_quote_msg_id (DcMessageRow* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_quote_msg_id;
	return result;
}

static void
dc_message_row_set_quote_msg_id (DcMessageRow* self,
                                 gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_row_get_quote_msg_id (self);
	if (old_value != value) {
		self->priv->_quote_msg_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_row_properties[DC_MESSAGE_ROW_QUOTE_MSG_ID_PROPERTY]);
	}
}

gboolean
dc_message_row_get_is_image (DcMessageRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_image;
	return result;
}

static void
dc_message_row_set_is_image (DcMessageRow* self,
                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_row_get_is_image (self);
	if (old_value != value) {
		self->priv->_is_image = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_row_properties[DC_MESSAGE_ROW_IS_IMAGE_PROPERTY]);
	}
}

static void
dc_message_row_class_init (DcMessageRowClass * klass,
                           gpointer klass_data)
{
	dc_message_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcMessageRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_message_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_message_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_message_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ROW_MESSAGE_ID_PROPERTY, dc_message_row_properties[DC_MESSAGE_ROW_MESSAGE_ID_PROPERTY] = g_param_spec_int ("message-id", "message-id", "message-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ROW_TIMESTAMP_PROPERTY, dc_message_row_properties[DC_MESSAGE_ROW_TIMESTAMP_PROPERTY] = g_param_spec_int64 ("timestamp", "timestamp", "timestamp", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ROW_IS_OUTGOING_PROPERTY, dc_message_row_properties[DC_MESSAGE_ROW_IS_OUTGOING_PROPERTY] = g_param_spec_boolean ("is-outgoing", "is-outgoing", "is-outgoing", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ROW_FILE_PATH_PROPERTY, dc_message_row_properties[DC_MESSAGE_ROW_FILE_PATH_PROPERTY] = g_param_spec_string ("file-path", "file-path", "file-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ROW_FILE_NAME_PROPERTY, dc_message_row_properties[DC_MESSAGE_ROW_FILE_NAME_PROPERTY] = g_param_spec_string ("file-name", "file-name", "file-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ROW_MESSAGE_TEXT_PROPERTY, dc_message_row_properties[DC_MESSAGE_ROW_MESSAGE_TEXT_PROPERTY] = g_param_spec_string ("message-text", "message-text", "message-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ROW_QUOTE_MSG_ID_PROPERTY, dc_message_row_properties[DC_MESSAGE_ROW_QUOTE_MSG_ID_PROPERTY] = g_param_spec_int ("quote-msg-id", "quote-msg-id", "quote-msg-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ROW_IS_IMAGE_PROPERTY, dc_message_row_properties[DC_MESSAGE_ROW_IS_IMAGE_PROPERTY] = g_param_spec_boolean ("is-image", "is-image", "is-image", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	dc_message_row_signals[DC_MESSAGE_ROW_QUOTE_CLICKED_SIGNAL] = g_signal_new ("quote-clicked", DC_TYPE_MESSAGE_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
}

static void
dc_message_row_instance_init (DcMessageRow * self,
                              gpointer klass)
{
	self->priv = dc_message_row_get_instance_private (self);
}

static void
dc_message_row_finalize (GObject * obj)
{
	DcMessageRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_MESSAGE_ROW, DcMessageRow);
	_g_free0 (self->priv->_file_path);
	_g_free0 (self->priv->_file_name);
	_g_free0 (self->priv->_message_text);
	G_OBJECT_CLASS (dc_message_row_parent_class)->finalize (obj);
}

/**
     * A single message bubble in the conversation view.
     * Incoming messages are left-aligned, outgoing messages right-aligned.
     */
static GType
dc_message_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcMessageRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_message_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcMessageRow), 0, (GInstanceInitFunc) dc_message_row_instance_init, NULL };
	GType dc_message_row_type_id;
	dc_message_row_type_id = g_type_register_static (gtk_box_get_type (), "DcMessageRow", &g_define_type_info, 0);
	DcMessageRow_private_offset = g_type_add_instance_private (dc_message_row_type_id, sizeof (DcMessageRowPrivate));
	return dc_message_row_type_id;
}

GType
dc_message_row_get_type (void)
{
	static volatile gsize dc_message_row_type_id__once = 0;
	if (g_once_init_enter (&dc_message_row_type_id__once)) {
		GType dc_message_row_type_id;
		dc_message_row_type_id = dc_message_row_get_type_once ();
		g_once_init_leave (&dc_message_row_type_id__once, dc_message_row_type_id);
	}
	return dc_message_row_type_id__once;
}

static void
_vala_dc_message_row_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	DcMessageRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_MESSAGE_ROW, DcMessageRow);
	switch (property_id) {
		case DC_MESSAGE_ROW_MESSAGE_ID_PROPERTY:
		g_value_set_int (value, dc_message_row_get_message_id (self));
		break;
		case DC_MESSAGE_ROW_TIMESTAMP_PROPERTY:
		g_value_set_int64 (value, dc_message_row_get_timestamp (self));
		break;
		case DC_MESSAGE_ROW_IS_OUTGOING_PROPERTY:
		g_value_set_boolean (value, dc_message_row_get_is_outgoing (self));
		break;
		case DC_MESSAGE_ROW_FILE_PATH_PROPERTY:
		g_value_set_string (value, dc_message_row_get_file_path (self));
		break;
		case DC_MESSAGE_ROW_FILE_NAME_PROPERTY:
		g_value_set_string (value, dc_message_row_get_file_name (self));
		break;
		case DC_MESSAGE_ROW_MESSAGE_TEXT_PROPERTY:
		g_value_set_string (value, dc_message_row_get_message_text (self));
		break;
		case DC_MESSAGE_ROW_QUOTE_MSG_ID_PROPERTY:
		g_value_set_int (value, dc_message_row_get_quote_msg_id (self));
		break;
		case DC_MESSAGE_ROW_IS_IMAGE_PROPERTY:
		g_value_set_boolean (value, dc_message_row_get_is_image (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_message_row_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	DcMessageRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_MESSAGE_ROW, DcMessageRow);
	switch (property_id) {
		case DC_MESSAGE_ROW_MESSAGE_ID_PROPERTY:
		dc_message_row_set_message_id (self, g_value_get_int (value));
		break;
		case DC_MESSAGE_ROW_TIMESTAMP_PROPERTY:
		dc_message_row_set_timestamp (self, g_value_get_int64 (value));
		break;
		case DC_MESSAGE_ROW_IS_OUTGOING_PROPERTY:
		dc_message_row_set_is_outgoing (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_ROW_FILE_PATH_PROPERTY:
		dc_message_row_set_file_path (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_ROW_FILE_NAME_PROPERTY:
		dc_message_row_set_file_name (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_ROW_MESSAGE_TEXT_PROPERTY:
		dc_message_row_set_message_text (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_ROW_QUOTE_MSG_ID_PROPERTY:
		dc_message_row_set_quote_msg_id (self, g_value_get_int (value));
		break;
		case DC_MESSAGE_ROW_IS_IMAGE_PROPERTY:
		dc_message_row_set_is_image (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

