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

#include "libdino.h"
#include <glib.h>
#include "xmpp-vala.h"
#include <gee.h>
#include <glib-object.h>
#include "qlite.h"
#include <stdlib.h>
#include <string.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_CALL_0_PROPERTY,
	DINO_ENTITIES_CALL_ID_PROPERTY,
	DINO_ENTITIES_CALL_ACCOUNT_PROPERTY,
	DINO_ENTITIES_CALL_COUNTERPART_PROPERTY,
	DINO_ENTITIES_CALL_OURPART_PROPERTY,
	DINO_ENTITIES_CALL_PROPOSER_PROPERTY,
	DINO_ENTITIES_CALL_DIRECTION_PROPERTY,
	DINO_ENTITIES_CALL_TIME_PROPERTY,
	DINO_ENTITIES_CALL_LOCAL_TIME_PROPERTY,
	DINO_ENTITIES_CALL_END_TIME_PROPERTY,
	DINO_ENTITIES_CALL_ENCRYPTION_PROPERTY,
	DINO_ENTITIES_CALL_STATE_PROPERTY,
	DINO_ENTITIES_CALL_NUM_PROPERTIES
};
static GParamSpec* dino_entities_call_properties[DINO_ENTITIES_CALL_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_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 _g_free0(var) (var = (g_free (var), NULL))
#define _qlite_statement_builder_unref0(var) ((var == NULL) ? NULL : (var = (qlite_statement_builder_unref (var), NULL)))
#define _qlite_row_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_unref (var), NULL)))
#define _qlite_row_iterator_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_iterator_unref (var), NULL)))

struct _DinoEntitiesCallPrivate {
	gint _id;
	DinoEntitiesAccount* _account;
	XmppJid* _counterpart;
	XmppJid* _ourpart;
	gboolean _direction;
	GDateTime* _time;
	GDateTime* _local_time;
	GDateTime* _end_time;
	DinoEntitiesEncryption _encryption;
	DinoEntitiesCallState _state;
	DinoDatabase* db;
};

static gint DinoEntitiesCall_private_offset;
static gpointer dino_entities_call_parent_class = NULL;

static gboolean _xmpp_jid_equals_bare_func_gee_equal_data_func (gconstpointer a,
                                                         gconstpointer b,
                                                         gpointer self);
static void dino_entities_call_on_update (DinoEntitiesCall* self,
                                   GObject* o,
                                   GParamSpec* sp);
static void _dino_entities_call_on_update_g_object_notify (GObject* _sender,
                                                    GParamSpec* pspec,
                                                    gpointer self);
static void dino_entities_call_finalize (GObject * obj);
static GType dino_entities_call_get_type_once (void);
static void _vala_dino_entities_call_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_dino_entities_call_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);

static inline gpointer
dino_entities_call_get_instance_private (DinoEntitiesCall* self)
{
	return G_STRUCT_MEMBER_P (self, DinoEntitiesCall_private_offset);
}

static GType
dino_entities_call_state_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_ENTITIES_CALL_STATE_RINGING, "DINO_ENTITIES_CALL_STATE_RINGING", "ringing"}, {DINO_ENTITIES_CALL_STATE_ESTABLISHING, "DINO_ENTITIES_CALL_STATE_ESTABLISHING", "establishing"}, {DINO_ENTITIES_CALL_STATE_IN_PROGRESS, "DINO_ENTITIES_CALL_STATE_IN_PROGRESS", "in-progress"}, {DINO_ENTITIES_CALL_STATE_OTHER_DEVICE, "DINO_ENTITIES_CALL_STATE_OTHER_DEVICE", "other-device"}, {DINO_ENTITIES_CALL_STATE_ENDED, "DINO_ENTITIES_CALL_STATE_ENDED", "ended"}, {DINO_ENTITIES_CALL_STATE_DECLINED, "DINO_ENTITIES_CALL_STATE_DECLINED", "declined"}, {DINO_ENTITIES_CALL_STATE_MISSED, "DINO_ENTITIES_CALL_STATE_MISSED", "missed"}, {DINO_ENTITIES_CALL_STATE_FAILED, "DINO_ENTITIES_CALL_STATE_FAILED", "failed"}, {0, NULL, NULL}};
	GType dino_entities_call_state_type_id;
	dino_entities_call_state_type_id = g_enum_register_static ("DinoEntitiesCallState", values);
	return dino_entities_call_state_type_id;
}

GType
dino_entities_call_state_get_type (void)
{
	static volatile gsize dino_entities_call_state_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_call_state_type_id__once)) {
		GType dino_entities_call_state_type_id;
		dino_entities_call_state_type_id = dino_entities_call_state_get_type_once ();
		g_once_init_leave (&dino_entities_call_state_type_id__once, dino_entities_call_state_type_id);
	}
	return dino_entities_call_state_type_id__once;
}

static gboolean
_xmpp_jid_equals_bare_func_gee_equal_data_func (gconstpointer a,
                                                gconstpointer b,
                                                gpointer self)
{
	gboolean result;
	result = xmpp_jid_equals_bare_func ((XmppJid*) a, (XmppJid*) b);
	return result;
}

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

static void
_dino_entities_call_on_update_g_object_notify (GObject* _sender,
                                               GParamSpec* pspec,
                                               gpointer self)
{
	dino_entities_call_on_update ((DinoEntitiesCall*) self, _sender, pspec);
}

DinoEntitiesCall*
dino_entities_call_construct_from_row (GType object_type,
                                       DinoDatabase* db,
                                       QliteRow* row,
                                       GError** error)
{
	DinoEntitiesCall * self = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseCallTable* _tmp1_;
	DinoDatabaseCallTable* _tmp2_;
	QliteColumn* _tmp3_;
	gpointer _tmp4_;
	DinoDatabaseCallTable* _tmp5_;
	DinoDatabaseCallTable* _tmp6_;
	QliteColumn* _tmp7_;
	gpointer _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	DinoEntitiesAccount* _tmp10_;
	gchar* our_resource = NULL;
	DinoDatabaseCallTable* _tmp11_;
	DinoDatabaseCallTable* _tmp12_;
	QliteColumn* _tmp13_;
	gpointer _tmp14_;
	const gchar* _tmp15_;
	DinoDatabaseCallTable* _tmp28_;
	DinoDatabaseCallTable* _tmp29_;
	QliteColumn* _tmp30_;
	gpointer _tmp31_;
	DinoDatabaseCallTable* _tmp32_;
	DinoDatabaseCallTable* _tmp33_;
	QliteColumn* _tmp34_;
	gpointer _tmp35_;
	GDateTime* _tmp36_;
	GDateTime* _tmp37_;
	DinoDatabaseCallTable* _tmp38_;
	DinoDatabaseCallTable* _tmp39_;
	QliteColumn* _tmp40_;
	gpointer _tmp41_;
	GDateTime* _tmp42_;
	GDateTime* _tmp43_;
	DinoDatabaseCallTable* _tmp44_;
	DinoDatabaseCallTable* _tmp45_;
	QliteColumn* _tmp46_;
	gpointer _tmp47_;
	GDateTime* _tmp48_;
	GDateTime* _tmp49_;
	DinoDatabaseCallTable* _tmp50_;
	DinoDatabaseCallTable* _tmp51_;
	QliteColumn* _tmp52_;
	gpointer _tmp53_;
	DinoDatabaseCallTable* _tmp54_;
	DinoDatabaseCallTable* _tmp55_;
	QliteColumn* _tmp56_;
	gpointer _tmp57_;
	QliteQueryBuilder* counterparts_select = NULL;
	DinoDatabaseCallCounterpartTable* _tmp58_;
	DinoDatabaseCallCounterpartTable* _tmp59_;
	QliteQueryBuilder* _tmp60_;
	QliteQueryBuilder* _tmp61_;
	DinoDatabaseCallCounterpartTable* _tmp62_;
	DinoDatabaseCallCounterpartTable* _tmp63_;
	QliteColumn* _tmp64_;
	gint _tmp65_;
	QliteQueryBuilder* _tmp66_;
	QliteQueryBuilder* _tmp67_;
	XmppJid* _tmp83_ = NULL;
	DinoDatabaseCallTable* _tmp84_;
	DinoDatabaseCallTable* _tmp85_;
	QliteColumn* _tmp86_;
	gpointer _tmp87_;
	XmppJid* _tmp88_;
	gchar* counterpart_resource = NULL;
	DinoDatabaseCallTable* _tmp89_;
	DinoDatabaseCallTable* _tmp90_;
	QliteColumn* _tmp91_;
	gpointer _tmp92_;
	const gchar* _tmp93_;
	GeeList* _tmp98_;
	gboolean _tmp99_;
	gboolean _tmp100_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (db != NULL, NULL);
	g_return_val_if_fail (row != NULL, NULL);
	self = (DinoEntitiesCall*) 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_call (db);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->id;
	_tmp4_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp3_);
	dino_entities_call_set_id (self, (gint) ((gintptr) _tmp4_));
	_tmp5_ = dino_database_get_call (db);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_->account_id;
	_tmp8_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp7_);
	_tmp9_ = dino_database_get_account_by_id (db, (gint) ((gintptr) _tmp8_));
	_tmp10_ = _tmp9_;
	dino_entities_call_set_account (self, _tmp10_);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = dino_database_get_call (db);
	_tmp12_ = _tmp11_;
	_tmp13_ = _tmp12_->our_resource;
	_tmp14_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp13_);
	our_resource = (gchar*) _tmp14_;
	_tmp15_ = our_resource;
	if (_tmp15_ != NULL) {
		XmppJid* _tmp16_ = NULL;
		DinoEntitiesAccount* _tmp17_;
		XmppJid* _tmp18_;
		XmppJid* _tmp19_;
		XmppJid* _tmp20_;
		const gchar* _tmp21_;
		XmppJid* _tmp22_;
		XmppJid* _tmp23_;
		_tmp17_ = self->priv->_account;
		_tmp18_ = dino_entities_account_get_bare_jid (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = _tmp19_;
		_tmp21_ = our_resource;
		_tmp22_ = xmpp_jid_with_resource (_tmp20_, _tmp21_, &_inner_error0_);
		_tmp23_ = _tmp22_;
		_xmpp_jid_unref0 (_tmp20_);
		_tmp16_ = _tmp23_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (our_resource);
				_g_object_unref0 (self);
				return NULL;
			} else {
				_g_free0 (our_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_call_set_ourpart (self, _tmp16_);
		_xmpp_jid_unref0 (_tmp16_);
	} else {
		DinoEntitiesAccount* _tmp24_;
		XmppJid* _tmp25_;
		XmppJid* _tmp26_;
		XmppJid* _tmp27_;
		_tmp24_ = self->priv->_account;
		_tmp25_ = dino_entities_account_get_bare_jid (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = _tmp26_;
		dino_entities_call_set_ourpart (self, _tmp27_);
		_xmpp_jid_unref0 (_tmp27_);
	}
	_tmp28_ = dino_database_get_call (db);
	_tmp29_ = _tmp28_;
	_tmp30_ = _tmp29_->direction;
	_tmp31_ = qlite_row_get (row, G_TYPE_BOOLEAN, NULL, NULL, _tmp30_);
	dino_entities_call_set_direction (self, (gboolean) ((gintptr) _tmp31_));
	_tmp32_ = dino_database_get_call (db);
	_tmp33_ = _tmp32_;
	_tmp34_ = _tmp33_->time;
	_tmp35_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp34_);
	_tmp36_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp35_)));
	_tmp37_ = _tmp36_;
	dino_entities_call_set_time (self, _tmp37_);
	_g_date_time_unref0 (_tmp37_);
	_tmp38_ = dino_database_get_call (db);
	_tmp39_ = _tmp38_;
	_tmp40_ = _tmp39_->local_time;
	_tmp41_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp40_);
	_tmp42_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp41_)));
	_tmp43_ = _tmp42_;
	dino_entities_call_set_local_time (self, _tmp43_);
	_g_date_time_unref0 (_tmp43_);
	_tmp44_ = dino_database_get_call (db);
	_tmp45_ = _tmp44_;
	_tmp46_ = _tmp45_->end_time;
	_tmp47_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp46_);
	_tmp48_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp47_)));
	_tmp49_ = _tmp48_;
	dino_entities_call_set_end_time (self, _tmp49_);
	_g_date_time_unref0 (_tmp49_);
	_tmp50_ = dino_database_get_call (db);
	_tmp51_ = _tmp50_;
	_tmp52_ = _tmp51_->encryption;
	_tmp53_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp52_);
	dino_entities_call_set_encryption (self, (DinoEntitiesEncryption) ((gint) ((gintptr) _tmp53_)));
	_tmp54_ = dino_database_get_call (db);
	_tmp55_ = _tmp54_;
	_tmp56_ = _tmp55_->state;
	_tmp57_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp56_);
	dino_entities_call_set_state (self, (DinoEntitiesCallState) ((gint) ((gintptr) _tmp57_)));
	_tmp58_ = dino_database_get_call_counterpart (db);
	_tmp59_ = _tmp58_;
	_tmp60_ = qlite_table_select ((QliteTable*) _tmp59_, NULL, (gint) 0);
	_tmp61_ = _tmp60_;
	_tmp62_ = dino_database_get_call_counterpart (db);
	_tmp63_ = _tmp62_;
	_tmp64_ = _tmp63_->call_id;
	_tmp65_ = self->priv->_id;
	_tmp66_ = qlite_query_builder_with (_tmp61_, G_TYPE_INT, NULL, NULL, _tmp64_, "=", (gpointer) ((gintptr) _tmp65_));
	_tmp67_ = _tmp66_;
	_qlite_statement_builder_unref0 (_tmp61_);
	counterparts_select = _tmp67_;
	{
		QliteRowIterator* _counterparts_row_it = NULL;
		QliteQueryBuilder* _tmp68_;
		QliteRowIterator* _tmp69_;
		_tmp68_ = counterparts_select;
		_tmp69_ = qlite_query_builder_iterator (_tmp68_);
		_counterparts_row_it = _tmp69_;
		while (TRUE) {
			QliteRowIterator* _tmp70_;
			QliteRow* counterparts_row = NULL;
			QliteRowIterator* _tmp71_;
			QliteRow* _tmp72_;
			XmppJid* peer = NULL;
			QliteRow* _tmp73_;
			DinoDatabaseCallCounterpartTable* _tmp74_;
			DinoDatabaseCallCounterpartTable* _tmp75_;
			QliteColumn* _tmp76_;
			gpointer _tmp77_;
			XmppJid* _tmp78_;
			GeeList* _tmp79_;
			XmppJid* _tmp80_;
			_tmp70_ = _counterparts_row_it;
			if (!qlite_row_iterator_next (_tmp70_)) {
				break;
			}
			_tmp71_ = _counterparts_row_it;
			_tmp72_ = qlite_row_iterator_get (_tmp71_);
			counterparts_row = _tmp72_;
			_tmp73_ = counterparts_row;
			_tmp74_ = dino_database_get_call_counterpart (db);
			_tmp75_ = _tmp74_;
			_tmp76_ = _tmp75_->jid_id;
			_tmp77_ = qlite_row_get (_tmp73_, G_TYPE_INT, NULL, NULL, _tmp76_);
			_tmp78_ = dino_database_get_jid_by_id (db, (gint) ((gintptr) _tmp77_), &_inner_error0_);
			peer = _tmp78_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_qlite_row_unref0 (counterparts_row);
					_qlite_row_iterator_unref0 (_counterparts_row_it);
					_qlite_statement_builder_unref0 (counterparts_select);
					_g_free0 (our_resource);
					_g_object_unref0 (self);
					return NULL;
				} else {
					_qlite_row_unref0 (counterparts_row);
					_qlite_row_iterator_unref0 (_counterparts_row_it);
					_qlite_statement_builder_unref0 (counterparts_select);
					_g_free0 (our_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;
				}
			}
			_tmp79_ = self->counterparts;
			_tmp80_ = peer;
			if (!gee_collection_contains ((GeeCollection*) _tmp79_, _tmp80_)) {
				GeeList* _tmp81_;
				XmppJid* _tmp82_;
				_tmp81_ = self->counterparts;
				_tmp82_ = peer;
				gee_collection_add ((GeeCollection*) _tmp81_, _tmp82_);
			}
			_xmpp_jid_unref0 (peer);
			_qlite_row_unref0 (counterparts_row);
		}
		_qlite_row_iterator_unref0 (_counterparts_row_it);
	}
	_tmp84_ = dino_database_get_call (db);
	_tmp85_ = _tmp84_;
	_tmp86_ = _tmp85_->counterpart_id;
	_tmp87_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp86_);
	_tmp88_ = dino_database_get_jid_by_id (db, (gint) ((gintptr) _tmp87_), &_inner_error0_);
	_tmp83_ = _tmp88_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_qlite_statement_builder_unref0 (counterparts_select);
			_g_free0 (our_resource);
			_g_object_unref0 (self);
			return NULL;
		} else {
			_qlite_statement_builder_unref0 (counterparts_select);
			_g_free0 (our_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_call_set_counterpart (self, _tmp83_);
	_tmp89_ = dino_database_get_call (db);
	_tmp90_ = _tmp89_;
	_tmp91_ = _tmp90_->counterpart_resource;
	_tmp92_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp91_);
	counterpart_resource = (gchar*) _tmp92_;
	_tmp93_ = counterpart_resource;
	if (_tmp93_ != NULL) {
		XmppJid* _tmp94_ = NULL;
		XmppJid* _tmp95_;
		const gchar* _tmp96_;
		XmppJid* _tmp97_;
		_tmp95_ = self->priv->_counterpart;
		_tmp96_ = counterpart_resource;
		_tmp97_ = xmpp_jid_with_resource (_tmp95_, _tmp96_, &_inner_error0_);
		_tmp94_ = _tmp97_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (counterpart_resource);
				_xmpp_jid_unref0 (_tmp83_);
				_qlite_statement_builder_unref0 (counterparts_select);
				_g_free0 (our_resource);
				_g_object_unref0 (self);
				return NULL;
			} else {
				_g_free0 (counterpart_resource);
				_xmpp_jid_unref0 (_tmp83_);
				_qlite_statement_builder_unref0 (counterparts_select);
				_g_free0 (our_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_call_set_counterpart (self, _tmp94_);
		_xmpp_jid_unref0 (_tmp94_);
	}
	_tmp98_ = self->counterparts;
	_tmp99_ = gee_collection_get_is_empty ((GeeCollection*) _tmp98_);
	_tmp100_ = _tmp99_;
	if (_tmp100_) {
		GeeList* _tmp101_;
		XmppJid* _tmp102_;
		_tmp101_ = self->counterparts;
		_tmp102_ = self->priv->_counterpart;
		gee_collection_add ((GeeCollection*) _tmp101_, _tmp102_);
	}
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _dino_entities_call_on_update_g_object_notify, self, 0);
	_g_free0 (counterpart_resource);
	_xmpp_jid_unref0 (_tmp83_);
	_qlite_statement_builder_unref0 (counterparts_select);
	_g_free0 (our_resource);
	return self;
}

DinoEntitiesCall*
dino_entities_call_new_from_row (DinoDatabase* db,
                                 QliteRow* row,
                                 GError** error)
{
	return dino_entities_call_construct_from_row (DINO_ENTITIES_TYPE_CALL, db, row, error);
}

void
dino_entities_call_persist (DinoEntitiesCall* self,
                            DinoDatabase* db)
{
	gint _tmp0_;
	DinoDatabase* _tmp1_;
	QliteInsertBuilder* builder = NULL;
	DinoDatabaseCallTable* _tmp2_;
	DinoDatabaseCallTable* _tmp3_;
	QliteInsertBuilder* _tmp4_;
	QliteInsertBuilder* _tmp5_;
	DinoDatabaseCallTable* _tmp6_;
	DinoDatabaseCallTable* _tmp7_;
	QliteColumn* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	QliteInsertBuilder* _tmp12_;
	QliteInsertBuilder* _tmp13_;
	DinoDatabaseCallTable* _tmp14_;
	DinoDatabaseCallTable* _tmp15_;
	QliteColumn* _tmp16_;
	XmppJid* _tmp17_;
	const gchar* _tmp18_;
	QliteInsertBuilder* _tmp19_;
	QliteInsertBuilder* _tmp20_;
	DinoDatabaseCallTable* _tmp21_;
	DinoDatabaseCallTable* _tmp22_;
	QliteColumn* _tmp23_;
	gboolean _tmp24_;
	QliteInsertBuilder* _tmp25_;
	QliteInsertBuilder* _tmp26_;
	DinoDatabaseCallTable* _tmp27_;
	DinoDatabaseCallTable* _tmp28_;
	QliteColumn* _tmp29_;
	GDateTime* _tmp30_;
	QliteInsertBuilder* _tmp31_;
	QliteInsertBuilder* _tmp32_;
	DinoDatabaseCallTable* _tmp33_;
	DinoDatabaseCallTable* _tmp34_;
	QliteColumn* _tmp35_;
	GDateTime* _tmp36_;
	QliteInsertBuilder* _tmp37_;
	QliteInsertBuilder* _tmp38_;
	DinoDatabaseCallTable* _tmp39_;
	DinoDatabaseCallTable* _tmp40_;
	QliteColumn* _tmp41_;
	DinoEntitiesEncryption _tmp42_;
	QliteInsertBuilder* _tmp43_;
	QliteInsertBuilder* _tmp44_;
	DinoDatabaseCallTable* _tmp45_;
	DinoDatabaseCallTable* _tmp46_;
	QliteColumn* _tmp47_;
	QliteInsertBuilder* _tmp48_;
	QliteInsertBuilder* _tmp49_;
	GDateTime* _tmp50_;
	XmppJid* _tmp65_;
	QliteInsertBuilder* _tmp80_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (db != NULL);
	_tmp0_ = self->priv->_id;
	if (_tmp0_ != -1) {
		return;
	}
	_tmp1_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp1_;
	_tmp2_ = dino_database_get_call (db);
	_tmp3_ = _tmp2_;
	_tmp4_ = qlite_table_insert ((QliteTable*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = dino_database_get_call (db);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->account_id;
	_tmp9_ = self->priv->_account;
	_tmp10_ = dino_entities_account_get_id (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = qlite_insert_builder_value (_tmp5_, G_TYPE_INT, NULL, NULL, _tmp8_, (gpointer) ((gintptr) _tmp11_));
	_tmp13_ = _tmp12_;
	_tmp14_ = dino_database_get_call (db);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_->our_resource;
	_tmp17_ = self->priv->_ourpart;
	_tmp18_ = _tmp17_->resourcepart;
	_tmp19_ = qlite_insert_builder_value (_tmp13_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp16_, _tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = dino_database_get_call (db);
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_->direction;
	_tmp24_ = self->priv->_direction;
	_tmp25_ = qlite_insert_builder_value (_tmp20_, G_TYPE_BOOLEAN, NULL, NULL, _tmp23_, (gpointer) ((gintptr) _tmp24_));
	_tmp26_ = _tmp25_;
	_tmp27_ = dino_database_get_call (db);
	_tmp28_ = _tmp27_;
	_tmp29_ = _tmp28_->time;
	_tmp30_ = self->priv->_time;
	_tmp31_ = qlite_insert_builder_value (_tmp26_, G_TYPE_LONG, NULL, NULL, _tmp29_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp30_)));
	_tmp32_ = _tmp31_;
	_tmp33_ = dino_database_get_call (db);
	_tmp34_ = _tmp33_;
	_tmp35_ = _tmp34_->local_time;
	_tmp36_ = self->priv->_local_time;
	_tmp37_ = qlite_insert_builder_value (_tmp32_, G_TYPE_LONG, NULL, NULL, _tmp35_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp36_)));
	_tmp38_ = _tmp37_;
	_tmp39_ = dino_database_get_call (db);
	_tmp40_ = _tmp39_;
	_tmp41_ = _tmp40_->encryption;
	_tmp42_ = self->priv->_encryption;
	_tmp43_ = qlite_insert_builder_value (_tmp38_, G_TYPE_INT, NULL, NULL, _tmp41_, (gpointer) ((gintptr) _tmp42_));
	_tmp44_ = _tmp43_;
	_tmp45_ = dino_database_get_call (db);
	_tmp46_ = _tmp45_;
	_tmp47_ = _tmp46_->state;
	_tmp48_ = qlite_insert_builder_value (_tmp44_, G_TYPE_INT, NULL, NULL, _tmp47_, (gpointer) ((gintptr) DINO_ENTITIES_CALL_STATE_ENDED));
	_tmp49_ = _tmp48_;
	_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 (_tmp13_);
	_qlite_statement_builder_unref0 (_tmp5_);
	builder = _tmp49_;
	_tmp50_ = self->priv->_end_time;
	if (_tmp50_ != NULL) {
		QliteInsertBuilder* _tmp51_;
		DinoDatabaseCallTable* _tmp52_;
		DinoDatabaseCallTable* _tmp53_;
		QliteColumn* _tmp54_;
		GDateTime* _tmp55_;
		QliteInsertBuilder* _tmp56_;
		QliteInsertBuilder* _tmp57_;
		_tmp51_ = builder;
		_tmp52_ = dino_database_get_call (db);
		_tmp53_ = _tmp52_;
		_tmp54_ = _tmp53_->end_time;
		_tmp55_ = self->priv->_end_time;
		_tmp56_ = qlite_insert_builder_value (_tmp51_, G_TYPE_LONG, NULL, NULL, _tmp54_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp55_)));
		_tmp57_ = _tmp56_;
		_qlite_statement_builder_unref0 (_tmp57_);
	} else {
		QliteInsertBuilder* _tmp58_;
		DinoDatabaseCallTable* _tmp59_;
		DinoDatabaseCallTable* _tmp60_;
		QliteColumn* _tmp61_;
		GDateTime* _tmp62_;
		QliteInsertBuilder* _tmp63_;
		QliteInsertBuilder* _tmp64_;
		_tmp58_ = builder;
		_tmp59_ = dino_database_get_call (db);
		_tmp60_ = _tmp59_;
		_tmp61_ = _tmp60_->end_time;
		_tmp62_ = self->priv->_local_time;
		_tmp63_ = qlite_insert_builder_value (_tmp58_, G_TYPE_LONG, NULL, NULL, _tmp61_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp62_)));
		_tmp64_ = _tmp63_;
		_qlite_statement_builder_unref0 (_tmp64_);
	}
	_tmp65_ = self->priv->_counterpart;
	if (_tmp65_ != NULL) {
		QliteInsertBuilder* _tmp66_;
		DinoDatabaseCallTable* _tmp67_;
		DinoDatabaseCallTable* _tmp68_;
		QliteColumn* _tmp69_;
		XmppJid* _tmp70_;
		QliteInsertBuilder* _tmp71_;
		QliteInsertBuilder* _tmp72_;
		DinoDatabaseCallTable* _tmp73_;
		DinoDatabaseCallTable* _tmp74_;
		QliteColumn* _tmp75_;
		XmppJid* _tmp76_;
		const gchar* _tmp77_;
		QliteInsertBuilder* _tmp78_;
		QliteInsertBuilder* _tmp79_;
		_tmp66_ = builder;
		_tmp67_ = dino_database_get_call (db);
		_tmp68_ = _tmp67_;
		_tmp69_ = _tmp68_->counterpart_id;
		_tmp70_ = self->priv->_counterpart;
		_tmp71_ = qlite_insert_builder_value (_tmp66_, G_TYPE_INT, NULL, NULL, _tmp69_, (gpointer) ((gintptr) dino_database_get_jid_id (db, _tmp70_)));
		_tmp72_ = _tmp71_;
		_tmp73_ = dino_database_get_call (db);
		_tmp74_ = _tmp73_;
		_tmp75_ = _tmp74_->counterpart_resource;
		_tmp76_ = self->priv->_counterpart;
		_tmp77_ = _tmp76_->resourcepart;
		_tmp78_ = qlite_insert_builder_value (_tmp72_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp75_, _tmp77_);
		_tmp79_ = _tmp78_;
		_qlite_statement_builder_unref0 (_tmp79_);
		_qlite_statement_builder_unref0 (_tmp72_);
	}
	_tmp80_ = builder;
	dino_entities_call_set_id (self, (gint) qlite_insert_builder_perform (_tmp80_));
	{
		GeeList* _peer_list = NULL;
		GeeList* _tmp81_;
		gint _peer_size = 0;
		GeeList* _tmp82_;
		gint _tmp83_;
		gint _tmp84_;
		gint _peer_index = 0;
		_tmp81_ = self->counterparts;
		_peer_list = _tmp81_;
		_tmp82_ = _peer_list;
		_tmp83_ = gee_collection_get_size ((GeeCollection*) _tmp82_);
		_tmp84_ = _tmp83_;
		_peer_size = _tmp84_;
		_peer_index = -1;
		while (TRUE) {
			gint _tmp85_;
			gint _tmp86_;
			XmppJid* peer = NULL;
			GeeList* _tmp87_;
			gpointer _tmp88_;
			DinoDatabaseCallCounterpartTable* _tmp89_;
			DinoDatabaseCallCounterpartTable* _tmp90_;
			QliteInsertBuilder* _tmp91_;
			QliteInsertBuilder* _tmp92_;
			DinoDatabaseCallCounterpartTable* _tmp93_;
			DinoDatabaseCallCounterpartTable* _tmp94_;
			QliteColumn* _tmp95_;
			gint _tmp96_;
			QliteInsertBuilder* _tmp97_;
			QliteInsertBuilder* _tmp98_;
			DinoDatabaseCallCounterpartTable* _tmp99_;
			DinoDatabaseCallCounterpartTable* _tmp100_;
			QliteColumn* _tmp101_;
			XmppJid* _tmp102_;
			QliteInsertBuilder* _tmp103_;
			QliteInsertBuilder* _tmp104_;
			DinoDatabaseCallCounterpartTable* _tmp105_;
			DinoDatabaseCallCounterpartTable* _tmp106_;
			QliteColumn* _tmp107_;
			XmppJid* _tmp108_;
			const gchar* _tmp109_;
			QliteInsertBuilder* _tmp110_;
			QliteInsertBuilder* _tmp111_;
			_peer_index = _peer_index + 1;
			_tmp85_ = _peer_index;
			_tmp86_ = _peer_size;
			if (!(_tmp85_ < _tmp86_)) {
				break;
			}
			_tmp87_ = _peer_list;
			_tmp88_ = gee_list_get (_tmp87_, _peer_index);
			peer = (XmppJid*) _tmp88_;
			_tmp89_ = dino_database_get_call_counterpart (db);
			_tmp90_ = _tmp89_;
			_tmp91_ = qlite_table_insert ((QliteTable*) _tmp90_);
			_tmp92_ = _tmp91_;
			_tmp93_ = dino_database_get_call_counterpart (db);
			_tmp94_ = _tmp93_;
			_tmp95_ = _tmp94_->call_id;
			_tmp96_ = self->priv->_id;
			_tmp97_ = qlite_insert_builder_value (_tmp92_, G_TYPE_INT, NULL, NULL, _tmp95_, (gpointer) ((gintptr) _tmp96_));
			_tmp98_ = _tmp97_;
			_tmp99_ = dino_database_get_call_counterpart (db);
			_tmp100_ = _tmp99_;
			_tmp101_ = _tmp100_->jid_id;
			_tmp102_ = peer;
			_tmp103_ = qlite_insert_builder_value (_tmp98_, G_TYPE_INT, NULL, NULL, _tmp101_, (gpointer) ((gintptr) dino_database_get_jid_id (db, _tmp102_)));
			_tmp104_ = _tmp103_;
			_tmp105_ = dino_database_get_call_counterpart (db);
			_tmp106_ = _tmp105_;
			_tmp107_ = _tmp106_->resource;
			_tmp108_ = peer;
			_tmp109_ = _tmp108_->resourcepart;
			_tmp110_ = qlite_insert_builder_value (_tmp104_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp107_, _tmp109_);
			_tmp111_ = _tmp110_;
			qlite_insert_builder_perform (_tmp111_);
			_qlite_statement_builder_unref0 (_tmp111_);
			_qlite_statement_builder_unref0 (_tmp104_);
			_qlite_statement_builder_unref0 (_tmp98_);
			_qlite_statement_builder_unref0 (_tmp92_);
			_xmpp_jid_unref0 (peer);
		}
	}
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _dino_entities_call_on_update_g_object_notify, self, 0);
	_qlite_statement_builder_unref0 (builder);
}

void
dino_entities_call_add_peer (DinoEntitiesCall* self,
                             XmppJid* peer)
{
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	DinoDatabase* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (peer != NULL);
	_tmp0_ = self->counterparts;
	if (gee_collection_contains ((GeeCollection*) _tmp0_, peer)) {
		return;
	}
	_tmp1_ = self->counterparts;
	gee_collection_add ((GeeCollection*) _tmp1_, peer);
	_tmp2_ = self->priv->db;
	if (_tmp2_ != NULL) {
		DinoDatabase* _tmp3_;
		DinoDatabaseCallCounterpartTable* _tmp4_;
		DinoDatabaseCallCounterpartTable* _tmp5_;
		QliteInsertBuilder* _tmp6_;
		QliteInsertBuilder* _tmp7_;
		DinoDatabase* _tmp8_;
		DinoDatabaseCallCounterpartTable* _tmp9_;
		DinoDatabaseCallCounterpartTable* _tmp10_;
		QliteColumn* _tmp11_;
		gint _tmp12_;
		QliteInsertBuilder* _tmp13_;
		QliteInsertBuilder* _tmp14_;
		DinoDatabase* _tmp15_;
		DinoDatabaseCallCounterpartTable* _tmp16_;
		DinoDatabaseCallCounterpartTable* _tmp17_;
		QliteColumn* _tmp18_;
		DinoDatabase* _tmp19_;
		QliteInsertBuilder* _tmp20_;
		QliteInsertBuilder* _tmp21_;
		DinoDatabase* _tmp22_;
		DinoDatabaseCallCounterpartTable* _tmp23_;
		DinoDatabaseCallCounterpartTable* _tmp24_;
		QliteColumn* _tmp25_;
		const gchar* _tmp26_;
		QliteInsertBuilder* _tmp27_;
		QliteInsertBuilder* _tmp28_;
		_tmp3_ = self->priv->db;
		_tmp4_ = dino_database_get_call_counterpart (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = qlite_table_insert ((QliteTable*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = self->priv->db;
		_tmp9_ = dino_database_get_call_counterpart (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_->call_id;
		_tmp12_ = self->priv->_id;
		_tmp13_ = qlite_insert_builder_value (_tmp7_, G_TYPE_INT, NULL, NULL, _tmp11_, (gpointer) ((gintptr) _tmp12_));
		_tmp14_ = _tmp13_;
		_tmp15_ = self->priv->db;
		_tmp16_ = dino_database_get_call_counterpart (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = _tmp17_->jid_id;
		_tmp19_ = self->priv->db;
		_tmp20_ = qlite_insert_builder_value (_tmp14_, G_TYPE_INT, NULL, NULL, _tmp18_, (gpointer) ((gintptr) dino_database_get_jid_id (_tmp19_, peer)));
		_tmp21_ = _tmp20_;
		_tmp22_ = self->priv->db;
		_tmp23_ = dino_database_get_call_counterpart (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = _tmp24_->resource;
		_tmp26_ = peer->resourcepart;
		_tmp27_ = qlite_insert_builder_value (_tmp21_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp25_, _tmp26_);
		_tmp28_ = _tmp27_;
		qlite_insert_builder_perform (_tmp28_);
		_qlite_statement_builder_unref0 (_tmp28_);
		_qlite_statement_builder_unref0 (_tmp21_);
		_qlite_statement_builder_unref0 (_tmp14_);
		_qlite_statement_builder_unref0 (_tmp7_);
	}
}

gboolean
dino_entities_call_equals (DinoEntitiesCall* self,
                           DinoEntitiesCall* c)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (c != NULL, FALSE);
	result = dino_entities_call_equals_func (self, c);
	return result;
}

gboolean
dino_entities_call_equals_func (DinoEntitiesCall* c1,
                                DinoEntitiesCall* c2)
{
	gint _tmp0_;
	gint _tmp1_;
	gboolean result;
	g_return_val_if_fail (c1 != NULL, FALSE);
	g_return_val_if_fail (c2 != NULL, FALSE);
	_tmp0_ = c1->priv->_id;
	_tmp1_ = c2->priv->_id;
	if (_tmp0_ == _tmp1_) {
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

guint
dino_entities_call_hash_func (DinoEntitiesCall* call)
{
	gint _tmp0_;
	guint result;
	g_return_val_if_fail (call != NULL, 0U);
	_tmp0_ = call->priv->_id;
	result = (guint) _tmp0_;
	return result;
}

static void
dino_entities_call_on_update (DinoEntitiesCall* self,
                              GObject* o,
                              GParamSpec* sp)
{
	QliteUpdateBuilder* update_builder = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseCallTable* _tmp1_;
	DinoDatabaseCallTable* _tmp2_;
	QliteUpdateBuilder* _tmp3_;
	QliteUpdateBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseCallTable* _tmp6_;
	DinoDatabaseCallTable* _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;
	QliteUpdateBuilder* _tmp96_;
	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_call (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_update ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->db;
	_tmp6_ = dino_database_get_call (_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_builder = _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 ("counterpart")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp16_;
				DinoDatabase* _tmp17_;
				DinoDatabaseCallTable* _tmp18_;
				DinoDatabaseCallTable* _tmp19_;
				QliteColumn* _tmp20_;
				DinoDatabase* _tmp21_;
				XmppJid* _tmp22_;
				QliteUpdateBuilder* _tmp23_;
				QliteUpdateBuilder* _tmp24_;
				QliteUpdateBuilder* _tmp25_;
				DinoDatabase* _tmp26_;
				DinoDatabaseCallTable* _tmp27_;
				DinoDatabaseCallTable* _tmp28_;
				QliteColumn* _tmp29_;
				XmppJid* _tmp30_;
				const gchar* _tmp31_;
				QliteUpdateBuilder* _tmp32_;
				QliteUpdateBuilder* _tmp33_;
				_tmp16_ = update_builder;
				_tmp17_ = self->priv->db;
				_tmp18_ = dino_database_get_call (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = _tmp19_->counterpart_id;
				_tmp21_ = self->priv->db;
				_tmp22_ = self->priv->_counterpart;
				_tmp23_ = qlite_update_builder_set (_tmp16_, G_TYPE_INT, NULL, NULL, _tmp20_, (gpointer) ((gintptr) dino_database_get_jid_id (_tmp21_, _tmp22_)));
				_tmp24_ = _tmp23_;
				_qlite_statement_builder_unref0 (_tmp24_);
				_tmp25_ = update_builder;
				_tmp26_ = self->priv->db;
				_tmp27_ = dino_database_get_call (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = _tmp28_->counterpart_resource;
				_tmp30_ = self->priv->_counterpart;
				_tmp31_ = _tmp30_->resourcepart;
				_tmp32_ = qlite_update_builder_set (_tmp25_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp29_, _tmp31_);
				_tmp33_ = _tmp32_;
				_qlite_statement_builder_unref0 (_tmp33_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label1) ? _tmp14_label1 : (_tmp14_label1 = g_quark_from_static_string ("ourpart")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp34_;
				DinoDatabase* _tmp35_;
				DinoDatabaseCallTable* _tmp36_;
				DinoDatabaseCallTable* _tmp37_;
				QliteColumn* _tmp38_;
				XmppJid* _tmp39_;
				const gchar* _tmp40_;
				QliteUpdateBuilder* _tmp41_;
				QliteUpdateBuilder* _tmp42_;
				_tmp34_ = update_builder;
				_tmp35_ = self->priv->db;
				_tmp36_ = dino_database_get_call (_tmp35_);
				_tmp37_ = _tmp36_;
				_tmp38_ = _tmp37_->our_resource;
				_tmp39_ = self->priv->_ourpart;
				_tmp40_ = _tmp39_->resourcepart;
				_tmp41_ = qlite_update_builder_set (_tmp34_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp38_, _tmp40_);
				_tmp42_ = _tmp41_;
				_qlite_statement_builder_unref0 (_tmp42_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label2) ? _tmp14_label2 : (_tmp14_label2 = g_quark_from_static_string ("direction")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp43_;
				DinoDatabase* _tmp44_;
				DinoDatabaseCallTable* _tmp45_;
				DinoDatabaseCallTable* _tmp46_;
				QliteColumn* _tmp47_;
				gboolean _tmp48_;
				QliteUpdateBuilder* _tmp49_;
				QliteUpdateBuilder* _tmp50_;
				_tmp43_ = update_builder;
				_tmp44_ = self->priv->db;
				_tmp45_ = dino_database_get_call (_tmp44_);
				_tmp46_ = _tmp45_;
				_tmp47_ = _tmp46_->direction;
				_tmp48_ = self->priv->_direction;
				_tmp49_ = qlite_update_builder_set (_tmp43_, G_TYPE_BOOLEAN, NULL, NULL, _tmp47_, (gpointer) ((gintptr) _tmp48_));
				_tmp50_ = _tmp49_;
				_qlite_statement_builder_unref0 (_tmp50_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label3) ? _tmp14_label3 : (_tmp14_label3 = g_quark_from_static_string ("time")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp51_;
				DinoDatabase* _tmp52_;
				DinoDatabaseCallTable* _tmp53_;
				DinoDatabaseCallTable* _tmp54_;
				QliteColumn* _tmp55_;
				GDateTime* _tmp56_;
				QliteUpdateBuilder* _tmp57_;
				QliteUpdateBuilder* _tmp58_;
				_tmp51_ = update_builder;
				_tmp52_ = self->priv->db;
				_tmp53_ = dino_database_get_call (_tmp52_);
				_tmp54_ = _tmp53_;
				_tmp55_ = _tmp54_->time;
				_tmp56_ = self->priv->_time;
				_tmp57_ = qlite_update_builder_set (_tmp51_, G_TYPE_LONG, NULL, NULL, _tmp55_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp56_)));
				_tmp58_ = _tmp57_;
				_qlite_statement_builder_unref0 (_tmp58_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label4) ? _tmp14_label4 : (_tmp14_label4 = g_quark_from_static_string ("local-time")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp59_;
				DinoDatabase* _tmp60_;
				DinoDatabaseCallTable* _tmp61_;
				DinoDatabaseCallTable* _tmp62_;
				QliteColumn* _tmp63_;
				GDateTime* _tmp64_;
				QliteUpdateBuilder* _tmp65_;
				QliteUpdateBuilder* _tmp66_;
				_tmp59_ = update_builder;
				_tmp60_ = self->priv->db;
				_tmp61_ = dino_database_get_call (_tmp60_);
				_tmp62_ = _tmp61_;
				_tmp63_ = _tmp62_->local_time;
				_tmp64_ = self->priv->_local_time;
				_tmp65_ = qlite_update_builder_set (_tmp59_, G_TYPE_LONG, NULL, NULL, _tmp63_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp64_)));
				_tmp66_ = _tmp65_;
				_qlite_statement_builder_unref0 (_tmp66_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label5) ? _tmp14_label5 : (_tmp14_label5 = g_quark_from_static_string ("end-time")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp67_;
				DinoDatabase* _tmp68_;
				DinoDatabaseCallTable* _tmp69_;
				DinoDatabaseCallTable* _tmp70_;
				QliteColumn* _tmp71_;
				GDateTime* _tmp72_;
				QliteUpdateBuilder* _tmp73_;
				QliteUpdateBuilder* _tmp74_;
				_tmp67_ = update_builder;
				_tmp68_ = self->priv->db;
				_tmp69_ = dino_database_get_call (_tmp68_);
				_tmp70_ = _tmp69_;
				_tmp71_ = _tmp70_->end_time;
				_tmp72_ = self->priv->_end_time;
				_tmp73_ = qlite_update_builder_set (_tmp67_, G_TYPE_LONG, NULL, NULL, _tmp71_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp72_)));
				_tmp74_ = _tmp73_;
				_qlite_statement_builder_unref0 (_tmp74_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label6) ? _tmp14_label6 : (_tmp14_label6 = g_quark_from_static_string ("encryption")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp75_;
				DinoDatabase* _tmp76_;
				DinoDatabaseCallTable* _tmp77_;
				DinoDatabaseCallTable* _tmp78_;
				QliteColumn* _tmp79_;
				DinoEntitiesEncryption _tmp80_;
				QliteUpdateBuilder* _tmp81_;
				QliteUpdateBuilder* _tmp82_;
				_tmp75_ = update_builder;
				_tmp76_ = self->priv->db;
				_tmp77_ = dino_database_get_call (_tmp76_);
				_tmp78_ = _tmp77_;
				_tmp79_ = _tmp78_->encryption;
				_tmp80_ = self->priv->_encryption;
				_tmp81_ = qlite_update_builder_set (_tmp75_, G_TYPE_INT, NULL, NULL, _tmp79_, (gpointer) ((gintptr) _tmp80_));
				_tmp82_ = _tmp81_;
				_qlite_statement_builder_unref0 (_tmp82_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label7) ? _tmp14_label7 : (_tmp14_label7 = g_quark_from_static_string ("state")))) {
		switch (0) {
			default:
			{
				gboolean _tmp83_ = FALSE;
				gboolean _tmp84_ = FALSE;
				DinoEntitiesCallState _tmp85_;
				QliteUpdateBuilder* _tmp88_;
				DinoDatabase* _tmp89_;
				DinoDatabaseCallTable* _tmp90_;
				DinoDatabaseCallTable* _tmp91_;
				QliteColumn* _tmp92_;
				DinoEntitiesCallState _tmp93_;
				QliteUpdateBuilder* _tmp94_;
				QliteUpdateBuilder* _tmp95_;
				_tmp85_ = self->priv->_state;
				if (_tmp85_ == DINO_ENTITIES_CALL_STATE_RINGING) {
					_tmp84_ = TRUE;
				} else {
					DinoEntitiesCallState _tmp86_;
					_tmp86_ = self->priv->_state;
					_tmp84_ = _tmp86_ == DINO_ENTITIES_CALL_STATE_ESTABLISHING;
				}
				if (_tmp84_) {
					_tmp83_ = TRUE;
				} else {
					DinoEntitiesCallState _tmp87_;
					_tmp87_ = self->priv->_state;
					_tmp83_ = _tmp87_ == DINO_ENTITIES_CALL_STATE_IN_PROGRESS;
				}
				if (_tmp83_) {
					_qlite_statement_builder_unref0 (update_builder);
					return;
				}
				_tmp88_ = update_builder;
				_tmp89_ = self->priv->db;
				_tmp90_ = dino_database_get_call (_tmp89_);
				_tmp91_ = _tmp90_;
				_tmp92_ = _tmp91_->state;
				_tmp93_ = self->priv->_state;
				_tmp94_ = qlite_update_builder_set (_tmp88_, G_TYPE_INT, NULL, NULL, _tmp92_, (gpointer) ((gintptr) _tmp93_));
				_tmp95_ = _tmp94_;
				_qlite_statement_builder_unref0 (_tmp95_);
				break;
			}
		}
	}
	_tmp96_ = update_builder;
	qlite_update_builder_perform (_tmp96_);
	_qlite_statement_builder_unref0 (update_builder);
}

DinoEntitiesCall*
dino_entities_call_construct (GType object_type)
{
	DinoEntitiesCall * self = NULL;
	self = (DinoEntitiesCall*) g_object_new (object_type, NULL);
	return self;
}

DinoEntitiesCall*
dino_entities_call_new (void)
{
	return dino_entities_call_construct (DINO_ENTITIES_TYPE_CALL);
}

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

void
dino_entities_call_set_id (DinoEntitiesCall* self,
                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_call_properties[DINO_ENTITIES_CALL_ID_PROPERTY]);
	}
}

DinoEntitiesAccount*
dino_entities_call_get_account (DinoEntitiesCall* 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;
}

void
dino_entities_call_set_account (DinoEntitiesCall* self,
                                DinoEntitiesAccount* value)
{
	DinoEntitiesAccount* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_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_call_properties[DINO_ENTITIES_CALL_ACCOUNT_PROPERTY]);
	}
}

XmppJid*
dino_entities_call_get_counterpart (DinoEntitiesCall* 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;
}

void
dino_entities_call_set_counterpart (DinoEntitiesCall* self,
                                    XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_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_call_properties[DINO_ENTITIES_CALL_COUNTERPART_PROPERTY]);
	}
}

XmppJid*
dino_entities_call_get_ourpart (DinoEntitiesCall* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_ourpart;
	result = _tmp0_;
	return result;
}

void
dino_entities_call_set_ourpart (DinoEntitiesCall* self,
                                XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_get_ourpart (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_ourpart);
		self->priv->_ourpart = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_call_properties[DINO_ENTITIES_CALL_OURPART_PROPERTY]);
	}
}

XmppJid*
dino_entities_call_get_proposer (DinoEntitiesCall* self)
{
	XmppJid* result;
	XmppJid* _tmp0_ = NULL;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->_direction;
	if (_tmp1_ == DINO_ENTITIES_CALL_DIRECTION_OUTGOING) {
		XmppJid* _tmp2_;
		_tmp2_ = self->priv->_ourpart;
		_tmp0_ = _tmp2_;
	} else {
		XmppJid* _tmp3_;
		_tmp3_ = self->priv->_counterpart;
		_tmp0_ = _tmp3_;
	}
	result = _tmp0_;
	return result;
}

gboolean
dino_entities_call_get_direction (DinoEntitiesCall* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_direction;
	return result;
}

void
dino_entities_call_set_direction (DinoEntitiesCall* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_get_direction (self);
	if (old_value != value) {
		self->priv->_direction = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_call_properties[DINO_ENTITIES_CALL_DIRECTION_PROPERTY]);
	}
}

GDateTime*
dino_entities_call_get_time (DinoEntitiesCall* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_time;
	result = _tmp0_;
	return result;
}

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

void
dino_entities_call_set_time (DinoEntitiesCall* self,
                             GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_get_time (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_time);
		self->priv->_time = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_call_properties[DINO_ENTITIES_CALL_TIME_PROPERTY]);
	}
}

GDateTime*
dino_entities_call_get_local_time (DinoEntitiesCall* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_local_time;
	result = _tmp0_;
	return result;
}

void
dino_entities_call_set_local_time (DinoEntitiesCall* self,
                                   GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_get_local_time (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_local_time);
		self->priv->_local_time = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_call_properties[DINO_ENTITIES_CALL_LOCAL_TIME_PROPERTY]);
	}
}

GDateTime*
dino_entities_call_get_end_time (DinoEntitiesCall* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_end_time;
	result = _tmp0_;
	return result;
}

void
dino_entities_call_set_end_time (DinoEntitiesCall* self,
                                 GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_get_end_time (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_end_time);
		self->priv->_end_time = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_call_properties[DINO_ENTITIES_CALL_END_TIME_PROPERTY]);
	}
}

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

void
dino_entities_call_set_encryption (DinoEntitiesCall* self,
                                   DinoEntitiesEncryption value)
{
	DinoEntitiesEncryption old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_get_encryption (self);
	if (old_value != value) {
		self->priv->_encryption = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_call_properties[DINO_ENTITIES_CALL_ENCRYPTION_PROPERTY]);
	}
}

DinoEntitiesCallState
dino_entities_call_get_state (DinoEntitiesCall* self)
{
	DinoEntitiesCallState result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_state;
	return result;
}

void
dino_entities_call_set_state (DinoEntitiesCall* self,
                              DinoEntitiesCallState value)
{
	DinoEntitiesCallState old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_call_get_state (self);
	if (old_value != value) {
		self->priv->_state = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_call_properties[DINO_ENTITIES_CALL_STATE_PROPERTY]);
	}
}

static void
dino_entities_call_class_init (DinoEntitiesCallClass * klass,
                               gpointer klass_data)
{
	dino_entities_call_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoEntitiesCall_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_entities_call_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_entities_call_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_entities_call_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CALL_ID_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_ID_PROPERTY] = g_param_spec_int ("id", "id", "id", 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_CALL_ACCOUNT_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_ACCOUNT_PROPERTY] = g_param_spec_object ("account", "account", "account", DINO_ENTITIES_TYPE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CALL_COUNTERPART_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_COUNTERPART_PROPERTY] = xmpp_param_spec_jid ("counterpart", "counterpart", "counterpart", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CALL_OURPART_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_OURPART_PROPERTY] = xmpp_param_spec_jid ("ourpart", "ourpart", "ourpart", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CALL_PROPOSER_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_PROPOSER_PROPERTY] = xmpp_param_spec_jid ("proposer", "proposer", "proposer", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CALL_DIRECTION_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_DIRECTION_PROPERTY] = g_param_spec_boolean ("direction", "direction", "direction", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CALL_TIME_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_TIME_PROPERTY] = g_param_spec_boxed ("time", "time", "time", 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_CALL_LOCAL_TIME_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_LOCAL_TIME_PROPERTY] = g_param_spec_boxed ("local-time", "local-time", "local-time", 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_CALL_END_TIME_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_END_TIME_PROPERTY] = g_param_spec_boxed ("end-time", "end-time", "end-time", 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_CALL_ENCRYPTION_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_ENCRYPTION_PROPERTY] = g_param_spec_enum ("encryption", "encryption", "encryption", DINO_ENTITIES_TYPE_ENCRYPTION, DINO_ENTITIES_ENCRYPTION_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_CALL_STATE_PROPERTY, dino_entities_call_properties[DINO_ENTITIES_CALL_STATE_PROPERTY] = g_param_spec_enum ("state", "state", "state", DINO_ENTITIES_CALL_TYPE_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_entities_call_instance_init (DinoEntitiesCall * self,
                                  gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->priv = dino_entities_call_get_instance_private (self);
	self->priv->_id = -1;
	_tmp0_ = gee_array_list_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, _xmpp_jid_equals_bare_func_gee_equal_data_func, NULL, NULL);
	self->counterparts = (GeeList*) _tmp0_;
	self->priv->_encryption = DINO_ENTITIES_ENCRYPTION_NONE;
}

static void
dino_entities_call_finalize (GObject * obj)
{
	DinoEntitiesCall * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_ENTITIES_TYPE_CALL, DinoEntitiesCall);
	_g_object_unref0 (self->priv->_account);
	_xmpp_jid_unref0 (self->priv->_counterpart);
	_g_object_unref0 (self->counterparts);
	_xmpp_jid_unref0 (self->priv->_ourpart);
	_g_date_time_unref0 (self->priv->_time);
	_g_date_time_unref0 (self->priv->_local_time);
	_g_date_time_unref0 (self->priv->_end_time);
	_qlite_database_unref0 (self->priv->db);
	G_OBJECT_CLASS (dino_entities_call_parent_class)->finalize (obj);
}

static GType
dino_entities_call_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoEntitiesCallClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_entities_call_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoEntitiesCall), 0, (GInstanceInitFunc) dino_entities_call_instance_init, NULL };
	GType dino_entities_call_type_id;
	dino_entities_call_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoEntitiesCall", &g_define_type_info, 0);
	DinoEntitiesCall_private_offset = g_type_add_instance_private (dino_entities_call_type_id, sizeof (DinoEntitiesCallPrivate));
	return dino_entities_call_type_id;
}

GType
dino_entities_call_get_type (void)
{
	static volatile gsize dino_entities_call_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_call_type_id__once)) {
		GType dino_entities_call_type_id;
		dino_entities_call_type_id = dino_entities_call_get_type_once ();
		g_once_init_leave (&dino_entities_call_type_id__once, dino_entities_call_type_id);
	}
	return dino_entities_call_type_id__once;
}

static void
_vala_dino_entities_call_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	DinoEntitiesCall * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_ENTITIES_TYPE_CALL, DinoEntitiesCall);
	switch (property_id) {
		case DINO_ENTITIES_CALL_ID_PROPERTY:
		g_value_set_int (value, dino_entities_call_get_id (self));
		break;
		case DINO_ENTITIES_CALL_ACCOUNT_PROPERTY:
		g_value_set_object (value, dino_entities_call_get_account (self));
		break;
		case DINO_ENTITIES_CALL_COUNTERPART_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_call_get_counterpart (self));
		break;
		case DINO_ENTITIES_CALL_OURPART_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_call_get_ourpart (self));
		break;
		case DINO_ENTITIES_CALL_PROPOSER_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_call_get_proposer (self));
		break;
		case DINO_ENTITIES_CALL_DIRECTION_PROPERTY:
		g_value_set_boolean (value, dino_entities_call_get_direction (self));
		break;
		case DINO_ENTITIES_CALL_TIME_PROPERTY:
		g_value_set_boxed (value, dino_entities_call_get_time (self));
		break;
		case DINO_ENTITIES_CALL_LOCAL_TIME_PROPERTY:
		g_value_set_boxed (value, dino_entities_call_get_local_time (self));
		break;
		case DINO_ENTITIES_CALL_END_TIME_PROPERTY:
		g_value_set_boxed (value, dino_entities_call_get_end_time (self));
		break;
		case DINO_ENTITIES_CALL_ENCRYPTION_PROPERTY:
		g_value_set_enum (value, dino_entities_call_get_encryption (self));
		break;
		case DINO_ENTITIES_CALL_STATE_PROPERTY:
		g_value_set_enum (value, dino_entities_call_get_state (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_entities_call_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	DinoEntitiesCall * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_ENTITIES_TYPE_CALL, DinoEntitiesCall);
	switch (property_id) {
		case DINO_ENTITIES_CALL_ID_PROPERTY:
		dino_entities_call_set_id (self, g_value_get_int (value));
		break;
		case DINO_ENTITIES_CALL_ACCOUNT_PROPERTY:
		dino_entities_call_set_account (self, g_value_get_object (value));
		break;
		case DINO_ENTITIES_CALL_COUNTERPART_PROPERTY:
		dino_entities_call_set_counterpart (self, xmpp_value_get_jid (value));
		break;
		case DINO_ENTITIES_CALL_OURPART_PROPERTY:
		dino_entities_call_set_ourpart (self, xmpp_value_get_jid (value));
		break;
		case DINO_ENTITIES_CALL_DIRECTION_PROPERTY:
		dino_entities_call_set_direction (self, g_value_get_boolean (value));
		break;
		case DINO_ENTITIES_CALL_TIME_PROPERTY:
		dino_entities_call_set_time (self, g_value_get_boxed (value));
		break;
		case DINO_ENTITIES_CALL_LOCAL_TIME_PROPERTY:
		dino_entities_call_set_local_time (self, g_value_get_boxed (value));
		break;
		case DINO_ENTITIES_CALL_END_TIME_PROPERTY:
		dino_entities_call_set_end_time (self, g_value_get_boxed (value));
		break;
		case DINO_ENTITIES_CALL_ENCRYPTION_PROPERTY:
		dino_entities_call_set_encryption (self, g_value_get_enum (value));
		break;
		case DINO_ENTITIES_CALL_STATE_PROPERTY:
		dino_entities_call_set_state (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

