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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <adwaita.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <glib/gstdio.h>
#include <json-glib/json-glib.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

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 ())

#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 _DcPopoverButtonPrivate DcPopoverButtonPrivate;
enum  {
	DC_POPOVER_BUTTON_0_PROPERTY,
	DC_POPOVER_BUTTON_NUM_PROPERTIES
};
static GParamSpec* dc_popover_button_properties[DC_POPOVER_BUTTON_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	DC_POPOVER_BUTTON_SELECTED_SIGNAL,
	DC_POPOVER_BUTTON_NUM_SIGNALS
};
static guint dc_popover_button_signals[DC_POPOVER_BUTTON_NUM_SIGNALS] = {0};
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _DcConfirmActionData DcConfirmActionData;
typedef struct _DcConfirmDeleteOptionsData DcConfirmDeleteOptionsData;
typedef struct _Block14Data Block14Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))

#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 _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))

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

typedef struct _DcMessage DcMessage;
typedef struct _DcMessageClass DcMessageClass;
typedef struct _DcChatMessageIdsForClearData DcChatMessageIdsForClearData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _DcPickImageFileData DcPickImageFileData;

#define DC_TYPE_CONTACT (dc_contact_get_type ())
#define DC_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_CONTACT, DcContact))
#define DC_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_CONTACT, DcContactClass))
#define DC_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_CONTACT))
#define DC_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_CONTACT))
#define DC_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_CONTACT, DcContactClass))

typedef struct _DcContact DcContact;
typedef struct _DcContactClass DcContactClass;

#define DC_TYPE_CHAT_ENTRY (dc_chat_entry_get_type ())
#define DC_CHAT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_CHAT_ENTRY, DcChatEntry))
#define DC_CHAT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_CHAT_ENTRY, DcChatEntryClass))
#define DC_IS_CHAT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_CHAT_ENTRY))
#define DC_IS_CHAT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_CHAT_ENTRY))
#define DC_CHAT_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_CHAT_ENTRY, DcChatEntryClass))

typedef struct _DcChatEntry DcChatEntry;
typedef struct _DcChatEntryClass DcChatEntryClass;
typedef struct _DcChatEntryPrivate DcChatEntryPrivate;
typedef enum  {
	DC_CHAT_KIND_UNKNOWN = 0,
	DC_CHAT_KIND_DIRECT = 1,
	DC_CHAT_KIND_GROUP = 2
} DcChatKind;

#define DC_TYPE_CHAT_KIND (dc_chat_kind_get_type ())
enum  {
	DC_CHAT_ENTRY_0_PROPERTY,
	DC_CHAT_ENTRY_ID_PROPERTY,
	DC_CHAT_ENTRY_NAME_PROPERTY,
	DC_CHAT_ENTRY_LAST_MESSAGE_PROPERTY,
	DC_CHAT_ENTRY_LAST_MESSAGE_ID_PROPERTY,
	DC_CHAT_ENTRY_SUMMARY_PREFIX_PROPERTY,
	DC_CHAT_ENTRY_TIMESTAMP_PROPERTY,
	DC_CHAT_ENTRY_UNREAD_COUNT_PROPERTY,
	DC_CHAT_ENTRY_AVATAR_PATH_PROPERTY,
	DC_CHAT_ENTRY_KIND_PROPERTY,
	DC_CHAT_ENTRY_IS_MUTED_PROPERTY,
	DC_CHAT_ENTRY_IS_CONTACT_REQUEST_PROPERTY,
	DC_CHAT_ENTRY_IS_PINNED_PROPERTY,
	DC_CHAT_ENTRY_IS_ARCHIVED_PROPERTY,
	DC_CHAT_ENTRY_WAS_SEEN_RECENTLY_PROPERTY,
	DC_CHAT_ENTRY_HAS_MENTION_PROPERTY,
	DC_CHAT_ENTRY_NUM_PROPERTIES
};
static GParamSpec* dc_chat_entry_properties[DC_CHAT_ENTRY_NUM_PROPERTIES];

#define DC_TYPE_MESSAGE_REACTION_USER (dc_message_reaction_user_get_type ())
#define DC_MESSAGE_REACTION_USER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MESSAGE_REACTION_USER, DcMessageReactionUser))
#define DC_MESSAGE_REACTION_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MESSAGE_REACTION_USER, DcMessageReactionUserClass))
#define DC_IS_MESSAGE_REACTION_USER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MESSAGE_REACTION_USER))
#define DC_IS_MESSAGE_REACTION_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MESSAGE_REACTION_USER))
#define DC_MESSAGE_REACTION_USER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MESSAGE_REACTION_USER, DcMessageReactionUserClass))

typedef struct _DcMessageReactionUser DcMessageReactionUser;
typedef struct _DcMessageReactionUserClass DcMessageReactionUserClass;
typedef struct _DcMessageReactionUserPrivate DcMessageReactionUserPrivate;
enum  {
	DC_MESSAGE_REACTION_USER_0_PROPERTY,
	DC_MESSAGE_REACTION_USER_CONTACT_ID_PROPERTY,
	DC_MESSAGE_REACTION_USER_NUM_PROPERTIES
};
static GParamSpec* dc_message_reaction_user_properties[DC_MESSAGE_REACTION_USER_NUM_PROPERTIES];

#define DC_TYPE_MESSAGE_REACTION (dc_message_reaction_get_type ())
#define DC_MESSAGE_REACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MESSAGE_REACTION, DcMessageReaction))
#define DC_MESSAGE_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MESSAGE_REACTION, DcMessageReactionClass))
#define DC_IS_MESSAGE_REACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MESSAGE_REACTION))
#define DC_IS_MESSAGE_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MESSAGE_REACTION))
#define DC_MESSAGE_REACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MESSAGE_REACTION, DcMessageReactionClass))

typedef struct _DcMessageReaction DcMessageReaction;
typedef struct _DcMessageReactionClass DcMessageReactionClass;
typedef struct _DcMessageReactionPrivate DcMessageReactionPrivate;
enum  {
	DC_MESSAGE_REACTION_0_PROPERTY,
	DC_MESSAGE_REACTION_EMOJI_PROPERTY,
	DC_MESSAGE_REACTION_COUNT_PROPERTY,
	DC_MESSAGE_REACTION_NUM_PROPERTIES
};
static GParamSpec* dc_message_reaction_properties[DC_MESSAGE_REACTION_NUM_PROPERTIES];
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
typedef enum  {
	DC_MESSAGE_STATE_UNDEFINED = 0,
	DC_MESSAGE_STATE_IN_FRESH = 10,
	DC_MESSAGE_STATE_IN_NOTICED = 13,
	DC_MESSAGE_STATE_IN_SEEN = 16,
	DC_MESSAGE_STATE_OUT_PREPARING = 18,
	DC_MESSAGE_STATE_OUT_DRAFT = 19,
	DC_MESSAGE_STATE_OUT_PENDING = 20,
	DC_MESSAGE_STATE_OUT_FAILED = 24,
	DC_MESSAGE_STATE_OUT_DELIVERED = 26,
	DC_MESSAGE_STATE_OUT_MDN_RCVD = 28
} DcMessageState;

#define DC_TYPE_MESSAGE_STATE (dc_message_state_get_type ())
typedef struct _DcMessagePrivate DcMessagePrivate;
enum  {
	DC_MESSAGE_0_PROPERTY,
	DC_MESSAGE_ID_PROPERTY,
	DC_MESSAGE_CHAT_ID_PROPERTY,
	DC_MESSAGE_TEXT_PROPERTY,
	DC_MESSAGE_SENDER_ADDRESS_PROPERTY,
	DC_MESSAGE_SENDER_NAME_PROPERTY,
	DC_MESSAGE_SENDER_AVATAR_PATH_PROPERTY,
	DC_MESSAGE_SENDER_CONTACT_ID_PROPERTY,
	DC_MESSAGE_SENDER_WAS_SEEN_RECENTLY_PROPERTY,
	DC_MESSAGE_IS_FORWARDED_PROPERTY,
	DC_MESSAGE_IS_EDITED_PROPERTY,
	DC_MESSAGE_OVERRIDE_SENDER_NAME_PROPERTY,
	DC_MESSAGE_TIMESTAMP_PROPERTY,
	DC_MESSAGE_IS_OUTGOING_PROPERTY,
	DC_MESSAGE_FILE_PATH_PROPERTY,
	DC_MESSAGE_FILE_NAME_PROPERTY,
	DC_MESSAGE_FILE_MIME_PROPERTY,
	DC_MESSAGE_FILE_BYTES_PROPERTY,
	DC_MESSAGE_VIEW_TYPE_PROPERTY,
	DC_MESSAGE_IS_INFO_PROPERTY,
	DC_MESSAGE_HAS_HTML_PROPERTY,
	DC_MESSAGE_DOWNLOAD_STATE_PROPERTY,
	DC_MESSAGE_REACTIONS_PROPERTY,
	DC_MESSAGE_MY_REACTIONS_PROPERTY,
	DC_MESSAGE_QUOTE_MSG_ID_PROPERTY,
	DC_MESSAGE_QUOTE_TEXT_PROPERTY,
	DC_MESSAGE_QUOTE_SENDER_NAME_PROPERTY,
	DC_MESSAGE_IS_PINNED_PROPERTY,
	DC_MESSAGE_HIGHLIGHTED_PROPERTY,
	DC_MESSAGE_SELECTION_VISIBLE_PROPERTY,
	DC_MESSAGE_SELECTED_PROPERTY,
	DC_MESSAGE_FULL_MESSAGE_TEXT_PROPERTY,
	DC_MESSAGE_FULL_MESSAGE_EXPANDED_PROPERTY,
	DC_MESSAGE_FULL_MESSAGE_LOADING_PROPERTY,
	DC_MESSAGE_STATE_PROPERTY,
	DC_MESSAGE_IS_PENDING_PROPERTY,
	DC_MESSAGE_IS_DELIVERED_PROPERTY,
	DC_MESSAGE_IS_READ_PROPERTY,
	DC_MESSAGE_IS_FAILED_PROPERTY,
	DC_MESSAGE_HAS_TEXT_PROPERTY,
	DC_MESSAGE_CAN_DOWNLOAD_FULL_MESSAGE_PROPERTY,
	DC_MESSAGE_IS_DOWNLOADING_FULL_MESSAGE_PROPERTY,
	DC_MESSAGE_HAS_FULL_MESSAGE_ACTION_PROPERTY,
	DC_MESSAGE_CAN_EDIT_TEXT_PROPERTY,
	DC_MESSAGE_HAS_FILE_PROPERTY,
	DC_MESSAGE_HAS_LOCAL_FILE_PROPERTY,
	DC_MESSAGE_IS_IMAGE_ONLY_PROPERTY,
	DC_MESSAGE_NUM_PROPERTIES
};
static GParamSpec* dc_message_properties[DC_MESSAGE_NUM_PROPERTIES];
typedef struct _DcContactPrivate DcContactPrivate;
enum  {
	DC_CONTACT_0_PROPERTY,
	DC_CONTACT_ID_PROPERTY,
	DC_CONTACT_DISPLAY_NAME_PROPERTY,
	DC_CONTACT_ADDRESS_PROPERTY,
	DC_CONTACT_PROFILE_IMAGE_PROPERTY,
	DC_CONTACT_IS_VERIFIED_PROPERTY,
	DC_CONTACT_IS_BLOCKED_PROPERTY,
	DC_CONTACT_STATUS_PROPERTY,
	DC_CONTACT_WAS_SEEN_RECENTLY_PROPERTY,
	DC_CONTACT_NUM_PROPERTIES
};
static GParamSpec* dc_contact_properties[DC_CONTACT_NUM_PROPERTIES];

struct _DcPopoverButton {
	GtkButton parent_instance;
	DcPopoverButtonPrivate * priv;
};

struct _DcPopoverButtonClass {
	GtkButtonClass parent_class;
};

struct _DcPopoverButtonPrivate {
	GWeakRef popover_ref;
};

struct _DcConfirmActionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GtkWidget* parent;
	gchar* title;
	gchar* body;
	gchar* action_id;
	gchar* action_label;
	gboolean result;
	AdwAlertDialog* d;
	AdwAlertDialog* _tmp0_;
	const gchar* _tmp1_;
};

struct _DcConfirmDeleteOptionsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GtkWidget* parent;
	gchar* title;
	gchar* body;
	gboolean allow_delete_for_everyone;
	DcDeleteChoice result;
	AdwAlertDialog* d;
	AdwAlertDialog* _tmp0_;
	AdwAlertDialog* _tmp1_;
	AdwAlertDialog* _tmp2_;
	AdwAlertDialog* _tmp3_;
	AdwAlertDialog* _tmp4_;
	AdwAlertDialog* _tmp5_;
	AdwAlertDialog* _tmp6_;
	AdwAlertDialog* _tmp7_;
	gchar* response;
	AdwAlertDialog* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
};

struct _Block14Data {
	int _ref_count_;
	GtkPopover* popover;
};

struct _DcChatMessageIdsForClearData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* rpc;
	gint account_id;
	gint chat_id;
	gboolean for_all;
	gint* result;
	gint result_length1;
	JsonArray* msg_ids;
	JsonArray* _tmp0_;
	gboolean _tmp1_;
	JsonArray* _tmp2_;
	JsonArray* _tmp3_;
	gint* _tmp4_;
	gint* _tmp5_;
	gint _tmp5__length1;
	gint* all_ids;
	JsonArray* _tmp6_;
	gint* _tmp7_;
	gint all_ids_length1;
	gint _all_ids_size_;
	guint i;
	gboolean _tmp8_;
	guint _tmp9_;
	JsonArray* _tmp10_;
	gint* _tmp11_;
	gint _tmp11__length1;
	JsonArray* _tmp12_;
	gint* _tmp13_;
	gint _tmp13__length1;
	gint* ids;
	gint* _tmp14_;
	gint ids_length1;
	gint _ids_size_;
	JsonObject* map;
	gint* _tmp15_;
	gint _tmp15__length1;
	JsonObject* _tmp16_;
	JsonObject* _tmp17_;
	gint* _tmp18_;
	gint _tmp18__length1;
	gint* _tmp19_;
	gint _tmp19__length1;
	gint* msg_id_collection;
	gint msg_id_collection_length1;
	gint _msg_id_collection_size_;
	gint msg_id_it;
	gint msg_id;
	gchar* key;
	gchar* _tmp20_;
	JsonObject* _tmp21_;
	const gchar* _tmp22_;
	DcMessage* msg;
	JsonObject* _tmp23_;
	const gchar* _tmp24_;
	JsonObject* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	DcMessage* _tmp28_;
	DcMessage* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	gint* _tmp32_;
	gint _tmp32__length1;
	GError* _inner_error0_;
};

struct _DcPickImageFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GtkWindow* parent;
	gchar* title;
	gchar* result;
	GtkFileDialog* chooser;
	GtkFileDialog* _tmp0_;
	GtkFileDialog* _tmp1_;
	GtkFileFilter* filter;
	GtkFileFilter* _tmp2_;
	GtkFileFilter* _tmp3_;
	GtkFileFilter* _tmp4_;
	GListStore* filters;
	GListStore* _tmp5_;
	GListStore* _tmp6_;
	GtkFileFilter* _tmp7_;
	GtkFileDialog* _tmp8_;
	GListStore* _tmp9_;
	GFile* file;
	GtkFileDialog* _tmp10_;
	GFile* _tmp11_;
	GFile* _tmp12_;
	GFile* _tmp13_;
	gchar* _tmp14_;
	GError* e;
	GError* _tmp15_;
	GError* _tmp16_;
	const gchar* _tmp17_;
	GError* _inner_error0_;
};

struct _DcChatEntry {
	GObject parent_instance;
	DcChatEntryPrivate * priv;
};

struct _DcChatEntryClass {
	GObjectClass parent_class;
};

struct _DcChatEntryPrivate {
	gint _id;
	gchar* _name;
	gchar* _last_message;
	gint _last_message_id;
	gchar* _summary_prefix;
	gint64 _timestamp;
	gint _unread_count;
	gchar* _avatar_path;
	DcChatKind _kind;
	gboolean _is_muted;
	gboolean _is_contact_request;
	gboolean _is_pinned;
	gboolean _is_archived;
	gboolean _was_seen_recently;
	gboolean _has_mention;
};

struct _DcMessageReactionUser {
	GObject parent_instance;
	DcMessageReactionUserPrivate * priv;
};

struct _DcMessageReactionUserClass {
	GObjectClass parent_class;
};

struct _DcMessageReactionUserPrivate {
	gint _contact_id;
};

struct _DcMessageReaction {
	GObject parent_instance;
	DcMessageReactionPrivate * priv;
	GPtrArray* users;
};

struct _DcMessageReactionClass {
	GObjectClass parent_class;
};

struct _DcMessageReactionPrivate {
	gchar* _emoji;
	gint _count;
};

struct _DcMessage {
	GObject parent_instance;
	DcMessagePrivate * priv;
	GPtrArray* reaction_details;
};

struct _DcMessageClass {
	GObjectClass parent_class;
};

struct _DcMessagePrivate {
	gint _id;
	gint _chat_id;
	gchar* _text;
	gchar* _sender_address;
	gchar* _sender_name;
	gchar* _sender_avatar_path;
	gint _sender_contact_id;
	gboolean _sender_was_seen_recently;
	gboolean _is_forwarded;
	gboolean _is_edited;
	gchar* _override_sender_name;
	gint64 _timestamp;
	gboolean _is_outgoing;
	gchar* _file_path;
	gchar* _file_name;
	gchar* _file_mime;
	gint _file_bytes;
	gchar* _view_type;
	gboolean _is_info;
	gboolean _has_html;
	gchar* _download_state;
	gchar* _reactions;
	gchar* _my_reactions;
	gint _quote_msg_id;
	gchar* _quote_text;
	gchar* _quote_sender_name;
	gboolean _is_pinned;
	gboolean _highlighted;
	gboolean _selection_visible;
	gboolean _selected;
	gchar* _full_message_text;
	gboolean _full_message_expanded;
	gboolean _full_message_loading;
	gint _state;
};

struct _DcContact {
	GObject parent_instance;
	DcContactPrivate * priv;
};

struct _DcContactClass {
	GObjectClass parent_class;
};

struct _DcContactPrivate {
	gint _id;
	gchar* _display_name;
	gchar* _address;
	gchar* _profile_image;
	gboolean _is_verified;
	gboolean _is_blocked;
	gchar* _status;
	gboolean _was_seen_recently;
};

static gint DcPopoverButton_private_offset;
static gpointer dc_popover_button_parent_class = NULL;
static gint DcChatEntry_private_offset;
static gpointer dc_chat_entry_parent_class = NULL;
static gint DcMessageReactionUser_private_offset;
static gpointer dc_message_reaction_user_parent_class = NULL;
static gint DcMessageReaction_private_offset;
static gpointer dc_message_reaction_parent_class = NULL;
static gint DcMessage_private_offset;
static gpointer dc_message_parent_class = NULL;
static gint DcContact_private_offset;
static gpointer dc_contact_parent_class = NULL;

VALA_EXTERN GType dc_delete_choice_get_type (void) G_GNUC_CONST ;
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 dc_popover_button_real_clicked (GtkButton* base);
static gboolean __lambda66_ (DcPopoverButton* self);
static gboolean ___lambda66__gsource_func (gpointer self);
static void dc_popover_button_finalize (GObject * obj);
static GType dc_popover_button_get_type_once (void);
VALA_EXTERN void dc_show_error (GtkWidget* parent,
                    const gchar* message);
VALA_EXTERN gboolean dc_is_dialog_dismissal (GError* _error_);
static void dc_confirm_action_data_free (gpointer _data);
VALA_EXTERN void dc_confirm_action (GtkWidget* parent,
                        const gchar* title,
                        const gchar* body,
                        const gchar* action_id,
                        const gchar* action_label,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_);
VALA_EXTERN gboolean dc_confirm_action_finish (GAsyncResult* _res_);
static gboolean dc_confirm_action_co (DcConfirmActionData* _data_);
static void dc_confirm_action_ready (GObject* source_object,
                              GAsyncResult* _res_,
                              gpointer _user_data_);
static void dc_confirm_delete_options_data_free (gpointer _data);
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 gboolean dc_confirm_delete_options_co (DcConfirmDeleteOptionsData* _data_);
static void dc_confirm_delete_options_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
VALA_EXTERN GtkPopover* dc_popover_menu (GtkWidget* parent,
                             gdouble x,
                             gdouble y,
                             GtkBox** vbox);
VALA_EXTERN void dc_unparent_on_close (GtkPopover* popover);
VALA_EXTERN void dc_on_popover_closed (GtkPopover* popover);
static void _dc_on_popover_closed_gtk_popover_closed (GtkPopover* _sender,
                                               gpointer self);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static gboolean __lambda65_ (Block14Data* _data14_);
static gboolean ___lambda65__gsource_func (gpointer self);
VALA_EXTERN void dc_install_escape_close (AdwDialog* dialog);
VALA_EXTERN gboolean dc_on_dialog_key_pressed (GtkEventControllerKey* controller,
                                   guint keyval,
                                   guint keycode,
                                   GdkModifierType state,
                                   AdwDialog* dialog);
VALA_EXTERN GdkTexture* dc_load_avatar (const gchar* path);
VALA_EXTERN gchar* dc_format_date_time (gint64 ts);
VALA_EXTERN gchar* dc_json_str (JsonObject* obj,
                    const gchar* key);
static JsonNode* _vala_JsonNode_copy (JsonNode* self);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN gint64 dc_json_int (JsonObject* obj,
                    const gchar* key,
                    gint64 fallback);
VALA_EXTERN gboolean dc_json_bool (JsonObject* obj,
                       const gchar* key);
VALA_EXTERN void dc_clear_listbox (GtkListBox* lb);
static void dc_chat_message_ids_for_clear_data_free (gpointer _data);
VALA_EXTERN GType dc_rpc_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRpcClient, g_object_unref)
VALA_EXTERN void dc_chat_message_ids_for_clear (DcRpcClient* rpc,
                                    gint account_id,
                                    gint chat_id,
                                    gboolean for_all,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN gint* dc_chat_message_ids_for_clear_finish (GAsyncResult* _res_,
                                            gint* result_length1,
                                            GError** error);
static gboolean dc_chat_message_ids_for_clear_co (DcChatMessageIdsForClearData* _data_);
VALA_EXTERN void dc_rpc_client_get_message_ids_for (DcRpcClient* self,
                                        gint acct_id,
                                        gint chat_id,
                                        gboolean info_only,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_message_ids_for_finish (DcRpcClient* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static void dc_chat_message_ids_for_clear_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_get_messages_for (DcRpcClient* self,
                                     gint acct_id,
                                     gint* msg_ids,
                                     gint msg_ids_length1,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_messages_for_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
VALA_EXTERN GType dc_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessage, g_object_unref)
VALA_EXTERN DcMessage* dc_rpc_parsers_parse_message (JsonObject* obj,
                                         const gchar* self_email);
VALA_EXTERN const gchar* dc_rpc_client_get_self_email (DcRpcClient* self);
VALA_EXTERN gboolean dc_message_get_is_outgoing (DcMessage* self);
static void _vala_array_add18 (gint* * array,
                        gint* length,
                        gint* size,
                        gint value);
static void dc_pick_image_file_data_free (gpointer _data);
VALA_EXTERN void dc_pick_image_file (GtkWindow* parent,
                         const gchar* title,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_);
VALA_EXTERN gchar* dc_pick_image_file_finish (GAsyncResult* _res_);
static gboolean dc_pick_image_file_co (DcPickImageFileData* _data_);
static void dc_pick_image_file_ready (GObject* source_object,
                               GAsyncResult* _res_,
                               gpointer _user_data_);
VALA_EXTERN GType dc_contact_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcContact, g_object_unref)
VALA_EXTERN AdwActionRow* dc_contact_row (DcContact* c,
                              gboolean activatable,
                              gboolean show_presence);
VALA_EXTERN const gchar* dc_contact_get_display_name (DcContact* self);
VALA_EXTERN const gchar* dc_contact_get_address (DcContact* self);
VALA_EXTERN gboolean dc_contact_get_is_verified (DcContact* self);
VALA_EXTERN gboolean dc_contact_get_is_blocked (DcContact* self);
VALA_EXTERN gboolean dc_contact_get_was_seen_recently (DcContact* self);
VALA_EXTERN GtkWidget* dc_presence_avatar (gint size,
                               const gchar* text,
                               const gchar* path,
                               gboolean online,
                               const gchar* avatar_css,
                               const gchar* ring_css);
VALA_EXTERN const gchar* dc_contact_get_profile_image (DcContact* self);
VALA_EXTERN GType dc_chat_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcChatEntry, g_object_unref)
VALA_EXTERN AdwActionRow* dc_chat_pick_row (DcChatEntry* chat);
VALA_EXTERN const gchar* dc_chat_entry_get_name (DcChatEntry* self);
VALA_EXTERN const gchar* dc_chat_entry_get_last_message (DcChatEntry* self);
VALA_EXTERN gchar* dc_markdown_single_line_preview (const gchar* input,
                                        gint max_chars);
VALA_EXTERN gint dc_chat_entry_get_id (DcChatEntry* self);
VALA_EXTERN const gchar* dc_chat_entry_get_avatar_path (DcChatEntry* self);
VALA_EXTERN gboolean dc_chat_entry_get_was_seen_recently (DcChatEntry* self);
VALA_EXTERN GType dc_chat_kind_get_type (void) G_GNUC_CONST ;
VALA_EXTERN DcChatEntry* dc_chat_entry_new (void);
VALA_EXTERN DcChatEntry* dc_chat_entry_construct (GType object_type);
VALA_EXTERN void dc_chat_entry_set_id (DcChatEntry* self,
                           gint value);
VALA_EXTERN void dc_chat_entry_set_name (DcChatEntry* self,
                             const gchar* value);
VALA_EXTERN void dc_chat_entry_set_last_message (DcChatEntry* self,
                                     const gchar* value);
VALA_EXTERN gint dc_chat_entry_get_last_message_id (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_last_message_id (DcChatEntry* self,
                                        gint value);
VALA_EXTERN const gchar* dc_chat_entry_get_summary_prefix (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_summary_prefix (DcChatEntry* self,
                                       const gchar* value);
VALA_EXTERN gint64 dc_chat_entry_get_timestamp (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_timestamp (DcChatEntry* self,
                                  gint64 value);
VALA_EXTERN gint dc_chat_entry_get_unread_count (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_unread_count (DcChatEntry* self,
                                     gint value);
VALA_EXTERN void dc_chat_entry_set_avatar_path (DcChatEntry* self,
                                    const gchar* value);
VALA_EXTERN DcChatKind dc_chat_entry_get_kind (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_kind (DcChatEntry* self,
                             DcChatKind value);
VALA_EXTERN gboolean dc_chat_entry_get_is_muted (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_is_muted (DcChatEntry* self,
                                 gboolean value);
VALA_EXTERN gboolean dc_chat_entry_get_is_contact_request (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_is_contact_request (DcChatEntry* self,
                                           gboolean value);
VALA_EXTERN gboolean dc_chat_entry_get_is_pinned (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_is_pinned (DcChatEntry* self,
                                  gboolean value);
VALA_EXTERN gboolean dc_chat_entry_get_is_archived (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_is_archived (DcChatEntry* self,
                                    gboolean value);
VALA_EXTERN void dc_chat_entry_set_was_seen_recently (DcChatEntry* self,
                                          gboolean value);
VALA_EXTERN gboolean dc_chat_entry_get_has_mention (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_has_mention (DcChatEntry* self,
                                    gboolean value);
static void dc_chat_entry_finalize (GObject * obj);
static GType dc_chat_entry_get_type_once (void);
static void _vala_dc_chat_entry_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec);
static void _vala_dc_chat_entry_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec);
VALA_EXTERN GType dc_message_reaction_user_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessageReactionUser, g_object_unref)
VALA_EXTERN DcMessageReactionUser* dc_message_reaction_user_new (gint contact_id);
VALA_EXTERN DcMessageReactionUser* dc_message_reaction_user_construct (GType object_type,
                                                           gint contact_id);
VALA_EXTERN void dc_message_reaction_user_set_contact_id (DcMessageReactionUser* self,
                                              gint value);
VALA_EXTERN gint dc_message_reaction_user_get_contact_id (DcMessageReactionUser* self);
static void dc_message_reaction_user_finalize (GObject * obj);
static GType dc_message_reaction_user_get_type_once (void);
static void _vala_dc_message_reaction_user_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_dc_message_reaction_user_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);
VALA_EXTERN GType dc_message_reaction_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessageReaction, g_object_unref)
static void _g_object_unref0_ (gpointer var);
VALA_EXTERN DcMessageReaction* dc_message_reaction_new (const gchar* emoji);
VALA_EXTERN DcMessageReaction* dc_message_reaction_construct (GType object_type,
                                                  const gchar* emoji);
VALA_EXTERN void dc_message_reaction_set_emoji (DcMessageReaction* self,
                                    const gchar* value);
VALA_EXTERN void dc_message_reaction_add_user (DcMessageReaction* self,
                                   gint contact_id);
VALA_EXTERN gint dc_message_reaction_get_count (DcMessageReaction* self);
VALA_EXTERN void dc_message_reaction_set_count (DcMessageReaction* self,
                                    gint value);
VALA_EXTERN const gchar* dc_message_reaction_get_emoji (DcMessageReaction* self);
static void dc_message_reaction_finalize (GObject * obj);
static GType dc_message_reaction_get_type_once (void);
static void _vala_dc_message_reaction_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_dc_message_reaction_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);
VALA_EXTERN GType dc_message_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gboolean dc_message_is_image_file (DcMessage* self);
static gboolean dc_message_has_mime (DcMessage* self,
                              const gchar* prefix);
static gboolean dc_message_view_type_is (DcMessage* self,
                                  const gchar* a,
                                  const gchar* b,
                                  const gchar* c);
static gboolean dc_message_path_has_suffix (DcMessage* self,
                                     gchar** suffixes,
                                     gint suffixes_length1);
VALA_EXTERN gboolean dc_message_is_sticker_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_is_webxdc (DcMessage* self);
VALA_EXTERN gboolean dc_message_is_video_sticker_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_is_video_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_is_audio_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_is_text_preview_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_is_markdown_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_is_html_file (DcMessage* self);
VALA_EXTERN gchar* dc_message_display_file_name (DcMessage* self,
                                     const gchar* fallback);
static gboolean dc_message_has_value (DcMessage* self,
                               const gchar* value);
VALA_EXTERN const gchar* dc_message_get_file_name (DcMessage* self);
VALA_EXTERN DcMessage* dc_message_dup (DcMessage* self);
VALA_EXTERN DcMessage* dc_message_new (void);
VALA_EXTERN DcMessage* dc_message_construct (GType object_type);
VALA_EXTERN const gchar* dc_message_get_file_mime (DcMessage* self);
VALA_EXTERN const gchar* dc_message_get_view_type (DcMessage* self);
VALA_EXTERN const gchar* dc_message_get_file_path (DcMessage* self);
VALA_EXTERN gint dc_message_get_id (DcMessage* self);
VALA_EXTERN void dc_message_set_id (DcMessage* self,
                        gint value);
VALA_EXTERN gint dc_message_get_chat_id (DcMessage* self);
VALA_EXTERN void dc_message_set_chat_id (DcMessage* self,
                             gint value);
VALA_EXTERN const gchar* dc_message_get_text (DcMessage* self);
VALA_EXTERN void dc_message_set_text (DcMessage* self,
                          const gchar* value);
VALA_EXTERN const gchar* dc_message_get_sender_address (DcMessage* self);
VALA_EXTERN void dc_message_set_sender_address (DcMessage* self,
                                    const gchar* value);
VALA_EXTERN const gchar* dc_message_get_sender_name (DcMessage* self);
VALA_EXTERN void dc_message_set_sender_name (DcMessage* self,
                                 const gchar* value);
VALA_EXTERN const gchar* dc_message_get_sender_avatar_path (DcMessage* self);
VALA_EXTERN void dc_message_set_sender_avatar_path (DcMessage* self,
                                        const gchar* value);
VALA_EXTERN gint dc_message_get_sender_contact_id (DcMessage* self);
VALA_EXTERN void dc_message_set_sender_contact_id (DcMessage* self,
                                       gint value);
VALA_EXTERN gboolean dc_message_get_sender_was_seen_recently (DcMessage* self);
VALA_EXTERN void dc_message_set_sender_was_seen_recently (DcMessage* self,
                                              gboolean value);
VALA_EXTERN gboolean dc_message_get_is_forwarded (DcMessage* self);
VALA_EXTERN void dc_message_set_is_forwarded (DcMessage* self,
                                  gboolean value);
VALA_EXTERN gboolean dc_message_get_is_edited (DcMessage* self);
VALA_EXTERN void dc_message_set_is_edited (DcMessage* self,
                               gboolean value);
VALA_EXTERN const gchar* dc_message_get_override_sender_name (DcMessage* self);
VALA_EXTERN void dc_message_set_override_sender_name (DcMessage* self,
                                          const gchar* value);
VALA_EXTERN gint64 dc_message_get_timestamp (DcMessage* self);
VALA_EXTERN void dc_message_set_timestamp (DcMessage* self,
                               gint64 value);
VALA_EXTERN void dc_message_set_is_outgoing (DcMessage* self,
                                 gboolean value);
VALA_EXTERN void dc_message_set_file_path (DcMessage* self,
                               const gchar* value);
VALA_EXTERN void dc_message_set_file_name (DcMessage* self,
                               const gchar* value);
VALA_EXTERN void dc_message_set_file_mime (DcMessage* self,
                               const gchar* value);
VALA_EXTERN gint dc_message_get_file_bytes (DcMessage* self);
VALA_EXTERN void dc_message_set_file_bytes (DcMessage* self,
                                gint value);
VALA_EXTERN void dc_message_set_view_type (DcMessage* self,
                               const gchar* value);
VALA_EXTERN gboolean dc_message_get_is_info (DcMessage* self);
VALA_EXTERN void dc_message_set_is_info (DcMessage* self,
                             gboolean value);
VALA_EXTERN gboolean dc_message_get_has_html (DcMessage* self);
VALA_EXTERN void dc_message_set_has_html (DcMessage* self,
                              gboolean value);
VALA_EXTERN const gchar* dc_message_get_download_state (DcMessage* self);
VALA_EXTERN void dc_message_set_download_state (DcMessage* self,
                                    const gchar* value);
VALA_EXTERN const gchar* dc_message_get_reactions (DcMessage* self);
VALA_EXTERN void dc_message_set_reactions (DcMessage* self,
                               const gchar* value);
VALA_EXTERN const gchar* dc_message_get_my_reactions (DcMessage* self);
VALA_EXTERN void dc_message_set_my_reactions (DcMessage* self,
                                  const gchar* value);
VALA_EXTERN gint dc_message_get_quote_msg_id (DcMessage* self);
VALA_EXTERN void dc_message_set_quote_msg_id (DcMessage* self,
                                  gint value);
VALA_EXTERN const gchar* dc_message_get_quote_text (DcMessage* self);
VALA_EXTERN void dc_message_set_quote_text (DcMessage* self,
                                const gchar* value);
VALA_EXTERN const gchar* dc_message_get_quote_sender_name (DcMessage* self);
VALA_EXTERN void dc_message_set_quote_sender_name (DcMessage* self,
                                       const gchar* value);
VALA_EXTERN gboolean dc_message_get_is_pinned (DcMessage* self);
VALA_EXTERN void dc_message_set_is_pinned (DcMessage* self,
                               gboolean value);
VALA_EXTERN gboolean dc_message_get_highlighted (DcMessage* self);
VALA_EXTERN void dc_message_set_highlighted (DcMessage* self,
                                 gboolean value);
VALA_EXTERN gboolean dc_message_get_selection_visible (DcMessage* self);
VALA_EXTERN void dc_message_set_selection_visible (DcMessage* self,
                                       gboolean value);
VALA_EXTERN gboolean dc_message_get_selected (DcMessage* self);
VALA_EXTERN void dc_message_set_selected (DcMessage* self,
                              gboolean value);
VALA_EXTERN const gchar* dc_message_get_full_message_text (DcMessage* self);
VALA_EXTERN void dc_message_set_full_message_text (DcMessage* self,
                                       const gchar* value);
VALA_EXTERN gboolean dc_message_get_full_message_expanded (DcMessage* self);
VALA_EXTERN void dc_message_set_full_message_expanded (DcMessage* self,
                                           gboolean value);
VALA_EXTERN gboolean dc_message_get_full_message_loading (DcMessage* self);
VALA_EXTERN void dc_message_set_full_message_loading (DcMessage* self,
                                          gboolean value);
VALA_EXTERN gint dc_message_get_state (DcMessage* self);
VALA_EXTERN void dc_message_set_state (DcMessage* self,
                           gint value);
VALA_EXTERN gboolean dc_message_get_is_pending (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_delivered (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_read (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_failed (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_has_text (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_can_download_full_message (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_downloading_full_message (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_has_full_message_action (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_can_edit_text (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_has_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_has_local_file (DcMessage* self);
VALA_EXTERN gboolean dc_message_get_is_image_only (DcMessage* self);
static void dc_message_finalize (GObject * obj);
static GType dc_message_get_type_once (void);
static void _vala_dc_message_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec);
static void _vala_dc_message_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec);
VALA_EXTERN DcContact* dc_contact_new (void);
VALA_EXTERN DcContact* dc_contact_construct (GType object_type);
VALA_EXTERN gint dc_contact_get_id (DcContact* self);
VALA_EXTERN void dc_contact_set_id (DcContact* self,
                        gint value);
VALA_EXTERN void dc_contact_set_display_name (DcContact* self,
                                  const gchar* value);
VALA_EXTERN void dc_contact_set_address (DcContact* self,
                             const gchar* value);
VALA_EXTERN void dc_contact_set_profile_image (DcContact* self,
                                   const gchar* value);
VALA_EXTERN void dc_contact_set_is_verified (DcContact* self,
                                 gboolean value);
VALA_EXTERN void dc_contact_set_is_blocked (DcContact* self,
                                gboolean value);
VALA_EXTERN const gchar* dc_contact_get_status (DcContact* self);
VALA_EXTERN void dc_contact_set_status (DcContact* self,
                            const gchar* value);
VALA_EXTERN void dc_contact_set_was_seen_recently (DcContact* self,
                                       gboolean value);
static void dc_contact_finalize (GObject * obj);
static GType dc_contact_get_type_once (void);
static void _vala_dc_contact_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec);
static void _vala_dc_contact_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec);
VALA_EXTERN DcChatEntry* dc_find_chat_entry (GListStore* store,
                                 gint chat_id);
VALA_EXTERN DcMessage* dc_find_message (GListModel* store,
                            gint msg_id);
VALA_EXTERN gint dc_find_message_index (GListModel* store,
                            gint msg_id);
VALA_EXTERN DcMessage* dc_find_last_editable_text_message (GListStore* store);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const gchar* DC_MESSAGE_IMAGE_EXTENSIONS[7] = {".jpg", ".jpeg", ".png", ".webp", ".gif", ".bmp", ".svg"};
static const gchar* DC_MESSAGE_STICKER_EXTENSIONS[3] = {".gif", ".webp", ".webm"};
static const gchar* DC_MESSAGE_VIDEO_EXTENSIONS[10] = {".mp4", ".m4v", ".webm", ".mkv", ".mov", ".avi", ".ogv", ".3gp", ".wmv", ".flv"};
static const gchar* DC_MESSAGE_AUDIO_EXTENSIONS[10] = {".mp3", ".ogg", ".oga", ".opus", ".wav", ".m4a", ".aac", ".flac", ".weba", ".amr"};
static const gchar* DC_MESSAGE_TEXT_EXTENSIONS[6] = {".txt", ".text", ".md", ".markdown", ".html", ".htm"};

static GType
dc_delete_choice_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_DELETE_CHOICE_CANCEL, "DC_DELETE_CHOICE_CANCEL", "cancel"}, {DC_DELETE_CHOICE_FOR_ME, "DC_DELETE_CHOICE_FOR_ME", "for-me"}, {DC_DELETE_CHOICE_FOR_EVERYONE, "DC_DELETE_CHOICE_FOR_EVERYONE", "for-everyone"}, {0, NULL, NULL}};
	GType dc_delete_choice_type_id;
	dc_delete_choice_type_id = g_enum_register_static ("DcDeleteChoice", values);
	return dc_delete_choice_type_id;
}

GType
dc_delete_choice_get_type (void)
{
	static volatile gsize dc_delete_choice_type_id__once = 0;
	if (g_once_init_enter (&dc_delete_choice_type_id__once)) {
		GType dc_delete_choice_type_id;
		dc_delete_choice_type_id = dc_delete_choice_get_type_once ();
		g_once_init_leave (&dc_delete_choice_type_id__once, dc_delete_choice_type_id);
	}
	return dc_delete_choice_type_id__once;
}

static inline gpointer
dc_popover_button_get_instance_private (DcPopoverButton* self)
{
	return G_STRUCT_MEMBER_P (self, DcPopoverButton_private_offset);
}

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

DcPopoverButton*
dc_popover_button_construct (GType object_type,
                             GtkPopover* popover,
                             const gchar* label,
                             gboolean destructive,
                             gboolean hexpand)
{
	DcPopoverButton * self = NULL;
	GtkLabel* label_widget = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	g_return_val_if_fail (popover != NULL, NULL);
	g_return_val_if_fail (label != NULL, NULL);
	self = (DcPopoverButton*) g_object_new (object_type, "label", label, "hexpand", hexpand, NULL);
	gtk_widget_add_css_class ((GtkWidget*) self, "flat");
	if (destructive) {
		gtk_widget_add_css_class ((GtkWidget*) self, "menu-destructive");
	}
	_tmp0_ = gtk_button_get_child ((GtkButton*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp1_) : NULL);
	label_widget = _tmp2_;
	_tmp3_ = label_widget;
	if (_tmp3_ != NULL) {
		GtkLabel* _tmp4_;
		GtkLabel* _tmp5_;
		_tmp4_ = label_widget;
		gtk_label_set_xalign (_tmp4_, (gfloat) 0);
		_tmp5_ = label_widget;
		gtk_widget_set_halign ((GtkWidget*) _tmp5_, GTK_ALIGN_START);
	}
	g_weak_ref_clear (&self->priv->popover_ref);
	g_weak_ref_init (&self->priv->popover_ref, (GObject*) popover);
	_g_object_unref0 (label_widget);
	return self;
}

DcPopoverButton*
dc_popover_button_new (GtkPopover* popover,
                       const gchar* label,
                       gboolean destructive,
                       gboolean hexpand)
{
	return dc_popover_button_construct (DC_TYPE_POPOVER_BUTTON, popover, label, destructive, hexpand);
}

static gboolean
__lambda66_ (DcPopoverButton* self)
{
	gboolean result;
	g_signal_emit (self, dc_popover_button_signals[DC_POPOVER_BUTTON_SELECTED_SIGNAL], 0);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda66__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda66_ ((DcPopoverButton*) self);
	return result;
}

static void
dc_popover_button_real_clicked (GtkButton* base)
{
	DcPopoverButton * self;
	GtkPopover* popover = NULL;
	GObject* _tmp0_;
	GtkPopover* _tmp1_;
	GtkPopover* _tmp2_;
	self = (DcPopoverButton*) base;
	gtk_widget_set_sensitive ((GtkWidget*) self, FALSE);
	_tmp0_ = g_weak_ref_get (&self->priv->popover_ref);
	_tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_popover_get_type ()) ? ((GtkPopover*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	popover = _tmp1_;
	_tmp2_ = popover;
	if (_tmp2_ != NULL) {
		GtkPopover* _tmp3_;
		_tmp3_ = popover;
		gtk_popover_popdown (_tmp3_);
	}
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda66__gsource_func, g_object_ref (self), g_object_unref);
	_g_object_unref0 (popover);
}

static void
dc_popover_button_class_init (DcPopoverButtonClass * klass,
                              gpointer klass_data)
{
	dc_popover_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcPopoverButton_private_offset);
	((GtkButtonClass *) klass)->clicked = (void (*) (GtkButton*)) dc_popover_button_real_clicked;
	G_OBJECT_CLASS (klass)->finalize = dc_popover_button_finalize;
	dc_popover_button_signals[DC_POPOVER_BUTTON_SELECTED_SIGNAL] = g_signal_new ("selected", DC_TYPE_POPOVER_BUTTON, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
dc_popover_button_instance_init (DcPopoverButton * self,
                                 gpointer klass)
{
	self->priv = dc_popover_button_get_instance_private (self);
}

static void
dc_popover_button_finalize (GObject * obj)
{
	DcPopoverButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_POPOVER_BUTTON, DcPopoverButton);
	g_weak_ref_clear (&self->priv->popover_ref);
	G_OBJECT_CLASS (dc_popover_button_parent_class)->finalize (obj);
}

/** Flat, left-aligned button for hand-built popover menus. It closes
        its popover before emitting selected from an idle. */
static GType
dc_popover_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcPopoverButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_popover_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcPopoverButton), 0, (GInstanceInitFunc) dc_popover_button_instance_init, NULL };
	GType dc_popover_button_type_id;
	dc_popover_button_type_id = g_type_register_static (gtk_button_get_type (), "DcPopoverButton", &g_define_type_info, 0);
	DcPopoverButton_private_offset = g_type_add_instance_private (dc_popover_button_type_id, sizeof (DcPopoverButtonPrivate));
	return dc_popover_button_type_id;
}

GType
dc_popover_button_get_type (void)
{
	static volatile gsize dc_popover_button_type_id__once = 0;
	if (g_once_init_enter (&dc_popover_button_type_id__once)) {
		GType dc_popover_button_type_id;
		dc_popover_button_type_id = dc_popover_button_get_type_once ();
		g_once_init_leave (&dc_popover_button_type_id__once, dc_popover_button_type_id);
	}
	return dc_popover_button_type_id__once;
}

void
dc_show_error (GtkWidget* parent,
               const gchar* message)
{
	AdwAlertDialog* d = NULL;
	AdwAlertDialog* _tmp0_;
	g_return_if_fail (parent != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new ("Error", message);
	g_object_ref_sink (_tmp0_);
	d = _tmp0_;
	adw_alert_dialog_add_response (d, "ok", "OK");
	adw_dialog_present ((AdwDialog*) d, parent);
	_g_object_unref0 (d);
}

gboolean
dc_is_dialog_dismissal (GError* _error_)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (_error_ != NULL, FALSE);
	if (g_error_matches (_error_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = g_error_matches (_error_, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED);
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_error_matches (_error_, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_DISMISSED);
	}
	result = _tmp0_;
	return result;
}

static void
dc_confirm_action_data_free (gpointer _data)
{
	DcConfirmActionData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->parent);
	_g_free0 (_data_->title);
	_g_free0 (_data_->body);
	_g_free0 (_data_->action_id);
	_g_free0 (_data_->action_label);
	g_slice_free (DcConfirmActionData, _data_);
}

void
dc_confirm_action (GtkWidget* parent,
                   const gchar* title,
                   const gchar* body,
                   const gchar* action_id,
                   const gchar* action_label,
                   GAsyncReadyCallback _callback_,
                   gpointer _user_data_)
{
	DcConfirmActionData* _data_;
	GtkWidget* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (parent != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (body != NULL);
	g_return_if_fail (action_id != NULL);
	g_return_if_fail (action_label != NULL);
	_data_ = g_slice_new0 (DcConfirmActionData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_confirm_action_data_free);
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (_data_->parent);
	_data_->parent = _tmp0_;
	_tmp1_ = g_strdup (title);
	_g_free0 (_data_->title);
	_data_->title = _tmp1_;
	_tmp2_ = g_strdup (body);
	_g_free0 (_data_->body);
	_data_->body = _tmp2_;
	_tmp3_ = g_strdup (action_id);
	_g_free0 (_data_->action_id);
	_data_->action_id = _tmp3_;
	_tmp4_ = g_strdup (action_label);
	_g_free0 (_data_->action_label);
	_data_->action_label = _tmp4_;
	dc_confirm_action_co (_data_);
}

gboolean
dc_confirm_action_finish (GAsyncResult* _res_)
{
	gboolean result;
	DcConfirmActionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
dc_confirm_action_ready (GObject* source_object,
                         GAsyncResult* _res_,
                         gpointer _user_data_)
{
	DcConfirmActionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_confirm_action_co (_data_);
}

static gboolean
dc_confirm_action_co (DcConfirmActionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (_data_->title, _data_->body);
	g_object_ref_sink (_data_->_tmp0_);
	_data_->d = _data_->_tmp0_;
	adw_alert_dialog_add_response (_data_->d, "cancel", "Cancel");
	adw_alert_dialog_add_response (_data_->d, _data_->action_id, _data_->action_label);
	adw_alert_dialog_set_response_appearance (_data_->d, _data_->action_id, ADW_RESPONSE_DESTRUCTIVE);
	adw_alert_dialog_set_default_response (_data_->d, "cancel");
	adw_alert_dialog_set_close_response (_data_->d, "cancel");
	_data_->_state_ = 1;
	adw_alert_dialog_choose (_data_->d, _data_->parent, NULL, dc_confirm_action_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = adw_alert_dialog_choose_finish (_data_->d, _data_->_res_);
	_data_->result = g_strcmp0 (_data_->_tmp1_, _data_->action_id) == 0;
	_g_object_unref0 (_data_->d);
	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_confirm_delete_options_data_free (gpointer _data)
{
	DcConfirmDeleteOptionsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->parent);
	_g_free0 (_data_->title);
	_g_free0 (_data_->body);
	g_slice_free (DcConfirmDeleteOptionsData, _data_);
}

void
dc_confirm_delete_options (GtkWidget* parent,
                           const gchar* title,
                           const gchar* body,
                           gboolean allow_delete_for_everyone,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcConfirmDeleteOptionsData* _data_;
	GtkWidget* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (parent != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (body != NULL);
	_data_ = g_slice_new0 (DcConfirmDeleteOptionsData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_confirm_delete_options_data_free);
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (_data_->parent);
	_data_->parent = _tmp0_;
	_tmp1_ = g_strdup (title);
	_g_free0 (_data_->title);
	_data_->title = _tmp1_;
	_tmp2_ = g_strdup (body);
	_g_free0 (_data_->body);
	_data_->body = _tmp2_;
	_data_->allow_delete_for_everyone = allow_delete_for_everyone;
	dc_confirm_delete_options_co (_data_);
}

DcDeleteChoice
dc_confirm_delete_options_finish (GAsyncResult* _res_)
{
	DcDeleteChoice result;
	DcConfirmDeleteOptionsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
dc_confirm_delete_options_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcConfirmDeleteOptionsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_confirm_delete_options_co (_data_);
}

static gboolean
dc_confirm_delete_options_co (DcConfirmDeleteOptionsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (_data_->title, _data_->body);
	g_object_ref_sink (_data_->_tmp0_);
	_data_->d = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->d;
	adw_alert_dialog_add_response (_data_->_tmp1_, "cancel", "Cancel");
	_data_->_tmp2_ = _data_->d;
	adw_alert_dialog_add_response (_data_->_tmp2_, "delete_me", "Delete for Me");
	_data_->_tmp3_ = _data_->d;
	adw_alert_dialog_set_response_appearance (_data_->_tmp3_, "delete_me", ADW_RESPONSE_DESTRUCTIVE);
	if (_data_->allow_delete_for_everyone) {
		_data_->_tmp4_ = _data_->d;
		adw_alert_dialog_add_response (_data_->_tmp4_, "delete_all", "Delete for Everyone");
		_data_->_tmp5_ = _data_->d;
		adw_alert_dialog_set_response_appearance (_data_->_tmp5_, "delete_all", ADW_RESPONSE_DESTRUCTIVE);
	}
	_data_->_tmp6_ = _data_->d;
	adw_alert_dialog_set_default_response (_data_->_tmp6_, "cancel");
	_data_->_tmp7_ = _data_->d;
	adw_alert_dialog_set_close_response (_data_->_tmp7_, "cancel");
	_data_->_tmp8_ = _data_->d;
	_data_->_state_ = 1;
	adw_alert_dialog_choose (_data_->_tmp8_, _data_->parent, NULL, dc_confirm_delete_options_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = adw_alert_dialog_choose_finish (_data_->_tmp8_, _data_->_res_);
	_data_->_tmp10_ = g_strdup (_data_->_tmp9_);
	_data_->response = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->response;
	if (g_strcmp0 (_data_->_tmp11_, "delete_me") == 0) {
		_data_->result = DC_DELETE_CHOICE_FOR_ME;
		_g_free0 (_data_->response);
		_g_object_unref0 (_data_->d);
		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_->_tmp12_ = _data_->response;
	if (g_strcmp0 (_data_->_tmp12_, "delete_all") == 0) {
		_data_->result = DC_DELETE_CHOICE_FOR_EVERYONE;
		_g_free0 (_data_->response);
		_g_object_unref0 (_data_->d);
		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_->result = DC_DELETE_CHOICE_CANCEL;
	_g_free0 (_data_->response);
	_g_object_unref0 (_data_->d);
	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;
}

/** Skeleton for hand-built popover menus: a no-arrow popover pointing
        at (x, y) in parent whose child is a vertical "menu" box ready for
        PopoverButton rows. Unparents itself after closing. */
GtkPopover*
dc_popover_menu (GtkWidget* parent,
                 gdouble x,
                 gdouble y,
                 GtkBox** vbox)
{
	GtkBox* _vala_vbox = NULL;
	GtkPopover* popover = NULL;
	GtkPopover* _tmp0_;
	GdkRectangle _tmp1_ = {0};
	GtkBox* _tmp2_;
	GtkPopover* result;
	g_return_val_if_fail (parent != NULL, NULL);
	_tmp0_ = (GtkPopover*) gtk_popover_new ();
	g_object_ref_sink (_tmp0_);
	popover = _tmp0_;
	gtk_popover_set_has_arrow (popover, FALSE);
	gtk_widget_set_parent ((GtkWidget*) popover, parent);
	_tmp1_.x = (gint) x;
	_tmp1_.y = (gint) y;
	_tmp1_.width = 1;
	_tmp1_.height = 1;
	gtk_popover_set_pointing_to (popover, &_tmp1_);
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (_vala_vbox);
	_vala_vbox = _tmp2_;
	gtk_widget_add_css_class ((GtkWidget*) _vala_vbox, "menu");
	gtk_widget_set_margin_start ((GtkWidget*) _vala_vbox, 8);
	gtk_widget_set_margin_end ((GtkWidget*) _vala_vbox, 8);
	gtk_widget_set_margin_top ((GtkWidget*) _vala_vbox, 8);
	gtk_widget_set_margin_bottom ((GtkWidget*) _vala_vbox, 8);
	gtk_popover_set_child (popover, (GtkWidget*) _vala_vbox);
	dc_unparent_on_close (popover);
	result = popover;
	if (vbox) {
		*vbox = _vala_vbox;
	} else {
		_g_object_unref0 (_vala_vbox);
	}
	return result;
}

/** Unparent a manually-parented popover once it closes, from an idle:
        tearing it down inside its own closed handler upsets GTK. */
static void
_dc_on_popover_closed_gtk_popover_closed (GtkPopover* _sender,
                                          gpointer self)
{
	dc_on_popover_closed (_sender);
}

void
dc_unparent_on_close (GtkPopover* popover)
{
	g_return_if_fail (popover != NULL);
	g_signal_connect (popover, "closed", (GCallback) _dc_on_popover_closed_gtk_popover_closed, NULL);
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		_g_object_unref0 (_data14_->popover);
		g_slice_free (Block14Data, _data14_);
	}
}

static gboolean
__lambda65_ (Block14Data* _data14_)
{
	gboolean result;
	gtk_widget_unparent ((GtkWidget*) _data14_->popover);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda65__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda65_ (self);
	return result;
}

void
dc_on_popover_closed (GtkPopover* popover)
{
	Block14Data* _data14_;
	GtkPopover* _tmp0_;
	g_return_if_fail (popover != NULL);
	_data14_ = g_slice_new0 (Block14Data);
	_data14_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (popover);
	_g_object_unref0 (_data14_->popover);
	_data14_->popover = _tmp0_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda65__gsource_func, block14_data_ref (_data14_), block14_data_unref);
	block14_data_unref (_data14_);
	_data14_ = NULL;
}

void
dc_install_escape_close (AdwDialog* dialog)
{
	GtkEventControllerKey* kc = NULL;
	GtkEventControllerKey* _tmp0_;
	GtkEventController* _tmp1_;
	g_return_if_fail (dialog != NULL);
	_tmp0_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	kc = _tmp0_;
	gtk_event_controller_set_propagation_phase ((GtkEventController*) kc, GTK_PHASE_CAPTURE);
	g_signal_connect_object (kc, "key-pressed", (GCallback) dc_on_dialog_key_pressed, (GObject*) dialog, (GConnectFlags) 0);
	_tmp1_ = _g_object_ref0 ((GtkEventController*) kc);
	gtk_widget_add_controller (G_TYPE_CHECK_INSTANCE_CAST (dialog, gtk_widget_get_type (), GtkWidget), _tmp1_);
	_g_object_unref0 (kc);
}

gboolean
dc_on_dialog_key_pressed (GtkEventControllerKey* controller,
                          guint keyval,
                          guint keycode,
                          GdkModifierType state,
                          AdwDialog* dialog)
{
	gboolean result;
	g_return_val_if_fail (controller != NULL, FALSE);
	g_return_val_if_fail (dialog != NULL, FALSE);
	if (keyval != GDK_KEY_Escape) {
		result = FALSE;
		return result;
	}
	adw_dialog_close (dialog);
	result = TRUE;
	return result;
}

GdkTexture*
dc_load_avatar (const gchar* path)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	GdkTexture* result;
	if (path != NULL) {
		gint _tmp2_;
		gint _tmp3_;
		_tmp2_ = strlen (path);
		_tmp3_ = _tmp2_;
		_tmp1_ = _tmp3_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = g_file_test (path, G_FILE_TEST_EXISTS);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		{
			GdkTexture* _tmp4_ = NULL;
			GdkTexture* _tmp5_;
			GdkTexture* _tmp6_;
			_tmp5_ = gdk_texture_new_from_filename (path, &_inner_error0_);
			_tmp4_ = _tmp5_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp6_ = _tmp4_;
			_tmp4_ = NULL;
			result = _tmp6_;
			_g_object_unref0 (_tmp4_);
			return result;
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = NULL;
	return result;
}

/** Locale date plus time, e.g. "07/25/2026 · 17:42". */
gchar*
dc_format_date_time (gint64 ts)
{
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	if (ts <= ((gint64) 0)) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("");
		result = _tmp0_;
		return result;
	}
	_tmp1_ = g_date_time_new_from_unix_local (ts);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_date_time_format (_tmp2_, "%x · %H:%M");
	_tmp4_ = _tmp3_;
	_g_date_time_unref0 (_tmp2_);
	result = _tmp4_;
	return result;
}

static JsonNode*
_vala_JsonNode_copy (JsonNode* self)
{
	return g_boxed_copy (json_node_get_type (), self);
}

static gpointer
__vala_JsonNode_copy0 (gpointer self)
{
	return self ? _vala_JsonNode_copy (self) : NULL;
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

gchar*
dc_json_str (JsonObject* obj,
             const gchar* key)
{
	JsonNode* m = NULL;
	JsonNode* _tmp0_;
	JsonNode* _tmp1_;
	gboolean _tmp2_ = FALSE;
	JsonNode* _tmp3_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* result;
	g_return_val_if_fail (obj != NULL, NULL);
	g_return_val_if_fail (key != NULL, NULL);
	if (!json_object_has_member (obj, key)) {
		result = NULL;
		return result;
	}
	_tmp0_ = json_object_get_member (obj, key);
	_tmp1_ = __vala_JsonNode_copy0 (_tmp0_);
	m = _tmp1_;
	_tmp3_ = m;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		JsonNode* _tmp4_;
		_tmp4_ = m;
		_tmp2_ = json_node_is_null (_tmp4_);
	}
	if (_tmp2_) {
		result = NULL;
		__vala_JsonNode_free0 (m);
		return result;
	}
	_tmp5_ = json_object_get_string_member (obj, key);
	_tmp6_ = g_strdup (_tmp5_);
	result = _tmp6_;
	__vala_JsonNode_free0 (m);
	return result;
}

gint64
dc_json_int (JsonObject* obj,
             const gchar* key,
             gint64 fallback)
{
	JsonNode* m = NULL;
	JsonNode* _tmp0_;
	JsonNode* _tmp1_;
	gboolean _tmp2_ = FALSE;
	JsonNode* _tmp3_;
	gint64 result;
	g_return_val_if_fail (obj != NULL, -1LL);
	g_return_val_if_fail (key != NULL, -1LL);
	if (!json_object_has_member (obj, key)) {
		result = fallback;
		return result;
	}
	_tmp0_ = json_object_get_member (obj, key);
	_tmp1_ = __vala_JsonNode_copy0 (_tmp0_);
	m = _tmp1_;
	_tmp3_ = m;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		JsonNode* _tmp4_;
		_tmp4_ = m;
		_tmp2_ = json_node_is_null (_tmp4_);
	}
	if (_tmp2_) {
		result = fallback;
		__vala_JsonNode_free0 (m);
		return result;
	}
	result = json_object_get_int_member (obj, key);
	__vala_JsonNode_free0 (m);
	return result;
}

gboolean
dc_json_bool (JsonObject* obj,
              const gchar* key)
{
	JsonNode* m = NULL;
	JsonNode* _tmp0_;
	JsonNode* _tmp1_;
	gboolean _tmp2_ = FALSE;
	JsonNode* _tmp3_;
	gboolean result;
	g_return_val_if_fail (obj != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	if (!json_object_has_member (obj, key)) {
		result = FALSE;
		return result;
	}
	_tmp0_ = json_object_get_member (obj, key);
	_tmp1_ = __vala_JsonNode_copy0 (_tmp0_);
	m = _tmp1_;
	_tmp3_ = m;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		JsonNode* _tmp4_;
		_tmp4_ = m;
		_tmp2_ = json_node_is_null (_tmp4_);
	}
	if (_tmp2_) {
		result = FALSE;
		__vala_JsonNode_free0 (m);
		return result;
	}
	result = json_object_get_boolean_member (obj, key);
	__vala_JsonNode_free0 (m);
	return result;
}

void
dc_clear_listbox (GtkListBox* lb)
{
	GtkListBoxRow* row = NULL;
	g_return_if_fail (lb != NULL);
	while (TRUE) {
		GtkListBoxRow* _tmp0_;
		GtkListBoxRow* _tmp1_;
		GtkListBoxRow* _tmp2_;
		GtkListBoxRow* _tmp3_;
		_tmp0_ = gtk_list_box_get_row_at_index (lb, 0);
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (row);
		row = _tmp1_;
		_tmp2_ = row;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp3_ = row;
		gtk_list_box_remove (lb, (GtkWidget*) _tmp3_);
	}
	_g_object_unref0 (row);
}

static void
dc_chat_message_ids_for_clear_data_free (gpointer _data)
{
	DcChatMessageIdsForClearData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->rpc);
	_data_->result = (g_free (_data_->result), NULL);
	g_slice_free (DcChatMessageIdsForClearData, _data_);
}

void
dc_chat_message_ids_for_clear (DcRpcClient* rpc,
                               gint account_id,
                               gint chat_id,
                               gboolean for_all,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcChatMessageIdsForClearData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (rpc != NULL);
	_data_ = g_slice_new0 (DcChatMessageIdsForClearData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_chat_message_ids_for_clear_data_free);
	_tmp0_ = _g_object_ref0 (rpc);
	_g_object_unref0 (_data_->rpc);
	_data_->rpc = _tmp0_;
	_data_->account_id = account_id;
	_data_->chat_id = chat_id;
	_data_->for_all = for_all;
	dc_chat_message_ids_for_clear_co (_data_);
}

gint*
dc_chat_message_ids_for_clear_finish (GAsyncResult* _res_,
                                      gint* result_length1,
                                      GError** error)
{
	gint* result;
	DcChatMessageIdsForClearData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}

static void
dc_chat_message_ids_for_clear_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcChatMessageIdsForClearData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_chat_message_ids_for_clear_co (_data_);
}

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

static gboolean
dc_chat_message_ids_for_clear_co (DcChatMessageIdsForClearData* _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_->_state_ = 1;
	dc_rpc_client_get_message_ids_for (_data_->rpc, _data_->account_id, _data_->chat_id, FALSE, dc_chat_message_ids_for_clear_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = dc_rpc_client_get_message_ids_for_finish (_data_->rpc, _data_->_res_, &_data_->_inner_error0_);
	_data_->msg_ids = _data_->_tmp0_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _data_->msg_ids;
	if (_data_->_tmp2_ == NULL) {
		_data_->_tmp1_ = TRUE;
	} else {
		_data_->_tmp3_ = _data_->msg_ids;
		_data_->_tmp1_ = json_array_get_length (_data_->_tmp3_) == ((guint) 0);
	}
	if (_data_->_tmp1_) {
		_data_->_tmp4_ = g_new0 (gint, 0);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp5__length1 = 0;
		_data_->result_length1 = _data_->_tmp5__length1;
		_data_->result = _data_->_tmp5_;
		_json_array_unref0 (_data_->msg_ids);
		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_->_tmp6_ = _data_->msg_ids;
	_data_->_tmp7_ = g_new0 (gint, json_array_get_length (_data_->_tmp6_));
	_data_->all_ids = _data_->_tmp7_;
	_data_->all_ids_length1 = json_array_get_length (_data_->_tmp6_);
	_data_->_all_ids_size_ = _data_->all_ids_length1;
	{
		_data_->i = (guint) 0;
		{
			_data_->_tmp8_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp8_) {
					_data_->_tmp9_ = _data_->i;
					_data_->i = _data_->_tmp9_ + 1;
				}
				_data_->_tmp8_ = FALSE;
				_data_->_tmp10_ = _data_->msg_ids;
				if (!(_data_->i < json_array_get_length (_data_->_tmp10_))) {
					break;
				}
				_data_->_tmp11_ = _data_->all_ids;
				_data_->_tmp11__length1 = _data_->all_ids_length1;
				_data_->_tmp12_ = _data_->msg_ids;
				_data_->_tmp11_[_data_->i] = (gint) json_array_get_int_element (_data_->_tmp12_, _data_->i);
			}
		}
	}
	if (!_data_->for_all) {
		_data_->_tmp13_ = _data_->all_ids;
		_data_->_tmp13__length1 = _data_->all_ids_length1;
		_data_->result_length1 = _data_->_tmp13__length1;
		_data_->result = _data_->_tmp13_;
		_json_array_unref0 (_data_->msg_ids);
		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_->_tmp14_ = g_new0 (gint, 0);
	_data_->ids = _data_->_tmp14_;
	_data_->ids_length1 = 0;
	_data_->_ids_size_ = _data_->ids_length1;
	_data_->_tmp15_ = _data_->all_ids;
	_data_->_tmp15__length1 = _data_->all_ids_length1;
	_data_->_state_ = 2;
	dc_rpc_client_get_messages_for (_data_->rpc, _data_->account_id, _data_->_tmp15_, (gint) _data_->_tmp15__length1, dc_chat_message_ids_for_clear_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp16_ = dc_rpc_client_get_messages_for_finish (_data_->rpc, _data_->_res_, &_data_->_inner_error0_);
	_data_->map = _data_->_tmp16_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_data_->ids = (g_free (_data_->ids), NULL);
		_data_->all_ids = (g_free (_data_->all_ids), NULL);
		_json_array_unref0 (_data_->msg_ids);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp17_ = _data_->map;
	if (_data_->_tmp17_ == NULL) {
		_data_->_tmp18_ = _data_->ids;
		_data_->_tmp18__length1 = _data_->ids_length1;
		_data_->result_length1 = _data_->_tmp18__length1;
		_data_->result = _data_->_tmp18_;
		_json_object_unref0 (_data_->map);
		_data_->all_ids = (g_free (_data_->all_ids), NULL);
		_json_array_unref0 (_data_->msg_ids);
		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_->_tmp19_ = _data_->all_ids;
	_data_->_tmp19__length1 = _data_->all_ids_length1;
	{
		_data_->msg_id_collection_length1 = 0;
		_data_->_msg_id_collection_size_ = 0;
		_data_->msg_id_collection = _data_->_tmp19_;
		_data_->msg_id_collection_length1 = _data_->_tmp19__length1;
		for (_data_->msg_id_it = 0; _data_->msg_id_it < _data_->msg_id_collection_length1; _data_->msg_id_it = _data_->msg_id_it + 1) {
			_data_->msg_id = _data_->msg_id_collection[_data_->msg_id_it];
			{
				_data_->_tmp20_ = g_strdup_printf ("%i", _data_->msg_id);
				_data_->key = _data_->_tmp20_;
				_data_->_tmp21_ = _data_->map;
				_data_->_tmp22_ = _data_->key;
				if (!json_object_has_member (_data_->_tmp21_, _data_->_tmp22_)) {
					_g_free0 (_data_->key);
					continue;
				}
				_data_->_tmp23_ = _data_->map;
				_data_->_tmp24_ = _data_->key;
				_data_->_tmp25_ = json_object_get_object_member (_data_->_tmp23_, _data_->_tmp24_);
				_data_->_tmp26_ = dc_rpc_client_get_self_email (_data_->rpc);
				_data_->_tmp27_ = _data_->_tmp26_;
				_data_->_tmp28_ = dc_rpc_parsers_parse_message (_data_->_tmp25_, _data_->_tmp27_);
				_data_->msg = _data_->_tmp28_;
				_data_->_tmp29_ = _data_->msg;
				_data_->_tmp30_ = dc_message_get_is_outgoing (_data_->_tmp29_);
				_data_->_tmp31_ = _data_->_tmp30_;
				if (_data_->_tmp31_) {
					_vala_array_add18 (&_data_->ids, &_data_->ids_length1, &_data_->_ids_size_, _data_->msg_id);
				}
				_g_object_unref0 (_data_->msg);
				_g_free0 (_data_->key);
			}
		}
	}
	_data_->_tmp32_ = _data_->ids;
	_data_->_tmp32__length1 = _data_->ids_length1;
	_data_->result_length1 = _data_->_tmp32__length1;
	_data_->result = _data_->_tmp32_;
	_json_object_unref0 (_data_->map);
	_data_->all_ids = (g_free (_data_->all_ids), NULL);
	_json_array_unref0 (_data_->msg_ids);
	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_pick_image_file_data_free (gpointer _data)
{
	DcPickImageFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->parent);
	_g_free0 (_data_->title);
	_g_free0 (_data_->result);
	g_slice_free (DcPickImageFileData, _data_);
}

void
dc_pick_image_file (GtkWindow* parent,
                    const gchar* title,
                    GAsyncReadyCallback _callback_,
                    gpointer _user_data_)
{
	DcPickImageFileData* _data_;
	GtkWindow* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (parent != NULL);
	g_return_if_fail (title != NULL);
	_data_ = g_slice_new0 (DcPickImageFileData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_pick_image_file_data_free);
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (_data_->parent);
	_data_->parent = _tmp0_;
	_tmp1_ = g_strdup (title);
	_g_free0 (_data_->title);
	_data_->title = _tmp1_;
	dc_pick_image_file_co (_data_);
}

gchar*
dc_pick_image_file_finish (GAsyncResult* _res_)
{
	gchar* result;
	DcPickImageFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_pick_image_file_ready (GObject* source_object,
                          GAsyncResult* _res_,
                          gpointer _user_data_)
{
	DcPickImageFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_pick_image_file_co (_data_);
}

static gboolean
dc_pick_image_file_co (DcPickImageFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gtk_file_dialog_new ();
	_data_->chooser = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->chooser;
	gtk_file_dialog_set_title (_data_->_tmp1_, _data_->title);
	_data_->_tmp2_ = gtk_file_filter_new ();
	_data_->filter = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->filter;
	gtk_file_filter_add_mime_type (_data_->_tmp3_, "image/*");
	_data_->_tmp4_ = _data_->filter;
	g_object_set (_data_->_tmp4_, "name", "Images", NULL);
	_data_->_tmp5_ = g_list_store_new (gtk_file_filter_get_type ());
	_data_->filters = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->filters;
	_data_->_tmp7_ = _data_->filter;
	g_list_store_append (_data_->_tmp6_, (GObject*) _data_->_tmp7_);
	_data_->_tmp8_ = _data_->chooser;
	_data_->_tmp9_ = _data_->filters;
	gtk_file_dialog_set_filters (_data_->_tmp8_, (GListModel*) _data_->_tmp9_);
	{
		_data_->_tmp10_ = _data_->chooser;
		_data_->_state_ = 1;
		gtk_file_dialog_open (_data_->_tmp10_, _data_->parent, NULL, dc_pick_image_file_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp11_ = gtk_file_dialog_open_finish (_data_->_tmp10_, _data_->_res_, &_data_->_inner_error0_);
		_data_->file = _data_->_tmp11_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp12_ = _data_->file;
		if (_data_->_tmp12_ != NULL) {
			_data_->_tmp13_ = _data_->file;
			_data_->_tmp14_ = g_file_get_path (_data_->_tmp13_);
			_data_->result = _data_->_tmp14_;
			_g_object_unref0 (_data_->file);
			_g_object_unref0 (_data_->filters);
			_g_object_unref0 (_data_->filter);
			_g_object_unref0 (_data_->chooser);
			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;
		}
		_g_object_unref0 (_data_->file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp15_ = _data_->e;
		if (!dc_is_dialog_dismissal (_data_->_tmp15_)) {
			_data_->_tmp16_ = _data_->e;
			_data_->_tmp17_ = _data_->_tmp16_->message;
			g_warning ("models.vala:216: image picker: %s", _data_->_tmp17_);
		}
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->filters);
		_g_object_unref0 (_data_->filter);
		_g_object_unref0 (_data_->chooser);
		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_->result = NULL;
	_g_object_unref0 (_data_->filters);
	_g_object_unref0 (_data_->filter);
	_g_object_unref0 (_data_->chooser);
	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;
}

AdwActionRow*
dc_contact_row (DcContact* c,
                gboolean activatable,
                gboolean show_presence)
{
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gchar* title = NULL;
	gchar* _tmp9_;
	const gchar* _tmp10_ = NULL;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	gchar* subtitle = NULL;
	gchar* _tmp17_;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_;
	gboolean _tmp20_;
	gboolean _tmp29_ = FALSE;
	gboolean _tmp30_;
	gboolean _tmp31_;
	AdwActionRow* row = NULL;
	AdwActionRow* _tmp40_;
	AdwActionRow* _tmp41_;
	AdwActionRow* _tmp42_;
	const gchar* _tmp43_;
	AdwActionRow* _tmp44_;
	const gchar* _tmp45_;
	AdwActionRow* _tmp46_;
	gboolean _tmp47_ = FALSE;
	AdwActionRow* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	GtkWidget* _tmp54_;
	GtkWidget* _tmp55_;
	AdwActionRow* result;
	g_return_val_if_fail (c != NULL, NULL);
	_tmp1_ = dc_contact_get_display_name (c);
	_tmp2_ = _tmp1_;
	_tmp3_ = strlen (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ > 0) {
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp5_ = dc_contact_get_display_name (c);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_;
	} else {
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp7_ = dc_contact_get_address (c);
		_tmp8_ = _tmp7_;
		_tmp0_ = _tmp8_;
	}
	_tmp9_ = g_strdup (_tmp0_);
	title = _tmp9_;
	_tmp11_ = dc_contact_get_display_name (c);
	_tmp12_ = _tmp11_;
	_tmp13_ = strlen (_tmp12_);
	_tmp14_ = _tmp13_;
	if (_tmp14_ > 0) {
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		_tmp15_ = dc_contact_get_address (c);
		_tmp16_ = _tmp15_;
		_tmp10_ = _tmp16_;
	} else {
		_tmp10_ = "";
	}
	_tmp17_ = g_strdup (_tmp10_);
	subtitle = _tmp17_;
	_tmp19_ = dc_contact_get_is_verified (c);
	_tmp20_ = _tmp19_;
	if (_tmp20_) {
		const gchar* _tmp21_;
		gint _tmp22_;
		gint _tmp23_;
		_tmp21_ = subtitle;
		_tmp22_ = strlen (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp18_ = _tmp23_ > 0;
	} else {
		_tmp18_ = FALSE;
	}
	if (_tmp18_) {
		const gchar* _tmp24_;
		gchar* _tmp25_;
		_tmp24_ = subtitle;
		_tmp25_ = g_strconcat (_tmp24_, " (verified)", NULL);
		_g_free0 (subtitle);
		subtitle = _tmp25_;
	} else {
		gboolean _tmp26_;
		gboolean _tmp27_;
		_tmp26_ = dc_contact_get_is_verified (c);
		_tmp27_ = _tmp26_;
		if (_tmp27_) {
			gchar* _tmp28_;
			_tmp28_ = g_strdup ("(verified)");
			_g_free0 (subtitle);
			subtitle = _tmp28_;
		}
	}
	_tmp30_ = dc_contact_get_is_blocked (c);
	_tmp31_ = _tmp30_;
	if (_tmp31_) {
		const gchar* _tmp32_;
		gint _tmp33_;
		gint _tmp34_;
		_tmp32_ = subtitle;
		_tmp33_ = strlen (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp29_ = _tmp34_ > 0;
	} else {
		_tmp29_ = FALSE;
	}
	if (_tmp29_) {
		const gchar* _tmp35_;
		gchar* _tmp36_;
		_tmp35_ = subtitle;
		_tmp36_ = g_strconcat (_tmp35_, " (blocked)", NULL);
		_g_free0 (subtitle);
		subtitle = _tmp36_;
	} else {
		gboolean _tmp37_;
		gboolean _tmp38_;
		_tmp37_ = dc_contact_get_is_blocked (c);
		_tmp38_ = _tmp37_;
		if (_tmp38_) {
			gchar* _tmp39_;
			_tmp39_ = g_strdup ("(blocked)");
			_g_free0 (subtitle);
			subtitle = _tmp39_;
		}
	}
	_tmp40_ = (AdwActionRow*) adw_action_row_new ();
	g_object_ref_sink (_tmp40_);
	row = _tmp40_;
	_tmp41_ = row;
	adw_preferences_row_set_use_markup ((AdwPreferencesRow*) _tmp41_, FALSE);
	_tmp42_ = row;
	_tmp43_ = title;
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp42_, _tmp43_);
	_tmp44_ = row;
	_tmp45_ = subtitle;
	adw_action_row_set_subtitle (_tmp44_, _tmp45_);
	_tmp46_ = row;
	gtk_list_box_row_set_activatable ((GtkListBoxRow*) _tmp46_, activatable);
	if (show_presence) {
		gboolean _tmp48_;
		gboolean _tmp49_;
		_tmp48_ = dc_contact_get_was_seen_recently (c);
		_tmp49_ = _tmp48_;
		_tmp47_ = _tmp49_;
	} else {
		_tmp47_ = FALSE;
	}
	_tmp50_ = row;
	_tmp51_ = title;
	_tmp52_ = dc_contact_get_profile_image (c);
	_tmp53_ = _tmp52_;
	_tmp54_ = dc_presence_avatar (32, _tmp51_, _tmp53_, _tmp47_, NULL, "list-presence-avatar-ring");
	_tmp55_ = _tmp54_;
	adw_action_row_add_prefix (_tmp50_, _tmp55_);
	_g_object_unref0 (_tmp55_);
	result = row;
	_g_free0 (subtitle);
	_g_free0 (title);
	return result;
}

AdwActionRow*
dc_chat_pick_row (DcChatEntry* chat)
{
	AdwActionRow* row = NULL;
	AdwActionRow* _tmp0_;
	AdwActionRow* _tmp1_;
	AdwActionRow* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	AdwActionRow* _tmp5_;
	AdwActionRow* _tmp6_;
	gboolean _tmp7_ = FALSE;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	AdwActionRow* _tmp19_;
	gint _tmp20_;
	gint _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	AdwActionRow* _tmp24_;
	AdwActionRow* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	GtkWidget* _tmp32_;
	GtkWidget* _tmp33_;
	AdwActionRow* result;
	g_return_val_if_fail (chat != NULL, NULL);
	_tmp0_ = (AdwActionRow*) adw_action_row_new ();
	g_object_ref_sink (_tmp0_);
	row = _tmp0_;
	_tmp1_ = row;
	adw_preferences_row_set_use_markup ((AdwPreferencesRow*) _tmp1_, FALSE);
	_tmp2_ = row;
	_tmp3_ = dc_chat_entry_get_name (chat);
	_tmp4_ = _tmp3_;
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp2_, _tmp4_);
	_tmp5_ = row;
	adw_action_row_set_title_lines (_tmp5_, 1);
	_tmp6_ = row;
	adw_action_row_set_subtitle_lines (_tmp6_, 1);
	_tmp8_ = dc_chat_entry_get_last_message (chat);
	_tmp9_ = _tmp8_;
	if (_tmp9_ != NULL) {
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		_tmp10_ = dc_chat_entry_get_last_message (chat);
		_tmp11_ = _tmp10_;
		_tmp12_ = strlen (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp7_ = _tmp13_ > 0;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		AdwActionRow* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		_tmp14_ = row;
		_tmp15_ = dc_chat_entry_get_last_message (chat);
		_tmp16_ = _tmp15_;
		_tmp17_ = dc_markdown_single_line_preview (_tmp16_, 0);
		_tmp18_ = _tmp17_;
		adw_action_row_set_subtitle (_tmp14_, _tmp18_);
		_g_free0 (_tmp18_);
	}
	_tmp19_ = row;
	_tmp20_ = dc_chat_entry_get_id (chat);
	_tmp21_ = _tmp20_;
	_tmp22_ = g_strdup_printf ("%i", _tmp21_);
	_tmp23_ = _tmp22_;
	gtk_widget_set_name ((GtkWidget*) _tmp19_, _tmp23_);
	_g_free0 (_tmp23_);
	_tmp24_ = row;
	gtk_list_box_row_set_activatable ((GtkListBoxRow*) _tmp24_, TRUE);
	_tmp25_ = row;
	_tmp26_ = dc_chat_entry_get_name (chat);
	_tmp27_ = _tmp26_;
	_tmp28_ = dc_chat_entry_get_avatar_path (chat);
	_tmp29_ = _tmp28_;
	_tmp30_ = dc_chat_entry_get_was_seen_recently (chat);
	_tmp31_ = _tmp30_;
	_tmp32_ = dc_presence_avatar (32, _tmp27_, _tmp29_, _tmp31_, NULL, "list-presence-avatar-ring");
	_tmp33_ = _tmp32_;
	adw_action_row_add_prefix (_tmp25_, _tmp33_);
	_g_object_unref0 (_tmp33_);
	result = row;
	return result;
}

GtkWidget*
dc_presence_avatar (gint size,
                    const gchar* text,
                    const gchar* path,
                    gboolean online,
                    const gchar* avatar_css,
                    const gchar* ring_css)
{
	AdwAvatar* avatar = NULL;
	AdwAvatar* _tmp0_;
	AdwAvatar* _tmp1_;
	GdkTexture* _tmp2_;
	GdkTexture* _tmp3_;
	gboolean _tmp4_ = FALSE;
	GtkBox* ring = NULL;
	GtkBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkBox* _tmp10_;
	GtkBox* _tmp11_;
	gboolean _tmp13_ = FALSE;
	GtkBox* _tmp17_;
	AdwAvatar* _tmp18_;
	GtkWidget* result;
	g_return_val_if_fail (text != NULL, NULL);
	_tmp0_ = (AdwAvatar*) adw_avatar_new (size, text, TRUE);
	g_object_ref_sink (_tmp0_);
	avatar = _tmp0_;
	_tmp1_ = avatar;
	_tmp2_ = dc_load_avatar (path);
	_tmp3_ = _tmp2_;
	adw_avatar_set_custom_image (_tmp1_, (GdkPaintable*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	if (avatar_css != NULL) {
		gint _tmp5_;
		gint _tmp6_;
		_tmp5_ = strlen (avatar_css);
		_tmp6_ = _tmp5_;
		_tmp4_ = _tmp6_ > 0;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		AdwAvatar* _tmp7_;
		_tmp7_ = avatar;
		gtk_widget_add_css_class ((GtkWidget*) _tmp7_, avatar_css);
	}
	if (!online) {
		result = (GtkWidget*) avatar;
		return result;
	}
	_tmp8_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp8_);
	ring = _tmp8_;
	_tmp9_ = ring;
	gtk_widget_set_halign ((GtkWidget*) _tmp9_, GTK_ALIGN_CENTER);
	_tmp10_ = ring;
	gtk_widget_set_valign ((GtkWidget*) _tmp10_, GTK_ALIGN_CENTER);
	_tmp11_ = ring;
	gtk_widget_add_css_class ((GtkWidget*) _tmp11_, "presence-avatar-ring");
	if (size <= 24) {
		GtkBox* _tmp12_;
		_tmp12_ = ring;
		gtk_widget_add_css_class ((GtkWidget*) _tmp12_, "presence-avatar-ring-small");
	}
	if (ring_css != NULL) {
		gint _tmp14_;
		gint _tmp15_;
		_tmp14_ = strlen (ring_css);
		_tmp15_ = _tmp14_;
		_tmp13_ = _tmp15_ > 0;
	} else {
		_tmp13_ = FALSE;
	}
	if (_tmp13_) {
		GtkBox* _tmp16_;
		_tmp16_ = ring;
		gtk_widget_add_css_class ((GtkWidget*) _tmp16_, ring_css);
	}
	_tmp17_ = ring;
	_tmp18_ = avatar;
	gtk_box_append (_tmp17_, (GtkWidget*) _tmp18_);
	result = (GtkWidget*) ring;
	_g_object_unref0 (avatar);
	return result;
}

static inline gpointer
dc_chat_entry_get_instance_private (DcChatEntry* self)
{
	return G_STRUCT_MEMBER_P (self, DcChatEntry_private_offset);
}

DcChatEntry*
dc_chat_entry_construct (GType object_type)
{
	DcChatEntry * self = NULL;
	self = (DcChatEntry*) g_object_new (object_type, NULL);
	return self;
}

DcChatEntry*
dc_chat_entry_new (void)
{
	return dc_chat_entry_construct (DC_TYPE_CHAT_ENTRY);
}

gint
dc_chat_entry_get_id (DcChatEntry* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_id;
	return result;
}

void
dc_chat_entry_set_id (DcChatEntry* self,
                      gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_ID_PROPERTY]);
	}
}

const gchar*
dc_chat_entry_get_name (DcChatEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
dc_chat_entry_set_name (DcChatEntry* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_NAME_PROPERTY]);
	}
}

const gchar*
dc_chat_entry_get_last_message (DcChatEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_last_message;
	result = _tmp0_;
	return result;
}

void
dc_chat_entry_set_last_message (DcChatEntry* self,
                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_last_message (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_last_message);
		self->priv->_last_message = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_LAST_MESSAGE_PROPERTY]);
	}
}

gint
dc_chat_entry_get_last_message_id (DcChatEntry* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_last_message_id;
	return result;
}

void
dc_chat_entry_set_last_message_id (DcChatEntry* self,
                                   gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_last_message_id (self);
	if (old_value != value) {
		self->priv->_last_message_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_LAST_MESSAGE_ID_PROPERTY]);
	}
}

const gchar*
dc_chat_entry_get_summary_prefix (DcChatEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_summary_prefix;
	result = _tmp0_;
	return result;
}

void
dc_chat_entry_set_summary_prefix (DcChatEntry* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_summary_prefix (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_summary_prefix);
		self->priv->_summary_prefix = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_SUMMARY_PREFIX_PROPERTY]);
	}
}

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

void
dc_chat_entry_set_timestamp (DcChatEntry* self,
                             gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_timestamp (self);
	if (old_value != value) {
		self->priv->_timestamp = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_TIMESTAMP_PROPERTY]);
	}
}

gint
dc_chat_entry_get_unread_count (DcChatEntry* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_unread_count;
	return result;
}

void
dc_chat_entry_set_unread_count (DcChatEntry* self,
                                gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_unread_count (self);
	if (old_value != value) {
		self->priv->_unread_count = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_UNREAD_COUNT_PROPERTY]);
	}
}

const gchar*
dc_chat_entry_get_avatar_path (DcChatEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_avatar_path;
	result = _tmp0_;
	return result;
}

void
dc_chat_entry_set_avatar_path (DcChatEntry* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_avatar_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_avatar_path);
		self->priv->_avatar_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_AVATAR_PATH_PROPERTY]);
	}
}

DcChatKind
dc_chat_entry_get_kind (DcChatEntry* self)
{
	DcChatKind result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_kind;
	return result;
}

void
dc_chat_entry_set_kind (DcChatEntry* self,
                        DcChatKind value)
{
	DcChatKind old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_kind (self);
	if (old_value != value) {
		self->priv->_kind = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_KIND_PROPERTY]);
	}
}

gboolean
dc_chat_entry_get_is_muted (DcChatEntry* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_muted;
	return result;
}

void
dc_chat_entry_set_is_muted (DcChatEntry* self,
                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_is_muted (self);
	if (old_value != value) {
		self->priv->_is_muted = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_IS_MUTED_PROPERTY]);
	}
}

gboolean
dc_chat_entry_get_is_contact_request (DcChatEntry* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_contact_request;
	return result;
}

void
dc_chat_entry_set_is_contact_request (DcChatEntry* self,
                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_is_contact_request (self);
	if (old_value != value) {
		self->priv->_is_contact_request = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_IS_CONTACT_REQUEST_PROPERTY]);
	}
}

gboolean
dc_chat_entry_get_is_pinned (DcChatEntry* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_pinned;
	return result;
}

void
dc_chat_entry_set_is_pinned (DcChatEntry* self,
                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_is_pinned (self);
	if (old_value != value) {
		self->priv->_is_pinned = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_IS_PINNED_PROPERTY]);
	}
}

gboolean
dc_chat_entry_get_is_archived (DcChatEntry* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_archived;
	return result;
}

void
dc_chat_entry_set_is_archived (DcChatEntry* self,
                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_is_archived (self);
	if (old_value != value) {
		self->priv->_is_archived = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_IS_ARCHIVED_PROPERTY]);
	}
}

gboolean
dc_chat_entry_get_was_seen_recently (DcChatEntry* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_was_seen_recently;
	return result;
}

void
dc_chat_entry_set_was_seen_recently (DcChatEntry* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_was_seen_recently (self);
	if (old_value != value) {
		self->priv->_was_seen_recently = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_WAS_SEEN_RECENTLY_PROPERTY]);
	}
}

gboolean
dc_chat_entry_get_has_mention (DcChatEntry* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_has_mention;
	return result;
}

void
dc_chat_entry_set_has_mention (DcChatEntry* self,
                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_has_mention (self);
	if (old_value != value) {
		self->priv->_has_mention = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_HAS_MENTION_PROPERTY]);
	}
}

static void
dc_chat_entry_class_init (DcChatEntryClass * klass,
                          gpointer klass_data)
{
	dc_chat_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcChatEntry_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_chat_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_chat_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_chat_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_ID_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_ID_PROPERTY] = g_param_spec_int ("id", "id", "id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_NAME_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_LAST_MESSAGE_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_LAST_MESSAGE_PROPERTY] = g_param_spec_string ("last-message", "last-message", "last-message", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_LAST_MESSAGE_ID_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_LAST_MESSAGE_ID_PROPERTY] = g_param_spec_int ("last-message-id", "last-message-id", "last-message-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_SUMMARY_PREFIX_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_SUMMARY_PREFIX_PROPERTY] = g_param_spec_string ("summary-prefix", "summary-prefix", "summary-prefix", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_TIMESTAMP_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_TIMESTAMP_PROPERTY] = g_param_spec_int64 ("timestamp", "timestamp", "timestamp", G_MININT64, G_MAXINT64, (gint64) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_UNREAD_COUNT_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_UNREAD_COUNT_PROPERTY] = g_param_spec_int ("unread-count", "unread-count", "unread-count", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_AVATAR_PATH_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_AVATAR_PATH_PROPERTY] = g_param_spec_string ("avatar-path", "avatar-path", "avatar-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_KIND_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_KIND_PROPERTY] = g_param_spec_enum ("kind", "kind", "kind", DC_TYPE_CHAT_KIND, DC_CHAT_KIND_UNKNOWN, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_IS_MUTED_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_IS_MUTED_PROPERTY] = g_param_spec_boolean ("is-muted", "is-muted", "is-muted", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_IS_CONTACT_REQUEST_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_IS_CONTACT_REQUEST_PROPERTY] = g_param_spec_boolean ("is-contact-request", "is-contact-request", "is-contact-request", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_IS_PINNED_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_IS_PINNED_PROPERTY] = g_param_spec_boolean ("is-pinned", "is-pinned", "is-pinned", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_IS_ARCHIVED_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_IS_ARCHIVED_PROPERTY] = g_param_spec_boolean ("is-archived", "is-archived", "is-archived", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_WAS_SEEN_RECENTLY_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_WAS_SEEN_RECENTLY_PROPERTY] = g_param_spec_boolean ("was-seen-recently", "was-seen-recently", "was-seen-recently", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CHAT_ENTRY_HAS_MENTION_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_HAS_MENTION_PROPERTY] = g_param_spec_boolean ("has-mention", "has-mention", "has-mention", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dc_chat_entry_instance_init (DcChatEntry * self,
                             gpointer klass)
{
	gchar* _tmp0_;
	self->priv = dc_chat_entry_get_instance_private (self);
	self->priv->_id = 0;
	_tmp0_ = g_strdup ("");
	self->priv->_name = _tmp0_;
	self->priv->_last_message = NULL;
	self->priv->_last_message_id = 0;
	self->priv->_summary_prefix = NULL;
	self->priv->_timestamp = (gint64) 0;
	self->priv->_unread_count = 0;
	self->priv->_avatar_path = NULL;
	self->priv->_kind = DC_CHAT_KIND_UNKNOWN;
	self->priv->_is_muted = FALSE;
	self->priv->_is_contact_request = FALSE;
	self->priv->_is_pinned = FALSE;
	self->priv->_is_archived = FALSE;
	self->priv->_was_seen_recently = FALSE;
	self->priv->_has_mention = FALSE;
}

static void
dc_chat_entry_finalize (GObject * obj)
{
	DcChatEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_CHAT_ENTRY, DcChatEntry);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_last_message);
	_g_free0 (self->priv->_summary_prefix);
	_g_free0 (self->priv->_avatar_path);
	G_OBJECT_CLASS (dc_chat_entry_parent_class)->finalize (obj);
}

static GType
dc_chat_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcChatEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_chat_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcChatEntry), 0, (GInstanceInitFunc) dc_chat_entry_instance_init, NULL };
	GType dc_chat_entry_type_id;
	dc_chat_entry_type_id = g_type_register_static (G_TYPE_OBJECT, "DcChatEntry", &g_define_type_info, 0);
	DcChatEntry_private_offset = g_type_add_instance_private (dc_chat_entry_type_id, sizeof (DcChatEntryPrivate));
	return dc_chat_entry_type_id;
}

GType
dc_chat_entry_get_type (void)
{
	static volatile gsize dc_chat_entry_type_id__once = 0;
	if (g_once_init_enter (&dc_chat_entry_type_id__once)) {
		GType dc_chat_entry_type_id;
		dc_chat_entry_type_id = dc_chat_entry_get_type_once ();
		g_once_init_leave (&dc_chat_entry_type_id__once, dc_chat_entry_type_id);
	}
	return dc_chat_entry_type_id__once;
}

static void
_vala_dc_chat_entry_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec)
{
	DcChatEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_CHAT_ENTRY, DcChatEntry);
	switch (property_id) {
		case DC_CHAT_ENTRY_ID_PROPERTY:
		g_value_set_int (value, dc_chat_entry_get_id (self));
		break;
		case DC_CHAT_ENTRY_NAME_PROPERTY:
		g_value_set_string (value, dc_chat_entry_get_name (self));
		break;
		case DC_CHAT_ENTRY_LAST_MESSAGE_PROPERTY:
		g_value_set_string (value, dc_chat_entry_get_last_message (self));
		break;
		case DC_CHAT_ENTRY_LAST_MESSAGE_ID_PROPERTY:
		g_value_set_int (value, dc_chat_entry_get_last_message_id (self));
		break;
		case DC_CHAT_ENTRY_SUMMARY_PREFIX_PROPERTY:
		g_value_set_string (value, dc_chat_entry_get_summary_prefix (self));
		break;
		case DC_CHAT_ENTRY_TIMESTAMP_PROPERTY:
		g_value_set_int64 (value, dc_chat_entry_get_timestamp (self));
		break;
		case DC_CHAT_ENTRY_UNREAD_COUNT_PROPERTY:
		g_value_set_int (value, dc_chat_entry_get_unread_count (self));
		break;
		case DC_CHAT_ENTRY_AVATAR_PATH_PROPERTY:
		g_value_set_string (value, dc_chat_entry_get_avatar_path (self));
		break;
		case DC_CHAT_ENTRY_KIND_PROPERTY:
		g_value_set_enum (value, dc_chat_entry_get_kind (self));
		break;
		case DC_CHAT_ENTRY_IS_MUTED_PROPERTY:
		g_value_set_boolean (value, dc_chat_entry_get_is_muted (self));
		break;
		case DC_CHAT_ENTRY_IS_CONTACT_REQUEST_PROPERTY:
		g_value_set_boolean (value, dc_chat_entry_get_is_contact_request (self));
		break;
		case DC_CHAT_ENTRY_IS_PINNED_PROPERTY:
		g_value_set_boolean (value, dc_chat_entry_get_is_pinned (self));
		break;
		case DC_CHAT_ENTRY_IS_ARCHIVED_PROPERTY:
		g_value_set_boolean (value, dc_chat_entry_get_is_archived (self));
		break;
		case DC_CHAT_ENTRY_WAS_SEEN_RECENTLY_PROPERTY:
		g_value_set_boolean (value, dc_chat_entry_get_was_seen_recently (self));
		break;
		case DC_CHAT_ENTRY_HAS_MENTION_PROPERTY:
		g_value_set_boolean (value, dc_chat_entry_get_has_mention (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_chat_entry_set_property (GObject * object,
                                  guint property_id,
                                  const GValue * value,
                                  GParamSpec * pspec)
{
	DcChatEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_CHAT_ENTRY, DcChatEntry);
	switch (property_id) {
		case DC_CHAT_ENTRY_ID_PROPERTY:
		dc_chat_entry_set_id (self, g_value_get_int (value));
		break;
		case DC_CHAT_ENTRY_NAME_PROPERTY:
		dc_chat_entry_set_name (self, g_value_get_string (value));
		break;
		case DC_CHAT_ENTRY_LAST_MESSAGE_PROPERTY:
		dc_chat_entry_set_last_message (self, g_value_get_string (value));
		break;
		case DC_CHAT_ENTRY_LAST_MESSAGE_ID_PROPERTY:
		dc_chat_entry_set_last_message_id (self, g_value_get_int (value));
		break;
		case DC_CHAT_ENTRY_SUMMARY_PREFIX_PROPERTY:
		dc_chat_entry_set_summary_prefix (self, g_value_get_string (value));
		break;
		case DC_CHAT_ENTRY_TIMESTAMP_PROPERTY:
		dc_chat_entry_set_timestamp (self, g_value_get_int64 (value));
		break;
		case DC_CHAT_ENTRY_UNREAD_COUNT_PROPERTY:
		dc_chat_entry_set_unread_count (self, g_value_get_int (value));
		break;
		case DC_CHAT_ENTRY_AVATAR_PATH_PROPERTY:
		dc_chat_entry_set_avatar_path (self, g_value_get_string (value));
		break;
		case DC_CHAT_ENTRY_KIND_PROPERTY:
		dc_chat_entry_set_kind (self, g_value_get_enum (value));
		break;
		case DC_CHAT_ENTRY_IS_MUTED_PROPERTY:
		dc_chat_entry_set_is_muted (self, g_value_get_boolean (value));
		break;
		case DC_CHAT_ENTRY_IS_CONTACT_REQUEST_PROPERTY:
		dc_chat_entry_set_is_contact_request (self, g_value_get_boolean (value));
		break;
		case DC_CHAT_ENTRY_IS_PINNED_PROPERTY:
		dc_chat_entry_set_is_pinned (self, g_value_get_boolean (value));
		break;
		case DC_CHAT_ENTRY_IS_ARCHIVED_PROPERTY:
		dc_chat_entry_set_is_archived (self, g_value_get_boolean (value));
		break;
		case DC_CHAT_ENTRY_WAS_SEEN_RECENTLY_PROPERTY:
		dc_chat_entry_set_was_seen_recently (self, g_value_get_boolean (value));
		break;
		case DC_CHAT_ENTRY_HAS_MENTION_PROPERTY:
		dc_chat_entry_set_has_mention (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static GType
dc_chat_kind_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_CHAT_KIND_UNKNOWN, "DC_CHAT_KIND_UNKNOWN", "unknown"}, {DC_CHAT_KIND_DIRECT, "DC_CHAT_KIND_DIRECT", "direct"}, {DC_CHAT_KIND_GROUP, "DC_CHAT_KIND_GROUP", "group"}, {0, NULL, NULL}};
	GType dc_chat_kind_type_id;
	dc_chat_kind_type_id = g_enum_register_static ("DcChatKind", values);
	return dc_chat_kind_type_id;
}

GType
dc_chat_kind_get_type (void)
{
	static volatile gsize dc_chat_kind_type_id__once = 0;
	if (g_once_init_enter (&dc_chat_kind_type_id__once)) {
		GType dc_chat_kind_type_id;
		dc_chat_kind_type_id = dc_chat_kind_get_type_once ();
		g_once_init_leave (&dc_chat_kind_type_id__once, dc_chat_kind_type_id);
	}
	return dc_chat_kind_type_id__once;
}

static inline gpointer
dc_message_reaction_user_get_instance_private (DcMessageReactionUser* self)
{
	return G_STRUCT_MEMBER_P (self, DcMessageReactionUser_private_offset);
}

DcMessageReactionUser*
dc_message_reaction_user_construct (GType object_type,
                                    gint contact_id)
{
	DcMessageReactionUser * self = NULL;
	self = (DcMessageReactionUser*) g_object_new (object_type, NULL);
	dc_message_reaction_user_set_contact_id (self, contact_id);
	return self;
}

DcMessageReactionUser*
dc_message_reaction_user_new (gint contact_id)
{
	return dc_message_reaction_user_construct (DC_TYPE_MESSAGE_REACTION_USER, contact_id);
}

gint
dc_message_reaction_user_get_contact_id (DcMessageReactionUser* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_contact_id;
	return result;
}

void
dc_message_reaction_user_set_contact_id (DcMessageReactionUser* self,
                                         gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_reaction_user_get_contact_id (self);
	if (old_value != value) {
		self->priv->_contact_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_reaction_user_properties[DC_MESSAGE_REACTION_USER_CONTACT_ID_PROPERTY]);
	}
}

static void
dc_message_reaction_user_class_init (DcMessageReactionUserClass * klass,
                                     gpointer klass_data)
{
	dc_message_reaction_user_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcMessageReactionUser_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_message_reaction_user_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_message_reaction_user_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_message_reaction_user_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_REACTION_USER_CONTACT_ID_PROPERTY, dc_message_reaction_user_properties[DC_MESSAGE_REACTION_USER_CONTACT_ID_PROPERTY] = g_param_spec_int ("contact-id", "contact-id", "contact-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dc_message_reaction_user_instance_init (DcMessageReactionUser * self,
                                        gpointer klass)
{
	self->priv = dc_message_reaction_user_get_instance_private (self);
	self->priv->_contact_id = 0;
}

static void
dc_message_reaction_user_finalize (GObject * obj)
{
	DcMessageReactionUser * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_MESSAGE_REACTION_USER, DcMessageReactionUser);
	G_OBJECT_CLASS (dc_message_reaction_user_parent_class)->finalize (obj);
}

static GType
dc_message_reaction_user_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcMessageReactionUserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_message_reaction_user_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcMessageReactionUser), 0, (GInstanceInitFunc) dc_message_reaction_user_instance_init, NULL };
	GType dc_message_reaction_user_type_id;
	dc_message_reaction_user_type_id = g_type_register_static (G_TYPE_OBJECT, "DcMessageReactionUser", &g_define_type_info, 0);
	DcMessageReactionUser_private_offset = g_type_add_instance_private (dc_message_reaction_user_type_id, sizeof (DcMessageReactionUserPrivate));
	return dc_message_reaction_user_type_id;
}

GType
dc_message_reaction_user_get_type (void)
{
	static volatile gsize dc_message_reaction_user_type_id__once = 0;
	if (g_once_init_enter (&dc_message_reaction_user_type_id__once)) {
		GType dc_message_reaction_user_type_id;
		dc_message_reaction_user_type_id = dc_message_reaction_user_get_type_once ();
		g_once_init_leave (&dc_message_reaction_user_type_id__once, dc_message_reaction_user_type_id);
	}
	return dc_message_reaction_user_type_id__once;
}

static void
_vala_dc_message_reaction_user_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	DcMessageReactionUser * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_MESSAGE_REACTION_USER, DcMessageReactionUser);
	switch (property_id) {
		case DC_MESSAGE_REACTION_USER_CONTACT_ID_PROPERTY:
		g_value_set_int (value, dc_message_reaction_user_get_contact_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_message_reaction_user_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	DcMessageReactionUser * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_MESSAGE_REACTION_USER, DcMessageReactionUser);
	switch (property_id) {
		case DC_MESSAGE_REACTION_USER_CONTACT_ID_PROPERTY:
		dc_message_reaction_user_set_contact_id (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dc_message_reaction_get_instance_private (DcMessageReaction* self)
{
	return G_STRUCT_MEMBER_P (self, DcMessageReaction_private_offset);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

DcMessageReaction*
dc_message_reaction_construct (GType object_type,
                               const gchar* emoji)
{
	DcMessageReaction * self = NULL;
	g_return_val_if_fail (emoji != NULL, NULL);
	self = (DcMessageReaction*) g_object_new (object_type, NULL);
	dc_message_reaction_set_emoji (self, emoji);
	return self;
}

DcMessageReaction*
dc_message_reaction_new (const gchar* emoji)
{
	return dc_message_reaction_construct (DC_TYPE_MESSAGE_REACTION, emoji);
}

void
dc_message_reaction_add_user (DcMessageReaction* self,
                              gint contact_id)
{
	GPtrArray* _tmp0_;
	DcMessageReactionUser* _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->users;
	_tmp1_ = dc_message_reaction_user_new (contact_id);
	g_ptr_array_add (_tmp0_, _tmp1_);
	_tmp2_ = self->priv->_count;
	dc_message_reaction_set_count (self, _tmp2_ + 1);
}

const gchar*
dc_message_reaction_get_emoji (DcMessageReaction* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_emoji;
	result = _tmp0_;
	return result;
}

void
dc_message_reaction_set_emoji (DcMessageReaction* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_reaction_get_emoji (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_emoji);
		self->priv->_emoji = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_reaction_properties[DC_MESSAGE_REACTION_EMOJI_PROPERTY]);
	}
}

gint
dc_message_reaction_get_count (DcMessageReaction* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_count;
	return result;
}

void
dc_message_reaction_set_count (DcMessageReaction* self,
                               gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_reaction_get_count (self);
	if (old_value != value) {
		self->priv->_count = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_reaction_properties[DC_MESSAGE_REACTION_COUNT_PROPERTY]);
	}
}

static void
dc_message_reaction_class_init (DcMessageReactionClass * klass,
                                gpointer klass_data)
{
	dc_message_reaction_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcMessageReaction_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_message_reaction_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_message_reaction_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_message_reaction_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_REACTION_EMOJI_PROPERTY, dc_message_reaction_properties[DC_MESSAGE_REACTION_EMOJI_PROPERTY] = g_param_spec_string ("emoji", "emoji", "emoji", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_REACTION_COUNT_PROPERTY, dc_message_reaction_properties[DC_MESSAGE_REACTION_COUNT_PROPERTY] = g_param_spec_int ("count", "count", "count", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dc_message_reaction_instance_init (DcMessageReaction * self,
                                   gpointer klass)
{
	gchar* _tmp0_;
	GPtrArray* _tmp1_;
	self->priv = dc_message_reaction_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_emoji = _tmp0_;
	self->priv->_count = 0;
	_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_object_unref0_);
	self->users = _tmp1_;
}

static void
dc_message_reaction_finalize (GObject * obj)
{
	DcMessageReaction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_MESSAGE_REACTION, DcMessageReaction);
	_g_free0 (self->priv->_emoji);
	_g_ptr_array_unref0 (self->users);
	G_OBJECT_CLASS (dc_message_reaction_parent_class)->finalize (obj);
}

static GType
dc_message_reaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcMessageReactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_message_reaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcMessageReaction), 0, (GInstanceInitFunc) dc_message_reaction_instance_init, NULL };
	GType dc_message_reaction_type_id;
	dc_message_reaction_type_id = g_type_register_static (G_TYPE_OBJECT, "DcMessageReaction", &g_define_type_info, 0);
	DcMessageReaction_private_offset = g_type_add_instance_private (dc_message_reaction_type_id, sizeof (DcMessageReactionPrivate));
	return dc_message_reaction_type_id;
}

GType
dc_message_reaction_get_type (void)
{
	static volatile gsize dc_message_reaction_type_id__once = 0;
	if (g_once_init_enter (&dc_message_reaction_type_id__once)) {
		GType dc_message_reaction_type_id;
		dc_message_reaction_type_id = dc_message_reaction_get_type_once ();
		g_once_init_leave (&dc_message_reaction_type_id__once, dc_message_reaction_type_id);
	}
	return dc_message_reaction_type_id__once;
}

static void
_vala_dc_message_reaction_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	DcMessageReaction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_MESSAGE_REACTION, DcMessageReaction);
	switch (property_id) {
		case DC_MESSAGE_REACTION_EMOJI_PROPERTY:
		g_value_set_string (value, dc_message_reaction_get_emoji (self));
		break;
		case DC_MESSAGE_REACTION_COUNT_PROPERTY:
		g_value_set_int (value, dc_message_reaction_get_count (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_message_reaction_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	DcMessageReaction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_MESSAGE_REACTION, DcMessageReaction);
	switch (property_id) {
		case DC_MESSAGE_REACTION_EMOJI_PROPERTY:
		dc_message_reaction_set_emoji (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_REACTION_COUNT_PROPERTY:
		dc_message_reaction_set_count (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static GType
dc_message_state_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_MESSAGE_STATE_UNDEFINED, "DC_MESSAGE_STATE_UNDEFINED", "undefined"}, {DC_MESSAGE_STATE_IN_FRESH, "DC_MESSAGE_STATE_IN_FRESH", "in-fresh"}, {DC_MESSAGE_STATE_IN_NOTICED, "DC_MESSAGE_STATE_IN_NOTICED", "in-noticed"}, {DC_MESSAGE_STATE_IN_SEEN, "DC_MESSAGE_STATE_IN_SEEN", "in-seen"}, {DC_MESSAGE_STATE_OUT_PREPARING, "DC_MESSAGE_STATE_OUT_PREPARING", "out-preparing"}, {DC_MESSAGE_STATE_OUT_DRAFT, "DC_MESSAGE_STATE_OUT_DRAFT", "out-draft"}, {DC_MESSAGE_STATE_OUT_PENDING, "DC_MESSAGE_STATE_OUT_PENDING", "out-pending"}, {DC_MESSAGE_STATE_OUT_FAILED, "DC_MESSAGE_STATE_OUT_FAILED", "out-failed"}, {DC_MESSAGE_STATE_OUT_DELIVERED, "DC_MESSAGE_STATE_OUT_DELIVERED", "out-delivered"}, {DC_MESSAGE_STATE_OUT_MDN_RCVD, "DC_MESSAGE_STATE_OUT_MDN_RCVD", "out-mdn-rcvd"}, {0, NULL, NULL}};
	GType dc_message_state_type_id;
	dc_message_state_type_id = g_enum_register_static ("DcMessageState", values);
	return dc_message_state_type_id;
}

GType
dc_message_state_get_type (void)
{
	static volatile gsize dc_message_state_type_id__once = 0;
	if (g_once_init_enter (&dc_message_state_type_id__once)) {
		GType dc_message_state_type_id;
		dc_message_state_type_id = dc_message_state_get_type_once ();
		g_once_init_leave (&dc_message_state_type_id__once, dc_message_state_type_id);
	}
	return dc_message_state_type_id__once;
}

static inline gpointer
dc_message_get_instance_private (DcMessage* self)
{
	return G_STRUCT_MEMBER_P (self, DcMessage_private_offset);
}

gboolean
dc_message_is_image_file (DcMessage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dc_message_has_mime (self, "image/")) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = dc_message_view_type_is (self, "image", "gif", "sticker");
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = dc_message_path_has_suffix (self, DC_MESSAGE_IMAGE_EXTENSIONS, (gint) G_N_ELEMENTS (DC_MESSAGE_IMAGE_EXTENSIONS));
	}
	result = _tmp0_;
	return result;
}

/** GIF/WebP/WebM attachments render as stickers when supported. */
gboolean
dc_message_is_sticker_file (DcMessage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dc_message_has_mime (self, "image/gif")) {
		_tmp3_ = TRUE;
	} else {
		_tmp3_ = dc_message_has_mime (self, "image/webp");
	}
	if (_tmp3_) {
		_tmp2_ = TRUE;
	} else {
		_tmp2_ = dc_message_has_mime (self, "video/webm");
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = dc_message_view_type_is (self, "sticker", "gif", NULL);
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = dc_message_path_has_suffix (self, DC_MESSAGE_STICKER_EXTENSIONS, (gint) G_N_ELEMENTS (DC_MESSAGE_STICKER_EXTENSIONS));
	}
	result = _tmp0_;
	return result;
}

/** Webxdc mini-app attachment (runnable when built with -Dwebxdc). */
gboolean
dc_message_is_webxdc (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = dc_message_view_type_is (self, "webxdc", NULL, NULL);
	return result;
}

gboolean
dc_message_is_video_sticker_file (DcMessage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dc_message_has_mime (self, "video/webm")) {
		_tmp0_ = TRUE;
	} else {
		gchar* _tmp1_;
		gchar** _tmp2_;
		gchar** _tmp3_;
		gint _tmp3__length1;
		_tmp1_ = g_strdup (".webm");
		_tmp2_ = g_new0 (gchar*, 1 + 1);
		_tmp2_[0] = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp3__length1 = 1;
		_tmp0_ = dc_message_path_has_suffix (self, _tmp3_, (gint) 1);
		_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_is_video_file (DcMessage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dc_message_has_mime (self, "video/")) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = dc_message_view_type_is (self, "video", NULL, NULL);
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = dc_message_path_has_suffix (self, DC_MESSAGE_VIDEO_EXTENSIONS, (gint) G_N_ELEMENTS (DC_MESSAGE_VIDEO_EXTENSIONS));
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_is_audio_file (DcMessage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dc_message_has_mime (self, "audio/")) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = dc_message_view_type_is (self, "audio", "voice", NULL);
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = dc_message_path_has_suffix (self, DC_MESSAGE_AUDIO_EXTENSIONS, (gint) G_N_ELEMENTS (DC_MESSAGE_AUDIO_EXTENSIONS));
	}
	result = _tmp0_;
	return result;
}

/** Text-like attachments (txt/md/html) can be previewed inline. */
gboolean
dc_message_is_text_preview_file (DcMessage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dc_message_has_mime (self, "text/plain")) {
		_tmp2_ = TRUE;
	} else {
		_tmp2_ = dc_message_has_mime (self, "text/markdown");
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = dc_message_has_mime (self, "text/html");
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = dc_message_path_has_suffix (self, DC_MESSAGE_TEXT_EXTENSIONS, (gint) G_N_ELEMENTS (DC_MESSAGE_TEXT_EXTENSIONS));
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_is_markdown_file (DcMessage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dc_message_has_mime (self, "text/markdown")) {
		_tmp0_ = TRUE;
	} else {
		gchar* _tmp1_;
		gchar* _tmp2_;
		gchar** _tmp3_;
		gchar** _tmp4_;
		gint _tmp4__length1;
		_tmp1_ = g_strdup (".md");
		_tmp2_ = g_strdup (".markdown");
		_tmp3_ = g_new0 (gchar*, 2 + 1);
		_tmp3_[0] = _tmp1_;
		_tmp3_[1] = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp4__length1 = 2;
		_tmp0_ = dc_message_path_has_suffix (self, _tmp4_, (gint) 2);
		_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_is_html_file (DcMessage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dc_message_has_mime (self, "text/html")) {
		_tmp0_ = TRUE;
	} else {
		gchar* _tmp1_;
		gchar* _tmp2_;
		gchar** _tmp3_;
		gchar** _tmp4_;
		gint _tmp4__length1;
		_tmp1_ = g_strdup (".html");
		_tmp2_ = g_strdup (".htm");
		_tmp3_ = g_new0 (gchar*, 2 + 1);
		_tmp3_[0] = _tmp1_;
		_tmp3_[1] = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp4__length1 = 2;
		_tmp0_ = dc_message_path_has_suffix (self, _tmp4_, (gint) 2);
		_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
	}
	result = _tmp0_;
	return result;
}

gchar*
dc_message_display_file_name (DcMessage* self,
                              const gchar* fallback)
{
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (fallback != NULL, NULL);
	_tmp1_ = self->priv->_file_name;
	if (dc_message_has_value (self, _tmp1_)) {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->_file_name;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = fallback;
	}
	_tmp3_ = g_strdup (_tmp0_);
	result = _tmp3_;
	return result;
}

/** Copy all properties into a fresh instance. Gtk.ListView reuses the
         * row widget when the same Message pointer reappears at a position, so
         * mutating in place never rebinds; splicing a distinct copy does. */
static gpointer
_g_ptr_array_ref0 (gpointer self)
{
	return self ? g_ptr_array_ref (self) : NULL;
}

DcMessage*
dc_message_dup (DcMessage* self)
{
	DcMessage* copy = NULL;
	DcMessage* _tmp0_;
	static const GParamFlags RW = G_PARAM_READABLE | G_PARAM_WRITABLE;
	GObjectClass* _tmp1_;
	guint _tmp2_ = 0;
	GParamSpec** _tmp3_;
	DcMessage* _tmp13_;
	GPtrArray* _tmp14_;
	GPtrArray* _tmp15_;
	DcMessage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = dc_message_new ();
	copy = _tmp0_;
	_tmp1_ = G_OBJECT_GET_CLASS ((GObject*) self);
	_tmp3_ = g_object_class_list_properties (_tmp1_, &_tmp2_);
	{
		GParamSpec** spec_collection = NULL;
		gint spec_collection_length1 = 0;
		gint _spec_collection_size_ = 0;
		gint spec_it = 0;
		spec_collection = _tmp3_;
		spec_collection_length1 = _tmp2_;
		for (spec_it = 0; spec_it < spec_collection_length1; spec_it = spec_it + 1) {
			GParamSpec* spec = NULL;
			spec = spec_collection[spec_it];
			{
				GParamSpec* _tmp4_;
				GValue val = {0};
				GParamSpec* _tmp5_;
				GValue _tmp6_ = {0};
				GParamSpec* _tmp7_;
				const gchar* _tmp8_;
				DcMessage* _tmp9_;
				GParamSpec* _tmp10_;
				const gchar* _tmp11_;
				GValue _tmp12_;
				_tmp4_ = spec;
				if ((_tmp4_->flags & RW) != RW) {
					continue;
				}
				_tmp5_ = spec;
				g_value_init (&_tmp6_, _tmp5_->value_type);
				val = _tmp6_;
				_tmp7_ = spec;
				_tmp8_ = _tmp7_->name;
				g_object_get_property ((GObject*) self, _tmp8_, &val);
				_tmp9_ = copy;
				_tmp10_ = spec;
				_tmp11_ = _tmp10_->name;
				_tmp12_ = val;
				g_object_set_property ((GObject*) _tmp9_, _tmp11_, &_tmp12_);
				G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
			}
		}
		spec_collection = (g_free (spec_collection), NULL);
	}
	_tmp13_ = copy;
	_tmp14_ = self->reaction_details;
	_tmp15_ = _g_ptr_array_ref0 (_tmp14_);
	_g_ptr_array_unref0 (_tmp13_->reaction_details);
	_tmp13_->reaction_details = _tmp15_;
	result = copy;
	return result;
}

static gboolean
dc_message_has_value (DcMessage* self,
                      const gchar* value)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (value != NULL) {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (value);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
dc_message_has_mime (DcMessage* self,
                     const gchar* prefix)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (prefix != NULL, FALSE);
	_tmp1_ = self->priv->_file_mime;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->_file_mime;
		_tmp0_ = g_str_has_prefix (_tmp2_, prefix);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
dc_message_view_type_is (DcMessage* self,
                         const gchar* a,
                         const gchar* b,
                         const gchar* c)
{
	const gchar* _tmp0_;
	gchar* vt = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	const gchar* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (a != NULL, FALSE);
	_tmp0_ = self->priv->_view_type;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_view_type;
	_tmp2_ = g_utf8_strdown (_tmp1_, (gssize) -1);
	vt = _tmp2_;
	_tmp5_ = vt;
	if (g_strcmp0 (_tmp5_, a) == 0) {
		_tmp4_ = TRUE;
	} else {
		gboolean _tmp6_ = FALSE;
		if (b != NULL) {
			const gchar* _tmp7_;
			_tmp7_ = vt;
			_tmp6_ = g_strcmp0 (_tmp7_, b) == 0;
		} else {
			_tmp6_ = FALSE;
		}
		_tmp4_ = _tmp6_;
	}
	if (_tmp4_) {
		_tmp3_ = TRUE;
	} else {
		gboolean _tmp8_ = FALSE;
		if (c != NULL) {
			const gchar* _tmp9_;
			_tmp9_ = vt;
			_tmp8_ = g_strcmp0 (_tmp9_, c) == 0;
		} else {
			_tmp8_ = FALSE;
		}
		_tmp3_ = _tmp8_;
	}
	result = _tmp3_;
	_g_free0 (vt);
	return result;
}

static gboolean
dc_message_path_has_suffix (DcMessage* self,
                            gchar** suffixes,
                            gint suffixes_length1)
{
	const gchar* _tmp0_;
	gchar* lower = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_file_path;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_file_path;
	_tmp2_ = g_utf8_strdown (_tmp1_, (gssize) -1);
	lower = _tmp2_;
	{
		gchar** suffix_collection = NULL;
		gint suffix_collection_length1 = 0;
		gint _suffix_collection_size_ = 0;
		gint suffix_it = 0;
		suffix_collection = suffixes;
		suffix_collection_length1 = suffixes_length1;
		for (suffix_it = 0; suffix_it < suffix_collection_length1; suffix_it = suffix_it + 1) {
			gchar* _tmp3_;
			gchar* suffix = NULL;
			_tmp3_ = g_strdup (suffix_collection[suffix_it]);
			suffix = _tmp3_;
			{
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				_tmp4_ = lower;
				_tmp5_ = suffix;
				if (g_str_has_suffix (_tmp4_, _tmp5_)) {
					result = TRUE;
					_g_free0 (suffix);
					_g_free0 (lower);
					return result;
				}
				_g_free0 (suffix);
			}
		}
	}
	result = FALSE;
	_g_free0 (lower);
	return result;
}

DcMessage*
dc_message_construct (GType object_type)
{
	DcMessage * self = NULL;
	self = (DcMessage*) g_object_new (object_type, NULL);
	return self;
}

DcMessage*
dc_message_new (void)
{
	return dc_message_construct (DC_TYPE_MESSAGE);
}

gint
dc_message_get_id (DcMessage* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_id;
	return result;
}

void
dc_message_set_id (DcMessage* self,
                   gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_ID_PROPERTY]);
	}
}

gint
dc_message_get_chat_id (DcMessage* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_chat_id;
	return result;
}

void
dc_message_set_chat_id (DcMessage* self,
                        gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_chat_id (self);
	if (old_value != value) {
		self->priv->_chat_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_CHAT_ID_PROPERTY]);
	}
}

const gchar*
dc_message_get_text (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_text;
	result = _tmp0_;
	return result;
}

void
dc_message_set_text (DcMessage* self,
                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_text);
		self->priv->_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_TEXT_PROPERTY]);
	}
}

const gchar*
dc_message_get_sender_address (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sender_address;
	result = _tmp0_;
	return result;
}

void
dc_message_set_sender_address (DcMessage* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_sender_address (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_sender_address);
		self->priv->_sender_address = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_SENDER_ADDRESS_PROPERTY]);
	}
}

const gchar*
dc_message_get_sender_name (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sender_name;
	result = _tmp0_;
	return result;
}

void
dc_message_set_sender_name (DcMessage* self,
                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_sender_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_sender_name);
		self->priv->_sender_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_SENDER_NAME_PROPERTY]);
	}
}

const gchar*
dc_message_get_sender_avatar_path (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sender_avatar_path;
	result = _tmp0_;
	return result;
}

void
dc_message_set_sender_avatar_path (DcMessage* self,
                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_sender_avatar_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_sender_avatar_path);
		self->priv->_sender_avatar_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_SENDER_AVATAR_PATH_PROPERTY]);
	}
}

gint
dc_message_get_sender_contact_id (DcMessage* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_sender_contact_id;
	return result;
}

void
dc_message_set_sender_contact_id (DcMessage* self,
                                  gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_sender_contact_id (self);
	if (old_value != value) {
		self->priv->_sender_contact_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_SENDER_CONTACT_ID_PROPERTY]);
	}
}

gboolean
dc_message_get_sender_was_seen_recently (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_sender_was_seen_recently;
	return result;
}

void
dc_message_set_sender_was_seen_recently (DcMessage* self,
                                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_sender_was_seen_recently (self);
	if (old_value != value) {
		self->priv->_sender_was_seen_recently = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_SENDER_WAS_SEEN_RECENTLY_PROPERTY]);
	}
}

gboolean
dc_message_get_is_forwarded (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_forwarded;
	return result;
}

void
dc_message_set_is_forwarded (DcMessage* self,
                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_is_forwarded (self);
	if (old_value != value) {
		self->priv->_is_forwarded = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_IS_FORWARDED_PROPERTY]);
	}
}

gboolean
dc_message_get_is_edited (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_edited;
	return result;
}

void
dc_message_set_is_edited (DcMessage* self,
                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_is_edited (self);
	if (old_value != value) {
		self->priv->_is_edited = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_IS_EDITED_PROPERTY]);
	}
}

const gchar*
dc_message_get_override_sender_name (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_override_sender_name;
	result = _tmp0_;
	return result;
}

void
dc_message_set_override_sender_name (DcMessage* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_override_sender_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_override_sender_name);
		self->priv->_override_sender_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_OVERRIDE_SENDER_NAME_PROPERTY]);
	}
}

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

void
dc_message_set_timestamp (DcMessage* self,
                          gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_timestamp (self);
	if (old_value != value) {
		self->priv->_timestamp = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_TIMESTAMP_PROPERTY]);
	}
}

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

void
dc_message_set_is_outgoing (DcMessage* self,
                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_is_outgoing (self);
	if (old_value != value) {
		self->priv->_is_outgoing = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_IS_OUTGOING_PROPERTY]);
	}
}

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

void
dc_message_set_file_path (DcMessage* self,
                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_file_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_file_path);
		self->priv->_file_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_FILE_PATH_PROPERTY]);
	}
}

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

void
dc_message_set_file_name (DcMessage* self,
                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_file_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_file_name);
		self->priv->_file_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_FILE_NAME_PROPERTY]);
	}
}

const gchar*
dc_message_get_file_mime (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_mime;
	result = _tmp0_;
	return result;
}

void
dc_message_set_file_mime (DcMessage* self,
                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_file_mime (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_file_mime);
		self->priv->_file_mime = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_FILE_MIME_PROPERTY]);
	}
}

gint
dc_message_get_file_bytes (DcMessage* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_file_bytes;
	return result;
}

void
dc_message_set_file_bytes (DcMessage* self,
                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_file_bytes (self);
	if (old_value != value) {
		self->priv->_file_bytes = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_FILE_BYTES_PROPERTY]);
	}
}

const gchar*
dc_message_get_view_type (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_view_type;
	result = _tmp0_;
	return result;
}

void
dc_message_set_view_type (DcMessage* self,
                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_view_type (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_view_type);
		self->priv->_view_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_VIEW_TYPE_PROPERTY]);
	}
}

gboolean
dc_message_get_is_info (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_info;
	return result;
}

void
dc_message_set_is_info (DcMessage* self,
                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_is_info (self);
	if (old_value != value) {
		self->priv->_is_info = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_IS_INFO_PROPERTY]);
	}
}

gboolean
dc_message_get_has_html (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_has_html;
	return result;
}

void
dc_message_set_has_html (DcMessage* self,
                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_has_html (self);
	if (old_value != value) {
		self->priv->_has_html = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_HAS_HTML_PROPERTY]);
	}
}

const gchar*
dc_message_get_download_state (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_download_state;
	result = _tmp0_;
	return result;
}

void
dc_message_set_download_state (DcMessage* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_download_state (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_download_state);
		self->priv->_download_state = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_DOWNLOAD_STATE_PROPERTY]);
	}
}

const gchar*
dc_message_get_reactions (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_reactions;
	result = _tmp0_;
	return result;
}

void
dc_message_set_reactions (DcMessage* self,
                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_reactions (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_reactions);
		self->priv->_reactions = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_REACTIONS_PROPERTY]);
	}
}

const gchar*
dc_message_get_my_reactions (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_my_reactions;
	result = _tmp0_;
	return result;
}

void
dc_message_set_my_reactions (DcMessage* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_my_reactions (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_my_reactions);
		self->priv->_my_reactions = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_MY_REACTIONS_PROPERTY]);
	}
}

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

void
dc_message_set_quote_msg_id (DcMessage* self,
                             gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_quote_msg_id (self);
	if (old_value != value) {
		self->priv->_quote_msg_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_QUOTE_MSG_ID_PROPERTY]);
	}
}

const gchar*
dc_message_get_quote_text (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_quote_text;
	result = _tmp0_;
	return result;
}

void
dc_message_set_quote_text (DcMessage* self,
                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_quote_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_quote_text);
		self->priv->_quote_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_QUOTE_TEXT_PROPERTY]);
	}
}

const gchar*
dc_message_get_quote_sender_name (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_quote_sender_name;
	result = _tmp0_;
	return result;
}

void
dc_message_set_quote_sender_name (DcMessage* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_quote_sender_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_quote_sender_name);
		self->priv->_quote_sender_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_QUOTE_SENDER_NAME_PROPERTY]);
	}
}

gboolean
dc_message_get_is_pinned (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_pinned;
	return result;
}

void
dc_message_set_is_pinned (DcMessage* self,
                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_is_pinned (self);
	if (old_value != value) {
		self->priv->_is_pinned = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_IS_PINNED_PROPERTY]);
	}
}

gboolean
dc_message_get_highlighted (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_highlighted;
	return result;
}

void
dc_message_set_highlighted (DcMessage* self,
                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_highlighted (self);
	if (old_value != value) {
		self->priv->_highlighted = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_HIGHLIGHTED_PROPERTY]);
	}
}

gboolean
dc_message_get_selection_visible (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_selection_visible;
	return result;
}

void
dc_message_set_selection_visible (DcMessage* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_selection_visible (self);
	if (old_value != value) {
		self->priv->_selection_visible = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_SELECTION_VISIBLE_PROPERTY]);
	}
}

gboolean
dc_message_get_selected (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_selected;
	return result;
}

void
dc_message_set_selected (DcMessage* self,
                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_selected (self);
	if (old_value != value) {
		self->priv->_selected = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_SELECTED_PROPERTY]);
	}
}

const gchar*
dc_message_get_full_message_text (DcMessage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_full_message_text;
	result = _tmp0_;
	return result;
}

void
dc_message_set_full_message_text (DcMessage* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_full_message_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_full_message_text);
		self->priv->_full_message_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_FULL_MESSAGE_TEXT_PROPERTY]);
	}
}

gboolean
dc_message_get_full_message_expanded (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_full_message_expanded;
	return result;
}

void
dc_message_set_full_message_expanded (DcMessage* self,
                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_full_message_expanded (self);
	if (old_value != value) {
		self->priv->_full_message_expanded = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_FULL_MESSAGE_EXPANDED_PROPERTY]);
	}
}

gboolean
dc_message_get_full_message_loading (DcMessage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_full_message_loading;
	return result;
}

void
dc_message_set_full_message_loading (DcMessage* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_full_message_loading (self);
	if (old_value != value) {
		self->priv->_full_message_loading = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_FULL_MESSAGE_LOADING_PROPERTY]);
	}
}

gint
dc_message_get_state (DcMessage* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_state;
	return result;
}

void
dc_message_set_state (DcMessage* self,
                      gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_message_get_state (self);
	if (old_value != value) {
		self->priv->_state = value;
		g_object_notify_by_pspec ((GObject *) self, dc_message_properties[DC_MESSAGE_STATE_PROPERTY]);
	}
}

gboolean
dc_message_get_is_pending (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_state;
	if (_tmp1_ == ((gint) DC_MESSAGE_STATE_OUT_PENDING)) {
		_tmp0_ = TRUE;
	} else {
		gint _tmp2_;
		_tmp2_ = self->priv->_state;
		_tmp0_ = _tmp2_ == ((gint) DC_MESSAGE_STATE_OUT_PREPARING);
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_get_is_delivered (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_state;
	if (_tmp1_ == ((gint) DC_MESSAGE_STATE_OUT_DELIVERED)) {
		_tmp0_ = TRUE;
	} else {
		gint _tmp2_;
		_tmp2_ = self->priv->_state;
		_tmp0_ = _tmp2_ == ((gint) DC_MESSAGE_STATE_OUT_MDN_RCVD);
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_get_is_read (DcMessage* self)
{
	gboolean result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_state;
	result = _tmp0_ == ((gint) DC_MESSAGE_STATE_OUT_MDN_RCVD);
	return result;
}

gboolean
dc_message_get_is_failed (DcMessage* self)
{
	gboolean result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_state;
	result = _tmp0_ == ((gint) DC_MESSAGE_STATE_OUT_FAILED);
	return result;
}

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

gboolean
dc_message_get_has_text (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_text;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		_tmp2_ = self->priv->_text;
		_tmp3_ = string_strip (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = strlen (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ > 0;
		_g_free0 (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_get_can_download_full_message (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_download_state;
	if (g_strcmp0 (_tmp1_, "Available") == 0) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->_download_state;
		_tmp0_ = g_strcmp0 (_tmp2_, "Failure") == 0;
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_get_is_downloading_full_message (DcMessage* self)
{
	gboolean result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_download_state;
	result = g_strcmp0 (_tmp0_, "InProgress") == 0;
	return result;
}

gboolean
dc_message_get_has_full_message_action (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp2_ = dc_message_get_can_download_full_message (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp4_;
		_tmp4_ = self->priv->_has_html;
		_tmp1_ = _tmp4_;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp5_;
		_tmp5_ = self->priv->_full_message_text;
		_tmp0_ = _tmp5_ != NULL;
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_get_can_edit_text (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp4_ = self->priv->_is_outgoing;
	if (_tmp4_) {
		gboolean _tmp5_;
		_tmp5_ = self->priv->_is_info;
		_tmp3_ = !_tmp5_;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp6_ = dc_message_get_has_text (self);
		_tmp7_ = _tmp6_;
		_tmp2_ = _tmp7_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gboolean _tmp8_;
		_tmp8_ = self->priv->_has_html;
		_tmp1_ = !_tmp8_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = !dc_message_view_type_is (self, "call", NULL, NULL);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_get_has_file (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_file_name;
	if (dc_message_has_value (self, _tmp1_)) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->_file_path;
		_tmp0_ = dc_message_has_value (self, _tmp2_);
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_get_has_local_file (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_file_path;
	if (dc_message_has_value (self, _tmp1_)) {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->_file_path;
		_tmp0_ = g_file_test (_tmp2_, G_FILE_TEST_EXISTS);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

gboolean
dc_message_get_is_image_only (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp3_ = self->priv->_is_info;
	if (!_tmp3_) {
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp4_ = dc_message_get_has_text (self);
		_tmp5_ = _tmp4_;
		_tmp2_ = !_tmp5_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		const gchar* _tmp6_;
		_tmp6_ = self->priv->_file_path;
		_tmp1_ = dc_message_has_value (self, _tmp6_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gboolean _tmp7_ = FALSE;
		if (dc_message_is_image_file (self)) {
			_tmp7_ = TRUE;
		} else {
			_tmp7_ = dc_message_is_sticker_file (self);
		}
		_tmp0_ = _tmp7_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static void
dc_message_class_init (DcMessageClass * klass,
                       gpointer klass_data)
{
	dc_message_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcMessage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_message_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_message_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_message_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_ID_PROPERTY, dc_message_properties[DC_MESSAGE_ID_PROPERTY] = g_param_spec_int ("id", "id", "id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_CHAT_ID_PROPERTY, dc_message_properties[DC_MESSAGE_CHAT_ID_PROPERTY] = g_param_spec_int ("chat-id", "chat-id", "chat-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_TEXT_PROPERTY, dc_message_properties[DC_MESSAGE_TEXT_PROPERTY] = g_param_spec_string ("text", "text", "text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_SENDER_ADDRESS_PROPERTY, dc_message_properties[DC_MESSAGE_SENDER_ADDRESS_PROPERTY] = g_param_spec_string ("sender-address", "sender-address", "sender-address", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_SENDER_NAME_PROPERTY, dc_message_properties[DC_MESSAGE_SENDER_NAME_PROPERTY] = g_param_spec_string ("sender-name", "sender-name", "sender-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_SENDER_AVATAR_PATH_PROPERTY, dc_message_properties[DC_MESSAGE_SENDER_AVATAR_PATH_PROPERTY] = g_param_spec_string ("sender-avatar-path", "sender-avatar-path", "sender-avatar-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_SENDER_CONTACT_ID_PROPERTY, dc_message_properties[DC_MESSAGE_SENDER_CONTACT_ID_PROPERTY] = g_param_spec_int ("sender-contact-id", "sender-contact-id", "sender-contact-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_SENDER_WAS_SEEN_RECENTLY_PROPERTY, dc_message_properties[DC_MESSAGE_SENDER_WAS_SEEN_RECENTLY_PROPERTY] = g_param_spec_boolean ("sender-was-seen-recently", "sender-was-seen-recently", "sender-was-seen-recently", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_FORWARDED_PROPERTY, dc_message_properties[DC_MESSAGE_IS_FORWARDED_PROPERTY] = g_param_spec_boolean ("is-forwarded", "is-forwarded", "is-forwarded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_EDITED_PROPERTY, dc_message_properties[DC_MESSAGE_IS_EDITED_PROPERTY] = g_param_spec_boolean ("is-edited", "is-edited", "is-edited", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_OVERRIDE_SENDER_NAME_PROPERTY, dc_message_properties[DC_MESSAGE_OVERRIDE_SENDER_NAME_PROPERTY] = g_param_spec_string ("override-sender-name", "override-sender-name", "override-sender-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_TIMESTAMP_PROPERTY, dc_message_properties[DC_MESSAGE_TIMESTAMP_PROPERTY] = g_param_spec_int64 ("timestamp", "timestamp", "timestamp", G_MININT64, G_MAXINT64, (gint64) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_OUTGOING_PROPERTY, dc_message_properties[DC_MESSAGE_IS_OUTGOING_PROPERTY] = g_param_spec_boolean ("is-outgoing", "is-outgoing", "is-outgoing", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_FILE_PATH_PROPERTY, dc_message_properties[DC_MESSAGE_FILE_PATH_PROPERTY] = g_param_spec_string ("file-path", "file-path", "file-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_FILE_NAME_PROPERTY, dc_message_properties[DC_MESSAGE_FILE_NAME_PROPERTY] = g_param_spec_string ("file-name", "file-name", "file-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_FILE_MIME_PROPERTY, dc_message_properties[DC_MESSAGE_FILE_MIME_PROPERTY] = g_param_spec_string ("file-mime", "file-mime", "file-mime", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_FILE_BYTES_PROPERTY, dc_message_properties[DC_MESSAGE_FILE_BYTES_PROPERTY] = g_param_spec_int ("file-bytes", "file-bytes", "file-bytes", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_VIEW_TYPE_PROPERTY, dc_message_properties[DC_MESSAGE_VIEW_TYPE_PROPERTY] = g_param_spec_string ("view-type", "view-type", "view-type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_INFO_PROPERTY, dc_message_properties[DC_MESSAGE_IS_INFO_PROPERTY] = g_param_spec_boolean ("is-info", "is-info", "is-info", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_HAS_HTML_PROPERTY, dc_message_properties[DC_MESSAGE_HAS_HTML_PROPERTY] = g_param_spec_boolean ("has-html", "has-html", "has-html", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_DOWNLOAD_STATE_PROPERTY, dc_message_properties[DC_MESSAGE_DOWNLOAD_STATE_PROPERTY] = g_param_spec_string ("download-state", "download-state", "download-state", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_REACTIONS_PROPERTY, dc_message_properties[DC_MESSAGE_REACTIONS_PROPERTY] = g_param_spec_string ("reactions", "reactions", "reactions", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_MY_REACTIONS_PROPERTY, dc_message_properties[DC_MESSAGE_MY_REACTIONS_PROPERTY] = g_param_spec_string ("my-reactions", "my-reactions", "my-reactions", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_QUOTE_MSG_ID_PROPERTY, dc_message_properties[DC_MESSAGE_QUOTE_MSG_ID_PROPERTY] = g_param_spec_int ("quote-msg-id", "quote-msg-id", "quote-msg-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_QUOTE_TEXT_PROPERTY, dc_message_properties[DC_MESSAGE_QUOTE_TEXT_PROPERTY] = g_param_spec_string ("quote-text", "quote-text", "quote-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_QUOTE_SENDER_NAME_PROPERTY, dc_message_properties[DC_MESSAGE_QUOTE_SENDER_NAME_PROPERTY] = g_param_spec_string ("quote-sender-name", "quote-sender-name", "quote-sender-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_PINNED_PROPERTY, dc_message_properties[DC_MESSAGE_IS_PINNED_PROPERTY] = g_param_spec_boolean ("is-pinned", "is-pinned", "is-pinned", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_HIGHLIGHTED_PROPERTY, dc_message_properties[DC_MESSAGE_HIGHLIGHTED_PROPERTY] = g_param_spec_boolean ("highlighted", "highlighted", "highlighted", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_SELECTION_VISIBLE_PROPERTY, dc_message_properties[DC_MESSAGE_SELECTION_VISIBLE_PROPERTY] = g_param_spec_boolean ("selection-visible", "selection-visible", "selection-visible", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_SELECTED_PROPERTY, dc_message_properties[DC_MESSAGE_SELECTED_PROPERTY] = g_param_spec_boolean ("selected", "selected", "selected", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_FULL_MESSAGE_TEXT_PROPERTY, dc_message_properties[DC_MESSAGE_FULL_MESSAGE_TEXT_PROPERTY] = g_param_spec_string ("full-message-text", "full-message-text", "full-message-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_FULL_MESSAGE_EXPANDED_PROPERTY, dc_message_properties[DC_MESSAGE_FULL_MESSAGE_EXPANDED_PROPERTY] = g_param_spec_boolean ("full-message-expanded", "full-message-expanded", "full-message-expanded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_FULL_MESSAGE_LOADING_PROPERTY, dc_message_properties[DC_MESSAGE_FULL_MESSAGE_LOADING_PROPERTY] = g_param_spec_boolean ("full-message-loading", "full-message-loading", "full-message-loading", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_STATE_PROPERTY, dc_message_properties[DC_MESSAGE_STATE_PROPERTY] = g_param_spec_int ("state", "state", "state", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_PENDING_PROPERTY, dc_message_properties[DC_MESSAGE_IS_PENDING_PROPERTY] = g_param_spec_boolean ("is-pending", "is-pending", "is-pending", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_DELIVERED_PROPERTY, dc_message_properties[DC_MESSAGE_IS_DELIVERED_PROPERTY] = g_param_spec_boolean ("is-delivered", "is-delivered", "is-delivered", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_READ_PROPERTY, dc_message_properties[DC_MESSAGE_IS_READ_PROPERTY] = g_param_spec_boolean ("is-read", "is-read", "is-read", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_FAILED_PROPERTY, dc_message_properties[DC_MESSAGE_IS_FAILED_PROPERTY] = g_param_spec_boolean ("is-failed", "is-failed", "is-failed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_HAS_TEXT_PROPERTY, dc_message_properties[DC_MESSAGE_HAS_TEXT_PROPERTY] = g_param_spec_boolean ("has-text", "has-text", "has-text", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_CAN_DOWNLOAD_FULL_MESSAGE_PROPERTY, dc_message_properties[DC_MESSAGE_CAN_DOWNLOAD_FULL_MESSAGE_PROPERTY] = g_param_spec_boolean ("can-download-full-message", "can-download-full-message", "can-download-full-message", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_DOWNLOADING_FULL_MESSAGE_PROPERTY, dc_message_properties[DC_MESSAGE_IS_DOWNLOADING_FULL_MESSAGE_PROPERTY] = g_param_spec_boolean ("is-downloading-full-message", "is-downloading-full-message", "is-downloading-full-message", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_HAS_FULL_MESSAGE_ACTION_PROPERTY, dc_message_properties[DC_MESSAGE_HAS_FULL_MESSAGE_ACTION_PROPERTY] = g_param_spec_boolean ("has-full-message-action", "has-full-message-action", "has-full-message-action", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_CAN_EDIT_TEXT_PROPERTY, dc_message_properties[DC_MESSAGE_CAN_EDIT_TEXT_PROPERTY] = g_param_spec_boolean ("can-edit-text", "can-edit-text", "can-edit-text", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_HAS_FILE_PROPERTY, dc_message_properties[DC_MESSAGE_HAS_FILE_PROPERTY] = g_param_spec_boolean ("has-file", "has-file", "has-file", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_HAS_LOCAL_FILE_PROPERTY, dc_message_properties[DC_MESSAGE_HAS_LOCAL_FILE_PROPERTY] = g_param_spec_boolean ("has-local-file", "has-local-file", "has-local-file", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_MESSAGE_IS_IMAGE_ONLY_PROPERTY, dc_message_properties[DC_MESSAGE_IS_IMAGE_ONLY_PROPERTY] = g_param_spec_boolean ("is-image-only", "is-image-only", "is-image-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dc_message_instance_init (DcMessage * self,
                          gpointer klass)
{
	gchar* _tmp0_;
	self->priv = dc_message_get_instance_private (self);
	self->priv->_id = 0;
	self->priv->_chat_id = 0;
	self->priv->_text = NULL;
	self->priv->_sender_address = NULL;
	self->priv->_sender_name = NULL;
	self->priv->_sender_avatar_path = NULL;
	self->priv->_sender_contact_id = 0;
	self->priv->_sender_was_seen_recently = FALSE;
	self->priv->_is_forwarded = FALSE;
	self->priv->_is_edited = FALSE;
	self->priv->_override_sender_name = NULL;
	self->priv->_timestamp = (gint64) 0;
	self->priv->_is_outgoing = FALSE;
	self->priv->_file_path = NULL;
	self->priv->_file_name = NULL;
	self->priv->_file_mime = NULL;
	self->priv->_file_bytes = 0;
	self->priv->_view_type = NULL;
	self->priv->_is_info = FALSE;
	self->priv->_has_html = FALSE;
	_tmp0_ = g_strdup ("Done");
	self->priv->_download_state = _tmp0_;
	self->priv->_reactions = NULL;
	self->reaction_details = NULL;
	self->priv->_my_reactions = NULL;
	self->priv->_quote_msg_id = 0;
	self->priv->_quote_text = NULL;
	self->priv->_quote_sender_name = NULL;
	self->priv->_is_pinned = FALSE;
	self->priv->_highlighted = FALSE;
	self->priv->_selection_visible = FALSE;
	self->priv->_selected = FALSE;
	self->priv->_full_message_text = NULL;
	self->priv->_full_message_expanded = FALSE;
	self->priv->_full_message_loading = FALSE;
	self->priv->_state = 0;
}

static void
dc_message_finalize (GObject * obj)
{
	DcMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_MESSAGE, DcMessage);
	_g_free0 (self->priv->_text);
	_g_free0 (self->priv->_sender_address);
	_g_free0 (self->priv->_sender_name);
	_g_free0 (self->priv->_sender_avatar_path);
	_g_free0 (self->priv->_override_sender_name);
	_g_free0 (self->priv->_file_path);
	_g_free0 (self->priv->_file_name);
	_g_free0 (self->priv->_file_mime);
	_g_free0 (self->priv->_view_type);
	_g_free0 (self->priv->_download_state);
	_g_free0 (self->priv->_reactions);
	_g_ptr_array_unref0 (self->reaction_details);
	_g_free0 (self->priv->_my_reactions);
	_g_free0 (self->priv->_quote_text);
	_g_free0 (self->priv->_quote_sender_name);
	_g_free0 (self->priv->_full_message_text);
	G_OBJECT_CLASS (dc_message_parent_class)->finalize (obj);
}

static GType
dc_message_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcMessageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_message_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcMessage), 0, (GInstanceInitFunc) dc_message_instance_init, NULL };
	GType dc_message_type_id;
	dc_message_type_id = g_type_register_static (G_TYPE_OBJECT, "DcMessage", &g_define_type_info, 0);
	DcMessage_private_offset = g_type_add_instance_private (dc_message_type_id, sizeof (DcMessagePrivate));
	return dc_message_type_id;
}

GType
dc_message_get_type (void)
{
	static volatile gsize dc_message_type_id__once = 0;
	if (g_once_init_enter (&dc_message_type_id__once)) {
		GType dc_message_type_id;
		dc_message_type_id = dc_message_get_type_once ();
		g_once_init_leave (&dc_message_type_id__once, dc_message_type_id);
	}
	return dc_message_type_id__once;
}

static void
_vala_dc_message_get_property (GObject * object,
                               guint property_id,
                               GValue * value,
                               GParamSpec * pspec)
{
	DcMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_MESSAGE, DcMessage);
	switch (property_id) {
		case DC_MESSAGE_ID_PROPERTY:
		g_value_set_int (value, dc_message_get_id (self));
		break;
		case DC_MESSAGE_CHAT_ID_PROPERTY:
		g_value_set_int (value, dc_message_get_chat_id (self));
		break;
		case DC_MESSAGE_TEXT_PROPERTY:
		g_value_set_string (value, dc_message_get_text (self));
		break;
		case DC_MESSAGE_SENDER_ADDRESS_PROPERTY:
		g_value_set_string (value, dc_message_get_sender_address (self));
		break;
		case DC_MESSAGE_SENDER_NAME_PROPERTY:
		g_value_set_string (value, dc_message_get_sender_name (self));
		break;
		case DC_MESSAGE_SENDER_AVATAR_PATH_PROPERTY:
		g_value_set_string (value, dc_message_get_sender_avatar_path (self));
		break;
		case DC_MESSAGE_SENDER_CONTACT_ID_PROPERTY:
		g_value_set_int (value, dc_message_get_sender_contact_id (self));
		break;
		case DC_MESSAGE_SENDER_WAS_SEEN_RECENTLY_PROPERTY:
		g_value_set_boolean (value, dc_message_get_sender_was_seen_recently (self));
		break;
		case DC_MESSAGE_IS_FORWARDED_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_forwarded (self));
		break;
		case DC_MESSAGE_IS_EDITED_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_edited (self));
		break;
		case DC_MESSAGE_OVERRIDE_SENDER_NAME_PROPERTY:
		g_value_set_string (value, dc_message_get_override_sender_name (self));
		break;
		case DC_MESSAGE_TIMESTAMP_PROPERTY:
		g_value_set_int64 (value, dc_message_get_timestamp (self));
		break;
		case DC_MESSAGE_IS_OUTGOING_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_outgoing (self));
		break;
		case DC_MESSAGE_FILE_PATH_PROPERTY:
		g_value_set_string (value, dc_message_get_file_path (self));
		break;
		case DC_MESSAGE_FILE_NAME_PROPERTY:
		g_value_set_string (value, dc_message_get_file_name (self));
		break;
		case DC_MESSAGE_FILE_MIME_PROPERTY:
		g_value_set_string (value, dc_message_get_file_mime (self));
		break;
		case DC_MESSAGE_FILE_BYTES_PROPERTY:
		g_value_set_int (value, dc_message_get_file_bytes (self));
		break;
		case DC_MESSAGE_VIEW_TYPE_PROPERTY:
		g_value_set_string (value, dc_message_get_view_type (self));
		break;
		case DC_MESSAGE_IS_INFO_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_info (self));
		break;
		case DC_MESSAGE_HAS_HTML_PROPERTY:
		g_value_set_boolean (value, dc_message_get_has_html (self));
		break;
		case DC_MESSAGE_DOWNLOAD_STATE_PROPERTY:
		g_value_set_string (value, dc_message_get_download_state (self));
		break;
		case DC_MESSAGE_REACTIONS_PROPERTY:
		g_value_set_string (value, dc_message_get_reactions (self));
		break;
		case DC_MESSAGE_MY_REACTIONS_PROPERTY:
		g_value_set_string (value, dc_message_get_my_reactions (self));
		break;
		case DC_MESSAGE_QUOTE_MSG_ID_PROPERTY:
		g_value_set_int (value, dc_message_get_quote_msg_id (self));
		break;
		case DC_MESSAGE_QUOTE_TEXT_PROPERTY:
		g_value_set_string (value, dc_message_get_quote_text (self));
		break;
		case DC_MESSAGE_QUOTE_SENDER_NAME_PROPERTY:
		g_value_set_string (value, dc_message_get_quote_sender_name (self));
		break;
		case DC_MESSAGE_IS_PINNED_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_pinned (self));
		break;
		case DC_MESSAGE_HIGHLIGHTED_PROPERTY:
		g_value_set_boolean (value, dc_message_get_highlighted (self));
		break;
		case DC_MESSAGE_SELECTION_VISIBLE_PROPERTY:
		g_value_set_boolean (value, dc_message_get_selection_visible (self));
		break;
		case DC_MESSAGE_SELECTED_PROPERTY:
		g_value_set_boolean (value, dc_message_get_selected (self));
		break;
		case DC_MESSAGE_FULL_MESSAGE_TEXT_PROPERTY:
		g_value_set_string (value, dc_message_get_full_message_text (self));
		break;
		case DC_MESSAGE_FULL_MESSAGE_EXPANDED_PROPERTY:
		g_value_set_boolean (value, dc_message_get_full_message_expanded (self));
		break;
		case DC_MESSAGE_FULL_MESSAGE_LOADING_PROPERTY:
		g_value_set_boolean (value, dc_message_get_full_message_loading (self));
		break;
		case DC_MESSAGE_STATE_PROPERTY:
		g_value_set_int (value, dc_message_get_state (self));
		break;
		case DC_MESSAGE_IS_PENDING_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_pending (self));
		break;
		case DC_MESSAGE_IS_DELIVERED_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_delivered (self));
		break;
		case DC_MESSAGE_IS_READ_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_read (self));
		break;
		case DC_MESSAGE_IS_FAILED_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_failed (self));
		break;
		case DC_MESSAGE_HAS_TEXT_PROPERTY:
		g_value_set_boolean (value, dc_message_get_has_text (self));
		break;
		case DC_MESSAGE_CAN_DOWNLOAD_FULL_MESSAGE_PROPERTY:
		g_value_set_boolean (value, dc_message_get_can_download_full_message (self));
		break;
		case DC_MESSAGE_IS_DOWNLOADING_FULL_MESSAGE_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_downloading_full_message (self));
		break;
		case DC_MESSAGE_HAS_FULL_MESSAGE_ACTION_PROPERTY:
		g_value_set_boolean (value, dc_message_get_has_full_message_action (self));
		break;
		case DC_MESSAGE_CAN_EDIT_TEXT_PROPERTY:
		g_value_set_boolean (value, dc_message_get_can_edit_text (self));
		break;
		case DC_MESSAGE_HAS_FILE_PROPERTY:
		g_value_set_boolean (value, dc_message_get_has_file (self));
		break;
		case DC_MESSAGE_HAS_LOCAL_FILE_PROPERTY:
		g_value_set_boolean (value, dc_message_get_has_local_file (self));
		break;
		case DC_MESSAGE_IS_IMAGE_ONLY_PROPERTY:
		g_value_set_boolean (value, dc_message_get_is_image_only (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_message_set_property (GObject * object,
                               guint property_id,
                               const GValue * value,
                               GParamSpec * pspec)
{
	DcMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_MESSAGE, DcMessage);
	switch (property_id) {
		case DC_MESSAGE_ID_PROPERTY:
		dc_message_set_id (self, g_value_get_int (value));
		break;
		case DC_MESSAGE_CHAT_ID_PROPERTY:
		dc_message_set_chat_id (self, g_value_get_int (value));
		break;
		case DC_MESSAGE_TEXT_PROPERTY:
		dc_message_set_text (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_SENDER_ADDRESS_PROPERTY:
		dc_message_set_sender_address (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_SENDER_NAME_PROPERTY:
		dc_message_set_sender_name (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_SENDER_AVATAR_PATH_PROPERTY:
		dc_message_set_sender_avatar_path (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_SENDER_CONTACT_ID_PROPERTY:
		dc_message_set_sender_contact_id (self, g_value_get_int (value));
		break;
		case DC_MESSAGE_SENDER_WAS_SEEN_RECENTLY_PROPERTY:
		dc_message_set_sender_was_seen_recently (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_IS_FORWARDED_PROPERTY:
		dc_message_set_is_forwarded (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_IS_EDITED_PROPERTY:
		dc_message_set_is_edited (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_OVERRIDE_SENDER_NAME_PROPERTY:
		dc_message_set_override_sender_name (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_TIMESTAMP_PROPERTY:
		dc_message_set_timestamp (self, g_value_get_int64 (value));
		break;
		case DC_MESSAGE_IS_OUTGOING_PROPERTY:
		dc_message_set_is_outgoing (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_FILE_PATH_PROPERTY:
		dc_message_set_file_path (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_FILE_NAME_PROPERTY:
		dc_message_set_file_name (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_FILE_MIME_PROPERTY:
		dc_message_set_file_mime (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_FILE_BYTES_PROPERTY:
		dc_message_set_file_bytes (self, g_value_get_int (value));
		break;
		case DC_MESSAGE_VIEW_TYPE_PROPERTY:
		dc_message_set_view_type (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_IS_INFO_PROPERTY:
		dc_message_set_is_info (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_HAS_HTML_PROPERTY:
		dc_message_set_has_html (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_DOWNLOAD_STATE_PROPERTY:
		dc_message_set_download_state (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_REACTIONS_PROPERTY:
		dc_message_set_reactions (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_MY_REACTIONS_PROPERTY:
		dc_message_set_my_reactions (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_QUOTE_MSG_ID_PROPERTY:
		dc_message_set_quote_msg_id (self, g_value_get_int (value));
		break;
		case DC_MESSAGE_QUOTE_TEXT_PROPERTY:
		dc_message_set_quote_text (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_QUOTE_SENDER_NAME_PROPERTY:
		dc_message_set_quote_sender_name (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_IS_PINNED_PROPERTY:
		dc_message_set_is_pinned (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_HIGHLIGHTED_PROPERTY:
		dc_message_set_highlighted (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_SELECTION_VISIBLE_PROPERTY:
		dc_message_set_selection_visible (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_SELECTED_PROPERTY:
		dc_message_set_selected (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_FULL_MESSAGE_TEXT_PROPERTY:
		dc_message_set_full_message_text (self, g_value_get_string (value));
		break;
		case DC_MESSAGE_FULL_MESSAGE_EXPANDED_PROPERTY:
		dc_message_set_full_message_expanded (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_FULL_MESSAGE_LOADING_PROPERTY:
		dc_message_set_full_message_loading (self, g_value_get_boolean (value));
		break;
		case DC_MESSAGE_STATE_PROPERTY:
		dc_message_set_state (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dc_contact_get_instance_private (DcContact* self)
{
	return G_STRUCT_MEMBER_P (self, DcContact_private_offset);
}

DcContact*
dc_contact_construct (GType object_type)
{
	DcContact * self = NULL;
	self = (DcContact*) g_object_new (object_type, NULL);
	return self;
}

DcContact*
dc_contact_new (void)
{
	return dc_contact_construct (DC_TYPE_CONTACT);
}

gint
dc_contact_get_id (DcContact* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_id;
	return result;
}

void
dc_contact_set_id (DcContact* self,
                   gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_contact_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_contact_properties[DC_CONTACT_ID_PROPERTY]);
	}
}

const gchar*
dc_contact_get_display_name (DcContact* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_name;
	result = _tmp0_;
	return result;
}

void
dc_contact_set_display_name (DcContact* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_contact_get_display_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_display_name);
		self->priv->_display_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_contact_properties[DC_CONTACT_DISPLAY_NAME_PROPERTY]);
	}
}

const gchar*
dc_contact_get_address (DcContact* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_address;
	result = _tmp0_;
	return result;
}

void
dc_contact_set_address (DcContact* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_contact_get_address (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_address);
		self->priv->_address = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_contact_properties[DC_CONTACT_ADDRESS_PROPERTY]);
	}
}

const gchar*
dc_contact_get_profile_image (DcContact* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_profile_image;
	result = _tmp0_;
	return result;
}

void
dc_contact_set_profile_image (DcContact* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_contact_get_profile_image (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_profile_image);
		self->priv->_profile_image = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_contact_properties[DC_CONTACT_PROFILE_IMAGE_PROPERTY]);
	}
}

gboolean
dc_contact_get_is_verified (DcContact* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_verified;
	return result;
}

void
dc_contact_set_is_verified (DcContact* self,
                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_contact_get_is_verified (self);
	if (old_value != value) {
		self->priv->_is_verified = value;
		g_object_notify_by_pspec ((GObject *) self, dc_contact_properties[DC_CONTACT_IS_VERIFIED_PROPERTY]);
	}
}

gboolean
dc_contact_get_is_blocked (DcContact* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_blocked;
	return result;
}

void
dc_contact_set_is_blocked (DcContact* self,
                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_contact_get_is_blocked (self);
	if (old_value != value) {
		self->priv->_is_blocked = value;
		g_object_notify_by_pspec ((GObject *) self, dc_contact_properties[DC_CONTACT_IS_BLOCKED_PROPERTY]);
	}
}

const gchar*
dc_contact_get_status (DcContact* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_status;
	result = _tmp0_;
	return result;
}

void
dc_contact_set_status (DcContact* self,
                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_contact_get_status (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_status);
		self->priv->_status = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_contact_properties[DC_CONTACT_STATUS_PROPERTY]);
	}
}

gboolean
dc_contact_get_was_seen_recently (DcContact* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_was_seen_recently;
	return result;
}

void
dc_contact_set_was_seen_recently (DcContact* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_contact_get_was_seen_recently (self);
	if (old_value != value) {
		self->priv->_was_seen_recently = value;
		g_object_notify_by_pspec ((GObject *) self, dc_contact_properties[DC_CONTACT_WAS_SEEN_RECENTLY_PROPERTY]);
	}
}

static void
dc_contact_class_init (DcContactClass * klass,
                       gpointer klass_data)
{
	dc_contact_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcContact_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_contact_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_contact_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_contact_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CONTACT_ID_PROPERTY, dc_contact_properties[DC_CONTACT_ID_PROPERTY] = g_param_spec_int ("id", "id", "id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CONTACT_DISPLAY_NAME_PROPERTY, dc_contact_properties[DC_CONTACT_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CONTACT_ADDRESS_PROPERTY, dc_contact_properties[DC_CONTACT_ADDRESS_PROPERTY] = g_param_spec_string ("address", "address", "address", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CONTACT_PROFILE_IMAGE_PROPERTY, dc_contact_properties[DC_CONTACT_PROFILE_IMAGE_PROPERTY] = g_param_spec_string ("profile-image", "profile-image", "profile-image", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CONTACT_IS_VERIFIED_PROPERTY, dc_contact_properties[DC_CONTACT_IS_VERIFIED_PROPERTY] = g_param_spec_boolean ("is-verified", "is-verified", "is-verified", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CONTACT_IS_BLOCKED_PROPERTY, dc_contact_properties[DC_CONTACT_IS_BLOCKED_PROPERTY] = g_param_spec_boolean ("is-blocked", "is-blocked", "is-blocked", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CONTACT_STATUS_PROPERTY, dc_contact_properties[DC_CONTACT_STATUS_PROPERTY] = g_param_spec_string ("status", "status", "status", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_CONTACT_WAS_SEEN_RECENTLY_PROPERTY, dc_contact_properties[DC_CONTACT_WAS_SEEN_RECENTLY_PROPERTY] = g_param_spec_boolean ("was-seen-recently", "was-seen-recently", "was-seen-recently", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dc_contact_instance_init (DcContact * self,
                          gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	self->priv = dc_contact_get_instance_private (self);
	self->priv->_id = 0;
	_tmp0_ = g_strdup ("");
	self->priv->_display_name = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_address = _tmp1_;
	self->priv->_profile_image = NULL;
	self->priv->_is_verified = FALSE;
	self->priv->_is_blocked = FALSE;
	self->priv->_status = NULL;
	self->priv->_was_seen_recently = FALSE;
}

static void
dc_contact_finalize (GObject * obj)
{
	DcContact * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_CONTACT, DcContact);
	_g_free0 (self->priv->_display_name);
	_g_free0 (self->priv->_address);
	_g_free0 (self->priv->_profile_image);
	_g_free0 (self->priv->_status);
	G_OBJECT_CLASS (dc_contact_parent_class)->finalize (obj);
}

static GType
dc_contact_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcContactClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_contact_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcContact), 0, (GInstanceInitFunc) dc_contact_instance_init, NULL };
	GType dc_contact_type_id;
	dc_contact_type_id = g_type_register_static (G_TYPE_OBJECT, "DcContact", &g_define_type_info, 0);
	DcContact_private_offset = g_type_add_instance_private (dc_contact_type_id, sizeof (DcContactPrivate));
	return dc_contact_type_id;
}

GType
dc_contact_get_type (void)
{
	static volatile gsize dc_contact_type_id__once = 0;
	if (g_once_init_enter (&dc_contact_type_id__once)) {
		GType dc_contact_type_id;
		dc_contact_type_id = dc_contact_get_type_once ();
		g_once_init_leave (&dc_contact_type_id__once, dc_contact_type_id);
	}
	return dc_contact_type_id__once;
}

static void
_vala_dc_contact_get_property (GObject * object,
                               guint property_id,
                               GValue * value,
                               GParamSpec * pspec)
{
	DcContact * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_CONTACT, DcContact);
	switch (property_id) {
		case DC_CONTACT_ID_PROPERTY:
		g_value_set_int (value, dc_contact_get_id (self));
		break;
		case DC_CONTACT_DISPLAY_NAME_PROPERTY:
		g_value_set_string (value, dc_contact_get_display_name (self));
		break;
		case DC_CONTACT_ADDRESS_PROPERTY:
		g_value_set_string (value, dc_contact_get_address (self));
		break;
		case DC_CONTACT_PROFILE_IMAGE_PROPERTY:
		g_value_set_string (value, dc_contact_get_profile_image (self));
		break;
		case DC_CONTACT_IS_VERIFIED_PROPERTY:
		g_value_set_boolean (value, dc_contact_get_is_verified (self));
		break;
		case DC_CONTACT_IS_BLOCKED_PROPERTY:
		g_value_set_boolean (value, dc_contact_get_is_blocked (self));
		break;
		case DC_CONTACT_STATUS_PROPERTY:
		g_value_set_string (value, dc_contact_get_status (self));
		break;
		case DC_CONTACT_WAS_SEEN_RECENTLY_PROPERTY:
		g_value_set_boolean (value, dc_contact_get_was_seen_recently (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_contact_set_property (GObject * object,
                               guint property_id,
                               const GValue * value,
                               GParamSpec * pspec)
{
	DcContact * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_CONTACT, DcContact);
	switch (property_id) {
		case DC_CONTACT_ID_PROPERTY:
		dc_contact_set_id (self, g_value_get_int (value));
		break;
		case DC_CONTACT_DISPLAY_NAME_PROPERTY:
		dc_contact_set_display_name (self, g_value_get_string (value));
		break;
		case DC_CONTACT_ADDRESS_PROPERTY:
		dc_contact_set_address (self, g_value_get_string (value));
		break;
		case DC_CONTACT_PROFILE_IMAGE_PROPERTY:
		dc_contact_set_profile_image (self, g_value_get_string (value));
		break;
		case DC_CONTACT_IS_VERIFIED_PROPERTY:
		dc_contact_set_is_verified (self, g_value_get_boolean (value));
		break;
		case DC_CONTACT_IS_BLOCKED_PROPERTY:
		dc_contact_set_is_blocked (self, g_value_get_boolean (value));
		break;
		case DC_CONTACT_STATUS_PROPERTY:
		dc_contact_set_status (self, g_value_get_string (value));
		break;
		case DC_CONTACT_WAS_SEEN_RECENTLY_PROPERTY:
		dc_contact_set_was_seen_recently (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

DcChatEntry*
dc_find_chat_entry (GListStore* store,
                    gint chat_id)
{
	DcChatEntry* result;
	g_return_val_if_fail (store != NULL, NULL);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				DcChatEntry* entry = NULL;
				GObject* _tmp2_;
				DcChatEntry* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				if (!_tmp0_) {
					guint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < g_list_model_get_n_items ((GListModel*) store))) {
					break;
				}
				_tmp2_ = g_list_model_get_item ((GListModel*) store, i);
				entry = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, DC_TYPE_CHAT_ENTRY, DcChatEntry);
				_tmp3_ = entry;
				_tmp4_ = dc_chat_entry_get_id (_tmp3_);
				_tmp5_ = _tmp4_;
				if (_tmp5_ == chat_id) {
					result = entry;
					return result;
				}
				_g_object_unref0 (entry);
			}
		}
	}
	result = NULL;
	return result;
}

DcMessage*
dc_find_message (GListModel* store,
                 gint msg_id)
{
	DcMessage* result;
	g_return_val_if_fail (store != NULL, NULL);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				DcMessage* m = NULL;
				GObject* _tmp2_;
				DcMessage* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				if (!_tmp0_) {
					guint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < g_list_model_get_n_items (store))) {
					break;
				}
				_tmp2_ = g_list_model_get_item (store, i);
				m = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, DC_TYPE_MESSAGE, DcMessage);
				_tmp3_ = m;
				_tmp4_ = dc_message_get_id (_tmp3_);
				_tmp5_ = _tmp4_;
				if (_tmp5_ == msg_id) {
					result = m;
					return result;
				}
				_g_object_unref0 (m);
			}
		}
	}
	result = NULL;
	return result;
}

gint
dc_find_message_index (GListModel* store,
                       gint msg_id)
{
	gint result;
	g_return_val_if_fail (store != NULL, -1);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				DcMessage* m = NULL;
				GObject* _tmp2_;
				DcMessage* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				if (!_tmp0_) {
					guint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < g_list_model_get_n_items (store))) {
					break;
				}
				_tmp2_ = g_list_model_get_item (store, i);
				m = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, DC_TYPE_MESSAGE, DcMessage);
				_tmp3_ = m;
				_tmp4_ = dc_message_get_id (_tmp3_);
				_tmp5_ = _tmp4_;
				if (_tmp5_ == msg_id) {
					result = (gint) i;
					_g_object_unref0 (m);
					return result;
				}
				_g_object_unref0 (m);
			}
		}
	}
	result = -1;
	return result;
}

DcMessage*
dc_find_last_editable_text_message (GListStore* store)
{
	DcMessage* result;
	g_return_val_if_fail (store != NULL, NULL);
	{
		guint i = 0U;
		i = g_list_model_get_n_items ((GListModel*) store);
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				DcMessage* m = NULL;
				GObject* _tmp2_;
				DcMessage* _tmp3_;
				gboolean _tmp4_;
				gboolean _tmp5_;
				if (!_tmp0_) {
					guint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ - 1;
				}
				_tmp0_ = FALSE;
				if (!(i > ((guint) 0))) {
					break;
				}
				_tmp2_ = g_list_model_get_item ((GListModel*) store, i - 1);
				m = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, DC_TYPE_MESSAGE, DcMessage);
				_tmp3_ = m;
				_tmp4_ = dc_message_get_can_edit_text (_tmp3_);
				_tmp5_ = _tmp4_;
				if (_tmp5_) {
					result = m;
					return result;
				}
				_g_object_unref0 (m);
			}
		}
	}
	result = NULL;
	return result;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

