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

#include <glib.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <adwaita.h>
#include <gdk/gdk.h>
#include <glib/gstdio.h>
#include <json-glib/json-glib.h>
#include <gio/gio.h>
#include <glib-object.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 void (*DcVoidFunc) (gpointer user_data);
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block8Data Block8Data;
typedef struct _Block9Data Block9Data;
typedef struct _Block10Data Block10Data;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_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;
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_SUMMARY_PREFIX_PROPERTY,
	DC_CHAT_ENTRY_TIMESTAMP_PROPERTY,
	DC_CHAT_ENTRY_UNREAD_COUNT_PROPERTY,
	DC_CHAT_ENTRY_AVATAR_PATH_PROPERTY,
	DC_CHAT_ENTRY_CHAT_TYPE_PROPERTY,
	DC_CHAT_ENTRY_IS_MUTED_PROPERTY,
	DC_CHAT_ENTRY_IS_CONTACT_REQUEST_PROPERTY,
	DC_CHAT_ENTRY_IS_ARCHIVED_PROPERTY,
	DC_CHAT_ENTRY_IS_PINNED_PROPERTY,
	DC_CHAT_ENTRY_NUM_PROPERTIES
};
static GParamSpec* dc_chat_entry_properties[DC_CHAT_ENTRY_NUM_PROPERTIES];
typedef enum  {
	DC_MESSAGE_STATE_UNKNOWN = 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 ())

#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 _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_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_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_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_EDIT_TEXT_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_NUM_PROPERTIES
};
static GParamSpec* dc_contact_properties[DC_CONTACT_NUM_PROPERTIES];

struct _Block8Data {
	int _ref_count_;
	gchar* action_id;
	DcVoidFunc on_confirm;
	gpointer on_confirm_target;
	GDestroyNotify on_confirm_target_destroy_notify;
};

struct _Block9Data {
	int _ref_count_;
	DcVoidFunc on_delete_for_me;
	gpointer on_delete_for_me_target;
	GDestroyNotify on_delete_for_me_target_destroy_notify;
	DcVoidFunc on_delete_for_everyone;
	gpointer on_delete_for_everyone_target;
	GDestroyNotify on_delete_for_everyone_target_destroy_notify;
};

struct _Block10Data {
	int _ref_count_;
	AdwDialog* dialog;
};

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

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

struct _DcChatEntryClass {
	GObjectClass parent_class;
};

struct _DcChatEntryPrivate {
	gint _id;
	gchar* _name;
	gchar* _last_message;
	gchar* _summary_prefix;
	gint64 _timestamp;
	gint _unread_count;
	gchar* _avatar_path;
	gint _chat_type;
	gboolean _is_muted;
	gboolean _is_contact_request;
	gboolean _is_archived;
	gboolean _is_pinned;
};

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

struct _DcMessageClass {
	GObjectClass parent_class;
};

struct _DcMessagePrivate {
	gint _id;
	gint _chat_id;
	gchar* _text;
	gchar* _sender_address;
	gchar* _sender_name;
	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;
	gchar* _reactions;
	gchar* _my_reactions;
	gint _quote_msg_id;
	gchar* _quote_text;
	gchar* _quote_sender_name;
	gboolean _is_pinned;
	gboolean _highlighted;
	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;
};

static gint DcChatEntry_private_offset;
static gpointer dc_chat_entry_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 void dc_show_error (GtkWidget* parent,
                    const gchar* message);
VALA_EXTERN void dc_confirm_action (GtkWidget* parent,
                        const gchar* title,
                        const gchar* body,
                        const gchar* action_id,
                        const gchar* action_label,
                        DcVoidFunc on_confirm,
                        gpointer on_confirm_target,
                        GDestroyNotify on_confirm_target_destroy_notify);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void __lambda115_ (Block8Data* _data8_,
                   const gchar* r);
static void ___lambda115__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                              const gchar* response,
                                              gpointer self);
VALA_EXTERN void dc_confirm_delete_options (GtkWidget* parent,
                                const gchar* title,
                                const gchar* body,
                                DcVoidFunc on_delete_for_me,
                                gpointer on_delete_for_me_target,
                                GDestroyNotify on_delete_for_me_target_destroy_notify,
                                DcVoidFunc on_delete_for_everyone,
                                gpointer on_delete_for_everyone_target,
                                GDestroyNotify on_delete_for_everyone_target_destroy_notify);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
static void __lambda55_ (Block9Data* _data9_,
                  const gchar* r);
static void ___lambda55__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                             const gchar* response,
                                             gpointer self);
VALA_EXTERN void dc_install_escape_close (AdwDialog* dialog);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static gboolean __lambda48_ (Block10Data* _data10_,
                      guint kv,
                      guint kc,
                      GdkModifierType st);
static gboolean ___lambda48__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                            guint keyval,
                                                            guint keycode,
                                                            GdkModifierType state,
                                                            gpointer self);
VALA_EXTERN GdkTexture* dc_load_avatar (const gchar* path);
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 gint* dc_json_ints (JsonArray* arr,
                    gint* result_length1);
VALA_EXTERN void dc_clear_listbox (GtkListBox* lb);
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);
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 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 DcChatEntry* dc_chat_entry_new (void);
VALA_EXTERN DcChatEntry* dc_chat_entry_construct (GType object_type);
VALA_EXTERN gint dc_chat_entry_get_id (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_id (DcChatEntry* self,
                           gint value);
VALA_EXTERN const gchar* dc_chat_entry_get_name (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_name (DcChatEntry* self,
                             const gchar* value);
VALA_EXTERN const gchar* dc_chat_entry_get_last_message (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_last_message (DcChatEntry* self,
                                     const gchar* 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 const gchar* dc_chat_entry_get_avatar_path (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_avatar_path (DcChatEntry* self,
                                    const gchar* value);
VALA_EXTERN gint dc_chat_entry_get_chat_type (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_chat_type (DcChatEntry* self,
                                  gint 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_archived (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_is_archived (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);
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_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType dc_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessage, g_object_unref)
VALA_EXTERN DcMessage* dc_message_new (void);
VALA_EXTERN DcMessage* dc_message_construct (GType object_type);
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 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 gboolean dc_message_get_is_outgoing (DcMessage* self);
VALA_EXTERN void dc_message_set_is_outgoing (DcMessage* self,
                                 gboolean value);
VALA_EXTERN const gchar* dc_message_get_file_path (DcMessage* self);
VALA_EXTERN void dc_message_set_file_path (DcMessage* self,
                               const gchar* value);
VALA_EXTERN const gchar* dc_message_get_file_name (DcMessage* self);
VALA_EXTERN void dc_message_set_file_name (DcMessage* self,
                               const gchar* value);
VALA_EXTERN const gchar* dc_message_get_file_mime (DcMessage* self);
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 const gchar* dc_message_get_view_type (DcMessage* self);
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 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 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_edit_text (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);
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 (GListStore* store,
                            gint msg_id);
VALA_EXTERN gint dc_find_message_index (GListStore* store,
                            gint msg_id);
VALA_EXTERN DcMessage* dc_find_last_editable_text_message (GListStore* store);

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

static Block8Data*
block8_data_ref (Block8Data* _data8_)
{
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}

static void
block8_data_unref (void * _userdata_)
{
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		_g_free0 (_data8_->action_id);
		(_data8_->on_confirm_target_destroy_notify == NULL) ? NULL : (_data8_->on_confirm_target_destroy_notify (_data8_->on_confirm_target), NULL);
		_data8_->on_confirm = NULL;
		_data8_->on_confirm_target = NULL;
		_data8_->on_confirm_target_destroy_notify = NULL;
		g_slice_free (Block8Data, _data8_);
	}
}

static void
__lambda115_ (Block8Data* _data8_,
              const gchar* r)
{
	g_return_if_fail (r != NULL);
	if (g_strcmp0 (r, _data8_->action_id) == 0) {
		_data8_->on_confirm (_data8_->on_confirm_target);
	}
}

static void
___lambda115__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                         const gchar* response,
                                         gpointer self)
{
	__lambda115_ (self, response);
}

void
dc_confirm_action (GtkWidget* parent,
                   const gchar* title,
                   const gchar* body,
                   const gchar* action_id,
                   const gchar* action_label,
                   DcVoidFunc on_confirm,
                   gpointer on_confirm_target,
                   GDestroyNotify on_confirm_target_destroy_notify)
{
	Block8Data* _data8_;
	gchar* _tmp0_;
	AdwAlertDialog* d = NULL;
	AdwAlertDialog* _tmp1_;
	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);
	_data8_ = g_slice_new0 (Block8Data);
	_data8_->_ref_count_ = 1;
	_tmp0_ = g_strdup (action_id);
	_g_free0 (_data8_->action_id);
	_data8_->action_id = _tmp0_;
	(_data8_->on_confirm_target_destroy_notify == NULL) ? NULL : (_data8_->on_confirm_target_destroy_notify (_data8_->on_confirm_target), NULL);
	_data8_->on_confirm = NULL;
	_data8_->on_confirm_target = NULL;
	_data8_->on_confirm_target_destroy_notify = NULL;
	_data8_->on_confirm = on_confirm;
	_data8_->on_confirm_target = on_confirm_target;
	_data8_->on_confirm_target_destroy_notify = on_confirm_target_destroy_notify;
	_tmp1_ = (AdwAlertDialog*) adw_alert_dialog_new (title, body);
	g_object_ref_sink (_tmp1_);
	d = _tmp1_;
	adw_alert_dialog_add_response (d, "cancel", "Cancel");
	adw_alert_dialog_add_response (d, _data8_->action_id, action_label);
	adw_alert_dialog_set_response_appearance (d, _data8_->action_id, ADW_RESPONSE_DESTRUCTIVE);
	adw_alert_dialog_set_default_response (d, "cancel");
	adw_alert_dialog_set_close_response (d, "cancel");
	g_signal_connect_data (d, "response", (GCallback) ___lambda115__adw_alert_dialog_response, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
	adw_dialog_present ((AdwDialog*) d, parent);
	_g_object_unref0 (d);
	block8_data_unref (_data8_);
	_data8_ = NULL;
}

static Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		(_data9_->on_delete_for_me_target_destroy_notify == NULL) ? NULL : (_data9_->on_delete_for_me_target_destroy_notify (_data9_->on_delete_for_me_target), NULL);
		_data9_->on_delete_for_me = NULL;
		_data9_->on_delete_for_me_target = NULL;
		_data9_->on_delete_for_me_target_destroy_notify = NULL;
		(_data9_->on_delete_for_everyone_target_destroy_notify == NULL) ? NULL : (_data9_->on_delete_for_everyone_target_destroy_notify (_data9_->on_delete_for_everyone_target), NULL);
		_data9_->on_delete_for_everyone = NULL;
		_data9_->on_delete_for_everyone_target = NULL;
		_data9_->on_delete_for_everyone_target_destroy_notify = NULL;
		g_slice_free (Block9Data, _data9_);
	}
}

static void
__lambda55_ (Block9Data* _data9_,
             const gchar* r)
{
	g_return_if_fail (r != NULL);
	if (g_strcmp0 (r, "delete_me") == 0) {
		_data9_->on_delete_for_me (_data9_->on_delete_for_me_target);
	} else {
		gboolean _tmp0_ = FALSE;
		if (g_strcmp0 (r, "delete_all") == 0) {
			_tmp0_ = _data9_->on_delete_for_everyone != NULL;
		} else {
			_tmp0_ = FALSE;
		}
		if (_tmp0_) {
			_data9_->on_delete_for_everyone (_data9_->on_delete_for_everyone_target);
		}
	}
}

static void
___lambda55__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                        const gchar* response,
                                        gpointer self)
{
	__lambda55_ (self, response);
}

void
dc_confirm_delete_options (GtkWidget* parent,
                           const gchar* title,
                           const gchar* body,
                           DcVoidFunc on_delete_for_me,
                           gpointer on_delete_for_me_target,
                           GDestroyNotify on_delete_for_me_target_destroy_notify,
                           DcVoidFunc on_delete_for_everyone,
                           gpointer on_delete_for_everyone_target,
                           GDestroyNotify on_delete_for_everyone_target_destroy_notify)
{
	Block9Data* _data9_;
	AdwAlertDialog* d = NULL;
	AdwAlertDialog* _tmp0_;
	AdwAlertDialog* _tmp1_;
	AdwAlertDialog* _tmp2_;
	AdwAlertDialog* _tmp3_;
	AdwAlertDialog* _tmp6_;
	AdwAlertDialog* _tmp7_;
	AdwAlertDialog* _tmp8_;
	AdwAlertDialog* _tmp9_;
	g_return_if_fail (parent != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (body != NULL);
	_data9_ = g_slice_new0 (Block9Data);
	_data9_->_ref_count_ = 1;
	(_data9_->on_delete_for_me_target_destroy_notify == NULL) ? NULL : (_data9_->on_delete_for_me_target_destroy_notify (_data9_->on_delete_for_me_target), NULL);
	_data9_->on_delete_for_me = NULL;
	_data9_->on_delete_for_me_target = NULL;
	_data9_->on_delete_for_me_target_destroy_notify = NULL;
	_data9_->on_delete_for_me = on_delete_for_me;
	_data9_->on_delete_for_me_target = on_delete_for_me_target;
	_data9_->on_delete_for_me_target_destroy_notify = on_delete_for_me_target_destroy_notify;
	(_data9_->on_delete_for_everyone_target_destroy_notify == NULL) ? NULL : (_data9_->on_delete_for_everyone_target_destroy_notify (_data9_->on_delete_for_everyone_target), NULL);
	_data9_->on_delete_for_everyone = NULL;
	_data9_->on_delete_for_everyone_target = NULL;
	_data9_->on_delete_for_everyone_target_destroy_notify = NULL;
	_data9_->on_delete_for_everyone = on_delete_for_everyone;
	_data9_->on_delete_for_everyone_target = on_delete_for_everyone_target;
	_data9_->on_delete_for_everyone_target_destroy_notify = on_delete_for_everyone_target_destroy_notify;
	_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (title, body);
	g_object_ref_sink (_tmp0_);
	d = _tmp0_;
	_tmp1_ = d;
	adw_alert_dialog_add_response (_tmp1_, "cancel", "Cancel");
	_tmp2_ = d;
	adw_alert_dialog_add_response (_tmp2_, "delete_me", "Delete for Me");
	_tmp3_ = d;
	adw_alert_dialog_set_response_appearance (_tmp3_, "delete_me", ADW_RESPONSE_DESTRUCTIVE);
	if (_data9_->on_delete_for_everyone != NULL) {
		AdwAlertDialog* _tmp4_;
		AdwAlertDialog* _tmp5_;
		_tmp4_ = d;
		adw_alert_dialog_add_response (_tmp4_, "delete_all", "Delete for Everyone");
		_tmp5_ = d;
		adw_alert_dialog_set_response_appearance (_tmp5_, "delete_all", ADW_RESPONSE_DESTRUCTIVE);
	}
	_tmp6_ = d;
	adw_alert_dialog_set_default_response (_tmp6_, "cancel");
	_tmp7_ = d;
	adw_alert_dialog_set_close_response (_tmp7_, "cancel");
	_tmp8_ = d;
	g_signal_connect_data (_tmp8_, "response", (GCallback) ___lambda55__adw_alert_dialog_response, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
	_tmp9_ = d;
	adw_dialog_present ((AdwDialog*) _tmp9_, parent);
	_g_object_unref0 (d);
	block9_data_unref (_data9_);
	_data9_ = NULL;
}

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

static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		_g_object_unref0 (_data10_->dialog);
		g_slice_free (Block10Data, _data10_);
	}
}

static gboolean
__lambda48_ (Block10Data* _data10_,
             guint kv,
             guint kc,
             GdkModifierType st)
{
	gboolean result;
	if (kv == GDK_KEY_Escape) {
		adw_dialog_close (_data10_->dialog);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda48__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                   guint keyval,
                                                   guint keycode,
                                                   GdkModifierType state,
                                                   gpointer self)
{
	gboolean result;
	result = __lambda48_ (self, keyval, keycode, state);
	return result;
}

void
dc_install_escape_close (AdwDialog* dialog)
{
	Block10Data* _data10_;
	AdwDialog* _tmp0_;
	GtkEventControllerKey* kc = NULL;
	GtkEventControllerKey* _tmp1_;
	GtkEventController* _tmp2_;
	g_return_if_fail (dialog != NULL);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (dialog);
	_g_object_unref0 (_data10_->dialog);
	_data10_->dialog = _tmp0_;
	_tmp1_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	kc = _tmp1_;
	gtk_event_controller_set_propagation_phase ((GtkEventController*) kc, GTK_PHASE_CAPTURE);
	g_signal_connect_data (kc, "key-pressed", (GCallback) ___lambda48__gtk_event_controller_key_key_pressed, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	_tmp2_ = _g_object_ref0 ((GtkEventController*) kc);
	gtk_widget_add_controller (G_TYPE_CHECK_INSTANCE_CAST (_data10_->dialog, gtk_widget_get_type (), GtkWidget), _tmp2_);
	_g_object_unref0 (kc);
	block10_data_unref (_data10_);
	_data10_ = NULL;
}

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

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

gint*
dc_json_ints (JsonArray* arr,
              gint* result_length1)
{
	gint* r = NULL;
	gint* _tmp0_;
	gint r_length1;
	gint _r_size_;
	gint* _tmp4_;
	gint _tmp4__length1;
	gint* result;
	g_return_val_if_fail (arr != NULL, NULL);
	_tmp0_ = g_new0 (gint, json_array_get_length (arr));
	r = _tmp0_;
	r_length1 = json_array_get_length (arr);
	_r_size_ = r_length1;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				gint* _tmp3_;
				gint _tmp3__length1;
				if (!_tmp1_) {
					guint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(i < json_array_get_length (arr))) {
					break;
				}
				_tmp3_ = r;
				_tmp3__length1 = r_length1;
				_tmp3_[i] = (gint) json_array_get_int_element (arr, i);
			}
		}
	}
	_tmp4_ = r;
	_tmp4__length1 = r_length1;
	if (result_length1) {
		*result_length1 = _tmp4__length1;
	}
	result = _tmp4_;
	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_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:
	{
		g_clear_error (&_data_->_inner_error0_);
	}
	__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)
{
	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_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	AdwAvatar* avatar = NULL;
	const gchar* _tmp43_;
	AdwAvatar* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	GdkTexture* _tmp47_;
	GdkTexture* _tmp48_;
	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_;
	adw_preferences_row_set_use_markup ((AdwPreferencesRow*) row, FALSE);
	_tmp41_ = title;
	adw_preferences_row_set_title ((AdwPreferencesRow*) row, _tmp41_);
	_tmp42_ = subtitle;
	adw_action_row_set_subtitle (row, _tmp42_);
	gtk_list_box_row_set_activatable ((GtkListBoxRow*) row, activatable);
	_tmp43_ = title;
	_tmp44_ = (AdwAvatar*) adw_avatar_new (32, _tmp43_, TRUE);
	g_object_ref_sink (_tmp44_);
	avatar = _tmp44_;
	_tmp45_ = dc_contact_get_profile_image (c);
	_tmp46_ = _tmp45_;
	_tmp47_ = dc_load_avatar (_tmp46_);
	_tmp48_ = _tmp47_;
	adw_avatar_set_custom_image (avatar, (GdkPaintable*) _tmp48_);
	_g_object_unref0 (_tmp48_);
	adw_action_row_add_prefix (row, (GtkWidget*) avatar);
	result = row;
	_g_object_unref0 (avatar);
	_g_free0 (subtitle);
	_g_free0 (title);
	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]);
	}
}

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

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

void
dc_chat_entry_set_chat_type (DcChatEntry* self,
                             gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_chat_entry_get_chat_type (self);
	if (old_value != value) {
		self->priv->_chat_type = value;
		g_object_notify_by_pspec ((GObject *) self, dc_chat_entry_properties[DC_CHAT_ENTRY_CHAT_TYPE_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_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_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]);
	}
}

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_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_CHAT_TYPE_PROPERTY, dc_chat_entry_properties[DC_CHAT_ENTRY_CHAT_TYPE_PROPERTY] = g_param_spec_int ("chat-type", "chat-type", "chat-type", 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_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_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_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));
}

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->_summary_prefix = NULL;
	self->priv->_timestamp = (gint64) 0;
	self->priv->_unread_count = 0;
	self->priv->_avatar_path = NULL;
	self->priv->_chat_type = 0;
	self->priv->_is_muted = FALSE;
	self->priv->_is_contact_request = FALSE;
	self->priv->_is_archived = FALSE;
	self->priv->_is_pinned = 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_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_CHAT_TYPE_PROPERTY:
		g_value_set_int (value, dc_chat_entry_get_chat_type (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_ARCHIVED_PROPERTY:
		g_value_set_boolean (value, dc_chat_entry_get_is_archived (self));
		break;
		case DC_CHAT_ENTRY_IS_PINNED_PROPERTY:
		g_value_set_boolean (value, dc_chat_entry_get_is_pinned (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_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_CHAT_TYPE_PROPERTY:
		dc_chat_entry_set_chat_type (self, g_value_get_int (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_ARCHIVED_PROPERTY:
		dc_chat_entry_set_is_archived (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;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

/**
     * Delivery state of a message, matching deltachat-core MessageState.
     * Only the values we render are named; everything else is UNKNOWN.
     */
static GType
dc_message_state_get_type_once (void)
{
	static const GEnumValue values[] = {{DC_MESSAGE_STATE_UNKNOWN, "DC_MESSAGE_STATE_UNKNOWN", "unknown"}, {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);
}

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

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

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

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_edit_text (DcMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp2_ = self->priv->_is_outgoing;
	if (_tmp2_) {
		gboolean _tmp3_;
		_tmp3_ = self->priv->_is_info;
		_tmp1_ = !_tmp3_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp4_ = dc_message_get_has_text (self);
		_tmp5_ = _tmp4_;
		_tmp0_ = _tmp5_;
	} 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_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_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_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_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));
}

static void
dc_message_instance_init (DcMessage * self,
                          gpointer klass)
{
	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->_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->_reactions = 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->_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->_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->_reactions);
	_g_free0 (self->priv->_my_reactions);
	_g_free0 (self->priv->_quote_text);
	_g_free0 (self->priv->_quote_sender_name);
	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_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_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_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_EDIT_TEXT_PROPERTY:
		g_value_set_boolean (value, dc_message_get_can_edit_text (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_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_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_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]);
	}
}

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

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

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_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;
		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;
		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 (GListStore* 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 ((GListModel*) store))) {
					break;
				}
				_tmp2_ = g_list_model_get_item ((GListModel*) 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 (GListStore* 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 ((GListModel*) store))) {
					break;
				}
				_tmp2_ = g_list_model_get_item ((GListModel*) 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;
}

