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

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

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

#define DC_TYPE_MESSAGE_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;
typedef struct _DcMessageActionsPrivate DcMessageActionsPrivate;

#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_PINNED_MESSAGES_MANAGER (dc_pinned_messages_manager_get_type ())
#define DC_PINNED_MESSAGES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_PINNED_MESSAGES_MANAGER, DcPinnedMessagesManager))
#define DC_PINNED_MESSAGES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_PINNED_MESSAGES_MANAGER, DcPinnedMessagesManagerClass))
#define DC_IS_PINNED_MESSAGES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_PINNED_MESSAGES_MANAGER))
#define DC_IS_PINNED_MESSAGES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_PINNED_MESSAGES_MANAGER))
#define DC_PINNED_MESSAGES_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_PINNED_MESSAGES_MANAGER, DcPinnedMessagesManagerClass))

typedef struct _DcPinnedMessagesManager DcPinnedMessagesManager;
typedef struct _DcPinnedMessagesManagerClass DcPinnedMessagesManagerClass;

#define DC_TYPE_COMPOSE_BAR (dc_compose_bar_get_type ())
#define DC_COMPOSE_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_COMPOSE_BAR, DcComposeBar))
#define DC_COMPOSE_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_COMPOSE_BAR, DcComposeBarClass))
#define DC_IS_COMPOSE_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_COMPOSE_BAR))
#define DC_IS_COMPOSE_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_COMPOSE_BAR))
#define DC_COMPOSE_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_COMPOSE_BAR, DcComposeBarClass))

typedef struct _DcComposeBar DcComposeBar;
typedef struct _DcComposeBarClass DcComposeBarClass;

#define DC_TYPE_SETTINGS_MANAGER (dc_settings_manager_get_type ())
#define DC_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_SETTINGS_MANAGER, DcSettingsManager))
#define DC_SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_SETTINGS_MANAGER, DcSettingsManagerClass))
#define DC_IS_SETTINGS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_SETTINGS_MANAGER))
#define DC_IS_SETTINGS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_SETTINGS_MANAGER))
#define DC_SETTINGS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_SETTINGS_MANAGER, DcSettingsManagerClass))

typedef struct _DcSettingsManager DcSettingsManager;
typedef struct _DcSettingsManagerClass DcSettingsManagerClass;

#define DC_TYPE_MENTION_ROSTER (dc_mention_roster_get_type ())
#define DC_MENTION_ROSTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MENTION_ROSTER, DcMentionRoster))
#define DC_MENTION_ROSTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MENTION_ROSTER, DcMentionRosterClass))
#define DC_IS_MENTION_ROSTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MENTION_ROSTER))
#define DC_IS_MENTION_ROSTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MENTION_ROSTER))
#define DC_MENTION_ROSTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MENTION_ROSTER, DcMentionRosterClass))

typedef struct _DcMentionRoster DcMentionRoster;
typedef struct _DcMentionRosterClass DcMentionRosterClass;
enum  {
	DC_MESSAGE_ACTIONS_0_PROPERTY,
	DC_MESSAGE_ACTIONS_NUM_PROPERTIES
};
static GParamSpec* dc_message_actions_properties[DC_MESSAGE_ACTIONS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block93Data Block93Data;

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

typedef struct _DcMessage DcMessage;
typedef struct _DcMessageClass DcMessageClass;

#define DC_TYPE_POPOVER_BUTTON (dc_popover_button_get_type ())
#define DC_POPOVER_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_POPOVER_BUTTON, DcPopoverButton))
#define DC_POPOVER_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_POPOVER_BUTTON, DcPopoverButtonClass))
#define DC_IS_POPOVER_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_POPOVER_BUTTON))
#define DC_IS_POPOVER_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_POPOVER_BUTTON))
#define DC_POPOVER_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_POPOVER_BUTTON, DcPopoverButtonClass))

typedef struct _DcPopoverButton DcPopoverButton;
typedef struct _DcPopoverButtonClass DcPopoverButtonClass;
typedef struct _Block94Data Block94Data;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block95Data Block95Data;

#define DC_TYPE_TRANSCRIBER (dc_transcriber_get_type ())
#define DC_TRANSCRIBER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_TRANSCRIBER, DcTranscriber))
#define DC_TRANSCRIBER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_TRANSCRIBER, DcTranscriberClass))
#define DC_IS_TRANSCRIBER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_TRANSCRIBER))
#define DC_IS_TRANSCRIBER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_TRANSCRIBER))
#define DC_TRANSCRIBER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_TRANSCRIBER, DcTranscriberClass))

typedef struct _DcTranscriber DcTranscriber;
typedef struct _DcTranscriberClass DcTranscriberClass;
typedef struct _Block96Data Block96Data;
typedef enum  {
	DC_DELETE_CHOICE_CANCEL,
	DC_DELETE_CHOICE_FOR_ME,
	DC_DELETE_CHOICE_FOR_EVERYONE
} DcDeleteChoice;

#define DC_TYPE_DELETE_CHOICE (dc_delete_choice_get_type ())
typedef struct _DcMessageActionsConfirmDeleteMessageData DcMessageActionsConfirmDeleteMessageData;
typedef struct _Block97Data Block97Data;
typedef struct _Block98Data Block98Data;

#define DC_TYPE_CONVERSATION_VIEW (dc_conversation_view_get_type ())
#define DC_CONVERSATION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_CONVERSATION_VIEW, DcConversationView))
#define DC_CONVERSATION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_CONVERSATION_VIEW, DcConversationViewClass))
#define DC_IS_CONVERSATION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_CONVERSATION_VIEW))
#define DC_IS_CONVERSATION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_CONVERSATION_VIEW))
#define DC_CONVERSATION_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_CONVERSATION_VIEW, DcConversationViewClass))

typedef struct _DcConversationView DcConversationView;
typedef struct _DcConversationViewClass DcConversationViewClass;
typedef struct _Block99Data Block99Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _DcMessageActionsSendReactionData DcMessageActionsSendReactionData;
typedef struct _Block100Data Block100Data;
typedef struct _DcMessageActionsDeleteMessageData DcMessageActionsDeleteMessageData;

#define DC_TYPE_CONTACT_PICKER_DIALOG (dc_contact_picker_dialog_get_type ())
#define DC_CONTACT_PICKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_CONTACT_PICKER_DIALOG, DcContactPickerDialog))
#define DC_CONTACT_PICKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_CONTACT_PICKER_DIALOG, DcContactPickerDialogClass))
#define DC_IS_CONTACT_PICKER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_CONTACT_PICKER_DIALOG))
#define DC_IS_CONTACT_PICKER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_CONTACT_PICKER_DIALOG))
#define DC_CONTACT_PICKER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_CONTACT_PICKER_DIALOG, DcContactPickerDialogClass))

typedef struct _DcContactPickerDialog DcContactPickerDialog;
typedef struct _DcContactPickerDialogClass DcContactPickerDialogClass;
typedef struct _Block101Data Block101Data;
typedef struct _DcMessageActionsForwardToChatData DcMessageActionsForwardToChatData;
typedef struct _DcMessageActionsForwardToContactData DcMessageActionsForwardToContactData;
typedef struct _DcMessageActionsEditMessageData DcMessageActionsEditMessageData;
typedef struct _DcMessageActionsUpdateRowData DcMessageActionsUpdateRowData;
typedef struct _Block102Data Block102Data;

#define DC_TYPE_MESSAGE_DETAILS_DIALOG (dc_message_details_dialog_get_type ())
#define DC_MESSAGE_DETAILS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MESSAGE_DETAILS_DIALOG, DcMessageDetailsDialog))
#define DC_MESSAGE_DETAILS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MESSAGE_DETAILS_DIALOG, DcMessageDetailsDialogClass))
#define DC_IS_MESSAGE_DETAILS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MESSAGE_DETAILS_DIALOG))
#define DC_IS_MESSAGE_DETAILS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MESSAGE_DETAILS_DIALOG))
#define DC_MESSAGE_DETAILS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MESSAGE_DETAILS_DIALOG, DcMessageDetailsDialogClass))

typedef struct _DcMessageDetailsDialog DcMessageDetailsDialog;
typedef struct _DcMessageDetailsDialogClass DcMessageDetailsDialogClass;
typedef struct _DcMessageActionsOpenSenderChatData DcMessageActionsOpenSenderChatData;
typedef struct _DcMessageActionsOpenSenderProfileData DcMessageActionsOpenSenderProfileData;
enum  {
	DC_MESSAGE_ACTIONS_SELECT_REQUESTED_SIGNAL,
	DC_MESSAGE_ACTIONS_NUM_SIGNALS
};
static guint dc_message_actions_signals[DC_MESSAGE_ACTIONS_NUM_SIGNALS] = {0};

struct _DcMessageActions {
	GObject parent_instance;
	DcMessageActionsPrivate * priv;
};

struct _DcMessageActionsClass {
	GObjectClass parent_class;
};

struct _DcMessageActionsPrivate {
	DcWindow* window;
	DcRpcClient* rpc;
	GListStore* message_store;
	DcPinnedMessagesManager* pinned;
	DcComposeBar* compose_bar;
	DcSettingsManager* settings;
	DcMentionRoster* reaction_roster;
};

struct _Block93Data {
	int _ref_count_;
	DcMessageActions* self;
	gint msg_id;
	gboolean is_outgoing;
};

struct _Block94Data {
	int _ref_count_;
	Block93Data * _data93_;
	gchar* fpath;
	gchar* fname;
};

struct _Block95Data {
	int _ref_count_;
	Block93Data * _data93_;
	gchar* apath;
};

struct _Block96Data {
	int _ref_count_;
	Block93Data * _data93_;
	gchar* spath;
};

struct _DcMessageActionsConfirmDeleteMessageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcMessageActions* self;
	gint msg_id;
	gboolean is_outgoing;
	const gchar* _tmp0_;
	gchar* body;
	gchar* _tmp1_;
	DcDeleteChoice choice;
	DcWindow* _tmp2_;
	const gchar* _tmp3_;
};

struct _Block97Data {
	int _ref_count_;
	DcMessageActions* self;
	gint msg_id;
	GtkWidget* parent;
	gdouble x;
	gdouble y;
};

struct _Block98Data {
	int _ref_count_;
	Block97Data * _data97_;
	gchar* emoji;
};

struct _Block99Data {
	int _ref_count_;
	DcMessageActions* self;
	DcConversationView* view;
	gdouble saved_scroll;
};

struct _DcMessageActionsSendReactionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcMessageActions* self;
	gint msg_id;
	gchar* emoji;
	DcMessage* current;
	GListStore* _tmp0_;
	DcMessage* _tmp1_;
	DcMessage* _tmp2_;
	DcRpcClient* _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	DcRpcClient* _tmp6_;
	gchar* _tmp7_;
	gchar** _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	GError* e;
	DcWindow* _tmp10_;
	GError* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GError* _inner_error0_;
};

struct _Block100Data {
	int _ref_count_;
	DcMessageActions* self;
	gint msg_id;
};

struct _DcMessageActionsDeleteMessageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcMessageActions* self;
	gint msg_id;
	gboolean for_all;
	DcRpcClient* _tmp0_;
	gint* _tmp1_;
	gint* _tmp2_;
	gint _tmp2__length1;
	DcRpcClient* _tmp3_;
	gint* _tmp4_;
	gint* _tmp5_;
	gint _tmp5__length1;
	gint idx;
	GListStore* _tmp6_;
	GListStore* _tmp7_;
	GError* e;
	DcWindow* _tmp8_;
	GError* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	GError* _inner_error0_;
};

struct _Block101Data {
	int _ref_count_;
	gint* forward_ids;
	gint forward_ids_length1;
	gint _forward_ids_size_;
	DcWindow* window;
	DcRpcClient* rpc;
};

struct _DcMessageActionsForwardToChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcWindow* window;
	DcRpcClient* rpc;
	gint* msg_ids;
	gint msg_ids_length1;
	gint chat_id;
	const gchar* _tmp0_;
	GError* e;
	GError* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GError* _inner_error0_;
};

struct _DcMessageActionsForwardToContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcWindow* window;
	DcRpcClient* rpc;
	gint* msg_ids;
	gint msg_ids_length1;
	gint contact_id;
	gchar* email;
	gint chat_id;
	gint cid;
	gint _tmp0_;
	gint _tmp1_;
	GError* e;
	GError* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gint* _tmp6_;
	gint _tmp6__length1;
	GError* _inner_error0_;
};

struct _DcMessageActionsEditMessageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcMessageActions* self;
	gint msg_id;
	gchar* new_text;
	DcRpcClient* _tmp0_;
	GError* e;
	DcWindow* _tmp1_;
	GError* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GError* _inner_error0_;
};

struct _DcMessageActionsUpdateRowData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcMessageActions* self;
	gint msg_id;
	DcMessage* msg;
	DcRpcClient* _tmp0_;
	DcMessage* _tmp1_;
	DcMessage* _tmp2_;
	DcConversationView* view;
	DcWindow* _tmp3_;
	DcConversationView* _tmp4_;
	DcConversationView* _tmp5_;
	DcConversationView* _tmp6_;
	DcMessage* _tmp7_;
	gint idx;
	GListStore* _tmp8_;
	GObject** replacements;
	DcMessage* _tmp9_;
	GObject* _tmp10_;
	GObject** _tmp11_;
	gint replacements_length1;
	gint _replacements_size_;
	GListStore* _tmp12_;
	GObject** _tmp13_;
	gint _tmp13__length1;
	GError* _inner_error0_;
};

struct _Block102Data {
	int _ref_count_;
	DcMessageActions* self;
	gint msg_id;
	gboolean is_outgoing;
	gdouble x;
	gdouble y;
	GtkWidget* parent;
};

struct _DcMessageActionsOpenSenderChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcMessageActions* self;
	gint msg_id;
	DcMessage* m;
	GListStore* _tmp0_;
	DcMessage* _tmp1_;
	DcMessage* _tmp2_;
	gint contact_id;
	DcMessage* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gchar* address;
	DcMessage* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gboolean _tmp10_;
	DcMessage* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	DcRpcClient* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	gboolean _tmp23_;
	gboolean _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	gint _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	DcRpcClient* _tmp30_;
	const gchar* _tmp31_;
	gint chat_id;
	DcRpcClient* _tmp32_;
	DcWindow* _tmp33_;
	DcWindow* _tmp34_;
	GError* e;
	DcWindow* _tmp35_;
	GError* _tmp36_;
	const gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	GError* _inner_error0_;
};

struct _DcMessageActionsOpenSenderProfileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcMessageActions* self;
	gint msg_id;
	DcMessage* m;
	GListStore* _tmp0_;
	DcMessage* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	DcMessage* _tmp4_;
	DcMessage* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	DcMessage* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	gint contact_id;
	DcRpcClient* _tmp11_;
	DcMessage* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gint chat_id;
	DcRpcClient* _tmp15_;
	DcWindow* _tmp16_;
	DcWindow* _tmp17_;
	GError* e;
	DcWindow* _tmp18_;
	GError* _tmp19_;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	GError* _inner_error0_;
};

static gint DcMessageActions_private_offset;
static gpointer dc_message_actions_parent_class = NULL;

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_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_pinned_messages_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcPinnedMessagesManager, g_object_unref)
VALA_EXTERN GType dc_compose_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcComposeBar, g_object_unref)
VALA_EXTERN GType dc_settings_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcSettingsManager, g_object_unref)
VALA_EXTERN GType dc_mention_roster_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMentionRoster, g_object_unref)
VALA_EXTERN DcMessageActions* dc_message_actions_new (DcWindow* window,
                                          DcRpcClient* rpc,
                                          GListStore* message_store,
                                          DcPinnedMessagesManager* pinned,
                                          DcComposeBar* compose_bar,
                                          DcSettingsManager* settings);
VALA_EXTERN DcMessageActions* dc_message_actions_construct (GType object_type,
                                                DcWindow* window,
                                                DcRpcClient* rpc,
                                                GListStore* message_store,
                                                DcPinnedMessagesManager* pinned,
                                                DcComposeBar* compose_bar,
                                                DcSettingsManager* settings);
VALA_EXTERN void dc_message_actions_set_reaction_roster (DcMessageActions* self,
                                             DcMentionRoster* roster);
VALA_EXTERN void dc_message_actions_show_context_menu (DcMessageActions* self,
                                           gint msg_id,
                                           gboolean is_outgoing,
                                           gdouble x,
                                           gdouble y,
                                           GtkWidget* parent);
static Block93Data* block93_data_ref (Block93Data* _data93_);
static void block93_data_unref (void * _userdata_);
VALA_EXTERN GtkPopover* dc_popover_menu (GtkWidget* parent,
                             gdouble x,
                             gdouble y,
                             GtkBox** vbox);
static void dc_message_actions_append_emoji_rows (DcMessageActions* self,
                                           GtkBox* vbox,
                                           GtkPopover* popover,
                                           gint msg_id,
                                           GtkWidget* parent,
                                           gdouble x,
                                           gdouble y);
VALA_EXTERN GType dc_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessage, g_object_unref)
VALA_EXTERN DcMessage* dc_find_message (GListModel* store,
                            gint msg_id);
VALA_EXTERN GType dc_popover_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcPopoverButton, g_object_unref)
VALA_EXTERN DcPopoverButton* dc_popover_button_new (GtkPopover* popover,
                                        const gchar* label,
                                        gboolean destructive,
                                        gboolean hexpand);
VALA_EXTERN DcPopoverButton* dc_popover_button_construct (GType object_type,
                                              GtkPopover* popover,
                                              const gchar* label,
                                              gboolean destructive,
                                              gboolean hexpand);
static void __lambda80_ (Block93Data* _data93_);
VALA_EXTERN void dc_message_actions_start_replying (DcMessageActions* self,
                                        gint msg_id);
static void ___lambda80__dc_popover_button_selected (DcPopoverButton* _sender,
                                              gpointer self);
static void __lambda81_ (Block93Data* _data93_);
VALA_EXTERN void dc_message_actions_start_forwarding (DcMessageActions* self,
                                          gint msg_id);
static void ___lambda81__dc_popover_button_selected (DcPopoverButton* _sender,
                                              gpointer self);
VALA_EXTERN gboolean dc_message_get_is_pinned (DcMessage* self);
VALA_EXTERN gboolean dc_pinned_messages_manager_is_pinned (DcPinnedMessagesManager* self,
                                               gint msg_id);
static void __lambda87_ (Block93Data* _data93_);
VALA_EXTERN void dc_pinned_messages_manager_toggle_pin (DcPinnedMessagesManager* self,
                                            gint msg_id,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN void dc_pinned_messages_manager_toggle_pin_finish (DcPinnedMessagesManager* self,
                                                   GAsyncResult* _res_);
static void ___lambda87__dc_popover_button_selected (DcPopoverButton* _sender,
                                              gpointer self);
VALA_EXTERN gboolean dc_message_get_can_edit_text (DcMessage* self);
static void ___lambda88_ (Block93Data* _data93_);
VALA_EXTERN void dc_message_actions_start_editing (DcMessageActions* self,
                                       gint msg_id);
static void ____lambda88__dc_popover_button_selected (DcPopoverButton* _sender,
                                               gpointer self);
static void __lambda89_ (Block93Data* _data93_);
static void ___lambda89__dc_popover_button_selected (DcPopoverButton* _sender,
                                              gpointer self);
static void __lambda90_ (Block93Data* _data93_);
VALA_EXTERN void dc_message_actions_show_details (DcMessageActions* self,
                                      gint msg_id);
static void ___lambda90__dc_popover_button_selected (DcPopoverButton* _sender,
                                              gpointer self);
VALA_EXTERN const gchar* dc_message_get_file_path (DcMessage* self);
static Block94Data* block94_data_ref (Block94Data* _data94_);
static void block94_data_unref (void * _userdata_);
VALA_EXTERN const gchar* dc_message_get_file_name (DcMessage* self);
static void ___lambda102_ (Block94Data* _data94_);
VALA_EXTERN void dc_window_save_attachment (DcWindow* self,
                                const gchar* src_path,
                                const gchar* name,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN void dc_window_save_attachment_finish (DcWindow* self,
                                       GAsyncResult* _res_);
static void ____lambda102__dc_popover_button_selected (DcPopoverButton* _sender,
                                                gpointer self);
VALA_EXTERN gboolean dc_message_is_audio_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_has_local_file (DcMessage* self);
VALA_EXTERN gboolean dc_transcriber_available (void);
static Block95Data* block95_data_ref (Block95Data* _data95_);
static void block95_data_unref (void * _userdata_);
static void ___lambda103_ (Block95Data* _data95_);
VALA_EXTERN GType dc_transcriber_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcTranscriber, g_object_unref)
VALA_EXTERN DcTranscriber* dc_transcriber_shared (void);
VALA_EXTERN void dc_transcriber_transcribe (DcTranscriber* self,
                                const gchar* path);
static void ____lambda103__dc_popover_button_selected (DcPopoverButton* _sender,
                                                gpointer self);
VALA_EXTERN gboolean dc_message_is_sticker_file (DcMessage* self);
static Block96Data* block96_data_ref (Block96Data* _data96_);
static void block96_data_unref (void * _userdata_);
static void ___lambda104_ (Block96Data* _data96_);
VALA_EXTERN void dc_sticker_manager_dialog_prompt_add_sticker (DcWindow* window,
                                                   const gchar* file_path);
static void ____lambda104__dc_popover_button_selected (DcPopoverButton* _sender,
                                                gpointer self);
static void __lambda118_ (Block93Data* _data93_);
static void dc_message_actions_confirm_delete_message (DcMessageActions* self,
                                                gint msg_id,
                                                gboolean is_outgoing,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static void dc_message_actions_confirm_delete_message_finish (DcMessageActions* self,
                                                       GAsyncResult* _res_);
static void ___lambda118__dc_popover_button_selected (DcPopoverButton* _sender,
                                               gpointer self);
static void dc_message_actions_preserve_scroll_until_closed (DcMessageActions* self,
                                                      GtkPopover* popover);
static void dc_message_actions_confirm_delete_message_data_free (gpointer _data);
static gboolean dc_message_actions_confirm_delete_message_co (DcMessageActionsConfirmDeleteMessageData* _data_);
VALA_EXTERN GType dc_delete_choice_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void dc_confirm_delete_options (GtkWidget* parent,
                                const gchar* title,
                                const gchar* body,
                                gboolean allow_delete_for_everyone,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN DcDeleteChoice dc_confirm_delete_options_finish (GAsyncResult* _res_);
static void dc_message_actions_confirm_delete_message_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
VALA_EXTERN void dc_message_actions_delete_message (DcMessageActions* self,
                                        gint msg_id,
                                        gboolean for_all,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN void dc_message_actions_delete_message_finish (DcMessageActions* self,
                                               GAsyncResult* _res_);
static Block97Data* block97_data_ref (Block97Data* _data97_);
static void block97_data_unref (void * _userdata_);
VALA_EXTERN gboolean dc_gtk_emoji_chooser_available (void);
static void _vala_array_add61 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
static Block98Data* block98_data_ref (Block98Data* _data98_);
static void block98_data_unref (void * _userdata_);
static void ______lambda72_ (Block98Data* _data98_);
static void dc_message_actions_show_emoji_picker (DcMessageActions* self,
                                           gint msg_id,
                                           GtkWidget* parent,
                                           gdouble x,
                                           gdouble y);
static void _______lambda72__dc_popover_button_selected (DcPopoverButton* _sender,
                                                  gpointer self);
static gboolean dc_message_actions_has_my_reaction (DcMessageActions* self,
                                             DcMessage* msg,
                                             const gchar* emoji);
static void ______lambda79_ (Block98Data* _data98_);
VALA_EXTERN void dc_message_actions_send_reaction (DcMessageActions* self,
                                       gint msg_id,
                                       const gchar* emoji,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN void dc_message_actions_send_reaction_finish (DcMessageActions* self,
                                              GAsyncResult* _res_);
static void _______lambda79__dc_popover_button_selected (DcPopoverButton* _sender,
                                                  gpointer self);
VALA_EXTERN void dc_message_actions_show_reaction_menu (DcMessageActions* self,
                                            gint msg_id,
                                            GtkWidget* parent,
                                            gdouble x,
                                            gdouble y);
VALA_EXTERN GType dc_conversation_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcConversationView, g_object_unref)
static Block99Data* block99_data_ref (Block99Data* _data99_);
static void block99_data_unref (void * _userdata_);
VALA_EXTERN DcConversationView* dc_window_current_view (DcWindow* self);
VALA_EXTERN gdouble dc_conversation_view_get_scroll_value (DcConversationView* self);
VALA_EXTERN void dc_conversation_view_freeze_scroll_handler (DcConversationView* self,
                                                 guint ms);
static void __lambda77_ (Block99Data* _data99_);
VALA_EXTERN void dc_conversation_view_restore_scroll_value (DcConversationView* self,
                                                gdouble v);
VALA_EXTERN void dc_conversation_view_restore_scroll_value_deferred (DcConversationView* self,
                                                         gdouble v);
static void ___lambda77__gtk_popover_closed (GtkPopover* _sender,
                                      gpointer self);
VALA_EXTERN const gchar* dc_message_get_my_reactions (DcMessage* self);
static void dc_message_actions_send_reaction_data_free (gpointer _data);
static gboolean dc_message_actions_send_reaction_co (DcMessageActionsSendReactionData* _data_);
VALA_EXTERN void dc_rpc_client_send_reaction (DcRpcClient* self,
                                  gint msg_id,
                                  gchar** emojis,
                                  gint emojis_length1,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_send_reaction_finish (DcRpcClient* self,
                                         GAsyncResult* _res_,
                                         GError** error);
static void dc_message_actions_send_reaction_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
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 Block100Data* block100_data_ref (Block100Data* _data100_);
static void block100_data_unref (void * _userdata_);
VALA_EXTERN GtkEmojiChooser* dc_create_emoji_chooser (void);
static void __lambda73_ (Block100Data* _data100_,
                  const gchar* emoji);
static void ___lambda73__gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                                  const gchar* text,
                                                  gpointer self);
VALA_EXTERN void dc_unparent_on_close (GtkPopover* popover);
static void dc_message_actions_delete_message_data_free (gpointer _data);
static gboolean dc_message_actions_delete_message_co (DcMessageActionsDeleteMessageData* _data_);
VALA_EXTERN void dc_rpc_client_delete_messages_for_all (DcRpcClient* self,
                                            gint* msg_ids,
                                            gint msg_ids_length1,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_messages_for_all_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static void dc_message_actions_delete_message_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_messages (DcRpcClient* self,
                                    gint* msg_ids,
                                    gint msg_ids_length1,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_messages_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
VALA_EXTERN gint dc_find_message_index (GListModel* store,
                            gint msg_id);
static void dc_message_actions_start_editing_message (DcMessageActions* self,
                                               DcMessage* m);
VALA_EXTERN void dc_message_actions_start_editing_last (DcMessageActions* self);
VALA_EXTERN DcMessage* dc_find_last_editable_text_message (GListStore* store);
VALA_EXTERN const gchar* dc_message_get_text (DcMessage* self);
VALA_EXTERN void dc_compose_bar_begin_edit (DcComposeBar* self,
                                gint msg_id,
                                const gchar* current_text);
VALA_EXTERN gint dc_message_get_id (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_outgoing (DcMessage* self);
VALA_EXTERN const gchar* dc_message_get_sender_name (DcMessage* self);
VALA_EXTERN void dc_compose_bar_begin_reply (DcComposeBar* self,
                                 gint msg_id,
                                 const gchar* sender_name,
                                 const gchar* preview);
VALA_EXTERN void dc_message_actions_start_forwarding_many (DcMessageActions* self,
                                               gint* msg_ids,
                                               gint msg_ids_length1);
VALA_EXTERN GType dc_contact_picker_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcContactPickerDialog, g_object_unref)
VALA_EXTERN DcContactPickerDialog* dc_message_actions_forward_with_picker (DcWindow* window,
                                                               DcRpcClient* rpc,
                                                               gint* msg_ids,
                                                               gint msg_ids_length1);
static Block101Data* block101_data_ref (Block101Data* _data101_);
static void block101_data_unref (void * _userdata_);
static gint* _vala_array_dup21 (gint* self,
                         gssize length);
VALA_EXTERN GListStore* dc_window_get_chat_store (DcWindow* self);
VALA_EXTERN DcContactPickerDialog* dc_contact_picker_dialog_new (DcRpcClient* rpc,
                                                     GListStore* chat_store,
                                                     const gchar* title);
VALA_EXTERN DcContactPickerDialog* dc_contact_picker_dialog_construct (GType object_type,
                                                           DcRpcClient* rpc,
                                                           GListStore* chat_store,
                                                           const gchar* title);
static void __lambda82_ (Block101Data* _data101_,
                  gint chat_id);
static void dc_message_actions_forward_to_chat (DcWindow* window,
                                         DcRpcClient* rpc,
                                         gint* msg_ids,
                                         gint msg_ids_length1,
                                         gint chat_id,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static void dc_message_actions_forward_to_chat_finish (GAsyncResult* _res_);
static gint* _vala_array_dup22 (gint* self,
                         gssize length);
static void ___lambda82__dc_contact_picker_dialog_chat_picked (DcContactPickerDialog* _sender,
                                                        gint chat_id,
                                                        gpointer self);
static void __lambda86_ (Block101Data* _data101_,
                  gint contact_id,
                  const gchar* email);
static void dc_message_actions_forward_to_contact (DcWindow* window,
                                            DcRpcClient* rpc,
                                            gint* msg_ids,
                                            gint msg_ids_length1,
                                            gint contact_id,
                                            const gchar* email,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
static void dc_message_actions_forward_to_contact_finish (GAsyncResult* _res_);
static gint* _vala_array_dup23 (gint* self,
                         gssize length);
static void ___lambda86__dc_contact_picker_dialog_contact_picked (DcContactPickerDialog* _sender,
                                                           gint contact_id,
                                                           const gchar* email,
                                                           gpointer self);
static void dc_message_actions_forward_to_chat_data_free (gpointer _data);
static gboolean dc_message_actions_forward_to_chat_co (DcMessageActionsForwardToChatData* _data_);
VALA_EXTERN void dc_rpc_client_forward_messages (DcRpcClient* self,
                                     gint* msg_ids,
                                     gint msg_ids_length1,
                                     gint chat_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_forward_messages_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static void dc_message_actions_forward_to_chat_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
VALA_EXTERN void dc_window_request_reload_chats (DcWindow* self);
VALA_EXTERN void dc_window_request_chat_messages_reload (DcWindow* self,
                                             gint chat_id);
static void dc_message_actions_forward_to_contact_data_free (gpointer _data);
static gboolean dc_message_actions_forward_to_contact_co (DcMessageActionsForwardToContactData* _data_);
VALA_EXTERN void dc_rpc_client_get_or_create_contact (DcRpcClient* self,
                                          const gchar* email,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_or_create_contact_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static void dc_message_actions_forward_to_contact_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_get_or_create_chat_by_contact (DcRpcClient* self,
                                                  gint contact_id,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_or_create_chat_by_contact_finish (DcRpcClient* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static void dc_message_actions_edit_message_data_free (gpointer _data);
VALA_EXTERN void dc_message_actions_edit_message (DcMessageActions* self,
                                      gint msg_id,
                                      const gchar* new_text,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN void dc_message_actions_edit_message_finish (DcMessageActions* self,
                                             GAsyncResult* _res_);
static gboolean dc_message_actions_edit_message_co (DcMessageActionsEditMessageData* _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_message_actions_edit_message_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void dc_message_actions_update_row_data_free (gpointer _data);
static gboolean dc_message_actions_update_row_co (DcMessageActionsUpdateRowData* _data_);
VALA_EXTERN void dc_rpc_client_fetch_message (DcRpcClient* self,
                                  gint msg_id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN DcMessage* dc_rpc_client_fetch_message_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static void dc_message_actions_update_row_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
VALA_EXTERN void dc_conversation_view_replace_message (DcConversationView* self,
                                           gint msg_id,
                                           DcMessage* new_msg);
VALA_EXTERN void dc_message_actions_handle_double_click (DcMessageActions* self,
                                             gint msg_id,
                                             gboolean is_outgoing,
                                             gdouble x,
                                             gdouble y,
                                             GtkWidget* parent);
static Block102Data* block102_data_ref (Block102Data* _data102_);
static void block102_data_unref (void * _userdata_);
VALA_EXTERN gint dc_settings_manager_get_double_click_action (DcSettingsManager* self);
VALA_EXTERN void dc_message_actions_open_sender_profile (DcMessageActions* self,
                                             gint msg_id,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void dc_message_actions_open_sender_profile_finish (DcMessageActions* self,
                                                    GAsyncResult* _res_);
static gboolean ___lambda119_ (Block102Data* _data102_);
static gboolean ____lambda119__gsource_func (gpointer self);
VALA_EXTERN void dc_compose_bar_grab_entry_focus (DcComposeBar* self);
VALA_EXTERN GType dc_message_details_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessageDetailsDialog, g_object_unref)
VALA_EXTERN DcMessageDetailsDialog* dc_message_details_dialog_new (DcWindow* window,
                                                       DcRpcClient* rpc,
                                                       DcMessageActions* actions,
                                                       DcMessage* msg,
                                                       DcMentionRoster* reaction_roster);
VALA_EXTERN DcMessageDetailsDialog* dc_message_details_dialog_construct (GType object_type,
                                                             DcWindow* window,
                                                             DcRpcClient* rpc,
                                                             DcMessageActions* actions,
                                                             DcMessage* msg,
                                                             DcMentionRoster* reaction_roster);
static void dc_message_actions_open_sender_chat_data_free (gpointer _data);
VALA_EXTERN void dc_message_actions_open_sender_chat (DcMessageActions* self,
                                          gint msg_id,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN void dc_message_actions_open_sender_chat_finish (DcMessageActions* self,
                                                 GAsyncResult* _res_);
static gboolean dc_message_actions_open_sender_chat_co (DcMessageActionsOpenSenderChatData* _data_);
VALA_EXTERN gint dc_message_get_sender_contact_id (DcMessage* self);
VALA_EXTERN const gchar* dc_message_get_sender_address (DcMessage* self);
VALA_EXTERN const gchar* dc_rpc_client_get_self_email (DcRpcClient* self);
static void dc_message_actions_open_sender_chat_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
VALA_EXTERN gboolean dc_window_select_chat_by_id (DcWindow* self,
                                      gint chat_id);
static void dc_message_actions_open_sender_profile_data_free (gpointer _data);
static gboolean dc_message_actions_open_sender_profile_co (DcMessageActionsOpenSenderProfileData* _data_);
VALA_EXTERN void dc_rpc_client_lookup_contact (DcRpcClient* self,
                                   const gchar* email,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_lookup_contact_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static void dc_message_actions_open_sender_profile_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void dc_message_actions_finalize (GObject * obj);
static GType dc_message_actions_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 gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dc_message_actions_get_instance_private (DcMessageActions* self)
{
	return G_STRUCT_MEMBER_P (self, DcMessageActions_private_offset);
}

DcMessageActions*
dc_message_actions_construct (GType object_type,
                              DcWindow* window,
                              DcRpcClient* rpc,
                              GListStore* message_store,
                              DcPinnedMessagesManager* pinned,
                              DcComposeBar* compose_bar,
                              DcSettingsManager* settings)
{
	DcMessageActions * self = NULL;
	g_return_val_if_fail (window != NULL, NULL);
	g_return_val_if_fail (rpc != NULL, NULL);
	g_return_val_if_fail (message_store != NULL, NULL);
	g_return_val_if_fail (pinned != NULL, NULL);
	g_return_val_if_fail (compose_bar != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	self = (DcMessageActions*) g_object_new (object_type, NULL);
	self->priv->window = window;
	self->priv->rpc = rpc;
	self->priv->message_store = message_store;
	self->priv->pinned = pinned;
	self->priv->compose_bar = compose_bar;
	self->priv->settings = settings;
	return self;
}

DcMessageActions*
dc_message_actions_new (DcWindow* window,
                        DcRpcClient* rpc,
                        GListStore* message_store,
                        DcPinnedMessagesManager* pinned,
                        DcComposeBar* compose_bar,
                        DcSettingsManager* settings)
{
	return dc_message_actions_construct (DC_TYPE_MESSAGE_ACTIONS, window, rpc, message_store, pinned, compose_bar, settings);
}

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

void
dc_message_actions_set_reaction_roster (DcMessageActions* self,
                                        DcMentionRoster* roster)
{
	DcMentionRoster* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (roster);
	_g_object_unref0 (self->priv->reaction_roster);
	self->priv->reaction_roster = _tmp0_;
}

static Block93Data*
block93_data_ref (Block93Data* _data93_)
{
	g_atomic_int_inc (&_data93_->_ref_count_);
	return _data93_;
}

static void
block93_data_unref (void * _userdata_)
{
	Block93Data* _data93_;
	_data93_ = (Block93Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data93_->_ref_count_)) {
		DcMessageActions* self;
		self = _data93_->self;
		_g_object_unref0 (self);
		g_slice_free (Block93Data, _data93_);
	}
}

static void
__lambda80_ (Block93Data* _data93_)
{
	DcMessageActions* self;
	self = _data93_->self;
	dc_message_actions_start_replying (self, _data93_->msg_id);
}

static void
___lambda80__dc_popover_button_selected (DcPopoverButton* _sender,
                                         gpointer self)
{
	__lambda80_ (self);
}

static void
__lambda81_ (Block93Data* _data93_)
{
	DcMessageActions* self;
	self = _data93_->self;
	dc_message_actions_start_forwarding (self, _data93_->msg_id);
}

static void
___lambda81__dc_popover_button_selected (DcPopoverButton* _sender,
                                         gpointer self)
{
	__lambda81_ (self);
}

static void
__lambda87_ (Block93Data* _data93_)
{
	DcMessageActions* self;
	DcPinnedMessagesManager* _tmp0_;
	self = _data93_->self;
	_tmp0_ = self->priv->pinned;
	dc_pinned_messages_manager_toggle_pin (_tmp0_, _data93_->msg_id, NULL, NULL);
}

static void
___lambda87__dc_popover_button_selected (DcPopoverButton* _sender,
                                         gpointer self)
{
	__lambda87_ (self);
}

static void
___lambda88_ (Block93Data* _data93_)
{
	DcMessageActions* self;
	self = _data93_->self;
	dc_message_actions_start_editing (self, _data93_->msg_id);
}

static void
____lambda88__dc_popover_button_selected (DcPopoverButton* _sender,
                                          gpointer self)
{
	___lambda88_ (self);
}

static void
__lambda89_ (Block93Data* _data93_)
{
	DcMessageActions* self;
	self = _data93_->self;
	g_signal_emit (self, dc_message_actions_signals[DC_MESSAGE_ACTIONS_SELECT_REQUESTED_SIGNAL], 0, _data93_->msg_id);
}

static void
___lambda89__dc_popover_button_selected (DcPopoverButton* _sender,
                                         gpointer self)
{
	__lambda89_ (self);
}

static void
__lambda90_ (Block93Data* _data93_)
{
	DcMessageActions* self;
	self = _data93_->self;
	dc_message_actions_show_details (self, _data93_->msg_id);
}

static void
___lambda90__dc_popover_button_selected (DcPopoverButton* _sender,
                                         gpointer self)
{
	__lambda90_ (self);
}

static Block94Data*
block94_data_ref (Block94Data* _data94_)
{
	g_atomic_int_inc (&_data94_->_ref_count_);
	return _data94_;
}

static void
block94_data_unref (void * _userdata_)
{
	Block94Data* _data94_;
	_data94_ = (Block94Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data94_->_ref_count_)) {
		DcMessageActions* self;
		self = _data94_->_data93_->self;
		_g_free0 (_data94_->fname);
		_g_free0 (_data94_->fpath);
		block93_data_unref (_data94_->_data93_);
		_data94_->_data93_ = NULL;
		g_slice_free (Block94Data, _data94_);
	}
}

static void
___lambda102_ (Block94Data* _data94_)
{
	Block93Data* _data93_;
	DcMessageActions* self;
	DcWindow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data93_ = _data94_->_data93_;
	self = _data93_->self;
	_tmp0_ = self->priv->window;
	_tmp1_ = _data94_->fpath;
	_tmp2_ = _data94_->fname;
	dc_window_save_attachment (_tmp0_, _tmp1_, _tmp2_, NULL, NULL);
}

static void
____lambda102__dc_popover_button_selected (DcPopoverButton* _sender,
                                           gpointer self)
{
	___lambda102_ (self);
}

static Block95Data*
block95_data_ref (Block95Data* _data95_)
{
	g_atomic_int_inc (&_data95_->_ref_count_);
	return _data95_;
}

static void
block95_data_unref (void * _userdata_)
{
	Block95Data* _data95_;
	_data95_ = (Block95Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data95_->_ref_count_)) {
		DcMessageActions* self;
		self = _data95_->_data93_->self;
		_g_free0 (_data95_->apath);
		block93_data_unref (_data95_->_data93_);
		_data95_->_data93_ = NULL;
		g_slice_free (Block95Data, _data95_);
	}
}

static void
___lambda103_ (Block95Data* _data95_)
{
	Block93Data* _data93_;
	DcMessageActions* self;
	DcTranscriber* _tmp0_;
	DcTranscriber* _tmp1_;
	const gchar* _tmp2_;
	_data93_ = _data95_->_data93_;
	self = _data93_->self;
	_tmp0_ = dc_transcriber_shared ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _data95_->apath;
	dc_transcriber_transcribe (_tmp1_, _tmp2_);
	_g_object_unref0 (_tmp1_);
}

static void
____lambda103__dc_popover_button_selected (DcPopoverButton* _sender,
                                           gpointer self)
{
	___lambda103_ (self);
}

static Block96Data*
block96_data_ref (Block96Data* _data96_)
{
	g_atomic_int_inc (&_data96_->_ref_count_);
	return _data96_;
}

static void
block96_data_unref (void * _userdata_)
{
	Block96Data* _data96_;
	_data96_ = (Block96Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data96_->_ref_count_)) {
		DcMessageActions* self;
		self = _data96_->_data93_->self;
		_g_free0 (_data96_->spath);
		block93_data_unref (_data96_->_data93_);
		_data96_->_data93_ = NULL;
		g_slice_free (Block96Data, _data96_);
	}
}

static void
___lambda104_ (Block96Data* _data96_)
{
	Block93Data* _data93_;
	DcMessageActions* self;
	DcWindow* _tmp0_;
	const gchar* _tmp1_;
	_data93_ = _data96_->_data93_;
	self = _data93_->self;
	_tmp0_ = self->priv->window;
	_tmp1_ = _data96_->spath;
	dc_sticker_manager_dialog_prompt_add_sticker (_tmp0_, _tmp1_);
}

static void
____lambda104__dc_popover_button_selected (DcPopoverButton* _sender,
                                           gpointer self)
{
	___lambda104_ (self);
}

static void
__lambda118_ (Block93Data* _data93_)
{
	DcMessageActions* self;
	self = _data93_->self;
	dc_message_actions_confirm_delete_message (self, _data93_->msg_id, _data93_->is_outgoing, NULL, NULL);
}

static void
___lambda118__dc_popover_button_selected (DcPopoverButton* _sender,
                                          gpointer self)
{
	__lambda118_ (self);
}

void
dc_message_actions_show_context_menu (DcMessageActions* self,
                                      gint msg_id,
                                      gboolean is_outgoing,
                                      gdouble x,
                                      gdouble y,
                                      GtkWidget* parent)
{
	Block93Data* _data93_;
	GtkBox* vbox = NULL;
	GtkPopover* popover = NULL;
	GtkBox* _tmp0_ = NULL;
	GtkPopover* _tmp1_;
	GtkBox* _tmp2_;
	GtkPopover* _tmp3_;
	DcMessage* msg = NULL;
	GListStore* _tmp4_;
	DcMessage* _tmp5_;
	GtkBox* _tmp6_;
	GtkSeparator* _tmp7_;
	GtkSeparator* _tmp8_;
	DcPopoverButton* reply_btn = NULL;
	GtkPopover* _tmp9_;
	DcPopoverButton* _tmp10_;
	DcPopoverButton* _tmp11_;
	GtkBox* _tmp12_;
	DcPopoverButton* _tmp13_;
	DcPopoverButton* forward_btn = NULL;
	GtkPopover* _tmp14_;
	DcPopoverButton* _tmp15_;
	DcPopoverButton* _tmp16_;
	GtkBox* _tmp17_;
	DcPopoverButton* _tmp18_;
	gboolean _tmp19_ = FALSE;
	DcMessage* _tmp20_;
	gboolean msg_is_pinned = FALSE;
	const gchar* _tmp25_ = NULL;
	DcPopoverButton* pin_btn = NULL;
	GtkPopover* _tmp26_;
	DcPopoverButton* _tmp27_;
	DcPopoverButton* _tmp28_;
	GtkBox* _tmp29_;
	DcPopoverButton* _tmp30_;
	gboolean _tmp31_ = FALSE;
	DcMessage* _tmp32_;
	DcPopoverButton* select_btn = NULL;
	GtkPopover* _tmp41_;
	DcPopoverButton* _tmp42_;
	DcPopoverButton* _tmp43_;
	GtkBox* _tmp44_;
	DcPopoverButton* _tmp45_;
	DcPopoverButton* details_btn = NULL;
	GtkPopover* _tmp46_;
	DcPopoverButton* _tmp47_;
	DcPopoverButton* _tmp48_;
	GtkBox* _tmp49_;
	DcPopoverButton* _tmp50_;
	gboolean _tmp51_ = FALSE;
	gboolean _tmp52_ = FALSE;
	DcMessage* _tmp53_;
	gboolean _tmp75_ = FALSE;
	gboolean _tmp76_ = FALSE;
	gboolean _tmp77_ = FALSE;
	DcMessage* _tmp78_;
	gboolean _tmp92_ = FALSE;
	gboolean _tmp93_ = FALSE;
	DcMessage* _tmp94_;
	GtkBox* _tmp108_;
	GtkSeparator* _tmp109_;
	GtkSeparator* _tmp110_;
	DcPopoverButton* delete_btn = NULL;
	GtkPopover* _tmp111_;
	DcPopoverButton* _tmp112_;
	GtkBox* _tmp113_;
	GtkPopover* _tmp114_;
	GtkPopover* _tmp115_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (parent != NULL);
	_data93_ = g_slice_new0 (Block93Data);
	_data93_->_ref_count_ = 1;
	_data93_->self = g_object_ref (self);
	_data93_->msg_id = msg_id;
	_data93_->is_outgoing = is_outgoing;
	_tmp1_ = dc_popover_menu (parent, x, y, &_tmp0_);
	_g_object_unref0 (vbox);
	vbox = _tmp0_;
	popover = _tmp1_;
	_tmp2_ = vbox;
	_tmp3_ = popover;
	dc_message_actions_append_emoji_rows (self, _tmp2_, _tmp3_, _data93_->msg_id, parent, x, y);
	_tmp4_ = self->priv->message_store;
	_tmp5_ = dc_find_message ((GListModel*) _tmp4_, _data93_->msg_id);
	msg = _tmp5_;
	_tmp6_ = vbox;
	_tmp7_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	gtk_box_append (_tmp6_, (GtkWidget*) _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = popover;
	_tmp10_ = dc_popover_button_new (_tmp9_, "Reply", FALSE, FALSE);
	g_object_ref_sink (_tmp10_);
	reply_btn = _tmp10_;
	_tmp11_ = reply_btn;
	g_signal_connect_data (_tmp11_, "selected", (GCallback) ___lambda80__dc_popover_button_selected, block93_data_ref (_data93_), (GClosureNotify) block93_data_unref, 0);
	_tmp12_ = vbox;
	_tmp13_ = reply_btn;
	gtk_box_append (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = popover;
	_tmp15_ = dc_popover_button_new (_tmp14_, "Forward\u2026", FALSE, FALSE);
	g_object_ref_sink (_tmp15_);
	forward_btn = _tmp15_;
	_tmp16_ = forward_btn;
	g_signal_connect_data (_tmp16_, "selected", (GCallback) ___lambda81__dc_popover_button_selected, block93_data_ref (_data93_), (GClosureNotify) block93_data_unref, 0);
	_tmp17_ = vbox;
	_tmp18_ = forward_btn;
	gtk_box_append (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp20_ = msg;
	if (_tmp20_ != NULL) {
		DcMessage* _tmp21_;
		gboolean _tmp22_;
		gboolean _tmp23_;
		_tmp21_ = msg;
		_tmp22_ = dc_message_get_is_pinned (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp19_ = _tmp23_;
	} else {
		DcPinnedMessagesManager* _tmp24_;
		_tmp24_ = self->priv->pinned;
		_tmp19_ = dc_pinned_messages_manager_is_pinned (_tmp24_, _data93_->msg_id);
	}
	msg_is_pinned = _tmp19_;
	if (msg_is_pinned) {
		_tmp25_ = "Unpin";
	} else {
		_tmp25_ = "Pin";
	}
	_tmp26_ = popover;
	_tmp27_ = dc_popover_button_new (_tmp26_, _tmp25_, FALSE, FALSE);
	g_object_ref_sink (_tmp27_);
	pin_btn = _tmp27_;
	_tmp28_ = pin_btn;
	g_signal_connect_data (_tmp28_, "selected", (GCallback) ___lambda87__dc_popover_button_selected, block93_data_ref (_data93_), (GClosureNotify) block93_data_unref, 0);
	_tmp29_ = vbox;
	_tmp30_ = pin_btn;
	gtk_box_append (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp32_ = msg;
	if (_tmp32_ != NULL) {
		DcMessage* _tmp33_;
		gboolean _tmp34_;
		gboolean _tmp35_;
		_tmp33_ = msg;
		_tmp34_ = dc_message_get_can_edit_text (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp31_ = _tmp35_;
	} else {
		_tmp31_ = FALSE;
	}
	if (_tmp31_) {
		DcPopoverButton* edit_btn = NULL;
		GtkPopover* _tmp36_;
		DcPopoverButton* _tmp37_;
		DcPopoverButton* _tmp38_;
		GtkBox* _tmp39_;
		DcPopoverButton* _tmp40_;
		_tmp36_ = popover;
		_tmp37_ = dc_popover_button_new (_tmp36_, "Edit", FALSE, FALSE);
		g_object_ref_sink (_tmp37_);
		edit_btn = _tmp37_;
		_tmp38_ = edit_btn;
		g_signal_connect_data (_tmp38_, "selected", (GCallback) ____lambda88__dc_popover_button_selected, block93_data_ref (_data93_), (GClosureNotify) block93_data_unref, 0);
		_tmp39_ = vbox;
		_tmp40_ = edit_btn;
		gtk_box_append (_tmp39_, (GtkWidget*) _tmp40_);
		_g_object_unref0 (edit_btn);
	}
	_tmp41_ = popover;
	_tmp42_ = dc_popover_button_new (_tmp41_, "Select...", FALSE, FALSE);
	g_object_ref_sink (_tmp42_);
	select_btn = _tmp42_;
	_tmp43_ = select_btn;
	g_signal_connect_data (_tmp43_, "selected", (GCallback) ___lambda89__dc_popover_button_selected, block93_data_ref (_data93_), (GClosureNotify) block93_data_unref, 0);
	_tmp44_ = vbox;
	_tmp45_ = select_btn;
	gtk_box_append (_tmp44_, (GtkWidget*) _tmp45_);
	_tmp46_ = popover;
	_tmp47_ = dc_popover_button_new (_tmp46_, "Details...", FALSE, FALSE);
	g_object_ref_sink (_tmp47_);
	details_btn = _tmp47_;
	_tmp48_ = details_btn;
	g_signal_connect_data (_tmp48_, "selected", (GCallback) ___lambda90__dc_popover_button_selected, block93_data_ref (_data93_), (GClosureNotify) block93_data_unref, 0);
	_tmp49_ = vbox;
	_tmp50_ = details_btn;
	gtk_box_append (_tmp49_, (GtkWidget*) _tmp50_);
	_tmp53_ = msg;
	if (_tmp53_ != NULL) {
		DcMessage* _tmp54_;
		const gchar* _tmp55_;
		const gchar* _tmp56_;
		_tmp54_ = msg;
		_tmp55_ = dc_message_get_file_path (_tmp54_);
		_tmp56_ = _tmp55_;
		_tmp52_ = _tmp56_ != NULL;
	} else {
		_tmp52_ = FALSE;
	}
	if (_tmp52_) {
		DcMessage* _tmp57_;
		const gchar* _tmp58_;
		const gchar* _tmp59_;
		gint _tmp60_;
		gint _tmp61_;
		_tmp57_ = msg;
		_tmp58_ = dc_message_get_file_path (_tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = strlen (_tmp59_);
		_tmp61_ = _tmp60_;
		_tmp51_ = _tmp61_ > 0;
	} else {
		_tmp51_ = FALSE;
	}
	if (_tmp51_) {
		Block94Data* _data94_;
		DcMessage* _tmp62_;
		const gchar* _tmp63_;
		const gchar* _tmp64_;
		gchar* _tmp65_;
		DcMessage* _tmp66_;
		const gchar* _tmp67_;
		const gchar* _tmp68_;
		gchar* _tmp69_;
		DcPopoverButton* save_btn = NULL;
		GtkPopover* _tmp70_;
		DcPopoverButton* _tmp71_;
		DcPopoverButton* _tmp72_;
		GtkBox* _tmp73_;
		DcPopoverButton* _tmp74_;
		_data94_ = g_slice_new0 (Block94Data);
		_data94_->_ref_count_ = 1;
		_data94_->_data93_ = block93_data_ref (_data93_);
		_tmp62_ = msg;
		_tmp63_ = dc_message_get_file_path (_tmp62_);
		_tmp64_ = _tmp63_;
		_tmp65_ = g_strdup (_tmp64_);
		_data94_->fpath = _tmp65_;
		_tmp66_ = msg;
		_tmp67_ = dc_message_get_file_name (_tmp66_);
		_tmp68_ = _tmp67_;
		_tmp69_ = g_strdup (_tmp68_);
		_data94_->fname = _tmp69_;
		_tmp70_ = popover;
		_tmp71_ = dc_popover_button_new (_tmp70_, "Save file", FALSE, FALSE);
		g_object_ref_sink (_tmp71_);
		save_btn = _tmp71_;
		_tmp72_ = save_btn;
		g_signal_connect_data (_tmp72_, "selected", (GCallback) ____lambda102__dc_popover_button_selected, block94_data_ref (_data94_), (GClosureNotify) block94_data_unref, 0);
		_tmp73_ = vbox;
		_tmp74_ = save_btn;
		gtk_box_append (_tmp73_, (GtkWidget*) _tmp74_);
		_g_object_unref0 (save_btn);
		block94_data_unref (_data94_);
		_data94_ = NULL;
	}
	_tmp78_ = msg;
	if (_tmp78_ != NULL) {
		DcMessage* _tmp79_;
		_tmp79_ = msg;
		_tmp77_ = dc_message_is_audio_file (_tmp79_);
	} else {
		_tmp77_ = FALSE;
	}
	if (_tmp77_) {
		DcMessage* _tmp80_;
		gboolean _tmp81_;
		gboolean _tmp82_;
		_tmp80_ = msg;
		_tmp81_ = dc_message_get_has_local_file (_tmp80_);
		_tmp82_ = _tmp81_;
		_tmp76_ = _tmp82_;
	} else {
		_tmp76_ = FALSE;
	}
	if (_tmp76_) {
		_tmp75_ = dc_transcriber_available ();
	} else {
		_tmp75_ = FALSE;
	}
	if (_tmp75_) {
		Block95Data* _data95_;
		DcMessage* _tmp83_;
		const gchar* _tmp84_;
		const gchar* _tmp85_;
		gchar* _tmp86_;
		DcPopoverButton* transcribe_btn = NULL;
		GtkPopover* _tmp87_;
		DcPopoverButton* _tmp88_;
		DcPopoverButton* _tmp89_;
		GtkBox* _tmp90_;
		DcPopoverButton* _tmp91_;
		_data95_ = g_slice_new0 (Block95Data);
		_data95_->_ref_count_ = 1;
		_data95_->_data93_ = block93_data_ref (_data93_);
		_tmp83_ = msg;
		_tmp84_ = dc_message_get_file_path (_tmp83_);
		_tmp85_ = _tmp84_;
		_tmp86_ = g_strdup (_tmp85_);
		_data95_->apath = _tmp86_;
		_tmp87_ = popover;
		_tmp88_ = dc_popover_button_new (_tmp87_, "Transcribe", FALSE, FALSE);
		g_object_ref_sink (_tmp88_);
		transcribe_btn = _tmp88_;
		_tmp89_ = transcribe_btn;
		g_signal_connect_data (_tmp89_, "selected", (GCallback) ____lambda103__dc_popover_button_selected, block95_data_ref (_data95_), (GClosureNotify) block95_data_unref, 0);
		_tmp90_ = vbox;
		_tmp91_ = transcribe_btn;
		gtk_box_append (_tmp90_, (GtkWidget*) _tmp91_);
		_g_object_unref0 (transcribe_btn);
		block95_data_unref (_data95_);
		_data95_ = NULL;
	}
	_tmp94_ = msg;
	if (_tmp94_ != NULL) {
		DcMessage* _tmp95_;
		_tmp95_ = msg;
		_tmp93_ = dc_message_is_sticker_file (_tmp95_);
	} else {
		_tmp93_ = FALSE;
	}
	if (_tmp93_) {
		DcMessage* _tmp96_;
		gboolean _tmp97_;
		gboolean _tmp98_;
		_tmp96_ = msg;
		_tmp97_ = dc_message_get_has_local_file (_tmp96_);
		_tmp98_ = _tmp97_;
		_tmp92_ = _tmp98_;
	} else {
		_tmp92_ = FALSE;
	}
	if (_tmp92_) {
		Block96Data* _data96_;
		DcMessage* _tmp99_;
		const gchar* _tmp100_;
		const gchar* _tmp101_;
		gchar* _tmp102_;
		DcPopoverButton* sticker_btn = NULL;
		GtkPopover* _tmp103_;
		DcPopoverButton* _tmp104_;
		DcPopoverButton* _tmp105_;
		GtkBox* _tmp106_;
		DcPopoverButton* _tmp107_;
		_data96_ = g_slice_new0 (Block96Data);
		_data96_->_ref_count_ = 1;
		_data96_->_data93_ = block93_data_ref (_data93_);
		_tmp99_ = msg;
		_tmp100_ = dc_message_get_file_path (_tmp99_);
		_tmp101_ = _tmp100_;
		_tmp102_ = g_strdup (_tmp101_);
		_data96_->spath = _tmp102_;
		_tmp103_ = popover;
		_tmp104_ = dc_popover_button_new (_tmp103_, "Add Sticker…", FALSE, FALSE);
		g_object_ref_sink (_tmp104_);
		sticker_btn = _tmp104_;
		_tmp105_ = sticker_btn;
		g_signal_connect_data (_tmp105_, "selected", (GCallback) ____lambda104__dc_popover_button_selected, block96_data_ref (_data96_), (GClosureNotify) block96_data_unref, 0);
		_tmp106_ = vbox;
		_tmp107_ = sticker_btn;
		gtk_box_append (_tmp106_, (GtkWidget*) _tmp107_);
		_g_object_unref0 (sticker_btn);
		block96_data_unref (_data96_);
		_data96_ = NULL;
	}
	_tmp108_ = vbox;
	_tmp109_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp109_);
	_tmp110_ = _tmp109_;
	gtk_box_append (_tmp108_, (GtkWidget*) _tmp110_);
	_g_object_unref0 (_tmp110_);
	_tmp111_ = popover;
	_tmp112_ = dc_popover_button_new (_tmp111_, "Delete…", TRUE, FALSE);
	g_object_ref_sink (_tmp112_);
	delete_btn = _tmp112_;
	g_signal_connect_data (delete_btn, "selected", (GCallback) ___lambda118__dc_popover_button_selected, block93_data_ref (_data93_), (GClosureNotify) block93_data_unref, 0);
	_tmp113_ = vbox;
	gtk_box_append (_tmp113_, (GtkWidget*) delete_btn);
	_tmp114_ = popover;
	dc_message_actions_preserve_scroll_until_closed (self, _tmp114_);
	_tmp115_ = popover;
	gtk_popover_popup (_tmp115_);
	_g_object_unref0 (delete_btn);
	_g_object_unref0 (details_btn);
	_g_object_unref0 (select_btn);
	_g_object_unref0 (pin_btn);
	_g_object_unref0 (forward_btn);
	_g_object_unref0 (reply_btn);
	_g_object_unref0 (msg);
	_g_object_unref0 (popover);
	_g_object_unref0 (vbox);
	block93_data_unref (_data93_);
	_data93_ = NULL;
}

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

static void
dc_message_actions_confirm_delete_message (DcMessageActions* self,
                                           gint msg_id,
                                           gboolean is_outgoing,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DcMessageActionsConfirmDeleteMessageData* _data_;
	DcMessageActions* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcMessageActionsConfirmDeleteMessageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_confirm_delete_message_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_data_->is_outgoing = is_outgoing;
	dc_message_actions_confirm_delete_message_co (_data_);
}

static void
dc_message_actions_confirm_delete_message_finish (DcMessageActions* self,
                                                  GAsyncResult* _res_)
{
	DcMessageActionsConfirmDeleteMessageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_confirm_delete_message_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	DcMessageActionsConfirmDeleteMessageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_confirm_delete_message_co (_data_);
}

static gboolean
dc_message_actions_confirm_delete_message_co (DcMessageActionsConfirmDeleteMessageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->is_outgoing) {
		_data_->_tmp0_ = "Delete this message from your device only, or from all participants? T" \
"his cannot be undone.";
	} else {
		_data_->_tmp0_ = "Delete this message from your device? This cannot be undone.";
	}
	_data_->_tmp1_ = g_strdup (_data_->_tmp0_);
	_data_->body = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->self->priv->window;
	_data_->_tmp3_ = _data_->body;
	_data_->_state_ = 1;
	dc_confirm_delete_options ((GtkWidget*) _data_->_tmp2_, "Delete Message?", _data_->_tmp3_, _data_->is_outgoing, dc_message_actions_confirm_delete_message_ready, _data_);
	return FALSE;
	_state_1:
	_data_->choice = dc_confirm_delete_options_finish (_data_->_res_);
	if (_data_->choice == DC_DELETE_CHOICE_FOR_ME) {
		dc_message_actions_delete_message (_data_->self, _data_->msg_id, FALSE, NULL, NULL);
	} else {
		if (_data_->choice == DC_DELETE_CHOICE_FOR_EVERYONE) {
			dc_message_actions_delete_message (_data_->self, _data_->msg_id, TRUE, NULL, NULL);
		}
	}
	_g_free0 (_data_->body);
	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;
}

/** Two rows of quick reaction emoji, plus "…" opening the full
            chooser when available. Shared by the context menu and the
            Workspace hover-action popover. */
static Block97Data*
block97_data_ref (Block97Data* _data97_)
{
	g_atomic_int_inc (&_data97_->_ref_count_);
	return _data97_;
}

static void
block97_data_unref (void * _userdata_)
{
	Block97Data* _data97_;
	_data97_ = (Block97Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data97_->_ref_count_)) {
		DcMessageActions* self;
		self = _data97_->self;
		_g_object_unref0 (_data97_->parent);
		_g_object_unref0 (self);
		g_slice_free (Block97Data, _data97_);
	}
}

static void
_vala_array_add61 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static Block98Data*
block98_data_ref (Block98Data* _data98_)
{
	g_atomic_int_inc (&_data98_->_ref_count_);
	return _data98_;
}

static void
block98_data_unref (void * _userdata_)
{
	Block98Data* _data98_;
	_data98_ = (Block98Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data98_->_ref_count_)) {
		DcMessageActions* self;
		self = _data98_->_data97_->self;
		_g_free0 (_data98_->emoji);
		block97_data_unref (_data98_->_data97_);
		_data98_->_data97_ = NULL;
		g_slice_free (Block98Data, _data98_);
	}
}

static void
______lambda72_ (Block98Data* _data98_)
{
	Block97Data* _data97_;
	DcMessageActions* self;
	_data97_ = _data98_->_data97_;
	self = _data97_->self;
	dc_message_actions_show_emoji_picker (self, _data97_->msg_id, _data97_->parent, _data97_->x, _data97_->y);
}

static void
_______lambda72__dc_popover_button_selected (DcPopoverButton* _sender,
                                             gpointer self)
{
	______lambda72_ (self);
}

static void
______lambda79_ (Block98Data* _data98_)
{
	Block97Data* _data97_;
	DcMessageActions* self;
	const gchar* _tmp0_;
	_data97_ = _data98_->_data97_;
	self = _data97_->self;
	_tmp0_ = _data98_->emoji;
	dc_message_actions_send_reaction (self, _data97_->msg_id, _tmp0_, NULL, NULL);
}

static void
_______lambda79__dc_popover_button_selected (DcPopoverButton* _sender,
                                             gpointer self)
{
	______lambda79_ (self);
}

static void
dc_message_actions_append_emoji_rows (DcMessageActions* self,
                                      GtkBox* vbox,
                                      GtkPopover* popover,
                                      gint msg_id,
                                      GtkWidget* parent,
                                      gdouble x,
                                      gdouble y)
{
	Block97Data* _data97_;
	GtkWidget* _tmp0_;
	gchar** emojis = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar** _tmp8_;
	gint emojis_length1;
	gint _emojis_size_;
	DcMessage* msg = NULL;
	GListStore* _tmp10_;
	DcMessage* _tmp11_;
	GtkBox* emoji_row1 = NULL;
	GtkBox* _tmp12_;
	GtkBox* emoji_row2 = NULL;
	GtkBox* _tmp13_;
	GtkBox* _tmp33_;
	GtkBox* _tmp34_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (vbox != NULL);
	g_return_if_fail (popover != NULL);
	g_return_if_fail (parent != NULL);
	_data97_ = g_slice_new0 (Block97Data);
	_data97_->_ref_count_ = 1;
	_data97_->self = g_object_ref (self);
	_data97_->msg_id = msg_id;
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (_data97_->parent);
	_data97_->parent = _tmp0_;
	_data97_->x = x;
	_data97_->y = y;
	_tmp1_ = g_strdup ("\xf0\x9f\x91\x8d");
	_tmp2_ = g_strdup ("\xf0\x9f\x91\x8e");
	_tmp3_ = g_strdup ("\xe2\x9d\xa4\xef\xb8\x8f");
	_tmp4_ = g_strdup ("\xf0\x9f\x94\xa5");
	_tmp5_ = g_strdup ("\xf0\x9f\x98\x82");
	_tmp6_ = g_strdup ("\xf0\x9f\x98\xae");
	_tmp7_ = g_strdup ("\xf0\x9f\x98\xa2");
	_tmp8_ = g_new0 (gchar*, 7 + 1);
	_tmp8_[0] = _tmp1_;
	_tmp8_[1] = _tmp2_;
	_tmp8_[2] = _tmp3_;
	_tmp8_[3] = _tmp4_;
	_tmp8_[4] = _tmp5_;
	_tmp8_[5] = _tmp6_;
	_tmp8_[6] = _tmp7_;
	emojis = _tmp8_;
	emojis_length1 = 7;
	_emojis_size_ = emojis_length1;
	if (dc_gtk_emoji_chooser_available ()) {
		gchar* _tmp9_;
		_tmp9_ = g_strdup ("…");
		_vala_array_add61 (&emojis, &emojis_length1, &_emojis_size_, _tmp9_);
	}
	_tmp10_ = self->priv->message_store;
	_tmp11_ = dc_find_message ((GListModel*) _tmp10_, _data97_->msg_id);
	msg = _tmp11_;
	_tmp12_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
	g_object_ref_sink (_tmp12_);
	emoji_row1 = _tmp12_;
	_tmp13_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
	g_object_ref_sink (_tmp13_);
	emoji_row2 = _tmp13_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp14_ = FALSE;
			_tmp14_ = TRUE;
			while (TRUE) {
				Block98Data* _data98_;
				gchar** _tmp16_;
				gint _tmp16__length1;
				gchar** _tmp17_;
				gint _tmp17__length1;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				DcPopoverButton* btn = NULL;
				const gchar* _tmp20_;
				DcPopoverButton* _tmp21_;
				gboolean is_more = FALSE;
				const gchar* _tmp22_;
				_data98_ = g_slice_new0 (Block98Data);
				_data98_->_ref_count_ = 1;
				_data98_->_data97_ = block97_data_ref (_data97_);
				if (!_tmp14_) {
					gint _tmp15_;
					_tmp15_ = i;
					i = _tmp15_ + 1;
				}
				_tmp14_ = FALSE;
				_tmp16_ = emojis;
				_tmp16__length1 = emojis_length1;
				if (!(i < _tmp16__length1)) {
					block98_data_unref (_data98_);
					_data98_ = NULL;
					break;
				}
				_tmp17_ = emojis;
				_tmp17__length1 = emojis_length1;
				_tmp18_ = _tmp17_[i];
				_tmp19_ = g_strdup (_tmp18_);
				_data98_->emoji = _tmp19_;
				_tmp20_ = _data98_->emoji;
				_tmp21_ = dc_popover_button_new (popover, _tmp20_, FALSE, FALSE);
				g_object_ref_sink (_tmp21_);
				btn = _tmp21_;
				_tmp22_ = _data98_->emoji;
				is_more = g_strcmp0 (_tmp22_, "…") == 0;
				if (is_more) {
					DcPopoverButton* _tmp23_;
					DcPopoverButton* _tmp24_;
					_tmp23_ = btn;
					gtk_widget_set_tooltip_text ((GtkWidget*) _tmp23_, "More emojis…");
					_tmp24_ = btn;
					g_signal_connect_data (_tmp24_, "selected", (GCallback) _______lambda72__dc_popover_button_selected, block98_data_ref (_data98_), (GClosureNotify) block98_data_unref, 0);
				} else {
					DcMessage* _tmp25_;
					const gchar* _tmp26_;
					DcPopoverButton* _tmp28_;
					_tmp25_ = msg;
					_tmp26_ = _data98_->emoji;
					if (dc_message_actions_has_my_reaction (self, _tmp25_, _tmp26_)) {
						DcPopoverButton* _tmp27_;
						_tmp27_ = btn;
						gtk_widget_add_css_class ((GtkWidget*) _tmp27_, "suggested-action");
					}
					_tmp28_ = btn;
					g_signal_connect_data (_tmp28_, "selected", (GCallback) _______lambda79__dc_popover_button_selected, block98_data_ref (_data98_), (GClosureNotify) block98_data_unref, 0);
				}
				if (i < 4) {
					GtkBox* _tmp29_;
					DcPopoverButton* _tmp30_;
					_tmp29_ = emoji_row1;
					_tmp30_ = btn;
					gtk_box_append (_tmp29_, (GtkWidget*) _tmp30_);
				} else {
					GtkBox* _tmp31_;
					DcPopoverButton* _tmp32_;
					_tmp31_ = emoji_row2;
					_tmp32_ = btn;
					gtk_box_append (_tmp31_, (GtkWidget*) _tmp32_);
				}
				_g_object_unref0 (btn);
				block98_data_unref (_data98_);
				_data98_ = NULL;
			}
		}
	}
	_tmp33_ = emoji_row1;
	gtk_box_append (vbox, (GtkWidget*) _tmp33_);
	_tmp34_ = emoji_row2;
	gtk_box_append (vbox, (GtkWidget*) _tmp34_);
	_g_object_unref0 (emoji_row2);
	_g_object_unref0 (emoji_row1);
	_g_object_unref0 (msg);
	emojis = (_vala_array_free (emojis, emojis_length1, (GDestroyNotify) g_free), NULL);
	block97_data_unref (_data97_);
	_data97_ = NULL;
}

/** Standalone quick-reaction popover pointing at (x, y) in parent. */
void
dc_message_actions_show_reaction_menu (DcMessageActions* self,
                                       gint msg_id,
                                       GtkWidget* parent,
                                       gdouble x,
                                       gdouble y)
{
	GtkBox* vbox = NULL;
	GtkPopover* popover = NULL;
	GtkBox* _tmp0_ = NULL;
	GtkPopover* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (parent != NULL);
	_tmp1_ = dc_popover_menu (parent, x, y, &_tmp0_);
	_g_object_unref0 (vbox);
	vbox = _tmp0_;
	popover = _tmp1_;
	dc_message_actions_append_emoji_rows (self, vbox, popover, msg_id, parent, x, y);
	dc_message_actions_preserve_scroll_until_closed (self, popover);
	gtk_popover_popup (popover);
	_g_object_unref0 (popover);
	_g_object_unref0 (vbox);
}

static Block99Data*
block99_data_ref (Block99Data* _data99_)
{
	g_atomic_int_inc (&_data99_->_ref_count_);
	return _data99_;
}

static void
block99_data_unref (void * _userdata_)
{
	Block99Data* _data99_;
	_data99_ = (Block99Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data99_->_ref_count_)) {
		DcMessageActions* self;
		self = _data99_->self;
		_g_object_unref0 (_data99_->view);
		_g_object_unref0 (self);
		g_slice_free (Block99Data, _data99_);
	}
}

static void
__lambda77_ (Block99Data* _data99_)
{
	DcMessageActions* self;
	DcConversationView* _tmp0_;
	self = _data99_->self;
	_tmp0_ = _data99_->view;
	if (_tmp0_ != NULL) {
		DcConversationView* _tmp1_;
		DcConversationView* _tmp2_;
		_tmp1_ = _data99_->view;
		dc_conversation_view_restore_scroll_value (_tmp1_, _data99_->saved_scroll);
		_tmp2_ = _data99_->view;
		dc_conversation_view_restore_scroll_value_deferred (_tmp2_, _data99_->saved_scroll);
	}
}

static void
___lambda77__gtk_popover_closed (GtkPopover* _sender,
                                 gpointer self)
{
	__lambda77_ (self);
}

static void
dc_message_actions_preserve_scroll_until_closed (DcMessageActions* self,
                                                 GtkPopover* popover)
{
	Block99Data* _data99_;
	DcWindow* _tmp0_;
	DcConversationView* _tmp1_;
	gdouble _tmp2_ = 0.0;
	DcConversationView* _tmp3_;
	DcConversationView* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (popover != NULL);
	_data99_ = g_slice_new0 (Block99Data);
	_data99_->_ref_count_ = 1;
	_data99_->self = g_object_ref (self);
	_tmp0_ = self->priv->window;
	_tmp1_ = dc_window_current_view (_tmp0_);
	_data99_->view = _tmp1_;
	_tmp3_ = _data99_->view;
	if (_tmp3_ != NULL) {
		DcConversationView* _tmp4_;
		_tmp4_ = _data99_->view;
		_tmp2_ = dc_conversation_view_get_scroll_value (_tmp4_);
	} else {
		_tmp2_ = (gdouble) 0;
	}
	_data99_->saved_scroll = _tmp2_;
	_tmp5_ = _data99_->view;
	if (_tmp5_ != NULL) {
		DcConversationView* _tmp6_;
		_tmp6_ = _data99_->view;
		dc_conversation_view_freeze_scroll_handler (_tmp6_, (guint) 1500);
	}
	g_signal_connect_data (popover, "closed", (GCallback) ___lambda77__gtk_popover_closed, block99_data_ref (_data99_), (GClosureNotify) block99_data_unref, 0);
	block99_data_unref (_data99_);
	_data99_ = NULL;
}

static gboolean
dc_message_actions_has_my_reaction (DcMessageActions* self,
                                    DcMessage* msg,
                                    const gchar* emoji)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar** _tmp5_;
	gchar** _tmp6_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (emoji != NULL, FALSE);
	if (msg == NULL) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		_tmp1_ = dc_message_get_my_reactions (msg);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp3_ = dc_message_get_my_reactions (msg);
	_tmp4_ = _tmp3_;
	_tmp6_ = _tmp5_ = g_strsplit (_tmp4_, ",", 0);
	{
		gchar** me_collection = NULL;
		gint me_collection_length1 = 0;
		gint _me_collection_size_ = 0;
		gint me_it = 0;
		me_collection = _tmp6_;
		me_collection_length1 = _vala_array_length (_tmp5_);
		for (me_it = 0; me_it < me_collection_length1; me_it = me_it + 1) {
			gchar* _tmp7_;
			gchar* me = NULL;
			_tmp7_ = g_strdup (me_collection[me_it]);
			me = _tmp7_;
			{
				const gchar* _tmp8_;
				_tmp8_ = me;
				if (g_strcmp0 (_tmp8_, emoji) == 0) {
					result = TRUE;
					_g_free0 (me);
					me_collection = (_vala_array_free (me_collection, me_collection_length1, (GDestroyNotify) g_free), NULL);
					return result;
				}
				_g_free0 (me);
			}
		}
		me_collection = (_vala_array_free (me_collection, me_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = FALSE;
	return result;
}

static void
dc_message_actions_send_reaction_data_free (gpointer _data)
{
	DcMessageActionsSendReactionData* _data_;
	_data_ = _data;
	_g_free0 (_data_->emoji);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcMessageActionsSendReactionData, _data_);
}

void
dc_message_actions_send_reaction (DcMessageActions* self,
                                  gint msg_id,
                                  const gchar* emoji,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	DcMessageActionsSendReactionData* _data_;
	DcMessageActions* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (emoji != NULL);
	_data_ = g_slice_new0 (DcMessageActionsSendReactionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_send_reaction_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_tmp1_ = g_strdup (emoji);
	_g_free0 (_data_->emoji);
	_data_->emoji = _tmp1_;
	dc_message_actions_send_reaction_co (_data_);
}

void
dc_message_actions_send_reaction_finish (DcMessageActions* self,
                                         GAsyncResult* _res_)
{
	DcMessageActionsSendReactionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_send_reaction_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	DcMessageActionsSendReactionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_send_reaction_co (_data_);
}

static gboolean
dc_message_actions_send_reaction_co (DcMessageActionsSendReactionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->message_store;
		_data_->_tmp1_ = dc_find_message ((GListModel*) _data_->_tmp0_, _data_->msg_id);
		_data_->current = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->current;
		if (dc_message_actions_has_my_reaction (_data_->self, _data_->_tmp2_, _data_->emoji)) {
			_data_->_tmp3_ = _data_->self->priv->rpc;
			_data_->_tmp4_ = g_new0 (gchar*, 0 + 1);
			_data_->_tmp5_ = _data_->_tmp4_;
			_data_->_tmp5__length1 = 0;
			_data_->_state_ = 1;
			dc_rpc_client_send_reaction (_data_->_tmp3_, _data_->msg_id, _data_->_tmp5_, (gint) 0, dc_message_actions_send_reaction_ready, _data_);
			return FALSE;
			_state_1:
			dc_rpc_client_send_reaction_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp5_ = (_vala_array_free (_data_->_tmp5_, _data_->_tmp5__length1, (GDestroyNotify) g_free), NULL);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->current);
				goto __catch0_g_error;
			}
		} else {
			_data_->_tmp6_ = _data_->self->priv->rpc;
			_data_->_tmp7_ = g_strdup (_data_->emoji);
			_data_->_tmp8_ = g_new0 (gchar*, 1 + 1);
			_data_->_tmp8_[0] = _data_->_tmp7_;
			_data_->_tmp9_ = _data_->_tmp8_;
			_data_->_tmp9__length1 = 1;
			_data_->_state_ = 2;
			dc_rpc_client_send_reaction (_data_->_tmp6_, _data_->msg_id, _data_->_tmp9_, (gint) 1, dc_message_actions_send_reaction_ready, _data_);
			return FALSE;
			_state_2:
			dc_rpc_client_send_reaction_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp9_ = (_vala_array_free (_data_->_tmp9_, _data_->_tmp9__length1, (GDestroyNotify) g_free), NULL);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->current);
				goto __catch0_g_error;
			}
		}
		_data_->_state_ = 3;
		dc_message_actions_update_row (_data_->self, _data_->msg_id, dc_message_actions_send_reaction_ready, _data_);
		return FALSE;
		_state_3:
		dc_message_actions_update_row_finish (_data_->self, _data_->_res_);
		_g_object_unref0 (_data_->current);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp10_ = _data_->self->priv->window;
		_data_->_tmp11_ = _data_->e;
		_data_->_tmp12_ = _data_->_tmp11_->message;
		_data_->_tmp13_ = g_strconcat ("Reaction failed: ", _data_->_tmp12_, NULL);
		_data_->_tmp14_ = _data_->_tmp13_;
		dc_window_show_toast (_data_->_tmp10_, _data_->_tmp14_);
		_g_free0 (_data_->_tmp14_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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;
	}
	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 Block100Data*
block100_data_ref (Block100Data* _data100_)
{
	g_atomic_int_inc (&_data100_->_ref_count_);
	return _data100_;
}

static void
block100_data_unref (void * _userdata_)
{
	Block100Data* _data100_;
	_data100_ = (Block100Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data100_->_ref_count_)) {
		DcMessageActions* self;
		self = _data100_->self;
		_g_object_unref0 (self);
		g_slice_free (Block100Data, _data100_);
	}
}

static void
__lambda73_ (Block100Data* _data100_,
             const gchar* emoji)
{
	DcMessageActions* self;
	self = _data100_->self;
	g_return_if_fail (emoji != NULL);
	dc_message_actions_send_reaction (self, _data100_->msg_id, emoji, NULL, NULL);
}

static void
___lambda73__gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                             const gchar* text,
                                             gpointer self)
{
	__lambda73_ (self, text);
}

static void
dc_message_actions_show_emoji_picker (DcMessageActions* self,
                                      gint msg_id,
                                      GtkWidget* parent,
                                      gdouble x,
                                      gdouble y)
{
	Block100Data* _data100_;
	GtkEmojiChooser* chooser = NULL;
	GtkEmojiChooser* _tmp0_;
	GtkEmojiChooser* _tmp1_;
	GtkEmojiChooser* _tmp3_;
	GtkEmojiChooser* _tmp4_;
	GtkEmojiChooser* _tmp5_;
	GdkRectangle _tmp6_ = {0};
	GtkEmojiChooser* _tmp7_;
	GtkEmojiChooser* _tmp8_;
	GtkEmojiChooser* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (parent != NULL);
	_data100_ = g_slice_new0 (Block100Data);
	_data100_->_ref_count_ = 1;
	_data100_->self = g_object_ref (self);
	_data100_->msg_id = msg_id;
	_tmp0_ = dc_create_emoji_chooser ();
	chooser = _tmp0_;
	_tmp1_ = chooser;
	if (_tmp1_ == NULL) {
		DcWindow* _tmp2_;
		_tmp2_ = self->priv->window;
		dc_window_show_toast (_tmp2_, "Emoji picker unavailable");
		_g_object_unref0 (chooser);
		block100_data_unref (_data100_);
		_data100_ = NULL;
		return;
	}
	_tmp3_ = chooser;
	g_signal_connect_data (_tmp3_, "emoji-picked", (GCallback) ___lambda73__gtk_emoji_chooser_emoji_picked, block100_data_ref (_data100_), (GClosureNotify) block100_data_unref, 0);
	_tmp4_ = chooser;
	gtk_widget_set_parent ((GtkWidget*) _tmp4_, parent);
	_tmp5_ = chooser;
	_tmp6_.x = (gint) x;
	_tmp6_.y = (gint) y;
	_tmp6_.width = 1;
	_tmp6_.height = 1;
	gtk_popover_set_pointing_to ((GtkPopover*) _tmp5_, &_tmp6_);
	_tmp7_ = chooser;
	dc_message_actions_preserve_scroll_until_closed (self, (GtkPopover*) _tmp7_);
	_tmp8_ = chooser;
	dc_unparent_on_close ((GtkPopover*) _tmp8_);
	_tmp9_ = chooser;
	gtk_popover_popup ((GtkPopover*) _tmp9_);
	_g_object_unref0 (chooser);
	block100_data_unref (_data100_);
	_data100_ = NULL;
}

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

void
dc_message_actions_delete_message (DcMessageActions* self,
                                   gint msg_id,
                                   gboolean for_all,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcMessageActionsDeleteMessageData* _data_;
	DcMessageActions* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcMessageActionsDeleteMessageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_delete_message_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_data_->for_all = for_all;
	dc_message_actions_delete_message_co (_data_);
}

void
dc_message_actions_delete_message_finish (DcMessageActions* self,
                                          GAsyncResult* _res_)
{
	DcMessageActionsDeleteMessageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_delete_message_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcMessageActionsDeleteMessageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_delete_message_co (_data_);
}

static gboolean
dc_message_actions_delete_message_co (DcMessageActionsDeleteMessageData* _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:
	{
		if (_data_->for_all) {
			_data_->_tmp0_ = _data_->self->priv->rpc;
			_data_->_tmp1_ = g_new0 (gint, 1);
			_data_->_tmp1_[0] = _data_->msg_id;
			_data_->_tmp2_ = _data_->_tmp1_;
			_data_->_tmp2__length1 = 1;
			_data_->_state_ = 1;
			dc_rpc_client_delete_messages_for_all (_data_->_tmp0_, _data_->_tmp2_, (gint) 1, dc_message_actions_delete_message_ready, _data_);
			return FALSE;
			_state_1:
			dc_rpc_client_delete_messages_for_all_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp2_ = (g_free (_data_->_tmp2_), NULL);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		} else {
			_data_->_tmp3_ = _data_->self->priv->rpc;
			_data_->_tmp4_ = g_new0 (gint, 1);
			_data_->_tmp4_[0] = _data_->msg_id;
			_data_->_tmp5_ = _data_->_tmp4_;
			_data_->_tmp5__length1 = 1;
			_data_->_state_ = 2;
			dc_rpc_client_delete_messages (_data_->_tmp3_, _data_->_tmp5_, (gint) 1, dc_message_actions_delete_message_ready, _data_);
			return FALSE;
			_state_2:
			dc_rpc_client_delete_messages_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp5_ = (g_free (_data_->_tmp5_), NULL);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		_data_->_tmp6_ = _data_->self->priv->message_store;
		_data_->idx = dc_find_message_index ((GListModel*) _data_->_tmp6_, _data_->msg_id);
		if (_data_->idx >= 0) {
			_data_->_tmp7_ = _data_->self->priv->message_store;
			g_list_store_remove (_data_->_tmp7_, (guint) _data_->idx);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp8_ = _data_->self->priv->window;
		_data_->_tmp9_ = _data_->e;
		_data_->_tmp10_ = _data_->_tmp9_->message;
		_data_->_tmp11_ = g_strconcat ("Delete failed: ", _data_->_tmp10_, NULL);
		_data_->_tmp12_ = _data_->_tmp11_;
		dc_window_show_toast (_data_->_tmp8_, _data_->_tmp12_);
		_g_free0 (_data_->_tmp12_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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;
	}
	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;
}

void
dc_message_actions_start_editing (DcMessageActions* self,
                                  gint msg_id)
{
	DcMessage* m = NULL;
	GListStore* _tmp0_;
	DcMessage* _tmp1_;
	DcMessage* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->message_store;
	_tmp1_ = dc_find_message ((GListModel*) _tmp0_, msg_id);
	m = _tmp1_;
	_tmp2_ = m;
	if (_tmp2_ != NULL) {
		DcMessage* _tmp3_;
		_tmp3_ = m;
		dc_message_actions_start_editing_message (self, _tmp3_);
	}
	_g_object_unref0 (m);
}

void
dc_message_actions_start_editing_last (DcMessageActions* self)
{
	DcMessage* m = NULL;
	GListStore* _tmp0_;
	DcMessage* _tmp1_;
	DcMessage* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->message_store;
	_tmp1_ = dc_find_last_editable_text_message (_tmp0_);
	m = _tmp1_;
	_tmp2_ = m;
	if (_tmp2_ != NULL) {
		DcMessage* _tmp3_;
		_tmp3_ = m;
		dc_message_actions_start_editing_message (self, _tmp3_);
	}
	_g_object_unref0 (m);
}

static void
dc_message_actions_start_editing_message (DcMessageActions* self,
                                          DcMessage* m)
{
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	DcComposeBar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (m != NULL);
	_tmp1_ = dc_message_get_text (m);
	_tmp2_ = _tmp1_;
	_tmp0_ = _tmp2_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp3_ = self->priv->compose_bar;
	_tmp4_ = dc_message_get_id (m);
	_tmp5_ = _tmp4_;
	dc_compose_bar_begin_edit (_tmp3_, _tmp5_, _tmp0_);
}

void
dc_message_actions_start_replying (DcMessageActions* self,
                                   gint msg_id)
{
	DcMessage* m = NULL;
	GListStore* _tmp0_;
	DcMessage* _tmp1_;
	DcMessage* _tmp2_;
	const gchar* _tmp3_ = NULL;
	DcMessage* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gchar* sender = NULL;
	gchar* _tmp11_;
	const gchar* _tmp12_ = NULL;
	DcMessage* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* preview = NULL;
	gchar* _tmp16_;
	DcComposeBar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->message_store;
	_tmp1_ = dc_find_message ((GListModel*) _tmp0_, msg_id);
	m = _tmp1_;
	_tmp2_ = m;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (m);
		return;
	}
	_tmp4_ = m;
	_tmp5_ = dc_message_get_is_outgoing (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		_tmp3_ = "You";
	} else {
		const gchar* _tmp7_ = NULL;
		DcMessage* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp8_ = m;
		_tmp9_ = dc_message_get_sender_name (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp7_ = _tmp10_;
		if (_tmp7_ == NULL) {
			_tmp7_ = "";
		}
		_tmp3_ = _tmp7_;
	}
	_tmp11_ = g_strdup (_tmp3_);
	sender = _tmp11_;
	_tmp13_ = m;
	_tmp14_ = dc_message_get_text (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp12_ = _tmp15_;
	if (_tmp12_ == NULL) {
		_tmp12_ = "(attachment)";
	}
	_tmp16_ = g_strdup (_tmp12_);
	preview = _tmp16_;
	_tmp17_ = self->priv->compose_bar;
	_tmp18_ = sender;
	_tmp19_ = preview;
	dc_compose_bar_begin_reply (_tmp17_, msg_id, _tmp18_, _tmp19_);
	_g_free0 (preview);
	_g_free0 (sender);
	_g_object_unref0 (m);
}

void
dc_message_actions_start_forwarding (DcMessageActions* self,
                                     gint msg_id)
{
	gint* _tmp0_;
	gint* _tmp1_;
	gint _tmp1__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (gint, 1);
	_tmp0_[0] = msg_id;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 1;
	dc_message_actions_start_forwarding_many (self, _tmp1_, (gint) 1);
	_tmp1_ = (g_free (_tmp1_), NULL);
}

void
dc_message_actions_start_forwarding_many (DcMessageActions* self,
                                          gint* msg_ids,
                                          gint msg_ids_length1)
{
	DcWindow* _tmp0_;
	DcRpcClient* _tmp1_;
	DcContactPickerDialog* _tmp2_;
	DcContactPickerDialog* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = self->priv->rpc;
	_tmp2_ = dc_message_actions_forward_with_picker (_tmp0_, _tmp1_, msg_ids, (gint) msg_ids_length1);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp3_);
}

/** Ask for a destination chat or contact and forward msg_ids there.
            Shared by the message context menu and the gallery dialog. */
static Block101Data*
block101_data_ref (Block101Data* _data101_)
{
	g_atomic_int_inc (&_data101_->_ref_count_);
	return _data101_;
}

static void
block101_data_unref (void * _userdata_)
{
	Block101Data* _data101_;
	_data101_ = (Block101Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data101_->_ref_count_)) {
		_data101_->forward_ids = (g_free (_data101_->forward_ids), NULL);
		_g_object_unref0 (_data101_->window);
		_g_object_unref0 (_data101_->rpc);
		g_slice_free (Block101Data, _data101_);
	}
}

static gint*
_vala_array_dup21 (gint* self,
                   gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (gint));
	}
	return NULL;
}

static gint*
_vala_array_dup22 (gint* self,
                   gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (gint));
	}
	return NULL;
}

static void
__lambda82_ (Block101Data* _data101_,
             gint chat_id)
{
	gint* _tmp0_;
	gint _tmp0__length1;
	_tmp0_ = (_data101_->forward_ids != NULL) ? _vala_array_dup22 (_data101_->forward_ids, _data101_->forward_ids_length1) : _data101_->forward_ids;
	_tmp0__length1 = _data101_->forward_ids_length1;
	dc_message_actions_forward_to_chat (_data101_->window, _data101_->rpc, _tmp0_, (gint) _tmp0__length1, chat_id, NULL, NULL);
}

static void
___lambda82__dc_contact_picker_dialog_chat_picked (DcContactPickerDialog* _sender,
                                                   gint chat_id,
                                                   gpointer self)
{
	__lambda82_ (self, chat_id);
}

static gint*
_vala_array_dup23 (gint* self,
                   gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (gint));
	}
	return NULL;
}

static void
__lambda86_ (Block101Data* _data101_,
             gint contact_id,
             const gchar* email)
{
	gint* _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (email != NULL);
	_tmp0_ = (_data101_->forward_ids != NULL) ? _vala_array_dup23 (_data101_->forward_ids, _data101_->forward_ids_length1) : _data101_->forward_ids;
	_tmp0__length1 = _data101_->forward_ids_length1;
	dc_message_actions_forward_to_contact (_data101_->window, _data101_->rpc, _tmp0_, (gint) _tmp0__length1, contact_id, email, NULL, NULL);
}

static void
___lambda86__dc_contact_picker_dialog_contact_picked (DcContactPickerDialog* _sender,
                                                      gint contact_id,
                                                      const gchar* email,
                                                      gpointer self)
{
	__lambda86_ (self, contact_id, email);
}

DcContactPickerDialog*
dc_message_actions_forward_with_picker (DcWindow* window,
                                        DcRpcClient* rpc,
                                        gint* msg_ids,
                                        gint msg_ids_length1)
{
	Block101Data* _data101_;
	DcWindow* _tmp0_;
	DcRpcClient* _tmp1_;
	gint* _tmp2_;
	gint _tmp2__length1;
	DcContactPickerDialog* picker = NULL;
	GListStore* _tmp3_;
	GListStore* _tmp4_;
	DcContactPickerDialog* _tmp5_;
	DcContactPickerDialog* _tmp6_;
	DcContactPickerDialog* _tmp7_;
	DcContactPickerDialog* _tmp8_;
	DcContactPickerDialog* result;
	g_return_val_if_fail (window != NULL, NULL);
	g_return_val_if_fail (rpc != NULL, NULL);
	_data101_ = g_slice_new0 (Block101Data);
	_data101_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (_data101_->window);
	_data101_->window = _tmp0_;
	_tmp1_ = _g_object_ref0 (rpc);
	_g_object_unref0 (_data101_->rpc);
	_data101_->rpc = _tmp1_;
	if (msg_ids_length1 == 0) {
		result = NULL;
		block101_data_unref (_data101_);
		_data101_ = NULL;
		return result;
	}
	_tmp2_ = (msg_ids != NULL) ? _vala_array_dup21 (msg_ids, msg_ids_length1) : msg_ids;
	_tmp2__length1 = msg_ids_length1;
	_data101_->forward_ids = _tmp2_;
	_data101_->forward_ids_length1 = _tmp2__length1;
	_data101_->_forward_ids_size_ = _data101_->forward_ids_length1;
	_tmp3_ = dc_window_get_chat_store (_data101_->window);
	_tmp4_ = _tmp3_;
	_tmp5_ = dc_contact_picker_dialog_new (_data101_->rpc, _tmp4_, "Forward To");
	g_object_ref_sink (_tmp5_);
	picker = _tmp5_;
	_tmp6_ = picker;
	g_signal_connect_data (_tmp6_, "chat-picked", (GCallback) ___lambda82__dc_contact_picker_dialog_chat_picked, block101_data_ref (_data101_), (GClosureNotify) block101_data_unref, 0);
	_tmp7_ = picker;
	g_signal_connect_data (_tmp7_, "contact-picked", (GCallback) ___lambda86__dc_contact_picker_dialog_contact_picked, block101_data_ref (_data101_), (GClosureNotify) block101_data_unref, 0);
	_tmp8_ = picker;
	adw_dialog_present ((AdwDialog*) _tmp8_, (GtkWidget*) _data101_->window);
	result = picker;
	block101_data_unref (_data101_);
	_data101_ = NULL;
	return result;
}

static void
dc_message_actions_forward_to_chat_data_free (gpointer _data)
{
	DcMessageActionsForwardToChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->window);
	_g_object_unref0 (_data_->rpc);
	_data_->msg_ids = (g_free (_data_->msg_ids), NULL);
	g_slice_free (DcMessageActionsForwardToChatData, _data_);
}

static void
dc_message_actions_forward_to_chat (DcWindow* window,
                                    DcRpcClient* rpc,
                                    gint* msg_ids,
                                    gint msg_ids_length1,
                                    gint chat_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	DcMessageActionsForwardToChatData* _data_;
	DcWindow* _tmp0_;
	DcRpcClient* _tmp1_;
	g_return_if_fail (window != NULL);
	g_return_if_fail (rpc != NULL);
	_data_ = g_slice_new0 (DcMessageActionsForwardToChatData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_forward_to_chat_data_free);
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (_data_->window);
	_data_->window = _tmp0_;
	_tmp1_ = _g_object_ref0 (rpc);
	_g_object_unref0 (_data_->rpc);
	_data_->rpc = _tmp1_;
	_data_->msg_ids = (g_free (_data_->msg_ids), NULL);
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	_data_->chat_id = chat_id;
	dc_message_actions_forward_to_chat_co (_data_);
}

static void
dc_message_actions_forward_to_chat_finish (GAsyncResult* _res_)
{
	DcMessageActionsForwardToChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_forward_to_chat_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	DcMessageActionsForwardToChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_forward_to_chat_co (_data_);
}

static gboolean
dc_message_actions_forward_to_chat_co (DcMessageActionsForwardToChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		dc_rpc_client_forward_messages (_data_->rpc, _data_->msg_ids, (gint) _data_->msg_ids_length1, _data_->chat_id, dc_message_actions_forward_to_chat_ready, _data_);
		return FALSE;
		_state_1:
		dc_rpc_client_forward_messages_finish (_data_->rpc, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		dc_window_request_reload_chats (_data_->window);
		dc_window_request_chat_messages_reload (_data_->window, _data_->chat_id);
		if (_data_->msg_ids_length1 == 1) {
			_data_->_tmp0_ = "Message forwarded";
		} else {
			_data_->_tmp0_ = "Messages forwarded";
		}
		dc_window_show_toast (_data_->window, _data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp1_ = _data_->e;
		_data_->_tmp2_ = _data_->_tmp1_->message;
		_data_->_tmp3_ = g_strconcat ("Forward failed: ", _data_->_tmp2_, NULL);
		_data_->_tmp4_ = _data_->_tmp3_;
		dc_window_show_toast (_data_->window, _data_->_tmp4_);
		_g_free0 (_data_->_tmp4_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_data_->msg_ids = (g_free (_data_->msg_ids), NULL);
		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_->msg_ids = (g_free (_data_->msg_ids), NULL);
	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 void
dc_message_actions_forward_to_contact_data_free (gpointer _data)
{
	DcMessageActionsForwardToContactData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->window);
	_g_object_unref0 (_data_->rpc);
	_data_->msg_ids = (g_free (_data_->msg_ids), NULL);
	_g_free0 (_data_->email);
	g_slice_free (DcMessageActionsForwardToContactData, _data_);
}

static void
dc_message_actions_forward_to_contact (DcWindow* window,
                                       DcRpcClient* rpc,
                                       gint* msg_ids,
                                       gint msg_ids_length1,
                                       gint contact_id,
                                       const gchar* email,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DcMessageActionsForwardToContactData* _data_;
	DcWindow* _tmp0_;
	DcRpcClient* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (window != NULL);
	g_return_if_fail (rpc != NULL);
	g_return_if_fail (email != NULL);
	_data_ = g_slice_new0 (DcMessageActionsForwardToContactData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_forward_to_contact_data_free);
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (_data_->window);
	_data_->window = _tmp0_;
	_tmp1_ = _g_object_ref0 (rpc);
	_g_object_unref0 (_data_->rpc);
	_data_->rpc = _tmp1_;
	_data_->msg_ids = (g_free (_data_->msg_ids), NULL);
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	_data_->contact_id = contact_id;
	_tmp2_ = g_strdup (email);
	_g_free0 (_data_->email);
	_data_->email = _tmp2_;
	dc_message_actions_forward_to_contact_co (_data_);
}

static void
dc_message_actions_forward_to_contact_finish (GAsyncResult* _res_)
{
	DcMessageActionsForwardToContactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_forward_to_contact_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	DcMessageActionsForwardToContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_forward_to_contact_co (_data_);
}

static gboolean
dc_message_actions_forward_to_contact_co (DcMessageActionsForwardToContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->cid = _data_->contact_id;
		if (_data_->cid <= 0) {
			_data_->_state_ = 1;
			dc_rpc_client_get_or_create_contact (_data_->rpc, _data_->email, dc_message_actions_forward_to_contact_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp0_ = dc_rpc_client_get_or_create_contact_finish (_data_->rpc, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->cid = _data_->_tmp0_;
		}
		_data_->_state_ = 2;
		dc_rpc_client_get_or_create_chat_by_contact (_data_->rpc, _data_->cid, dc_message_actions_forward_to_contact_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp1_ = dc_rpc_client_get_or_create_chat_by_contact_finish (_data_->rpc, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->chat_id = _data_->_tmp1_;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp2_ = _data_->e;
		_data_->_tmp3_ = _data_->_tmp2_->message;
		_data_->_tmp4_ = g_strconcat ("Forward failed: ", _data_->_tmp3_, NULL);
		_data_->_tmp5_ = _data_->_tmp4_;
		dc_window_show_toast (_data_->window, _data_->_tmp5_);
		_g_free0 (_data_->_tmp5_);
		_g_error_free0 (_data_->e);
		_data_->msg_ids = (g_free (_data_->msg_ids), NULL);
		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;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_data_->msg_ids = (g_free (_data_->msg_ids), NULL);
		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_->_tmp6_ = _data_->msg_ids;
	_data_->_tmp6__length1 = _data_->msg_ids_length1;
	_data_->msg_ids = NULL;
	_data_->msg_ids_length1 = 0;
	_data_->_state_ = 3;
	dc_message_actions_forward_to_chat (_data_->window, _data_->rpc, _data_->_tmp6_, (gint) _data_->_tmp6__length1, _data_->chat_id, dc_message_actions_forward_to_contact_ready, _data_);
	return FALSE;
	_state_3:
	dc_message_actions_forward_to_chat_finish (_data_->_res_);
	_data_->msg_ids = (g_free (_data_->msg_ids), NULL);
	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 void
dc_message_actions_edit_message_data_free (gpointer _data)
{
	DcMessageActionsEditMessageData* _data_;
	_data_ = _data;
	_g_free0 (_data_->new_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcMessageActionsEditMessageData, _data_);
}

void
dc_message_actions_edit_message (DcMessageActions* self,
                                 gint msg_id,
                                 const gchar* new_text,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DcMessageActionsEditMessageData* _data_;
	DcMessageActions* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_text != NULL);
	_data_ = g_slice_new0 (DcMessageActionsEditMessageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_edit_message_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_tmp1_ = g_strdup (new_text);
	_g_free0 (_data_->new_text);
	_data_->new_text = _tmp1_;
	dc_message_actions_edit_message_co (_data_);
}

void
dc_message_actions_edit_message_finish (DcMessageActions* self,
                                        GAsyncResult* _res_)
{
	DcMessageActionsEditMessageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_edit_message_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DcMessageActionsEditMessageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_edit_message_co (_data_);
}

static gboolean
dc_message_actions_edit_message_co (DcMessageActionsEditMessageData* _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_->_tmp0_ = _data_->self->priv->rpc;
		_data_->_state_ = 1;
		dc_rpc_client_send_edit_request (_data_->_tmp0_, _data_->msg_id, _data_->new_text, dc_message_actions_edit_message_ready, _data_);
		return FALSE;
		_state_1:
		dc_rpc_client_send_edit_request_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_state_ = 2;
		dc_message_actions_update_row (_data_->self, _data_->msg_id, dc_message_actions_edit_message_ready, _data_);
		return FALSE;
		_state_2:
		dc_message_actions_update_row_finish (_data_->self, _data_->_res_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp1_ = _data_->self->priv->window;
		_data_->_tmp2_ = _data_->e;
		_data_->_tmp3_ = _data_->_tmp2_->message;
		_data_->_tmp4_ = g_strconcat ("Edit failed: ", _data_->_tmp3_, NULL);
		_data_->_tmp5_ = _data_->_tmp4_;
		dc_window_show_toast (_data_->_tmp1_, _data_->_tmp5_);
		_g_free0 (_data_->_tmp5_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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;
	}
	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 void
dc_message_actions_update_row_data_free (gpointer _data)
{
	DcMessageActionsUpdateRowData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcMessageActionsUpdateRowData, _data_);
}

void
dc_message_actions_update_row (DcMessageActions* self,
                               gint msg_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcMessageActionsUpdateRowData* _data_;
	DcMessageActions* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcMessageActionsUpdateRowData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_update_row_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	dc_message_actions_update_row_co (_data_);
}

void
dc_message_actions_update_row_finish (DcMessageActions* self,
                                      GAsyncResult* _res_)
{
	DcMessageActionsUpdateRowData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_update_row_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcMessageActionsUpdateRowData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_update_row_co (_data_);
}

static gboolean
dc_message_actions_update_row_co (DcMessageActionsUpdateRowData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->rpc;
		_data_->_state_ = 1;
		dc_rpc_client_fetch_message (_data_->_tmp0_, _data_->msg_id, dc_message_actions_update_row_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = dc_rpc_client_fetch_message_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
		_data_->msg = _data_->_tmp1_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp2_ = _data_->msg;
		if (_data_->_tmp2_ == NULL) {
			_g_object_unref0 (_data_->msg);
			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->window;
		_data_->_tmp4_ = dc_window_current_view (_data_->_tmp3_);
		_data_->view = _data_->_tmp4_;
		_data_->_tmp5_ = _data_->view;
		if (_data_->_tmp5_ != NULL) {
			_data_->_tmp6_ = _data_->view;
			_data_->_tmp7_ = _data_->msg;
			dc_conversation_view_replace_message (_data_->_tmp6_, _data_->msg_id, _data_->_tmp7_);
		} else {
			_data_->_tmp8_ = _data_->self->priv->message_store;
			_data_->idx = dc_find_message_index ((GListModel*) _data_->_tmp8_, _data_->msg_id);
			if (_data_->idx >= 0) {
				_data_->_tmp9_ = _data_->msg;
				_data_->_tmp10_ = _g_object_ref0 ((GObject*) _data_->_tmp9_);
				_data_->_tmp11_ = g_new0 (GObject*, 1 + 1);
				_data_->_tmp11_[0] = _data_->_tmp10_;
				_data_->replacements = _data_->_tmp11_;
				_data_->replacements_length1 = 1;
				_data_->_replacements_size_ = _data_->replacements_length1;
				_data_->_tmp12_ = _data_->self->priv->message_store;
				_data_->_tmp13_ = _data_->replacements;
				_data_->_tmp13__length1 = _data_->replacements_length1;
				g_list_store_splice (_data_->_tmp12_, (guint) _data_->idx, (guint) 1, _data_->_tmp13_, (guint) _data_->_tmp13__length1);
				_data_->replacements = (_vala_array_free (_data_->replacements, _data_->replacements_length1, (GDestroyNotify) g_object_unref), NULL);
			}
		}
		_g_object_unref0 (_data_->view);
		_g_object_unref0 (_data_->msg);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		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;
	}
	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 Block102Data*
block102_data_ref (Block102Data* _data102_)
{
	g_atomic_int_inc (&_data102_->_ref_count_);
	return _data102_;
}

static void
block102_data_unref (void * _userdata_)
{
	Block102Data* _data102_;
	_data102_ = (Block102Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data102_->_ref_count_)) {
		DcMessageActions* self;
		self = _data102_->self;
		_g_object_unref0 (_data102_->parent);
		_g_object_unref0 (self);
		g_slice_free (Block102Data, _data102_);
	}
}

static gboolean
___lambda119_ (Block102Data* _data102_)
{
	DcMessageActions* self;
	gboolean result;
	self = _data102_->self;
	dc_message_actions_show_context_menu (self, _data102_->msg_id, _data102_->is_outgoing, _data102_->x, _data102_->y, _data102_->parent);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
____lambda119__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda119_ (self);
	return result;
}

void
dc_message_actions_handle_double_click (DcMessageActions* self,
                                        gint msg_id,
                                        gboolean is_outgoing,
                                        gdouble x,
                                        gdouble y,
                                        GtkWidget* parent)
{
	Block102Data* _data102_;
	GtkWidget* _tmp0_;
	DcSettingsManager* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	DcComposeBar* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (parent != NULL);
	_data102_ = g_slice_new0 (Block102Data);
	_data102_->_ref_count_ = 1;
	_data102_->self = g_object_ref (self);
	_data102_->msg_id = msg_id;
	_data102_->is_outgoing = is_outgoing;
	_data102_->x = x;
	_data102_->y = y;
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (_data102_->parent);
	_data102_->parent = _tmp0_;
	_tmp1_ = self->priv->settings;
	_tmp2_ = dc_settings_manager_get_double_click_action (_tmp1_);
	_tmp3_ = _tmp2_;
	switch (_tmp3_) {
		case 0:
		{
			dc_message_actions_start_replying (self, _data102_->msg_id);
			break;
		}
		case 1:
		{
			dc_message_actions_send_reaction (self, _data102_->msg_id, "\xe2\x9d\xa4\xef\xb8\x8f", NULL, NULL);
			break;
		}
		case 2:
		{
			dc_message_actions_send_reaction (self, _data102_->msg_id, "\xf0\x9f\x91\x8d", NULL, NULL);
			break;
		}
		case 3:
		{
			dc_message_actions_open_sender_profile (self, _data102_->msg_id, NULL, NULL);
			break;
		}
		case 4:
		{
			break;
		}
		case 5:
		{
			g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda119__gsource_func, block102_data_ref (_data102_), block102_data_unref);
			block102_data_unref (_data102_);
			_data102_ = NULL;
			return;
		}
		default:
		break;
	}
	_tmp4_ = self->priv->compose_bar;
	dc_compose_bar_grab_entry_focus (_tmp4_);
	block102_data_unref (_data102_);
	_data102_ = NULL;
}

void
dc_message_actions_show_details (DcMessageActions* self,
                                 gint msg_id)
{
	DcMessage* m = NULL;
	GListStore* _tmp0_;
	DcMessage* _tmp1_;
	DcMessage* _tmp2_;
	DcMessageDetailsDialog* dialog = NULL;
	DcWindow* _tmp3_;
	DcRpcClient* _tmp4_;
	DcMessage* _tmp5_;
	DcMentionRoster* _tmp6_;
	DcMessageDetailsDialog* _tmp7_;
	DcMessageDetailsDialog* _tmp8_;
	DcWindow* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->message_store;
	_tmp1_ = dc_find_message ((GListModel*) _tmp0_, msg_id);
	m = _tmp1_;
	_tmp2_ = m;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (m);
		return;
	}
	_tmp3_ = self->priv->window;
	_tmp4_ = self->priv->rpc;
	_tmp5_ = m;
	_tmp6_ = self->priv->reaction_roster;
	_tmp7_ = dc_message_details_dialog_new (_tmp3_, _tmp4_, self, _tmp5_, _tmp6_);
	g_object_ref_sink (_tmp7_);
	dialog = _tmp7_;
	_tmp8_ = dialog;
	_tmp9_ = self->priv->window;
	adw_dialog_present ((AdwDialog*) _tmp8_, (GtkWidget*) _tmp9_);
	_g_object_unref0 (dialog);
	_g_object_unref0 (m);
}

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

void
dc_message_actions_open_sender_chat (DcMessageActions* self,
                                     gint msg_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcMessageActionsOpenSenderChatData* _data_;
	DcMessageActions* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcMessageActionsOpenSenderChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_open_sender_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	dc_message_actions_open_sender_chat_co (_data_);
}

void
dc_message_actions_open_sender_chat_finish (DcMessageActions* self,
                                            GAsyncResult* _res_)
{
	DcMessageActionsOpenSenderChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_open_sender_chat_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcMessageActionsOpenSenderChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_open_sender_chat_co (_data_);
}

static gboolean
dc_message_actions_open_sender_chat_co (DcMessageActionsOpenSenderChatData* _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_->_tmp0_ = _data_->self->priv->message_store;
	_data_->_tmp1_ = dc_find_message ((GListModel*) _data_->_tmp0_, _data_->msg_id);
	_data_->m = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->m;
	if (_data_->_tmp2_ == NULL) {
		_g_object_unref0 (_data_->m);
		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_->m;
		_data_->_tmp4_ = dc_message_get_sender_contact_id (_data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->contact_id = _data_->_tmp5_;
		_data_->_tmp6_ = _data_->m;
		_data_->_tmp7_ = dc_message_get_sender_address (_data_->_tmp6_);
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
		_data_->address = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->m;
		_data_->_tmp12_ = dc_message_get_is_outgoing (_data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		if (_data_->_tmp13_) {
			_data_->_tmp15_ = _data_->address;
			if (_data_->_tmp15_ == NULL) {
				_data_->_tmp14_ = TRUE;
			} else {
				_data_->_tmp16_ = _data_->address;
				_data_->_tmp17_ = strlen (_data_->_tmp16_);
				_data_->_tmp18_ = _data_->_tmp17_;
				_data_->_tmp14_ = _data_->_tmp18_ == 0;
			}
			_data_->_tmp10_ = _data_->_tmp14_;
		} else {
			_data_->_tmp10_ = FALSE;
		}
		if (_data_->_tmp10_) {
			_data_->_tmp19_ = _data_->self->priv->rpc;
			_data_->_tmp20_ = dc_rpc_client_get_self_email (_data_->_tmp19_);
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_tmp22_ = g_strdup (_data_->_tmp21_);
			_g_free0 (_data_->address);
			_data_->address = _data_->_tmp22_;
		}
		if (_data_->contact_id <= 0) {
			_data_->_tmp25_ = _data_->address;
			_data_->_tmp24_ = _data_->_tmp25_ != NULL;
		} else {
			_data_->_tmp24_ = FALSE;
		}
		if (_data_->_tmp24_) {
			_data_->_tmp26_ = _data_->address;
			_data_->_tmp27_ = strlen (_data_->_tmp26_);
			_data_->_tmp28_ = _data_->_tmp27_;
			_data_->_tmp23_ = _data_->_tmp28_ > 0;
		} else {
			_data_->_tmp23_ = FALSE;
		}
		if (_data_->_tmp23_) {
			_data_->_tmp30_ = _data_->self->priv->rpc;
			_data_->_tmp31_ = _data_->address;
			_data_->_state_ = 1;
			dc_rpc_client_get_or_create_contact (_data_->_tmp30_, _data_->_tmp31_, dc_message_actions_open_sender_chat_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp29_ = dc_rpc_client_get_or_create_contact_finish (_data_->_tmp30_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_free0 (_data_->address);
				goto __catch0_g_error;
			}
			_data_->contact_id = _data_->_tmp29_;
		}
		if (_data_->contact_id <= 0) {
			_g_free0 (_data_->address);
			_g_object_unref0 (_data_->m);
			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_->_tmp32_ = _data_->self->priv->rpc;
		_data_->_state_ = 2;
		dc_rpc_client_get_or_create_chat_by_contact (_data_->_tmp32_, _data_->contact_id, dc_message_actions_open_sender_chat_ready, _data_);
		return FALSE;
		_state_2:
		_data_->chat_id = dc_rpc_client_get_or_create_chat_by_contact_finish (_data_->_tmp32_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->address);
			goto __catch0_g_error;
		}
		if (_data_->chat_id > 0) {
			_data_->_tmp33_ = _data_->self->priv->window;
			dc_window_request_reload_chats (_data_->_tmp33_);
			_data_->_tmp34_ = _data_->self->priv->window;
			dc_window_select_chat_by_id (_data_->_tmp34_, _data_->chat_id);
		}
		_g_free0 (_data_->address);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp35_ = _data_->self->priv->window;
		_data_->_tmp36_ = _data_->e;
		_data_->_tmp37_ = _data_->_tmp36_->message;
		_data_->_tmp38_ = g_strconcat ("Could not open chat: ", _data_->_tmp37_, NULL);
		_data_->_tmp39_ = _data_->_tmp38_;
		dc_window_show_toast (_data_->_tmp35_, _data_->_tmp39_);
		_g_free0 (_data_->_tmp39_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->m);
		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;
	}
	_g_object_unref0 (_data_->m);
	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 void
dc_message_actions_open_sender_profile_data_free (gpointer _data)
{
	DcMessageActionsOpenSenderProfileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcMessageActionsOpenSenderProfileData, _data_);
}

void
dc_message_actions_open_sender_profile (DcMessageActions* self,
                                        gint msg_id,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcMessageActionsOpenSenderProfileData* _data_;
	DcMessageActions* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcMessageActionsOpenSenderProfileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_message_actions_open_sender_profile_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	dc_message_actions_open_sender_profile_co (_data_);
}

void
dc_message_actions_open_sender_profile_finish (DcMessageActions* self,
                                               GAsyncResult* _res_)
{
	DcMessageActionsOpenSenderProfileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_message_actions_open_sender_profile_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcMessageActionsOpenSenderProfileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_message_actions_open_sender_profile_co (_data_);
}

static gboolean
dc_message_actions_open_sender_profile_co (DcMessageActionsOpenSenderProfileData* _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_->_tmp0_ = _data_->self->priv->message_store;
	_data_->_tmp1_ = dc_find_message ((GListModel*) _data_->_tmp0_, _data_->msg_id);
	_data_->m = _data_->_tmp1_;
	_data_->_tmp4_ = _data_->m;
	if (_data_->_tmp4_ == NULL) {
		_data_->_tmp3_ = TRUE;
	} else {
		_data_->_tmp5_ = _data_->m;
		_data_->_tmp6_ = dc_message_get_sender_address (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp3_ = _data_->_tmp7_ == NULL;
	}
	if (_data_->_tmp3_) {
		_data_->_tmp2_ = TRUE;
	} else {
		_data_->_tmp8_ = _data_->m;
		_data_->_tmp9_ = dc_message_get_is_outgoing (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp2_ = _data_->_tmp10_;
	}
	if (_data_->_tmp2_) {
		_g_object_unref0 (_data_->m);
		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_->_tmp11_ = _data_->self->priv->rpc;
		_data_->_tmp12_ = _data_->m;
		_data_->_tmp13_ = dc_message_get_sender_address (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_state_ = 1;
		dc_rpc_client_lookup_contact (_data_->_tmp11_, _data_->_tmp14_, dc_message_actions_open_sender_profile_ready, _data_);
		return FALSE;
		_state_1:
		_data_->contact_id = dc_rpc_client_lookup_contact_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->contact_id <= 0) {
			_g_object_unref0 (_data_->m);
			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->rpc;
		_data_->_state_ = 2;
		dc_rpc_client_get_or_create_chat_by_contact (_data_->_tmp15_, _data_->contact_id, dc_message_actions_open_sender_profile_ready, _data_);
		return FALSE;
		_state_2:
		_data_->chat_id = dc_rpc_client_get_or_create_chat_by_contact_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->chat_id > 0) {
			_data_->_tmp16_ = _data_->self->priv->window;
			dc_window_request_reload_chats (_data_->_tmp16_);
			_data_->_tmp17_ = _data_->self->priv->window;
			dc_window_select_chat_by_id (_data_->_tmp17_, _data_->chat_id);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp18_ = _data_->self->priv->window;
		_data_->_tmp19_ = _data_->e;
		_data_->_tmp20_ = _data_->_tmp19_->message;
		_data_->_tmp21_ = g_strconcat ("Could not open profile: ", _data_->_tmp20_, NULL);
		_data_->_tmp22_ = _data_->_tmp21_;
		dc_window_show_toast (_data_->_tmp18_, _data_->_tmp22_);
		_g_free0 (_data_->_tmp22_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->m);
		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;
	}
	_g_object_unref0 (_data_->m);
	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 void
dc_message_actions_class_init (DcMessageActionsClass * klass,
                               gpointer klass_data)
{
	dc_message_actions_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcMessageActions_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dc_message_actions_finalize;
	dc_message_actions_signals[DC_MESSAGE_ACTIONS_SELECT_REQUESTED_SIGNAL] = g_signal_new ("select-requested", DC_TYPE_MESSAGE_ACTIONS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
}

static void
dc_message_actions_instance_init (DcMessageActions * self,
                                  gpointer klass)
{
	self->priv = dc_message_actions_get_instance_private (self);
	self->priv->reaction_roster = NULL;
}

static void
dc_message_actions_finalize (GObject * obj)
{
	DcMessageActions * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_MESSAGE_ACTIONS, DcMessageActions);
	_g_object_unref0 (self->priv->reaction_roster);
	G_OBJECT_CLASS (dc_message_actions_parent_class)->finalize (obj);
}

static GType
dc_message_actions_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcMessageActionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_message_actions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcMessageActions), 0, (GInstanceInitFunc) dc_message_actions_instance_init, NULL };
	GType dc_message_actions_type_id;
	dc_message_actions_type_id = g_type_register_static (G_TYPE_OBJECT, "DcMessageActions", &g_define_type_info, 0);
	DcMessageActions_private_offset = g_type_add_instance_private (dc_message_actions_type_id, sizeof (DcMessageActionsPrivate));
	return dc_message_actions_type_id;
}

GType
dc_message_actions_get_type (void)
{
	static volatile gsize dc_message_actions_type_id__once = 0;
	if (g_once_init_enter (&dc_message_actions_type_id__once)) {
		GType dc_message_actions_type_id;
		dc_message_actions_type_id = dc_message_actions_get_type_once ();
		g_once_init_leave (&dc_message_actions_type_id__once, dc_message_actions_type_id);
	}
	return dc_message_actions_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 gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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

