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

#include "libdino.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "xmpp-vala.h"
#include <gio/gio.h>
#include <gee.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_FILE_TRANSFER_0_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_ID_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_FILE_SHARING_ID_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_ACCOUNT_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_COUNTERPART_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_OURPART_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_FROM_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_TO_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_DIRECTION_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_TIME_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_LOCAL_TIME_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_ENCRYPTION_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_INPUT_STREAM_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_FILE_NAME_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_SERVER_FILE_NAME_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_PATH_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_MIME_TYPE_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_SIZE_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_STATE_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_PROVIDER_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_INFO_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_CANCELLABLE_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_TRANSFERRED_BYTES_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_FILE_METADATA_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_DESC_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_MODIFICATION_DATE_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_WIDTH_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_HEIGHT_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_LENGTH_PROPERTY,
	DINO_ENTITIES_FILE_TRANSFER_NUM_PROPERTIES
};
static GParamSpec* dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#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 _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)))
#define _xmpp_xep_jingle_content_thumbnails_thumbnail_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_content_thumbnails_thumbnail_unref (var), NULL)))
enum  {
	DINO_ENTITIES_FILE_TRANSFER_SOURCES_CHANGED_SIGNAL,
	DINO_ENTITIES_FILE_TRANSFER_NUM_SIGNALS
};
static guint dino_entities_file_transfer_signals[DINO_ENTITIES_FILE_TRANSFER_NUM_SIGNALS] = {0};

struct _DinoEntitiesFileTransferPrivate {
	gint _id;
	gchar* _file_sharing_id;
	DinoEntitiesAccount* _account;
	XmppJid* _counterpart;
	XmppJid* _ourpart;
	gboolean _direction;
	GDateTime* _time;
	GDateTime* _local_time;
	DinoEntitiesEncryption _encryption;
	GInputStream* input_stream_;
	gchar* file_name_;
	gchar* server_file_name_;
	gchar* _path;
	gchar* _mime_type;
	gint64 _size;
	DinoEntitiesFileTransferState _state;
	gint _provider;
	gchar* _info;
	GCancellable* _cancellable;
	gint64 _transferred_bytes;
	gchar* _desc;
	GDateTime* _modification_date;
	gint _width;
	gint _height;
	gint64 _length;
	DinoDatabase* db;
	gchar* storage_dir;
};

static gint DinoEntitiesFileTransfer_private_offset;
static gpointer dino_entities_file_transfer_parent_class = NULL;

static gboolean _xmpp_xep_stateless_file_sharing_source_equals_func_gee_equal_data_func (gconstpointer a,
                                                                                  gconstpointer b,
                                                                                  gpointer self);
static void dino_entities_file_transfer_on_update (DinoEntitiesFileTransfer* self,
                                            GObject* o,
                                            GParamSpec* sp);
static void _dino_entities_file_transfer_on_update_g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self);
static void dino_entities_file_transfer_persist_source (DinoEntitiesFileTransfer* self,
                                                 XmppXepStatelessFileSharingSource* source);
static void dino_entities_file_transfer_finalize (GObject * obj);
static GType dino_entities_file_transfer_get_type_once (void);
static void _vala_dino_entities_file_transfer_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_dino_entities_file_transfer_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);

static inline gpointer
dino_entities_file_transfer_get_instance_private (DinoEntitiesFileTransfer* self)
{
	return G_STRUCT_MEMBER_P (self, DinoEntitiesFileTransfer_private_offset);
}

static GType
dino_entities_file_transfer_state_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_ENTITIES_FILE_TRANSFER_STATE_COMPLETE, "DINO_ENTITIES_FILE_TRANSFER_STATE_COMPLETE", "complete"}, {DINO_ENTITIES_FILE_TRANSFER_STATE_IN_PROGRESS, "DINO_ENTITIES_FILE_TRANSFER_STATE_IN_PROGRESS", "in-progress"}, {DINO_ENTITIES_FILE_TRANSFER_STATE_NOT_STARTED, "DINO_ENTITIES_FILE_TRANSFER_STATE_NOT_STARTED", "not-started"}, {DINO_ENTITIES_FILE_TRANSFER_STATE_FAILED, "DINO_ENTITIES_FILE_TRANSFER_STATE_FAILED", "failed"}, {0, NULL, NULL}};
	GType dino_entities_file_transfer_state_type_id;
	dino_entities_file_transfer_state_type_id = g_enum_register_static ("DinoEntitiesFileTransferState", values);
	return dino_entities_file_transfer_state_type_id;
}

GType
dino_entities_file_transfer_state_get_type (void)
{
	static volatile gsize dino_entities_file_transfer_state_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_file_transfer_state_type_id__once)) {
		GType dino_entities_file_transfer_state_type_id;
		dino_entities_file_transfer_state_type_id = dino_entities_file_transfer_state_get_type_once ();
		g_once_init_leave (&dino_entities_file_transfer_state_type_id__once, dino_entities_file_transfer_state_type_id);
	}
	return dino_entities_file_transfer_state_type_id__once;
}

static gboolean
_xmpp_xep_stateless_file_sharing_source_equals_func_gee_equal_data_func (gconstpointer a,
                                                                         gconstpointer b,
                                                                         gpointer self)
{
	gboolean result;
	result = xmpp_xep_stateless_file_sharing_source_equals_func ((XmppXepStatelessFileSharingSource*) a, (XmppXepStatelessFileSharingSource*) b);
	return result;
}

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

static void
_dino_entities_file_transfer_on_update_g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self)
{
	dino_entities_file_transfer_on_update ((DinoEntitiesFileTransfer*) self, _sender, pspec);
}

DinoEntitiesFileTransfer*
dino_entities_file_transfer_construct_from_row (GType object_type,
                                                DinoDatabase* db,
                                                QliteRow* row,
                                                const gchar* storage_dir,
                                                GError** error)
{
	DinoEntitiesFileTransfer * self = NULL;
	DinoDatabase* _tmp0_;
	gchar* _tmp1_;
	DinoDatabaseFileTransferTable* _tmp2_;
	DinoDatabaseFileTransferTable* _tmp3_;
	QliteColumn* _tmp4_;
	gpointer _tmp5_;
	DinoDatabaseFileTransferTable* _tmp6_;
	DinoDatabaseFileTransferTable* _tmp7_;
	QliteColumn* _tmp8_;
	gpointer _tmp9_;
	gchar* _tmp10_;
	DinoDatabaseFileTransferTable* _tmp11_;
	DinoDatabaseFileTransferTable* _tmp12_;
	QliteColumn* _tmp13_;
	gpointer _tmp14_;
	DinoEntitiesAccount* _tmp15_;
	DinoEntitiesAccount* _tmp16_;
	XmppJid* _tmp17_ = NULL;
	DinoDatabaseFileTransferTable* _tmp18_;
	DinoDatabaseFileTransferTable* _tmp19_;
	QliteColumn* _tmp20_;
	gpointer _tmp21_;
	XmppJid* _tmp22_;
	gchar* counterpart_resource = NULL;
	DinoDatabaseFileTransferTable* _tmp23_;
	DinoDatabaseFileTransferTable* _tmp24_;
	QliteColumn* _tmp25_;
	gpointer _tmp26_;
	const gchar* _tmp27_;
	gchar* our_resource = NULL;
	DinoDatabaseFileTransferTable* _tmp32_;
	DinoDatabaseFileTransferTable* _tmp33_;
	QliteColumn* _tmp34_;
	gpointer _tmp35_;
	const gchar* _tmp36_;
	DinoDatabaseFileTransferTable* _tmp49_;
	DinoDatabaseFileTransferTable* _tmp50_;
	QliteColumn* _tmp51_;
	gpointer _tmp52_;
	DinoDatabaseFileTransferTable* _tmp53_;
	DinoDatabaseFileTransferTable* _tmp54_;
	QliteColumn* _tmp55_;
	gpointer _tmp56_;
	GDateTime* _tmp57_;
	GDateTime* _tmp58_;
	DinoDatabaseFileTransferTable* _tmp59_;
	DinoDatabaseFileTransferTable* _tmp60_;
	QliteColumn* _tmp61_;
	gpointer _tmp62_;
	GDateTime* _tmp63_;
	GDateTime* _tmp64_;
	DinoDatabaseFileTransferTable* _tmp65_;
	DinoDatabaseFileTransferTable* _tmp66_;
	QliteColumn* _tmp67_;
	gpointer _tmp68_;
	DinoDatabaseFileTransferTable* _tmp69_;
	DinoDatabaseFileTransferTable* _tmp70_;
	QliteColumn* _tmp71_;
	gpointer _tmp72_;
	gchar* _tmp73_;
	DinoDatabaseFileTransferTable* _tmp74_;
	DinoDatabaseFileTransferTable* _tmp75_;
	QliteColumn* _tmp76_;
	gpointer _tmp77_;
	gchar* _tmp78_;
	DinoDatabaseFileTransferTable* _tmp79_;
	DinoDatabaseFileTransferTable* _tmp80_;
	QliteColumn* _tmp81_;
	gpointer _tmp82_;
	gchar* _tmp83_;
	DinoDatabaseFileTransferTable* _tmp84_;
	DinoDatabaseFileTransferTable* _tmp85_;
	QliteColumn* _tmp86_;
	gpointer _tmp87_;
	DinoDatabaseFileTransferTable* _tmp88_;
	DinoDatabaseFileTransferTable* _tmp89_;
	QliteColumn* _tmp90_;
	gpointer _tmp91_;
	DinoDatabaseFileTransferTable* _tmp92_;
	DinoDatabaseFileTransferTable* _tmp93_;
	QliteColumn* _tmp94_;
	gpointer _tmp95_;
	DinoDatabaseFileTransferTable* _tmp96_;
	DinoDatabaseFileTransferTable* _tmp97_;
	QliteColumn* _tmp98_;
	gpointer _tmp99_;
	gchar* _tmp100_;
	DinoDatabaseFileTransferTable* _tmp101_;
	DinoDatabaseFileTransferTable* _tmp102_;
	QliteColumn* _tmp103_;
	gpointer _tmp104_;
	GDateTime* _tmp105_;
	GDateTime* _tmp106_;
	DinoDatabaseFileTransferTable* _tmp107_;
	DinoDatabaseFileTransferTable* _tmp108_;
	QliteColumn* _tmp109_;
	gpointer _tmp110_;
	DinoDatabaseFileTransferTable* _tmp111_;
	DinoDatabaseFileTransferTable* _tmp112_;
	QliteColumn* _tmp113_;
	gpointer _tmp114_;
	DinoDatabaseFileTransferTable* _tmp115_;
	DinoDatabaseFileTransferTable* _tmp116_;
	QliteColumn* _tmp117_;
	gpointer _tmp118_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (db != NULL, NULL);
	g_return_val_if_fail (row != NULL, NULL);
	g_return_val_if_fail (storage_dir != NULL, NULL);
	self = (DinoEntitiesFileTransfer*) g_object_new (object_type, NULL);
	_tmp0_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp0_;
	_tmp1_ = g_strdup (storage_dir);
	_g_free0 (self->priv->storage_dir);
	self->priv->storage_dir = _tmp1_;
	_tmp2_ = dino_database_get_file_transfer (db);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_->id;
	_tmp5_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp4_);
	dino_entities_file_transfer_set_id (self, (gint) ((gintptr) _tmp5_));
	_tmp6_ = dino_database_get_file_transfer (db);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->file_sharing_id;
	_tmp9_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp8_);
	_tmp10_ = (gchar*) _tmp9_;
	dino_entities_file_transfer_set_file_sharing_id (self, _tmp10_);
	_g_free0 (_tmp10_);
	_tmp11_ = dino_database_get_file_transfer (db);
	_tmp12_ = _tmp11_;
	_tmp13_ = _tmp12_->account_id;
	_tmp14_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp13_);
	_tmp15_ = dino_database_get_account_by_id (db, (gint) ((gintptr) _tmp14_));
	_tmp16_ = _tmp15_;
	dino_entities_file_transfer_set_account (self, _tmp16_);
	_g_object_unref0 (_tmp16_);
	_tmp18_ = dino_database_get_file_transfer (db);
	_tmp19_ = _tmp18_;
	_tmp20_ = _tmp19_->counterpart_id;
	_tmp21_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp20_);
	_tmp22_ = dino_database_get_jid_by_id (db, (gint) ((gintptr) _tmp21_), &_inner_error0_);
	_tmp17_ = _tmp22_;
	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;
		}
	}
	dino_entities_file_transfer_set_counterpart (self, _tmp17_);
	_tmp23_ = dino_database_get_file_transfer (db);
	_tmp24_ = _tmp23_;
	_tmp25_ = _tmp24_->counterpart_resource;
	_tmp26_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp25_);
	counterpart_resource = (gchar*) _tmp26_;
	_tmp27_ = counterpart_resource;
	if (_tmp27_ != NULL) {
		XmppJid* _tmp28_ = NULL;
		XmppJid* _tmp29_;
		const gchar* _tmp30_;
		XmppJid* _tmp31_;
		_tmp29_ = self->priv->_counterpart;
		_tmp30_ = counterpart_resource;
		_tmp31_ = xmpp_jid_with_resource (_tmp29_, _tmp30_, &_inner_error0_);
		_tmp28_ = _tmp31_;
		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 (_tmp17_);
				_g_object_unref0 (self);
				return NULL;
			} else {
				_g_free0 (counterpart_resource);
				_xmpp_jid_unref0 (_tmp17_);
				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_file_transfer_set_counterpart (self, _tmp28_);
		_xmpp_jid_unref0 (_tmp28_);
	}
	_tmp32_ = dino_database_get_file_transfer (db);
	_tmp33_ = _tmp32_;
	_tmp34_ = _tmp33_->our_resource;
	_tmp35_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp34_);
	our_resource = (gchar*) _tmp35_;
	_tmp36_ = our_resource;
	if (_tmp36_ != NULL) {
		XmppJid* _tmp37_ = NULL;
		DinoEntitiesAccount* _tmp38_;
		XmppJid* _tmp39_;
		XmppJid* _tmp40_;
		XmppJid* _tmp41_;
		const gchar* _tmp42_;
		XmppJid* _tmp43_;
		XmppJid* _tmp44_;
		_tmp38_ = self->priv->_account;
		_tmp39_ = dino_entities_account_get_bare_jid (_tmp38_);
		_tmp40_ = _tmp39_;
		_tmp41_ = _tmp40_;
		_tmp42_ = our_resource;
		_tmp43_ = xmpp_jid_with_resource (_tmp41_, _tmp42_, &_inner_error0_);
		_tmp44_ = _tmp43_;
		_xmpp_jid_unref0 (_tmp41_);
		_tmp37_ = _tmp44_;
		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_free0 (counterpart_resource);
				_xmpp_jid_unref0 (_tmp17_);
				_g_object_unref0 (self);
				return NULL;
			} else {
				_g_free0 (our_resource);
				_g_free0 (counterpart_resource);
				_xmpp_jid_unref0 (_tmp17_);
				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_file_transfer_set_ourpart (self, _tmp37_);
		_xmpp_jid_unref0 (_tmp37_);
	} else {
		DinoEntitiesAccount* _tmp45_;
		XmppJid* _tmp46_;
		XmppJid* _tmp47_;
		XmppJid* _tmp48_;
		_tmp45_ = self->priv->_account;
		_tmp46_ = dino_entities_account_get_bare_jid (_tmp45_);
		_tmp47_ = _tmp46_;
		_tmp48_ = _tmp47_;
		dino_entities_file_transfer_set_ourpart (self, _tmp48_);
		_xmpp_jid_unref0 (_tmp48_);
	}
	_tmp49_ = dino_database_get_file_transfer (db);
	_tmp50_ = _tmp49_;
	_tmp51_ = _tmp50_->direction;
	_tmp52_ = qlite_row_get (row, G_TYPE_BOOLEAN, NULL, NULL, _tmp51_);
	dino_entities_file_transfer_set_direction (self, (gboolean) ((gintptr) _tmp52_));
	_tmp53_ = dino_database_get_file_transfer (db);
	_tmp54_ = _tmp53_;
	_tmp55_ = _tmp54_->time;
	_tmp56_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp55_);
	_tmp57_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp56_)));
	_tmp58_ = _tmp57_;
	dino_entities_file_transfer_set_time (self, _tmp58_);
	_g_date_time_unref0 (_tmp58_);
	_tmp59_ = dino_database_get_file_transfer (db);
	_tmp60_ = _tmp59_;
	_tmp61_ = _tmp60_->local_time;
	_tmp62_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp61_);
	_tmp63_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp62_)));
	_tmp64_ = _tmp63_;
	dino_entities_file_transfer_set_local_time (self, _tmp64_);
	_g_date_time_unref0 (_tmp64_);
	_tmp65_ = dino_database_get_file_transfer (db);
	_tmp66_ = _tmp65_;
	_tmp67_ = _tmp66_->encryption;
	_tmp68_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp67_);
	dino_entities_file_transfer_set_encryption (self, (DinoEntitiesEncryption) ((gint) ((gintptr) _tmp68_)));
	_tmp69_ = dino_database_get_file_transfer (db);
	_tmp70_ = _tmp69_;
	_tmp71_ = _tmp70_->file_name;
	_tmp72_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp71_);
	_tmp73_ = (gchar*) _tmp72_;
	dino_entities_file_transfer_set_file_name (self, _tmp73_);
	_g_free0 (_tmp73_);
	_tmp74_ = dino_database_get_file_transfer (db);
	_tmp75_ = _tmp74_;
	_tmp76_ = _tmp75_->path;
	_tmp77_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp76_);
	_tmp78_ = (gchar*) _tmp77_;
	dino_entities_file_transfer_set_path (self, _tmp78_);
	_g_free0 (_tmp78_);
	_tmp79_ = dino_database_get_file_transfer (db);
	_tmp80_ = _tmp79_;
	_tmp81_ = _tmp80_->mime_type;
	_tmp82_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp81_);
	_tmp83_ = (gchar*) _tmp82_;
	dino_entities_file_transfer_set_mime_type (self, _tmp83_);
	_g_free0 (_tmp83_);
	_tmp84_ = dino_database_get_file_transfer (db);
	_tmp85_ = _tmp84_;
	_tmp86_ = _tmp85_->size;
	_tmp87_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp86_);
	dino_entities_file_transfer_set_size (self, (gint64) ((glong) ((gintptr) _tmp87_)));
	_tmp88_ = dino_database_get_file_transfer (db);
	_tmp89_ = _tmp88_;
	_tmp90_ = _tmp89_->state;
	_tmp91_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp90_);
	dino_entities_file_transfer_set_state (self, (DinoEntitiesFileTransferState) ((gint) ((gintptr) _tmp91_)));
	_tmp92_ = dino_database_get_file_transfer (db);
	_tmp93_ = _tmp92_;
	_tmp94_ = _tmp93_->provider;
	_tmp95_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp94_);
	dino_entities_file_transfer_set_provider (self, (gint) ((gintptr) _tmp95_));
	_tmp96_ = dino_database_get_file_transfer (db);
	_tmp97_ = _tmp96_;
	_tmp98_ = _tmp97_->info;
	_tmp99_ = qlite_row_get (row, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp98_);
	_tmp100_ = (gchar*) _tmp99_;
	dino_entities_file_transfer_set_info (self, _tmp100_);
	_g_free0 (_tmp100_);
	_tmp101_ = dino_database_get_file_transfer (db);
	_tmp102_ = _tmp101_;
	_tmp103_ = _tmp102_->modification_date;
	_tmp104_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp103_);
	_tmp105_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp104_)));
	_tmp106_ = _tmp105_;
	dino_entities_file_transfer_set_modification_date (self, _tmp106_);
	_g_date_time_unref0 (_tmp106_);
	_tmp107_ = dino_database_get_file_transfer (db);
	_tmp108_ = _tmp107_;
	_tmp109_ = _tmp108_->width;
	_tmp110_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp109_);
	dino_entities_file_transfer_set_width (self, (gint) ((gintptr) _tmp110_));
	_tmp111_ = dino_database_get_file_transfer (db);
	_tmp112_ = _tmp111_;
	_tmp113_ = _tmp112_->height;
	_tmp114_ = qlite_row_get (row, G_TYPE_INT, NULL, NULL, _tmp113_);
	dino_entities_file_transfer_set_height (self, (gint) ((gintptr) _tmp114_));
	_tmp115_ = dino_database_get_file_transfer (db);
	_tmp116_ = _tmp115_;
	_tmp117_ = _tmp116_->length;
	_tmp118_ = qlite_row_get (row, G_TYPE_LONG, NULL, NULL, _tmp117_);
	dino_entities_file_transfer_set_length (self, (gint64) ((glong) ((gintptr) _tmp118_)));
	{
		QliteRowIterator* _hash_row_it = NULL;
		DinoDatabaseFileHashesTable* _tmp119_;
		DinoDatabaseFileHashesTable* _tmp120_;
		QliteQueryBuilder* _tmp121_;
		QliteQueryBuilder* _tmp122_;
		DinoDatabaseFileHashesTable* _tmp123_;
		DinoDatabaseFileHashesTable* _tmp124_;
		QliteColumn* _tmp125_;
		gint _tmp126_;
		QliteQueryBuilder* _tmp127_;
		QliteQueryBuilder* _tmp128_;
		QliteRowIterator* _tmp129_;
		QliteRowIterator* _tmp130_;
		_tmp119_ = dino_database_get_file_hashes (db);
		_tmp120_ = _tmp119_;
		_tmp121_ = qlite_table_select ((QliteTable*) _tmp120_, NULL, (gint) 0);
		_tmp122_ = _tmp121_;
		_tmp123_ = dino_database_get_file_hashes (db);
		_tmp124_ = _tmp123_;
		_tmp125_ = _tmp124_->id;
		_tmp126_ = self->priv->_id;
		_tmp127_ = qlite_query_builder_with (_tmp122_, G_TYPE_INT, NULL, NULL, _tmp125_, "=", (gpointer) ((gintptr) _tmp126_));
		_tmp128_ = _tmp127_;
		_tmp129_ = qlite_query_builder_iterator (_tmp128_);
		_tmp130_ = _tmp129_;
		_qlite_statement_builder_unref0 (_tmp128_);
		_qlite_statement_builder_unref0 (_tmp122_);
		_hash_row_it = _tmp130_;
		while (TRUE) {
			QliteRowIterator* _tmp131_;
			QliteRow* hash_row = NULL;
			QliteRowIterator* _tmp132_;
			QliteRow* _tmp133_;
			XmppXepCryptographicHashesHash* hash = NULL;
			XmppXepCryptographicHashesHash* _tmp134_;
			XmppXepCryptographicHashesHash* _tmp135_;
			QliteRow* _tmp136_;
			DinoDatabaseFileHashesTable* _tmp137_;
			DinoDatabaseFileHashesTable* _tmp138_;
			QliteColumn* _tmp139_;
			gpointer _tmp140_;
			XmppXepCryptographicHashesHash* _tmp141_;
			QliteRow* _tmp142_;
			DinoDatabaseFileHashesTable* _tmp143_;
			DinoDatabaseFileHashesTable* _tmp144_;
			QliteColumn* _tmp145_;
			gpointer _tmp146_;
			GeeList* _tmp147_;
			XmppXepCryptographicHashesHash* _tmp148_;
			_tmp131_ = _hash_row_it;
			if (!qlite_row_iterator_next (_tmp131_)) {
				break;
			}
			_tmp132_ = _hash_row_it;
			_tmp133_ = qlite_row_iterator_get (_tmp132_);
			hash_row = _tmp133_;
			_tmp134_ = xmpp_xep_cryptographic_hashes_hash_new ();
			hash = _tmp134_;
			_tmp135_ = hash;
			_tmp136_ = hash_row;
			_tmp137_ = dino_database_get_file_hashes (db);
			_tmp138_ = _tmp137_;
			_tmp139_ = _tmp138_->algo;
			_tmp140_ = qlite_row_get (_tmp136_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp139_);
			_g_free0 (_tmp135_->algo);
			_tmp135_->algo = (gchar*) _tmp140_;
			_tmp141_ = hash;
			_tmp142_ = hash_row;
			_tmp143_ = dino_database_get_file_hashes (db);
			_tmp144_ = _tmp143_;
			_tmp145_ = _tmp144_->value;
			_tmp146_ = qlite_row_get (_tmp142_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp145_);
			_g_free0 (_tmp141_->val);
			_tmp141_->val = (gchar*) _tmp146_;
			_tmp147_ = self->hashes;
			_tmp148_ = hash;
			gee_collection_add ((GeeCollection*) _tmp147_, _tmp148_);
			_g_object_unref0 (hash);
			_qlite_row_unref0 (hash_row);
		}
		_qlite_row_iterator_unref0 (_hash_row_it);
	}
	{
		QliteRowIterator* _thumbnail_row_it = NULL;
		DinoDatabaseFileThumbnailsTable* _tmp149_;
		DinoDatabaseFileThumbnailsTable* _tmp150_;
		QliteQueryBuilder* _tmp151_;
		QliteQueryBuilder* _tmp152_;
		DinoDatabaseFileThumbnailsTable* _tmp153_;
		DinoDatabaseFileThumbnailsTable* _tmp154_;
		QliteColumn* _tmp155_;
		gint _tmp156_;
		QliteQueryBuilder* _tmp157_;
		QliteQueryBuilder* _tmp158_;
		QliteRowIterator* _tmp159_;
		QliteRowIterator* _tmp160_;
		_tmp149_ = dino_database_get_file_thumbnails (db);
		_tmp150_ = _tmp149_;
		_tmp151_ = qlite_table_select ((QliteTable*) _tmp150_, NULL, (gint) 0);
		_tmp152_ = _tmp151_;
		_tmp153_ = dino_database_get_file_thumbnails (db);
		_tmp154_ = _tmp153_;
		_tmp155_ = _tmp154_->id;
		_tmp156_ = self->priv->_id;
		_tmp157_ = qlite_query_builder_with (_tmp152_, G_TYPE_INT, NULL, NULL, _tmp155_, "=", (gpointer) ((gintptr) _tmp156_));
		_tmp158_ = _tmp157_;
		_tmp159_ = qlite_query_builder_iterator (_tmp158_);
		_tmp160_ = _tmp159_;
		_qlite_statement_builder_unref0 (_tmp158_);
		_qlite_statement_builder_unref0 (_tmp152_);
		_thumbnail_row_it = _tmp160_;
		while (TRUE) {
			QliteRowIterator* _tmp161_;
			QliteRow* thumbnail_row = NULL;
			QliteRowIterator* _tmp162_;
			QliteRow* _tmp163_;
			XmppXepJingleContentThumbnailsThumbnail* thumbnail = NULL;
			XmppXepJingleContentThumbnailsThumbnail* _tmp164_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp165_;
			QliteRow* _tmp166_;
			DinoDatabaseFileThumbnailsTable* _tmp167_;
			DinoDatabaseFileThumbnailsTable* _tmp168_;
			QliteColumn* _tmp169_;
			gpointer _tmp170_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp171_;
			QliteRow* _tmp172_;
			DinoDatabaseFileThumbnailsTable* _tmp173_;
			DinoDatabaseFileThumbnailsTable* _tmp174_;
			QliteColumn* _tmp175_;
			gpointer _tmp176_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp177_;
			QliteRow* _tmp178_;
			DinoDatabaseFileThumbnailsTable* _tmp179_;
			DinoDatabaseFileThumbnailsTable* _tmp180_;
			QliteColumn* _tmp181_;
			gpointer _tmp182_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp183_;
			QliteRow* _tmp184_;
			DinoDatabaseFileThumbnailsTable* _tmp185_;
			DinoDatabaseFileThumbnailsTable* _tmp186_;
			QliteColumn* _tmp187_;
			gpointer _tmp188_;
			GeeList* _tmp189_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp190_;
			_tmp161_ = _thumbnail_row_it;
			if (!qlite_row_iterator_next (_tmp161_)) {
				break;
			}
			_tmp162_ = _thumbnail_row_it;
			_tmp163_ = qlite_row_iterator_get (_tmp162_);
			thumbnail_row = _tmp163_;
			_tmp164_ = xmpp_xep_jingle_content_thumbnails_thumbnail_new ();
			thumbnail = _tmp164_;
			_tmp165_ = thumbnail;
			_tmp166_ = thumbnail_row;
			_tmp167_ = dino_database_get_file_thumbnails (db);
			_tmp168_ = _tmp167_;
			_tmp169_ = _tmp168_->uri;
			_tmp170_ = qlite_row_get (_tmp166_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp169_);
			_g_free0 (_tmp165_->uri);
			_tmp165_->uri = (gchar*) _tmp170_;
			_tmp171_ = thumbnail;
			_tmp172_ = thumbnail_row;
			_tmp173_ = dino_database_get_file_thumbnails (db);
			_tmp174_ = _tmp173_;
			_tmp175_ = _tmp174_->mime_type;
			_tmp176_ = qlite_row_get (_tmp172_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp175_);
			_g_free0 (_tmp171_->media_type);
			_tmp171_->media_type = (gchar*) _tmp176_;
			_tmp177_ = thumbnail;
			_tmp178_ = thumbnail_row;
			_tmp179_ = dino_database_get_file_thumbnails (db);
			_tmp180_ = _tmp179_;
			_tmp181_ = _tmp180_->width;
			_tmp182_ = qlite_row_get (_tmp178_, G_TYPE_INT, NULL, NULL, _tmp181_);
			_tmp177_->width = (gint) ((gintptr) _tmp182_);
			_tmp183_ = thumbnail;
			_tmp184_ = thumbnail_row;
			_tmp185_ = dino_database_get_file_thumbnails (db);
			_tmp186_ = _tmp185_;
			_tmp187_ = _tmp186_->height;
			_tmp188_ = qlite_row_get (_tmp184_, G_TYPE_INT, NULL, NULL, _tmp187_);
			_tmp183_->height = (gint) ((gintptr) _tmp188_);
			_tmp189_ = self->thumbnails;
			_tmp190_ = thumbnail;
			gee_collection_add ((GeeCollection*) _tmp189_, _tmp190_);
			_xmpp_xep_jingle_content_thumbnails_thumbnail_unref0 (thumbnail);
			_qlite_row_unref0 (thumbnail_row);
		}
		_qlite_row_iterator_unref0 (_thumbnail_row_it);
	}
	{
		QliteRowIterator* _source_row_it = NULL;
		DinoDatabaseSourcesTable* _tmp191_;
		DinoDatabaseSourcesTable* _tmp192_;
		QliteQueryBuilder* _tmp193_;
		QliteQueryBuilder* _tmp194_;
		DinoDatabaseSourcesTable* _tmp195_;
		DinoDatabaseSourcesTable* _tmp196_;
		QliteColumn* _tmp197_;
		gint _tmp198_;
		QliteQueryBuilder* _tmp199_;
		QliteQueryBuilder* _tmp200_;
		QliteRowIterator* _tmp201_;
		QliteRowIterator* _tmp202_;
		_tmp191_ = dino_database_get_sfs_sources (db);
		_tmp192_ = _tmp191_;
		_tmp193_ = qlite_table_select ((QliteTable*) _tmp192_, NULL, (gint) 0);
		_tmp194_ = _tmp193_;
		_tmp195_ = dino_database_get_sfs_sources (db);
		_tmp196_ = _tmp195_;
		_tmp197_ = _tmp196_->file_transfer_id;
		_tmp198_ = self->priv->_id;
		_tmp199_ = qlite_query_builder_with (_tmp194_, G_TYPE_INT, NULL, NULL, _tmp197_, "=", (gpointer) ((gintptr) _tmp198_));
		_tmp200_ = _tmp199_;
		_tmp201_ = qlite_query_builder_iterator (_tmp200_);
		_tmp202_ = _tmp201_;
		_qlite_statement_builder_unref0 (_tmp200_);
		_qlite_statement_builder_unref0 (_tmp194_);
		_source_row_it = _tmp202_;
		while (TRUE) {
			QliteRowIterator* _tmp203_;
			QliteRow* source_row = NULL;
			QliteRowIterator* _tmp204_;
			QliteRow* _tmp205_;
			QliteRow* _tmp206_;
			DinoDatabaseSourcesTable* _tmp207_;
			DinoDatabaseSourcesTable* _tmp208_;
			QliteColumn* _tmp209_;
			gpointer _tmp210_;
			gchar* _tmp211_;
			gboolean _tmp212_;
			_tmp203_ = _source_row_it;
			if (!qlite_row_iterator_next (_tmp203_)) {
				break;
			}
			_tmp204_ = _source_row_it;
			_tmp205_ = qlite_row_iterator_get (_tmp204_);
			source_row = _tmp205_;
			_tmp206_ = source_row;
			_tmp207_ = dino_database_get_sfs_sources (db);
			_tmp208_ = _tmp207_;
			_tmp209_ = _tmp208_->type;
			_tmp210_ = qlite_row_get (_tmp206_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp209_);
			_tmp211_ = (gchar*) _tmp210_;
			_tmp212_ = g_strcmp0 (_tmp211_, "http") == 0;
			_g_free0 (_tmp211_);
			if (_tmp212_) {
				GeeList* _tmp213_;
				QliteRow* _tmp214_;
				DinoDatabaseSourcesTable* _tmp215_;
				DinoDatabaseSourcesTable* _tmp216_;
				QliteColumn* _tmp217_;
				gpointer _tmp218_;
				XmppXepStatelessFileSharingHttpSource* _tmp219_ = NULL;
				XmppXepStatelessFileSharingHttpSource* _tmp220_;
				_tmp213_ = self->sfs_sources;
				_tmp214_ = source_row;
				_tmp215_ = dino_database_get_sfs_sources (db);
				_tmp216_ = _tmp215_;
				_tmp217_ = _tmp216_->data;
				_tmp218_ = qlite_row_get (_tmp214_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp217_);
				_tmp219_ = xmpp_xep_stateless_file_sharing_http_source_new ();
				xmpp_xep_stateless_file_sharing_http_source_set_url (_tmp219_, (gchar*) _tmp218_);
				_g_free0 (_tmp218_);
				_tmp220_ = _tmp219_;
				gee_collection_add ((GeeCollection*) _tmp213_, (XmppXepStatelessFileSharingSource*) _tmp220_);
				_g_object_unref0 (_tmp220_);
			}
			_qlite_row_unref0 (source_row);
		}
		_qlite_row_iterator_unref0 (_source_row_it);
	}
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _dino_entities_file_transfer_on_update_g_object_notify, self, 0);
	_g_free0 (our_resource);
	_g_free0 (counterpart_resource);
	_xmpp_jid_unref0 (_tmp17_);
	return self;
}

DinoEntitiesFileTransfer*
dino_entities_file_transfer_new_from_row (DinoDatabase* db,
                                          QliteRow* row,
                                          const gchar* storage_dir,
                                          GError** error)
{
	return dino_entities_file_transfer_construct_from_row (DINO_ENTITIES_TYPE_FILE_TRANSFER, db, row, storage_dir, error);
}

void
dino_entities_file_transfer_persist (DinoEntitiesFileTransfer* self,
                                     DinoDatabase* db)
{
	gint _tmp0_;
	DinoDatabase* _tmp1_;
	QliteInsertBuilder* builder = NULL;
	DinoDatabaseFileTransferTable* _tmp2_;
	DinoDatabaseFileTransferTable* _tmp3_;
	QliteInsertBuilder* _tmp4_;
	QliteInsertBuilder* _tmp5_;
	DinoDatabaseFileTransferTable* _tmp6_;
	DinoDatabaseFileTransferTable* _tmp7_;
	QliteColumn* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	QliteInsertBuilder* _tmp12_;
	QliteInsertBuilder* _tmp13_;
	DinoDatabaseFileTransferTable* _tmp14_;
	DinoDatabaseFileTransferTable* _tmp15_;
	QliteColumn* _tmp16_;
	XmppJid* _tmp17_;
	QliteInsertBuilder* _tmp18_;
	QliteInsertBuilder* _tmp19_;
	DinoDatabaseFileTransferTable* _tmp20_;
	DinoDatabaseFileTransferTable* _tmp21_;
	QliteColumn* _tmp22_;
	XmppJid* _tmp23_;
	const gchar* _tmp24_;
	QliteInsertBuilder* _tmp25_;
	QliteInsertBuilder* _tmp26_;
	DinoDatabaseFileTransferTable* _tmp27_;
	DinoDatabaseFileTransferTable* _tmp28_;
	QliteColumn* _tmp29_;
	XmppJid* _tmp30_;
	const gchar* _tmp31_;
	QliteInsertBuilder* _tmp32_;
	QliteInsertBuilder* _tmp33_;
	DinoDatabaseFileTransferTable* _tmp34_;
	DinoDatabaseFileTransferTable* _tmp35_;
	QliteColumn* _tmp36_;
	gboolean _tmp37_;
	QliteInsertBuilder* _tmp38_;
	QliteInsertBuilder* _tmp39_;
	DinoDatabaseFileTransferTable* _tmp40_;
	DinoDatabaseFileTransferTable* _tmp41_;
	QliteColumn* _tmp42_;
	GDateTime* _tmp43_;
	QliteInsertBuilder* _tmp44_;
	QliteInsertBuilder* _tmp45_;
	DinoDatabaseFileTransferTable* _tmp46_;
	DinoDatabaseFileTransferTable* _tmp47_;
	QliteColumn* _tmp48_;
	GDateTime* _tmp49_;
	QliteInsertBuilder* _tmp50_;
	QliteInsertBuilder* _tmp51_;
	DinoDatabaseFileTransferTable* _tmp52_;
	DinoDatabaseFileTransferTable* _tmp53_;
	QliteColumn* _tmp54_;
	DinoEntitiesEncryption _tmp55_;
	QliteInsertBuilder* _tmp56_;
	QliteInsertBuilder* _tmp57_;
	DinoDatabaseFileTransferTable* _tmp58_;
	DinoDatabaseFileTransferTable* _tmp59_;
	QliteColumn* _tmp60_;
	const gchar* _tmp61_;
	const gchar* _tmp62_;
	QliteInsertBuilder* _tmp63_;
	QliteInsertBuilder* _tmp64_;
	DinoDatabaseFileTransferTable* _tmp65_;
	DinoDatabaseFileTransferTable* _tmp66_;
	QliteColumn* _tmp67_;
	gint64 _tmp68_;
	QliteInsertBuilder* _tmp69_;
	QliteInsertBuilder* _tmp70_;
	DinoDatabaseFileTransferTable* _tmp71_;
	DinoDatabaseFileTransferTable* _tmp72_;
	QliteColumn* _tmp73_;
	DinoEntitiesFileTransferState _tmp74_;
	QliteInsertBuilder* _tmp75_;
	QliteInsertBuilder* _tmp76_;
	DinoDatabaseFileTransferTable* _tmp77_;
	DinoDatabaseFileTransferTable* _tmp78_;
	QliteColumn* _tmp79_;
	gint _tmp80_;
	QliteInsertBuilder* _tmp81_;
	QliteInsertBuilder* _tmp82_;
	DinoDatabaseFileTransferTable* _tmp83_;
	DinoDatabaseFileTransferTable* _tmp84_;
	QliteColumn* _tmp85_;
	const gchar* _tmp86_;
	QliteInsertBuilder* _tmp87_;
	QliteInsertBuilder* _tmp88_;
	const gchar* _tmp89_;
	const gchar* _tmp97_;
	const gchar* _tmp105_;
	const gchar* _tmp113_;
	GDateTime* _tmp121_;
	gint _tmp129_;
	gint _tmp137_;
	gint64 _tmp145_;
	QliteInsertBuilder* _tmp153_;
	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_file_transfer (db);
	_tmp3_ = _tmp2_;
	_tmp4_ = qlite_table_insert ((QliteTable*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = dino_database_get_file_transfer (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_file_transfer (db);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_->counterpart_id;
	_tmp17_ = self->priv->_counterpart;
	_tmp18_ = qlite_insert_builder_value (_tmp13_, G_TYPE_INT, NULL, NULL, _tmp16_, (gpointer) ((gintptr) dino_database_get_jid_id (db, _tmp17_)));
	_tmp19_ = _tmp18_;
	_tmp20_ = dino_database_get_file_transfer (db);
	_tmp21_ = _tmp20_;
	_tmp22_ = _tmp21_->counterpart_resource;
	_tmp23_ = self->priv->_counterpart;
	_tmp24_ = _tmp23_->resourcepart;
	_tmp25_ = qlite_insert_builder_value (_tmp19_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp22_, _tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = dino_database_get_file_transfer (db);
	_tmp28_ = _tmp27_;
	_tmp29_ = _tmp28_->our_resource;
	_tmp30_ = self->priv->_ourpart;
	_tmp31_ = _tmp30_->resourcepart;
	_tmp32_ = qlite_insert_builder_value (_tmp26_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp29_, _tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = dino_database_get_file_transfer (db);
	_tmp35_ = _tmp34_;
	_tmp36_ = _tmp35_->direction;
	_tmp37_ = self->priv->_direction;
	_tmp38_ = qlite_insert_builder_value (_tmp33_, G_TYPE_BOOLEAN, NULL, NULL, _tmp36_, (gpointer) ((gintptr) _tmp37_));
	_tmp39_ = _tmp38_;
	_tmp40_ = dino_database_get_file_transfer (db);
	_tmp41_ = _tmp40_;
	_tmp42_ = _tmp41_->time;
	_tmp43_ = self->priv->_time;
	_tmp44_ = qlite_insert_builder_value (_tmp39_, G_TYPE_LONG, NULL, NULL, _tmp42_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp43_)));
	_tmp45_ = _tmp44_;
	_tmp46_ = dino_database_get_file_transfer (db);
	_tmp47_ = _tmp46_;
	_tmp48_ = _tmp47_->local_time;
	_tmp49_ = self->priv->_local_time;
	_tmp50_ = qlite_insert_builder_value (_tmp45_, G_TYPE_LONG, NULL, NULL, _tmp48_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp49_)));
	_tmp51_ = _tmp50_;
	_tmp52_ = dino_database_get_file_transfer (db);
	_tmp53_ = _tmp52_;
	_tmp54_ = _tmp53_->encryption;
	_tmp55_ = self->priv->_encryption;
	_tmp56_ = qlite_insert_builder_value (_tmp51_, G_TYPE_INT, NULL, NULL, _tmp54_, (gpointer) ((gintptr) _tmp55_));
	_tmp57_ = _tmp56_;
	_tmp58_ = dino_database_get_file_transfer (db);
	_tmp59_ = _tmp58_;
	_tmp60_ = _tmp59_->file_name;
	_tmp61_ = dino_entities_file_transfer_get_file_name (self);
	_tmp62_ = _tmp61_;
	_tmp63_ = qlite_insert_builder_value (_tmp57_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp60_, _tmp62_);
	_tmp64_ = _tmp63_;
	_tmp65_ = dino_database_get_file_transfer (db);
	_tmp66_ = _tmp65_;
	_tmp67_ = _tmp66_->size;
	_tmp68_ = self->priv->_size;
	_tmp69_ = qlite_insert_builder_value (_tmp64_, G_TYPE_LONG, NULL, NULL, _tmp67_, (gpointer) ((gintptr) _tmp68_));
	_tmp70_ = _tmp69_;
	_tmp71_ = dino_database_get_file_transfer (db);
	_tmp72_ = _tmp71_;
	_tmp73_ = _tmp72_->state;
	_tmp74_ = self->priv->_state;
	_tmp75_ = qlite_insert_builder_value (_tmp70_, G_TYPE_INT, NULL, NULL, _tmp73_, (gpointer) ((gintptr) _tmp74_));
	_tmp76_ = _tmp75_;
	_tmp77_ = dino_database_get_file_transfer (db);
	_tmp78_ = _tmp77_;
	_tmp79_ = _tmp78_->provider;
	_tmp80_ = self->priv->_provider;
	_tmp81_ = qlite_insert_builder_value (_tmp76_, G_TYPE_INT, NULL, NULL, _tmp79_, (gpointer) ((gintptr) _tmp80_));
	_tmp82_ = _tmp81_;
	_tmp83_ = dino_database_get_file_transfer (db);
	_tmp84_ = _tmp83_;
	_tmp85_ = _tmp84_->info;
	_tmp86_ = self->priv->_info;
	_tmp87_ = qlite_insert_builder_value (_tmp82_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp85_, _tmp86_);
	_tmp88_ = _tmp87_;
	_qlite_statement_builder_unref0 (_tmp82_);
	_qlite_statement_builder_unref0 (_tmp76_);
	_qlite_statement_builder_unref0 (_tmp70_);
	_qlite_statement_builder_unref0 (_tmp64_);
	_qlite_statement_builder_unref0 (_tmp57_);
	_qlite_statement_builder_unref0 (_tmp51_);
	_qlite_statement_builder_unref0 (_tmp45_);
	_qlite_statement_builder_unref0 (_tmp39_);
	_qlite_statement_builder_unref0 (_tmp33_);
	_qlite_statement_builder_unref0 (_tmp26_);
	_qlite_statement_builder_unref0 (_tmp19_);
	_qlite_statement_builder_unref0 (_tmp13_);
	_qlite_statement_builder_unref0 (_tmp5_);
	builder = _tmp88_;
	_tmp89_ = self->priv->_file_sharing_id;
	if (_tmp89_ != NULL) {
		QliteInsertBuilder* _tmp90_;
		DinoDatabaseFileTransferTable* _tmp91_;
		DinoDatabaseFileTransferTable* _tmp92_;
		QliteColumn* _tmp93_;
		const gchar* _tmp94_;
		QliteInsertBuilder* _tmp95_;
		QliteInsertBuilder* _tmp96_;
		_tmp90_ = builder;
		_tmp91_ = dino_database_get_file_transfer (db);
		_tmp92_ = _tmp91_;
		_tmp93_ = _tmp92_->file_sharing_id;
		_tmp94_ = self->priv->_file_sharing_id;
		_tmp95_ = qlite_insert_builder_value (_tmp90_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp93_, _tmp94_);
		_tmp96_ = _tmp95_;
		_qlite_statement_builder_unref0 (_tmp96_);
	}
	_tmp97_ = self->priv->_path;
	if (_tmp97_ != NULL) {
		QliteInsertBuilder* _tmp98_;
		DinoDatabaseFileTransferTable* _tmp99_;
		DinoDatabaseFileTransferTable* _tmp100_;
		QliteColumn* _tmp101_;
		const gchar* _tmp102_;
		QliteInsertBuilder* _tmp103_;
		QliteInsertBuilder* _tmp104_;
		_tmp98_ = builder;
		_tmp99_ = dino_database_get_file_transfer (db);
		_tmp100_ = _tmp99_;
		_tmp101_ = _tmp100_->path;
		_tmp102_ = self->priv->_path;
		_tmp103_ = qlite_insert_builder_value (_tmp98_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp101_, _tmp102_);
		_tmp104_ = _tmp103_;
		_qlite_statement_builder_unref0 (_tmp104_);
	}
	_tmp105_ = self->priv->_mime_type;
	if (_tmp105_ != NULL) {
		QliteInsertBuilder* _tmp106_;
		DinoDatabaseFileTransferTable* _tmp107_;
		DinoDatabaseFileTransferTable* _tmp108_;
		QliteColumn* _tmp109_;
		const gchar* _tmp110_;
		QliteInsertBuilder* _tmp111_;
		QliteInsertBuilder* _tmp112_;
		_tmp106_ = builder;
		_tmp107_ = dino_database_get_file_transfer (db);
		_tmp108_ = _tmp107_;
		_tmp109_ = _tmp108_->mime_type;
		_tmp110_ = self->priv->_mime_type;
		_tmp111_ = qlite_insert_builder_value (_tmp106_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp109_, _tmp110_);
		_tmp112_ = _tmp111_;
		_qlite_statement_builder_unref0 (_tmp112_);
	}
	_tmp113_ = self->priv->_path;
	if (_tmp113_ != NULL) {
		QliteInsertBuilder* _tmp114_;
		DinoDatabaseFileTransferTable* _tmp115_;
		DinoDatabaseFileTransferTable* _tmp116_;
		QliteColumn* _tmp117_;
		const gchar* _tmp118_;
		QliteInsertBuilder* _tmp119_;
		QliteInsertBuilder* _tmp120_;
		_tmp114_ = builder;
		_tmp115_ = dino_database_get_file_transfer (db);
		_tmp116_ = _tmp115_;
		_tmp117_ = _tmp116_->path;
		_tmp118_ = self->priv->_path;
		_tmp119_ = qlite_insert_builder_value (_tmp114_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp117_, _tmp118_);
		_tmp120_ = _tmp119_;
		_qlite_statement_builder_unref0 (_tmp120_);
	}
	_tmp121_ = self->priv->_modification_date;
	if (_tmp121_ != NULL) {
		QliteInsertBuilder* _tmp122_;
		DinoDatabaseFileTransferTable* _tmp123_;
		DinoDatabaseFileTransferTable* _tmp124_;
		QliteColumn* _tmp125_;
		GDateTime* _tmp126_;
		QliteInsertBuilder* _tmp127_;
		QliteInsertBuilder* _tmp128_;
		_tmp122_ = builder;
		_tmp123_ = dino_database_get_file_transfer (db);
		_tmp124_ = _tmp123_;
		_tmp125_ = _tmp124_->modification_date;
		_tmp126_ = self->priv->_modification_date;
		_tmp127_ = qlite_insert_builder_value (_tmp122_, G_TYPE_LONG, NULL, NULL, _tmp125_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp126_)));
		_tmp128_ = _tmp127_;
		_qlite_statement_builder_unref0 (_tmp128_);
	}
	_tmp129_ = self->priv->_width;
	if (_tmp129_ != -1) {
		QliteInsertBuilder* _tmp130_;
		DinoDatabaseFileTransferTable* _tmp131_;
		DinoDatabaseFileTransferTable* _tmp132_;
		QliteColumn* _tmp133_;
		gint _tmp134_;
		QliteInsertBuilder* _tmp135_;
		QliteInsertBuilder* _tmp136_;
		_tmp130_ = builder;
		_tmp131_ = dino_database_get_file_transfer (db);
		_tmp132_ = _tmp131_;
		_tmp133_ = _tmp132_->width;
		_tmp134_ = self->priv->_width;
		_tmp135_ = qlite_insert_builder_value (_tmp130_, G_TYPE_INT, NULL, NULL, _tmp133_, (gpointer) ((gintptr) _tmp134_));
		_tmp136_ = _tmp135_;
		_qlite_statement_builder_unref0 (_tmp136_);
	}
	_tmp137_ = self->priv->_height;
	if (_tmp137_ != -1) {
		QliteInsertBuilder* _tmp138_;
		DinoDatabaseFileTransferTable* _tmp139_;
		DinoDatabaseFileTransferTable* _tmp140_;
		QliteColumn* _tmp141_;
		gint _tmp142_;
		QliteInsertBuilder* _tmp143_;
		QliteInsertBuilder* _tmp144_;
		_tmp138_ = builder;
		_tmp139_ = dino_database_get_file_transfer (db);
		_tmp140_ = _tmp139_;
		_tmp141_ = _tmp140_->height;
		_tmp142_ = self->priv->_height;
		_tmp143_ = qlite_insert_builder_value (_tmp138_, G_TYPE_INT, NULL, NULL, _tmp141_, (gpointer) ((gintptr) _tmp142_));
		_tmp144_ = _tmp143_;
		_qlite_statement_builder_unref0 (_tmp144_);
	}
	_tmp145_ = self->priv->_length;
	if (_tmp145_ != ((gint64) -1)) {
		QliteInsertBuilder* _tmp146_;
		DinoDatabaseFileTransferTable* _tmp147_;
		DinoDatabaseFileTransferTable* _tmp148_;
		QliteColumn* _tmp149_;
		gint64 _tmp150_;
		QliteInsertBuilder* _tmp151_;
		QliteInsertBuilder* _tmp152_;
		_tmp146_ = builder;
		_tmp147_ = dino_database_get_file_transfer (db);
		_tmp148_ = _tmp147_;
		_tmp149_ = _tmp148_->length;
		_tmp150_ = self->priv->_length;
		_tmp151_ = qlite_insert_builder_value (_tmp146_, G_TYPE_LONG, NULL, NULL, _tmp149_, (gpointer) ((gintptr) _tmp150_));
		_tmp152_ = _tmp151_;
		_qlite_statement_builder_unref0 (_tmp152_);
	}
	_tmp153_ = builder;
	dino_entities_file_transfer_set_id (self, (gint) qlite_insert_builder_perform (_tmp153_));
	{
		GeeList* _hash_list = NULL;
		GeeList* _tmp154_;
		gint _hash_size = 0;
		GeeList* _tmp155_;
		gint _tmp156_;
		gint _tmp157_;
		gint _hash_index = 0;
		_tmp154_ = self->hashes;
		_hash_list = _tmp154_;
		_tmp155_ = _hash_list;
		_tmp156_ = gee_collection_get_size ((GeeCollection*) _tmp155_);
		_tmp157_ = _tmp156_;
		_hash_size = _tmp157_;
		_hash_index = -1;
		while (TRUE) {
			gint _tmp158_;
			gint _tmp159_;
			XmppXepCryptographicHashesHash* hash = NULL;
			GeeList* _tmp160_;
			gpointer _tmp161_;
			DinoDatabaseFileHashesTable* _tmp162_;
			DinoDatabaseFileHashesTable* _tmp163_;
			QliteInsertBuilder* _tmp164_;
			QliteInsertBuilder* _tmp165_;
			DinoDatabaseFileHashesTable* _tmp166_;
			DinoDatabaseFileHashesTable* _tmp167_;
			QliteColumn* _tmp168_;
			gint _tmp169_;
			QliteInsertBuilder* _tmp170_;
			QliteInsertBuilder* _tmp171_;
			DinoDatabaseFileHashesTable* _tmp172_;
			DinoDatabaseFileHashesTable* _tmp173_;
			QliteColumn* _tmp174_;
			XmppXepCryptographicHashesHash* _tmp175_;
			const gchar* _tmp176_;
			QliteInsertBuilder* _tmp177_;
			QliteInsertBuilder* _tmp178_;
			DinoDatabaseFileHashesTable* _tmp179_;
			DinoDatabaseFileHashesTable* _tmp180_;
			QliteColumn* _tmp181_;
			XmppXepCryptographicHashesHash* _tmp182_;
			const gchar* _tmp183_;
			QliteInsertBuilder* _tmp184_;
			QliteInsertBuilder* _tmp185_;
			_hash_index = _hash_index + 1;
			_tmp158_ = _hash_index;
			_tmp159_ = _hash_size;
			if (!(_tmp158_ < _tmp159_)) {
				break;
			}
			_tmp160_ = _hash_list;
			_tmp161_ = gee_list_get (_tmp160_, _hash_index);
			hash = (XmppXepCryptographicHashesHash*) _tmp161_;
			_tmp162_ = dino_database_get_file_hashes (db);
			_tmp163_ = _tmp162_;
			_tmp164_ = qlite_table_insert ((QliteTable*) _tmp163_);
			_tmp165_ = _tmp164_;
			_tmp166_ = dino_database_get_file_hashes (db);
			_tmp167_ = _tmp166_;
			_tmp168_ = _tmp167_->id;
			_tmp169_ = self->priv->_id;
			_tmp170_ = qlite_insert_builder_value (_tmp165_, G_TYPE_INT, NULL, NULL, _tmp168_, (gpointer) ((gintptr) _tmp169_));
			_tmp171_ = _tmp170_;
			_tmp172_ = dino_database_get_file_hashes (db);
			_tmp173_ = _tmp172_;
			_tmp174_ = _tmp173_->algo;
			_tmp175_ = hash;
			_tmp176_ = _tmp175_->algo;
			_tmp177_ = qlite_insert_builder_value (_tmp171_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp174_, _tmp176_);
			_tmp178_ = _tmp177_;
			_tmp179_ = dino_database_get_file_hashes (db);
			_tmp180_ = _tmp179_;
			_tmp181_ = _tmp180_->value;
			_tmp182_ = hash;
			_tmp183_ = _tmp182_->val;
			_tmp184_ = qlite_insert_builder_value (_tmp178_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp181_, _tmp183_);
			_tmp185_ = _tmp184_;
			qlite_insert_builder_perform (_tmp185_);
			_qlite_statement_builder_unref0 (_tmp185_);
			_qlite_statement_builder_unref0 (_tmp178_);
			_qlite_statement_builder_unref0 (_tmp171_);
			_qlite_statement_builder_unref0 (_tmp165_);
			_g_object_unref0 (hash);
		}
	}
	{
		GeeList* _thumbnail_list = NULL;
		GeeList* _tmp186_;
		gint _thumbnail_size = 0;
		GeeList* _tmp187_;
		gint _tmp188_;
		gint _tmp189_;
		gint _thumbnail_index = 0;
		_tmp186_ = self->thumbnails;
		_thumbnail_list = _tmp186_;
		_tmp187_ = _thumbnail_list;
		_tmp188_ = gee_collection_get_size ((GeeCollection*) _tmp187_);
		_tmp189_ = _tmp188_;
		_thumbnail_size = _tmp189_;
		_thumbnail_index = -1;
		while (TRUE) {
			gint _tmp190_;
			gint _tmp191_;
			XmppXepJingleContentThumbnailsThumbnail* thumbnail = NULL;
			GeeList* _tmp192_;
			gpointer _tmp193_;
			DinoDatabaseFileThumbnailsTable* _tmp194_;
			DinoDatabaseFileThumbnailsTable* _tmp195_;
			QliteInsertBuilder* _tmp196_;
			QliteInsertBuilder* _tmp197_;
			DinoDatabaseFileThumbnailsTable* _tmp198_;
			DinoDatabaseFileThumbnailsTable* _tmp199_;
			QliteColumn* _tmp200_;
			gint _tmp201_;
			QliteInsertBuilder* _tmp202_;
			QliteInsertBuilder* _tmp203_;
			DinoDatabaseFileThumbnailsTable* _tmp204_;
			DinoDatabaseFileThumbnailsTable* _tmp205_;
			QliteColumn* _tmp206_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp207_;
			const gchar* _tmp208_;
			QliteInsertBuilder* _tmp209_;
			QliteInsertBuilder* _tmp210_;
			DinoDatabaseFileThumbnailsTable* _tmp211_;
			DinoDatabaseFileThumbnailsTable* _tmp212_;
			QliteColumn* _tmp213_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp214_;
			const gchar* _tmp215_;
			QliteInsertBuilder* _tmp216_;
			QliteInsertBuilder* _tmp217_;
			DinoDatabaseFileThumbnailsTable* _tmp218_;
			DinoDatabaseFileThumbnailsTable* _tmp219_;
			QliteColumn* _tmp220_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp221_;
			QliteInsertBuilder* _tmp222_;
			QliteInsertBuilder* _tmp223_;
			DinoDatabaseFileThumbnailsTable* _tmp224_;
			DinoDatabaseFileThumbnailsTable* _tmp225_;
			QliteColumn* _tmp226_;
			XmppXepJingleContentThumbnailsThumbnail* _tmp227_;
			QliteInsertBuilder* _tmp228_;
			QliteInsertBuilder* _tmp229_;
			_thumbnail_index = _thumbnail_index + 1;
			_tmp190_ = _thumbnail_index;
			_tmp191_ = _thumbnail_size;
			if (!(_tmp190_ < _tmp191_)) {
				break;
			}
			_tmp192_ = _thumbnail_list;
			_tmp193_ = gee_list_get (_tmp192_, _thumbnail_index);
			thumbnail = (XmppXepJingleContentThumbnailsThumbnail*) _tmp193_;
			_tmp194_ = dino_database_get_file_thumbnails (db);
			_tmp195_ = _tmp194_;
			_tmp196_ = qlite_table_insert ((QliteTable*) _tmp195_);
			_tmp197_ = _tmp196_;
			_tmp198_ = dino_database_get_file_thumbnails (db);
			_tmp199_ = _tmp198_;
			_tmp200_ = _tmp199_->id;
			_tmp201_ = self->priv->_id;
			_tmp202_ = qlite_insert_builder_value (_tmp197_, G_TYPE_INT, NULL, NULL, _tmp200_, (gpointer) ((gintptr) _tmp201_));
			_tmp203_ = _tmp202_;
			_tmp204_ = dino_database_get_file_thumbnails (db);
			_tmp205_ = _tmp204_;
			_tmp206_ = _tmp205_->uri;
			_tmp207_ = thumbnail;
			_tmp208_ = _tmp207_->uri;
			_tmp209_ = qlite_insert_builder_value (_tmp203_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp206_, _tmp208_);
			_tmp210_ = _tmp209_;
			_tmp211_ = dino_database_get_file_thumbnails (db);
			_tmp212_ = _tmp211_;
			_tmp213_ = _tmp212_->mime_type;
			_tmp214_ = thumbnail;
			_tmp215_ = _tmp214_->media_type;
			_tmp216_ = qlite_insert_builder_value (_tmp210_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp213_, _tmp215_);
			_tmp217_ = _tmp216_;
			_tmp218_ = dino_database_get_file_thumbnails (db);
			_tmp219_ = _tmp218_;
			_tmp220_ = _tmp219_->width;
			_tmp221_ = thumbnail;
			_tmp222_ = qlite_insert_builder_value (_tmp217_, G_TYPE_INT, NULL, NULL, _tmp220_, (gpointer) ((gintptr) _tmp221_->width));
			_tmp223_ = _tmp222_;
			_tmp224_ = dino_database_get_file_thumbnails (db);
			_tmp225_ = _tmp224_;
			_tmp226_ = _tmp225_->height;
			_tmp227_ = thumbnail;
			_tmp228_ = qlite_insert_builder_value (_tmp223_, G_TYPE_INT, NULL, NULL, _tmp226_, (gpointer) ((gintptr) _tmp227_->height));
			_tmp229_ = _tmp228_;
			qlite_insert_builder_perform (_tmp229_);
			_qlite_statement_builder_unref0 (_tmp229_);
			_qlite_statement_builder_unref0 (_tmp223_);
			_qlite_statement_builder_unref0 (_tmp217_);
			_qlite_statement_builder_unref0 (_tmp210_);
			_qlite_statement_builder_unref0 (_tmp203_);
			_qlite_statement_builder_unref0 (_tmp197_);
			_xmpp_xep_jingle_content_thumbnails_thumbnail_unref0 (thumbnail);
		}
	}
	{
		GeeList* _source_list = NULL;
		GeeList* _tmp230_;
		gint _source_size = 0;
		GeeList* _tmp231_;
		gint _tmp232_;
		gint _tmp233_;
		gint _source_index = 0;
		_tmp230_ = self->sfs_sources;
		_source_list = _tmp230_;
		_tmp231_ = _source_list;
		_tmp232_ = gee_collection_get_size ((GeeCollection*) _tmp231_);
		_tmp233_ = _tmp232_;
		_source_size = _tmp233_;
		_source_index = -1;
		while (TRUE) {
			gint _tmp234_;
			gint _tmp235_;
			XmppXepStatelessFileSharingSource* source = NULL;
			GeeList* _tmp236_;
			gpointer _tmp237_;
			XmppXepStatelessFileSharingSource* _tmp238_;
			_source_index = _source_index + 1;
			_tmp234_ = _source_index;
			_tmp235_ = _source_size;
			if (!(_tmp234_ < _tmp235_)) {
				break;
			}
			_tmp236_ = _source_list;
			_tmp237_ = gee_list_get (_tmp236_, _source_index);
			source = (XmppXepStatelessFileSharingSource*) _tmp237_;
			_tmp238_ = source;
			dino_entities_file_transfer_persist_source (self, _tmp238_);
			_g_object_unref0 (source);
		}
	}
	g_signal_connect_object ((GObject*) self, "notify", (GCallback) _dino_entities_file_transfer_on_update_g_object_notify, self, 0);
	_qlite_statement_builder_unref0 (builder);
}

void
dino_entities_file_transfer_add_sfs_source (DinoEntitiesFileTransfer* self,
                                            XmppXepStatelessFileSharingSource* source)
{
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	_tmp0_ = self->sfs_sources;
	if (gee_collection_contains ((GeeCollection*) _tmp0_, source)) {
		return;
	}
	_tmp1_ = self->sfs_sources;
	gee_collection_add ((GeeCollection*) _tmp1_, source);
	_tmp2_ = self->priv->_id;
	if (_tmp2_ != -1) {
		dino_entities_file_transfer_persist_source (self, source);
	}
	g_signal_emit (self, dino_entities_file_transfer_signals[DINO_ENTITIES_FILE_TRANSFER_SOURCES_CHANGED_SIGNAL], 0);
}

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

static void
dino_entities_file_transfer_persist_source (DinoEntitiesFileTransfer* self,
                                            XmppXepStatelessFileSharingSource* source)
{
	XmppXepStatelessFileSharingHttpSource* http_source = NULL;
	XmppXepStatelessFileSharingHttpSource* _tmp0_;
	XmppXepStatelessFileSharingHttpSource* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (source, XMPP_XEP_STATELESS_FILE_SHARING_TYPE_HTTP_SOURCE) ? ((XmppXepStatelessFileSharingHttpSource*) source) : NULL);
	http_source = _tmp0_;
	_tmp1_ = http_source;
	if (_tmp1_ != NULL) {
		DinoDatabase* _tmp2_;
		DinoDatabaseSourcesTable* _tmp3_;
		DinoDatabaseSourcesTable* _tmp4_;
		QliteInsertBuilder* _tmp5_;
		QliteInsertBuilder* _tmp6_;
		DinoDatabase* _tmp7_;
		DinoDatabaseSourcesTable* _tmp8_;
		DinoDatabaseSourcesTable* _tmp9_;
		QliteColumn* _tmp10_;
		gint _tmp11_;
		QliteInsertBuilder* _tmp12_;
		QliteInsertBuilder* _tmp13_;
		DinoDatabase* _tmp14_;
		DinoDatabaseSourcesTable* _tmp15_;
		DinoDatabaseSourcesTable* _tmp16_;
		QliteColumn* _tmp17_;
		QliteInsertBuilder* _tmp18_;
		QliteInsertBuilder* _tmp19_;
		DinoDatabase* _tmp20_;
		DinoDatabaseSourcesTable* _tmp21_;
		DinoDatabaseSourcesTable* _tmp22_;
		QliteColumn* _tmp23_;
		XmppXepStatelessFileSharingHttpSource* _tmp24_;
		const gchar* _tmp25_;
		const gchar* _tmp26_;
		QliteInsertBuilder* _tmp27_;
		QliteInsertBuilder* _tmp28_;
		_tmp2_ = self->priv->db;
		_tmp3_ = dino_database_get_sfs_sources (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = qlite_table_insert ((QliteTable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = self->priv->db;
		_tmp8_ = dino_database_get_sfs_sources (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_->file_transfer_id;
		_tmp11_ = self->priv->_id;
		_tmp12_ = qlite_insert_builder_value (_tmp6_, G_TYPE_INT, NULL, NULL, _tmp10_, (gpointer) ((gintptr) _tmp11_));
		_tmp13_ = _tmp12_;
		_tmp14_ = self->priv->db;
		_tmp15_ = dino_database_get_sfs_sources (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = _tmp16_->type;
		_tmp18_ = qlite_insert_builder_value (_tmp13_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp17_, "http");
		_tmp19_ = _tmp18_;
		_tmp20_ = self->priv->db;
		_tmp21_ = dino_database_get_sfs_sources (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = _tmp22_->data;
		_tmp24_ = http_source;
		_tmp25_ = xmpp_xep_stateless_file_sharing_http_source_get_url (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = qlite_insert_builder_value (_tmp19_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp23_, _tmp26_);
		_tmp28_ = _tmp27_;
		qlite_insert_builder_perform (_tmp28_);
		_qlite_statement_builder_unref0 (_tmp28_);
		_qlite_statement_builder_unref0 (_tmp19_);
		_qlite_statement_builder_unref0 (_tmp13_);
		_qlite_statement_builder_unref0 (_tmp6_);
	}
	_g_object_unref0 (http_source);
}

GFile*
dino_entities_file_transfer_get_file (DinoEntitiesFileTransfer* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GFile* _tmp6_;
	GFile* _tmp7_;
	GFile* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_path;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = dino_get_storage_dir ();
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_path;
	_tmp4_ = g_build_filename (_tmp2_, "files", _tmp3_, NULL);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_file_new_for_path (_tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_g_free0 (_tmp2_);
	result = _tmp7_;
	return result;
}

static void
dino_entities_file_transfer_on_update (DinoEntitiesFileTransfer* self,
                                       GObject* o,
                                       GParamSpec* sp)
{
	QliteUpdateBuilder* update_builder = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseFileTransferTable* _tmp1_;
	DinoDatabaseFileTransferTable* _tmp2_;
	QliteUpdateBuilder* _tmp3_;
	QliteUpdateBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseFileTransferTable* _tmp6_;
	DinoDatabaseFileTransferTable* _tmp7_;
	QliteColumn* _tmp8_;
	gint _tmp9_;
	QliteUpdateBuilder* _tmp10_;
	QliteUpdateBuilder* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GQuark _tmp15_ = 0U;
	static GQuark _tmp14_label0 = 0;
	static GQuark _tmp14_label1 = 0;
	static GQuark _tmp14_label2 = 0;
	static GQuark _tmp14_label3 = 0;
	static GQuark _tmp14_label4 = 0;
	static GQuark _tmp14_label5 = 0;
	static GQuark _tmp14_label6 = 0;
	static GQuark _tmp14_label7 = 0;
	static GQuark _tmp14_label8 = 0;
	static GQuark _tmp14_label9 = 0;
	static GQuark _tmp14_label10 = 0;
	static GQuark _tmp14_label11 = 0;
	static GQuark _tmp14_label12 = 0;
	static GQuark _tmp14_label13 = 0;
	static GQuark _tmp14_label14 = 0;
	static GQuark _tmp14_label15 = 0;
	static GQuark _tmp14_label16 = 0;
	static GQuark _tmp14_label17 = 0;
	QliteUpdateBuilder* _tmp173_;
	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_file_transfer (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_update ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->db;
	_tmp6_ = dino_database_get_file_transfer (_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 ("file-sharing-id")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp16_;
				DinoDatabase* _tmp17_;
				DinoDatabaseFileTransferTable* _tmp18_;
				DinoDatabaseFileTransferTable* _tmp19_;
				QliteColumn* _tmp20_;
				const gchar* _tmp21_;
				QliteUpdateBuilder* _tmp22_;
				QliteUpdateBuilder* _tmp23_;
				_tmp16_ = update_builder;
				_tmp17_ = self->priv->db;
				_tmp18_ = dino_database_get_file_transfer (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = _tmp19_->file_sharing_id;
				_tmp21_ = self->priv->_file_sharing_id;
				_tmp22_ = qlite_update_builder_set (_tmp16_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp20_, _tmp21_);
				_tmp23_ = _tmp22_;
				_qlite_statement_builder_unref0 (_tmp23_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label1) ? _tmp14_label1 : (_tmp14_label1 = g_quark_from_static_string ("counterpart")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp24_;
				DinoDatabase* _tmp25_;
				DinoDatabaseFileTransferTable* _tmp26_;
				DinoDatabaseFileTransferTable* _tmp27_;
				QliteColumn* _tmp28_;
				DinoDatabase* _tmp29_;
				XmppJid* _tmp30_;
				QliteUpdateBuilder* _tmp31_;
				QliteUpdateBuilder* _tmp32_;
				QliteUpdateBuilder* _tmp33_;
				DinoDatabase* _tmp34_;
				DinoDatabaseFileTransferTable* _tmp35_;
				DinoDatabaseFileTransferTable* _tmp36_;
				QliteColumn* _tmp37_;
				XmppJid* _tmp38_;
				const gchar* _tmp39_;
				QliteUpdateBuilder* _tmp40_;
				QliteUpdateBuilder* _tmp41_;
				_tmp24_ = update_builder;
				_tmp25_ = self->priv->db;
				_tmp26_ = dino_database_get_file_transfer (_tmp25_);
				_tmp27_ = _tmp26_;
				_tmp28_ = _tmp27_->counterpart_id;
				_tmp29_ = self->priv->db;
				_tmp30_ = self->priv->_counterpart;
				_tmp31_ = qlite_update_builder_set (_tmp24_, G_TYPE_INT, NULL, NULL, _tmp28_, (gpointer) ((gintptr) dino_database_get_jid_id (_tmp29_, _tmp30_)));
				_tmp32_ = _tmp31_;
				_qlite_statement_builder_unref0 (_tmp32_);
				_tmp33_ = update_builder;
				_tmp34_ = self->priv->db;
				_tmp35_ = dino_database_get_file_transfer (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = _tmp36_->counterpart_resource;
				_tmp38_ = self->priv->_counterpart;
				_tmp39_ = _tmp38_->resourcepart;
				_tmp40_ = qlite_update_builder_set (_tmp33_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp37_, _tmp39_);
				_tmp41_ = _tmp40_;
				_qlite_statement_builder_unref0 (_tmp41_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label2) ? _tmp14_label2 : (_tmp14_label2 = g_quark_from_static_string ("ourpart")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp42_;
				DinoDatabase* _tmp43_;
				DinoDatabaseFileTransferTable* _tmp44_;
				DinoDatabaseFileTransferTable* _tmp45_;
				QliteColumn* _tmp46_;
				XmppJid* _tmp47_;
				const gchar* _tmp48_;
				QliteUpdateBuilder* _tmp49_;
				QliteUpdateBuilder* _tmp50_;
				_tmp42_ = update_builder;
				_tmp43_ = self->priv->db;
				_tmp44_ = dino_database_get_file_transfer (_tmp43_);
				_tmp45_ = _tmp44_;
				_tmp46_ = _tmp45_->our_resource;
				_tmp47_ = self->priv->_ourpart;
				_tmp48_ = _tmp47_->resourcepart;
				_tmp49_ = qlite_update_builder_set (_tmp42_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp46_, _tmp48_);
				_tmp50_ = _tmp49_;
				_qlite_statement_builder_unref0 (_tmp50_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label3) ? _tmp14_label3 : (_tmp14_label3 = g_quark_from_static_string ("direction")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp51_;
				DinoDatabase* _tmp52_;
				DinoDatabaseFileTransferTable* _tmp53_;
				DinoDatabaseFileTransferTable* _tmp54_;
				QliteColumn* _tmp55_;
				gboolean _tmp56_;
				QliteUpdateBuilder* _tmp57_;
				QliteUpdateBuilder* _tmp58_;
				_tmp51_ = update_builder;
				_tmp52_ = self->priv->db;
				_tmp53_ = dino_database_get_file_transfer (_tmp52_);
				_tmp54_ = _tmp53_;
				_tmp55_ = _tmp54_->direction;
				_tmp56_ = self->priv->_direction;
				_tmp57_ = qlite_update_builder_set (_tmp51_, G_TYPE_BOOLEAN, NULL, NULL, _tmp55_, (gpointer) ((gintptr) _tmp56_));
				_tmp58_ = _tmp57_;
				_qlite_statement_builder_unref0 (_tmp58_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label4) ? _tmp14_label4 : (_tmp14_label4 = g_quark_from_static_string ("time")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp59_;
				DinoDatabase* _tmp60_;
				DinoDatabaseFileTransferTable* _tmp61_;
				DinoDatabaseFileTransferTable* _tmp62_;
				QliteColumn* _tmp63_;
				GDateTime* _tmp64_;
				QliteUpdateBuilder* _tmp65_;
				QliteUpdateBuilder* _tmp66_;
				_tmp59_ = update_builder;
				_tmp60_ = self->priv->db;
				_tmp61_ = dino_database_get_file_transfer (_tmp60_);
				_tmp62_ = _tmp61_;
				_tmp63_ = _tmp62_->time;
				_tmp64_ = self->priv->_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 ("local-time")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp67_;
				DinoDatabase* _tmp68_;
				DinoDatabaseFileTransferTable* _tmp69_;
				DinoDatabaseFileTransferTable* _tmp70_;
				QliteColumn* _tmp71_;
				GDateTime* _tmp72_;
				QliteUpdateBuilder* _tmp73_;
				QliteUpdateBuilder* _tmp74_;
				_tmp67_ = update_builder;
				_tmp68_ = self->priv->db;
				_tmp69_ = dino_database_get_file_transfer (_tmp68_);
				_tmp70_ = _tmp69_;
				_tmp71_ = _tmp70_->local_time;
				_tmp72_ = self->priv->_local_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_;
				DinoDatabaseFileTransferTable* _tmp77_;
				DinoDatabaseFileTransferTable* _tmp78_;
				QliteColumn* _tmp79_;
				DinoEntitiesEncryption _tmp80_;
				QliteUpdateBuilder* _tmp81_;
				QliteUpdateBuilder* _tmp82_;
				_tmp75_ = update_builder;
				_tmp76_ = self->priv->db;
				_tmp77_ = dino_database_get_file_transfer (_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 ("file-name")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp83_;
				DinoDatabase* _tmp84_;
				DinoDatabaseFileTransferTable* _tmp85_;
				DinoDatabaseFileTransferTable* _tmp86_;
				QliteColumn* _tmp87_;
				const gchar* _tmp88_;
				const gchar* _tmp89_;
				QliteUpdateBuilder* _tmp90_;
				QliteUpdateBuilder* _tmp91_;
				_tmp83_ = update_builder;
				_tmp84_ = self->priv->db;
				_tmp85_ = dino_database_get_file_transfer (_tmp84_);
				_tmp86_ = _tmp85_;
				_tmp87_ = _tmp86_->file_name;
				_tmp88_ = dino_entities_file_transfer_get_file_name (self);
				_tmp89_ = _tmp88_;
				_tmp90_ = qlite_update_builder_set (_tmp83_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp87_, _tmp89_);
				_tmp91_ = _tmp90_;
				_qlite_statement_builder_unref0 (_tmp91_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label8) ? _tmp14_label8 : (_tmp14_label8 = g_quark_from_static_string ("path")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp92_;
				DinoDatabase* _tmp93_;
				DinoDatabaseFileTransferTable* _tmp94_;
				DinoDatabaseFileTransferTable* _tmp95_;
				QliteColumn* _tmp96_;
				const gchar* _tmp97_;
				QliteUpdateBuilder* _tmp98_;
				QliteUpdateBuilder* _tmp99_;
				_tmp92_ = update_builder;
				_tmp93_ = self->priv->db;
				_tmp94_ = dino_database_get_file_transfer (_tmp93_);
				_tmp95_ = _tmp94_;
				_tmp96_ = _tmp95_->path;
				_tmp97_ = self->priv->_path;
				_tmp98_ = qlite_update_builder_set (_tmp92_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp96_, _tmp97_);
				_tmp99_ = _tmp98_;
				_qlite_statement_builder_unref0 (_tmp99_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label9) ? _tmp14_label9 : (_tmp14_label9 = g_quark_from_static_string ("mime-type")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp100_;
				DinoDatabase* _tmp101_;
				DinoDatabaseFileTransferTable* _tmp102_;
				DinoDatabaseFileTransferTable* _tmp103_;
				QliteColumn* _tmp104_;
				const gchar* _tmp105_;
				QliteUpdateBuilder* _tmp106_;
				QliteUpdateBuilder* _tmp107_;
				_tmp100_ = update_builder;
				_tmp101_ = self->priv->db;
				_tmp102_ = dino_database_get_file_transfer (_tmp101_);
				_tmp103_ = _tmp102_;
				_tmp104_ = _tmp103_->mime_type;
				_tmp105_ = self->priv->_mime_type;
				_tmp106_ = qlite_update_builder_set (_tmp100_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp104_, _tmp105_);
				_tmp107_ = _tmp106_;
				_qlite_statement_builder_unref0 (_tmp107_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label10) ? _tmp14_label10 : (_tmp14_label10 = g_quark_from_static_string ("size")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp108_;
				DinoDatabase* _tmp109_;
				DinoDatabaseFileTransferTable* _tmp110_;
				DinoDatabaseFileTransferTable* _tmp111_;
				QliteColumn* _tmp112_;
				gint64 _tmp113_;
				QliteUpdateBuilder* _tmp114_;
				QliteUpdateBuilder* _tmp115_;
				_tmp108_ = update_builder;
				_tmp109_ = self->priv->db;
				_tmp110_ = dino_database_get_file_transfer (_tmp109_);
				_tmp111_ = _tmp110_;
				_tmp112_ = _tmp111_->size;
				_tmp113_ = self->priv->_size;
				_tmp114_ = qlite_update_builder_set (_tmp108_, G_TYPE_LONG, NULL, NULL, _tmp112_, (gpointer) ((gintptr) _tmp113_));
				_tmp115_ = _tmp114_;
				_qlite_statement_builder_unref0 (_tmp115_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label11) ? _tmp14_label11 : (_tmp14_label11 = g_quark_from_static_string ("state")))) {
		switch (0) {
			default:
			{
				DinoEntitiesFileTransferState _tmp116_;
				QliteUpdateBuilder* _tmp117_;
				DinoDatabase* _tmp118_;
				DinoDatabaseFileTransferTable* _tmp119_;
				DinoDatabaseFileTransferTable* _tmp120_;
				QliteColumn* _tmp121_;
				DinoEntitiesFileTransferState _tmp122_;
				QliteUpdateBuilder* _tmp123_;
				QliteUpdateBuilder* _tmp124_;
				_tmp116_ = self->priv->_state;
				if (_tmp116_ == DINO_ENTITIES_FILE_TRANSFER_STATE_IN_PROGRESS) {
					_qlite_statement_builder_unref0 (update_builder);
					return;
				}
				_tmp117_ = update_builder;
				_tmp118_ = self->priv->db;
				_tmp119_ = dino_database_get_file_transfer (_tmp118_);
				_tmp120_ = _tmp119_;
				_tmp121_ = _tmp120_->state;
				_tmp122_ = self->priv->_state;
				_tmp123_ = qlite_update_builder_set (_tmp117_, G_TYPE_INT, NULL, NULL, _tmp121_, (gpointer) ((gintptr) _tmp122_));
				_tmp124_ = _tmp123_;
				_qlite_statement_builder_unref0 (_tmp124_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label12) ? _tmp14_label12 : (_tmp14_label12 = g_quark_from_static_string ("provider")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp125_;
				DinoDatabase* _tmp126_;
				DinoDatabaseFileTransferTable* _tmp127_;
				DinoDatabaseFileTransferTable* _tmp128_;
				QliteColumn* _tmp129_;
				gint _tmp130_;
				QliteUpdateBuilder* _tmp131_;
				QliteUpdateBuilder* _tmp132_;
				_tmp125_ = update_builder;
				_tmp126_ = self->priv->db;
				_tmp127_ = dino_database_get_file_transfer (_tmp126_);
				_tmp128_ = _tmp127_;
				_tmp129_ = _tmp128_->provider;
				_tmp130_ = self->priv->_provider;
				_tmp131_ = qlite_update_builder_set (_tmp125_, G_TYPE_INT, NULL, NULL, _tmp129_, (gpointer) ((gintptr) _tmp130_));
				_tmp132_ = _tmp131_;
				_qlite_statement_builder_unref0 (_tmp132_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label13) ? _tmp14_label13 : (_tmp14_label13 = g_quark_from_static_string ("info")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp133_;
				DinoDatabase* _tmp134_;
				DinoDatabaseFileTransferTable* _tmp135_;
				DinoDatabaseFileTransferTable* _tmp136_;
				QliteColumn* _tmp137_;
				const gchar* _tmp138_;
				QliteUpdateBuilder* _tmp139_;
				QliteUpdateBuilder* _tmp140_;
				_tmp133_ = update_builder;
				_tmp134_ = self->priv->db;
				_tmp135_ = dino_database_get_file_transfer (_tmp134_);
				_tmp136_ = _tmp135_;
				_tmp137_ = _tmp136_->info;
				_tmp138_ = self->priv->_info;
				_tmp139_ = qlite_update_builder_set (_tmp133_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp137_, _tmp138_);
				_tmp140_ = _tmp139_;
				_qlite_statement_builder_unref0 (_tmp140_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label14) ? _tmp14_label14 : (_tmp14_label14 = g_quark_from_static_string ("modification-date")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp141_;
				DinoDatabase* _tmp142_;
				DinoDatabaseFileTransferTable* _tmp143_;
				DinoDatabaseFileTransferTable* _tmp144_;
				QliteColumn* _tmp145_;
				GDateTime* _tmp146_;
				QliteUpdateBuilder* _tmp147_;
				QliteUpdateBuilder* _tmp148_;
				_tmp141_ = update_builder;
				_tmp142_ = self->priv->db;
				_tmp143_ = dino_database_get_file_transfer (_tmp142_);
				_tmp144_ = _tmp143_;
				_tmp145_ = _tmp144_->modification_date;
				_tmp146_ = self->priv->_modification_date;
				_tmp147_ = qlite_update_builder_set (_tmp141_, G_TYPE_LONG, NULL, NULL, _tmp145_, (gpointer) ((gintptr) g_date_time_to_unix (_tmp146_)));
				_tmp148_ = _tmp147_;
				_qlite_statement_builder_unref0 (_tmp148_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label15) ? _tmp14_label15 : (_tmp14_label15 = g_quark_from_static_string ("width")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp149_;
				DinoDatabase* _tmp150_;
				DinoDatabaseFileTransferTable* _tmp151_;
				DinoDatabaseFileTransferTable* _tmp152_;
				QliteColumn* _tmp153_;
				gint _tmp154_;
				QliteUpdateBuilder* _tmp155_;
				QliteUpdateBuilder* _tmp156_;
				_tmp149_ = update_builder;
				_tmp150_ = self->priv->db;
				_tmp151_ = dino_database_get_file_transfer (_tmp150_);
				_tmp152_ = _tmp151_;
				_tmp153_ = _tmp152_->width;
				_tmp154_ = self->priv->_width;
				_tmp155_ = qlite_update_builder_set (_tmp149_, G_TYPE_INT, NULL, NULL, _tmp153_, (gpointer) ((gintptr) _tmp154_));
				_tmp156_ = _tmp155_;
				_qlite_statement_builder_unref0 (_tmp156_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label16) ? _tmp14_label16 : (_tmp14_label16 = g_quark_from_static_string ("height")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp157_;
				DinoDatabase* _tmp158_;
				DinoDatabaseFileTransferTable* _tmp159_;
				DinoDatabaseFileTransferTable* _tmp160_;
				QliteColumn* _tmp161_;
				gint _tmp162_;
				QliteUpdateBuilder* _tmp163_;
				QliteUpdateBuilder* _tmp164_;
				_tmp157_ = update_builder;
				_tmp158_ = self->priv->db;
				_tmp159_ = dino_database_get_file_transfer (_tmp158_);
				_tmp160_ = _tmp159_;
				_tmp161_ = _tmp160_->height;
				_tmp162_ = self->priv->_height;
				_tmp163_ = qlite_update_builder_set (_tmp157_, G_TYPE_INT, NULL, NULL, _tmp161_, (gpointer) ((gintptr) _tmp162_));
				_tmp164_ = _tmp163_;
				_qlite_statement_builder_unref0 (_tmp164_);
				break;
			}
		}
	} else if (_tmp15_ == ((0 != _tmp14_label17) ? _tmp14_label17 : (_tmp14_label17 = g_quark_from_static_string ("length")))) {
		switch (0) {
			default:
			{
				QliteUpdateBuilder* _tmp165_;
				DinoDatabase* _tmp166_;
				DinoDatabaseFileTransferTable* _tmp167_;
				DinoDatabaseFileTransferTable* _tmp168_;
				QliteColumn* _tmp169_;
				gint64 _tmp170_;
				QliteUpdateBuilder* _tmp171_;
				QliteUpdateBuilder* _tmp172_;
				_tmp165_ = update_builder;
				_tmp166_ = self->priv->db;
				_tmp167_ = dino_database_get_file_transfer (_tmp166_);
				_tmp168_ = _tmp167_;
				_tmp169_ = _tmp168_->length;
				_tmp170_ = self->priv->_length;
				_tmp171_ = qlite_update_builder_set (_tmp165_, G_TYPE_LONG, NULL, NULL, _tmp169_, (gpointer) ((gintptr) _tmp170_));
				_tmp172_ = _tmp171_;
				_qlite_statement_builder_unref0 (_tmp172_);
				break;
			}
		}
	}
	_tmp173_ = update_builder;
	qlite_update_builder_perform (_tmp173_);
	_qlite_statement_builder_unref0 (update_builder);
}

DinoEntitiesFileTransfer*
dino_entities_file_transfer_construct (GType object_type)
{
	DinoEntitiesFileTransfer * self = NULL;
	self = (DinoEntitiesFileTransfer*) g_object_new (object_type, NULL);
	return self;
}

DinoEntitiesFileTransfer*
dino_entities_file_transfer_new (void)
{
	return dino_entities_file_transfer_construct (DINO_ENTITIES_TYPE_FILE_TRANSFER);
}

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

void
dino_entities_file_transfer_set_id (DinoEntitiesFileTransfer* self,
                                    gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_ID_PROPERTY]);
	}
}

const gchar*
dino_entities_file_transfer_get_file_sharing_id (DinoEntitiesFileTransfer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_file_sharing_id;
	result = _tmp0_;
	return result;
}

void
dino_entities_file_transfer_set_file_sharing_id (DinoEntitiesFileTransfer* self,
                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_file_sharing_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_file_sharing_id);
		self->priv->_file_sharing_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_FILE_SHARING_ID_PROPERTY]);
	}
}

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

void
dino_entities_file_transfer_set_account (DinoEntitiesFileTransfer* self,
                                         DinoEntitiesAccount* value)
{
	DinoEntitiesAccount* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_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_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_ACCOUNT_PROPERTY]);
	}
}

XmppJid*
dino_entities_file_transfer_get_counterpart (DinoEntitiesFileTransfer* 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_file_transfer_set_counterpart (DinoEntitiesFileTransfer* self,
                                             XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_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_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_COUNTERPART_PROPERTY]);
	}
}

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

void
dino_entities_file_transfer_set_ourpart (DinoEntitiesFileTransfer* self,
                                         XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_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_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_OURPART_PROPERTY]);
	}
}

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

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

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

void
dino_entities_file_transfer_set_direction (DinoEntitiesFileTransfer* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_direction (self);
	if (old_value != value) {
		self->priv->_direction = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_DIRECTION_PROPERTY]);
	}
}

GDateTime*
dino_entities_file_transfer_get_time (DinoEntitiesFileTransfer* 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_file_transfer_set_time (DinoEntitiesFileTransfer* self,
                                      GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_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_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_TIME_PROPERTY]);
	}
}

GDateTime*
dino_entities_file_transfer_get_local_time (DinoEntitiesFileTransfer* 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_file_transfer_set_local_time (DinoEntitiesFileTransfer* self,
                                            GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_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_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_LOCAL_TIME_PROPERTY]);
	}
}

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

void
dino_entities_file_transfer_set_encryption (DinoEntitiesFileTransfer* self,
                                            DinoEntitiesEncryption value)
{
	DinoEntitiesEncryption old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_encryption (self);
	if (old_value != value) {
		self->priv->_encryption = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_ENCRYPTION_PROPERTY]);
	}
}

GInputStream*
dino_entities_file_transfer_get_input_stream (DinoEntitiesFileTransfer* self)
{
	GInputStream* result;
	GInputStream* _tmp0_;
	GInputStream* _tmp14_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->input_stream_;
	if (_tmp0_ == NULL) {
		const gchar* _tmp1_ = NULL;
		const gchar* _tmp2_;
		GFile* file = NULL;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		GFile* _tmp8_;
		GFile* _tmp9_;
		_tmp2_ = self->priv->_path;
		_tmp1_ = _tmp2_;
		if (_tmp1_ == NULL) {
			const gchar* _tmp3_;
			const gchar* _tmp4_;
			_tmp3_ = dino_entities_file_transfer_get_file_name (self);
			_tmp4_ = _tmp3_;
			_tmp1_ = _tmp4_;
		}
		_tmp5_ = self->priv->storage_dir;
		_tmp6_ = g_build_filename (_tmp5_, _tmp1_, NULL);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_file_new_for_path (_tmp7_);
		_tmp9_ = _tmp8_;
		_g_free0 (_tmp7_);
		file = _tmp9_;
		{
			GFileInputStream* _tmp10_ = NULL;
			GFile* _tmp11_;
			GFileInputStream* _tmp12_;
			GFileInputStream* _tmp13_;
			_tmp11_ = file;
			_tmp12_ = g_file_read (_tmp11_, NULL, &_inner_error0_);
			_tmp10_ = _tmp12_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp13_ = _tmp10_;
			_tmp10_ = NULL;
			_g_object_unref0 (self->priv->input_stream_);
			self->priv->input_stream_ = (GInputStream*) _tmp13_;
			_g_object_unref0 (_tmp10_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (file);
			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;
		}
		_g_object_unref0 (file);
	}
	_tmp14_ = self->priv->input_stream_;
	result = _tmp14_;
	return result;
}

void
dino_entities_file_transfer_set_input_stream (DinoEntitiesFileTransfer* self,
                                              GInputStream* value)
{
	GInputStream* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->input_stream_);
	self->priv->input_stream_ = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_INPUT_STREAM_PROPERTY]);
}

const gchar*
dino_entities_file_transfer_get_file_name (DinoEntitiesFileTransfer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->file_name_;
	result = _tmp0_;
	return result;
}

void
dino_entities_file_transfer_set_file_name (DinoEntitiesFileTransfer* self,
                                           const gchar* value)
{
	gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_path_get_basename (value);
	_g_free0 (self->priv->file_name_);
	self->priv->file_name_ = _tmp0_;
	_tmp2_ = self->priv->file_name_;
	if (g_strcmp0 (_tmp2_, G_DIR_SEPARATOR_S) == 0) {
		_tmp1_ = TRUE;
	} else {
		const gchar* _tmp3_;
		_tmp3_ = self->priv->file_name_;
		_tmp1_ = g_strcmp0 (_tmp3_, ".") == 0;
	}
	if (_tmp1_) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup ("unknown filename");
		_g_free0 (self->priv->file_name_);
		self->priv->file_name_ = _tmp4_;
	} else {
		const gchar* _tmp5_;
		_tmp5_ = self->priv->file_name_;
		if (g_str_has_prefix (_tmp5_, ".")) {
			const gchar* _tmp6_;
			gchar* _tmp7_;
			_tmp6_ = self->priv->file_name_;
			_tmp7_ = g_strconcat ("_", _tmp6_, NULL);
			_g_free0 (self->priv->file_name_);
			self->priv->file_name_ = _tmp7_;
		}
	}
	g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_FILE_NAME_PROPERTY]);
}

const gchar*
dino_entities_file_transfer_get_server_file_name (DinoEntitiesFileTransfer* self)
{
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->server_file_name_;
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp2_ = dino_entities_file_transfer_get_file_name (self);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_;
	}
	result = _tmp0_;
	return result;
}

void
dino_entities_file_transfer_set_server_file_name (DinoEntitiesFileTransfer* self,
                                                  const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->server_file_name_);
	self->priv->server_file_name_ = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_SERVER_FILE_NAME_PROPERTY]);
}

const gchar*
dino_entities_file_transfer_get_path (DinoEntitiesFileTransfer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_path;
	result = _tmp0_;
	return result;
}

void
dino_entities_file_transfer_set_path (DinoEntitiesFileTransfer* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_path);
		self->priv->_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_PATH_PROPERTY]);
	}
}

const gchar*
dino_entities_file_transfer_get_mime_type (DinoEntitiesFileTransfer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_mime_type;
	result = _tmp0_;
	return result;
}

void
dino_entities_file_transfer_set_mime_type (DinoEntitiesFileTransfer* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_mime_type (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_mime_type);
		self->priv->_mime_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_MIME_TYPE_PROPERTY]);
	}
}

gint64
dino_entities_file_transfer_get_size (DinoEntitiesFileTransfer* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_size;
	return result;
}

void
dino_entities_file_transfer_set_size (DinoEntitiesFileTransfer* self,
                                      gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_size (self);
	if (old_value != value) {
		self->priv->_size = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_SIZE_PROPERTY]);
	}
}

DinoEntitiesFileTransferState
dino_entities_file_transfer_get_state (DinoEntitiesFileTransfer* self)
{
	DinoEntitiesFileTransferState result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_state;
	return result;
}

void
dino_entities_file_transfer_set_state (DinoEntitiesFileTransfer* self,
                                       DinoEntitiesFileTransferState value)
{
	DinoEntitiesFileTransferState old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_state (self);
	if (old_value != value) {
		self->priv->_state = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_STATE_PROPERTY]);
	}
}

gint
dino_entities_file_transfer_get_provider (DinoEntitiesFileTransfer* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_provider;
	return result;
}

void
dino_entities_file_transfer_set_provider (DinoEntitiesFileTransfer* self,
                                          gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_provider (self);
	if (old_value != value) {
		self->priv->_provider = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_PROVIDER_PROPERTY]);
	}
}

const gchar*
dino_entities_file_transfer_get_info (DinoEntitiesFileTransfer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_info;
	result = _tmp0_;
	return result;
}

void
dino_entities_file_transfer_set_info (DinoEntitiesFileTransfer* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_info (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_info);
		self->priv->_info = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_INFO_PROPERTY]);
	}
}

GCancellable*
dino_entities_file_transfer_get_cancellable (DinoEntitiesFileTransfer* self)
{
	GCancellable* result;
	GCancellable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_cancellable;
	result = _tmp0_;
	return result;
}

gint64
dino_entities_file_transfer_get_transferred_bytes (DinoEntitiesFileTransfer* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_transferred_bytes;
	return result;
}

void
dino_entities_file_transfer_set_transferred_bytes (DinoEntitiesFileTransfer* self,
                                                   gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_transferred_bytes (self);
	if (old_value != value) {
		self->priv->_transferred_bytes = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_TRANSFERRED_BYTES_PROPERTY]);
	}
}

XmppXepFileMetadataElementFileMetadata*
dino_entities_file_transfer_get_file_metadata (DinoEntitiesFileTransfer* self)
{
	XmppXepFileMetadataElementFileMetadata* result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gint64 _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	GDateTime* _tmp8_;
	GDateTime* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	gint64 _tmp12_;
	GeeList* _tmp13_;
	GeeList* _tmp14_;
	GeeList* _tmp15_;
	GeeList* _tmp16_;
	XmppXepFileMetadataElementFileMetadata* _tmp17_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = dino_entities_file_transfer_get_file_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup (_tmp1_);
	_tmp3_ = self->priv->_mime_type;
	_tmp4_ = g_strdup (_tmp3_);
	_tmp5_ = self->priv->_size;
	_tmp6_ = self->priv->_desc;
	_tmp7_ = g_strdup (_tmp6_);
	_tmp8_ = self->priv->_modification_date;
	_tmp9_ = _g_date_time_ref0 (_tmp8_);
	_tmp10_ = self->priv->_width;
	_tmp11_ = self->priv->_height;
	_tmp12_ = self->priv->_length;
	_tmp13_ = self->hashes;
	_tmp14_ = _g_object_ref0 (_tmp13_);
	_tmp15_ = self->thumbnails;
	_tmp16_ = _g_object_ref0 (_tmp15_);
	_tmp17_ = xmpp_xep_file_metadata_element_file_metadata_new ();
	xmpp_xep_file_metadata_element_file_metadata_set_name (_tmp17_, _tmp2_);
	_g_free0 (_tmp2_);
	xmpp_xep_file_metadata_element_file_metadata_set_mime_type (_tmp17_, _tmp4_);
	_g_free0 (_tmp4_);
	xmpp_xep_file_metadata_element_file_metadata_set_size (_tmp17_, _tmp5_);
	xmpp_xep_file_metadata_element_file_metadata_set_desc (_tmp17_, _tmp7_);
	_g_free0 (_tmp7_);
	xmpp_xep_file_metadata_element_file_metadata_set_date (_tmp17_, _tmp9_);
	_g_date_time_unref0 (_tmp9_);
	xmpp_xep_file_metadata_element_file_metadata_set_width (_tmp17_, _tmp10_);
	xmpp_xep_file_metadata_element_file_metadata_set_height (_tmp17_, _tmp11_);
	xmpp_xep_file_metadata_element_file_metadata_set_length (_tmp17_, _tmp12_);
	_g_object_unref0 (_tmp17_->hashes);
	_tmp17_->hashes = _tmp14_;
	_g_object_unref0 (_tmp17_->thumbnails);
	_tmp17_->thumbnails = _tmp16_;
	result = _tmp17_;
	return result;
}

void
dino_entities_file_transfer_set_file_metadata (DinoEntitiesFileTransfer* self,
                                               XmppXepFileMetadataElementFileMetadata* value)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint64 _tmp4_;
	gint64 _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	GDateTime* _tmp8_;
	GDateTime* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gint64 _tmp14_;
	gint64 _tmp15_;
	GeeList* _tmp16_;
	GeeList* _tmp17_;
	GeeList* _tmp18_;
	GeeList* _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = xmpp_xep_file_metadata_element_file_metadata_get_name (value);
	_tmp1_ = _tmp0_;
	dino_entities_file_transfer_set_file_name (self, _tmp1_);
	_tmp2_ = xmpp_xep_file_metadata_element_file_metadata_get_mime_type (value);
	_tmp3_ = _tmp2_;
	dino_entities_file_transfer_set_mime_type (self, _tmp3_);
	_tmp4_ = xmpp_xep_file_metadata_element_file_metadata_get_size (value);
	_tmp5_ = _tmp4_;
	dino_entities_file_transfer_set_size (self, _tmp5_);
	_tmp6_ = xmpp_xep_file_metadata_element_file_metadata_get_desc (value);
	_tmp7_ = _tmp6_;
	dino_entities_file_transfer_set_desc (self, _tmp7_);
	_tmp8_ = xmpp_xep_file_metadata_element_file_metadata_get_date (value);
	_tmp9_ = _tmp8_;
	dino_entities_file_transfer_set_modification_date (self, _tmp9_);
	_tmp10_ = xmpp_xep_file_metadata_element_file_metadata_get_width (value);
	_tmp11_ = _tmp10_;
	dino_entities_file_transfer_set_width (self, _tmp11_);
	_tmp12_ = xmpp_xep_file_metadata_element_file_metadata_get_height (value);
	_tmp13_ = _tmp12_;
	dino_entities_file_transfer_set_height (self, _tmp13_);
	_tmp14_ = xmpp_xep_file_metadata_element_file_metadata_get_length (value);
	_tmp15_ = _tmp14_;
	dino_entities_file_transfer_set_length (self, _tmp15_);
	_tmp16_ = value->hashes;
	_tmp17_ = _g_object_ref0 (_tmp16_);
	_g_object_unref0 (self->hashes);
	self->hashes = _tmp17_;
	_tmp18_ = value->thumbnails;
	_tmp19_ = _g_object_ref0 (_tmp18_);
	_g_object_unref0 (self->thumbnails);
	self->thumbnails = _tmp19_;
	g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_FILE_METADATA_PROPERTY]);
}

const gchar*
dino_entities_file_transfer_get_desc (DinoEntitiesFileTransfer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_desc;
	result = _tmp0_;
	return result;
}

void
dino_entities_file_transfer_set_desc (DinoEntitiesFileTransfer* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_desc (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_desc);
		self->priv->_desc = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_DESC_PROPERTY]);
	}
}

GDateTime*
dino_entities_file_transfer_get_modification_date (DinoEntitiesFileTransfer* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_modification_date;
	result = _tmp0_;
	return result;
}

void
dino_entities_file_transfer_set_modification_date (DinoEntitiesFileTransfer* self,
                                                   GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_modification_date (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_modification_date);
		self->priv->_modification_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_MODIFICATION_DATE_PROPERTY]);
	}
}

gint
dino_entities_file_transfer_get_width (DinoEntitiesFileTransfer* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_width;
	return result;
}

void
dino_entities_file_transfer_set_width (DinoEntitiesFileTransfer* self,
                                       gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_width (self);
	if (old_value != value) {
		self->priv->_width = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_WIDTH_PROPERTY]);
	}
}

gint
dino_entities_file_transfer_get_height (DinoEntitiesFileTransfer* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_height;
	return result;
}

void
dino_entities_file_transfer_set_height (DinoEntitiesFileTransfer* self,
                                        gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_height (self);
	if (old_value != value) {
		self->priv->_height = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_HEIGHT_PROPERTY]);
	}
}

gint64
dino_entities_file_transfer_get_length (DinoEntitiesFileTransfer* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_length;
	return result;
}

void
dino_entities_file_transfer_set_length (DinoEntitiesFileTransfer* self,
                                        gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_entities_file_transfer_get_length (self);
	if (old_value != value) {
		self->priv->_length = value;
		g_object_notify_by_pspec ((GObject *) self, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_LENGTH_PROPERTY]);
	}
}

static void
dino_entities_file_transfer_class_init (DinoEntitiesFileTransferClass * klass,
                                        gpointer klass_data)
{
	dino_entities_file_transfer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoEntitiesFileTransfer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_entities_file_transfer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_entities_file_transfer_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_entities_file_transfer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_ID_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_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_FILE_TRANSFER_FILE_SHARING_ID_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_FILE_SHARING_ID_PROPERTY] = g_param_spec_string ("file-sharing-id", "file-sharing-id", "file-sharing-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_ACCOUNT_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_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_FILE_TRANSFER_COUNTERPART_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_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_FILE_TRANSFER_OURPART_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_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_FILE_TRANSFER_FROM_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_FROM_PROPERTY] = xmpp_param_spec_jid ("from", "from", "from", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_TO_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_TO_PROPERTY] = xmpp_param_spec_jid ("to", "to", "to", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_DIRECTION_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_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_FILE_TRANSFER_TIME_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_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_FILE_TRANSFER_LOCAL_TIME_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_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_FILE_TRANSFER_ENCRYPTION_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_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_FILE_TRANSFER_INPUT_STREAM_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_INPUT_STREAM_PROPERTY] = g_param_spec_object ("input-stream", "input-stream", "input-stream", g_input_stream_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_FILE_NAME_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_FILE_NAME_PROPERTY] = g_param_spec_string ("file-name", "file-name", "file-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_SERVER_FILE_NAME_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_SERVER_FILE_NAME_PROPERTY] = g_param_spec_string ("server-file-name", "server-file-name", "server-file-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_PATH_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_PATH_PROPERTY] = g_param_spec_string ("path", "path", "path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_MIME_TYPE_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_MIME_TYPE_PROPERTY] = g_param_spec_string ("mime-type", "mime-type", "mime-type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_SIZE_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_SIZE_PROPERTY] = g_param_spec_int64 ("size", "size", "size", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_STATE_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_STATE_PROPERTY] = g_param_spec_enum ("state", "state", "state", DINO_ENTITIES_FILE_TRANSFER_TYPE_STATE, DINO_ENTITIES_FILE_TRANSFER_STATE_NOT_STARTED, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_PROVIDER_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_PROVIDER_PROPERTY] = g_param_spec_int ("provider", "provider", "provider", 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_FILE_TRANSFER_INFO_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_INFO_PROPERTY] = g_param_spec_string ("info", "info", "info", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_CANCELLABLE_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_CANCELLABLE_PROPERTY] = g_param_spec_object ("cancellable", "cancellable", "cancellable", g_cancellable_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_TRANSFERRED_BYTES_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_TRANSFERRED_BYTES_PROPERTY] = g_param_spec_int64 ("transferred-bytes", "transferred-bytes", "transferred-bytes", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_FILE_METADATA_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_FILE_METADATA_PROPERTY] = xmpp_xep_file_metadata_element_param_spec_file_metadata ("file-metadata", "file-metadata", "file-metadata", XMPP_XEP_FILE_METADATA_ELEMENT_TYPE_FILE_METADATA, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_DESC_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_DESC_PROPERTY] = g_param_spec_string ("desc", "desc", "desc", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_ENTITIES_FILE_TRANSFER_MODIFICATION_DATE_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_MODIFICATION_DATE_PROPERTY] = g_param_spec_boxed ("modification-date", "modification-date", "modification-date", 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_FILE_TRANSFER_WIDTH_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_WIDTH_PROPERTY] = g_param_spec_int ("width", "width", "width", 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_FILE_TRANSFER_HEIGHT_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_HEIGHT_PROPERTY] = g_param_spec_int ("height", "height", "height", 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_FILE_TRANSFER_LENGTH_PROPERTY, dino_entities_file_transfer_properties[DINO_ENTITIES_FILE_TRANSFER_LENGTH_PROPERTY] = g_param_spec_int64 ("length", "length", "length", G_MININT64, G_MAXINT64, (gint64) -1, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	dino_entities_file_transfer_signals[DINO_ENTITIES_FILE_TRANSFER_SOURCES_CHANGED_SIGNAL] = g_signal_new ("sources-changed", DINO_ENTITIES_TYPE_FILE_TRANSFER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
dino_entities_file_transfer_instance_init (DinoEntitiesFileTransfer * self,
                                           gpointer klass)
{
	GCancellable* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	self->priv = dino_entities_file_transfer_get_instance_private (self);
	self->priv->_id = -1;
	self->priv->_encryption = DINO_ENTITIES_ENCRYPTION_NONE;
	self->priv->input_stream_ = NULL;
	self->priv->server_file_name_ = NULL;
	self->priv->_state = DINO_ENTITIES_FILE_TRANSFER_STATE_NOT_STARTED;
	_tmp0_ = g_cancellable_new ();
	self->priv->_cancellable = _tmp0_;
	self->priv->_width = -1;
	self->priv->_height = -1;
	self->priv->_length = (gint64) -1;
	_tmp1_ = gee_array_list_new (XMPP_XEP_CRYPTOGRAPHIC_HASHES_TYPE_HASH, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->hashes = (GeeList*) _tmp1_;
	_tmp2_ = gee_array_list_new (XMPP_XEP_STATELESS_FILE_SHARING_TYPE_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_xep_stateless_file_sharing_source_equals_func_gee_equal_data_func, NULL, NULL);
	self->sfs_sources = (GeeList*) _tmp2_;
	_tmp3_ = gee_array_list_new (XMPP_XEP_JINGLE_CONTENT_THUMBNAILS_TYPE_THUMBNAIL, (GBoxedCopyFunc) xmpp_xep_jingle_content_thumbnails_thumbnail_ref, (GDestroyNotify) xmpp_xep_jingle_content_thumbnails_thumbnail_unref, NULL, NULL, NULL);
	self->thumbnails = (GeeList*) _tmp3_;
}

static void
dino_entities_file_transfer_finalize (GObject * obj)
{
	DinoEntitiesFileTransfer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_ENTITIES_TYPE_FILE_TRANSFER, DinoEntitiesFileTransfer);
	_g_free0 (self->priv->_file_sharing_id);
	_g_object_unref0 (self->priv->_account);
	_xmpp_jid_unref0 (self->priv->_counterpart);
	_xmpp_jid_unref0 (self->priv->_ourpart);
	_g_date_time_unref0 (self->priv->_time);
	_g_date_time_unref0 (self->priv->_local_time);
	_g_object_unref0 (self->priv->input_stream_);
	_g_free0 (self->priv->file_name_);
	_g_free0 (self->priv->server_file_name_);
	_g_free0 (self->priv->_path);
	_g_free0 (self->priv->_mime_type);
	_g_free0 (self->priv->_info);
	_g_object_unref0 (self->priv->_cancellable);
	_g_free0 (self->priv->_desc);
	_g_date_time_unref0 (self->priv->_modification_date);
	_g_object_unref0 (self->hashes);
	_g_object_unref0 (self->sfs_sources);
	_g_object_unref0 (self->thumbnails);
	_qlite_database_unref0 (self->priv->db);
	_g_free0 (self->priv->storage_dir);
	G_OBJECT_CLASS (dino_entities_file_transfer_parent_class)->finalize (obj);
}

static GType
dino_entities_file_transfer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoEntitiesFileTransferClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_entities_file_transfer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoEntitiesFileTransfer), 0, (GInstanceInitFunc) dino_entities_file_transfer_instance_init, NULL };
	GType dino_entities_file_transfer_type_id;
	dino_entities_file_transfer_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoEntitiesFileTransfer", &g_define_type_info, 0);
	DinoEntitiesFileTransfer_private_offset = g_type_add_instance_private (dino_entities_file_transfer_type_id, sizeof (DinoEntitiesFileTransferPrivate));
	return dino_entities_file_transfer_type_id;
}

GType
dino_entities_file_transfer_get_type (void)
{
	static volatile gsize dino_entities_file_transfer_type_id__once = 0;
	if (g_once_init_enter (&dino_entities_file_transfer_type_id__once)) {
		GType dino_entities_file_transfer_type_id;
		dino_entities_file_transfer_type_id = dino_entities_file_transfer_get_type_once ();
		g_once_init_leave (&dino_entities_file_transfer_type_id__once, dino_entities_file_transfer_type_id);
	}
	return dino_entities_file_transfer_type_id__once;
}

static void
_vala_dino_entities_file_transfer_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	DinoEntitiesFileTransfer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_ENTITIES_TYPE_FILE_TRANSFER, DinoEntitiesFileTransfer);
	switch (property_id) {
		case DINO_ENTITIES_FILE_TRANSFER_ID_PROPERTY:
		g_value_set_int (value, dino_entities_file_transfer_get_id (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_FILE_SHARING_ID_PROPERTY:
		g_value_set_string (value, dino_entities_file_transfer_get_file_sharing_id (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_ACCOUNT_PROPERTY:
		g_value_set_object (value, dino_entities_file_transfer_get_account (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_COUNTERPART_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_file_transfer_get_counterpart (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_OURPART_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_file_transfer_get_ourpart (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_FROM_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_file_transfer_get_from (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_TO_PROPERTY:
		xmpp_value_set_jid (value, dino_entities_file_transfer_get_to (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_DIRECTION_PROPERTY:
		g_value_set_boolean (value, dino_entities_file_transfer_get_direction (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_TIME_PROPERTY:
		g_value_set_boxed (value, dino_entities_file_transfer_get_time (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_LOCAL_TIME_PROPERTY:
		g_value_set_boxed (value, dino_entities_file_transfer_get_local_time (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_ENCRYPTION_PROPERTY:
		g_value_set_enum (value, dino_entities_file_transfer_get_encryption (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_INPUT_STREAM_PROPERTY:
		g_value_set_object (value, dino_entities_file_transfer_get_input_stream (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_FILE_NAME_PROPERTY:
		g_value_set_string (value, dino_entities_file_transfer_get_file_name (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_SERVER_FILE_NAME_PROPERTY:
		g_value_set_string (value, dino_entities_file_transfer_get_server_file_name (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_PATH_PROPERTY:
		g_value_set_string (value, dino_entities_file_transfer_get_path (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_MIME_TYPE_PROPERTY:
		g_value_set_string (value, dino_entities_file_transfer_get_mime_type (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_SIZE_PROPERTY:
		g_value_set_int64 (value, dino_entities_file_transfer_get_size (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_STATE_PROPERTY:
		g_value_set_enum (value, dino_entities_file_transfer_get_state (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_PROVIDER_PROPERTY:
		g_value_set_int (value, dino_entities_file_transfer_get_provider (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_INFO_PROPERTY:
		g_value_set_string (value, dino_entities_file_transfer_get_info (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_CANCELLABLE_PROPERTY:
		g_value_set_object (value, dino_entities_file_transfer_get_cancellable (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_TRANSFERRED_BYTES_PROPERTY:
		g_value_set_int64 (value, dino_entities_file_transfer_get_transferred_bytes (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_FILE_METADATA_PROPERTY:
		xmpp_xep_file_metadata_element_value_take_file_metadata (value, dino_entities_file_transfer_get_file_metadata (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_DESC_PROPERTY:
		g_value_set_string (value, dino_entities_file_transfer_get_desc (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_MODIFICATION_DATE_PROPERTY:
		g_value_set_boxed (value, dino_entities_file_transfer_get_modification_date (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_WIDTH_PROPERTY:
		g_value_set_int (value, dino_entities_file_transfer_get_width (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_HEIGHT_PROPERTY:
		g_value_set_int (value, dino_entities_file_transfer_get_height (self));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_LENGTH_PROPERTY:
		g_value_set_int64 (value, dino_entities_file_transfer_get_length (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_entities_file_transfer_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	DinoEntitiesFileTransfer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_ENTITIES_TYPE_FILE_TRANSFER, DinoEntitiesFileTransfer);
	switch (property_id) {
		case DINO_ENTITIES_FILE_TRANSFER_ID_PROPERTY:
		dino_entities_file_transfer_set_id (self, g_value_get_int (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_FILE_SHARING_ID_PROPERTY:
		dino_entities_file_transfer_set_file_sharing_id (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_ACCOUNT_PROPERTY:
		dino_entities_file_transfer_set_account (self, g_value_get_object (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_COUNTERPART_PROPERTY:
		dino_entities_file_transfer_set_counterpart (self, xmpp_value_get_jid (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_OURPART_PROPERTY:
		dino_entities_file_transfer_set_ourpart (self, xmpp_value_get_jid (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_DIRECTION_PROPERTY:
		dino_entities_file_transfer_set_direction (self, g_value_get_boolean (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_TIME_PROPERTY:
		dino_entities_file_transfer_set_time (self, g_value_get_boxed (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_LOCAL_TIME_PROPERTY:
		dino_entities_file_transfer_set_local_time (self, g_value_get_boxed (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_ENCRYPTION_PROPERTY:
		dino_entities_file_transfer_set_encryption (self, g_value_get_enum (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_INPUT_STREAM_PROPERTY:
		dino_entities_file_transfer_set_input_stream (self, g_value_get_object (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_FILE_NAME_PROPERTY:
		dino_entities_file_transfer_set_file_name (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_SERVER_FILE_NAME_PROPERTY:
		dino_entities_file_transfer_set_server_file_name (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_PATH_PROPERTY:
		dino_entities_file_transfer_set_path (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_MIME_TYPE_PROPERTY:
		dino_entities_file_transfer_set_mime_type (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_SIZE_PROPERTY:
		dino_entities_file_transfer_set_size (self, g_value_get_int64 (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_STATE_PROPERTY:
		dino_entities_file_transfer_set_state (self, g_value_get_enum (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_PROVIDER_PROPERTY:
		dino_entities_file_transfer_set_provider (self, g_value_get_int (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_INFO_PROPERTY:
		dino_entities_file_transfer_set_info (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_TRANSFERRED_BYTES_PROPERTY:
		dino_entities_file_transfer_set_transferred_bytes (self, g_value_get_int64 (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_FILE_METADATA_PROPERTY:
		dino_entities_file_transfer_set_file_metadata (self, xmpp_xep_file_metadata_element_value_get_file_metadata (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_DESC_PROPERTY:
		dino_entities_file_transfer_set_desc (self, g_value_get_string (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_MODIFICATION_DATE_PROPERTY:
		dino_entities_file_transfer_set_modification_date (self, g_value_get_boxed (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_WIDTH_PROPERTY:
		dino_entities_file_transfer_set_width (self, g_value_get_int (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_HEIGHT_PROPERTY:
		dino_entities_file_transfer_set_height (self, g_value_get_int (value));
		break;
		case DINO_ENTITIES_FILE_TRANSFER_LENGTH_PROPERTY:
		dino_entities_file_transfer_set_length (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

