/* account.c generated by valac 0.56.19, the Vala compiler
 * generated from account.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_ACCOUNT_0_PROPERTY,
	DINO_ENTITIES_ACCOUNT_ID_PROPERTY,
	DINO_ENTITIES_ACCOUNT_LOCALPART_PROPERTY,
	DINO_ENTITIES_ACCOUNT_DOMAINPART_PROPERTY,
	DINO_ENTITIES_ACCOUNT_RESOURCEPART_PROPERTY,
	DINO_ENTITIES_ACCOUNT_BARE_JID_PROPERTY,
	DINO_ENTITIES_ACCOUNT_FULL_JID_PROPERTY,
	DINO_ENTITIES_ACCOUNT_PASSWORD_PROPERTY,
	DINO_ENTITIES_ACCOUNT_DISPLAY_NAME_PROPERTY,
	DINO_ENTITIES_ACCOUNT_ALIAS_PROPERTY,
	DINO_ENTITIES_ACCOUNT_ENABLED_PROPERTY,
	DINO_ENTITIES_ACCOUNT_ROSTER_VERSION_PROPERTY,
	DINO_ENTITIES_ACCOUNT_NUM_PROPERTIES
};
static GParamSpec* dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_NUM_PROPERTIES];
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _qlite_database_unref0(var) ((var == NULL) ? NULL : (var = (qlite_database_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _qlite_statement_builder_unref0(var) ((var == NULL) ? NULL : (var = (qlite_statement_builder_unref (var), NULL)))

struct _DinoEntitiesAccountPrivate {
	gint _id;
	XmppJid* _full_jid;
	gchar* _password;
	gchar* _alias;
	gboolean _enabled;
	gchar* _roster_version;
	DinoDatabase* db;
};

static gint DinoEntitiesAccount_private_offset;
static gpointer dino_entities_account_parent_class = NULL;

static gchar* dino_entities_account_get_random_resource (void);
static void dino_entities_account_set_full_jid (DinoEntitiesAccount* self,
                                         XmppJid* value);
static void dino_entities_account_on_update (DinoEntitiesAccount* self,
                                      GObject* o,
                                      GParamSpec* sp);
static void _dino_entities_account_on_update_g_object_notify (GObject* _sender,
                                                       GParamSpec* pspec,
                                                       gpointer self);
static void dino_entities_account_set_resourcepart (DinoEntitiesAccount* self,
                                             const gchar* value);
static void dino_entities_account_finalize (GObject * obj);
static GType dino_entities_account_get_type_once (void);
static void _vala_dino_entities_account_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_dino_entities_account_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
dino_entities_account_get_instance_private (DinoEntitiesAccount* self)
{
	return G_STRUCT_MEMBER_P (self, DinoEntitiesAccount_private_offset);
}

DinoEntitiesAccount*
dino_entities_account_construct (GType object_type,
                                 XmppJid* bare_jid,
                                 const gchar* password)
{
	DinoEntitiesAccount * self = NULL;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (bare_jid != NULL, NULL);
	g_return_val_if_fail (password != NULL, NULL);
	self = (DinoEntitiesAccount*) g_object_new (object_type, NULL);
	dino_entities_account_set_id (self, -1);
	{
		XmppJid* _tmp0_ = NULL;
		gchar* _tmp1_;
		gchar* _tmp2_;
		XmppJid* _tmp3_;
		XmppJid* _tmp4_;
		_tmp1_ = dino_entities_account_get_random_resource ();
		_tmp2_ = _tmp1_;
		_tmp3_ = xmpp_jid_with_resource (bare_jid, _tmp2_, &_inner_error0_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		_tmp0_ = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_error;
			}
			g_critical ("file %s: line %d: unexpected 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_account_set_full_jid (self, _tmp0_);
		_xmpp_jid_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GError* e = NULL;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = e->message;
		g_error ("account.vala:32: Auto-generated resource was invalid (%s)", _tmp5_);
		_g_error_free0 (e);
	}
	__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;
	}
	dino_entities_account_set_password (self, password);
	return self;
}

DinoEntitiesAccount*
dino_entities_account_new (XmppJid* bare_jid,
                           const gchar* password)
{
	return dino_entities_account_construct (DINO_ENTITIES_TYPE_ACCOUNT, bare_jid, password);
}

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

static void
_dino_entities_account_on_update_g_object_notify (GObject* _sender,
                                                  GParamSpec* pspec,
                                                  gpointer self)
{
	dino_entities_account_on_update ((DinoEntitiesAccount*) self, _sender, pspec);
}

DinoEntitiesAccount*
dino_entities_account_construct_from_row (GType object_type,
                                          DinoDatabase* db,
                                          QliteRow* row,
                                          GError** error)
{
	DinoEntitiesAccount * self = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseAccountTable* _tmp1_;
	DinoDatabaseAccountTable* _tmp2_;
	QliteColumn* _tmp3_;
	gpointer _tmp4_;
	XmppJid* _tmp5_ = NULL;
	DinoDatabaseAccountTable* _tmp6_;
	DinoDatabaseAccountTable* _tmp7_;
	QliteColumn* _tmp8_;
	gpointer _tmp9_;
	gchar* _tmp10_;
	XmppJid* _tmp11_;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_ = NULL;
	DinoDatabaseAccountTable* _tmp14_;
	DinoDatabaseAccountTable* _tmp15_;
	QliteColumn* _tmp16_;
	gpointer _tmp17_;
	gchar* _tmp18_;
	XmppJid* _tmp19_;
	XmppJid* _tmp20_;
	DinoDatabaseAccountTable* _tmp21_;
	DinoDatabaseAccountTable* _tmp22_;
	QliteColumn* _tmp23_;
	gpointer _tmp24_;
	gchar* _tmp25_;
	DinoDatabaseAccountTable* _tmp26_;
	DinoDatabaseAccountTable* _tmp27_;
	QliteColumn* _tmp28_;
	gpointer _tmp29_;
	gchar* _tmp30_;
	DinoDatabaseAccountTable* _tmp31_;
	DinoDatabaseAccountTable* _tmp32_;
	QliteColumn* _tmp33_;
	gpointer _tmp34_;
	DinoDatabaseAccountTable* _tmp35_;
	DinoDatabaseAccountTable* _tmp36_;
	QliteColumn* _tmp37_;
	gpointer _tmp38_;
	gchar* _tmp39_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (db != NULL, NULL);
	g_return_val_if_fail (row != NULL, NULL);
	self = (DinoEntitiesAccount*) 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_account (db);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->id;
	_tmp4_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp3_);
	dino_entities_account_set_id (self, (gint) ((gintptr) _tmp4_));
	_tmp6_ = dino_database_get_account (db);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->bare_jid;
	_tmp9_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp8_);
	_tmp10_ = (gchar*) _tmp9_;
	_tmp11_ = xmpp_jid_new (_tmp10_, &_inner_error0_);
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp10_);
	_tmp5_ = _tmp12_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (self);
			return NULL;
		} else {
			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;
		}
	}
	_tmp14_ = dino_database_get_account (db);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_->resourcepart;
	_tmp17_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp16_);
	_tmp18_ = (gchar*) _tmp17_;
	_tmp19_ = xmpp_jid_with_resource (_tmp5_, _tmp18_, &_inner_error0_);
	_tmp20_ = _tmp19_;
	_g_free0 (_tmp18_);
	_tmp13_ = _tmp20_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_xmpp_jid_unref0 (_tmp5_);
			_g_object_unref0 (self);
			return NULL;
		} else {
			_xmpp_jid_unref0 (_tmp5_);
			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_account_set_full_jid (self, _tmp13_);
	_tmp21_ = dino_database_get_account (db);
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_->password;
	_tmp24_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp23_);
	_tmp25_ = (gchar*) _tmp24_;
	dino_entities_account_set_password (self, _tmp25_);
	_g_free0 (_tmp25_);
	_tmp26_ = dino_database_get_account (db);
	_tmp27_ = _tmp26_;
	_tmp28_ = _tmp27_->alias;
	_tmp29_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp28_);
	_tmp30_ = (gchar*) _tmp29_;
	dino_entities_account_set_alias (self, _tmp30_);
	_g_free0 (_tmp30_);
	_tmp31_ = dino_database_get_account (db);
	_tmp32_ = _tmp31_;
	_tmp33_ = _tmp32_->enabled;
	_tmp34_ = qlite_row_get (row, G_TYPE_BOOLEAN, NULL, NULL, _tmp33_);
	dino_entities_account_set_enabled (self, (gboolean) ((gintptr) _tmp34_));
	_tmp35_ = dino_database_get_account (db);
	_tmp36_ = _tmp35_;
	_tmp37_ = _tmp36_->roster_version;
	_tmp38_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp37_);
	_tmp39_ = (gchar*) _tmp38_;
	dino_entities_account_set_roster_version (self, _tmp39_);
	_g_free0 (_tmp39_);
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _dino_entities_account_on_update_g_object_notify, self, 0);
	_xmpp_jid_unref0 (_tmp13_);
	_xmpp_jid_unref0 (_tmp5_);
	return self;
}

DinoEntitiesAccount*
dino_entities_account_new_from_row (DinoDatabase* db,
                                    QliteRow* row,
                                    GError** error)
{
	return dino_entities_account_construct_from_row (DINO_ENTITIES_TYPE_ACCOUNT, db, row, error);
}

void
dino_entities_account_persist (DinoEntitiesAccount* self,
                               DinoDatabase* db)
{
	gint _tmp0_;
	DinoDatabase* _tmp1_;
	DinoDatabaseAccountTable* _tmp2_;
	DinoDatabaseAccountTable* _tmp3_;
	QliteInsertBuilder* _tmp4_;
	QliteInsertBuilder* _tmp5_;
	DinoDatabaseAccountTable* _tmp6_;
	DinoDatabaseAccountTable* _tmp7_;
	QliteColumn* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	QliteInsertBuilder* _tmp14_;
	QliteInsertBuilder* _tmp15_;
	DinoDatabaseAccountTable* _tmp16_;
	DinoDatabaseAccountTable* _tmp17_;
	QliteColumn* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	QliteInsertBuilder* _tmp21_;
	QliteInsertBuilder* _tmp22_;
	DinoDatabaseAccountTable* _tmp23_;
	DinoDatabaseAccountTable* _tmp24_;
	QliteColumn* _tmp25_;
	const gchar* _tmp26_;
	QliteInsertBuilder* _tmp27_;
	QliteInsertBuilder* _tmp28_;
	DinoDatabaseAccountTable* _tmp29_;
	DinoDatabaseAccountTable* _tmp30_;
	QliteColumn* _tmp31_;
	const gchar* _tmp32_;
	QliteInsertBuilder* _tmp33_;
	QliteInsertBuilder* _tmp34_;
	DinoDatabaseAccountTable* _tmp35_;
	DinoDatabaseAccountTable* _tmp36_;
	QliteColumn* _tmp37_;
	gboolean _tmp38_;
	QliteInsertBuilder* _tmp39_;
	QliteInsertBuilder* _tmp40_;
	DinoDatabaseAccountTable* _tmp41_;
	DinoDatabaseAccountTable* _tmp42_;
	QliteColumn* _tmp43_;
	const gchar* _tmp44_;
	QliteInsertBuilder* _tmp45_;
	QliteInsertBuilder* _tmp46_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (db != NULL);
	_tmp0_ = self->priv->_id;
	if (_tmp0_ > 0) {
		return;
	}
	_tmp1_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp1_;
	_tmp2_ = dino_database_get_account (db);
	_tmp3_ = _tmp2_;
	_tmp4_ = qlite_table_insert ((QliteTable*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = dino_database_get_account (db);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->bare_jid;
	_tmp9_ = dino_entities_account_get_bare_jid (self);
	_tmp10_ = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp12_ = xmpp_jid_to_string (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = qlite_insert_builder_value (_tmp5_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp8_, _tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = dino_database_get_account (db);
	_tmp17_ = _tmp16_;
	_tmp18_ = _tmp17_->resourcepart;
	_tmp19_ = dino_entities_account_get_resourcepart (self);
	_tmp20_ = _tmp19_;
	_tmp21_ = qlite_insert_builder_value (_tmp15_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp18_, _tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = dino_database_get_account (db);
	_tmp24_ = _tmp23_;
	_tmp25_ = _tmp24_->password;
	_tmp26_ = self->priv->_password;
	_tmp27_ = qlite_insert_builder_value (_tmp22_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp25_, _tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = dino_database_get_account (db);
	_tmp30_ = _tmp29_;
	_tmp31_ = _tmp30_->alias;
	_tmp32_ = self->priv->_alias;
	_tmp33_ = qlite_insert_builder_value (_tmp28_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp31_, _tmp32_);
	_tmp34_ = _tmp33_;
	_tmp35_ = dino_database_get_account (db);
	_tmp36_ = _tmp35_;
	_tmp37_ = _tmp36_->enabled;
	_tmp38_ = self->priv->_enabled;
	_tmp39_ = qlite_insert_builder_value (_tmp34_, G_TYPE_BOOLEAN, NULL, NULL, _tmp37_, (gpointer) ((gintptr) _tmp38_));
	_tmp40_ = _tmp39_;
	_tmp41_ = dino_database_get_account (db);
	_tmp42_ = _tmp41_;
	_tmp43_ = _tmp42_->roster_version;
	_tmp44_ = self->priv->_roster_version;
	_tmp45_ = qlite_insert_builder_value (_tmp40_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp43_, _tmp44_);
	_tmp46_ = _tmp45_;
	dino_entities_account_set_id (self, (gint) qlite_insert_builder_perform (_tmp46_));
	_qlite_statement_builder_unref0 (_tmp46_);
	_qlite_statement_builder_unref0 (_tmp40_);
	_qlite_statement_builder_unref0 (_tmp34_);
	_qlite_statement_builder_unref0 (_tmp28_);
	_qlite_statement_builder_unref0 (_tmp22_);
	_qlite_statement_builder_unref0 (_tmp15_);
	_g_free0 (_tmp13_);
	_xmpp_jid_unref0 (_tmp11_);
	_qlite_statement_builder_unref0 (_tmp5_);
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _dino_entities_account_on_update_g_object_notify, self, 0);
}

void
dino_entities_account_remove (DinoEntitiesAccount* self)
{
	DinoDatabase* _tmp0_;
	DinoDatabaseAccountTable* _tmp1_;
	DinoDatabaseAccountTable* _tmp2_;
	QliteDeleteBuilder* _tmp3_;
	QliteDeleteBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseAccountTable* _tmp6_;
	DinoDatabaseAccountTable* _tmp7_;
	QliteColumn* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	QliteDeleteBuilder* _tmp14_;
	QliteDeleteBuilder* _tmp15_;
	guint _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->db;
	_tmp1_ = dino_database_get_account (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_delete ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->db;
	_tmp6_ = dino_database_get_account (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->bare_jid;
	_tmp9_ = dino_entities_account_get_bare_jid (self);
	_tmp10_ = _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp12_ = xmpp_jid_to_string (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = qlite_delete_builder_with (_tmp4_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp8_, "=", _tmp13_);
	_tmp15_ = _tmp14_;
	qlite_delete_builder_perform (_tmp15_);
	_qlite_statement_builder_unref0 (_tmp15_);
	_g_free0 (_tmp13_);
	_xmpp_jid_unref0 (_tmp11_);
	_qlite_statement_builder_unref0 (_tmp4_);
	g_signal_parse_name ("notify", G_TYPE_OBJECT, &_tmp16_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((GObject*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp16_, 0, NULL, (GCallback) _dino_entities_account_on_update_g_object_notify, self);
	dino_entities_account_set_id (self, -1);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = NULL;
}

void
dino_entities_account_set_random_resource (DinoEntitiesAccount* self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dino_entities_account_get_random_resource ();
	_tmp1_ = _tmp0_;
	dino_entities_account_set_resourcepart (self, _tmp1_);
	_g_free0 (_tmp1_);
}

static gchar*
dino_entities_account_get_random_resource (void)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	_tmp0_ = g_strdup_printf ("%x", g_random_int ());
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strconcat ("dino.", _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

gboolean
dino_entities_account_equals (DinoEntitiesAccount* self,
                              DinoEntitiesAccount* acc)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (acc != NULL, FALSE);
	result = dino_entities_account_equals_func (self, acc);
	return result;
}

gboolean
dino_entities_account_equals_func (DinoEntitiesAccount* acc1,
                                   DinoEntitiesAccount* acc2)
{
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gboolean _tmp10_;
	gboolean result;
	g_return_val_if_fail (acc1 != NULL, FALSE);
	g_return_val_if_fail (acc2 != NULL, FALSE);
	_tmp0_ = dino_entities_account_get_bare_jid (acc1);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_jid_to_string (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = dino_entities_account_get_bare_jid (acc2);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = xmpp_jid_to_string (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strcmp0 (_tmp4_, _tmp9_) == 0;
	_g_free0 (_tmp9_);
	_xmpp_jid_unref0 (_tmp7_);
	_g_free0 (_tmp4_);
	_xmpp_jid_unref0 (_tmp2_);
	result = _tmp10_;
	return result;
}

guint
dino_entities_account_hash_func (DinoEntitiesAccount* acc)
{
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	guint _tmp5_;
	guint result;
	g_return_val_if_fail (acc != NULL, 0U);
	_tmp0_ = dino_entities_account_get_bare_jid (acc);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_jid_to_string (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_str_hash (_tmp4_);
	_g_free0 (_tmp4_);
	_xmpp_jid_unref0 (_tmp2_);
	result = _tmp5_;
	return result;
}

static void
dino_entities_account_on_update (DinoEntitiesAccount* self,
                                 GObject* o,
                                 GParamSpec* sp)
{
	QliteUpdateBuilder* update = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseAccountTable* _tmp1_;
	DinoDatabaseAccountTable* _tmp2_;
	QliteUpdateBuilder* _tmp3_;
	QliteUpdateBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseAccountTable* _tmp6_;
	DinoDatabaseAccountTable* _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;
	QliteUpdateBuilder* _tmp69_;
	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_account (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_update ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->db;
	_tmp6_ = dino_database_get_account (_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 ("bare-jid")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp16_;
				DinoDatabase* _tmp17_;
				DinoDatabaseAccountTable* _tmp18_;
				DinoDatabaseAccountTable* _tmp19_;
				QliteColumn* _tmp20_;
				XmppJid* _tmp21_;
				XmppJid* _tmp22_;
				XmppJid* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
				QliteUpdateBuilder* _tmp26_;
				QliteUpdateBuilder* _tmp27_;
				_tmp16_ = update;
				_tmp17_ = self->priv->db;
				_tmp18_ = dino_database_get_account (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = _tmp19_->bare_jid;
				_tmp21_ = dino_entities_account_get_bare_jid (self);
				_tmp22_ = _tmp21_;
				_tmp23_ = _tmp22_;
				_tmp24_ = xmpp_jid_to_string (_tmp23_);
				_tmp25_ = _tmp24_;
				_tmp26_ = qlite_update_builder_set (_tmp16_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp20_, _tmp25_);
				_tmp27_ = _tmp26_;
				_qlite_statement_builder_unref0 (_tmp27_);
				_g_free0 (_tmp25_);
				_xmpp_jid_unref0 (_tmp23_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label1) ? _tmp14_label1 : (_tmp14_label1 = g_quark_from_static_string ("resourcepart")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp28_;
				DinoDatabase* _tmp29_;
				DinoDatabaseAccountTable* _tmp30_;
				DinoDatabaseAccountTable* _tmp31_;
				QliteColumn* _tmp32_;
				const gchar* _tmp33_;
				const gchar* _tmp34_;
				QliteUpdateBuilder* _tmp35_;
				QliteUpdateBuilder* _tmp36_;
				_tmp28_ = update;
				_tmp29_ = self->priv->db;
				_tmp30_ = dino_database_get_account (_tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = _tmp31_->resourcepart;
				_tmp33_ = dino_entities_account_get_resourcepart (self);
				_tmp34_ = _tmp33_;
				_tmp35_ = qlite_update_builder_set (_tmp28_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp32_, _tmp34_);
				_tmp36_ = _tmp35_;
				_qlite_statement_builder_unref0 (_tmp36_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label2) ? _tmp14_label2 : (_tmp14_label2 = g_quark_from_static_string ("password")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp37_;
				DinoDatabase* _tmp38_;
				DinoDatabaseAccountTable* _tmp39_;
				DinoDatabaseAccountTable* _tmp40_;
				QliteColumn* _tmp41_;
				const gchar* _tmp42_;
				QliteUpdateBuilder* _tmp43_;
				QliteUpdateBuilder* _tmp44_;
				_tmp37_ = update;
				_tmp38_ = self->priv->db;
				_tmp39_ = dino_database_get_account (_tmp38_);
				_tmp40_ = _tmp39_;
				_tmp41_ = _tmp40_->password;
				_tmp42_ = self->priv->_password;
				_tmp43_ = qlite_update_builder_set (_tmp37_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp41_, _tmp42_);
				_tmp44_ = _tmp43_;
				_qlite_statement_builder_unref0 (_tmp44_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label3) ? _tmp14_label3 : (_tmp14_label3 = g_quark_from_static_string ("alias")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp45_;
				DinoDatabase* _tmp46_;
				DinoDatabaseAccountTable* _tmp47_;
				DinoDatabaseAccountTable* _tmp48_;
				QliteColumn* _tmp49_;
				const gchar* _tmp50_;
				QliteUpdateBuilder* _tmp51_;
				QliteUpdateBuilder* _tmp52_;
				_tmp45_ = update;
				_tmp46_ = self->priv->db;
				_tmp47_ = dino_database_get_account (_tmp46_);
				_tmp48_ = _tmp47_;
				_tmp49_ = _tmp48_->alias;
				_tmp50_ = self->priv->_alias;
				_tmp51_ = qlite_update_builder_set (_tmp45_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp49_, _tmp50_);
				_tmp52_ = _tmp51_;
				_qlite_statement_builder_unref0 (_tmp52_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label4) ? _tmp14_label4 : (_tmp14_label4 = g_quark_from_static_string ("enabled")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp53_;
				DinoDatabase* _tmp54_;
				DinoDatabaseAccountTable* _tmp55_;
				DinoDatabaseAccountTable* _tmp56_;
				QliteColumn* _tmp57_;
				gboolean _tmp58_;
				QliteUpdateBuilder* _tmp59_;
				QliteUpdateBuilder* _tmp60_;
				_tmp53_ = update;
				_tmp54_ = self->priv->db;
				_tmp55_ = dino_database_get_account (_tmp54_);
				_tmp56_ = _tmp55_;
				_tmp57_ = _tmp56_->enabled;
				_tmp58_ = self->priv->_enabled;
				_tmp59_ = qlite_update_builder_set (_tmp53_, G_TYPE_BOOLEAN, NULL, NULL, _tmp57_, (gpointer) ((gintptr) _tmp58_));
				_tmp60_ = _tmp59_;
				_qlite_statement_builder_unref0 (_tmp60_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label5) ? _tmp14_label5 : (_tmp14_label5 = g_quark_from_static_string ("roster-version")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp61_;
				DinoDatabase* _tmp62_;
				DinoDatabaseAccountTable* _tmp63_;
				DinoDatabaseAccountTable* _tmp64_;
				QliteColumn* _tmp65_;
				const gchar* _tmp66_;
				QliteUpdateBuilder* _tmp67_;
				QliteUpdateBuilder* _tmp68_;
				_tmp61_ = update;
				_tmp62_ = self->priv->db;
				_tmp63_ = dino_database_get_account (_tmp62_);
				_tmp64_ = _tmp63_;
				_tmp65_ = _tmp64_->roster_version;
				_tmp66_ = self->priv->_roster_version;
				_tmp67_ = qlite_update_builder_set (_tmp61_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp65_, _tmp66_);
				_tmp68_ = _tmp67_;
				_qlite_statement_builder_unref0 (_tmp68_);
				break;
			}
		}
	}
	_tmp69_ = update;
	qlite_update_builder_perform (_tmp69_);
	_qlite_statement_builder_unref0 (update);
}

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

void
dino_entities_account_set_id (DinoEntitiesAccount* self,
                              gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_account_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_ID_PROPERTY]);
	}
}

const gchar*
dino_entities_account_get_localpart (DinoEntitiesAccount* self)
{
	const gchar* result;
	XmppJid* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_full_jid;
	_tmp1_ = _tmp0_->localpart;
	result = _tmp1_;
	return result;
}

const gchar*
dino_entities_account_get_domainpart (DinoEntitiesAccount* self)
{
	const gchar* result;
	XmppJid* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_full_jid;
	_tmp1_ = _tmp0_->domainpart;
	result = _tmp1_;
	return result;
}

const gchar*
dino_entities_account_get_resourcepart (DinoEntitiesAccount* self)
{
	const gchar* result;
	XmppJid* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_full_jid;
	_tmp1_ = _tmp0_->resourcepart;
	result = _tmp1_;
	return result;
}

static void
dino_entities_account_set_resourcepart (DinoEntitiesAccount* self,
                                        const gchar* value)
{
	XmppJid* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_full_jid;
	_tmp1_ = g_strdup (value);
	_g_free0 (_tmp0_->resourcepart);
	_tmp0_->resourcepart = _tmp1_;
	g_object_notify_by_pspec ((GObject *) self, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_RESOURCEPART_PROPERTY]);
}

XmppJid*
dino_entities_account_get_bare_jid (DinoEntitiesAccount* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_full_jid;
	_tmp1_ = xmpp_jid_get_bare_jid (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

XmppJid*
dino_entities_account_get_full_jid (DinoEntitiesAccount* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_full_jid;
	result = _tmp0_;
	return result;
}

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

static void
dino_entities_account_set_full_jid (DinoEntitiesAccount* self,
                                    XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_account_get_full_jid (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_full_jid);
		self->priv->_full_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_FULL_JID_PROPERTY]);
	}
}

const gchar*
dino_entities_account_get_password (DinoEntitiesAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_password;
	result = _tmp0_;
	return result;
}

void
dino_entities_account_set_password (DinoEntitiesAccount* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_account_get_password (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_password);
		self->priv->_password = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_PASSWORD_PROPERTY]);
	}
}

gchar*
dino_entities_account_get_display_name (DinoEntitiesAccount* self)
{
	gchar* result;
	gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	gchar* _tmp12_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp2_ = self->priv->_alias;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		_tmp3_ = self->priv->_alias;
		_tmp4_ = strlen (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		const gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp6_ = self->priv->_alias;
		_tmp7_ = g_strdup (_tmp6_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp7_;
	} else {
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		XmppJid* _tmp10_;
		gchar* _tmp11_;
		_tmp8_ = dino_entities_account_get_bare_jid (self);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		_tmp11_ = xmpp_jid_to_string (_tmp10_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp11_;
		_xmpp_jid_unref0 (_tmp10_);
	}
	_tmp12_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp12_;
	_g_free0 (_tmp0_);
	return result;
}

const gchar*
dino_entities_account_get_alias (DinoEntitiesAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_alias;
	result = _tmp0_;
	return result;
}

void
dino_entities_account_set_alias (DinoEntitiesAccount* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_account_get_alias (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_alias);
		self->priv->_alias = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_ALIAS_PROPERTY]);
	}
}

gboolean
dino_entities_account_get_enabled (DinoEntitiesAccount* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_enabled;
	return result;
}

void
dino_entities_account_set_enabled (DinoEntitiesAccount* self,
                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_account_get_enabled (self);
	if (old_value != value) {
		self->priv->_enabled = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_ENABLED_PROPERTY]);
	}
}

const gchar*
dino_entities_account_get_roster_version (DinoEntitiesAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_roster_version;
	result = _tmp0_;
	return result;
}

void
dino_entities_account_set_roster_version (DinoEntitiesAccount* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_account_get_roster_version (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_roster_version);
		self->priv->_roster_version = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_ROSTER_VERSION_PROPERTY]);
	}
}

static void
dino_entities_account_class_init (DinoEntitiesAccountClass * klass,
                                  gpointer klass_data)
{
	dino_entities_account_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoEntitiesAccount_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_entities_account_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_entities_account_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_entities_account_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_ID_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_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_ACCOUNT_LOCALPART_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_LOCALPART_PROPERTY] = g_param_spec_string ("localpart", "localpart", "localpart", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_DOMAINPART_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_DOMAINPART_PROPERTY] = g_param_spec_string ("domainpart", "domainpart", "domainpart", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_RESOURCEPART_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_RESOURCEPART_PROPERTY] = g_param_spec_string ("resourcepart", "resourcepart", "resourcepart", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_BARE_JID_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_BARE_JID_PROPERTY] = xmpp_param_spec_jid ("bare-jid", "bare-jid", "bare-jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_FULL_JID_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_FULL_JID_PROPERTY] = xmpp_param_spec_jid ("full-jid", "full-jid", "full-jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_PASSWORD_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_PASSWORD_PROPERTY] = g_param_spec_string ("password", "password", "password", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_DISPLAY_NAME_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_ALIAS_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_ALIAS_PROPERTY] = g_param_spec_string ("alias", "alias", "alias", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_ENABLED_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_ENABLED_PROPERTY] = g_param_spec_boolean ("enabled", "enabled", "enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_ACCOUNT_ROSTER_VERSION_PROPERTY, dino_entities_account_properties[DINO_ENTITIES_ACCOUNT_ROSTER_VERSION_PROPERTY] = g_param_spec_string ("roster-version", "roster-version", "roster-version", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_entities_account_instance_init (DinoEntitiesAccount * self,
                                     gpointer klass)
{
	self->priv = dino_entities_account_get_instance_private (self);
	self->priv->_enabled = FALSE;
}

static void
dino_entities_account_finalize (GObject * obj)
{
	DinoEntitiesAccount * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_ENTITIES_TYPE_ACCOUNT, DinoEntitiesAccount);
	_xmpp_jid_unref0 (self->priv->_full_jid);
	_g_free0 (self->priv->_password);
	_g_free0 (self->priv->_alias);
	_g_free0 (self->priv->_roster_version);
	_qlite_database_unref0 (self->priv->db);
	G_OBJECT_CLASS (dino_entities_account_parent_class)->finalize (obj);
}

static GType
dino_entities_account_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoEntitiesAccountClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_entities_account_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoEntitiesAccount), 0, (GInstanceInitFunc) dino_entities_account_instance_init, NULL };
	GType dino_entities_account_type_id;
	dino_entities_account_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoEntitiesAccount", &g_define_type_info, 0);
	DinoEntitiesAccount_private_offset = g_type_add_instance_private (dino_entities_account_type_id, sizeof (DinoEntitiesAccountPrivate));
	return dino_entities_account_type_id;
}

GType
dino_entities_account_get_type (void)
{
	static volatile gsize dino_entities_account_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_account_type_id__once)) {
		GType dino_entities_account_type_id;
		dino_entities_account_type_id = dino_entities_account_get_type_once ();
		g_once_init_leave (&dino_entities_account_type_id__once, dino_entities_account_type_id);
	}
	return dino_entities_account_type_id__once;
}

static void
_vala_dino_entities_account_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	DinoEntitiesAccount * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_ENTITIES_TYPE_ACCOUNT, DinoEntitiesAccount);
	switch (property_id) {
		case DINO_ENTITIES_ACCOUNT_ID_PROPERTY:
		g_value_set_int (value, dino_entities_account_get_id (self));
		break;
		case DINO_ENTITIES_ACCOUNT_LOCALPART_PROPERTY:
		g_value_set_string (value, dino_entities_account_get_localpart (self));
		break;
		case DINO_ENTITIES_ACCOUNT_DOMAINPART_PROPERTY:
		g_value_set_string (value, dino_entities_account_get_domainpart (self));
		break;
		case DINO_ENTITIES_ACCOUNT_RESOURCEPART_PROPERTY:
		g_value_set_string (value, dino_entities_account_get_resourcepart (self));
		break;
		case DINO_ENTITIES_ACCOUNT_BARE_JID_PROPERTY:
		xmpp_value_take_jid (value, dino_entities_account_get_bare_jid (self));
		break;
		case DINO_ENTITIES_ACCOUNT_FULL_JID_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_account_get_full_jid (self));
		break;
		case DINO_ENTITIES_ACCOUNT_PASSWORD_PROPERTY:
		g_value_set_string (value, dino_entities_account_get_password (self));
		break;
		case DINO_ENTITIES_ACCOUNT_DISPLAY_NAME_PROPERTY:
		g_value_take_string (value, dino_entities_account_get_display_name (self));
		break;
		case DINO_ENTITIES_ACCOUNT_ALIAS_PROPERTY:
		g_value_set_string (value, dino_entities_account_get_alias (self));
		break;
		case DINO_ENTITIES_ACCOUNT_ENABLED_PROPERTY:
		g_value_set_boolean (value, dino_entities_account_get_enabled (self));
		break;
		case DINO_ENTITIES_ACCOUNT_ROSTER_VERSION_PROPERTY:
		g_value_set_string (value, dino_entities_account_get_roster_version (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_entities_account_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	DinoEntitiesAccount * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_ENTITIES_TYPE_ACCOUNT, DinoEntitiesAccount);
	switch (property_id) {
		case DINO_ENTITIES_ACCOUNT_ID_PROPERTY:
		dino_entities_account_set_id (self, g_value_get_int (value));
		break;
		case DINO_ENTITIES_ACCOUNT_RESOURCEPART_PROPERTY:
		dino_entities_account_set_resourcepart (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_ACCOUNT_FULL_JID_PROPERTY:
		dino_entities_account_set_full_jid (self, xmpp_value_get_jid (value));
		break;
		case DINO_ENTITIES_ACCOUNT_PASSWORD_PROPERTY:
		dino_entities_account_set_password (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_ACCOUNT_ALIAS_PROPERTY:
		dino_entities_account_set_alias (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_ACCOUNT_ENABLED_PROPERTY:
		dino_entities_account_set_enabled (self, g_value_get_boolean (value));
		break;
		case DINO_ENTITIES_ACCOUNT_ROSTER_VERSION_PROPERTY:
		dino_entities_account_set_roster_version (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

