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

#include <adwaita.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>

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

#define DC_TYPE_FULL_MESSAGE_DIALOG (dc_full_message_dialog_get_type ())
#define DC_FULL_MESSAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_FULL_MESSAGE_DIALOG, DcFullMessageDialog))
#define DC_FULL_MESSAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_FULL_MESSAGE_DIALOG, DcFullMessageDialogClass))
#define DC_IS_FULL_MESSAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_FULL_MESSAGE_DIALOG))
#define DC_IS_FULL_MESSAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_FULL_MESSAGE_DIALOG))
#define DC_FULL_MESSAGE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_FULL_MESSAGE_DIALOG, DcFullMessageDialogClass))

typedef struct _DcFullMessageDialog DcFullMessageDialog;
typedef struct _DcFullMessageDialogClass DcFullMessageDialogClass;
typedef struct _DcFullMessageDialogPrivate DcFullMessageDialogPrivate;

#define DC_TYPE_WINDOW (dc_window_get_type ())
#define DC_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_WINDOW, DcWindow))
#define DC_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_WINDOW, DcWindowClass))
#define DC_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_WINDOW))
#define DC_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_WINDOW))
#define DC_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_WINDOW, DcWindowClass))

typedef struct _DcWindow DcWindow;
typedef struct _DcWindowClass DcWindowClass;

#define DC_TYPE_RPC_CLIENT (dc_rpc_client_get_type ())
#define DC_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_RPC_CLIENT, DcRpcClient))
#define DC_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_RPC_CLIENT, DcRpcClientClass))
#define DC_IS_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_RPC_CLIENT))
#define DC_IS_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_RPC_CLIENT))
#define DC_RPC_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_RPC_CLIENT, DcRpcClientClass))

typedef struct _DcRpcClient DcRpcClient;
typedef struct _DcRpcClientClass DcRpcClientClass;

#define DC_TYPE_MESSAGE_ACTIONS (dc_message_actions_get_type ())
#define DC_MESSAGE_ACTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MESSAGE_ACTIONS, DcMessageActions))
#define DC_MESSAGE_ACTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MESSAGE_ACTIONS, DcMessageActionsClass))
#define DC_IS_MESSAGE_ACTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MESSAGE_ACTIONS))
#define DC_IS_MESSAGE_ACTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MESSAGE_ACTIONS))
#define DC_MESSAGE_ACTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MESSAGE_ACTIONS, DcMessageActionsClass))

typedef struct _DcMessageActions DcMessageActions;
typedef struct _DcMessageActionsClass DcMessageActionsClass;

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

typedef struct _DcMessage DcMessage;
typedef struct _DcMessageClass DcMessageClass;
enum  {
	DC_FULL_MESSAGE_DIALOG_0_PROPERTY,
	DC_FULL_MESSAGE_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dc_full_message_dialog_properties[DC_FULL_MESSAGE_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef enum  {
	DC_MARKDOWN_MODE_ENABLED = 0,
	DC_MARKDOWN_MODE_STRIPPED = 1,
	DC_MARKDOWN_MODE_DISABLED = 2
} DcMarkdownMode;

#define DC_TYPE_MARKDOWN_MODE (dc_markdown_mode_get_type ())
typedef struct _Block49Data Block49Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _DcFullMessageDialogSaveEditData DcFullMessageDialogSaveEditData;

struct _DcFullMessageDialog {
	AdwDialog parent_instance;
	DcFullMessageDialogPrivate * priv;
};

struct _DcFullMessageDialogClass {
	AdwDialogClass parent_class;
};

struct _DcFullMessageDialogPrivate {
	DcWindow* window;
	DcRpcClient* rpc;
	DcMessageActions* actions;
	DcMessage* msg;
	gchar* base_title;
	gchar* message_text;
	gchar* edit_original_text;
	gint reader_font_size;
	gboolean render_markdown;
	GtkStack* content_stack;
	GtkLabel* reader;
	GtkTextView* editor;
	GtkMenuButton* reading_button;
	GtkButton* edit_button;
	GtkButton* cancel_button;
	GtkButton* save_button;
	GtkLabel* edit_status;
};

struct _Block49Data {
	int _ref_count_;
	DcFullMessageDialog* self;
	GtkScale* scale;
	GtkSwitch* markdown_switch;
};

struct _DcFullMessageDialogSaveEditData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcFullMessageDialog* self;
	gboolean _tmp0_;
	GtkButton* _tmp1_;
	GtkButton* _tmp2_;
	gchar* text;
	GtkTextView* _tmp3_;
	GtkTextBuffer* _tmp4_;
	GtkTextBuffer* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	GtkTextView* _tmp17_;
	GtkLabel* _tmp18_;
	GtkLabel* _tmp19_;
	DcRpcClient* _tmp20_;
	DcMessage* _tmp21_;
	gint _tmp22_;
	gint _tmp23_;
	const gchar* _tmp24_;
	DcMessage* _tmp25_;
	const gchar* _tmp26_;
	DcMessage* _tmp27_;
	const gchar* _tmp28_;
	DcMessage* _tmp29_;
	DcMessageActions* _tmp30_;
	DcMessage* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	GError* e;
	GtkLabel* _tmp38_;
	GtkLabel* _tmp39_;
	GError* _tmp40_;
	const gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	DcWindow* _tmp44_;
	GError* _tmp45_;
	const gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	GtkTextView* _tmp49_;
	GtkButton* _tmp50_;
	GError* _inner_error0_;
};

static gint DcFullMessageDialog_private_offset;
static gpointer dc_full_message_dialog_parent_class = NULL;
VALA_EXTERN DcMarkdownMode dc_markdown_mode;

VALA_EXTERN GType dc_full_message_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcFullMessageDialog, g_object_unref)
VALA_EXTERN GType dc_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcWindow, g_object_unref)
VALA_EXTERN GType dc_rpc_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRpcClient, g_object_unref)
VALA_EXTERN GType dc_message_actions_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessageActions, g_object_unref)
VALA_EXTERN GType dc_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessage, g_object_unref)
VALA_EXTERN DcFullMessageDialog* dc_full_message_dialog_new (DcWindow* window,
                                                 DcRpcClient* rpc,
                                                 DcMessageActions* actions,
                                                 DcMessage* msg,
                                                 const gchar* full_text,
                                                 gint initial_font_size);
VALA_EXTERN DcFullMessageDialog* dc_full_message_dialog_construct (GType object_type,
                                                       DcWindow* window,
                                                       DcRpcClient* rpc,
                                                       DcMessageActions* actions,
                                                       DcMessage* msg,
                                                       const gchar* full_text,
                                                       gint initial_font_size);
VALA_EXTERN GType dc_markdown_mode_get_type (void) G_GNUC_CONST ;
static void dc_full_message_dialog_build_ui (DcFullMessageDialog* self,
                                      const gchar* dialog_title,
                                      const gchar* full_text,
                                      gint initial_font_size,
                                      gboolean can_edit);
VALA_EXTERN gint dc_message_get_id (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_can_edit_text (DcMessage* self);
VALA_EXTERN DcFullMessageDialog* dc_full_message_dialog_new_for_file (DcWindow* window,
                                                          const gchar* file_title,
                                                          const gchar* content,
                                                          gint initial_font_size,
                                                          gboolean markdown_default);
VALA_EXTERN DcFullMessageDialog* dc_full_message_dialog_construct_for_file (GType object_type,
                                                                DcWindow* window,
                                                                const gchar* file_title,
                                                                const gchar* content,
                                                                gint initial_font_size,
                                                                gboolean markdown_default);
VALA_EXTERN gint dc_settings_manager_clamp_font_size (gint size);
static GtkMenuButton* dc_full_message_dialog_build_reading_button (DcFullMessageDialog* self);
static void dc_full_message_dialog_enter_edit_mode (DcFullMessageDialog* self);
static void _dc_full_message_dialog_enter_edit_mode_gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self);
static void dc_full_message_dialog_leave_edit_mode (DcFullMessageDialog* self);
static void _dc_full_message_dialog_leave_edit_mode_gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self);
static void ___lambda172_ (DcFullMessageDialog* self);
static void dc_full_message_dialog_save_edit (DcFullMessageDialog* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static void dc_full_message_dialog_save_edit_finish (DcFullMessageDialog* self,
                                              GAsyncResult* _res_);
static void ____lambda172__gtk_button_clicked (GtkButton* _sender,
                                        gpointer self);
static GtkWidget* dc_full_message_dialog_build_reader (DcFullMessageDialog* self);
static GtkWidget* dc_full_message_dialog_build_editor (DcFullMessageDialog* self);
VALA_EXTERN void dc_install_escape_close (AdwDialog* dialog);
static void dc_full_message_dialog_update_reader (DcFullMessageDialog* self);
static void dc_full_message_dialog_update_save_button (DcFullMessageDialog* self);
static void _dc_full_message_dialog_update_save_button_gtk_text_buffer_changed (GtkTextBuffer* _sender,
                                                                         gpointer self);
static Block49Data* block49_data_ref (Block49Data* _data49_);
static void block49_data_unref (void * _userdata_);
static void __lambda169_ (Block49Data* _data49_);
static void ___lambda169__gtk_range_value_changed (GtkRange* _sender,
                                            gpointer self);
static void __lambda170_ (Block49Data* _data49_);
static void ___lambda170__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN gchar* dc_markdown_format_with_mode (const gchar* input,
                                     DcMarkdownMode render_mode);
static gboolean __lambda171_ (DcFullMessageDialog* self);
static gboolean ___lambda171__gsource_func (gpointer self);
static gchar* dc_full_message_dialog_text_buffer_text (GtkTextBuffer* buffer);
static void dc_full_message_dialog_save_edit_data_free (gpointer _data);
static gboolean dc_full_message_dialog_save_edit_co (DcFullMessageDialogSaveEditData* _data_);
VALA_EXTERN void dc_rpc_client_send_edit_request (DcRpcClient* self,
                                      gint msg_id,
                                      const gchar* new_text,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_send_edit_request_finish (DcRpcClient* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static void dc_full_message_dialog_save_edit_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
VALA_EXTERN void dc_message_set_text (DcMessage* self,
                          const gchar* value);
VALA_EXTERN void dc_message_set_full_message_text (DcMessage* self,
                                       const gchar* value);
VALA_EXTERN void dc_message_set_is_edited (DcMessage* self,
                               gboolean value);
VALA_EXTERN void dc_message_actions_update_row (DcMessageActions* self,
                                    gint msg_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void dc_message_actions_update_row_finish (DcMessageActions* self,
                                           GAsyncResult* _res_);
VALA_EXTERN void dc_window_show_toast (DcWindow* self,
                           const gchar* message);
static void dc_full_message_dialog_finalize (GObject * obj);
static GType dc_full_message_dialog_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dc_full_message_dialog_get_instance_private (DcFullMessageDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DcFullMessageDialog_private_offset);
}

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

DcFullMessageDialog*
dc_full_message_dialog_construct (GType object_type,
                                  DcWindow* window,
                                  DcRpcClient* rpc,
                                  DcMessageActions* actions,
                                  DcMessage* msg,
                                  const gchar* full_text,
                                  gint initial_font_size)
{
	DcFullMessageDialog * self = NULL;
	DcMessageActions* _tmp0_;
	DcMessage* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	g_return_val_if_fail (window != NULL, NULL);
	g_return_val_if_fail (rpc != NULL, NULL);
	g_return_val_if_fail (actions != NULL, NULL);
	g_return_val_if_fail (msg != NULL, NULL);
	g_return_val_if_fail (full_text != NULL, NULL);
	self = (DcFullMessageDialog*) g_object_new (object_type, NULL);
	self->priv->window = window;
	self->priv->rpc = rpc;
	_tmp0_ = _g_object_ref0 (actions);
	_g_object_unref0 (self->priv->actions);
	self->priv->actions = _tmp0_;
	_tmp1_ = _g_object_ref0 (msg);
	_g_object_unref0 (self->priv->msg);
	self->priv->msg = _tmp1_;
	self->priv->render_markdown = dc_markdown_mode == DC_MARKDOWN_MODE_ENABLED;
	_tmp2_ = dc_message_get_id (msg);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf ("Message %d", _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = dc_message_get_can_edit_text (msg);
	_tmp7_ = _tmp6_;
	dc_full_message_dialog_build_ui (self, _tmp5_, full_text, initial_font_size, _tmp7_);
	_g_free0 (_tmp5_);
	return self;
}

DcFullMessageDialog*
dc_full_message_dialog_new (DcWindow* window,
                            DcRpcClient* rpc,
                            DcMessageActions* actions,
                            DcMessage* msg,
                            const gchar* full_text,
                            gint initial_font_size)
{
	return dc_full_message_dialog_construct (DC_TYPE_FULL_MESSAGE_DIALOG, window, rpc, actions, msg, full_text, initial_font_size);
}

/** Read-only preview of a text-like attachment. */
DcFullMessageDialog*
dc_full_message_dialog_construct_for_file (GType object_type,
                                           DcWindow* window,
                                           const gchar* file_title,
                                           const gchar* content,
                                           gint initial_font_size,
                                           gboolean markdown_default)
{
	DcFullMessageDialog * self = NULL;
	g_return_val_if_fail (window != NULL, NULL);
	g_return_val_if_fail (file_title != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	self = (DcFullMessageDialog*) g_object_new (object_type, NULL);
	self->priv->window = window;
	self->priv->render_markdown = markdown_default;
	dc_full_message_dialog_build_ui (self, file_title, content, initial_font_size, FALSE);
	return self;
}

DcFullMessageDialog*
dc_full_message_dialog_new_for_file (DcWindow* window,
                                     const gchar* file_title,
                                     const gchar* content,
                                     gint initial_font_size,
                                     gboolean markdown_default)
{
	return dc_full_message_dialog_construct_for_file (DC_TYPE_FULL_MESSAGE_DIALOG, window, file_title, content, initial_font_size, markdown_default);
}

static void
_dc_full_message_dialog_enter_edit_mode_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self)
{
	dc_full_message_dialog_enter_edit_mode ((DcFullMessageDialog*) self);
}

static void
_dc_full_message_dialog_leave_edit_mode_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self)
{
	dc_full_message_dialog_leave_edit_mode ((DcFullMessageDialog*) self);
}

static void
___lambda172_ (DcFullMessageDialog* self)
{
	dc_full_message_dialog_save_edit (self, NULL, NULL);
}

static void
____lambda172__gtk_button_clicked (GtkButton* _sender,
                                   gpointer self)
{
	___lambda172_ ((DcFullMessageDialog*) self);
}

static void
dc_full_message_dialog_build_ui (DcFullMessageDialog* self,
                                 const gchar* dialog_title,
                                 const gchar* full_text,
                                 gint initial_font_size,
                                 gboolean can_edit)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	AdwToolbarView* toolbar = NULL;
	AdwToolbarView* _tmp3_;
	AdwHeaderBar* header = NULL;
	AdwHeaderBar* _tmp4_;
	AdwToolbarView* _tmp5_;
	AdwHeaderBar* _tmp6_;
	GtkMenuButton* _tmp7_;
	AdwHeaderBar* _tmp8_;
	GtkMenuButton* _tmp9_;
	GtkStack* _tmp27_;
	GtkStack* _tmp28_;
	GtkStack* _tmp29_;
	GtkStack* _tmp30_;
	GtkWidget* _tmp31_;
	GtkWidget* _tmp32_;
	GtkStack* _tmp33_;
	GtkWidget* _tmp34_;
	GtkWidget* _tmp35_;
	GtkStack* _tmp36_;
	AdwToolbarView* _tmp37_;
	GtkStack* _tmp38_;
	AdwToolbarView* _tmp39_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dialog_title != NULL);
	g_return_if_fail (full_text != NULL);
	_tmp0_ = g_strdup (full_text);
	_g_free0 (self->priv->message_text);
	self->priv->message_text = _tmp0_;
	_tmp1_ = g_strdup (full_text);
	_g_free0 (self->priv->edit_original_text);
	self->priv->edit_original_text = _tmp1_;
	self->priv->reader_font_size = dc_settings_manager_clamp_font_size (initial_font_size);
	if (self->priv->reader_font_size == DC_FONT_SIZE_SYSTEM) {
		self->priv->reader_font_size = DC_FONT_SIZE_FALLBACK;
	}
	_tmp2_ = g_strdup (dialog_title);
	_g_free0 (self->priv->base_title);
	self->priv->base_title = _tmp2_;
	adw_dialog_set_title ((AdwDialog*) self, dialog_title);
	adw_dialog_set_content_width ((AdwDialog*) self, 680);
	adw_dialog_set_content_height ((AdwDialog*) self, 560);
	_tmp3_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp3_);
	toolbar = _tmp3_;
	_tmp4_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp4_);
	header = _tmp4_;
	_tmp5_ = toolbar;
	_tmp6_ = header;
	adw_toolbar_view_add_top_bar (_tmp5_, (GtkWidget*) _tmp6_);
	_tmp7_ = dc_full_message_dialog_build_reading_button (self);
	_g_object_unref0 (self->priv->reading_button);
	self->priv->reading_button = _tmp7_;
	_tmp8_ = header;
	_tmp9_ = self->priv->reading_button;
	adw_header_bar_pack_end (_tmp8_, (GtkWidget*) _tmp9_);
	if (can_edit) {
		GtkButton* _tmp10_;
		GtkButton* _tmp11_;
		GtkButton* _tmp12_;
		GtkButton* _tmp13_;
		AdwHeaderBar* _tmp14_;
		GtkButton* _tmp15_;
		GtkButton* _tmp16_;
		GtkButton* _tmp17_;
		GtkButton* _tmp18_;
		AdwHeaderBar* _tmp19_;
		GtkButton* _tmp20_;
		GtkButton* _tmp21_;
		GtkButton* _tmp22_;
		GtkButton* _tmp23_;
		GtkButton* _tmp24_;
		AdwHeaderBar* _tmp25_;
		GtkButton* _tmp26_;
		_tmp10_ = (GtkButton*) gtk_button_new_from_icon_name ("document-edit-symbolic");
		g_object_ref_sink (_tmp10_);
		_g_object_unref0 (self->priv->edit_button);
		self->priv->edit_button = _tmp10_;
		_tmp11_ = self->priv->edit_button;
		gtk_widget_add_css_class ((GtkWidget*) _tmp11_, "flat");
		_tmp12_ = self->priv->edit_button;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp12_, "Edit message");
		_tmp13_ = self->priv->edit_button;
		g_signal_connect_object (_tmp13_, "clicked", (GCallback) _dc_full_message_dialog_enter_edit_mode_gtk_button_clicked, self, 0);
		_tmp14_ = header;
		_tmp15_ = self->priv->edit_button;
		adw_header_bar_pack_end (_tmp14_, (GtkWidget*) _tmp15_);
		_tmp16_ = (GtkButton*) gtk_button_new_with_label ("Cancel");
		g_object_ref_sink (_tmp16_);
		_g_object_unref0 (self->priv->cancel_button);
		self->priv->cancel_button = _tmp16_;
		_tmp17_ = self->priv->cancel_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp17_, FALSE);
		_tmp18_ = self->priv->cancel_button;
		g_signal_connect_object (_tmp18_, "clicked", (GCallback) _dc_full_message_dialog_leave_edit_mode_gtk_button_clicked, self, 0);
		_tmp19_ = header;
		_tmp20_ = self->priv->cancel_button;
		adw_header_bar_pack_end (_tmp19_, (GtkWidget*) _tmp20_);
		_tmp21_ = (GtkButton*) gtk_button_new_with_label ("Save");
		g_object_ref_sink (_tmp21_);
		_g_object_unref0 (self->priv->save_button);
		self->priv->save_button = _tmp21_;
		_tmp22_ = self->priv->save_button;
		gtk_widget_add_css_class ((GtkWidget*) _tmp22_, "suggested-action");
		_tmp23_ = self->priv->save_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp23_, FALSE);
		_tmp24_ = self->priv->save_button;
		g_signal_connect_object (_tmp24_, "clicked", (GCallback) ____lambda172__gtk_button_clicked, self, 0);
		_tmp25_ = header;
		_tmp26_ = self->priv->save_button;
		adw_header_bar_pack_end (_tmp25_, (GtkWidget*) _tmp26_);
	}
	_tmp27_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->content_stack);
	self->priv->content_stack = _tmp27_;
	_tmp28_ = self->priv->content_stack;
	gtk_stack_set_transition_type (_tmp28_, GTK_STACK_TRANSITION_TYPE_CROSSFADE);
	_tmp29_ = self->priv->content_stack;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp29_, TRUE);
	_tmp30_ = self->priv->content_stack;
	_tmp31_ = dc_full_message_dialog_build_reader (self);
	_tmp32_ = _tmp31_;
	gtk_stack_add_named (_tmp30_, _tmp32_, "reader");
	_g_object_unref0 (_tmp32_);
	_tmp33_ = self->priv->content_stack;
	_tmp34_ = dc_full_message_dialog_build_editor (self);
	_tmp35_ = _tmp34_;
	gtk_stack_add_named (_tmp33_, _tmp35_, "editor");
	_g_object_unref0 (_tmp35_);
	_tmp36_ = self->priv->content_stack;
	gtk_stack_set_visible_child_name (_tmp36_, "reader");
	_tmp37_ = toolbar;
	_tmp38_ = self->priv->content_stack;
	adw_toolbar_view_set_content (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = toolbar;
	adw_dialog_set_child ((AdwDialog*) self, (GtkWidget*) _tmp39_);
	dc_install_escape_close ((AdwDialog*) self);
	dc_full_message_dialog_update_reader (self);
	dc_full_message_dialog_update_save_button (self);
	_g_object_unref0 (header);
	_g_object_unref0 (toolbar);
}

static GtkWidget*
dc_full_message_dialog_build_reader (DcFullMessageDialog* self)
{
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	GtkLabel* _tmp10_;
	GtkLabel* _tmp11_;
	GtkLabel* _tmp12_;
	GtkLabel* _tmp13_;
	GtkScrolledWindow* scroll = NULL;
	GtkScrolledWindow* _tmp14_;
	GtkLabel* _tmp15_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->reader);
	self->priv->reader = _tmp0_;
	_tmp1_ = self->priv->reader;
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_FILL);
	_tmp2_ = self->priv->reader;
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	_tmp3_ = self->priv->reader;
	gtk_label_set_xalign (_tmp3_, (gfloat) 0);
	_tmp4_ = self->priv->reader;
	gtk_label_set_yalign (_tmp4_, (gfloat) 0);
	_tmp5_ = self->priv->reader;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
	_tmp6_ = self->priv->reader;
	gtk_label_set_wrap (_tmp6_, TRUE);
	_tmp7_ = self->priv->reader;
	gtk_label_set_wrap_mode (_tmp7_, PANGO_WRAP_WORD_CHAR);
	_tmp8_ = self->priv->reader;
	gtk_label_set_selectable (_tmp8_, TRUE);
	_tmp9_ = self->priv->reader;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp9_, 32);
	_tmp10_ = self->priv->reader;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp10_, 32);
	_tmp11_ = self->priv->reader;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp11_, 24);
	_tmp12_ = self->priv->reader;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp12_, 24);
	_tmp13_ = self->priv->reader;
	gtk_widget_add_css_class ((GtkWidget*) _tmp13_, "full-message-reader");
	_tmp14_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_ref_sink (_tmp14_);
	scroll = _tmp14_;
	g_object_set (scroll, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (scroll, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	gtk_widget_set_vexpand ((GtkWidget*) scroll, TRUE);
	_tmp15_ = self->priv->reader;
	gtk_scrolled_window_set_child (scroll, (GtkWidget*) _tmp15_);
	result = (GtkWidget*) scroll;
	return result;
}

static void
_dc_full_message_dialog_update_save_button_gtk_text_buffer_changed (GtkTextBuffer* _sender,
                                                                    gpointer self)
{
	dc_full_message_dialog_update_save_button ((DcFullMessageDialog*) self);
}

static GtkWidget*
dc_full_message_dialog_build_editor (DcFullMessageDialog* self)
{
	GtkTextView* _tmp0_;
	GtkTextView* _tmp1_;
	GtkTextView* _tmp2_;
	GtkTextView* _tmp3_;
	GtkTextView* _tmp4_;
	GtkTextView* _tmp5_;
	GtkTextView* _tmp6_;
	GtkTextView* _tmp7_;
	GtkTextView* _tmp8_;
	GtkTextBuffer* _tmp9_;
	GtkTextBuffer* _tmp10_;
	const gchar* _tmp11_;
	GtkTextView* _tmp12_;
	GtkTextBuffer* _tmp13_;
	GtkTextBuffer* _tmp14_;
	GtkTextView* _tmp15_;
	GtkLabel* _tmp16_;
	GtkLabel* _tmp17_;
	GtkLabel* _tmp18_;
	GtkLabel* _tmp19_;
	GtkLabel* _tmp20_;
	GtkLabel* _tmp21_;
	GtkLabel* _tmp22_;
	GtkScrolledWindow* scroll = NULL;
	GtkScrolledWindow* _tmp23_;
	GtkTextView* _tmp24_;
	GtkBox* box = NULL;
	GtkBox* _tmp25_;
	GtkLabel* _tmp26_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkTextView*) gtk_text_view_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->editor);
	self->priv->editor = _tmp0_;
	_tmp1_ = self->priv->editor;
	gtk_text_view_set_monospace (_tmp1_, TRUE);
	_tmp2_ = self->priv->editor;
	gtk_text_view_set_wrap_mode (_tmp2_, GTK_WRAP_WORD_CHAR);
	_tmp3_ = self->priv->editor;
	gtk_text_view_set_accepts_tab (_tmp3_, FALSE);
	_tmp4_ = self->priv->editor;
	gtk_text_view_set_top_margin (_tmp4_, 24);
	_tmp5_ = self->priv->editor;
	gtk_text_view_set_bottom_margin (_tmp5_, 24);
	_tmp6_ = self->priv->editor;
	gtk_text_view_set_left_margin (_tmp6_, 32);
	_tmp7_ = self->priv->editor;
	gtk_text_view_set_right_margin (_tmp7_, 32);
	_tmp8_ = self->priv->editor;
	_tmp9_ = gtk_text_view_get_buffer (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = self->priv->message_text;
	g_object_set (_tmp10_, "text", _tmp11_, NULL);
	_tmp12_ = self->priv->editor;
	_tmp13_ = gtk_text_view_get_buffer (_tmp12_);
	_tmp14_ = _tmp13_;
	g_signal_connect_object (_tmp14_, "changed", (GCallback) _dc_full_message_dialog_update_save_button_gtk_text_buffer_changed, self, 0);
	_tmp15_ = self->priv->editor;
	gtk_widget_add_css_class ((GtkWidget*) _tmp15_, "full-message-editor");
	_tmp16_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->edit_status);
	self->priv->edit_status = _tmp16_;
	_tmp17_ = self->priv->edit_status;
	gtk_widget_add_css_class ((GtkWidget*) _tmp17_, "dim-label");
	_tmp18_ = self->priv->edit_status;
	gtk_widget_set_halign ((GtkWidget*) _tmp18_, GTK_ALIGN_START);
	_tmp19_ = self->priv->edit_status;
	gtk_label_set_xalign (_tmp19_, (gfloat) 0);
	_tmp20_ = self->priv->edit_status;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp20_, 32);
	_tmp21_ = self->priv->edit_status;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp21_, 32);
	_tmp22_ = self->priv->edit_status;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp22_, 8);
	_tmp23_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_ref_sink (_tmp23_);
	scroll = _tmp23_;
	g_object_set (scroll, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (scroll, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	gtk_widget_set_vexpand ((GtkWidget*) scroll, TRUE);
	_tmp24_ = self->priv->editor;
	gtk_scrolled_window_set_child (scroll, (GtkWidget*) _tmp24_);
	_tmp25_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp25_);
	box = _tmp25_;
	gtk_box_append (box, (GtkWidget*) scroll);
	_tmp26_ = self->priv->edit_status;
	gtk_box_append (box, (GtkWidget*) _tmp26_);
	result = (GtkWidget*) box;
	_g_object_unref0 (scroll);
	return result;
}

static Block49Data*
block49_data_ref (Block49Data* _data49_)
{
	g_atomic_int_inc (&_data49_->_ref_count_);
	return _data49_;
}

static void
block49_data_unref (void * _userdata_)
{
	Block49Data* _data49_;
	_data49_ = (Block49Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data49_->_ref_count_)) {
		DcFullMessageDialog* self;
		self = _data49_->self;
		_g_object_unref0 (_data49_->markdown_switch);
		_g_object_unref0 (_data49_->scale);
		_g_object_unref0 (self);
		g_slice_free (Block49Data, _data49_);
	}
}

static void
__lambda169_ (Block49Data* _data49_)
{
	DcFullMessageDialog* self;
	self = _data49_->self;
	self->priv->reader_font_size = (gint) gtk_range_get_value ((GtkRange*) _data49_->scale);
	dc_full_message_dialog_update_reader (self);
}

static void
___lambda169__gtk_range_value_changed (GtkRange* _sender,
                                       gpointer self)
{
	__lambda169_ (self);
}

static void
__lambda170_ (Block49Data* _data49_)
{
	DcFullMessageDialog* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = _data49_->self;
	_tmp0_ = gtk_switch_get_active (_data49_->markdown_switch);
	_tmp1_ = _tmp0_;
	self->priv->render_markdown = _tmp1_;
	dc_full_message_dialog_update_reader (self);
}

static void
___lambda170__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda170_ (self);
}

static GtkMenuButton*
dc_full_message_dialog_build_reading_button (DcFullMessageDialog* self)
{
	Block49Data* _data49_;
	GtkMenuButton* button = NULL;
	GtkMenuButton* _tmp0_;
	GtkLabel* button_label = NULL;
	GtkLabel* _tmp1_;
	GtkBox* settings_box = NULL;
	GtkBox* _tmp2_;
	GtkLabel* heading = NULL;
	GtkLabel* _tmp3_;
	GtkLabel* size_label = NULL;
	GtkLabel* _tmp4_;
	GtkBox* size_row = NULL;
	GtkBox* _tmp5_;
	GtkLabel* small_a = NULL;
	GtkLabel* _tmp6_;
	GtkScale* _tmp7_;
	GtkLabel* large_a = NULL;
	GtkLabel* _tmp8_;
	GtkSeparator* _tmp9_;
	GtkSeparator* _tmp10_;
	GtkBox* markdown_row = NULL;
	GtkBox* _tmp11_;
	GtkBox* markdown_labels = NULL;
	GtkBox* _tmp12_;
	GtkLabel* markdown_title = NULL;
	GtkLabel* _tmp13_;
	GtkLabel* markdown_hint = NULL;
	GtkLabel* _tmp14_;
	GtkSwitch* _tmp15_;
	GtkPopover* popover = NULL;
	GtkPopover* _tmp16_;
	GtkMenuButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data49_ = g_slice_new0 (Block49Data);
	_data49_->_ref_count_ = 1;
	_data49_->self = g_object_ref (self);
	_tmp0_ = (GtkMenuButton*) gtk_menu_button_new ();
	g_object_ref_sink (_tmp0_);
	button = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new ("A");
	g_object_ref_sink (_tmp1_);
	button_label = _tmp1_;
	gtk_widget_add_css_class ((GtkWidget*) button_label, "heading");
	gtk_menu_button_set_child (button, (GtkWidget*) button_label);
	gtk_widget_add_css_class ((GtkWidget*) button, "flat");
	gtk_widget_set_tooltip_text ((GtkWidget*) button, "Reading settings");
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	g_object_ref_sink (_tmp2_);
	settings_box = _tmp2_;
	gtk_widget_set_margin_start ((GtkWidget*) settings_box, 16);
	gtk_widget_set_margin_end ((GtkWidget*) settings_box, 16);
	gtk_widget_set_margin_top ((GtkWidget*) settings_box, 14);
	gtk_widget_set_margin_bottom ((GtkWidget*) settings_box, 14);
	g_object_set ((GtkWidget*) settings_box, "width-request", 280, NULL);
	_tmp3_ = (GtkLabel*) gtk_label_new ("Reading settings");
	g_object_ref_sink (_tmp3_);
	heading = _tmp3_;
	gtk_widget_add_css_class ((GtkWidget*) heading, "heading");
	gtk_widget_set_halign ((GtkWidget*) heading, GTK_ALIGN_START);
	gtk_label_set_xalign (heading, (gfloat) 0);
	gtk_box_append (settings_box, (GtkWidget*) heading);
	_tmp4_ = (GtkLabel*) gtk_label_new ("Text size");
	g_object_ref_sink (_tmp4_);
	size_label = _tmp4_;
	gtk_widget_set_halign ((GtkWidget*) size_label, GTK_ALIGN_START);
	gtk_label_set_xalign (size_label, (gfloat) 0);
	gtk_box_append (settings_box, (GtkWidget*) size_label);
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
	g_object_ref_sink (_tmp5_);
	size_row = _tmp5_;
	_tmp6_ = (GtkLabel*) gtk_label_new ("A");
	g_object_ref_sink (_tmp6_);
	small_a = _tmp6_;
	gtk_widget_add_css_class ((GtkWidget*) small_a, "caption");
	gtk_box_append (size_row, (GtkWidget*) small_a);
	_tmp7_ = (GtkScale*) gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, (gdouble) DC_FONT_SIZE_MIN, (gdouble) DC_FONT_SIZE_MAX, 1.0);
	g_object_ref_sink (_tmp7_);
	_data49_->scale = _tmp7_;
	gtk_widget_set_hexpand ((GtkWidget*) _data49_->scale, TRUE);
	gtk_scale_set_draw_value (_data49_->scale, TRUE);
	gtk_scale_set_digits (_data49_->scale, 0);
	gtk_scale_set_value_pos (_data49_->scale, GTK_POS_RIGHT);
	gtk_range_set_value ((GtkRange*) _data49_->scale, (gdouble) self->priv->reader_font_size);
	g_signal_connect_data ((GtkRange*) _data49_->scale, "value-changed", (GCallback) ___lambda169__gtk_range_value_changed, block49_data_ref (_data49_), (GClosureNotify) block49_data_unref, 0);
	gtk_box_append (size_row, (GtkWidget*) _data49_->scale);
	_tmp8_ = (GtkLabel*) gtk_label_new ("A");
	g_object_ref_sink (_tmp8_);
	large_a = _tmp8_;
	gtk_widget_add_css_class ((GtkWidget*) large_a, "title-3");
	gtk_box_append (size_row, (GtkWidget*) large_a);
	gtk_box_append (settings_box, (GtkWidget*) size_row);
	_tmp9_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	gtk_box_append (settings_box, (GtkWidget*) _tmp10_);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	g_object_ref_sink (_tmp11_);
	markdown_row = _tmp11_;
	_tmp12_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
	g_object_ref_sink (_tmp12_);
	markdown_labels = _tmp12_;
	gtk_widget_set_hexpand ((GtkWidget*) markdown_labels, TRUE);
	_tmp13_ = (GtkLabel*) gtk_label_new ("Render Markdown");
	g_object_ref_sink (_tmp13_);
	markdown_title = _tmp13_;
	gtk_widget_set_halign ((GtkWidget*) markdown_title, GTK_ALIGN_START);
	gtk_label_set_xalign (markdown_title, (gfloat) 0);
	gtk_box_append (markdown_labels, (GtkWidget*) markdown_title);
	_tmp14_ = (GtkLabel*) gtk_label_new ("Format headings, emphasis, code, and links");
	g_object_ref_sink (_tmp14_);
	markdown_hint = _tmp14_;
	gtk_widget_add_css_class ((GtkWidget*) markdown_hint, "dim-label");
	gtk_widget_add_css_class ((GtkWidget*) markdown_hint, "caption");
	gtk_widget_set_halign ((GtkWidget*) markdown_hint, GTK_ALIGN_START);
	gtk_label_set_xalign (markdown_hint, (gfloat) 0);
	gtk_label_set_wrap (markdown_hint, TRUE);
	gtk_box_append (markdown_labels, (GtkWidget*) markdown_hint);
	gtk_box_append (markdown_row, (GtkWidget*) markdown_labels);
	_tmp15_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp15_);
	_data49_->markdown_switch = _tmp15_;
	gtk_widget_set_valign ((GtkWidget*) _data49_->markdown_switch, GTK_ALIGN_CENTER);
	gtk_switch_set_active (_data49_->markdown_switch, self->priv->render_markdown);
	g_signal_connect_data ((GObject*) _data49_->markdown_switch, "notify::active", (GCallback) ___lambda170__g_object_notify, block49_data_ref (_data49_), (GClosureNotify) block49_data_unref, 0);
	gtk_box_append (markdown_row, (GtkWidget*) _data49_->markdown_switch);
	gtk_box_append (settings_box, (GtkWidget*) markdown_row);
	_tmp16_ = (GtkPopover*) gtk_popover_new ();
	g_object_ref_sink (_tmp16_);
	popover = _tmp16_;
	gtk_popover_set_has_arrow (popover, TRUE);
	gtk_popover_set_child (popover, (GtkWidget*) settings_box);
	gtk_menu_button_set_popover (button, popover);
	result = button;
	_g_object_unref0 (popover);
	_g_object_unref0 (markdown_hint);
	_g_object_unref0 (markdown_title);
	_g_object_unref0 (markdown_labels);
	_g_object_unref0 (markdown_row);
	_g_object_unref0 (large_a);
	_g_object_unref0 (small_a);
	_g_object_unref0 (size_row);
	_g_object_unref0 (size_label);
	_g_object_unref0 (heading);
	_g_object_unref0 (settings_box);
	_g_object_unref0 (button_label);
	block49_data_unref (_data49_);
	_data49_ = NULL;
	return result;
}

static void
dc_full_message_dialog_update_reader (DcFullMessageDialog* self)
{
	GtkLabel* _tmp0_;
	DcMarkdownMode _tmp1_ = 0;
	DcMarkdownMode mode = 0;
	gchar* body = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* markup = NULL;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	GtkLabel* _tmp6_;
	const gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->reader;
	if (_tmp0_ == NULL) {
		return;
	}
	if (self->priv->render_markdown) {
		_tmp1_ = DC_MARKDOWN_MODE_ENABLED;
	} else {
		_tmp1_ = DC_MARKDOWN_MODE_DISABLED;
	}
	mode = _tmp1_;
	_tmp2_ = self->priv->message_text;
	_tmp3_ = dc_markdown_format_with_mode (_tmp2_, mode);
	body = _tmp3_;
	_tmp4_ = body;
	_tmp5_ = g_strdup_printf ("<span size=\"%d\">%s</span>", self->priv->reader_font_size * PANGO_SCALE, _tmp4_);
	markup = _tmp5_;
	_tmp6_ = self->priv->reader;
	_tmp7_ = markup;
	gtk_label_set_markup (_tmp6_, _tmp7_);
	_g_free0 (markup);
	_g_free0 (body);
}

static gboolean
__lambda171_ (DcFullMessageDialog* self)
{
	GtkTextView* _tmp0_;
	GtkTextView* _tmp1_;
	GtkTextBuffer* _tmp2_;
	GtkTextBuffer* _tmp3_;
	GtkTextMark* _tmp4_;
	gboolean result;
	_tmp0_ = self->priv->editor;
	_tmp1_ = self->priv->editor;
	_tmp2_ = gtk_text_view_get_buffer (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = gtk_text_buffer_get_insert (_tmp3_);
	gtk_text_view_scroll_mark_onscreen (_tmp0_, _tmp4_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda171__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda171_ ((DcFullMessageDialog*) self);
	return result;
}

static void
dc_full_message_dialog_enter_edit_mode (DcFullMessageDialog* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkButton* _tmp2_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	GtkTextView* _tmp7_;
	GtkTextBuffer* _tmp8_;
	GtkTextBuffer* _tmp9_;
	const gchar* _tmp10_;
	GtkLabel* _tmp11_;
	GtkStack* _tmp13_;
	GtkMenuButton* _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	GtkButton* _tmp17_;
	GtkTextView* _tmp18_;
	GtkTextIter end = {0};
	GtkTextView* _tmp19_;
	GtkTextBuffer* _tmp20_;
	GtkTextBuffer* _tmp21_;
	GtkTextIter _tmp22_ = {0};
	GtkTextView* _tmp23_;
	GtkTextBuffer* _tmp24_;
	GtkTextBuffer* _tmp25_;
	GtkTextIter _tmp26_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->edit_button;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		GtkButton* _tmp3_;
		_tmp3_ = self->priv->cancel_button;
		_tmp1_ = _tmp3_ == NULL;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		GtkButton* _tmp4_;
		_tmp4_ = self->priv->save_button;
		_tmp0_ = _tmp4_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp5_ = self->priv->message_text;
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (self->priv->edit_original_text);
	self->priv->edit_original_text = _tmp6_;
	_tmp7_ = self->priv->editor;
	_tmp8_ = gtk_text_view_get_buffer (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = self->priv->message_text;
	g_object_set (_tmp9_, "text", _tmp10_, NULL);
	_tmp11_ = self->priv->edit_status;
	if (_tmp11_ != NULL) {
		GtkLabel* _tmp12_;
		_tmp12_ = self->priv->edit_status;
		gtk_label_set_label (_tmp12_, "");
	}
	_tmp13_ = self->priv->content_stack;
	gtk_stack_set_visible_child_name (_tmp13_, "editor");
	adw_dialog_set_title ((AdwDialog*) self, "Edit Message");
	_tmp14_ = self->priv->reading_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp14_, FALSE);
	_tmp15_ = self->priv->edit_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp15_, FALSE);
	_tmp16_ = self->priv->cancel_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp16_, TRUE);
	_tmp17_ = self->priv->save_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp17_, TRUE);
	dc_full_message_dialog_update_save_button (self);
	_tmp18_ = self->priv->editor;
	gtk_widget_grab_focus ((GtkWidget*) _tmp18_);
	_tmp19_ = self->priv->editor;
	_tmp20_ = gtk_text_view_get_buffer (_tmp19_);
	_tmp21_ = _tmp20_;
	gtk_text_buffer_get_end_iter (_tmp21_, &_tmp22_);
	end = _tmp22_;
	_tmp23_ = self->priv->editor;
	_tmp24_ = gtk_text_view_get_buffer (_tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = end;
	gtk_text_buffer_place_cursor (_tmp25_, &_tmp26_);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda171__gsource_func, g_object_ref (self), g_object_unref);
}

static void
dc_full_message_dialog_leave_edit_mode (DcFullMessageDialog* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkButton* _tmp2_;
	GtkTextView* _tmp5_;
	GtkTextBuffer* _tmp6_;
	GtkTextBuffer* _tmp7_;
	const gchar* _tmp8_;
	GtkLabel* _tmp9_;
	GtkStack* _tmp11_;
	const gchar* _tmp12_;
	GtkMenuButton* _tmp13_;
	GtkButton* _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->edit_button;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		GtkButton* _tmp3_;
		_tmp3_ = self->priv->cancel_button;
		_tmp1_ = _tmp3_ == NULL;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		GtkButton* _tmp4_;
		_tmp4_ = self->priv->save_button;
		_tmp0_ = _tmp4_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp5_ = self->priv->editor;
	_tmp6_ = gtk_text_view_get_buffer (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = self->priv->message_text;
	g_object_set (_tmp7_, "text", _tmp8_, NULL);
	_tmp9_ = self->priv->edit_status;
	if (_tmp9_ != NULL) {
		GtkLabel* _tmp10_;
		_tmp10_ = self->priv->edit_status;
		gtk_label_set_label (_tmp10_, "");
	}
	_tmp11_ = self->priv->content_stack;
	gtk_stack_set_visible_child_name (_tmp11_, "reader");
	_tmp12_ = self->priv->base_title;
	adw_dialog_set_title ((AdwDialog*) self, _tmp12_);
	_tmp13_ = self->priv->reading_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp13_, TRUE);
	_tmp14_ = self->priv->edit_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp14_, TRUE);
	_tmp15_ = self->priv->cancel_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp15_, FALSE);
	_tmp16_ = self->priv->save_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp16_, FALSE);
}

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

static void
dc_full_message_dialog_update_save_button (DcFullMessageDialog* self)
{
	gboolean _tmp0_ = FALSE;
	GtkButton* _tmp1_;
	gchar* text = NULL;
	GtkTextView* _tmp3_;
	GtkTextBuffer* _tmp4_;
	GtkTextBuffer* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_ = FALSE;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	GtkButton* _tmp15_;
	gboolean _tmp16_ = FALSE;
	GtkButton* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->save_button;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		GtkTextView* _tmp2_;
		_tmp2_ = self->priv->editor;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = self->priv->editor;
	_tmp4_ = gtk_text_view_get_buffer (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = dc_full_message_dialog_text_buffer_text (_tmp5_);
	text = _tmp6_;
	_tmp8_ = text;
	_tmp9_ = self->priv->edit_original_text;
	if (g_strcmp0 (_tmp8_, _tmp9_) != 0) {
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		_tmp10_ = text;
		_tmp11_ = string_strip (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = strlen (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp7_ = _tmp14_ > 0;
		_g_free0 (_tmp12_);
	} else {
		_tmp7_ = FALSE;
	}
	_tmp15_ = self->priv->save_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, _tmp7_);
	_tmp17_ = self->priv->save_button;
	_tmp18_ = gtk_widget_get_sensitive ((GtkWidget*) _tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		GtkLabel* _tmp20_;
		_tmp20_ = self->priv->edit_status;
		_tmp16_ = _tmp20_ != NULL;
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		GtkLabel* _tmp21_;
		_tmp21_ = self->priv->edit_status;
		gtk_label_set_label (_tmp21_, "");
	}
	_g_free0 (text);
}

static void
dc_full_message_dialog_save_edit_data_free (gpointer _data)
{
	DcFullMessageDialogSaveEditData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcFullMessageDialogSaveEditData, _data_);
}

static void
dc_full_message_dialog_save_edit (DcFullMessageDialog* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	DcFullMessageDialogSaveEditData* _data_;
	DcFullMessageDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcFullMessageDialogSaveEditData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_full_message_dialog_save_edit_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_full_message_dialog_save_edit_co (_data_);
}

static void
dc_full_message_dialog_save_edit_finish (DcFullMessageDialog* self,
                                         GAsyncResult* _res_)
{
	DcFullMessageDialogSaveEditData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_full_message_dialog_save_edit_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	DcFullMessageDialogSaveEditData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_full_message_dialog_save_edit_co (_data_);
}

static gboolean
dc_full_message_dialog_save_edit_co (DcFullMessageDialogSaveEditData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->save_button;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp2_ = _data_->self->priv->cancel_button;
		_data_->_tmp0_ = _data_->_tmp2_ == NULL;
	}
	if (_data_->_tmp0_) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->self->priv->editor;
	_data_->_tmp4_ = gtk_text_view_get_buffer (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_full_message_dialog_text_buffer_text (_data_->_tmp5_);
	_data_->text = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->text;
	_data_->_tmp9_ = _data_->self->priv->edit_original_text;
	if (g_strcmp0 (_data_->_tmp8_, _data_->_tmp9_) == 0) {
		_data_->_tmp7_ = TRUE;
	} else {
		_data_->_tmp10_ = _data_->text;
		_data_->_tmp11_ = string_strip (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = strlen (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp7_ = _data_->_tmp14_ == 0;
		_g_free0 (_data_->_tmp12_);
	}
	if (_data_->_tmp7_) {
		_g_free0 (_data_->text);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = _data_->self->priv->save_button;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp15_, FALSE);
	_data_->_tmp16_ = _data_->self->priv->cancel_button;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp16_, FALSE);
	_data_->_tmp17_ = _data_->self->priv->editor;
	gtk_text_view_set_editable (_data_->_tmp17_, FALSE);
	_data_->_tmp18_ = _data_->self->priv->edit_status;
	if (_data_->_tmp18_ != NULL) {
		_data_->_tmp19_ = _data_->self->priv->edit_status;
		gtk_label_set_label (_data_->_tmp19_, "Saving…");
	}
	{
		_data_->_tmp20_ = _data_->self->priv->rpc;
		_data_->_tmp21_ = _data_->self->priv->msg;
		_data_->_tmp22_ = dc_message_get_id (_data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp24_ = _data_->text;
		_data_->_state_ = 1;
		dc_rpc_client_send_edit_request (_data_->_tmp20_, _data_->_tmp23_, _data_->_tmp24_, dc_full_message_dialog_save_edit_ready, _data_);
		return FALSE;
		_state_1:
		dc_rpc_client_send_edit_request_finish (_data_->_tmp20_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp25_ = _data_->self->priv->msg;
		_data_->_tmp26_ = _data_->text;
		dc_message_set_text (_data_->_tmp25_, _data_->_tmp26_);
		_data_->_tmp27_ = _data_->self->priv->msg;
		_data_->_tmp28_ = _data_->text;
		dc_message_set_full_message_text (_data_->_tmp27_, _data_->_tmp28_);
		_data_->_tmp29_ = _data_->self->priv->msg;
		dc_message_set_is_edited (_data_->_tmp29_, TRUE);
		_data_->_tmp30_ = _data_->self->priv->actions;
		_data_->_tmp31_ = _data_->self->priv->msg;
		_data_->_tmp32_ = dc_message_get_id (_data_->_tmp31_);
		_data_->_tmp33_ = _data_->_tmp32_;
		_data_->_state_ = 2;
		dc_message_actions_update_row (_data_->_tmp30_, _data_->_tmp33_, dc_full_message_dialog_save_edit_ready, _data_);
		return FALSE;
		_state_2:
		dc_message_actions_update_row_finish (_data_->_tmp30_, _data_->_res_);
		_data_->_tmp34_ = _data_->text;
		_data_->_tmp35_ = g_strdup (_data_->_tmp34_);
		_g_free0 (_data_->self->priv->message_text);
		_data_->self->priv->message_text = _data_->_tmp35_;
		_data_->_tmp36_ = _data_->text;
		_data_->_tmp37_ = g_strdup (_data_->_tmp36_);
		_g_free0 (_data_->self->priv->edit_original_text);
		_data_->self->priv->edit_original_text = _data_->_tmp37_;
		dc_full_message_dialog_update_reader (_data_->self);
		dc_full_message_dialog_leave_edit_mode (_data_->self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp38_ = _data_->self->priv->edit_status;
		if (_data_->_tmp38_ != NULL) {
			_data_->_tmp39_ = _data_->self->priv->edit_status;
			_data_->_tmp40_ = _data_->e;
			_data_->_tmp41_ = _data_->_tmp40_->message;
			_data_->_tmp42_ = g_strconcat ("Edit failed: ", _data_->_tmp41_, NULL);
			_data_->_tmp43_ = _data_->_tmp42_;
			gtk_label_set_label (_data_->_tmp39_, _data_->_tmp43_);
			_g_free0 (_data_->_tmp43_);
		}
		_data_->_tmp44_ = _data_->self->priv->window;
		_data_->_tmp45_ = _data_->e;
		_data_->_tmp46_ = _data_->_tmp45_->message;
		_data_->_tmp47_ = g_strconcat ("Edit failed: ", _data_->_tmp46_, NULL);
		_data_->_tmp48_ = _data_->_tmp47_;
		dc_window_show_toast (_data_->_tmp44_, _data_->_tmp48_);
		_g_free0 (_data_->_tmp48_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->text);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp49_ = _data_->self->priv->editor;
	gtk_text_view_set_editable (_data_->_tmp49_, TRUE);
	_data_->_tmp50_ = _data_->self->priv->cancel_button;
	gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp50_, TRUE);
	dc_full_message_dialog_update_save_button (_data_->self);
	_g_free0 (_data_->text);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gchar*
dc_full_message_dialog_text_buffer_text (GtkTextBuffer* buffer)
{
	GtkTextIter start = {0};
	GtkTextIter end = {0};
	GtkTextIter _tmp0_ = {0};
	GtkTextIter _tmp1_ = {0};
	GtkTextIter _tmp2_;
	GtkTextIter _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (buffer != NULL, NULL);
	gtk_text_buffer_get_start_iter (buffer, &_tmp0_);
	start = _tmp0_;
	gtk_text_buffer_get_end_iter (buffer, &_tmp1_);
	end = _tmp1_;
	_tmp2_ = start;
	_tmp3_ = end;
	_tmp4_ = gtk_text_buffer_get_text (buffer, &_tmp2_, &_tmp3_, FALSE);
	result = _tmp4_;
	return result;
}

static void
dc_full_message_dialog_class_init (DcFullMessageDialogClass * klass,
                                   gpointer klass_data)
{
	dc_full_message_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcFullMessageDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dc_full_message_dialog_finalize;
}

static void
dc_full_message_dialog_instance_init (DcFullMessageDialog * self,
                                      gpointer klass)
{
	self->priv = dc_full_message_dialog_get_instance_private (self);
	self->priv->edit_button = NULL;
	self->priv->cancel_button = NULL;
	self->priv->save_button = NULL;
	self->priv->edit_status = NULL;
}

static void
dc_full_message_dialog_finalize (GObject * obj)
{
	DcFullMessageDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_FULL_MESSAGE_DIALOG, DcFullMessageDialog);
	_g_object_unref0 (self->priv->actions);
	_g_object_unref0 (self->priv->msg);
	_g_free0 (self->priv->base_title);
	_g_free0 (self->priv->message_text);
	_g_free0 (self->priv->edit_original_text);
	_g_object_unref0 (self->priv->content_stack);
	_g_object_unref0 (self->priv->reader);
	_g_object_unref0 (self->priv->editor);
	_g_object_unref0 (self->priv->reading_button);
	_g_object_unref0 (self->priv->edit_button);
	_g_object_unref0 (self->priv->cancel_button);
	_g_object_unref0 (self->priv->save_button);
	_g_object_unref0 (self->priv->edit_status);
	G_OBJECT_CLASS (dc_full_message_dialog_parent_class)->finalize (obj);
}

/**
     * Comfortable, scrollable reader for the unabridged message body.
     * Also serves as a read-only previewer for text-like attachments
     * (see the `for_file` constructor).
     * Reading preferences are deliberately local to this dialog.
     */
static GType
dc_full_message_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcFullMessageDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_full_message_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcFullMessageDialog), 0, (GInstanceInitFunc) dc_full_message_dialog_instance_init, NULL };
	GType dc_full_message_dialog_type_id;
	dc_full_message_dialog_type_id = g_type_register_static (adw_dialog_get_type (), "DcFullMessageDialog", &g_define_type_info, 0);
	DcFullMessageDialog_private_offset = g_type_add_instance_private (dc_full_message_dialog_type_id, sizeof (DcFullMessageDialogPrivate));
	return dc_full_message_dialog_type_id;
}

GType
dc_full_message_dialog_get_type (void)
{
	static volatile gsize dc_full_message_dialog_type_id__once = 0;
	if (g_once_init_enter (&dc_full_message_dialog_type_id__once)) {
		GType dc_full_message_dialog_type_id;
		dc_full_message_dialog_type_id = dc_full_message_dialog_get_type_once ();
		g_once_init_leave (&dc_full_message_dialog_type_id__once, dc_full_message_dialog_type_id);
	}
	return dc_full_message_dialog_type_id__once;
}

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

