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

#include "libdino.h"
#include <glib.h>
#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include "qlite.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

enum  {
	DINO_ENTITIES_CONVERSATION_0_PROPERTY,
	DINO_ENTITIES_CONVERSATION_ID_PROPERTY,
	DINO_ENTITIES_CONVERSATION_TYPE__PROPERTY,
	DINO_ENTITIES_CONVERSATION_ACCOUNT_PROPERTY,
	DINO_ENTITIES_CONVERSATION_COUNTERPART_PROPERTY,
	DINO_ENTITIES_CONVERSATION_NICKNAME_PROPERTY,
	DINO_ENTITIES_CONVERSATION_ACTIVE_PROPERTY,
	DINO_ENTITIES_CONVERSATION_ACTIVE_LAST_CHANGED_PROPERTY,
	DINO_ENTITIES_CONVERSATION_LAST_ACTIVE_PROPERTY,
	DINO_ENTITIES_CONVERSATION_ENCRYPTION_PROPERTY,
	DINO_ENTITIES_CONVERSATION_READ_UP_TO_PROPERTY,
	DINO_ENTITIES_CONVERSATION_READ_UP_TO_ITEM_PROPERTY,
	DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_PROPERTY,
	DINO_ENTITIES_CONVERSATION_SEND_TYPING_PROPERTY,
	DINO_ENTITIES_CONVERSATION_SEND_MARKER_PROPERTY,
	DINO_ENTITIES_CONVERSATION_PINNED_PROPERTY,
	DINO_ENTITIES_CONVERSATION_NUM_PROPERTIES
};
static GParamSpec* dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _qlite_database_unref0(var) ((var == NULL) ? NULL : (var = (qlite_database_unref (var), NULL)))
#define _qlite_statement_builder_unref0(var) ((var == NULL) ? NULL : (var = (qlite_statement_builder_unref (var), NULL)))
enum  {
	DINO_ENTITIES_CONVERSATION_OBJECT_UPDATED_SIGNAL,
	DINO_ENTITIES_CONVERSATION_NUM_SIGNALS
};
static guint dino_entities_conversation_signals[DINO_ENTITIES_CONVERSATION_NUM_SIGNALS] = {0};

struct _DinoEntitiesConversationPrivate {
	gint _id;
	DinoEntitiesConversationType _type_;
	DinoEntitiesAccount* _account;
	XmppJid* _counterpart;
	gchar* _nickname;
	gboolean _active;
	GDateTime* _active_last_changed;
	GDateTime* _last_active;
	DinoEntitiesEncryption _encryption;
	DinoEntitiesMessage* _read_up_to;
	gint _read_up_to_item;
	DinoEntitiesConversationNotifySetting _notify_setting;
	DinoEntitiesConversationSetting _send_typing;
	DinoEntitiesConversationSetting _send_marker;
	gint _pinned;
	DinoDatabase* db;
};

static gint DinoEntitiesConversation_private_offset;
static gpointer dino_entities_conversation_parent_class = NULL;

static void dino_entities_conversation_set_account (DinoEntitiesConversation* self,
                                             DinoEntitiesAccount* value);
static void dino_entities_conversation_set_counterpart (DinoEntitiesConversation* self,
                                                 XmppJid* value);
static void dino_entities_conversation_set_active_last_changed (DinoEntitiesConversation* self,
                                                         GDateTime* value);
static gint64* _int64_dup (gint64* self);
static gint* _int_dup (gint* self);
static void dino_entities_conversation_on_update (DinoEntitiesConversation* self,
                                           GObject* o,
                                           GParamSpec* sp);
static void _dino_entities_conversation_on_update_g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self);
static void dino_entities_conversation_finalize (GObject * obj);
static GType dino_entities_conversation_get_type_once (void);
static void _vala_dino_entities_conversation_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_dino_entities_conversation_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);

static inline gpointer
dino_entities_conversation_get_instance_private (DinoEntitiesConversation* self)
{
	return G_STRUCT_MEMBER_P (self, DinoEntitiesConversation_private_offset);
}

gboolean
dino_entities_conversation_type_is_muc_semantic (DinoEntitiesConversationType self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	if (self == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT_PM;
	}
	result = _tmp0_;
	return result;
}

static GType
dino_entities_conversation_type_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_ENTITIES_CONVERSATION_TYPE_CHAT, "DINO_ENTITIES_CONVERSATION_TYPE_CHAT", "chat"}, {DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT, "DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT", "groupchat"}, {DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT_PM, "DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT_PM", "groupchat-pm"}, {0, NULL, NULL}};
	GType dino_entities_conversation_type_type_id;
	dino_entities_conversation_type_type_id = g_enum_register_static ("DinoEntitiesConversationType", values);
	return dino_entities_conversation_type_type_id;
}

GType
dino_entities_conversation_type_get_type (void)
{
	static volatile gsize dino_entities_conversation_type_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_conversation_type_type_id__once)) {
		GType dino_entities_conversation_type_type_id;
		dino_entities_conversation_type_type_id = dino_entities_conversation_type_get_type_once ();
		g_once_init_leave (&dino_entities_conversation_type_type_id__once, dino_entities_conversation_type_type_id);
	}
	return dino_entities_conversation_type_type_id__once;
}

static GType
dino_entities_conversation_notify_setting_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_DEFAULT, "DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_DEFAULT", "default"}, {DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_ON, "DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_ON", "on"}, {DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_OFF, "DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_OFF", "off"}, {DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_HIGHLIGHT, "DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_HIGHLIGHT", "highlight"}, {0, NULL, NULL}};
	GType dino_entities_conversation_notify_setting_type_id;
	dino_entities_conversation_notify_setting_type_id = g_enum_register_static ("DinoEntitiesConversationNotifySetting", values);
	return dino_entities_conversation_notify_setting_type_id;
}

GType
dino_entities_conversation_notify_setting_get_type (void)
{
	static volatile gsize dino_entities_conversation_notify_setting_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_conversation_notify_setting_type_id__once)) {
		GType dino_entities_conversation_notify_setting_type_id;
		dino_entities_conversation_notify_setting_type_id = dino_entities_conversation_notify_setting_get_type_once ();
		g_once_init_leave (&dino_entities_conversation_notify_setting_type_id__once, dino_entities_conversation_notify_setting_type_id);
	}
	return dino_entities_conversation_notify_setting_type_id__once;
}

static GType
dino_entities_conversation_setting_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_ENTITIES_CONVERSATION_SETTING_DEFAULT, "DINO_ENTITIES_CONVERSATION_SETTING_DEFAULT", "default"}, {DINO_ENTITIES_CONVERSATION_SETTING_ON, "DINO_ENTITIES_CONVERSATION_SETTING_ON", "on"}, {DINO_ENTITIES_CONVERSATION_SETTING_OFF, "DINO_ENTITIES_CONVERSATION_SETTING_OFF", "off"}, {0, NULL, NULL}};
	GType dino_entities_conversation_setting_type_id;
	dino_entities_conversation_setting_type_id = g_enum_register_static ("DinoEntitiesConversationSetting", values);
	return dino_entities_conversation_setting_type_id;
}

GType
dino_entities_conversation_setting_get_type (void)
{
	static volatile gsize dino_entities_conversation_setting_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_conversation_setting_type_id__once)) {
		GType dino_entities_conversation_setting_type_id;
		dino_entities_conversation_setting_type_id = dino_entities_conversation_setting_get_type_once ();
		g_once_init_leave (&dino_entities_conversation_setting_type_id__once, dino_entities_conversation_setting_type_id);
	}
	return dino_entities_conversation_setting_type_id__once;
}

DinoEntitiesConversation*
dino_entities_conversation_construct (GType object_type,
                                      XmppJid* jid,
                                      DinoEntitiesAccount* account,
                                      DinoEntitiesConversationType type)
{
	DinoEntitiesConversation * self = NULL;
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	self = (DinoEntitiesConversation*) g_object_new (object_type, NULL);
	dino_entities_conversation_set_account (self, account);
	dino_entities_conversation_set_counterpart (self, jid);
	dino_entities_conversation_set_type_ (self, type);
	return self;
}

DinoEntitiesConversation*
dino_entities_conversation_new (XmppJid* jid,
                                DinoEntitiesAccount* account,
                                DinoEntitiesConversationType type)
{
	return dino_entities_conversation_construct (DINO_ENTITIES_TYPE_CONVERSATION, jid, account, type);
}

static gpointer
_qlite_database_ref0 (gpointer self)
{
	return self ? qlite_database_ref (self) : NULL;
}

static gint64*
_int64_dup (gint64* self)
{
	gint64* dup;
	dup = g_new0 (gint64, 1);
	memcpy (dup, self, sizeof (gint64));
	return dup;
}

static gpointer
__int64_dup0 (gpointer self)
{
	return self ? _int64_dup (self) : NULL;
}

static gint*
_int_dup (gint* self)
{
	gint* dup;
	dup = g_new0 (gint, 1);
	memcpy (dup, self, sizeof (gint));
	return dup;
}

static gpointer
__int_dup0 (gpointer self)
{
	return self ? _int_dup (self) : NULL;
}

static void
_dino_entities_conversation_on_update_g_object_notify (GObject* _sender,
                                                       GParamSpec* pspec,
                                                       gpointer self)
{
	dino_entities_conversation_on_update ((DinoEntitiesConversation*) self, _sender, pspec);
}

DinoEntitiesConversation*
dino_entities_conversation_construct_from_row (GType object_type,
                                               DinoDatabase* db,
                                               QliteRow* row,
                                               GError** error)
{
	DinoEntitiesConversation * self = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseConversationTable* _tmp1_;
	DinoDatabaseConversationTable* _tmp2_;
	QliteColumn* _tmp3_;
	gpointer _tmp4_;
	DinoDatabaseConversationTable* _tmp5_;
	DinoDatabaseConversationTable* _tmp6_;
	QliteColumn* _tmp7_;
	gpointer _tmp8_;
	DinoDatabaseConversationTable* _tmp9_;
	DinoDatabaseConversationTable* _tmp10_;
	QliteColumn* _tmp11_;
	gpointer _tmp12_;
	DinoEntitiesAccount* _tmp13_;
	DinoEntitiesAccount* _tmp14_;
	gchar* resource = NULL;
	DinoDatabaseConversationTable* _tmp15_;
	DinoDatabaseConversationTable* _tmp16_;
	QliteColumn* _tmp17_;
	gpointer _tmp18_;
	XmppJid* _tmp19_ = NULL;
	DinoDatabaseConversationTable* _tmp20_;
	DinoDatabaseConversationTable* _tmp21_;
	QliteColumn* _tmp22_;
	gpointer _tmp23_;
	XmppJid* _tmp24_;
	DinoEntitiesConversationType _tmp25_;
	const gchar* _tmp30_ = NULL;
	DinoEntitiesConversationType _tmp31_;
	DinoDatabaseConversationTable* _tmp33_;
	DinoDatabaseConversationTable* _tmp34_;
	QliteColumn* _tmp35_;
	gpointer _tmp36_;
	DinoDatabaseConversationTable* _tmp37_;
	DinoDatabaseConversationTable* _tmp38_;
	QliteColumn* _tmp39_;
	gpointer _tmp40_;
	GDateTime* _tmp41_;
	GDateTime* _tmp42_;
	gint64* last_active = NULL;
	DinoDatabaseConversationTable* _tmp43_;
	DinoDatabaseConversationTable* _tmp44_;
	QliteColumn* _tmp45_;
	gpointer _tmp46_;
	gint64 _tmp47_;
	gint64* _tmp48_;
	gint64* _tmp49_;
	DinoDatabaseConversationTable* _tmp53_;
	DinoDatabaseConversationTable* _tmp54_;
	QliteColumn* _tmp55_;
	gpointer _tmp56_;
	gint* read_up_to = NULL;
	DinoDatabaseConversationTable* _tmp57_;
	DinoDatabaseConversationTable* _tmp58_;
	QliteColumn* _tmp59_;
	gpointer _tmp60_;
	gint _tmp61_;
	gint* _tmp62_;
	gint* _tmp63_;
	DinoDatabaseConversationTable* _tmp67_;
	DinoDatabaseConversationTable* _tmp68_;
	QliteColumn* _tmp69_;
	gpointer _tmp70_;
	DinoDatabaseConversationTable* _tmp71_;
	DinoDatabaseConversationTable* _tmp72_;
	QliteColumn* _tmp73_;
	gpointer _tmp74_;
	DinoDatabaseConversationTable* _tmp75_;
	DinoDatabaseConversationTable* _tmp76_;
	QliteColumn* _tmp77_;
	gpointer _tmp78_;
	DinoDatabaseConversationTable* _tmp79_;
	DinoDatabaseConversationTable* _tmp80_;
	QliteColumn* _tmp81_;
	gpointer _tmp82_;
	DinoDatabaseConversationTable* _tmp83_;
	DinoDatabaseConversationTable* _tmp84_;
	QliteColumn* _tmp85_;
	gpointer _tmp86_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (db != NULL, NULL);
	g_return_val_if_fail (row != NULL, NULL);
	self = (DinoEntitiesConversation*) g_object_new (object_type, NULL);
	_tmp0_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp0_;
	_tmp1_ = dino_database_get_conversation (db);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->id;
	_tmp4_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp3_);
	dino_entities_conversation_set_id (self, (gint) ((gintptr) _tmp4_));
	_tmp5_ = dino_database_get_conversation (db);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_->type_;
	_tmp8_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp7_);
	dino_entities_conversation_set_type_ (self, (DinoEntitiesConversationType) ((gint) ((gintptr) _tmp8_)));
	_tmp9_ = dino_database_get_conversation (db);
	_tmp10_ = _tmp9_;
	_tmp11_ = _tmp10_->account_id;
	_tmp12_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp11_);
	_tmp13_ = dino_database_get_account_by_id (db, (gint) ((gintptr) _tmp12_));
	_tmp14_ = _tmp13_;
	dino_entities_conversation_set_account (self, _tmp14_);
	_g_object_unref0 (_tmp14_);
	_tmp15_ = dino_database_get_conversation (db);
	_tmp16_ = _tmp15_;
	_tmp17_ = _tmp16_->resource;
	_tmp18_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp17_);
	resource = (gchar*) _tmp18_;
	_tmp20_ = dino_database_get_conversation (db);
	_tmp21_ = _tmp20_;
	_tmp22_ = _tmp21_->jid_id;
	_tmp23_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp22_);
	_tmp24_ = dino_database_get_jid_by_id (db, (gint) ((gintptr) _tmp23_), &_inner_error0_);
	_tmp19_ = _tmp24_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (resource);
			_g_object_unref0 (self);
			return NULL;
		} else {
			_g_free0 (resource);
			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;
		}
	}
	dino_entities_conversation_set_counterpart (self, _tmp19_);
	_tmp25_ = self->priv->_type_;
	if (_tmp25_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT_PM) {
		XmppJid* _tmp26_ = NULL;
		XmppJid* _tmp27_;
		const gchar* _tmp28_;
		XmppJid* _tmp29_;
		_tmp27_ = self->priv->_counterpart;
		_tmp28_ = resource;
		_tmp29_ = xmpp_jid_with_resource (_tmp27_, _tmp28_, &_inner_error0_);
		_tmp26_ = _tmp29_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_xmpp_jid_unref0 (_tmp19_);
				_g_free0 (resource);
				_g_object_unref0 (self);
				return NULL;
			} else {
				_xmpp_jid_unref0 (_tmp19_);
				_g_free0 (resource);
				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;
			}
		}
		dino_entities_conversation_set_counterpart (self, _tmp26_);
		_xmpp_jid_unref0 (_tmp26_);
	}
	_tmp31_ = self->priv->_type_;
	if (_tmp31_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		const gchar* _tmp32_;
		_tmp32_ = resource;
		_tmp30_ = _tmp32_;
	} else {
		_tmp30_ = NULL;
	}
	dino_entities_conversation_set_nickname (self, _tmp30_);
	_tmp33_ = dino_database_get_conversation (db);
	_tmp34_ = _tmp33_;
	_tmp35_ = _tmp34_->active;
	_tmp36_ = qlite_row_get (row, G_TYPE_BOOLEAN, NULL, NULL, _tmp35_);
	dino_entities_conversation_set_active (self, (gboolean) ((gintptr) _tmp36_));
	_tmp37_ = dino_database_get_conversation (db);
	_tmp38_ = _tmp37_;
	_tmp39_ = _tmp38_->active_last_changed;
	_tmp40_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp39_);
	_tmp41_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp40_)));
	_tmp42_ = _tmp41_;
	dino_entities_conversation_set_active_last_changed (self, _tmp42_);
	_g_date_time_unref0 (_tmp42_);
	_tmp43_ = dino_database_get_conversation (db);
	_tmp44_ = _tmp43_;
	_tmp45_ = _tmp44_->last_active;
	_tmp46_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp45_);
	_tmp47_ = (gint64) ((glong) ((gintptr) _tmp46_));
	_tmp48_ = __int64_dup0 (&_tmp47_);
	last_active = _tmp48_;
	_tmp49_ = last_active;
	if (_tmp49_ != NULL) {
		gint64* _tmp50_;
		GDateTime* _tmp51_;
		GDateTime* _tmp52_;
		_tmp50_ = last_active;
		_tmp51_ = g_date_time_new_from_unix_utc (*_tmp50_);
		_tmp52_ = _tmp51_;
		dino_entities_conversation_set_last_active (self, _tmp52_);
		_g_date_time_unref0 (_tmp52_);
	}
	_tmp53_ = dino_database_get_conversation (db);
	_tmp54_ = _tmp53_;
	_tmp55_ = _tmp54_->encryption;
	_tmp56_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp55_);
	dino_entities_conversation_set_encryption (self, (DinoEntitiesEncryption) ((gint) ((gintptr) _tmp56_)));
	_tmp57_ = dino_database_get_conversation (db);
	_tmp58_ = _tmp57_;
	_tmp59_ = _tmp58_->read_up_to;
	_tmp60_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp59_);
	_tmp61_ = (gint) ((gintptr) _tmp60_);
	_tmp62_ = __int_dup0 (&_tmp61_);
	read_up_to = _tmp62_;
	_tmp63_ = read_up_to;
	if (_tmp63_ != NULL) {
		gint* _tmp64_;
		DinoEntitiesMessage* _tmp65_;
		DinoEntitiesMessage* _tmp66_;
		_tmp64_ = read_up_to;
		_tmp65_ = dino_database_get_message_by_id (db, *_tmp64_);
		_tmp66_ = _tmp65_;
		dino_entities_conversation_set_read_up_to (self, _tmp66_);
		_g_object_unref0 (_tmp66_);
	}
	_tmp67_ = dino_database_get_conversation (db);
	_tmp68_ = _tmp67_;
	_tmp69_ = _tmp68_->read_up_to_item;
	_tmp70_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp69_);
	dino_entities_conversation_set_read_up_to_item (self, (gint) ((gintptr) _tmp70_));
	_tmp71_ = dino_database_get_conversation (db);
	_tmp72_ = _tmp71_;
	_tmp73_ = _tmp72_->notification;
	_tmp74_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp73_);
	dino_entities_conversation_set_notify_setting (self, (DinoEntitiesConversationNotifySetting) ((gint) ((gintptr) _tmp74_)));
	_tmp75_ = dino_database_get_conversation (db);
	_tmp76_ = _tmp75_;
	_tmp77_ = _tmp76_->send_typing;
	_tmp78_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp77_);
	dino_entities_conversation_set_send_typing (self, (DinoEntitiesConversationSetting) ((gint) ((gintptr) _tmp78_)));
	_tmp79_ = dino_database_get_conversation (db);
	_tmp80_ = _tmp79_;
	_tmp81_ = _tmp80_->send_marker;
	_tmp82_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp81_);
	dino_entities_conversation_set_send_marker (self, (DinoEntitiesConversationSetting) ((gint) ((gintptr) _tmp82_)));
	_tmp83_ = dino_database_get_conversation (db);
	_tmp84_ = _tmp83_;
	_tmp85_ = _tmp84_->pinned;
	_tmp86_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp85_);
	dino_entities_conversation_set_pinned (self, (gint) ((gintptr) _tmp86_));
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _dino_entities_conversation_on_update_g_object_notify, self, 0);
	_g_free0 (read_up_to);
	_g_free0 (last_active);
	_xmpp_jid_unref0 (_tmp19_);
	_g_free0 (resource);
	return self;
}

DinoEntitiesConversation*
dino_entities_conversation_new_from_row (DinoDatabase* db,
                                         QliteRow* row,
                                         GError** error)
{
	return dino_entities_conversation_construct_from_row (DINO_ENTITIES_TYPE_CONVERSATION, db, row, error);
}

void
dino_entities_conversation_persist (DinoEntitiesConversation* self,
                                    DinoDatabase* db)
{
	DinoDatabase* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	QliteInsertBuilder* insert = NULL;
	DinoDatabaseConversationTable* _tmp3_;
	DinoDatabaseConversationTable* _tmp4_;
	QliteInsertBuilder* _tmp5_;
	QliteInsertBuilder* _tmp6_;
	DinoDatabaseConversationTable* _tmp7_;
	DinoDatabaseConversationTable* _tmp8_;
	QliteColumn* _tmp9_;
	DinoEntitiesAccount* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	QliteInsertBuilder* _tmp13_;
	QliteInsertBuilder* _tmp14_;
	DinoDatabaseConversationTable* _tmp15_;
	DinoDatabaseConversationTable* _tmp16_;
	QliteColumn* _tmp17_;
	XmppJid* _tmp18_;
	QliteInsertBuilder* _tmp19_;
	QliteInsertBuilder* _tmp20_;
	DinoDatabaseConversationTable* _tmp21_;
	DinoDatabaseConversationTable* _tmp22_;
	QliteColumn* _tmp23_;
	DinoEntitiesConversationType _tmp24_;
	QliteInsertBuilder* _tmp25_;
	QliteInsertBuilder* _tmp26_;
	DinoDatabaseConversationTable* _tmp27_;
	DinoDatabaseConversationTable* _tmp28_;
	QliteColumn* _tmp29_;
	DinoEntitiesEncryption _tmp30_;
	QliteInsertBuilder* _tmp31_;
	QliteInsertBuilder* _tmp32_;
	DinoDatabaseConversationTable* _tmp33_;
	DinoDatabaseConversationTable* _tmp34_;
	QliteColumn* _tmp35_;
	gboolean _tmp36_;
	QliteInsertBuilder* _tmp37_;
	QliteInsertBuilder* _tmp38_;
	DinoDatabaseConversationTable* _tmp39_;
	DinoDatabaseConversationTable* _tmp40_;
	QliteColumn* _tmp41_;
	GDateTime* _tmp42_;
	QliteInsertBuilder* _tmp43_;
	QliteInsertBuilder* _tmp44_;
	DinoDatabaseConversationTable* _tmp45_;
	DinoDatabaseConversationTable* _tmp46_;
	QliteColumn* _tmp47_;
	DinoEntitiesConversationNotifySetting _tmp48_;
	QliteInsertBuilder* _tmp49_;
	QliteInsertBuilder* _tmp50_;
	DinoDatabaseConversationTable* _tmp51_;
	DinoDatabaseConversationTable* _tmp52_;
	QliteColumn* _tmp53_;
	DinoEntitiesConversationSetting _tmp54_;
	QliteInsertBuilder* _tmp55_;
	QliteInsertBuilder* _tmp56_;
	DinoDatabaseConversationTable* _tmp57_;
	DinoDatabaseConversationTable* _tmp58_;
	QliteColumn* _tmp59_;
	DinoEntitiesConversationSetting _tmp60_;
	QliteInsertBuilder* _tmp61_;
	QliteInsertBuilder* _tmp62_;
	DinoDatabaseConversationTable* _tmp63_;
	DinoDatabaseConversationTable* _tmp64_;
	QliteColumn* _tmp65_;
	gint _tmp66_;
	QliteInsertBuilder* _tmp67_;
	QliteInsertBuilder* _tmp68_;
	DinoEntitiesMessage* _tmp69_;
	gint _tmp79_;
	const gchar* _tmp87_;
	XmppJid* _tmp95_;
	GDateTime* _tmp104_;
	GDateTime* _tmp105_;
	QliteInsertBuilder* _tmp114_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (db != NULL);
	_tmp0_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp0_;
	_tmp1_ = g_date_time_new_now_utc ();
	_tmp2_ = _tmp1_;
	dino_entities_conversation_set_active_last_changed (self, _tmp2_);
	_g_date_time_unref0 (_tmp2_);
	_tmp3_ = dino_database_get_conversation (db);
	_tmp4_ = _tmp3_;
	_tmp5_ = qlite_table_insert ((QliteTable*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = dino_database_get_conversation (db);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_->account_id;
	_tmp10_ = self->priv->_account;
	_tmp11_ = dino_entities_account_get_id (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = qlite_insert_builder_value (_tmp6_, G_TYPE_INT, NULL, NULL, _tmp9_, (gpointer) ((gintptr) _tmp12_));
	_tmp14_ = _tmp13_;
	_tmp15_ = dino_database_get_conversation (db);
	_tmp16_ = _tmp15_;
	_tmp17_ = _tmp16_->jid_id;
	_tmp18_ = self->priv->_counterpart;
	_tmp19_ = qlite_insert_builder_value (_tmp14_, G_TYPE_INT, NULL, NULL, _tmp17_, (gpointer) ((gintptr) dino_database_get_jid_id (db, _tmp18_)));
	_tmp20_ = _tmp19_;
	_tmp21_ = dino_database_get_conversation (db);
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_->type_;
	_tmp24_ = self->priv->_type_;
	_tmp25_ = qlite_insert_builder_value (_tmp20_, G_TYPE_INT, NULL, NULL, _tmp23_, (gpointer) ((gintptr) _tmp24_));
	_tmp26_ = _tmp25_;
	_tmp27_ = dino_database_get_conversation (db);
	_tmp28_ = _tmp27_;
	_tmp29_ = _tmp28_->encryption;
	_tmp30_ = self->priv->_encryption;
	_tmp31_ = qlite_insert_builder_value (_tmp26_, G_TYPE_INT, NULL, NULL, _tmp29_, (gpointer) ((gintptr) _tmp30_));
	_tmp32_ = _tmp31_;
	_tmp33_ = dino_database_get_conversation (db);
	_tmp34_ = _tmp33_;
	_tmp35_ = _tmp34_->active;
	_tmp36_ = self->priv->_active;
	_tmp37_ = qlite_insert_builder_value (_tmp32_, G_TYPE_BOOLEAN, NULL, NULL, _tmp35_, (gpointer) ((gintptr) _tmp36_));
	_tmp38_ = _tmp37_;
	_tmp39_ = dino_database_get_conversation (db);
	_tmp40_ = _tmp39_;
	_tmp41_ = _tmp40_->active_last_changed;
	_tmp42_ = self->priv->_active_last_changed;
	_tmp43_ = qlite_insert_builder_value (_tmp38_, G_TYPE_LONG, NULL, NULL, _tmp41_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp42_)));
	_tmp44_ = _tmp43_;
	_tmp45_ = dino_database_get_conversation (db);
	_tmp46_ = _tmp45_;
	_tmp47_ = _tmp46_->notification;
	_tmp48_ = self->priv->_notify_setting;
	_tmp49_ = qlite_insert_builder_value (_tmp44_, G_TYPE_INT, NULL, NULL, _tmp47_, (gpointer) ((gintptr) _tmp48_));
	_tmp50_ = _tmp49_;
	_tmp51_ = dino_database_get_conversation (db);
	_tmp52_ = _tmp51_;
	_tmp53_ = _tmp52_->send_typing;
	_tmp54_ = self->priv->_send_typing;
	_tmp55_ = qlite_insert_builder_value (_tmp50_, G_TYPE_INT, NULL, NULL, _tmp53_, (gpointer) ((gintptr) _tmp54_));
	_tmp56_ = _tmp55_;
	_tmp57_ = dino_database_get_conversation (db);
	_tmp58_ = _tmp57_;
	_tmp59_ = _tmp58_->send_marker;
	_tmp60_ = self->priv->_send_marker;
	_tmp61_ = qlite_insert_builder_value (_tmp56_, G_TYPE_INT, NULL, NULL, _tmp59_, (gpointer) ((gintptr) _tmp60_));
	_tmp62_ = _tmp61_;
	_tmp63_ = dino_database_get_conversation (db);
	_tmp64_ = _tmp63_;
	_tmp65_ = _tmp64_->pinned;
	_tmp66_ = self->priv->_pinned;
	_tmp67_ = qlite_insert_builder_value (_tmp62_, G_TYPE_INT, NULL, NULL, _tmp65_, (gpointer) ((gintptr) _tmp66_));
	_tmp68_ = _tmp67_;
	_qlite_statement_builder_unref0 (_tmp62_);
	_qlite_statement_builder_unref0 (_tmp56_);
	_qlite_statement_builder_unref0 (_tmp50_);
	_qlite_statement_builder_unref0 (_tmp44_);
	_qlite_statement_builder_unref0 (_tmp38_);
	_qlite_statement_builder_unref0 (_tmp32_);
	_qlite_statement_builder_unref0 (_tmp26_);
	_qlite_statement_builder_unref0 (_tmp20_);
	_qlite_statement_builder_unref0 (_tmp14_);
	_qlite_statement_builder_unref0 (_tmp6_);
	insert = _tmp68_;
	_tmp69_ = self->priv->_read_up_to;
	if (_tmp69_ != NULL) {
		QliteInsertBuilder* _tmp70_;
		DinoDatabaseConversationTable* _tmp71_;
		DinoDatabaseConversationTable* _tmp72_;
		QliteColumn* _tmp73_;
		DinoEntitiesMessage* _tmp74_;
		gint _tmp75_;
		gint _tmp76_;
		QliteInsertBuilder* _tmp77_;
		QliteInsertBuilder* _tmp78_;
		_tmp70_ = insert;
		_tmp71_ = dino_database_get_conversation (db);
		_tmp72_ = _tmp71_;
		_tmp73_ = _tmp72_->read_up_to;
		_tmp74_ = self->priv->_read_up_to;
		_tmp75_ = dino_entities_message_get_id (_tmp74_);
		_tmp76_ = _tmp75_;
		_tmp77_ = qlite_insert_builder_value (_tmp70_, G_TYPE_INT, NULL, NULL, _tmp73_, (gpointer) ((gintptr) _tmp76_));
		_tmp78_ = _tmp77_;
		_qlite_statement_builder_unref0 (_tmp78_);
	}
	_tmp79_ = self->priv->_read_up_to_item;
	if (_tmp79_ != -1) {
		QliteInsertBuilder* _tmp80_;
		DinoDatabaseConversationTable* _tmp81_;
		DinoDatabaseConversationTable* _tmp82_;
		QliteColumn* _tmp83_;
		gint _tmp84_;
		QliteInsertBuilder* _tmp85_;
		QliteInsertBuilder* _tmp86_;
		_tmp80_ = insert;
		_tmp81_ = dino_database_get_conversation (db);
		_tmp82_ = _tmp81_;
		_tmp83_ = _tmp82_->read_up_to_item;
		_tmp84_ = self->priv->_read_up_to_item;
		_tmp85_ = qlite_insert_builder_value (_tmp80_, G_TYPE_INT, NULL, NULL, _tmp83_, (gpointer) ((gintptr) _tmp84_));
		_tmp86_ = _tmp85_;
		_qlite_statement_builder_unref0 (_tmp86_);
	}
	_tmp87_ = self->priv->_nickname;
	if (_tmp87_ != NULL) {
		QliteInsertBuilder* _tmp88_;
		DinoDatabaseConversationTable* _tmp89_;
		DinoDatabaseConversationTable* _tmp90_;
		QliteColumn* _tmp91_;
		const gchar* _tmp92_;
		QliteInsertBuilder* _tmp93_;
		QliteInsertBuilder* _tmp94_;
		_tmp88_ = insert;
		_tmp89_ = dino_database_get_conversation (db);
		_tmp90_ = _tmp89_;
		_tmp91_ = _tmp90_->resource;
		_tmp92_ = self->priv->_nickname;
		_tmp93_ = qlite_insert_builder_value (_tmp88_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp91_, _tmp92_);
		_tmp94_ = _tmp93_;
		_qlite_statement_builder_unref0 (_tmp94_);
	}
	_tmp95_ = self->priv->_counterpart;
	if (xmpp_jid_is_full (_tmp95_)) {
		QliteInsertBuilder* _tmp96_;
		DinoDatabaseConversationTable* _tmp97_;
		DinoDatabaseConversationTable* _tmp98_;
		QliteColumn* _tmp99_;
		XmppJid* _tmp100_;
		const gchar* _tmp101_;
		QliteInsertBuilder* _tmp102_;
		QliteInsertBuilder* _tmp103_;
		_tmp96_ = insert;
		_tmp97_ = dino_database_get_conversation (db);
		_tmp98_ = _tmp97_;
		_tmp99_ = _tmp98_->resource;
		_tmp100_ = self->priv->_counterpart;
		_tmp101_ = _tmp100_->resourcepart;
		_tmp102_ = qlite_insert_builder_value (_tmp96_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp99_, _tmp101_);
		_tmp103_ = _tmp102_;
		_qlite_statement_builder_unref0 (_tmp103_);
	}
	_tmp104_ = dino_entities_conversation_get_last_active (self);
	_tmp105_ = _tmp104_;
	if (_tmp105_ != NULL) {
		QliteInsertBuilder* _tmp106_;
		DinoDatabaseConversationTable* _tmp107_;
		DinoDatabaseConversationTable* _tmp108_;
		QliteColumn* _tmp109_;
		GDateTime* _tmp110_;
		GDateTime* _tmp111_;
		QliteInsertBuilder* _tmp112_;
		QliteInsertBuilder* _tmp113_;
		_tmp106_ = insert;
		_tmp107_ = dino_database_get_conversation (db);
		_tmp108_ = _tmp107_;
		_tmp109_ = _tmp108_->last_active;
		_tmp110_ = dino_entities_conversation_get_last_active (self);
		_tmp111_ = _tmp110_;
		_tmp112_ = qlite_insert_builder_value (_tmp106_, G_TYPE_LONG, NULL, NULL, _tmp109_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp111_)));
		_tmp113_ = _tmp112_;
		_qlite_statement_builder_unref0 (_tmp113_);
	}
	_tmp114_ = insert;
	dino_entities_conversation_set_id (self, (gint) qlite_insert_builder_perform (_tmp114_));
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _dino_entities_conversation_on_update_g_object_notify, self, 0);
	_qlite_statement_builder_unref0 (insert);
}

DinoEntitiesConversationNotifySetting
dino_entities_conversation_get_notification_setting (DinoEntitiesConversation* self,
                                                     DinoStreamInteractor* stream_interactor)
{
	DinoEntitiesConversationNotifySetting _tmp0_ = 0;
	DinoEntitiesConversationNotifySetting _tmp1_;
	DinoEntitiesConversationNotifySetting result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (stream_interactor != NULL, 0);
	_tmp1_ = self->priv->_notify_setting;
	if (_tmp1_ != DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_DEFAULT) {
		DinoEntitiesConversationNotifySetting _tmp2_;
		_tmp2_ = self->priv->_notify_setting;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = dino_entities_conversation_get_notification_default_setting (self, stream_interactor);
	}
	result = _tmp0_;
	return result;
}

DinoEntitiesConversationNotifySetting
dino_entities_conversation_get_notification_default_setting (DinoEntitiesConversation* self,
                                                             DinoStreamInteractor* stream_interactor)
{
	DinoApplication* _tmp0_;
	DinoEntitiesSettings* _tmp1_;
	DinoEntitiesSettings* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	DinoEntitiesConversationType _tmp5_;
	DinoEntitiesConversationNotifySetting result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (stream_interactor != NULL, 0);
	_tmp0_ = dino_application_get_default ();
	_tmp1_ = dino_application_get_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = dino_entities_settings_get_notifications (_tmp2_);
	_tmp4_ = _tmp3_;
	if (!_tmp4_) {
		result = DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_OFF;
		return result;
	}
	_tmp5_ = self->priv->_type_;
	if (_tmp5_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		DinoModuleIdentity* _tmp6_;
		gpointer _tmp7_;
		DinoMucManager* _tmp8_;
		DinoEntitiesAccount* _tmp9_;
		XmppJid* _tmp10_;
		gboolean _tmp11_;
		_tmp6_ = dino_muc_manager_IDENTITY;
		_tmp7_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
		_tmp8_ = (DinoMucManager*) _tmp7_;
		_tmp9_ = self->priv->_account;
		_tmp10_ = self->priv->_counterpart;
		_tmp11_ = dino_muc_manager_is_private_room (_tmp8_, _tmp9_, _tmp10_);
		_g_object_unref0 (_tmp8_);
		if (_tmp11_) {
			result = DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_ON;
			return result;
		} else {
			result = DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_HIGHLIGHT;
			return result;
		}
	}
	result = DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_ON;
	return result;
}

DinoEntitiesConversationSetting
dino_entities_conversation_get_send_typing_setting (DinoEntitiesConversation* self,
                                                    DinoStreamInteractor* stream_interactor)
{
	DinoEntitiesConversationSetting _tmp0_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoMucManager* _tmp4_;
	DinoEntitiesAccount* _tmp5_;
	XmppJid* _tmp6_;
	gboolean _tmp7_;
	DinoEntitiesConversationSetting _tmp8_ = 0;
	DinoApplication* _tmp9_;
	DinoEntitiesSettings* _tmp10_;
	DinoEntitiesSettings* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	DinoEntitiesConversationSetting result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (stream_interactor != NULL, 0);
	_tmp0_ = self->priv->_send_typing;
	if (_tmp0_ != DINO_ENTITIES_CONVERSATION_SETTING_DEFAULT) {
		DinoEntitiesConversationSetting _tmp1_;
		_tmp1_ = self->priv->_send_typing;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = dino_muc_manager_IDENTITY;
	_tmp3_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (DinoMucManager*) _tmp3_;
	_tmp5_ = self->priv->_account;
	_tmp6_ = self->priv->_counterpart;
	_tmp7_ = dino_muc_manager_is_public_room (_tmp4_, _tmp5_, _tmp6_);
	_g_object_unref0 (_tmp4_);
	if (_tmp7_) {
		result = DINO_ENTITIES_CONVERSATION_SETTING_OFF;
		return result;
	}
	_tmp9_ = dino_application_get_default ();
	_tmp10_ = dino_application_get_settings (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = dino_entities_settings_get_send_typing (_tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		_tmp8_ = DINO_ENTITIES_CONVERSATION_SETTING_ON;
	} else {
		_tmp8_ = DINO_ENTITIES_CONVERSATION_SETTING_OFF;
	}
	result = _tmp8_;
	return result;
}

DinoEntitiesConversationSetting
dino_entities_conversation_get_send_marker_setting (DinoEntitiesConversation* self,
                                                    DinoStreamInteractor* stream_interactor)
{
	DinoEntitiesConversationSetting _tmp0_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoMucManager* _tmp4_;
	DinoEntitiesAccount* _tmp5_;
	XmppJid* _tmp6_;
	gboolean _tmp7_;
	DinoEntitiesConversationSetting _tmp8_ = 0;
	DinoApplication* _tmp9_;
	DinoEntitiesSettings* _tmp10_;
	DinoEntitiesSettings* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	DinoEntitiesConversationSetting result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (stream_interactor != NULL, 0);
	_tmp0_ = self->priv->_send_marker;
	if (_tmp0_ != DINO_ENTITIES_CONVERSATION_SETTING_DEFAULT) {
		DinoEntitiesConversationSetting _tmp1_;
		_tmp1_ = self->priv->_send_marker;
		result = _tmp1_;
		return result;
	}
	_tmp2_ = dino_muc_manager_IDENTITY;
	_tmp3_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (DinoMucManager*) _tmp3_;
	_tmp5_ = self->priv->_account;
	_tmp6_ = self->priv->_counterpart;
	_tmp7_ = dino_muc_manager_is_public_room (_tmp4_, _tmp5_, _tmp6_);
	_g_object_unref0 (_tmp4_);
	if (_tmp7_) {
		result = DINO_ENTITIES_CONVERSATION_SETTING_OFF;
		return result;
	}
	_tmp9_ = dino_application_get_default ();
	_tmp10_ = dino_application_get_settings (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = dino_entities_settings_get_send_marker (_tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		_tmp8_ = DINO_ENTITIES_CONVERSATION_SETTING_ON;
	} else {
		_tmp8_ = DINO_ENTITIES_CONVERSATION_SETTING_OFF;
	}
	result = _tmp8_;
	return result;
}

gboolean
dino_entities_conversation_equals (DinoEntitiesConversation* self,
                                   DinoEntitiesConversation* conversation)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (conversation == NULL) {
		result = FALSE;
		return result;
	}
	result = dino_entities_conversation_equals_func (self, conversation);
	return result;
}

gboolean
dino_entities_conversation_equals_func (DinoEntitiesConversation* conversation1,
                                        DinoEntitiesConversation* conversation2)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gboolean result;
	g_return_val_if_fail (conversation1 != NULL, FALSE);
	g_return_val_if_fail (conversation2 != NULL, FALSE);
	_tmp2_ = conversation1->priv->_counterpart;
	_tmp3_ = conversation2->priv->_counterpart;
	if (xmpp_jid_equals (_tmp2_, _tmp3_)) {
		DinoEntitiesAccount* _tmp4_;
		DinoEntitiesAccount* _tmp5_;
		_tmp4_ = conversation1->priv->_account;
		_tmp5_ = conversation2->priv->_account;
		_tmp1_ = dino_entities_account_equals (_tmp4_, _tmp5_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		DinoEntitiesConversationType _tmp6_;
		DinoEntitiesConversationType _tmp7_;
		_tmp6_ = conversation1->priv->_type_;
		_tmp7_ = conversation2->priv->_type_;
		_tmp0_ = _tmp6_ == _tmp7_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

guint
dino_entities_conversation_hash_func (DinoEntitiesConversation* conversation)
{
	XmppJid* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	guint _tmp9_;
	guint result;
	g_return_val_if_fail (conversation != NULL, 0U);
	_tmp0_ = conversation->priv->_counterpart;
	_tmp1_ = xmpp_jid_to_string (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = conversation->priv->_account;
	_tmp4_ = dino_entities_account_get_bare_jid (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_jid_to_string (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_str_hash (_tmp2_) ^ g_str_hash (_tmp8_);
	_g_free0 (_tmp8_);
	_xmpp_jid_unref0 (_tmp6_);
	_g_free0 (_tmp2_);
	result = _tmp9_;
	return result;
}

static void
dino_entities_conversation_on_update (DinoEntitiesConversation* self,
                                      GObject* o,
                                      GParamSpec* sp)
{
	QliteUpdateBuilder* update = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseConversationTable* _tmp1_;
	DinoDatabaseConversationTable* _tmp2_;
	QliteUpdateBuilder* _tmp3_;
	QliteUpdateBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseConversationTable* _tmp6_;
	DinoDatabaseConversationTable* _tmp7_;
	QliteColumn* _tmp8_;
	gint _tmp9_;
	QliteUpdateBuilder* _tmp10_;
	QliteUpdateBuilder* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GQuark _tmp15_ = 0U;
	static GQuark _tmp14_label0 = 0;
	static GQuark _tmp14_label1 = 0;
	static GQuark _tmp14_label2 = 0;
	static GQuark _tmp14_label3 = 0;
	static GQuark _tmp14_label4 = 0;
	static GQuark _tmp14_label5 = 0;
	static GQuark _tmp14_label6 = 0;
	static GQuark _tmp14_label7 = 0;
	static GQuark _tmp14_label8 = 0;
	static GQuark _tmp14_label9 = 0;
	static GQuark _tmp14_label10 = 0;
	QliteUpdateBuilder* _tmp141_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (o != NULL);
	g_return_if_fail (sp != NULL);
	_tmp0_ = self->priv->db;
	_tmp1_ = dino_database_get_conversation (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_update ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->db;
	_tmp6_ = dino_database_get_conversation (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->id;
	_tmp9_ = self->priv->_id;
	_tmp10_ = qlite_update_builder_with (_tmp4_, G_TYPE_INT, NULL, NULL, _tmp8_, "=", (gpointer) ((gintptr) _tmp9_));
	_tmp11_ = _tmp10_;
	_qlite_statement_builder_unref0 (_tmp4_);
	update = _tmp11_;
	_tmp12_ = sp->name;
	_tmp13_ = _tmp12_;
	_tmp15_ = (NULL == _tmp13_) ? 0 : g_quark_from_string (_tmp13_);
	if (_tmp15_ == ((0 != _tmp14_label0) ? _tmp14_label0 : (_tmp14_label0 = g_quark_from_static_string ("type-")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp16_;
				DinoDatabase* _tmp17_;
				DinoDatabaseConversationTable* _tmp18_;
				DinoDatabaseConversationTable* _tmp19_;
				QliteColumn* _tmp20_;
				DinoEntitiesConversationType _tmp21_;
				QliteUpdateBuilder* _tmp22_;
				QliteUpdateBuilder* _tmp23_;
				_tmp16_ = update;
				_tmp17_ = self->priv->db;
				_tmp18_ = dino_database_get_conversation (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = _tmp19_->type_;
				_tmp21_ = self->priv->_type_;
				_tmp22_ = qlite_update_builder_set (_tmp16_, G_TYPE_INT, NULL, NULL, _tmp20_, (gpointer) ((gintptr) _tmp21_));
				_tmp23_ = _tmp22_;
				_qlite_statement_builder_unref0 (_tmp23_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label1) ? _tmp14_label1 : (_tmp14_label1 = g_quark_from_static_string ("encryption")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp24_;
				DinoDatabase* _tmp25_;
				DinoDatabaseConversationTable* _tmp26_;
				DinoDatabaseConversationTable* _tmp27_;
				QliteColumn* _tmp28_;
				DinoEntitiesEncryption _tmp29_;
				QliteUpdateBuilder* _tmp30_;
				QliteUpdateBuilder* _tmp31_;
				_tmp24_ = update;
				_tmp25_ = self->priv->db;
				_tmp26_ = dino_database_get_conversation (_tmp25_);
				_tmp27_ = _tmp26_;
				_tmp28_ = _tmp27_->encryption;
				_tmp29_ = self->priv->_encryption;
				_tmp30_ = qlite_update_builder_set (_tmp24_, G_TYPE_INT, NULL, NULL, _tmp28_, (gpointer) ((gintptr) _tmp29_));
				_tmp31_ = _tmp30_;
				_qlite_statement_builder_unref0 (_tmp31_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label2) ? _tmp14_label2 : (_tmp14_label2 = g_quark_from_static_string ("read-up-to")))) {
		switch (0) {
			default:
			{
				DinoEntitiesMessage* _tmp32_;
				_tmp32_ = self->priv->_read_up_to;
				if (_tmp32_ != NULL) {
					QliteUpdateBuilder* _tmp33_;
					DinoDatabase* _tmp34_;
					DinoDatabaseConversationTable* _tmp35_;
					DinoDatabaseConversationTable* _tmp36_;
					QliteColumn* _tmp37_;
					DinoEntitiesMessage* _tmp38_;
					gint _tmp39_;
					gint _tmp40_;
					QliteUpdateBuilder* _tmp41_;
					QliteUpdateBuilder* _tmp42_;
					_tmp33_ = update;
					_tmp34_ = self->priv->db;
					_tmp35_ = dino_database_get_conversation (_tmp34_);
					_tmp36_ = _tmp35_;
					_tmp37_ = _tmp36_->read_up_to;
					_tmp38_ = self->priv->_read_up_to;
					_tmp39_ = dino_entities_message_get_id (_tmp38_);
					_tmp40_ = _tmp39_;
					_tmp41_ = qlite_update_builder_set (_tmp33_, G_TYPE_INT, NULL, NULL, _tmp37_, (gpointer) ((gintptr) _tmp40_));
					_tmp42_ = _tmp41_;
					_qlite_statement_builder_unref0 (_tmp42_);
				} else {
					QliteUpdateBuilder* _tmp43_;
					DinoDatabase* _tmp44_;
					DinoDatabaseConversationTable* _tmp45_;
					DinoDatabaseConversationTable* _tmp46_;
					QliteColumn* _tmp47_;
					QliteUpdateBuilder* _tmp48_;
					QliteUpdateBuilder* _tmp49_;
					_tmp43_ = update;
					_tmp44_ = self->priv->db;
					_tmp45_ = dino_database_get_conversation (_tmp44_);
					_tmp46_ = _tmp45_;
					_tmp47_ = _tmp46_->read_up_to;
					_tmp48_ = qlite_update_builder_set_null (_tmp43_, G_TYPE_INT, NULL, NULL, _tmp47_);
					_tmp49_ = _tmp48_;
					_qlite_statement_builder_unref0 (_tmp49_);
				}
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label3) ? _tmp14_label3 : (_tmp14_label3 = g_quark_from_static_string ("read-up-to-item")))) {
		switch (0) {
			default:
			{
				gint _tmp50_;
				_tmp50_ = self->priv->_read_up_to_item;
				if (_tmp50_ != -1) {
					QliteUpdateBuilder* _tmp51_;
					DinoDatabase* _tmp52_;
					DinoDatabaseConversationTable* _tmp53_;
					DinoDatabaseConversationTable* _tmp54_;
					QliteColumn* _tmp55_;
					gint _tmp56_;
					QliteUpdateBuilder* _tmp57_;
					QliteUpdateBuilder* _tmp58_;
					_tmp51_ = update;
					_tmp52_ = self->priv->db;
					_tmp53_ = dino_database_get_conversation (_tmp52_);
					_tmp54_ = _tmp53_;
					_tmp55_ = _tmp54_->read_up_to_item;
					_tmp56_ = self->priv->_read_up_to_item;
					_tmp57_ = qlite_update_builder_set (_tmp51_, G_TYPE_INT, NULL, NULL, _tmp55_, (gpointer) ((gintptr) _tmp56_));
					_tmp58_ = _tmp57_;
					_qlite_statement_builder_unref0 (_tmp58_);
				} else {
					QliteUpdateBuilder* _tmp59_;
					DinoDatabase* _tmp60_;
					DinoDatabaseConversationTable* _tmp61_;
					DinoDatabaseConversationTable* _tmp62_;
					QliteColumn* _tmp63_;
					QliteUpdateBuilder* _tmp64_;
					QliteUpdateBuilder* _tmp65_;
					_tmp59_ = update;
					_tmp60_ = self->priv->db;
					_tmp61_ = dino_database_get_conversation (_tmp60_);
					_tmp62_ = _tmp61_;
					_tmp63_ = _tmp62_->read_up_to_item;
					_tmp64_ = qlite_update_builder_set_null (_tmp59_, G_TYPE_INT, NULL, NULL, _tmp63_);
					_tmp65_ = _tmp64_;
					_qlite_statement_builder_unref0 (_tmp65_);
				}
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label4) ? _tmp14_label4 : (_tmp14_label4 = g_quark_from_static_string ("nickname")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp66_;
				DinoDatabase* _tmp67_;
				DinoDatabaseConversationTable* _tmp68_;
				DinoDatabaseConversationTable* _tmp69_;
				QliteColumn* _tmp70_;
				const gchar* _tmp71_;
				QliteUpdateBuilder* _tmp72_;
				QliteUpdateBuilder* _tmp73_;
				_tmp66_ = update;
				_tmp67_ = self->priv->db;
				_tmp68_ = dino_database_get_conversation (_tmp67_);
				_tmp69_ = _tmp68_;
				_tmp70_ = _tmp69_->resource;
				_tmp71_ = self->priv->_nickname;
				_tmp72_ = qlite_update_builder_set (_tmp66_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp70_, _tmp71_);
				_tmp73_ = _tmp72_;
				_qlite_statement_builder_unref0 (_tmp73_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label5) ? _tmp14_label5 : (_tmp14_label5 = g_quark_from_static_string ("active")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp74_;
				DinoDatabase* _tmp75_;
				DinoDatabaseConversationTable* _tmp76_;
				DinoDatabaseConversationTable* _tmp77_;
				QliteColumn* _tmp78_;
				gboolean _tmp79_;
				QliteUpdateBuilder* _tmp80_;
				QliteUpdateBuilder* _tmp81_;
				QliteUpdateBuilder* _tmp82_;
				DinoDatabase* _tmp83_;
				DinoDatabaseConversationTable* _tmp84_;
				DinoDatabaseConversationTable* _tmp85_;
				QliteColumn* _tmp86_;
				GDateTime* _tmp87_;
				GDateTime* _tmp88_;
				QliteUpdateBuilder* _tmp89_;
				QliteUpdateBuilder* _tmp90_;
				_tmp74_ = update;
				_tmp75_ = self->priv->db;
				_tmp76_ = dino_database_get_conversation (_tmp75_);
				_tmp77_ = _tmp76_;
				_tmp78_ = _tmp77_->active;
				_tmp79_ = self->priv->_active;
				_tmp80_ = qlite_update_builder_set (_tmp74_, G_TYPE_BOOLEAN, NULL, NULL, _tmp78_, (gpointer) ((gintptr) _tmp79_));
				_tmp81_ = _tmp80_;
				_qlite_statement_builder_unref0 (_tmp81_);
				_tmp82_ = update;
				_tmp83_ = self->priv->db;
				_tmp84_ = dino_database_get_conversation (_tmp83_);
				_tmp85_ = _tmp84_;
				_tmp86_ = _tmp85_->active_last_changed;
				_tmp87_ = g_date_time_new_now_utc ();
				_tmp88_ = _tmp87_;
				_tmp89_ = qlite_update_builder_set (_tmp82_, G_TYPE_LONG, NULL, NULL, _tmp86_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp88_)));
				_tmp90_ = _tmp89_;
				_qlite_statement_builder_unref0 (_tmp90_);
				_g_date_time_unref0 (_tmp88_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label6) ? _tmp14_label6 : (_tmp14_label6 = g_quark_from_static_string ("last-active")))) {
		switch (0) {
			default:
			{
				GDateTime* _tmp91_;
				GDateTime* _tmp92_;
				_tmp91_ = dino_entities_conversation_get_last_active (self);
				_tmp92_ = _tmp91_;
				if (_tmp92_ != NULL) {
					QliteUpdateBuilder* _tmp93_;
					DinoDatabase* _tmp94_;
					DinoDatabaseConversationTable* _tmp95_;
					DinoDatabaseConversationTable* _tmp96_;
					QliteColumn* _tmp97_;
					GDateTime* _tmp98_;
					GDateTime* _tmp99_;
					QliteUpdateBuilder* _tmp100_;
					QliteUpdateBuilder* _tmp101_;
					_tmp93_ = update;
					_tmp94_ = self->priv->db;
					_tmp95_ = dino_database_get_conversation (_tmp94_);
					_tmp96_ = _tmp95_;
					_tmp97_ = _tmp96_->last_active;
					_tmp98_ = dino_entities_conversation_get_last_active (self);
					_tmp99_ = _tmp98_;
					_tmp100_ = qlite_update_builder_set (_tmp93_, G_TYPE_LONG, NULL, NULL, _tmp97_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp99_)));
					_tmp101_ = _tmp100_;
					_qlite_statement_builder_unref0 (_tmp101_);
				} else {
					QliteUpdateBuilder* _tmp102_;
					DinoDatabase* _tmp103_;
					DinoDatabaseConversationTable* _tmp104_;
					DinoDatabaseConversationTable* _tmp105_;
					QliteColumn* _tmp106_;
					QliteUpdateBuilder* _tmp107_;
					QliteUpdateBuilder* _tmp108_;
					_tmp102_ = update;
					_tmp103_ = self->priv->db;
					_tmp104_ = dino_database_get_conversation (_tmp103_);
					_tmp105_ = _tmp104_;
					_tmp106_ = _tmp105_->last_active;
					_tmp107_ = qlite_update_builder_set_null (_tmp102_, G_TYPE_LONG, NULL, NULL, _tmp106_);
					_tmp108_ = _tmp107_;
					_qlite_statement_builder_unref0 (_tmp108_);
				}
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label7) ? _tmp14_label7 : (_tmp14_label7 = g_quark_from_static_string ("notify-setting")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp109_;
				DinoDatabase* _tmp110_;
				DinoDatabaseConversationTable* _tmp111_;
				DinoDatabaseConversationTable* _tmp112_;
				QliteColumn* _tmp113_;
				DinoEntitiesConversationNotifySetting _tmp114_;
				QliteUpdateBuilder* _tmp115_;
				QliteUpdateBuilder* _tmp116_;
				_tmp109_ = update;
				_tmp110_ = self->priv->db;
				_tmp111_ = dino_database_get_conversation (_tmp110_);
				_tmp112_ = _tmp111_;
				_tmp113_ = _tmp112_->notification;
				_tmp114_ = self->priv->_notify_setting;
				_tmp115_ = qlite_update_builder_set (_tmp109_, G_TYPE_INT, NULL, NULL, _tmp113_, (gpointer) ((gintptr) _tmp114_));
				_tmp116_ = _tmp115_;
				_qlite_statement_builder_unref0 (_tmp116_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label8) ? _tmp14_label8 : (_tmp14_label8 = g_quark_from_static_string ("send-typing")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp117_;
				DinoDatabase* _tmp118_;
				DinoDatabaseConversationTable* _tmp119_;
				DinoDatabaseConversationTable* _tmp120_;
				QliteColumn* _tmp121_;
				DinoEntitiesConversationSetting _tmp122_;
				QliteUpdateBuilder* _tmp123_;
				QliteUpdateBuilder* _tmp124_;
				_tmp117_ = update;
				_tmp118_ = self->priv->db;
				_tmp119_ = dino_database_get_conversation (_tmp118_);
				_tmp120_ = _tmp119_;
				_tmp121_ = _tmp120_->send_typing;
				_tmp122_ = self->priv->_send_typing;
				_tmp123_ = qlite_update_builder_set (_tmp117_, G_TYPE_INT, NULL, NULL, _tmp121_, (gpointer) ((gintptr) _tmp122_));
				_tmp124_ = _tmp123_;
				_qlite_statement_builder_unref0 (_tmp124_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label9) ? _tmp14_label9 : (_tmp14_label9 = g_quark_from_static_string ("send-marker")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp125_;
				DinoDatabase* _tmp126_;
				DinoDatabaseConversationTable* _tmp127_;
				DinoDatabaseConversationTable* _tmp128_;
				QliteColumn* _tmp129_;
				DinoEntitiesConversationSetting _tmp130_;
				QliteUpdateBuilder* _tmp131_;
				QliteUpdateBuilder* _tmp132_;
				_tmp125_ = update;
				_tmp126_ = self->priv->db;
				_tmp127_ = dino_database_get_conversation (_tmp126_);
				_tmp128_ = _tmp127_;
				_tmp129_ = _tmp128_->send_marker;
				_tmp130_ = self->priv->_send_marker;
				_tmp131_ = qlite_update_builder_set (_tmp125_, G_TYPE_INT, NULL, NULL, _tmp129_, (gpointer) ((gintptr) _tmp130_));
				_tmp132_ = _tmp131_;
				_qlite_statement_builder_unref0 (_tmp132_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label10) ? _tmp14_label10 : (_tmp14_label10 = g_quark_from_static_string ("pinned")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp133_;
				DinoDatabase* _tmp134_;
				DinoDatabaseConversationTable* _tmp135_;
				DinoDatabaseConversationTable* _tmp136_;
				QliteColumn* _tmp137_;
				gint _tmp138_;
				QliteUpdateBuilder* _tmp139_;
				QliteUpdateBuilder* _tmp140_;
				_tmp133_ = update;
				_tmp134_ = self->priv->db;
				_tmp135_ = dino_database_get_conversation (_tmp134_);
				_tmp136_ = _tmp135_;
				_tmp137_ = _tmp136_->pinned;
				_tmp138_ = self->priv->_pinned;
				_tmp139_ = qlite_update_builder_set (_tmp133_, G_TYPE_INT, NULL, NULL, _tmp137_, (gpointer) ((gintptr) _tmp138_));
				_tmp140_ = _tmp139_;
				_qlite_statement_builder_unref0 (_tmp140_);
				break;
			}
		}
	}
	_tmp141_ = update;
	qlite_update_builder_perform (_tmp141_);
	_qlite_statement_builder_unref0 (update);
}

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

void
dino_entities_conversation_set_id (DinoEntitiesConversation* self,
                                   gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ID_PROPERTY]);
	}
}

DinoEntitiesConversationType
dino_entities_conversation_get_type_ (DinoEntitiesConversation* self)
{
	DinoEntitiesConversationType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_type_;
	return result;
}

void
dino_entities_conversation_set_type_ (DinoEntitiesConversation* self,
                                      DinoEntitiesConversationType value)
{
	DinoEntitiesConversationType old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_type_ (self);
	if (old_value != value) {
		self->priv->_type_ = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_TYPE__PROPERTY]);
	}
}

DinoEntitiesAccount*
dino_entities_conversation_get_account (DinoEntitiesConversation* self)
{
	DinoEntitiesAccount* result;
	DinoEntitiesAccount* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account;
	result = _tmp0_;
	return result;
}

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

static void
dino_entities_conversation_set_account (DinoEntitiesConversation* self,
                                        DinoEntitiesAccount* value)
{
	DinoEntitiesAccount* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_account (self);
	if (old_value != value) {
		DinoEntitiesAccount* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_account);
		self->priv->_account = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ACCOUNT_PROPERTY]);
	}
}

XmppJid*
dino_entities_conversation_get_counterpart (DinoEntitiesConversation* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_counterpart;
	result = _tmp0_;
	return result;
}

static gpointer
_xmpp_jid_ref0 (gpointer self)
{
	return self ? xmpp_jid_ref (self) : NULL;
}

static void
dino_entities_conversation_set_counterpart (DinoEntitiesConversation* self,
                                            XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_counterpart (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_counterpart);
		self->priv->_counterpart = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_COUNTERPART_PROPERTY]);
	}
}

const gchar*
dino_entities_conversation_get_nickname (DinoEntitiesConversation* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_nickname;
	result = _tmp0_;
	return result;
}

void
dino_entities_conversation_set_nickname (DinoEntitiesConversation* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_nickname (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_nickname);
		self->priv->_nickname = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_NICKNAME_PROPERTY]);
	}
}

gboolean
dino_entities_conversation_get_active (DinoEntitiesConversation* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_active;
	return result;
}

void
dino_entities_conversation_set_active (DinoEntitiesConversation* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_active (self);
	if (old_value != value) {
		self->priv->_active = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ACTIVE_PROPERTY]);
	}
}

GDateTime*
dino_entities_conversation_get_active_last_changed (DinoEntitiesConversation* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_active_last_changed;
	result = _tmp0_;
	return result;
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

static void
dino_entities_conversation_set_active_last_changed (DinoEntitiesConversation* self,
                                                    GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_active_last_changed (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_active_last_changed);
		self->priv->_active_last_changed = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ACTIVE_LAST_CHANGED_PROPERTY]);
	}
}

GDateTime*
dino_entities_conversation_get_last_active (DinoEntitiesConversation* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_last_active;
	result = _tmp0_;
	return result;
}

void
dino_entities_conversation_set_last_active (DinoEntitiesConversation* self,
                                            GDateTime* value)
{
	gboolean _tmp0_ = FALSE;
	GDateTime* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_last_active;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp2_ = FALSE;
		if (value != NULL) {
			GDateTime* _tmp3_;
			_tmp3_ = self->priv->_last_active;
			_tmp2_ = g_date_time_difference (value, _tmp3_) > ((GTimeSpan) 0);
		} else {
			_tmp2_ = FALSE;
		}
		_tmp0_ = _tmp2_;
	}
	if (_tmp0_) {
		GDateTime* _tmp4_;
		_tmp4_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_last_active);
		self->priv->_last_active = _tmp4_;
	}
	g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_LAST_ACTIVE_PROPERTY]);
}

DinoEntitiesEncryption
dino_entities_conversation_get_encryption (DinoEntitiesConversation* self)
{
	DinoEntitiesEncryption result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_encryption;
	return result;
}

void
dino_entities_conversation_set_encryption (DinoEntitiesConversation* self,
                                           DinoEntitiesEncryption value)
{
	DinoEntitiesEncryption old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_encryption (self);
	if (old_value != value) {
		self->priv->_encryption = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ENCRYPTION_PROPERTY]);
	}
}

DinoEntitiesMessage*
dino_entities_conversation_get_read_up_to (DinoEntitiesConversation* self)
{
	DinoEntitiesMessage* result;
	DinoEntitiesMessage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_read_up_to;
	result = _tmp0_;
	return result;
}

void
dino_entities_conversation_set_read_up_to (DinoEntitiesConversation* self,
                                           DinoEntitiesMessage* value)
{
	DinoEntitiesMessage* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_read_up_to (self);
	if (old_value != value) {
		DinoEntitiesMessage* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_read_up_to);
		self->priv->_read_up_to = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_READ_UP_TO_PROPERTY]);
	}
}

gint
dino_entities_conversation_get_read_up_to_item (DinoEntitiesConversation* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_read_up_to_item;
	return result;
}

void
dino_entities_conversation_set_read_up_to_item (DinoEntitiesConversation* self,
                                                gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_read_up_to_item (self);
	if (old_value != value) {
		self->priv->_read_up_to_item = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_READ_UP_TO_ITEM_PROPERTY]);
	}
}

DinoEntitiesConversationNotifySetting
dino_entities_conversation_get_notify_setting (DinoEntitiesConversation* self)
{
	DinoEntitiesConversationNotifySetting result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_notify_setting;
	return result;
}

void
dino_entities_conversation_set_notify_setting (DinoEntitiesConversation* self,
                                               DinoEntitiesConversationNotifySetting value)
{
	DinoEntitiesConversationNotifySetting old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_notify_setting (self);
	if (old_value != value) {
		self->priv->_notify_setting = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_PROPERTY]);
	}
}

DinoEntitiesConversationSetting
dino_entities_conversation_get_send_typing (DinoEntitiesConversation* self)
{
	DinoEntitiesConversationSetting result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_send_typing;
	return result;
}

void
dino_entities_conversation_set_send_typing (DinoEntitiesConversation* self,
                                            DinoEntitiesConversationSetting value)
{
	DinoEntitiesConversationSetting old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_send_typing (self);
	if (old_value != value) {
		self->priv->_send_typing = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_SEND_TYPING_PROPERTY]);
	}
}

DinoEntitiesConversationSetting
dino_entities_conversation_get_send_marker (DinoEntitiesConversation* self)
{
	DinoEntitiesConversationSetting result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_send_marker;
	return result;
}

void
dino_entities_conversation_set_send_marker (DinoEntitiesConversation* self,
                                            DinoEntitiesConversationSetting value)
{
	DinoEntitiesConversationSetting old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_send_marker (self);
	if (old_value != value) {
		self->priv->_send_marker = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_SEND_MARKER_PROPERTY]);
	}
}

gint
dino_entities_conversation_get_pinned (DinoEntitiesConversation* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_pinned;
	return result;
}

void
dino_entities_conversation_set_pinned (DinoEntitiesConversation* self,
                                       gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_conversation_get_pinned (self);
	if (old_value != value) {
		self->priv->_pinned = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_PINNED_PROPERTY]);
	}
}

static void
dino_entities_conversation_class_init (DinoEntitiesConversationClass * klass,
                                       gpointer klass_data)
{
	dino_entities_conversation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoEntitiesConversation_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_entities_conversation_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_entities_conversation_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_entities_conversation_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_ID_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_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), DINO_ENTITIES_CONVERSATION_TYPE__PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_TYPE__PROPERTY] = g_param_spec_enum ("type-", "type-", "type-", DINO_ENTITIES_CONVERSATION_TYPE_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_ACCOUNT_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ACCOUNT_PROPERTY] = g_param_spec_object ("account", "account", "account", DINO_ENTITIES_TYPE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_COUNTERPART_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_COUNTERPART_PROPERTY] = xmpp_param_spec_jid ("counterpart", "counterpart", "counterpart", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_NICKNAME_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_NICKNAME_PROPERTY] = g_param_spec_string ("nickname", "nickname", "nickname", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_ACTIVE_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ACTIVE_PROPERTY] = g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_ACTIVE_LAST_CHANGED_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ACTIVE_LAST_CHANGED_PROPERTY] = g_param_spec_boxed ("active-last-changed", "active-last-changed", "active-last-changed", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_LAST_ACTIVE_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_LAST_ACTIVE_PROPERTY] = g_param_spec_boxed ("last-active", "last-active", "last-active", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_ENCRYPTION_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_ENCRYPTION_PROPERTY] = g_param_spec_enum ("encryption", "encryption", "encryption", DINO_ENTITIES_TYPE_ENCRYPTION, DINO_ENTITIES_ENCRYPTION_UNKNOWN, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_READ_UP_TO_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_READ_UP_TO_PROPERTY] = g_param_spec_object ("read-up-to", "read-up-to", "read-up-to", DINO_ENTITIES_TYPE_MESSAGE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_READ_UP_TO_ITEM_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_READ_UP_TO_ITEM_PROPERTY] = g_param_spec_int ("read-up-to-item", "read-up-to-item", "read-up-to-item", G_MININT, G_MAXINT, -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_PROPERTY] = g_param_spec_enum ("notify-setting", "notify-setting", "notify-setting", DINO_ENTITIES_CONVERSATION_TYPE_NOTIFY_SETTING, DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_DEFAULT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_SEND_TYPING_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_SEND_TYPING_PROPERTY] = g_param_spec_enum ("send-typing", "send-typing", "send-typing", DINO_ENTITIES_CONVERSATION_TYPE_SETTING, DINO_ENTITIES_CONVERSATION_SETTING_DEFAULT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_SEND_MARKER_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_SEND_MARKER_PROPERTY] = g_param_spec_enum ("send-marker", "send-marker", "send-marker", DINO_ENTITIES_CONVERSATION_TYPE_SETTING, DINO_ENTITIES_CONVERSATION_SETTING_DEFAULT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CONVERSATION_PINNED_PROPERTY, dino_entities_conversation_properties[DINO_ENTITIES_CONVERSATION_PINNED_PROPERTY] = g_param_spec_int ("pinned", "pinned", "pinned", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	dino_entities_conversation_signals[DINO_ENTITIES_CONVERSATION_OBJECT_UPDATED_SIGNAL] = g_signal_new ("object-updated", DINO_ENTITIES_TYPE_CONVERSATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_ENTITIES_TYPE_CONVERSATION);
}

static void
dino_entities_conversation_instance_init (DinoEntitiesConversation * self,
                                          gpointer klass)
{
	self->priv = dino_entities_conversation_get_instance_private (self);
	self->priv->_active = FALSE;
	self->priv->_encryption = DINO_ENTITIES_ENCRYPTION_UNKNOWN;
	self->priv->_read_up_to_item = -1;
	self->priv->_notify_setting = DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_DEFAULT;
	self->priv->_send_typing = DINO_ENTITIES_CONVERSATION_SETTING_DEFAULT;
	self->priv->_send_marker = DINO_ENTITIES_CONVERSATION_SETTING_DEFAULT;
	self->priv->_pinned = 0;
}

static void
dino_entities_conversation_finalize (GObject * obj)
{
	DinoEntitiesConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_ENTITIES_TYPE_CONVERSATION, DinoEntitiesConversation);
	_g_object_unref0 (self->priv->_account);
	_xmpp_jid_unref0 (self->priv->_counterpart);
	_g_free0 (self->priv->_nickname);
	_g_date_time_unref0 (self->priv->_active_last_changed);
	_g_date_time_unref0 (self->priv->_last_active);
	_g_object_unref0 (self->priv->_read_up_to);
	_qlite_database_unref0 (self->priv->db);
	G_OBJECT_CLASS (dino_entities_conversation_parent_class)->finalize (obj);
}

static GType
dino_entities_conversation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoEntitiesConversationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_entities_conversation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoEntitiesConversation), 0, (GInstanceInitFunc) dino_entities_conversation_instance_init, NULL };
	GType dino_entities_conversation_type_id;
	dino_entities_conversation_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoEntitiesConversation", &g_define_type_info, 0);
	DinoEntitiesConversation_private_offset = g_type_add_instance_private (dino_entities_conversation_type_id, sizeof (DinoEntitiesConversationPrivate));
	return dino_entities_conversation_type_id;
}

GType
dino_entities_conversation_get_type (void)
{
	static volatile gsize dino_entities_conversation_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_conversation_type_id__once)) {
		GType dino_entities_conversation_type_id;
		dino_entities_conversation_type_id = dino_entities_conversation_get_type_once ();
		g_once_init_leave (&dino_entities_conversation_type_id__once, dino_entities_conversation_type_id);
	}
	return dino_entities_conversation_type_id__once;
}

static void
_vala_dino_entities_conversation_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	DinoEntitiesConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_ENTITIES_TYPE_CONVERSATION, DinoEntitiesConversation);
	switch (property_id) {
		case DINO_ENTITIES_CONVERSATION_ID_PROPERTY:
		g_value_set_int (value, dino_entities_conversation_get_id (self));
		break;
		case DINO_ENTITIES_CONVERSATION_TYPE__PROPERTY:
		g_value_set_enum (value, dino_entities_conversation_get_type_ (self));
		break;
		case DINO_ENTITIES_CONVERSATION_ACCOUNT_PROPERTY:
		g_value_set_object (value, dino_entities_conversation_get_account (self));
		break;
		case DINO_ENTITIES_CONVERSATION_COUNTERPART_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_conversation_get_counterpart (self));
		break;
		case DINO_ENTITIES_CONVERSATION_NICKNAME_PROPERTY:
		g_value_set_string (value, dino_entities_conversation_get_nickname (self));
		break;
		case DINO_ENTITIES_CONVERSATION_ACTIVE_PROPERTY:
		g_value_set_boolean (value, dino_entities_conversation_get_active (self));
		break;
		case DINO_ENTITIES_CONVERSATION_ACTIVE_LAST_CHANGED_PROPERTY:
		g_value_set_boxed (value, dino_entities_conversation_get_active_last_changed (self));
		break;
		case DINO_ENTITIES_CONVERSATION_LAST_ACTIVE_PROPERTY:
		g_value_set_boxed (value, dino_entities_conversation_get_last_active (self));
		break;
		case DINO_ENTITIES_CONVERSATION_ENCRYPTION_PROPERTY:
		g_value_set_enum (value, dino_entities_conversation_get_encryption (self));
		break;
		case DINO_ENTITIES_CONVERSATION_READ_UP_TO_PROPERTY:
		g_value_set_object (value, dino_entities_conversation_get_read_up_to (self));
		break;
		case DINO_ENTITIES_CONVERSATION_READ_UP_TO_ITEM_PROPERTY:
		g_value_set_int (value, dino_entities_conversation_get_read_up_to_item (self));
		break;
		case DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_PROPERTY:
		g_value_set_enum (value, dino_entities_conversation_get_notify_setting (self));
		break;
		case DINO_ENTITIES_CONVERSATION_SEND_TYPING_PROPERTY:
		g_value_set_enum (value, dino_entities_conversation_get_send_typing (self));
		break;
		case DINO_ENTITIES_CONVERSATION_SEND_MARKER_PROPERTY:
		g_value_set_enum (value, dino_entities_conversation_get_send_marker (self));
		break;
		case DINO_ENTITIES_CONVERSATION_PINNED_PROPERTY:
		g_value_set_int (value, dino_entities_conversation_get_pinned (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_entities_conversation_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	DinoEntitiesConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_ENTITIES_TYPE_CONVERSATION, DinoEntitiesConversation);
	switch (property_id) {
		case DINO_ENTITIES_CONVERSATION_ID_PROPERTY:
		dino_entities_conversation_set_id (self, g_value_get_int (value));
		break;
		case DINO_ENTITIES_CONVERSATION_TYPE__PROPERTY:
		dino_entities_conversation_set_type_ (self, g_value_get_enum (value));
		break;
		case DINO_ENTITIES_CONVERSATION_ACCOUNT_PROPERTY:
		dino_entities_conversation_set_account (self, g_value_get_object (value));
		break;
		case DINO_ENTITIES_CONVERSATION_COUNTERPART_PROPERTY:
		dino_entities_conversation_set_counterpart (self, xmpp_value_get_jid (value));
		break;
		case DINO_ENTITIES_CONVERSATION_NICKNAME_PROPERTY:
		dino_entities_conversation_set_nickname (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_CONVERSATION_ACTIVE_PROPERTY:
		dino_entities_conversation_set_active (self, g_value_get_boolean (value));
		break;
		case DINO_ENTITIES_CONVERSATION_ACTIVE_LAST_CHANGED_PROPERTY:
		dino_entities_conversation_set_active_last_changed (self, g_value_get_boxed (value));
		break;
		case DINO_ENTITIES_CONVERSATION_LAST_ACTIVE_PROPERTY:
		dino_entities_conversation_set_last_active (self, g_value_get_boxed (value));
		break;
		case DINO_ENTITIES_CONVERSATION_ENCRYPTION_PROPERTY:
		dino_entities_conversation_set_encryption (self, g_value_get_enum (value));
		break;
		case DINO_ENTITIES_CONVERSATION_READ_UP_TO_PROPERTY:
		dino_entities_conversation_set_read_up_to (self, g_value_get_object (value));
		break;
		case DINO_ENTITIES_CONVERSATION_READ_UP_TO_ITEM_PROPERTY:
		dino_entities_conversation_set_read_up_to_item (self, g_value_get_int (value));
		break;
		case DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_PROPERTY:
		dino_entities_conversation_set_notify_setting (self, g_value_get_enum (value));
		break;
		case DINO_ENTITIES_CONVERSATION_SEND_TYPING_PROPERTY:
		dino_entities_conversation_set_send_typing (self, g_value_get_enum (value));
		break;
		case DINO_ENTITIES_CONVERSATION_SEND_MARKER_PROPERTY:
		dino_entities_conversation_set_send_marker (self, g_value_get_enum (value));
		break;
		case DINO_ENTITIES_CONVERSATION_PINNED_PROPERTY:
		dino_entities_conversation_set_pinned (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

