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

#include "libdino.h"
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <gee.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>
#include <stdlib.h>
#include <string.h>
#include "xmpp-vala.h"
#include "dino_i18n.h"
#include <gdk/gdk.h>
#include <gio/gio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

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

typedef struct _DinoUiConversationSummaryContentMetaItem DinoUiConversationSummaryContentMetaItem;
typedef struct _DinoUiConversationSummaryContentMetaItemClass DinoUiConversationSummaryContentMetaItemClass;
typedef struct _DinoUiConversationSummaryContentMetaItemPrivate DinoUiConversationSummaryContentMetaItemPrivate;

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

typedef struct _DinoUiConversationSummaryMessageMetaItem DinoUiConversationSummaryMessageMetaItem;
typedef struct _DinoUiConversationSummaryMessageMetaItemClass DinoUiConversationSummaryMessageMetaItemClass;
typedef struct _DinoUiConversationSummaryMessageMetaItemPrivate DinoUiConversationSummaryMessageMetaItemPrivate;

#define DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE (dino_ui_conversation_summary_message_item_edit_mode_get_type ())
#define DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE, DinoUiConversationSummaryMessageItemEditMode))
#define DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE, DinoUiConversationSummaryMessageItemEditModeClass))
#define DINO_UI_CONVERSATION_SUMMARY_IS_MESSAGE_ITEM_EDIT_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE))
#define DINO_UI_CONVERSATION_SUMMARY_IS_MESSAGE_ITEM_EDIT_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE))
#define DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE, DinoUiConversationSummaryMessageItemEditModeClass))

typedef struct _DinoUiConversationSummaryMessageItemEditMode DinoUiConversationSummaryMessageItemEditMode;
typedef struct _DinoUiConversationSummaryMessageItemEditModeClass DinoUiConversationSummaryMessageItemEditModeClass;

#define DINO_UI_TYPE_CHAT_TEXT_VIEW_CONTROLLER (dino_ui_chat_text_view_controller_get_type ())
#define DINO_UI_CHAT_TEXT_VIEW_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CHAT_TEXT_VIEW_CONTROLLER, DinoUiChatTextViewController))
#define DINO_UI_CHAT_TEXT_VIEW_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CHAT_TEXT_VIEW_CONTROLLER, DinoUiChatTextViewControllerClass))
#define DINO_UI_IS_CHAT_TEXT_VIEW_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CHAT_TEXT_VIEW_CONTROLLER))
#define DINO_UI_IS_CHAT_TEXT_VIEW_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CHAT_TEXT_VIEW_CONTROLLER))
#define DINO_UI_CHAT_TEXT_VIEW_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CHAT_TEXT_VIEW_CONTROLLER, DinoUiChatTextViewControllerClass))

typedef struct _DinoUiChatTextViewController DinoUiChatTextViewController;
typedef struct _DinoUiChatTextViewControllerClass DinoUiChatTextViewControllerClass;
typedef enum  {
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_NONE,
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_PENDING,
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_DELIVERY_FAILED
} DinoUiConversationSummaryMessageMetaItemAdditionalInfo;

#define DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_TYPE_ADDITIONAL_INFO (dino_ui_conversation_summary_message_meta_item_additional_info_get_type ())
enum  {
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_0_PROPERTY,
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_MARKED_PROPERTY,
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_NUM_PROPERTIES
};
static GParamSpec* dino_ui_conversation_summary_message_meta_item_properties[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block35Data Block35Data;
typedef struct _Block36Data Block36Data;
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _pango_attribute_destroy0(var) ((var == NULL) ? NULL : (var = (pango_attribute_destroy (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _Block37Data Block37Data;

#define DINO_UI_QUOTE_TYPE_MODEL (dino_ui_quote_model_get_type ())
#define DINO_UI_QUOTE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_QUOTE_TYPE_MODEL, DinoUiQuoteModel))
#define DINO_UI_QUOTE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_QUOTE_TYPE_MODEL, DinoUiQuoteModelClass))
#define DINO_UI_QUOTE_IS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_QUOTE_TYPE_MODEL))
#define DINO_UI_QUOTE_IS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_QUOTE_TYPE_MODEL))
#define DINO_UI_QUOTE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_QUOTE_TYPE_MODEL, DinoUiQuoteModelClass))

typedef struct _DinoUiQuoteModel DinoUiQuoteModel;
typedef struct _DinoUiQuoteModelClass DinoUiQuoteModelClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _Block38Data Block38Data;
typedef struct _DinoUiConversationSummaryMessageItemEditModePrivate DinoUiConversationSummaryMessageItemEditModePrivate;

#define DINO_UI_TYPE_CHAT_TEXT_VIEW (dino_ui_chat_text_view_get_type ())
#define DINO_UI_CHAT_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CHAT_TEXT_VIEW, DinoUiChatTextView))
#define DINO_UI_CHAT_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CHAT_TEXT_VIEW, DinoUiChatTextViewClass))
#define DINO_UI_IS_CHAT_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CHAT_TEXT_VIEW))
#define DINO_UI_IS_CHAT_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CHAT_TEXT_VIEW))
#define DINO_UI_CHAT_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CHAT_TEXT_VIEW, DinoUiChatTextViewClass))

typedef struct _DinoUiChatTextView DinoUiChatTextView;
typedef struct _DinoUiChatTextViewClass DinoUiChatTextViewClass;
typedef struct _DinoUiChatTextViewPrivate DinoUiChatTextViewPrivate;
enum  {
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_0_PROPERTY,
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_NUM_PROPERTIES
};
static GParamSpec* dino_ui_conversation_summary_message_item_edit_mode_properties[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_NUM_PROPERTIES];
enum  {
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_CANCELLED_SIGNAL,
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_SEND_SIGNAL,
	DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_NUM_SIGNALS
};
static guint dino_ui_conversation_summary_message_item_edit_mode_signals[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_NUM_SIGNALS] = {0};

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

struct _DinoUiConversationSummaryContentMetaItemClass {
	DinoPluginsMetaConversationItemClass parent_class;
};

struct _DinoUiConversationSummaryMessageMetaItem {
	DinoUiConversationSummaryContentMetaItem parent_instance;
	DinoUiConversationSummaryMessageMetaItemPrivate * priv;
	DinoPluginsConversationItemWidgetInterface* outer;
	GtkLabel* label;
};

struct _DinoUiConversationSummaryMessageMetaItemClass {
	DinoUiConversationSummaryContentMetaItemClass parent_class;
};

struct _DinoUiConversationSummaryMessageMetaItemPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoMessageItem* message_item;
	DinoEntitiesMessageMarked _marked;
	DinoUiConversationSummaryMessageItemEditMode* edit_mode;
	DinoUiChatTextViewController* controller;
	DinoUiConversationSummaryMessageMetaItemAdditionalInfo additional_info;
	gulong realize_id;
	gulong marked_notify_handler_id;
	guint pending_timeout_id;
};

struct _Block35Data {
	int _ref_count_;
	DinoUiConversationSummaryMessageMetaItem* self;
	DinoEntitiesMessage* message;
};

struct _Block36Data {
	int _ref_count_;
	Block35Data * _data35_;
	GBinding* binding;
};

struct _Block37Data {
	int _ref_count_;
	DinoUiConversationSummaryMessageMetaItem* self;
	DinoContentItem* quoted_content_item;
};

struct _Block38Data {
	int _ref_count_;
	DinoUiConversationSummaryMessageMetaItem* self;
	DinoMessageItem* message_item;
};

struct _DinoUiConversationSummaryMessageItemEditMode {
	GtkBox parent_instance;
	DinoUiConversationSummaryMessageItemEditModePrivate * priv;
	GtkMenuButton* emoji_button;
	DinoUiChatTextView* chat_text_view;
	GtkButton* cancel_button;
	GtkButton* send_button;
	GtkFrame* frame;
};

struct _DinoUiConversationSummaryMessageItemEditModeClass {
	GtkBoxClass parent_class;
};

struct _DinoUiChatTextView {
	GtkBox parent_instance;
	DinoUiChatTextViewPrivate * priv;
	GtkScrolledWindow* scrolled_window;
	GtkTextView* text_view;
};

struct _DinoUiChatTextViewClass {
	GtkBoxClass parent_class;
};

static gint DinoUiConversationSummaryMessageMetaItem_private_offset;
static gpointer dino_ui_conversation_summary_message_meta_item_parent_class = NULL;
static gpointer dino_ui_conversation_summary_message_item_edit_mode_parent_class = NULL;

VALA_EXTERN GType dino_ui_conversation_summary_content_meta_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiConversationSummaryContentMetaItem, g_object_unref)
VALA_EXTERN GType dino_ui_conversation_summary_message_meta_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiConversationSummaryMessageMetaItem, g_object_unref)
VALA_EXTERN GType dino_ui_conversation_summary_message_item_edit_mode_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiConversationSummaryMessageItemEditMode, g_object_unref)
VALA_EXTERN GType dino_ui_chat_text_view_controller_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiChatTextViewController, g_object_unref)
static GType dino_ui_conversation_summary_message_meta_item_additional_info_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN DinoUiConversationSummaryMessageMetaItem* dino_ui_conversation_summary_message_meta_item_new (DinoContentItem* content_item,
                                                                                              DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiConversationSummaryMessageMetaItem* dino_ui_conversation_summary_message_meta_item_construct (GType object_type,
                                                                                                    DinoContentItem* content_item,
                                                                                                    DinoStreamInteractor* stream_interactor);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
VALA_EXTERN DinoUiConversationSummaryContentMetaItem* dino_ui_conversation_summary_content_meta_item_construct (GType object_type,
                                                                                                    DinoContentItem* content_item);
static void dino_ui_conversation_summary_message_meta_item_on_received_correction (DinoUiConversationSummaryMessageMetaItem* self,
                                                                            DinoContentItem* content_item);
static void _dino_ui_conversation_summary_message_meta_item_on_received_correction_dino_message_correction_received_correction (DinoMessageCorrection* _sender,
                                                                                                                         DinoContentItem* content_item,
                                                                                                                         gpointer self);
VALA_EXTERN gboolean dino_ui_conversation_summary_message_meta_item_on_label_activate_link (const gchar* uri);
static gboolean _dino_ui_conversation_summary_message_meta_item_on_label_activate_link_gtk_label_activate_link (GtkLabel* _sender,
                                                                                                         const gchar* uri,
                                                                                                         gpointer self);
static gboolean _vala_dino_entities_message_marked_array_contains (DinoEntitiesMessageMarked * stack,
                                                            gssize stack_length,
                                                            const DinoEntitiesMessageMarked needle);
static Block36Data* block36_data_ref (Block36Data* _data36_);
static void block36_data_unref (void * _userdata_);
static void ___lambda29_ (Block36Data* _data36_);
VALA_EXTERN void dino_ui_conversation_summary_message_meta_item_update_label (DinoUiConversationSummaryMessageMetaItem* self);
static void ____lambda29__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void dino_ui_conversation_summary_message_meta_item_generate_markup_text (DinoUiConversationSummaryMessageMetaItem* self,
                                                                          DinoContentItem* item,
                                                                          GtkLabel* label);
VALA_EXTERN gchar* dino_ui_util_remove_fallbacks_adjust_markups (const gchar* text,
                                                     gboolean contains_quote,
                                                     GeeList* fallbacks,
                                                     GeeList* markups);
VALA_EXTERN gchar* dino_ui_util_get_participant_display_name (DinoStreamInteractor* stream_interactor,
                                                  DinoEntitiesConversation* conversation,
                                                  XmppJid* participant,
                                                  gboolean me_is_me);
VALA_EXTERN gchar* dino_ui_util_unbreak_space_around_non_spacing_mark (gchar* s);
VALA_EXTERN gchar* dino_ui_util_parse_add_markup_theme (const gchar* s_,
                                            const gchar* highlight_word,
                                            gboolean parse_links,
                                            gboolean parse_text_markup,
                                            gboolean parse_quotes,
                                            gboolean dark_theme,
                                            gboolean* theme_dependent,
                                            gboolean already_escaped_);
VALA_EXTERN gboolean dino_ui_util_is_dark_theme (GtkWidget* widget);
VALA_EXTERN gint dino_ui_util_get_only_emoji_count (const gchar* markup_text);
static gboolean ____lambda28_ (DinoUiConversationSummaryMessageMetaItem* self);
static gboolean _____lambda28__gsource_func (gpointer self);
VALA_EXTERN gchar* dino_ui_util_rgba_to_hex (GdkRGBA* rgba);
VALA_EXTERN void dino_ui_util_get_label_pango_color (GtkLabel* label,
                                         const gchar* css_color,
                                         GdkRGBA* result);
static void _dino_ui_conversation_summary_message_meta_item_update_label_gtk_widget_realize (GtkWidget* _sender,
                                                                                      gpointer self);
static GObject* dino_ui_conversation_summary_message_meta_item_real_get_widget (DinoPluginsMetaConversationItem* base,
                                                                         DinoPluginsConversationItemWidgetInterface* outer,
                                                                         DinoPluginsWidgetType type);
static void dino_ui_conversation_summary_message_meta_item_on_in_edit_mode_changed (DinoUiConversationSummaryMessageMetaItem* self);
static void _dino_ui_conversation_summary_message_meta_item_on_in_edit_mode_changed_g_object_notify (GObject* _sender,
                                                                                              GParamSpec* pspec,
                                                                                              gpointer self);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
VALA_EXTERN GType dino_ui_quote_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiQuoteModel, g_object_unref)
VALA_EXTERN DinoUiQuoteModel* dino_ui_quote_model_new_from_content_item (DinoContentItem* content_item,
                                                             DinoEntitiesConversation* conversation,
                                                             DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiQuoteModel* dino_ui_quote_model_construct_from_content_item (GType object_type,
                                                                   DinoContentItem* content_item,
                                                                   DinoEntitiesConversation* conversation,
                                                                   DinoStreamInteractor* stream_interactor);
static void ____lambda32_ (Block37Data* _data37_);
static void _____lambda32__dino_ui_quote_model_jump_to (DinoUiQuoteModel* _sender,
                                                 gpointer self);
VALA_EXTERN GtkWidget* dino_ui_quote_get_widget (DinoUiQuoteModel* model);
static GeeList* dino_ui_conversation_summary_message_meta_item_real_get_item_actions (DinoPluginsMetaConversationItem* base,
                                                                               DinoPluginsWidgetType type);
static void ___lambda35_ (DinoUiConversationSummaryMessageMetaItem* self);
static void ____lambda35__dino_plugins_message_action_evoked (GVariant* variant,
                                                       gpointer self);
VALA_EXTERN DinoPluginsMessageAction* dino_ui_get_reply_action (DinoContentItem* content_item,
                                                    DinoEntitiesConversation* conversation,
                                                    DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoPluginsMessageAction* dino_ui_get_reaction_action (DinoContentItem* content_item,
                                                       DinoEntitiesConversation* conversation,
                                                       DinoStreamInteractor* stream_interactor);
static Block38Data* block38_data_ref (Block38Data* _data38_);
static void block38_data_unref (void * _userdata_);
VALA_EXTERN DinoUiConversationSummaryMessageItemEditMode* dino_ui_conversation_summary_message_item_edit_mode_new (void);
VALA_EXTERN DinoUiConversationSummaryMessageItemEditMode* dino_ui_conversation_summary_message_item_edit_mode_construct (GType object_type);
VALA_EXTERN GType dino_ui_chat_text_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiChatTextView, g_object_unref)
VALA_EXTERN DinoUiChatTextViewController* dino_ui_chat_text_view_controller_new (DinoUiChatTextView* widget,
                                                                     DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiChatTextViewController* dino_ui_chat_text_view_controller_construct (GType object_type,
                                                                           DinoUiChatTextView* widget,
                                                                           DinoStreamInteractor* stream_interactor);
VALA_EXTERN void dino_ui_chat_text_view_controller_initialize_for_conversation (DinoUiChatTextViewController* self,
                                                                    DinoEntitiesConversation* conversation);
static void ___lambda30_ (DinoUiConversationSummaryMessageMetaItem* self);
static void ____lambda30__dino_ui_conversation_summary_message_item_edit_mode_cancelled (DinoUiConversationSummaryMessageItemEditMode* _sender,
                                                                                  gpointer self);
static void ___lambda31_ (Block38Data* _data38_);
VALA_EXTERN GeeList* dino_ui_chat_text_view_get_markups (DinoUiChatTextView* self);
static void ____lambda31__dino_ui_conversation_summary_message_item_edit_mode_send (DinoUiConversationSummaryMessageItemEditMode* _sender,
                                                                             gpointer self);
VALA_EXTERN void dino_ui_chat_text_view_set_text (DinoUiChatTextView* self,
                                      DinoEntitiesMessage* message);
static void dino_ui_conversation_summary_message_meta_item_real_dispose (GObject* base);
VALA_EXTERN DinoEntitiesMessageMarked dino_ui_conversation_summary_message_meta_item_get_marked (DinoUiConversationSummaryMessageMetaItem* self);
VALA_EXTERN void dino_ui_conversation_summary_message_meta_item_set_marked (DinoUiConversationSummaryMessageMetaItem* self,
                                                                DinoEntitiesMessageMarked value);
static void dino_ui_conversation_summary_message_meta_item_finalize (GObject * obj);
static GType dino_ui_conversation_summary_message_meta_item_get_type_once (void);
static void _vala_dino_ui_conversation_summary_message_meta_item_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec);
static void _vala_dino_ui_conversation_summary_message_meta_item_set_property (GObject * object,
                                                                        guint property_id,
                                                                        const GValue * value,
                                                                        GParamSpec * pspec);
static void dino_ui_conversation_summary_message_item_edit_mode_on_text_view_changed (DinoUiConversationSummaryMessageItemEditMode* self);
static GObject * dino_ui_conversation_summary_message_item_edit_mode_constructor (GType type,
                                                                           guint n_construct_properties,
                                                                           GObjectConstructParam * construct_properties);
VALA_EXTERN GtkCssProvider* dino_ui_util_force_css (GtkWidget* widget,
                                        const gchar* css);
static void _dino_ui_conversation_summary_message_item_edit_mode___lambda22_ (DinoUiConversationSummaryMessageItemEditMode* self,
                                                                       const gchar* emoji);
static void __dino_ui_conversation_summary_message_item_edit_mode___lambda22__gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                                                                                       const gchar* text,
                                                                                                       gpointer self);
static void _dino_ui_conversation_summary_message_item_edit_mode_on_text_view_changed_gtk_text_buffer_changed (GtkTextBuffer* _sender,
                                                                                                        gpointer self);
static void _dino_ui_conversation_summary_message_item_edit_mode___lambda23_ (DinoUiConversationSummaryMessageItemEditMode* self);
static void __dino_ui_conversation_summary_message_item_edit_mode___lambda23__gtk_button_clicked (GtkButton* _sender,
                                                                                           gpointer self);
static void _dino_ui_conversation_summary_message_item_edit_mode___lambda24_ (DinoUiConversationSummaryMessageItemEditMode* self);
static void __dino_ui_conversation_summary_message_item_edit_mode___lambda24__gtk_button_clicked (GtkButton* _sender,
                                                                                           gpointer self);
static void _dino_ui_conversation_summary_message_item_edit_mode___lambda25_ (DinoUiConversationSummaryMessageItemEditMode* self);
static void __dino_ui_conversation_summary_message_item_edit_mode___lambda25__dino_ui_chat_text_view_cancel_input (DinoUiChatTextView* _sender,
                                                                                                            gpointer self);
static void _dino_ui_conversation_summary_message_item_edit_mode___lambda26_ (DinoUiConversationSummaryMessageItemEditMode* self);
static void __dino_ui_conversation_summary_message_item_edit_mode___lambda26__dino_ui_chat_text_view_send_text (DinoUiChatTextView* _sender,
                                                                                                         gpointer self);
static void dino_ui_conversation_summary_message_item_edit_mode_finalize (GObject * obj);
static GType dino_ui_conversation_summary_message_item_edit_mode_get_type_once (void);
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 inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_conversation_summary_message_meta_item_get_instance_private (DinoUiConversationSummaryMessageMetaItem* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiConversationSummaryMessageMetaItem_private_offset);
}

static GType
dino_ui_conversation_summary_message_meta_item_additional_info_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_NONE, "DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_NONE", "none"}, {DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_PENDING, "DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_PENDING", "pending"}, {DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_DELIVERY_FAILED, "DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_DELIVERY_FAILED", "delivery-failed"}, {0, NULL, NULL}};
	GType dino_ui_conversation_summary_message_meta_item_additional_info_type_id;
	dino_ui_conversation_summary_message_meta_item_additional_info_type_id = g_enum_register_static ("DinoUiConversationSummaryMessageMetaItemAdditionalInfo", values);
	return dino_ui_conversation_summary_message_meta_item_additional_info_type_id;
}

static GType
dino_ui_conversation_summary_message_meta_item_additional_info_get_type (void)
{
	static volatile gsize dino_ui_conversation_summary_message_meta_item_additional_info_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_conversation_summary_message_meta_item_additional_info_type_id__once)) {
		GType dino_ui_conversation_summary_message_meta_item_additional_info_type_id;
		dino_ui_conversation_summary_message_meta_item_additional_info_type_id = dino_ui_conversation_summary_message_meta_item_additional_info_get_type_once ();
		g_once_init_leave (&dino_ui_conversation_summary_message_meta_item_additional_info_type_id__once, dino_ui_conversation_summary_message_meta_item_additional_info_type_id);
	}
	return dino_ui_conversation_summary_message_meta_item_additional_info_type_id__once;
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		DinoUiConversationSummaryMessageMetaItem* self;
		self = _data35_->self;
		_g_object_unref0 (_data35_->message);
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

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

static void
_dino_ui_conversation_summary_message_meta_item_on_received_correction_dino_message_correction_received_correction (DinoMessageCorrection* _sender,
                                                                                                                    DinoContentItem* content_item,
                                                                                                                    gpointer self)
{
	dino_ui_conversation_summary_message_meta_item_on_received_correction ((DinoUiConversationSummaryMessageMetaItem*) self, content_item);
}

static gboolean
_dino_ui_conversation_summary_message_meta_item_on_label_activate_link_gtk_label_activate_link (GtkLabel* _sender,
                                                                                                const gchar* uri,
                                                                                                gpointer self)
{
	gboolean result;
	result = dino_ui_conversation_summary_message_meta_item_on_label_activate_link (uri);
	return result;
}

static gboolean
_vala_dino_entities_message_marked_array_contains (DinoEntitiesMessageMarked * stack,
                                                   gssize stack_length,
                                                   const DinoEntitiesMessageMarked needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (needle == stack[i]) {
			return TRUE;
		}
	}
	return FALSE;
}

static Block36Data*
block36_data_ref (Block36Data* _data36_)
{
	g_atomic_int_inc (&_data36_->_ref_count_);
	return _data36_;
}

static void
block36_data_unref (void * _userdata_)
{
	Block36Data* _data36_;
	_data36_ = (Block36Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
		DinoUiConversationSummaryMessageMetaItem* self;
		self = _data36_->_data35_->self;
		_g_object_unref0 (_data36_->binding);
		block35_data_unref (_data36_->_data35_);
		_data36_->_data35_ = NULL;
		g_slice_free (Block36Data, _data36_);
	}
}

static void
___lambda29_ (Block36Data* _data36_)
{
	Block35Data* _data35_;
	DinoUiConversationSummaryMessageMetaItem* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp12_ = FALSE;
	DinoEntitiesMessage* _tmp16_;
	DinoEntitiesMessageMarked _tmp17_;
	DinoEntitiesMessageMarked _tmp18_;
	DinoEntitiesMessageMarked* _tmp19_;
	gint _tmp19__length1;
	_data35_ = _data36_->_data35_;
	self = _data35_->self;
	if (self->priv->additional_info == DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_PENDING) {
		DinoEntitiesMessage* _tmp2_;
		DinoEntitiesMessageMarked _tmp3_;
		DinoEntitiesMessageMarked _tmp4_;
		_tmp2_ = _data35_->message;
		_tmp3_ = dino_entities_message_get_marked (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp1_ = _tmp4_ != DINO_ENTITIES_MESSAGE_MARKED_SENDING;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		DinoEntitiesMessage* _tmp5_;
		DinoEntitiesMessageMarked _tmp6_;
		DinoEntitiesMessageMarked _tmp7_;
		_tmp5_ = _data35_->message;
		_tmp6_ = dino_entities_message_get_marked (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp7_ != DINO_ENTITIES_MESSAGE_MARKED_UNSENT;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		dino_ui_conversation_summary_message_meta_item_update_label (self);
	}
	if (self->priv->additional_info == DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_DELIVERY_FAILED) {
		DinoEntitiesMessage* _tmp9_;
		DinoEntitiesMessageMarked _tmp10_;
		DinoEntitiesMessageMarked _tmp11_;
		_tmp9_ = _data35_->message;
		_tmp10_ = dino_entities_message_get_marked (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp8_ = _tmp11_ != DINO_ENTITIES_MESSAGE_MARKED_ERROR;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		dino_ui_conversation_summary_message_meta_item_update_label (self);
	}
	if (self->priv->additional_info != DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_DELIVERY_FAILED) {
		DinoEntitiesMessage* _tmp13_;
		DinoEntitiesMessageMarked _tmp14_;
		DinoEntitiesMessageMarked _tmp15_;
		_tmp13_ = _data35_->message;
		_tmp14_ = dino_entities_message_get_marked (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp12_ = _tmp15_ == DINO_ENTITIES_MESSAGE_MARKED_ERROR;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		dino_ui_conversation_summary_message_meta_item_update_label (self);
	}
	_tmp16_ = _data35_->message;
	_tmp17_ = dino_entities_message_get_marked (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = dino_entities_message_MARKED_RECEIVED;
	_tmp19__length1 = dino_entities_message_MARKED_RECEIVED_length1;
	if (_vala_dino_entities_message_marked_array_contains (_tmp19_, _tmp19__length1, _tmp18_)) {
		GBinding* _tmp20_;
		GBinding* _tmp21_;
		_tmp20_ = _data36_->binding;
		_tmp21_ = _g_object_ref0 (_tmp20_);
		g_binding_unbind (_tmp21_);
		g_signal_handler_disconnect ((GObject*) self, self->priv->marked_notify_handler_id);
		self->priv->marked_notify_handler_id = (gulong) -1;
	}
}

static void
____lambda29__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	___lambda29_ (self);
}

DinoUiConversationSummaryMessageMetaItem*
dino_ui_conversation_summary_message_meta_item_construct (GType object_type,
                                                          DinoContentItem* content_item,
                                                          DinoStreamInteractor* stream_interactor)
{
	DinoUiConversationSummaryMessageMetaItem * self = NULL;
	Block35Data* _data35_;
	DinoMessageItem* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoMessageCorrection* _tmp4_;
	GtkLabel* _tmp5_;
	DinoEntitiesMessage* _tmp6_;
	DinoEntitiesMessage* _tmp7_;
	gboolean _tmp8_ = FALSE;
	DinoEntitiesMessage* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	g_return_val_if_fail (content_item != NULL, NULL);
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	_data35_ = g_slice_new0 (Block35Data);
	_data35_->_ref_count_ = 1;
	self = (DinoUiConversationSummaryMessageMetaItem*) dino_ui_conversation_summary_content_meta_item_construct (object_type, content_item);
	_data35_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (content_item, DINO_TYPE_MESSAGE_ITEM) ? ((DinoMessageItem*) content_item) : NULL);
	_g_object_unref0 (self->priv->message_item);
	self->priv->message_item = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp1_;
	_tmp2_ = dino_message_correction_IDENTITY;
	_tmp3_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MESSAGE_CORRECTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (DinoMessageCorrection*) _tmp3_;
	g_signal_connect_object (_tmp4_, "received-correction", (GCallback) _dino_ui_conversation_summary_message_meta_item_on_received_correction_dino_message_correction_received_correction, self, 0);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = self->label;
	g_signal_connect (_tmp5_, "activate-link", (GCallback) _dino_ui_conversation_summary_message_meta_item_on_label_activate_link_gtk_label_activate_link, NULL);
	_tmp6_ = G_TYPE_CHECK_INSTANCE_CAST (content_item, DINO_TYPE_MESSAGE_ITEM, DinoMessageItem)->message;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	_data35_->message = _tmp7_;
	_tmp9_ = _data35_->message;
	_tmp10_ = dino_entities_message_get_direction (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_ == DINO_ENTITIES_MESSAGE_DIRECTION_SENT) {
		DinoEntitiesMessage* _tmp12_;
		DinoEntitiesMessageMarked _tmp13_;
		DinoEntitiesMessageMarked _tmp14_;
		DinoEntitiesMessageMarked* _tmp15_;
		gint _tmp15__length1;
		_tmp12_ = _data35_->message;
		_tmp13_ = dino_entities_message_get_marked (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = dino_entities_message_MARKED_RECEIVED;
		_tmp15__length1 = dino_entities_message_MARKED_RECEIVED_length1;
		_tmp8_ = !_vala_dino_entities_message_marked_array_contains (_tmp15_, _tmp15__length1, _tmp14_);
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		Block36Data* _data36_;
		DinoEntitiesMessage* _tmp16_;
		GBinding* _tmp17_;
		GBinding* _tmp18_;
		gulong _tmp19_;
		_data36_ = g_slice_new0 (Block36Data);
		_data36_->_ref_count_ = 1;
		_data36_->_data35_ = block35_data_ref (_data35_);
		_tmp16_ = _data35_->message;
		_tmp17_ = g_object_bind_property_with_closures ((GObject*) _tmp16_, "marked", (GObject*) self, "marked", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp18_ = _g_object_ref0 (_tmp17_);
		_data36_->binding = _tmp18_;
		_tmp19_ = g_signal_connect_data ((GObject*) self, "notify::marked", (GCallback) ____lambda29__g_object_notify, block36_data_ref (_data36_), (GClosureNotify) block36_data_unref, 0);
		self->priv->marked_notify_handler_id = _tmp19_;
		block36_data_unref (_data36_);
		_data36_ = NULL;
	}
	dino_ui_conversation_summary_message_meta_item_update_label (self);
	block35_data_unref (_data35_);
	_data35_ = NULL;
	return self;
}

DinoUiConversationSummaryMessageMetaItem*
dino_ui_conversation_summary_message_meta_item_new (DinoContentItem* content_item,
                                                    DinoStreamInteractor* stream_interactor)
{
	return dino_ui_conversation_summary_message_meta_item_construct (DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM, content_item, stream_interactor);
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static gint
string_index_of_nth_char (const gchar* self,
                          glong c)
{
	gchar* _tmp0_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = g_utf8_offset_to_pointer (self, c);
	result = (gint) (_tmp0_ - ((gchar*) self));
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gboolean
____lambda28_ (DinoUiConversationSummaryMessageMetaItem* self)
{
	gboolean result;
	dino_ui_conversation_summary_message_meta_item_update_label (self);
	self->priv->pending_timeout_id = (guint) -1;
	result = FALSE;
	return result;
}

static gboolean
_____lambda28__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda28_ ((DinoUiConversationSummaryMessageMetaItem*) self);
	return result;
}

static void
_dino_ui_conversation_summary_message_meta_item_update_label_gtk_widget_realize (GtkWidget* _sender,
                                                                                 gpointer self)
{
	dino_ui_conversation_summary_message_meta_item_update_label ((DinoUiConversationSummaryMessageMetaItem*) self);
}

static void
dino_ui_conversation_summary_message_meta_item_generate_markup_text (DinoUiConversationSummaryMessageMetaItem* self,
                                                                     DinoContentItem* item,
                                                                     GtkLabel* label)
{
	DinoMessageItem* message_item = NULL;
	DinoMessageItem* _tmp0_;
	DinoEntitiesConversation* conversation = NULL;
	DinoMessageItem* _tmp1_;
	DinoEntitiesConversation* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	DinoEntitiesMessage* message = NULL;
	DinoMessageItem* _tmp4_;
	DinoEntitiesMessage* _tmp5_;
	DinoEntitiesMessage* _tmp6_;
	GeeArrayList* markups = NULL;
	GeeArrayList* _tmp7_;
	gchar* markup_text = NULL;
	DinoEntitiesMessage* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	PangoAttrList* attrs = NULL;
	PangoAttrList* _tmp34_;
	PangoAttrList* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	gint _tmp38_;
	gint _tmp39_;
	gboolean theme_dependent = FALSE;
	const gchar* _tmp49_;
	DinoEntitiesMessage* _tmp50_;
	gint _tmp51_;
	gint _tmp52_;
	DinoEntitiesMessage* _tmp53_;
	GeeList* _tmp54_;
	GeeList* _tmp55_;
	GeeArrayList* _tmp56_;
	gchar* _tmp57_;
	PangoAttribute* bold_attr = NULL;
	PangoAttribute* _tmp58_;
	PangoAttribute* italic_attr = NULL;
	PangoAttribute* _tmp59_;
	PangoAttribute* strikethrough_attr = NULL;
	PangoAttribute* _tmp60_;
	const gchar* _tmp61_;
	gchar* _tmp140_;
	gchar* _tmp141_;
	DinoEntitiesConversation* _tmp142_;
	DinoEntitiesConversationType _tmp143_;
	DinoEntitiesConversationType _tmp144_;
	gint only_emoji_count = 0;
	const gchar* _tmp154_;
	const gchar* _tmp165_ = NULL;
	GtkLabel* _tmp166_;
	gchar* dim_color = NULL;
	gchar* _tmp167_;
	DinoEntitiesMessage* _tmp168_;
	const gchar* _tmp169_;
	gboolean _tmp179_ = FALSE;
	DinoEntitiesMessage* _tmp180_;
	gboolean _tmp181_;
	gboolean _tmp182_;
	gboolean _tmp228_ = FALSE;
	const gchar* _tmp231_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_return_if_fail (label != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (item, DINO_TYPE_MESSAGE_ITEM) ? ((DinoMessageItem*) item) : NULL);
	message_item = _tmp0_;
	_tmp1_ = message_item;
	_tmp2_ = _tmp1_->conversation;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	conversation = _tmp3_;
	_tmp4_ = message_item;
	_tmp5_ = _tmp4_->message;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	message = _tmp6_;
	_tmp7_ = gee_array_list_new (XMPP_XEP_MESSAGE_MARKUP_TYPE_SPAN, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	markups = _tmp7_;
	{
		GeeList* _markup_list = NULL;
		DinoEntitiesMessage* _tmp8_;
		GeeList* _tmp9_;
		gint _markup_size = 0;
		GeeList* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		gint _markup_index = 0;
		_tmp8_ = message;
		_tmp9_ = dino_entities_message_get_markups (_tmp8_);
		_markup_list = _tmp9_;
		_tmp10_ = _markup_list;
		_tmp11_ = gee_collection_get_size ((GeeCollection*) _tmp10_);
		_tmp12_ = _tmp11_;
		_markup_size = _tmp12_;
		_markup_index = -1;
		while (TRUE) {
			gint _tmp13_;
			gint _tmp14_;
			XmppXepMessageMarkupSpan* markup = NULL;
			GeeList* _tmp15_;
			gpointer _tmp16_;
			GeeArrayList* _tmp17_;
			XmppXepMessageMarkupSpan* _tmp18_;
			GeeList* _tmp19_;
			GeeList* _tmp20_;
			GeeList* _tmp21_;
			XmppXepMessageMarkupSpan* _tmp22_;
			gint _tmp23_;
			gint _tmp24_;
			XmppXepMessageMarkupSpan* _tmp25_;
			gint _tmp26_;
			gint _tmp27_;
			XmppXepMessageMarkupSpan* _tmp28_ = NULL;
			XmppXepMessageMarkupSpan* _tmp29_;
			_markup_index = _markup_index + 1;
			_tmp13_ = _markup_index;
			_tmp14_ = _markup_size;
			if (!(_tmp13_ < _tmp14_)) {
				break;
			}
			_tmp15_ = _markup_list;
			_tmp16_ = gee_list_get (_tmp15_, _markup_index);
			markup = (XmppXepMessageMarkupSpan*) _tmp16_;
			_tmp17_ = markups;
			_tmp18_ = markup;
			_tmp19_ = xmpp_xep_message_markup_span_get_types (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = _g_object_ref0 (_tmp20_);
			_tmp22_ = markup;
			_tmp23_ = xmpp_xep_message_markup_span_get_start_char (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = markup;
			_tmp26_ = xmpp_xep_message_markup_span_get_end_char (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = xmpp_xep_message_markup_span_new ();
			xmpp_xep_message_markup_span_set_types (_tmp28_, _tmp21_);
			_g_object_unref0 (_tmp21_);
			xmpp_xep_message_markup_span_set_start_char (_tmp28_, _tmp24_);
			xmpp_xep_message_markup_span_set_end_char (_tmp28_, _tmp27_);
			_tmp29_ = _tmp28_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp17_, _tmp29_);
			_g_object_unref0 (_tmp29_);
			_g_object_unref0 (markup);
		}
		_g_object_unref0 (_markup_list);
	}
	_tmp30_ = message;
	_tmp31_ = dino_entities_message_get_body (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = g_strdup (_tmp32_);
	markup_text = _tmp33_;
	_tmp34_ = pango_attr_list_new ();
	attrs = _tmp34_;
	_tmp35_ = attrs;
	gtk_label_set_attributes (label, _tmp35_);
	_tmp36_ = markup_text;
	if (_tmp36_ == NULL) {
		_pango_attr_list_unref0 (attrs);
		_g_free0 (markup_text);
		_g_object_unref0 (markups);
		_g_object_unref0 (message);
		_g_object_unref0 (conversation);
		_g_object_unref0 (message_item);
		return;
	}
	_tmp37_ = markup_text;
	_tmp38_ = strlen (_tmp37_);
	_tmp39_ = _tmp38_;
	if (_tmp39_ > 10000) {
		const gchar* _tmp40_;
		gchar* _tmp41_;
		gchar* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		const gchar* _tmp45_;
		gchar* _tmp46_;
		gchar* _tmp47_;
		gchar* _tmp48_;
		_tmp40_ = markup_text;
		_tmp41_ = string_substring (_tmp40_, (glong) 0, (glong) 10000);
		_tmp42_ = _tmp41_;
		_tmp43_ = g_strconcat (_tmp42_, " [", NULL);
		_tmp44_ = _tmp43_;
		_tmp45_ = dino_gettext ("Message too long");
		_tmp46_ = g_strconcat (_tmp44_, _tmp45_, NULL);
		_tmp47_ = _tmp46_;
		_tmp48_ = g_strconcat (_tmp47_, "]", NULL);
		_g_free0 (markup_text);
		markup_text = _tmp48_;
		_g_free0 (_tmp47_);
		_g_free0 (_tmp44_);
		_g_free0 (_tmp42_);
	}
	theme_dependent = FALSE;
	_tmp49_ = markup_text;
	_tmp50_ = message;
	_tmp51_ = dino_entities_message_get_quoted_item_id (_tmp50_);
	_tmp52_ = _tmp51_;
	_tmp53_ = message;
	_tmp54_ = dino_entities_message_get_fallbacks (_tmp53_);
	_tmp55_ = _tmp54_;
	_tmp56_ = markups;
	_tmp57_ = dino_ui_util_remove_fallbacks_adjust_markups (_tmp49_, _tmp52_ > 0, _tmp55_, (GeeList*) _tmp56_);
	_g_free0 (markup_text);
	markup_text = _tmp57_;
	_g_object_unref0 (_tmp55_);
	_tmp58_ = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
	bold_attr = _tmp58_;
	_tmp59_ = pango_attr_style_new (PANGO_STYLE_ITALIC);
	italic_attr = _tmp59_;
	_tmp60_ = pango_attr_strikethrough_new (TRUE);
	strikethrough_attr = _tmp60_;
	_tmp61_ = markup_text;
	if (g_str_has_prefix (_tmp61_, "/me ")) {
		gchar* display_name = NULL;
		DinoStreamInteractor* _tmp62_;
		DinoEntitiesConversation* _tmp63_;
		DinoEntitiesMessage* _tmp64_;
		XmppJid* _tmp65_;
		XmppJid* _tmp66_;
		gchar* _tmp67_;
		const gchar* _tmp68_;
		gchar* _tmp69_;
		gchar* _tmp70_;
		const gchar* _tmp71_;
		gchar* _tmp72_;
		gchar* _tmp73_;
		gchar* _tmp74_;
		PangoAttribute* _tmp92_;
		const gchar* _tmp93_;
		gint _tmp94_;
		gint _tmp95_;
		PangoAttribute* _tmp96_;
		const gchar* _tmp97_;
		gint _tmp98_;
		gint _tmp99_;
		PangoAttrList* _tmp100_;
		PangoAttribute* _tmp101_;
		PangoAttribute* _tmp102_;
		PangoAttrList* _tmp103_;
		PangoAttribute* _tmp104_;
		PangoAttribute* _tmp105_;
		_tmp62_ = self->priv->stream_interactor;
		_tmp63_ = conversation;
		_tmp64_ = message;
		_tmp65_ = dino_entities_message_get_from (_tmp64_);
		_tmp66_ = _tmp65_;
		_tmp67_ = dino_ui_util_get_participant_display_name (_tmp62_, _tmp63_, _tmp66_, FALSE);
		display_name = _tmp67_;
		_tmp68_ = display_name;
		_tmp69_ = g_strconcat (_tmp68_, " ", NULL);
		_tmp70_ = _tmp69_;
		_tmp71_ = markup_text;
		_tmp72_ = string_substring (_tmp71_, (glong) 4, (glong) -1);
		_tmp73_ = _tmp72_;
		_tmp74_ = g_strconcat (_tmp70_, _tmp73_, NULL);
		_g_free0 (markup_text);
		markup_text = _tmp74_;
		_g_free0 (_tmp73_);
		_g_free0 (_tmp70_);
		{
			GeeArrayList* _span_list = NULL;
			GeeArrayList* _tmp75_;
			gint _span_size = 0;
			GeeArrayList* _tmp76_;
			gint _tmp77_;
			gint _tmp78_;
			gint _span_index = 0;
			_tmp75_ = markups;
			_span_list = _tmp75_;
			_tmp76_ = _span_list;
			_tmp77_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp76_);
			_tmp78_ = _tmp77_;
			_span_size = _tmp78_;
			_span_index = -1;
			while (TRUE) {
				gint _tmp79_;
				gint _tmp80_;
				XmppXepMessageMarkupSpan* span = NULL;
				GeeArrayList* _tmp81_;
				gpointer _tmp82_;
				gint length = 0;
				const gchar* _tmp83_;
				XmppXepMessageMarkupSpan* _tmp84_;
				XmppXepMessageMarkupSpan* _tmp85_;
				gint _tmp86_;
				gint _tmp87_;
				XmppXepMessageMarkupSpan* _tmp88_;
				XmppXepMessageMarkupSpan* _tmp89_;
				gint _tmp90_;
				gint _tmp91_;
				_span_index = _span_index + 1;
				_tmp79_ = _span_index;
				_tmp80_ = _span_size;
				if (!(_tmp79_ < _tmp80_)) {
					break;
				}
				_tmp81_ = _span_list;
				_tmp82_ = gee_abstract_list_get ((GeeAbstractList*) _tmp81_, _span_index);
				span = (XmppXepMessageMarkupSpan*) _tmp82_;
				_tmp83_ = display_name;
				length = (g_utf8_strlen (_tmp83_, (gssize) -1) - 4) + 1;
				_tmp84_ = span;
				_tmp85_ = span;
				_tmp86_ = xmpp_xep_message_markup_span_get_start_char (_tmp85_);
				_tmp87_ = _tmp86_;
				xmpp_xep_message_markup_span_set_start_char (_tmp85_, _tmp87_ + length);
				_tmp88_ = span;
				_tmp89_ = span;
				_tmp90_ = xmpp_xep_message_markup_span_get_end_char (_tmp89_);
				_tmp91_ = _tmp90_;
				xmpp_xep_message_markup_span_set_end_char (_tmp89_, _tmp91_ + length);
				_g_object_unref0 (span);
			}
		}
		_tmp92_ = bold_attr;
		_tmp93_ = display_name;
		_tmp94_ = strlen (_tmp93_);
		_tmp95_ = _tmp94_;
		_tmp92_->end_index = (guint) _tmp95_;
		_tmp96_ = italic_attr;
		_tmp97_ = display_name;
		_tmp98_ = strlen (_tmp97_);
		_tmp99_ = _tmp98_;
		_tmp96_->end_index = (guint) _tmp99_;
		_tmp100_ = attrs;
		_tmp101_ = bold_attr;
		_tmp102_ = pango_attribute_copy (_tmp101_);
		pango_attr_list_insert (_tmp100_, _tmp102_);
		_tmp103_ = attrs;
		_tmp104_ = italic_attr;
		_tmp105_ = pango_attribute_copy (_tmp104_);
		pango_attr_list_insert (_tmp103_, _tmp105_);
		_g_free0 (display_name);
	}
	{
		GeeArrayList* _markup_list = NULL;
		GeeArrayList* _tmp106_;
		gint _markup_size = 0;
		GeeArrayList* _tmp107_;
		gint _tmp108_;
		gint _tmp109_;
		gint _markup_index = 0;
		_tmp106_ = markups;
		_markup_list = _tmp106_;
		_tmp107_ = _markup_list;
		_tmp108_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp107_);
		_tmp109_ = _tmp108_;
		_markup_size = _tmp109_;
		_markup_index = -1;
		while (TRUE) {
			gint _tmp110_;
			gint _tmp111_;
			XmppXepMessageMarkupSpan* markup = NULL;
			GeeArrayList* _tmp112_;
			gpointer _tmp113_;
			_markup_index = _markup_index + 1;
			_tmp110_ = _markup_index;
			_tmp111_ = _markup_size;
			if (!(_tmp110_ < _tmp111_)) {
				break;
			}
			_tmp112_ = _markup_list;
			_tmp113_ = gee_abstract_list_get ((GeeAbstractList*) _tmp112_, _markup_index);
			markup = (XmppXepMessageMarkupSpan*) _tmp113_;
			{
				GeeList* _ty_list = NULL;
				XmppXepMessageMarkupSpan* _tmp114_;
				GeeList* _tmp115_;
				GeeList* _tmp116_;
				gint _ty_size = 0;
				GeeList* _tmp117_;
				gint _tmp118_;
				gint _tmp119_;
				gint _ty_index = 0;
				_tmp114_ = markup;
				_tmp115_ = xmpp_xep_message_markup_span_get_types (_tmp114_);
				_tmp116_ = _tmp115_;
				_ty_list = _tmp116_;
				_tmp117_ = _ty_list;
				_tmp118_ = gee_collection_get_size ((GeeCollection*) _tmp117_);
				_tmp119_ = _tmp118_;
				_ty_size = _tmp119_;
				_ty_index = -1;
				while (TRUE) {
					gint _tmp120_;
					gint _tmp121_;
					XmppXepMessageMarkupSpanType ty = 0;
					GeeList* _tmp122_;
					gpointer _tmp123_;
					PangoAttribute* attr = NULL;
					PangoAttribute* _tmp127_;
					const gchar* _tmp128_;
					XmppXepMessageMarkupSpan* _tmp129_;
					gint _tmp130_;
					gint _tmp131_;
					PangoAttribute* _tmp132_;
					const gchar* _tmp133_;
					XmppXepMessageMarkupSpan* _tmp134_;
					gint _tmp135_;
					gint _tmp136_;
					PangoAttrList* _tmp137_;
					PangoAttribute* _tmp138_;
					PangoAttribute* _tmp139_;
					_ty_index = _ty_index + 1;
					_tmp120_ = _ty_index;
					_tmp121_ = _ty_size;
					if (!(_tmp120_ < _tmp121_)) {
						break;
					}
					_tmp122_ = _ty_list;
					_tmp123_ = gee_list_get (_tmp122_, _ty_index);
					ty = (XmppXepMessageMarkupSpanType) ((gintptr) _tmp123_);
					attr = NULL;
					switch (ty) {
						case XMPP_XEP_MESSAGE_MARKUP_SPAN_TYPE_EMPHASIS:
						{
							PangoAttribute* _tmp124_;
							_tmp124_ = pango_attr_style_new (PANGO_STYLE_ITALIC);
							_pango_attribute_destroy0 (attr);
							attr = _tmp124_;
							break;
						}
						case XMPP_XEP_MESSAGE_MARKUP_SPAN_TYPE_STRONG_EMPHASIS:
						{
							PangoAttribute* _tmp125_;
							_tmp125_ = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
							_pango_attribute_destroy0 (attr);
							attr = _tmp125_;
							break;
						}
						case XMPP_XEP_MESSAGE_MARKUP_SPAN_TYPE_DELETED:
						{
							PangoAttribute* _tmp126_;
							_tmp126_ = pango_attr_strikethrough_new (TRUE);
							_pango_attribute_destroy0 (attr);
							attr = _tmp126_;
							break;
						}
						default:
						break;
					}
					_tmp127_ = attr;
					_tmp128_ = markup_text;
					_tmp129_ = markup;
					_tmp130_ = xmpp_xep_message_markup_span_get_start_char (_tmp129_);
					_tmp131_ = _tmp130_;
					_tmp127_->start_index = (guint) string_index_of_nth_char (_tmp128_, (glong) _tmp131_);
					_tmp132_ = attr;
					_tmp133_ = markup_text;
					_tmp134_ = markup;
					_tmp135_ = xmpp_xep_message_markup_span_get_end_char (_tmp134_);
					_tmp136_ = _tmp135_;
					_tmp132_->end_index = (guint) string_index_of_nth_char (_tmp133_, (glong) _tmp136_);
					_tmp137_ = attrs;
					_tmp138_ = attr;
					_tmp139_ = pango_attribute_copy (_tmp138_);
					pango_attr_list_insert (_tmp137_, _tmp139_);
					_pango_attribute_destroy0 (attr);
				}
			}
			_g_object_unref0 (markup);
		}
	}
	_tmp140_ = markup_text;
	markup_text = NULL;
	_tmp141_ = dino_ui_util_unbreak_space_around_non_spacing_mark (_tmp140_);
	_g_free0 (markup_text);
	markup_text = _tmp141_;
	_tmp142_ = conversation;
	_tmp143_ = dino_entities_conversation_get_type_ (_tmp142_);
	_tmp144_ = _tmp143_;
	if (_tmp144_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		const gchar* _tmp145_;
		DinoEntitiesConversation* _tmp146_;
		const gchar* _tmp147_;
		const gchar* _tmp148_;
		GtkLabel* _tmp149_;
		gchar* _tmp150_;
		_tmp145_ = markup_text;
		_tmp146_ = conversation;
		_tmp147_ = dino_entities_conversation_get_nickname (_tmp146_);
		_tmp148_ = _tmp147_;
		_tmp149_ = self->label;
		_tmp150_ = dino_ui_util_parse_add_markup_theme (_tmp145_, _tmp148_, TRUE, TRUE, TRUE, dino_ui_util_is_dark_theme ((GtkWidget*) _tmp149_), &theme_dependent, FALSE);
		_g_free0 (markup_text);
		markup_text = _tmp150_;
	} else {
		const gchar* _tmp151_;
		GtkLabel* _tmp152_;
		gchar* _tmp153_;
		_tmp151_ = markup_text;
		_tmp152_ = self->label;
		_tmp153_ = dino_ui_util_parse_add_markup_theme (_tmp151_, NULL, TRUE, TRUE, TRUE, dino_ui_util_is_dark_theme ((GtkWidget*) _tmp152_), &theme_dependent, FALSE);
		_g_free0 (markup_text);
		markup_text = _tmp153_;
	}
	_tmp154_ = markup_text;
	only_emoji_count = dino_ui_util_get_only_emoji_count (_tmp154_);
	if (only_emoji_count != -1) {
		const gchar* _tmp155_ = NULL;
		gchar* size_str = NULL;
		gchar* _tmp156_;
		const gchar* _tmp157_;
		const gchar* _tmp158_;
		gchar* _tmp159_;
		gchar* _tmp160_;
		const gchar* _tmp161_;
		gchar* _tmp162_;
		gchar* _tmp163_;
		gchar* _tmp164_;
		if (only_emoji_count < 5) {
			_tmp155_ = "xx-large";
		} else {
			_tmp155_ = "large";
		}
		_tmp156_ = g_strdup (_tmp155_);
		size_str = _tmp156_;
		_tmp157_ = size_str;
		_tmp158_ = string_to_string (_tmp157_);
		_tmp159_ = g_strconcat ("<span size=\'", _tmp158_, "\'>", NULL);
		_tmp160_ = _tmp159_;
		_tmp161_ = markup_text;
		_tmp162_ = g_strconcat (_tmp160_, _tmp161_, NULL);
		_tmp163_ = _tmp162_;
		_tmp164_ = g_strconcat (_tmp163_, "</span>", NULL);
		_g_free0 (markup_text);
		markup_text = _tmp164_;
		_g_free0 (_tmp163_);
		_g_free0 (_tmp160_);
		_g_free0 (size_str);
	}
	_tmp166_ = self->label;
	if (dino_ui_util_is_dark_theme ((GtkWidget*) _tmp166_)) {
		_tmp165_ = "#BDBDBD";
	} else {
		_tmp165_ = "#707070";
	}
	_tmp167_ = g_strdup (_tmp165_);
	dim_color = _tmp167_;
	_tmp168_ = message;
	_tmp169_ = _tmp168_->edit_to;
	if (_tmp169_ != NULL) {
		const gchar* _tmp170_;
		const gchar* _tmp171_;
		const gchar* _tmp172_;
		gchar* _tmp173_;
		gchar* _tmp174_;
		const gchar* _tmp175_;
		gchar* _tmp176_;
		gchar* _tmp177_;
		gchar* _tmp178_;
		_tmp170_ = markup_text;
		_tmp171_ = dim_color;
		_tmp172_ = string_to_string (_tmp171_);
		_tmp173_ = g_strconcat ("  <span size='small' color='", _tmp172_, "'>(%s)</span>", NULL);
		_tmp174_ = _tmp173_;
		_tmp175_ = dino_gettext ("edited");
		_tmp176_ = g_strdup_printf (_tmp174_, _tmp175_);
		_tmp177_ = _tmp176_;
		_tmp178_ = g_strconcat (_tmp170_, _tmp177_, NULL);
		_g_free0 (markup_text);
		markup_text = _tmp178_;
		_g_free0 (_tmp177_);
		_g_free0 (_tmp174_);
		theme_dependent = TRUE;
	}
	self->priv->additional_info = DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_NONE;
	_tmp180_ = message;
	_tmp181_ = dino_entities_message_get_direction (_tmp180_);
	_tmp182_ = _tmp181_;
	if (_tmp182_ == DINO_ENTITIES_MESSAGE_DIRECTION_SENT) {
		gboolean _tmp183_ = FALSE;
		DinoEntitiesMessage* _tmp184_;
		DinoEntitiesMessageMarked _tmp185_;
		DinoEntitiesMessageMarked _tmp186_;
		_tmp184_ = message;
		_tmp185_ = dino_entities_message_get_marked (_tmp184_);
		_tmp186_ = _tmp185_;
		if (_tmp186_ == DINO_ENTITIES_MESSAGE_MARKED_SENDING) {
			_tmp183_ = TRUE;
		} else {
			DinoEntitiesMessage* _tmp187_;
			DinoEntitiesMessageMarked _tmp188_;
			DinoEntitiesMessageMarked _tmp189_;
			_tmp187_ = message;
			_tmp188_ = dino_entities_message_get_marked (_tmp187_);
			_tmp189_ = _tmp188_;
			_tmp183_ = _tmp189_ == DINO_ENTITIES_MESSAGE_MARKED_UNSENT;
		}
		_tmp179_ = _tmp183_;
	} else {
		_tmp179_ = FALSE;
	}
	if (_tmp179_) {
		DinoEntitiesMessage* _tmp190_;
		GDateTime* _tmp191_;
		GDateTime* _tmp192_;
		GDateTime* _tmp193_;
		GDateTime* _tmp194_;
		GDateTime* _tmp195_;
		GDateTime* _tmp196_;
		gboolean _tmp197_;
		_tmp190_ = message;
		_tmp191_ = dino_entities_message_get_time (_tmp190_);
		_tmp192_ = _tmp191_;
		_tmp193_ = g_date_time_new_now_utc ();
		_tmp194_ = _tmp193_;
		_tmp195_ = g_date_time_add_seconds (_tmp194_, (gdouble) -10);
		_tmp196_ = _tmp195_;
		_tmp197_ = g_date_time_compare (_tmp192_, _tmp196_) < 0;
		_g_date_time_unref0 (_tmp196_);
		_g_date_time_unref0 (_tmp194_);
		if (_tmp197_) {
			const gchar* _tmp198_;
			const gchar* _tmp199_;
			const gchar* _tmp200_;
			gchar* _tmp201_;
			gchar* _tmp202_;
			const gchar* _tmp203_;
			gchar* _tmp204_;
			gchar* _tmp205_;
			gchar* _tmp206_;
			_tmp198_ = markup_text;
			_tmp199_ = dim_color;
			_tmp200_ = string_to_string (_tmp199_);
			_tmp201_ = g_strconcat ("  <span size='small' color='", _tmp200_, "'>%s</span>", NULL);
			_tmp202_ = _tmp201_;
			_tmp203_ = dino_gettext ("pending…");
			_tmp204_ = g_strdup_printf (_tmp202_, _tmp203_);
			_tmp205_ = _tmp204_;
			_tmp206_ = g_strconcat (_tmp198_, _tmp205_, NULL);
			_g_free0 (markup_text);
			markup_text = _tmp206_;
			_g_free0 (_tmp205_);
			_g_free0 (_tmp202_);
			theme_dependent = TRUE;
			self->priv->additional_info = DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_PENDING;
		} else {
			gint time_diff = 0;
			DinoEntitiesMessage* _tmp207_;
			GDateTime* _tmp208_;
			GDateTime* _tmp209_;
			GDateTime* _tmp210_;
			GDateTime* _tmp211_;
			gint _tmp212_;
			_tmp207_ = message;
			_tmp208_ = dino_entities_message_get_time (_tmp207_);
			_tmp209_ = _tmp208_;
			_tmp210_ = g_date_time_new_now_utc ();
			_tmp211_ = _tmp210_;
			_tmp212_ = (-((gint) g_date_time_difference (_tmp209_, _tmp211_))) / 1000;
			_g_date_time_unref0 (_tmp211_);
			time_diff = _tmp212_;
			if (self->priv->pending_timeout_id != ((guint) -1)) {
				g_source_remove (self->priv->pending_timeout_id);
			}
			self->priv->pending_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) (10000 - time_diff), _____lambda28__gsource_func, g_object_ref (self), g_object_unref);
		}
	} else {
		gboolean _tmp213_ = FALSE;
		DinoEntitiesMessage* _tmp214_;
		gboolean _tmp215_;
		gboolean _tmp216_;
		_tmp214_ = message;
		_tmp215_ = dino_entities_message_get_direction (_tmp214_);
		_tmp216_ = _tmp215_;
		if (_tmp216_ == DINO_ENTITIES_MESSAGE_DIRECTION_SENT) {
			DinoEntitiesMessage* _tmp217_;
			DinoEntitiesMessageMarked _tmp218_;
			DinoEntitiesMessageMarked _tmp219_;
			_tmp217_ = message;
			_tmp218_ = dino_entities_message_get_marked (_tmp217_);
			_tmp219_ = _tmp218_;
			_tmp213_ = _tmp219_ == DINO_ENTITIES_MESSAGE_MARKED_ERROR;
		} else {
			_tmp213_ = FALSE;
		}
		if (_tmp213_) {
			gchar* error_color = NULL;
			GdkRGBA _tmp220_ = {0};
			gchar* _tmp221_;
			const gchar* _tmp222_;
			const gchar* _tmp223_;
			const gchar* _tmp224_;
			gchar* _tmp225_;
			gchar* _tmp226_;
			gchar* _tmp227_;
			dino_ui_util_get_label_pango_color (label, "@error_color", &_tmp220_);
			_tmp221_ = dino_ui_util_rgba_to_hex (&_tmp220_);
			error_color = _tmp221_;
			_tmp222_ = markup_text;
			_tmp223_ = error_color;
			_tmp224_ = dino_gettext ("delivery failed");
			_tmp225_ = g_strdup_printf ("  <span size='small' color='%s'>%s</span>", _tmp223_, _tmp224_);
			_tmp226_ = _tmp225_;
			_tmp227_ = g_strconcat (_tmp222_, _tmp226_, NULL);
			_g_free0 (markup_text);
			markup_text = _tmp227_;
			_g_free0 (_tmp226_);
			theme_dependent = TRUE;
			self->priv->additional_info = DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_DELIVERY_FAILED;
			_g_free0 (error_color);
		}
	}
	if (theme_dependent) {
		_tmp228_ = self->priv->realize_id == ((gulong) -1);
	} else {
		_tmp228_ = FALSE;
	}
	if (_tmp228_) {
		gulong _tmp229_;
		_tmp229_ = g_signal_connect_object ((GtkWidget*) label, "realize", (GCallback) _dino_ui_conversation_summary_message_meta_item_update_label_gtk_widget_realize, self, 0);
		self->priv->realize_id = _tmp229_;
	} else {
		gboolean _tmp230_ = FALSE;
		if (!theme_dependent) {
			_tmp230_ = self->priv->realize_id != ((gulong) -1);
		} else {
			_tmp230_ = FALSE;
		}
		if (_tmp230_) {
			g_signal_handler_disconnect ((GObject*) label, self->priv->realize_id);
		}
	}
	_tmp231_ = markup_text;
	gtk_label_set_label (label, _tmp231_);
	_g_free0 (dim_color);
	_pango_attribute_destroy0 (strikethrough_attr);
	_pango_attribute_destroy0 (italic_attr);
	_pango_attribute_destroy0 (bold_attr);
	_pango_attr_list_unref0 (attrs);
	_g_free0 (markup_text);
	_g_object_unref0 (markups);
	_g_object_unref0 (message);
	_g_object_unref0 (conversation);
	_g_object_unref0 (message_item);
}

void
dino_ui_conversation_summary_message_meta_item_update_label (DinoUiConversationSummaryMessageMetaItem* self)
{
	DinoContentItem* _tmp0_;
	GtkLabel* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((DinoUiConversationSummaryContentMetaItem*) self)->content_item;
	_tmp1_ = self->label;
	dino_ui_conversation_summary_message_meta_item_generate_markup_text (self, _tmp0_, _tmp1_);
}

static void
_dino_ui_conversation_summary_message_meta_item_on_in_edit_mode_changed_g_object_notify (GObject* _sender,
                                                                                         GParamSpec* pspec,
                                                                                         gpointer self)
{
	dino_ui_conversation_summary_message_meta_item_on_in_edit_mode_changed ((DinoUiConversationSummaryMessageMetaItem*) self);
}

static Block37Data*
block37_data_ref (Block37Data* _data37_)
{
	g_atomic_int_inc (&_data37_->_ref_count_);
	return _data37_;
}

static void
block37_data_unref (void * _userdata_)
{
	Block37Data* _data37_;
	_data37_ = (Block37Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data37_->_ref_count_)) {
		DinoUiConversationSummaryMessageMetaItem* self;
		self = _data37_->self;
		_g_object_unref0 (_data37_->quoted_content_item);
		_g_object_unref0 (self);
		g_slice_free (Block37Data, _data37_);
	}
}

static void
____lambda32_ (Block37Data* _data37_)
{
	DinoUiConversationSummaryMessageMetaItem* self;
	GApplication* _tmp0_;
	DinoMessageItem* _tmp1_;
	DinoEntitiesConversation* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	GVariant* _tmp5_;
	DinoContentItem* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	GVariant* _tmp9_;
	GVariant** _tmp10_;
	GVariant** _tmp11_;
	gint _tmp11__length1;
	GVariant* _tmp12_;
	GVariant* _tmp13_;
	self = _data37_->self;
	_tmp0_ = g_application_get_default ();
	_tmp1_ = self->priv->message_item;
	_tmp2_ = _tmp1_->conversation;
	_tmp3_ = dino_entities_conversation_get_id (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_variant_new_int32 ((gint32) _tmp4_);
	g_variant_ref_sink (_tmp5_);
	_tmp6_ = _data37_->quoted_content_item;
	_tmp7_ = dino_content_item_get_id (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_variant_new_int32 ((gint32) _tmp8_);
	g_variant_ref_sink (_tmp9_);
	_tmp10_ = g_new0 (GVariant*, 2 + 1);
	_tmp10_[0] = _tmp5_;
	_tmp10_[1] = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 2;
	_tmp12_ = g_variant_new_tuple (_tmp11_, 2);
	g_variant_ref_sink (_tmp12_);
	_tmp13_ = _tmp12_;
	g_action_group_activate_action ((GActionGroup*) _tmp0_, "jump-to-conversation-message", _tmp13_);
	_g_variant_unref0 (_tmp13_);
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) g_variant_unref), NULL);
}

static void
_____lambda32__dino_ui_quote_model_jump_to (DinoUiQuoteModel* _sender,
                                            gpointer self)
{
	____lambda32_ (self);
}

static GObject*
dino_ui_conversation_summary_message_meta_item_real_get_widget (DinoPluginsMetaConversationItem* base,
                                                                DinoPluginsConversationItemWidgetInterface* outer,
                                                                DinoPluginsWidgetType type)
{
	DinoUiConversationSummaryMessageMetaItem * self;
	DinoPluginsConversationItemWidgetInterface* _tmp0_;
	GtkLabel* _tmp1_;
	DinoMessageItem* _tmp2_;
	DinoEntitiesMessage* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GtkLabel* _tmp28_;
	GObject* _tmp29_;
	GObject* result;
	self = (DinoUiConversationSummaryMessageMetaItem*) base;
	g_return_val_if_fail (outer != NULL, NULL);
	_tmp0_ = _g_object_ref0 (outer);
	_g_object_unref0 (self->outer);
	self->outer = _tmp0_;
	g_signal_connect_object ((GObject*) self, "notify::in-edit-mode", (GCallback) _dino_ui_conversation_summary_message_meta_item_on_in_edit_mode_changed_g_object_notify, self, 0);
	_tmp1_ = self->label;
	dino_plugins_conversation_item_widget_interface_set_widget (outer, (GObject*) _tmp1_, DINO_PLUGINS_WIDGET_TYPE_GTK4, 2);
	_tmp2_ = self->priv->message_item;
	_tmp3_ = _tmp2_->message;
	_tmp4_ = dino_entities_message_get_quoted_item_id (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ > 0) {
		Block37Data* _data37_;
		DinoStreamInteractor* _tmp6_;
		DinoModuleIdentity* _tmp7_;
		gpointer _tmp8_;
		DinoContentItemStore* _tmp9_;
		DinoMessageItem* _tmp10_;
		DinoEntitiesConversation* _tmp11_;
		DinoMessageItem* _tmp12_;
		DinoEntitiesMessage* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		DinoContentItem* _tmp16_;
		DinoContentItem* _tmp17_;
		DinoContentItem* _tmp18_;
		_data37_ = g_slice_new0 (Block37Data);
		_data37_->_ref_count_ = 1;
		_data37_->self = g_object_ref (self);
		_tmp6_ = self->priv->stream_interactor;
		_tmp7_ = dino_content_item_store_IDENTITY;
		_tmp8_ = dino_stream_interactor_get_module (_tmp6_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp7_);
		_tmp9_ = (DinoContentItemStore*) _tmp8_;
		_tmp10_ = self->priv->message_item;
		_tmp11_ = _tmp10_->conversation;
		_tmp12_ = self->priv->message_item;
		_tmp13_ = _tmp12_->message;
		_tmp14_ = dino_entities_message_get_quoted_item_id (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = dino_content_item_store_get_item_by_id (_tmp9_, _tmp11_, _tmp15_);
		_tmp17_ = _tmp16_;
		_g_object_unref0 (_tmp9_);
		_data37_->quoted_content_item = _tmp17_;
		_tmp18_ = _data37_->quoted_content_item;
		if (_tmp18_ != NULL) {
			DinoUiQuoteModel* quote_model = NULL;
			DinoContentItem* _tmp19_;
			DinoMessageItem* _tmp20_;
			DinoEntitiesConversation* _tmp21_;
			DinoStreamInteractor* _tmp22_;
			DinoUiQuoteModel* _tmp23_;
			DinoUiQuoteModel* _tmp24_;
			GtkWidget* quote_widget = NULL;
			DinoUiQuoteModel* _tmp25_;
			GtkWidget* _tmp26_;
			GtkWidget* _tmp27_;
			_tmp19_ = _data37_->quoted_content_item;
			_tmp20_ = self->priv->message_item;
			_tmp21_ = _tmp20_->conversation;
			_tmp22_ = self->priv->stream_interactor;
			_tmp23_ = dino_ui_quote_model_new_from_content_item (_tmp19_, _tmp21_, _tmp22_);
			quote_model = _tmp23_;
			_tmp24_ = quote_model;
			g_signal_connect_data (_tmp24_, "jump-to", (GCallback) _____lambda32__dino_ui_quote_model_jump_to, block37_data_ref (_data37_), (GClosureNotify) block37_data_unref, 0);
			_tmp25_ = quote_model;
			_tmp26_ = dino_ui_quote_get_widget (_tmp25_);
			quote_widget = _tmp26_;
			_tmp27_ = quote_widget;
			dino_plugins_conversation_item_widget_interface_set_widget (outer, (GObject*) _tmp27_, DINO_PLUGINS_WIDGET_TYPE_GTK4, 1);
			_g_object_unref0 (quote_widget);
			_g_object_unref0 (quote_model);
		}
		block37_data_unref (_data37_);
		_data37_ = NULL;
	}
	_tmp28_ = self->label;
	_tmp29_ = _g_object_ref0 ((GObject*) _tmp28_);
	result = _tmp29_;
	return result;
}

static void
___lambda35_ (DinoUiConversationSummaryMessageMetaItem* self)
{
	dino_plugins_meta_conversation_item_set_in_edit_mode ((DinoPluginsMetaConversationItem*) self, TRUE);
}

static void
____lambda35__dino_plugins_message_action_evoked (GVariant* variant,
                                                  gpointer self)
{
	___lambda35_ ((DinoUiConversationSummaryMessageMetaItem*) self);
}

static GeeList*
dino_ui_conversation_summary_message_meta_item_real_get_item_actions (DinoPluginsMetaConversationItem* base,
                                                                      DinoPluginsWidgetType type)
{
	DinoUiConversationSummaryMessageMetaItem * self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GeeList* actions = NULL;
	GeeArrayList* _tmp2_;
	gboolean correction_allowed = FALSE;
	DinoStreamInteractor* _tmp3_;
	DinoModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	DinoMessageCorrection* _tmp6_;
	DinoMessageItem* _tmp7_;
	DinoEntitiesConversation* _tmp8_;
	DinoMessageItem* _tmp9_;
	DinoEntitiesMessage* _tmp10_;
	gboolean _tmp11_;
	GeeList* _tmp23_;
	DinoContentItem* _tmp24_;
	DinoMessageItem* _tmp25_;
	DinoEntitiesConversation* _tmp26_;
	DinoStreamInteractor* _tmp27_;
	DinoPluginsMessageAction* _tmp28_;
	DinoPluginsMessageAction* _tmp29_;
	GeeList* _tmp30_;
	DinoContentItem* _tmp31_;
	DinoMessageItem* _tmp32_;
	DinoEntitiesConversation* _tmp33_;
	DinoStreamInteractor* _tmp34_;
	DinoPluginsMessageAction* _tmp35_;
	DinoPluginsMessageAction* _tmp36_;
	GeeList* result;
	self = (DinoUiConversationSummaryMessageMetaItem*) base;
	_tmp0_ = dino_plugins_meta_conversation_item_get_in_edit_mode ((DinoPluginsMetaConversationItem*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		result = NULL;
		return result;
	}
	_tmp2_ = gee_array_list_new (DINO_PLUGINS_TYPE_MESSAGE_ACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	actions = (GeeList*) _tmp2_;
	_tmp3_ = self->priv->stream_interactor;
	_tmp4_ = dino_message_correction_IDENTITY;
	_tmp5_ = dino_stream_interactor_get_module (_tmp3_, DINO_TYPE_MESSAGE_CORRECTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
	_tmp6_ = (DinoMessageCorrection*) _tmp5_;
	_tmp7_ = self->priv->message_item;
	_tmp8_ = _tmp7_->conversation;
	_tmp9_ = self->priv->message_item;
	_tmp10_ = _tmp9_->message;
	_tmp11_ = dino_message_correction_is_own_correction_allowed (_tmp6_, _tmp8_, _tmp10_);
	_g_object_unref0 (_tmp6_);
	correction_allowed = _tmp11_;
	if (correction_allowed) {
		DinoPluginsMessageAction* action1 = NULL;
		DinoPluginsMessageAction* _tmp12_;
		DinoPluginsMessageAction* _tmp13_;
		gchar* _tmp14_;
		DinoPluginsMessageAction* _tmp15_;
		gchar* _tmp16_;
		DinoPluginsMessageAction* _tmp17_;
		const gchar* _tmp18_;
		gchar* _tmp19_;
		DinoPluginsMessageAction* _tmp20_;
		GeeList* _tmp21_;
		DinoPluginsMessageAction* _tmp22_;
		_tmp12_ = dino_plugins_message_action_new ();
		action1 = _tmp12_;
		_tmp13_ = action1;
		_tmp14_ = g_strdup ("correction");
		_g_free0 (_tmp13_->name);
		_tmp13_->name = _tmp14_;
		_tmp15_ = action1;
		_tmp16_ = g_strdup ("document-edit-symbolic");
		_g_free0 (_tmp15_->icon_name);
		_tmp15_->icon_name = _tmp16_;
		_tmp17_ = action1;
		_tmp18_ = dino_gettext ("Edit message");
		_tmp19_ = g_strdup (_tmp18_);
		_g_free0 (_tmp17_->tooltip);
		_tmp17_->tooltip = _tmp19_;
		_tmp20_ = action1;
		(_tmp20_->callback_target_destroy_notify == NULL) ? NULL : (_tmp20_->callback_target_destroy_notify (_tmp20_->callback_target), NULL);
		_tmp20_->callback = NULL;
		_tmp20_->callback_target = NULL;
		_tmp20_->callback_target_destroy_notify = NULL;
		_tmp20_->callback = ____lambda35__dino_plugins_message_action_evoked;
		_tmp20_->callback_target = g_object_ref (self);
		_tmp20_->callback_target_destroy_notify = g_object_unref;
		_tmp21_ = actions;
		_tmp22_ = action1;
		gee_collection_add ((GeeCollection*) _tmp21_, _tmp22_);
		_g_object_unref0 (action1);
	}
	_tmp23_ = actions;
	_tmp24_ = ((DinoUiConversationSummaryContentMetaItem*) self)->content_item;
	_tmp25_ = self->priv->message_item;
	_tmp26_ = _tmp25_->conversation;
	_tmp27_ = self->priv->stream_interactor;
	_tmp28_ = dino_ui_get_reply_action (_tmp24_, _tmp26_, _tmp27_);
	_tmp29_ = _tmp28_;
	gee_collection_add ((GeeCollection*) _tmp23_, _tmp29_);
	_g_object_unref0 (_tmp29_);
	_tmp30_ = actions;
	_tmp31_ = ((DinoUiConversationSummaryContentMetaItem*) self)->content_item;
	_tmp32_ = self->priv->message_item;
	_tmp33_ = _tmp32_->conversation;
	_tmp34_ = self->priv->stream_interactor;
	_tmp35_ = dino_ui_get_reaction_action (_tmp31_, _tmp33_, _tmp34_);
	_tmp36_ = _tmp35_;
	gee_collection_add ((GeeCollection*) _tmp30_, _tmp36_);
	_g_object_unref0 (_tmp36_);
	result = actions;
	return result;
}

static Block38Data*
block38_data_ref (Block38Data* _data38_)
{
	g_atomic_int_inc (&_data38_->_ref_count_);
	return _data38_;
}

static void
block38_data_unref (void * _userdata_)
{
	Block38Data* _data38_;
	_data38_ = (Block38Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data38_->_ref_count_)) {
		DinoUiConversationSummaryMessageMetaItem* self;
		self = _data38_->self;
		_g_object_unref0 (_data38_->message_item);
		_g_object_unref0 (self);
		g_slice_free (Block38Data, _data38_);
	}
}

static void
___lambda30_ (DinoUiConversationSummaryMessageMetaItem* self)
{
	DinoPluginsConversationItemWidgetInterface* _tmp0_;
	GtkLabel* _tmp1_;
	dino_plugins_meta_conversation_item_set_in_edit_mode ((DinoPluginsMetaConversationItem*) self, FALSE);
	_tmp0_ = self->outer;
	_tmp1_ = self->label;
	dino_plugins_conversation_item_widget_interface_set_widget (_tmp0_, (GObject*) _tmp1_, DINO_PLUGINS_WIDGET_TYPE_GTK4, 2);
}

static void
____lambda30__dino_ui_conversation_summary_message_item_edit_mode_cancelled (DinoUiConversationSummaryMessageItemEditMode* _sender,
                                                                             gpointer self)
{
	___lambda30_ ((DinoUiConversationSummaryMessageMetaItem*) self);
}

static void
___lambda31_ (Block38Data* _data38_)
{
	DinoUiConversationSummaryMessageMetaItem* self;
	gchar* text = NULL;
	DinoUiConversationSummaryMessageItemEditMode* _tmp0_;
	DinoUiChatTextView* _tmp1_;
	GtkTextView* _tmp2_;
	GtkTextBuffer* _tmp3_;
	GtkTextBuffer* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GeeList* markups = NULL;
	DinoUiConversationSummaryMessageItemEditMode* _tmp7_;
	DinoUiChatTextView* _tmp8_;
	GeeList* _tmp9_;
	DinoMessageItem* _tmp10_;
	DinoEntitiesConversation* _tmp11_;
	DinoMessageItem* _tmp12_;
	DinoEntitiesMessage* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	DinoMessageItem* _tmp16_;
	DinoEntitiesMessage* _tmp17_;
	DinoPluginsConversationItemWidgetInterface* _tmp18_;
	GtkLabel* _tmp19_;
	self = _data38_->self;
	_tmp0_ = self->priv->edit_mode;
	_tmp1_ = _tmp0_->chat_text_view;
	_tmp2_ = _tmp1_->text_view;
	_tmp3_ = gtk_text_view_get_buffer (_tmp2_);
	_tmp4_ = _tmp3_;
	g_object_get (_tmp4_, "text", &_tmp5_, NULL);
	_tmp6_ = _tmp5_;
	text = _tmp6_;
	_tmp7_ = self->priv->edit_mode;
	_tmp8_ = _tmp7_->chat_text_view;
	_tmp9_ = dino_ui_chat_text_view_get_markups (_tmp8_);
	markups = _tmp9_;
	_tmp10_ = _data38_->message_item;
	_tmp11_ = _tmp10_->conversation;
	_tmp12_ = _data38_->message_item;
	_tmp13_ = _tmp12_->message;
	_tmp14_ = dino_entities_message_get_quoted_item_id (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _data38_->message_item;
	_tmp17_ = _tmp16_->message;
	dino_send_message (_tmp11_, text, _tmp15_, _tmp17_, markups);
	dino_plugins_meta_conversation_item_set_in_edit_mode ((DinoPluginsMetaConversationItem*) self, FALSE);
	_tmp18_ = self->outer;
	_tmp19_ = self->label;
	dino_plugins_conversation_item_widget_interface_set_widget (_tmp18_, (GObject*) _tmp19_, DINO_PLUGINS_WIDGET_TYPE_GTK4, 2);
	_g_object_unref0 (markups);
	_g_free0 (text);
}

static void
____lambda31__dino_ui_conversation_summary_message_item_edit_mode_send (DinoUiConversationSummaryMessageItemEditMode* _sender,
                                                                        gpointer self)
{
	___lambda31_ (self);
}

static void
dino_ui_conversation_summary_message_meta_item_on_in_edit_mode_changed (DinoUiConversationSummaryMessageMetaItem* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean allowed = FALSE;
	DinoStreamInteractor* _tmp2_;
	DinoModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	DinoMessageCorrection* _tmp5_;
	DinoMessageItem* _tmp6_;
	DinoEntitiesConversation* _tmp7_;
	DinoMessageItem* _tmp8_;
	DinoEntitiesMessage* _tmp9_;
	gboolean _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dino_plugins_meta_conversation_item_get_in_edit_mode ((DinoPluginsMetaConversationItem*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == FALSE) {
		return;
	}
	_tmp2_ = self->priv->stream_interactor;
	_tmp3_ = dino_message_correction_IDENTITY;
	_tmp4_ = dino_stream_interactor_get_module (_tmp2_, DINO_TYPE_MESSAGE_CORRECTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
	_tmp5_ = (DinoMessageCorrection*) _tmp4_;
	_tmp6_ = self->priv->message_item;
	_tmp7_ = _tmp6_->conversation;
	_tmp8_ = self->priv->message_item;
	_tmp9_ = _tmp8_->message;
	_tmp10_ = dino_message_correction_is_own_correction_allowed (_tmp5_, _tmp7_, _tmp9_);
	_g_object_unref0 (_tmp5_);
	allowed = _tmp10_;
	if (allowed) {
		Block38Data* _data38_;
		DinoContentItem* _tmp11_;
		DinoMessageItem* _tmp12_;
		DinoEntitiesMessage* message = NULL;
		DinoMessageItem* _tmp13_;
		DinoEntitiesMessage* _tmp14_;
		DinoEntitiesMessage* _tmp15_;
		DinoUiConversationSummaryMessageItemEditMode* _tmp16_;
		DinoUiConversationSummaryMessageItemEditMode* _tmp17_;
		DinoUiChatTextView* _tmp18_;
		DinoStreamInteractor* _tmp19_;
		DinoUiChatTextViewController* _tmp20_;
		DinoEntitiesConversation* conversation = NULL;
		DinoMessageItem* _tmp21_;
		DinoEntitiesConversation* _tmp22_;
		DinoEntitiesConversation* _tmp23_;
		DinoUiChatTextViewController* _tmp24_;
		DinoEntitiesConversation* _tmp25_;
		DinoUiConversationSummaryMessageItemEditMode* _tmp26_;
		DinoUiConversationSummaryMessageItemEditMode* _tmp27_;
		DinoUiConversationSummaryMessageItemEditMode* _tmp28_;
		DinoUiChatTextView* _tmp29_;
		DinoEntitiesMessage* _tmp30_;
		DinoPluginsConversationItemWidgetInterface* _tmp31_;
		DinoUiConversationSummaryMessageItemEditMode* _tmp32_;
		DinoUiConversationSummaryMessageItemEditMode* _tmp33_;
		DinoUiChatTextView* _tmp34_;
		GtkTextView* _tmp35_;
		_data38_ = g_slice_new0 (Block38Data);
		_data38_->_ref_count_ = 1;
		_data38_->self = g_object_ref (self);
		_tmp11_ = ((DinoUiConversationSummaryContentMetaItem*) self)->content_item;
		_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, DINO_TYPE_MESSAGE_ITEM) ? ((DinoMessageItem*) _tmp11_) : NULL);
		_data38_->message_item = _tmp12_;
		_tmp13_ = _data38_->message_item;
		_tmp14_ = _tmp13_->message;
		_tmp15_ = _g_object_ref0 (_tmp14_);
		message = _tmp15_;
		_tmp16_ = dino_ui_conversation_summary_message_item_edit_mode_new ();
		g_object_ref_sink (_tmp16_);
		_g_object_unref0 (self->priv->edit_mode);
		self->priv->edit_mode = _tmp16_;
		_tmp17_ = self->priv->edit_mode;
		_tmp18_ = _tmp17_->chat_text_view;
		_tmp19_ = self->priv->stream_interactor;
		_tmp20_ = dino_ui_chat_text_view_controller_new (_tmp18_, _tmp19_);
		_g_object_unref0 (self->priv->controller);
		self->priv->controller = _tmp20_;
		_tmp21_ = _data38_->message_item;
		_tmp22_ = _tmp21_->conversation;
		_tmp23_ = _g_object_ref0 (_tmp22_);
		conversation = _tmp23_;
		_tmp24_ = self->priv->controller;
		_tmp25_ = conversation;
		dino_ui_chat_text_view_controller_initialize_for_conversation (_tmp24_, _tmp25_);
		_tmp26_ = self->priv->edit_mode;
		g_signal_connect_object (_tmp26_, "cancelled", (GCallback) ____lambda30__dino_ui_conversation_summary_message_item_edit_mode_cancelled, self, 0);
		_tmp27_ = self->priv->edit_mode;
		g_signal_connect_data (_tmp27_, "send", (GCallback) ____lambda31__dino_ui_conversation_summary_message_item_edit_mode_send, block38_data_ref (_data38_), (GClosureNotify) block38_data_unref, 0);
		_tmp28_ = self->priv->edit_mode;
		_tmp29_ = _tmp28_->chat_text_view;
		_tmp30_ = message;
		dino_ui_chat_text_view_set_text (_tmp29_, _tmp30_);
		_tmp31_ = self->outer;
		_tmp32_ = self->priv->edit_mode;
		dino_plugins_conversation_item_widget_interface_set_widget (_tmp31_, (GObject*) _tmp32_, DINO_PLUGINS_WIDGET_TYPE_GTK4, 2);
		_tmp33_ = self->priv->edit_mode;
		_tmp34_ = _tmp33_->chat_text_view;
		_tmp35_ = _tmp34_->text_view;
		gtk_widget_grab_focus ((GtkWidget*) _tmp35_);
		_g_object_unref0 (conversation);
		_g_object_unref0 (message);
		block38_data_unref (_data38_);
		_data38_ = NULL;
	} else {
		dino_plugins_meta_conversation_item_set_in_edit_mode ((DinoPluginsMetaConversationItem*) self, FALSE);
	}
}

static void
dino_ui_conversation_summary_message_meta_item_on_received_correction (DinoUiConversationSummaryMessageMetaItem* self,
                                                                       DinoContentItem* content_item)
{
	DinoContentItem* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content_item != NULL);
	_tmp0_ = ((DinoUiConversationSummaryContentMetaItem*) self)->content_item;
	_tmp1_ = dino_content_item_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = dino_content_item_get_id (content_item);
	_tmp4_ = _tmp3_;
	if (_tmp2_ == _tmp4_) {
		DinoContentItem* _tmp5_;
		DinoMessageItem* _tmp6_;
		_tmp5_ = _g_object_ref0 (content_item);
		_g_object_unref0 (((DinoUiConversationSummaryContentMetaItem*) self)->content_item);
		((DinoUiConversationSummaryContentMetaItem*) self)->content_item = _tmp5_;
		_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (content_item, DINO_TYPE_MESSAGE_ITEM) ? ((DinoMessageItem*) content_item) : NULL);
		_g_object_unref0 (self->priv->message_item);
		self->priv->message_item = _tmp6_;
		dino_ui_conversation_summary_message_meta_item_update_label (self);
	}
}

gboolean
dino_ui_conversation_summary_message_meta_item_on_label_activate_link (const gchar* uri)
{
	GFile* file = NULL;
	GFile* _tmp0_;
	DinoApplication* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	GFile** _tmp4_;
	GFile** _tmp5_;
	gint _tmp5__length1;
	gboolean result;
	g_return_val_if_fail (uri != NULL, FALSE);
	if (!g_str_has_prefix (uri, "xmpp:")) {
		result = FALSE;
		return result;
	}
	_tmp0_ = g_file_new_for_uri (uri);
	file = _tmp0_;
	_tmp1_ = dino_application_get_default ();
	_tmp2_ = file;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = g_new0 (GFile*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 1;
	g_application_open ((GApplication*) _tmp1_, _tmp5_, (gint) 1, "");
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_object_unref), NULL);
	result = TRUE;
	_g_object_unref0 (file);
	return result;
}

static void
dino_ui_conversation_summary_message_meta_item_real_dispose (GObject* base)
{
	DinoUiConversationSummaryMessageMetaItem * self;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoMessageCorrection* _tmp3_;
	guint _tmp4_;
	guint _tmp5_;
	GQuark _tmp6_;
	GtkLabel* _tmp8_;
	self = (DinoUiConversationSummaryMessageMetaItem*) base;
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_message_correction_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_MESSAGE_CORRECTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoMessageCorrection*) _tmp2_;
	g_signal_parse_name ("received-correction", DINO_TYPE_MESSAGE_CORRECTION, &_tmp4_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _dino_ui_conversation_summary_message_meta_item_on_received_correction_dino_message_correction_received_correction, self);
	_g_object_unref0 (_tmp3_);
	g_signal_parse_name ("notify::in-edit-mode", G_TYPE_OBJECT, &_tmp5_, &_tmp6_, TRUE);
	g_signal_handlers_disconnect_matched ((GObject*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, _tmp6_, NULL, (GCallback) _dino_ui_conversation_summary_message_meta_item_on_in_edit_mode_changed_g_object_notify, self);
	if (self->priv->marked_notify_handler_id != ((gulong) -1)) {
		g_signal_handler_disconnect ((GObject*) self, self->priv->marked_notify_handler_id);
	}
	if (self->priv->realize_id != ((gulong) -1)) {
		GtkLabel* _tmp7_;
		_tmp7_ = self->label;
		g_signal_handler_disconnect ((GObject*) _tmp7_, self->priv->realize_id);
	}
	if (self->priv->pending_timeout_id != ((guint) -1)) {
		g_source_remove (self->priv->pending_timeout_id);
	}
	_tmp8_ = self->label;
	if (_tmp8_ != NULL) {
		GtkLabel* _tmp9_;
		GtkLabel* _tmp10_;
		_tmp9_ = self->label;
		gtk_widget_unparent ((GtkWidget*) _tmp9_);
		_tmp10_ = self->label;
		g_object_run_dispose ((GObject*) _tmp10_);
		_g_object_unref0 (self->label);
		self->label = NULL;
	}
	G_OBJECT_CLASS (dino_ui_conversation_summary_message_meta_item_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, DinoUiConversationSummaryContentMetaItem));
}

DinoEntitiesMessageMarked
dino_ui_conversation_summary_message_meta_item_get_marked (DinoUiConversationSummaryMessageMetaItem* self)
{
	DinoEntitiesMessageMarked result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_marked;
	return result;
}

void
dino_ui_conversation_summary_message_meta_item_set_marked (DinoUiConversationSummaryMessageMetaItem* self,
                                                           DinoEntitiesMessageMarked value)
{
	DinoEntitiesMessageMarked old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_conversation_summary_message_meta_item_get_marked (self);
	if (old_value != value) {
		self->priv->_marked = value;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_conversation_summary_message_meta_item_properties[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_MARKED_PROPERTY]);
	}
}

static void
dino_ui_conversation_summary_message_meta_item_class_init (DinoUiConversationSummaryMessageMetaItemClass * klass,
                                                           gpointer klass_data)
{
	dino_ui_conversation_summary_message_meta_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiConversationSummaryMessageMetaItem_private_offset);
	((DinoPluginsMetaConversationItemClass *) klass)->get_widget = (GObject* (*) (DinoPluginsMetaConversationItem*, DinoPluginsConversationItemWidgetInterface*, DinoPluginsWidgetType)) dino_ui_conversation_summary_message_meta_item_real_get_widget;
	((DinoPluginsMetaConversationItemClass *) klass)->get_item_actions = (GeeList* (*) (DinoPluginsMetaConversationItem*, DinoPluginsWidgetType)) dino_ui_conversation_summary_message_meta_item_real_get_item_actions;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) dino_ui_conversation_summary_message_meta_item_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_conversation_summary_message_meta_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_conversation_summary_message_meta_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_conversation_summary_message_meta_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_MARKED_PROPERTY, dino_ui_conversation_summary_message_meta_item_properties[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_MARKED_PROPERTY] = g_param_spec_enum ("marked", "marked", "marked", DINO_ENTITIES_MESSAGE_TYPE_MARKED, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_conversation_summary_message_meta_item_instance_init (DinoUiConversationSummaryMessageMetaItem * self,
                                                              gpointer klass)
{
	GtkLabel* _tmp0_ = NULL;
	self->priv = dino_ui_conversation_summary_message_meta_item_get_instance_private (self);
	self->outer = NULL;
	self->priv->edit_mode = NULL;
	self->priv->controller = NULL;
	self->priv->additional_info = DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_ADDITIONAL_INFO_NONE;
	self->priv->realize_id = (gulong) -1;
	self->priv->marked_notify_handler_id = (gulong) -1;
	self->priv->pending_timeout_id = (guint) -1;
	_tmp0_ = (GtkLabel*) gtk_label_new ("");
	gtk_label_set_use_markup (_tmp0_, TRUE);
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	gtk_label_set_selectable (_tmp0_, TRUE);
	gtk_label_set_wrap (_tmp0_, TRUE);
	gtk_label_set_wrap_mode (_tmp0_, PANGO_WRAP_WORD_CHAR);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	self->label = _tmp0_;
}

static void
dino_ui_conversation_summary_message_meta_item_finalize (GObject * obj)
{
	DinoUiConversationSummaryMessageMetaItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM, DinoUiConversationSummaryMessageMetaItem);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->message_item);
	_g_object_unref0 (self->outer);
	_g_object_unref0 (self->priv->edit_mode);
	_g_object_unref0 (self->priv->controller);
	_g_object_unref0 (self->label);
	G_OBJECT_CLASS (dino_ui_conversation_summary_message_meta_item_parent_class)->finalize (obj);
}

static GType
dino_ui_conversation_summary_message_meta_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiConversationSummaryMessageMetaItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_conversation_summary_message_meta_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiConversationSummaryMessageMetaItem), 0, (GInstanceInitFunc) dino_ui_conversation_summary_message_meta_item_instance_init, NULL };
	GType dino_ui_conversation_summary_message_meta_item_type_id;
	dino_ui_conversation_summary_message_meta_item_type_id = g_type_register_static (DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, "DinoUiConversationSummaryMessageMetaItem", &g_define_type_info, 0);
	DinoUiConversationSummaryMessageMetaItem_private_offset = g_type_add_instance_private (dino_ui_conversation_summary_message_meta_item_type_id, sizeof (DinoUiConversationSummaryMessageMetaItemPrivate));
	return dino_ui_conversation_summary_message_meta_item_type_id;
}

GType
dino_ui_conversation_summary_message_meta_item_get_type (void)
{
	static volatile gsize dino_ui_conversation_summary_message_meta_item_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_conversation_summary_message_meta_item_type_id__once)) {
		GType dino_ui_conversation_summary_message_meta_item_type_id;
		dino_ui_conversation_summary_message_meta_item_type_id = dino_ui_conversation_summary_message_meta_item_get_type_once ();
		g_once_init_leave (&dino_ui_conversation_summary_message_meta_item_type_id__once, dino_ui_conversation_summary_message_meta_item_type_id);
	}
	return dino_ui_conversation_summary_message_meta_item_type_id__once;
}

static void
_vala_dino_ui_conversation_summary_message_meta_item_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec)
{
	DinoUiConversationSummaryMessageMetaItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM, DinoUiConversationSummaryMessageMetaItem);
	switch (property_id) {
		case DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_MARKED_PROPERTY:
		g_value_set_enum (value, dino_ui_conversation_summary_message_meta_item_get_marked (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_conversation_summary_message_meta_item_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec)
{
	DinoUiConversationSummaryMessageMetaItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_META_ITEM, DinoUiConversationSummaryMessageMetaItem);
	switch (property_id) {
		case DINO_UI_CONVERSATION_SUMMARY_MESSAGE_META_ITEM_MARKED_PROPERTY:
		dino_ui_conversation_summary_message_meta_item_set_marked (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
dino_ui_conversation_summary_message_item_edit_mode_on_text_view_changed (DinoUiConversationSummaryMessageItemEditMode* self)
{
	GtkButton* _tmp0_;
	DinoUiChatTextView* _tmp1_;
	GtkTextView* _tmp2_;
	GtkTextBuffer* _tmp3_;
	GtkTextBuffer* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->send_button;
	_tmp1_ = self->chat_text_view;
	_tmp2_ = _tmp1_->text_view;
	_tmp3_ = gtk_text_view_get_buffer (_tmp2_);
	_tmp4_ = _tmp3_;
	g_object_get (_tmp4_, "text", &_tmp5_, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, g_strcmp0 (_tmp7_, "") != 0);
	_g_free0 (_tmp7_);
}

DinoUiConversationSummaryMessageItemEditMode*
dino_ui_conversation_summary_message_item_edit_mode_construct (GType object_type)
{
	DinoUiConversationSummaryMessageItemEditMode * self = NULL;
	self = (DinoUiConversationSummaryMessageItemEditMode*) g_object_new (object_type, NULL);
	return self;
}

DinoUiConversationSummaryMessageItemEditMode*
dino_ui_conversation_summary_message_item_edit_mode_new (void)
{
	return dino_ui_conversation_summary_message_item_edit_mode_construct (DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE);
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static void
_dino_ui_conversation_summary_message_item_edit_mode___lambda22_ (DinoUiConversationSummaryMessageItemEditMode* self,
                                                                  const gchar* emoji)
{
	DinoUiChatTextView* _tmp0_;
	GtkTextView* _tmp1_;
	GtkTextBuffer* _tmp2_;
	GtkTextBuffer* _tmp3_;
	guint8* _tmp4_;
	gint _tmp4__length1;
	gint _tmp5_ = 0;
	guint8* _tmp6_;
	gint _tmp6__length1;
	g_return_if_fail (emoji != NULL);
	_tmp0_ = self->chat_text_view;
	_tmp1_ = _tmp0_->text_view;
	_tmp2_ = gtk_text_view_get_buffer (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = string_get_data (emoji, &_tmp5_);
	_tmp4__length1 = _tmp5_;
	_tmp6_ = _tmp4_;
	_tmp6__length1 = _tmp4__length1;
	gtk_text_buffer_insert_at_cursor (_tmp3_, emoji, _tmp6__length1);
}

static void
__dino_ui_conversation_summary_message_item_edit_mode___lambda22__gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                                                                                  const gchar* text,
                                                                                                  gpointer self)
{
	_dino_ui_conversation_summary_message_item_edit_mode___lambda22_ ((DinoUiConversationSummaryMessageItemEditMode*) self, text);
}

static void
_dino_ui_conversation_summary_message_item_edit_mode_on_text_view_changed_gtk_text_buffer_changed (GtkTextBuffer* _sender,
                                                                                                   gpointer self)
{
	dino_ui_conversation_summary_message_item_edit_mode_on_text_view_changed ((DinoUiConversationSummaryMessageItemEditMode*) self);
}

static void
_dino_ui_conversation_summary_message_item_edit_mode___lambda23_ (DinoUiConversationSummaryMessageItemEditMode* self)
{
	g_signal_emit (self, dino_ui_conversation_summary_message_item_edit_mode_signals[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_CANCELLED_SIGNAL], 0);
}

static void
__dino_ui_conversation_summary_message_item_edit_mode___lambda23__gtk_button_clicked (GtkButton* _sender,
                                                                                      gpointer self)
{
	_dino_ui_conversation_summary_message_item_edit_mode___lambda23_ ((DinoUiConversationSummaryMessageItemEditMode*) self);
}

static void
_dino_ui_conversation_summary_message_item_edit_mode___lambda24_ (DinoUiConversationSummaryMessageItemEditMode* self)
{
	g_signal_emit (self, dino_ui_conversation_summary_message_item_edit_mode_signals[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_SEND_SIGNAL], 0);
}

static void
__dino_ui_conversation_summary_message_item_edit_mode___lambda24__gtk_button_clicked (GtkButton* _sender,
                                                                                      gpointer self)
{
	_dino_ui_conversation_summary_message_item_edit_mode___lambda24_ ((DinoUiConversationSummaryMessageItemEditMode*) self);
}

static void
_dino_ui_conversation_summary_message_item_edit_mode___lambda25_ (DinoUiConversationSummaryMessageItemEditMode* self)
{
	g_signal_emit (self, dino_ui_conversation_summary_message_item_edit_mode_signals[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_CANCELLED_SIGNAL], 0);
}

static void
__dino_ui_conversation_summary_message_item_edit_mode___lambda25__dino_ui_chat_text_view_cancel_input (DinoUiChatTextView* _sender,
                                                                                                       gpointer self)
{
	_dino_ui_conversation_summary_message_item_edit_mode___lambda25_ ((DinoUiConversationSummaryMessageItemEditMode*) self);
}

static void
_dino_ui_conversation_summary_message_item_edit_mode___lambda26_ (DinoUiConversationSummaryMessageItemEditMode* self)
{
	g_signal_emit (self, dino_ui_conversation_summary_message_item_edit_mode_signals[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_SEND_SIGNAL], 0);
}

static void
__dino_ui_conversation_summary_message_item_edit_mode___lambda26__dino_ui_chat_text_view_send_text (DinoUiChatTextView* _sender,
                                                                                                    gpointer self)
{
	_dino_ui_conversation_summary_message_item_edit_mode___lambda26_ ((DinoUiConversationSummaryMessageItemEditMode*) self);
}

static GObject *
dino_ui_conversation_summary_message_item_edit_mode_constructor (GType type,
                                                                 guint n_construct_properties,
                                                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DinoUiConversationSummaryMessageItemEditMode * self;
	GtkFrame* _tmp0_;
	GtkCssProvider* _tmp1_;
	GtkCssProvider* _tmp2_;
	GtkEmojiChooser* chooser = NULL;
	GtkEmojiChooser* _tmp3_;
	GtkEmojiChooser* _tmp4_;
	GtkMenuButton* _tmp5_;
	GtkEmojiChooser* _tmp6_;
	DinoUiChatTextView* _tmp7_;
	GtkTextView* _tmp8_;
	GtkTextBuffer* _tmp9_;
	GtkTextBuffer* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	DinoUiChatTextView* _tmp13_;
	DinoUiChatTextView* _tmp14_;
	parent_class = G_OBJECT_CLASS (dino_ui_conversation_summary_message_item_edit_mode_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE, DinoUiConversationSummaryMessageItemEditMode);
	_tmp0_ = self->frame;
	_tmp1_ = dino_ui_util_force_css ((GtkWidget*) _tmp0_, "* { border-radius: 3px; padding: 0px 7px; }");
	_tmp2_ = _tmp1_;
	_g_object_unref0 (_tmp2_);
	_tmp3_ = (GtkEmojiChooser*) gtk_emoji_chooser_new ();
	g_object_ref_sink (_tmp3_);
	chooser = _tmp3_;
	_tmp4_ = chooser;
	g_signal_connect_object (_tmp4_, "emoji-picked", (GCallback) __dino_ui_conversation_summary_message_item_edit_mode___lambda22__gtk_emoji_chooser_emoji_picked, self, 0);
	_tmp5_ = self->emoji_button;
	_tmp6_ = chooser;
	gtk_menu_button_set_popover (_tmp5_, (GtkPopover*) _tmp6_);
	_tmp7_ = self->chat_text_view;
	_tmp8_ = _tmp7_->text_view;
	_tmp9_ = gtk_text_view_get_buffer (_tmp8_);
	_tmp10_ = _tmp9_;
	g_signal_connect_object (_tmp10_, "changed", (GCallback) _dino_ui_conversation_summary_message_item_edit_mode_on_text_view_changed_gtk_text_buffer_changed, self, G_CONNECT_AFTER);
	_tmp11_ = self->cancel_button;
	g_signal_connect_object (_tmp11_, "clicked", (GCallback) __dino_ui_conversation_summary_message_item_edit_mode___lambda23__gtk_button_clicked, self, 0);
	_tmp12_ = self->send_button;
	g_signal_connect_object (_tmp12_, "clicked", (GCallback) __dino_ui_conversation_summary_message_item_edit_mode___lambda24__gtk_button_clicked, self, 0);
	_tmp13_ = self->chat_text_view;
	g_signal_connect_object (_tmp13_, "cancel-input", (GCallback) __dino_ui_conversation_summary_message_item_edit_mode___lambda25__dino_ui_chat_text_view_cancel_input, self, 0);
	_tmp14_ = self->chat_text_view;
	g_signal_connect_object (_tmp14_, "send-text", (GCallback) __dino_ui_conversation_summary_message_item_edit_mode___lambda26__dino_ui_chat_text_view_send_text, self, 0);
	_g_object_unref0 (chooser);
	return obj;
}

static void
dino_ui_conversation_summary_message_item_edit_mode_class_init (DinoUiConversationSummaryMessageItemEditModeClass * klass,
                                                                gpointer klass_data)
{
	dino_ui_conversation_summary_message_item_edit_mode_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = dino_ui_conversation_summary_message_item_edit_mode_constructor;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_conversation_summary_message_item_edit_mode_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/im/dino/Dino/message_item_widget_edit_mode.ui");
	dino_ui_conversation_summary_message_item_edit_mode_signals[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_CANCELLED_SIGNAL] = g_signal_new ("cancelled", DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	dino_ui_conversation_summary_message_item_edit_mode_signals[DINO_UI_CONVERSATION_SUMMARY_MESSAGE_ITEM_EDIT_MODE_SEND_SIGNAL] = g_signal_new ("send", DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "emoji_button", FALSE, G_STRUCT_OFFSET (DinoUiConversationSummaryMessageItemEditMode, emoji_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "chat_text_view", FALSE, G_STRUCT_OFFSET (DinoUiConversationSummaryMessageItemEditMode, chat_text_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "cancel_button", FALSE, G_STRUCT_OFFSET (DinoUiConversationSummaryMessageItemEditMode, cancel_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "send_button", FALSE, G_STRUCT_OFFSET (DinoUiConversationSummaryMessageItemEditMode, send_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "frame", FALSE, G_STRUCT_OFFSET (DinoUiConversationSummaryMessageItemEditMode, frame));
}

static void
dino_ui_conversation_summary_message_item_edit_mode_instance_init (DinoUiConversationSummaryMessageItemEditMode * self,
                                                                   gpointer klass)
{
	g_type_ensure (DINO_UI_TYPE_CHAT_TEXT_VIEW);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
dino_ui_conversation_summary_message_item_edit_mode_finalize (GObject * obj)
{
	DinoUiConversationSummaryMessageItemEditMode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_CONVERSATION_SUMMARY_TYPE_MESSAGE_ITEM_EDIT_MODE, DinoUiConversationSummaryMessageItemEditMode);
	G_OBJECT_CLASS (dino_ui_conversation_summary_message_item_edit_mode_parent_class)->finalize (obj);
}

static GType
dino_ui_conversation_summary_message_item_edit_mode_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiConversationSummaryMessageItemEditModeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_conversation_summary_message_item_edit_mode_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiConversationSummaryMessageItemEditMode), 0, (GInstanceInitFunc) dino_ui_conversation_summary_message_item_edit_mode_instance_init, NULL };
	GType dino_ui_conversation_summary_message_item_edit_mode_type_id;
	dino_ui_conversation_summary_message_item_edit_mode_type_id = g_type_register_static (gtk_box_get_type (), "DinoUiConversationSummaryMessageItemEditMode", &g_define_type_info, 0);
	return dino_ui_conversation_summary_message_item_edit_mode_type_id;
}

GType
dino_ui_conversation_summary_message_item_edit_mode_get_type (void)
{
	static volatile gsize dino_ui_conversation_summary_message_item_edit_mode_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_conversation_summary_message_item_edit_mode_type_id__once)) {
		GType dino_ui_conversation_summary_message_item_edit_mode_type_id;
		dino_ui_conversation_summary_message_item_edit_mode_type_id = dino_ui_conversation_summary_message_item_edit_mode_get_type_once ();
		g_once_init_leave (&dino_ui_conversation_summary_message_item_edit_mode_type_id__once, dino_ui_conversation_summary_message_item_edit_mode_type_id);
	}
	return dino_ui_conversation_summary_message_item_edit_mode_type_id__once;
}

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

