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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>

#define TOOTLE_WIDGETS_TYPE_STATUS (tootle_widgets_status_get_type ())
#define TOOTLE_WIDGETS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatus))
#define TOOTLE_WIDGETS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatusClass))
#define TOOTLE_WIDGETS_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_STATUS))
#define TOOTLE_WIDGETS_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_STATUS))
#define TOOTLE_WIDGETS_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatusClass))

typedef struct _TootleWidgetsStatus TootleWidgetsStatus;
typedef struct _TootleWidgetsStatusClass TootleWidgetsStatusClass;
typedef struct _TootleWidgetsStatusPrivate TootleWidgetsStatusPrivate;

#define TOOTLE_WIDGETS_TYPE_RICH_LABEL (tootle_widgets_rich_label_get_type ())
#define TOOTLE_WIDGETS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabel))
#define TOOTLE_WIDGETS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabelClass))
#define TOOTLE_WIDGETS_IS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL))
#define TOOTLE_WIDGETS_IS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_RICH_LABEL))
#define TOOTLE_WIDGETS_RICH_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabelClass))

typedef struct _TootleWidgetsRichLabel TootleWidgetsRichLabel;
typedef struct _TootleWidgetsRichLabelClass TootleWidgetsRichLabelClass;

#define TOOTLE_WIDGETS_TYPE_AVATAR (tootle_widgets_avatar_get_type ())
#define TOOTLE_WIDGETS_AVATAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_AVATAR, TootleWidgetsAvatar))
#define TOOTLE_WIDGETS_AVATAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_AVATAR, TootleWidgetsAvatarClass))
#define TOOTLE_WIDGETS_IS_AVATAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_AVATAR))
#define TOOTLE_WIDGETS_IS_AVATAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_AVATAR))
#define TOOTLE_WIDGETS_AVATAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_AVATAR, TootleWidgetsAvatarClass))

typedef struct _TootleWidgetsAvatar TootleWidgetsAvatar;
typedef struct _TootleWidgetsAvatarClass TootleWidgetsAvatarClass;

#define TOOTLE_WIDGETS_TYPE_MARKUP_VIEW (tootle_widgets_markup_view_get_type ())
#define TOOTLE_WIDGETS_MARKUP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_MARKUP_VIEW, TootleWidgetsMarkupView))
#define TOOTLE_WIDGETS_MARKUP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_MARKUP_VIEW, TootleWidgetsMarkupViewClass))
#define TOOTLE_WIDGETS_IS_MARKUP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_MARKUP_VIEW))
#define TOOTLE_WIDGETS_IS_MARKUP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_MARKUP_VIEW))
#define TOOTLE_WIDGETS_MARKUP_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_MARKUP_VIEW, TootleWidgetsMarkupViewClass))

typedef struct _TootleWidgetsMarkupView TootleWidgetsMarkupView;
typedef struct _TootleWidgetsMarkupViewClass TootleWidgetsMarkupViewClass;

#define TOOTLE_WIDGETS_ATTACHMENT_TYPE_BOX (tootle_widgets_attachment_box_get_type ())
#define TOOTLE_WIDGETS_ATTACHMENT_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_ATTACHMENT_TYPE_BOX, TootleWidgetsAttachmentBox))
#define TOOTLE_WIDGETS_ATTACHMENT_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_ATTACHMENT_TYPE_BOX, TootleWidgetsAttachmentBoxClass))
#define TOOTLE_WIDGETS_ATTACHMENT_IS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_ATTACHMENT_TYPE_BOX))
#define TOOTLE_WIDGETS_ATTACHMENT_IS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_ATTACHMENT_TYPE_BOX))
#define TOOTLE_WIDGETS_ATTACHMENT_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_ATTACHMENT_TYPE_BOX, TootleWidgetsAttachmentBoxClass))

typedef struct _TootleWidgetsAttachmentBox TootleWidgetsAttachmentBox;
typedef struct _TootleWidgetsAttachmentBoxClass TootleWidgetsAttachmentBoxClass;

#define TOOTLE_WIDGETS_TYPE_CONVERSATION (tootle_widgets_conversation_get_type ())
#define TOOTLE_WIDGETS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_CONVERSATION, TootleWidgetsConversation))
#define TOOTLE_WIDGETS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_CONVERSATION, TootleWidgetsConversationClass))
#define TOOTLE_WIDGETS_IS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_CONVERSATION))
#define TOOTLE_WIDGETS_IS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_CONVERSATION))
#define TOOTLE_WIDGETS_CONVERSATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_CONVERSATION, TootleWidgetsConversationClass))

typedef struct _TootleWidgetsConversation TootleWidgetsConversation;
typedef struct _TootleWidgetsConversationClass TootleWidgetsConversationClass;
typedef struct _TootleWidgetsConversationPrivate TootleWidgetsConversationPrivate;

#define TOOTLE_TYPE_ENTITY (tootle_entity_get_type ())
#define TOOTLE_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ENTITY, TootleEntity))
#define TOOTLE_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ENTITY, TootleEntityClass))
#define TOOTLE_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ENTITY))
#define TOOTLE_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ENTITY))
#define TOOTLE_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ENTITY, TootleEntityClass))

typedef struct _TootleEntity TootleEntity;
typedef struct _TootleEntityClass TootleEntityClass;

#define TOOTLE_API_TYPE_CONVERSATION (tootle_api_conversation_get_type ())
#define TOOTLE_API_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_CONVERSATION, TootleAPIConversation))
#define TOOTLE_API_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_CONVERSATION, TootleAPIConversationClass))
#define TOOTLE_API_IS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_CONVERSATION))
#define TOOTLE_API_IS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_CONVERSATION))
#define TOOTLE_API_CONVERSATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_CONVERSATION, TootleAPIConversationClass))

typedef struct _TootleAPIConversation TootleAPIConversation;
typedef struct _TootleAPIConversationClass TootleAPIConversationClass;
enum  {
	TOOTLE_WIDGETS_CONVERSATION_0_PROPERTY,
	TOOTLE_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY,
	TOOTLE_WIDGETS_CONVERSATION_TITLE_TEXT_PROPERTY,
	TOOTLE_WIDGETS_CONVERSATION_SUBTITLE_TEXT_PROPERTY,
	TOOTLE_WIDGETS_CONVERSATION_AVATAR_URL_PROPERTY,
	TOOTLE_WIDGETS_CONVERSATION_NUM_PROPERTIES
};
static GParamSpec* tootle_widgets_conversation_properties[TOOTLE_WIDGETS_CONVERSATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TOOTLE_API_TYPE_STATUS (tootle_api_status_get_type ())
#define TOOTLE_API_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_STATUS, TootleAPIStatus))
#define TOOTLE_API_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_STATUS, TootleAPIStatusClass))
#define TOOTLE_API_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_STATUS))
#define TOOTLE_API_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_STATUS))
#define TOOTLE_API_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_STATUS, TootleAPIStatusClass))

typedef struct _TootleAPIStatus TootleAPIStatus;
typedef struct _TootleAPIStatusClass TootleAPIStatusClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TOOTLE_TYPE_WIDGETIZABLE (tootle_widgetizable_get_type ())
#define TOOTLE_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_WIDGETIZABLE, TootleWidgetizable))
#define TOOTLE_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_WIDGETIZABLE))
#define TOOTLE_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TOOTLE_TYPE_WIDGETIZABLE, TootleWidgetizableIface))

typedef struct _TootleWidgetizable TootleWidgetizable;
typedef struct _TootleWidgetizableIface TootleWidgetizableIface;

#define TOOTLE_API_TYPE_ACCOUNT (tootle_api_account_get_type ())
#define TOOTLE_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccount))
#define TOOTLE_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))
#define TOOTLE_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))

typedef struct _TootleAPIAccount TootleAPIAccount;
typedef struct _TootleAPIAccountClass TootleAPIAccountClass;

#define TOOTLE_TYPE_INSTANCE_ACCOUNT (tootle_instance_account_get_type ())
#define TOOTLE_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccount))
#define TOOTLE_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))
#define TOOTLE_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))

typedef struct _TootleInstanceAccount TootleInstanceAccount;
typedef struct _TootleInstanceAccountClass TootleInstanceAccountClass;

struct _TootleWidgetsStatus {
	GtkListBoxRow parent_instance;
	TootleWidgetsStatusPrivate * priv;
	GtkGrid* grid;
	GtkImage* header_icon;
	TootleWidgetsRichLabel* header_label;
	GtkImage* thread_line;
	TootleWidgetsAvatar* avatar;
	TootleWidgetsRichLabel* name_label;
	GtkLabel* handle_label;
	GtkBox* indicators;
	GtkLabel* date_label;
	GtkImage* pin_indicator;
	GtkImage* indicator;
	GtkBox* content_column;
	GtkStack* spoiler_stack;
	GtkBox* content_box;
	TootleWidgetsMarkupView* content;
	TootleWidgetsAttachmentBox* attachments;
	GtkButton* spoiler_button;
	TootleWidgetsRichLabel* spoiler_label;
	GtkBox* actions;
	GtkButton* reply_button;
	GtkImage* reply_button_icon;
	GtkToggleButton* reblog_button;
	GtkImage* reblog_icon;
	GtkToggleButton* favorite_button;
	GtkToggleButton* bookmark_button;
	GtkButton* menu_button;
};

struct _TootleWidgetsStatusClass {
	GtkListBoxRowClass parent_class;
	void (*on_open) (TootleWidgetsStatus* self);
	void (*on_kind_changed) (TootleWidgetsStatus* self);
};

struct _TootleWidgetsConversation {
	TootleWidgetsStatus parent_instance;
	TootleWidgetsConversationPrivate * priv;
};

struct _TootleWidgetsConversationClass {
	TootleWidgetsStatusClass parent_class;
};

struct _TootleWidgetsConversationPrivate {
	TootleAPIConversation* _conversation;
};

typedef enum  {
	TOOTLE_OOPSIE_USER,
	TOOTLE_OOPSIE_PARSING,
	TOOTLE_OOPSIE_INSTANCE,
	TOOTLE_OOPSIE_INTERNAL
} TootleOopsie;
#define TOOTLE_OOPSIE tootle_oopsie_quark ()
struct _TootleWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TootleWidgetizable* self, GError** error);
	void (*open) (TootleWidgetizable* self);
	void (*resolve_open) (TootleWidgetizable* self, TootleInstanceAccount* account);
};

static gint TootleWidgetsConversation_private_offset;
static gpointer tootle_widgets_conversation_parent_class = NULL;

GType tootle_widgets_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsStatus, g_object_unref)
GType tootle_widgets_rich_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsRichLabel, g_object_unref)
GType tootle_widgets_avatar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsAvatar, g_object_unref)
GType tootle_widgets_markup_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsMarkupView, g_object_unref)
GType tootle_widgets_attachment_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsAttachmentBox, g_object_unref)
GType tootle_widgets_conversation_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsConversation, g_object_unref)
GType tootle_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleEntity, g_object_unref)
GType tootle_api_conversation_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIConversation, g_object_unref)
void tootle_widgets_status_on_open (TootleWidgetsStatus* self);
TootleWidgetsConversation* tootle_widgets_conversation_new (TootleAPIConversation* entity);
TootleWidgetsConversation* tootle_widgets_conversation_construct (GType object_type,
                                                                  TootleAPIConversation* entity);
GType tootle_api_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIStatus, g_object_unref)
TootleAPIStatus* tootle_api_conversation_get_last_status (TootleAPIConversation* self);
TootleAPIConversation* tootle_widgets_conversation_get_conversation (TootleWidgetsConversation* self);
gchar* tootle_desktop_fallback_icon (const gchar* normal,
                                     const gchar* fallback,
                                     const gchar* fallback2);
static void tootle_widgets_conversation_real_on_open (TootleWidgetsStatus* base);
GQuark tootle_oopsie_quark (void);
GType tootle_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIAccount, g_object_unref)
GType tootle_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleInstanceAccount, g_object_unref)
GType tootle_widgetizable_get_type (void) G_GNUC_CONST ;
void tootle_widgetizable_open (TootleWidgetizable* self);
void tootle_widgets_conversation_set_conversation (TootleWidgetsConversation* self,
                                                   TootleAPIConversation* value);
gchar* tootle_widgets_conversation_get_title_text (TootleWidgetsConversation* self);
GeeArrayList* tootle_api_conversation_get_accounts (TootleAPIConversation* self);
const gchar* tootle_api_account_get_display_name (TootleAPIAccount* self);
gchar* tootle_widgets_conversation_get_subtitle_text (TootleWidgetsConversation* self);
gchar* tootle_api_account_get_handle (TootleAPIAccount* self);
gchar* tootle_widgets_conversation_get_avatar_url (TootleWidgetsConversation* self);
const gchar* tootle_api_account_get_avatar (TootleAPIAccount* self);
static void tootle_widgets_conversation_finalize (GObject * obj);
static GType tootle_widgets_conversation_get_type_once (void);
static void _vala_tootle_widgets_conversation_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_tootle_widgets_conversation_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
tootle_widgets_conversation_get_instance_private (TootleWidgetsConversation* self)
{
	return G_STRUCT_MEMBER_P (self, TootleWidgetsConversation_private_offset);
}

TootleWidgetsConversation*
tootle_widgets_conversation_construct (GType object_type,
                                       TootleAPIConversation* entity)
{
	TootleWidgetsConversation * self = NULL;
	TootleAPIStatus* _tmp0_;
	TootleAPIStatus* _tmp1_;
	TootleAPIConversation* _tmp2_;
	GtkImage* _tmp3_;
	GtkBox* _tmp4_;
	GtkImage* _tmp5_;
	GValue _tmp6_ = {0};
	GtkImage* _tmp7_;
	GtkImage* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GtkBox* _tmp11_;
	g_return_val_if_fail (entity != NULL, NULL);
	_tmp0_ = tootle_api_conversation_get_last_status (entity);
	_tmp1_ = _tmp0_;
	self = (TootleWidgetsConversation*) g_object_new (object_type, "conversation", entity, "status", _tmp1_, NULL);
	_tmp2_ = self->priv->_conversation;
	_tmp3_ = ((TootleWidgetsStatus*) self)->indicator;
	g_object_bind_property_with_closures ((GObject*) _tmp2_, "unread", (GObject*) _tmp3_, "visible", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp4_ = ((TootleWidgetsStatus*) self)->indicators;
	_tmp5_ = ((TootleWidgetsStatus*) self)->indicator;
	g_value_init (&_tmp6_, G_TYPE_INT);
	g_value_set_int (&_tmp6_, 2);
	gtk_container_child_set_property ((GtkContainer*) _tmp4_, (GtkWidget*) _tmp5_, "position", &_tmp6_);
	G_IS_VALUE (&_tmp6_) ? (g_value_unset (&_tmp6_), NULL) : NULL;
	_tmp7_ = ((TootleWidgetsStatus*) self)->indicator;
	gtk_widget_set_opacity ((GtkWidget*) _tmp7_, (gdouble) 1);
	_tmp8_ = ((TootleWidgetsStatus*) self)->indicator;
	_tmp9_ = tootle_desktop_fallback_icon ("software-update-urgent-symbolic", "dialog-warning-symbolic", "broken");
	_tmp10_ = _tmp9_;
	g_object_set (_tmp8_, "icon-name", _tmp10_, NULL);
	_g_free0 (_tmp10_);
	_tmp11_ = ((TootleWidgetsStatus*) self)->actions;
	gtk_widget_destroy ((GtkWidget*) _tmp11_);
	return self;
}

TootleWidgetsConversation*
tootle_widgets_conversation_new (TootleAPIConversation* entity)
{
	return tootle_widgets_conversation_construct (TOOTLE_WIDGETS_TYPE_CONVERSATION, entity);
}

static void
tootle_widgets_conversation_real_on_open (TootleWidgetsStatus* base)
{
	TootleWidgetsConversation * self;
	TootleAPIConversation* _tmp0_;
	self = (TootleWidgetsConversation*) base;
	_tmp0_ = self->priv->_conversation;
	tootle_widgetizable_open ((TootleWidgetizable*) _tmp0_);
}

TootleAPIConversation*
tootle_widgets_conversation_get_conversation (TootleWidgetsConversation* self)
{
	TootleAPIConversation* result;
	TootleAPIConversation* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_conversation;
	result = _tmp0_;
	return result;
}

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

void
tootle_widgets_conversation_set_conversation (TootleWidgetsConversation* self,
                                              TootleAPIConversation* value)
{
	TootleAPIConversation* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_widgets_conversation_get_conversation (self);
	if (old_value != value) {
		TootleAPIConversation* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_conversation);
		self->priv->_conversation = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_widgets_conversation_properties[TOOTLE_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY]);
	}
}

gchar*
tootle_widgets_conversation_get_title_text (TootleWidgetsConversation* self)
{
	gchar* result;
	gchar* label = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("");
	label = _tmp0_;
	{
		GeeArrayList* _account_list = NULL;
		TootleAPIConversation* _tmp1_;
		GeeArrayList* _tmp2_;
		GeeArrayList* _tmp3_;
		gint _account_size = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _account_index = 0;
		_tmp1_ = self->priv->_conversation;
		_tmp2_ = tootle_api_conversation_get_accounts (_tmp1_);
		_tmp3_ = _tmp2_;
		_account_list = _tmp3_;
		_tmp4_ = _account_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_account_size = _tmp6_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			TootleAPIAccount* account = NULL;
			GeeArrayList* _tmp9_;
			gpointer _tmp10_;
			const gchar* _tmp11_;
			TootleAPIAccount* _tmp12_;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			gchar* _tmp15_;
			TootleAPIConversation* _tmp16_;
			GeeArrayList* _tmp17_;
			GeeArrayList* _tmp18_;
			gpointer _tmp19_;
			TootleAPIAccount* _tmp20_;
			TootleAPIAccount* _tmp21_;
			gboolean _tmp22_;
			_account_index = _account_index + 1;
			_tmp7_ = _account_index;
			_tmp8_ = _account_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _account_list;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _account_index);
			account = (TootleAPIAccount*) _tmp10_;
			_tmp11_ = label;
			_tmp12_ = account;
			_tmp13_ = tootle_api_account_get_display_name (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = g_strconcat (_tmp11_, _tmp14_, NULL);
			_g_free0 (label);
			label = _tmp15_;
			_tmp16_ = self->priv->_conversation;
			_tmp17_ = tootle_api_conversation_get_accounts (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = gee_list_last ((GeeList*) _tmp18_);
			_tmp20_ = (TootleAPIAccount*) _tmp19_;
			_tmp21_ = account;
			_tmp22_ = _tmp20_ != _tmp21_;
			_g_object_unref0 (_tmp20_);
			if (_tmp22_) {
				const gchar* _tmp23_;
				gchar* _tmp24_;
				_tmp23_ = label;
				_tmp24_ = g_strconcat (_tmp23_, ", ", NULL);
				_g_free0 (label);
				label = _tmp24_;
			}
			_g_object_unref0 (account);
		}
	}
	result = label;
	return result;
}

gchar*
tootle_widgets_conversation_get_subtitle_text (TootleWidgetsConversation* self)
{
	gchar* result;
	gchar* label = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("");
	label = _tmp0_;
	{
		GeeArrayList* _account_list = NULL;
		TootleAPIConversation* _tmp1_;
		GeeArrayList* _tmp2_;
		GeeArrayList* _tmp3_;
		gint _account_size = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _account_index = 0;
		_tmp1_ = self->priv->_conversation;
		_tmp2_ = tootle_api_conversation_get_accounts (_tmp1_);
		_tmp3_ = _tmp2_;
		_account_list = _tmp3_;
		_tmp4_ = _account_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_account_size = _tmp6_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			TootleAPIAccount* account = NULL;
			GeeArrayList* _tmp9_;
			gpointer _tmp10_;
			const gchar* _tmp11_;
			TootleAPIAccount* _tmp12_;
			gchar* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			_account_index = _account_index + 1;
			_tmp7_ = _account_index;
			_tmp8_ = _account_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _account_list;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _account_index);
			account = (TootleAPIAccount*) _tmp10_;
			_tmp11_ = label;
			_tmp12_ = account;
			_tmp13_ = tootle_api_account_get_handle (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = _tmp14_;
			_tmp16_ = g_strconcat (_tmp15_, " ", NULL);
			_tmp17_ = _tmp16_;
			_tmp18_ = g_strconcat (_tmp11_, _tmp17_, NULL);
			_g_free0 (label);
			label = _tmp18_;
			_g_free0 (_tmp17_);
			_g_free0 (_tmp15_);
			_g_object_unref0 (account);
		}
	}
	result = label;
	return result;
}

gchar*
tootle_widgets_conversation_get_avatar_url (TootleWidgetsConversation* self)
{
	gchar* result;
	TootleAPIConversation* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_conversation;
	_tmp1_ = tootle_api_conversation_get_accounts (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ > 1) {
		result = NULL;
		return result;
	} else {
		TootleAPIConversation* _tmp5_;
		GeeArrayList* _tmp6_;
		GeeArrayList* _tmp7_;
		gpointer _tmp8_;
		TootleAPIAccount* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp5_ = self->priv->_conversation;
		_tmp6_ = tootle_api_conversation_get_accounts (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, 0);
		_tmp9_ = (TootleAPIAccount*) _tmp8_;
		_tmp10_ = tootle_api_account_get_avatar (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = g_strdup (_tmp11_);
		_tmp13_ = _tmp12_;
		_g_object_unref0 (_tmp9_);
		result = _tmp13_;
		return result;
	}
}

static void
tootle_widgets_conversation_class_init (TootleWidgetsConversationClass * klass,
                                        gpointer klass_data)
{
	tootle_widgets_conversation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TootleWidgetsConversation_private_offset);
	((TootleWidgetsStatusClass *) klass)->on_open = (void (*) (TootleWidgetsStatus*)) tootle_widgets_conversation_real_on_open;
	G_OBJECT_CLASS (klass)->get_property = _vala_tootle_widgets_conversation_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tootle_widgets_conversation_set_property;
	G_OBJECT_CLASS (klass)->finalize = tootle_widgets_conversation_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY, tootle_widgets_conversation_properties[TOOTLE_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY] = g_param_spec_object ("conversation", "conversation", "conversation", TOOTLE_API_TYPE_CONVERSATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_WIDGETS_CONVERSATION_TITLE_TEXT_PROPERTY, tootle_widgets_conversation_properties[TOOTLE_WIDGETS_CONVERSATION_TITLE_TEXT_PROPERTY] = g_param_spec_string ("title-text", "title-text", "title-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_WIDGETS_CONVERSATION_SUBTITLE_TEXT_PROPERTY, tootle_widgets_conversation_properties[TOOTLE_WIDGETS_CONVERSATION_SUBTITLE_TEXT_PROPERTY] = g_param_spec_string ("subtitle-text", "subtitle-text", "subtitle-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_WIDGETS_CONVERSATION_AVATAR_URL_PROPERTY, tootle_widgets_conversation_properties[TOOTLE_WIDGETS_CONVERSATION_AVATAR_URL_PROPERTY] = g_param_spec_string ("avatar-url", "avatar-url", "avatar-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tootle_widgets_conversation_instance_init (TootleWidgetsConversation * self,
                                           gpointer klass)
{
	self->priv = tootle_widgets_conversation_get_instance_private (self);
}

static void
tootle_widgets_conversation_finalize (GObject * obj)
{
	TootleWidgetsConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_WIDGETS_TYPE_CONVERSATION, TootleWidgetsConversation);
	_g_object_unref0 (self->priv->_conversation);
	G_OBJECT_CLASS (tootle_widgets_conversation_parent_class)->finalize (obj);
}

static GType
tootle_widgets_conversation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleWidgetsConversationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_widgets_conversation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleWidgetsConversation), 0, (GInstanceInitFunc) tootle_widgets_conversation_instance_init, NULL };
	GType tootle_widgets_conversation_type_id;
	tootle_widgets_conversation_type_id = g_type_register_static (TOOTLE_WIDGETS_TYPE_STATUS, "TootleWidgetsConversation", &g_define_type_info, 0);
	TootleWidgetsConversation_private_offset = g_type_add_instance_private (tootle_widgets_conversation_type_id, sizeof (TootleWidgetsConversationPrivate));
	return tootle_widgets_conversation_type_id;
}

GType
tootle_widgets_conversation_get_type (void)
{
	static volatile gsize tootle_widgets_conversation_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_widgets_conversation_type_id__volatile)) {
		GType tootle_widgets_conversation_type_id;
		tootle_widgets_conversation_type_id = tootle_widgets_conversation_get_type_once ();
		g_once_init_leave (&tootle_widgets_conversation_type_id__volatile, tootle_widgets_conversation_type_id);
	}
	return tootle_widgets_conversation_type_id__volatile;
}

static void
_vala_tootle_widgets_conversation_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	TootleWidgetsConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_WIDGETS_TYPE_CONVERSATION, TootleWidgetsConversation);
	switch (property_id) {
		case TOOTLE_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY:
		g_value_set_object (value, tootle_widgets_conversation_get_conversation (self));
		break;
		case TOOTLE_WIDGETS_CONVERSATION_TITLE_TEXT_PROPERTY:
		g_value_take_string (value, tootle_widgets_conversation_get_title_text (self));
		break;
		case TOOTLE_WIDGETS_CONVERSATION_SUBTITLE_TEXT_PROPERTY:
		g_value_take_string (value, tootle_widgets_conversation_get_subtitle_text (self));
		break;
		case TOOTLE_WIDGETS_CONVERSATION_AVATAR_URL_PROPERTY:
		g_value_take_string (value, tootle_widgets_conversation_get_avatar_url (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tootle_widgets_conversation_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	TootleWidgetsConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_WIDGETS_TYPE_CONVERSATION, TootleWidgetsConversation);
	switch (property_id) {
		case TOOTLE_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY:
		tootle_widgets_conversation_set_conversation (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

