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

#include "libdino.h"
#include <gee.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
#include "xmpp-vala.h"
#include <gobject/gvaluecollector.h>
#include <float.h>
#include <math.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_FILE_MANAGER_0_PROPERTY,
	DINO_FILE_MANAGER_ID_PROPERTY,
	DINO_FILE_MANAGER_SFS_PROPERTY,
	DINO_FILE_MANAGER_NUM_PROPERTIES
};
static GParamSpec* dino_file_manager_properties[DINO_FILE_MANAGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _qlite_database_unref0(var) ((var == NULL) ? NULL : (var = (qlite_database_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define DINO_TYPE_GENERIC_FILE_METADATA_PROVIDER (dino_generic_file_metadata_provider_get_type ())
#define DINO_GENERIC_FILE_METADATA_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_TYPE_GENERIC_FILE_METADATA_PROVIDER, DinoGenericFileMetadataProvider))
#define DINO_GENERIC_FILE_METADATA_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_TYPE_GENERIC_FILE_METADATA_PROVIDER, DinoGenericFileMetadataProviderClass))
#define DINO_IS_GENERIC_FILE_METADATA_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_TYPE_GENERIC_FILE_METADATA_PROVIDER))
#define DINO_IS_GENERIC_FILE_METADATA_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_TYPE_GENERIC_FILE_METADATA_PROVIDER))
#define DINO_GENERIC_FILE_METADATA_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_TYPE_GENERIC_FILE_METADATA_PROVIDER, DinoGenericFileMetadataProviderClass))

typedef struct _DinoGenericFileMetadataProvider DinoGenericFileMetadataProvider;
typedef struct _DinoGenericFileMetadataProviderClass DinoGenericFileMetadataProviderClass;
typedef struct _DinoFileManagerGetFileSizeLimitsData DinoFileManagerGetFileSizeLimitsData;
#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 _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _xmpp_xep_file_metadata_element_file_metadata_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_file_metadata_element_file_metadata_unref (var), NULL)))
#define _dino_file_meta_unref0(var) ((var == NULL) ? NULL : (var = (dino_file_meta_unref (var), NULL)))
#define _dino_file_send_data_unref0(var) ((var == NULL) ? NULL : (var = (dino_file_send_data_unref (var), NULL)))
typedef struct _DinoFileManagerSendFileData DinoFileManagerSendFileData;
typedef struct _DinoFileManagerDownloadFileData DinoFileManagerDownloadFileData;
typedef struct _DinoFileManagerIsUploadAvailableData DinoFileManagerIsUploadAvailableData;
typedef struct _Block15Data Block15Data;
#define _xmpp_roster_item_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_roster_item_unref (var), NULL)))
#define _dino_file_receive_data_unref0(var) ((var == NULL) ? NULL : (var = (dino_file_receive_data_unref (var), NULL)))
typedef struct _DinoFileManagerGetFileMetaData DinoFileManagerGetFileMetaData;
typedef struct _DinoFileManagerDownloadFileInternalData DinoFileManagerDownloadFileInternalData;
typedef struct _DinoFileManagerHandleIncomingFileData DinoFileManagerHandleIncomingFileData;
typedef struct _DinoFileManagerSaveFileData DinoFileManagerSaveFileData;
enum  {
	DINO_FILE_MANAGER_UPLOAD_AVAILABLE_SIGNAL,
	DINO_FILE_MANAGER_RECEIVED_FILE_SIGNAL,
	DINO_FILE_MANAGER_NUM_SIGNALS
};
static guint dino_file_manager_signals[DINO_FILE_MANAGER_NUM_SIGNALS] = {0};
typedef struct _DinoParamSpecFileMeta DinoParamSpecFileMeta;
typedef struct _DinoParamSpecFileSendData DinoParamSpecFileSendData;
typedef struct _DinoParamSpecFileReceiveData DinoParamSpecFileReceiveData;
enum  {
	DINO_FILE_PROVIDER_FILE_INCOMING_SIGNAL,
	DINO_FILE_PROVIDER_NUM_SIGNALS
};
static guint dino_file_provider_signals[DINO_FILE_PROVIDER_NUM_SIGNALS] = {0};
enum  {
	DINO_FILE_SENDER_UPLOAD_AVAILABLE_SIGNAL,
	DINO_FILE_SENDER_NUM_SIGNALS
};
static guint dino_file_sender_signals[DINO_FILE_SENDER_NUM_SIGNALS] = {0};

struct _DinoFileManagerPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoDatabase* db;
	GeeList* file_senders;
	GeeList* file_encryptors;
	GeeList* file_decryptors;
	GeeList* file_providers;
	GeeList* file_metadata_providers;
};

struct _DinoFileManagerGetFileSizeLimitsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoFileManager* self;
	DinoEntitiesConversation* conversation;
	GeeHashMap* result;
	GeeHashMap* ret;
	GeeHashMap* _tmp0_;
	GeeList* _sender_list;
	GeeList* _tmp1_;
	gint _sender_size;
	GeeList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _sender_index;
	gint _tmp5_;
	gint _tmp6_;
	DinoFileSender* sender;
	GeeList* _tmp7_;
	gpointer _tmp8_;
	GeeHashMap* _tmp9_;
	DinoFileSender* _tmp10_;
	DinoFileSender* _tmp11_;
};

struct _DinoFileManagerSendFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoFileManager* self;
	GFile* file;
	DinoEntitiesConversation* conversation;
	DinoEntitiesFileTransfer* file_transfer;
	DinoEntitiesFileTransfer* _tmp0_;
	DinoEntitiesFileTransfer* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	DinoEntitiesFileTransfer* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	DinoEntitiesConversationType _tmp7_;
	DinoEntitiesConversationType _tmp8_;
	XmppJid* _tmp9_;
	DinoStreamInteractor* _tmp10_;
	DinoModuleIdentity* _tmp11_;
	gpointer _tmp12_;
	DinoMucManager* _tmp13_;
	XmppJid* _tmp14_;
	XmppJid* _tmp15_;
	DinoEntitiesAccount* _tmp16_;
	DinoEntitiesAccount* _tmp17_;
	XmppJid* _tmp18_;
	XmppJid* _tmp19_;
	DinoEntitiesAccount* _tmp20_;
	DinoEntitiesAccount* _tmp21_;
	XmppJid* _tmp22_;
	XmppJid* _tmp23_;
	DinoEntitiesFileTransfer* _tmp24_;
	DinoEntitiesFileTransfer* _tmp25_;
	DinoEntitiesAccount* _tmp26_;
	DinoEntitiesAccount* _tmp27_;
	XmppJid* _tmp28_;
	XmppJid* _tmp29_;
	DinoEntitiesFileTransfer* _tmp30_;
	DinoEntitiesFileTransfer* _tmp31_;
	GDateTime* _tmp32_;
	GDateTime* _tmp33_;
	DinoEntitiesFileTransfer* _tmp34_;
	GDateTime* _tmp35_;
	GDateTime* _tmp36_;
	DinoEntitiesFileTransfer* _tmp37_;
	DinoEntitiesEncryption _tmp38_;
	DinoEntitiesEncryption _tmp39_;
	XmppXepFileMetadataElementFileMetadata* metadata;
	XmppXepFileMetadataElementFileMetadata* _tmp40_;
	GeeList* _file_metadata_provider_list;
	GeeList* _tmp41_;
	gint _file_metadata_provider_size;
	GeeList* _tmp42_;
	gint _tmp43_;
	gint _tmp44_;
	gint _file_metadata_provider_index;
	gint _tmp45_;
	gint _tmp46_;
	DinoFileMetadataProvider* file_metadata_provider;
	GeeList* _tmp47_;
	gpointer _tmp48_;
	DinoFileMetadataProvider* _tmp49_;
	DinoFileMetadataProvider* _tmp50_;
	XmppXepFileMetadataElementFileMetadata* _tmp51_;
	DinoEntitiesFileTransfer* _tmp52_;
	XmppXepFileMetadataElementFileMetadata* _tmp53_;
	GFileInputStream* _tmp54_;
	GFileInputStream* _tmp55_;
	DinoEntitiesFileTransfer* _tmp56_;
	DinoEntitiesFileTransfer* _tmp57_;
	DinoStreamInteractor* _tmp58_;
	DinoModuleIdentity* _tmp59_;
	gpointer _tmp60_;
	DinoFileTransferStorage* _tmp61_;
	DinoEntitiesFileTransfer* _tmp62_;
	DinoEntitiesFileTransfer* _tmp63_;
	GDateTime* _tmp64_;
	GDateTime* _tmp65_;
	DinoEntitiesFileTransfer* _tmp66_;
	GError* e;
	DinoEntitiesFileTransfer* _tmp67_;
	GError* _tmp68_;
	const gchar* _tmp69_;
	DinoFileMeta* file_meta;
	DinoFileMeta* _tmp70_;
	DinoFileMeta* _tmp71_;
	DinoEntitiesFileTransfer* _tmp72_;
	gint64 _tmp73_;
	gint64 _tmp74_;
	DinoFileMeta* _tmp75_;
	DinoEntitiesFileTransfer* _tmp76_;
	const gchar* _tmp77_;
	const gchar* _tmp78_;
	gchar* _tmp79_;
	DinoFileSender* file_sender;
	DinoFileEncryptor* file_encryptor;
	GeeList* _sender_list;
	GeeList* _tmp80_;
	gint _sender_size;
	GeeList* _tmp81_;
	gint _tmp82_;
	gint _tmp83_;
	gint _sender_index;
	gint _tmp84_;
	gint _tmp85_;
	DinoFileSender* sender;
	GeeList* _tmp86_;
	gpointer _tmp87_;
	DinoFileSender* _tmp88_;
	DinoEntitiesFileTransfer* _tmp89_;
	gboolean _tmp90_;
	DinoEntitiesFileTransfer* _tmp91_;
	DinoEntitiesEncryption _tmp92_;
	DinoEntitiesEncryption _tmp93_;
	DinoFileSender* _tmp94_;
	DinoEntitiesFileTransfer* _tmp95_;
	DinoFileSender* _tmp96_;
	DinoFileSender* _tmp97_;
	GeeList* _encryptor_list;
	GeeList* _tmp98_;
	gint _encryptor_size;
	GeeList* _tmp99_;
	gint _tmp100_;
	gint _tmp101_;
	gint _encryptor_index;
	gint _tmp102_;
	gint _tmp103_;
	DinoFileEncryptor* encryptor;
	GeeList* _tmp104_;
	gpointer _tmp105_;
	DinoFileEncryptor* _tmp106_;
	DinoEntitiesFileTransfer* _tmp107_;
	DinoFileEncryptor* _tmp108_;
	DinoFileEncryptor* _tmp109_;
	DinoFileEncryptor* _tmp110_;
	DinoFileSender* _tmp111_;
	DinoFileSender* _tmp112_;
	DinoFileSender* _tmp113_;
	GError* _tmp114_;
	DinoFileEncryptor* _tmp115_;
	DinoFileMeta* _tmp116_;
	DinoFileEncryptor* _tmp117_;
	DinoEntitiesFileTransfer* _tmp118_;
	DinoFileMeta* _tmp119_;
	DinoFileMeta* _tmp120_;
	DinoFileSendData* file_send_data;
	DinoFileSender* _tmp121_;
	DinoEntitiesFileTransfer* _tmp122_;
	DinoFileMeta* _tmp123_;
	DinoFileSendData* _tmp124_;
	DinoFileEncryptor* _tmp125_;
	DinoFileSendData* _tmp126_;
	DinoFileEncryptor* _tmp127_;
	DinoEntitiesFileTransfer* _tmp128_;
	DinoFileSendData* _tmp129_;
	DinoFileMeta* _tmp130_;
	DinoFileSendData* _tmp131_;
	DinoFileSendData* _tmp132_;
	DinoEntitiesFileTransfer* _tmp133_;
	DinoLimitInputStream* limit_stream;
	DinoEntitiesFileTransfer* _tmp134_;
	GInputStream* _tmp135_;
	GInputStream* _tmp136_;
	DinoLimitInputStream* _tmp137_;
	DinoLimitInputStream* _tmp138_;
	DinoEntitiesFileTransfer* _tmp139_;
	GInputStream* _tmp140_;
	GInputStream* _tmp141_;
	DinoFileMeta* _tmp142_;
	DinoLimitInputStream* _tmp143_;
	DinoEntitiesFileTransfer* _tmp144_;
	DinoLimitInputStream* _tmp145_;
	DinoLimitInputStream* _tmp146_;
	DinoLimitInputStream* _tmp147_;
	DinoEntitiesFileTransfer* _tmp148_;
	DinoFileSender* _tmp149_;
	DinoEntitiesFileTransfer* _tmp150_;
	DinoFileSendData* _tmp151_;
	DinoFileMeta* _tmp152_;
	DinoEntitiesFileTransfer* _tmp153_;
	GError* _vala1_e;
	GError* _tmp154_;
	const gchar* _tmp155_;
	DinoEntitiesFileTransfer* _tmp156_;
	GError* _inner_error0_;
};

struct _DinoFileManagerDownloadFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoFileManager* self;
	DinoEntitiesFileTransfer* file_transfer;
	DinoEntitiesConversation* conversation;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	XmppJid* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	DinoEntitiesAccount* _tmp10_;
	DinoEntitiesConversation* _tmp11_;
	DinoEntitiesConversation* _tmp12_;
	DinoFileProvider* file_provider;
	DinoFileProvider* _tmp13_;
};

struct _DinoFileManagerIsUploadAvailableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoFileManager* self;
	DinoEntitiesConversation* conversation;
	gboolean result;
	GeeList* _file_sender_list;
	GeeList* _tmp0_;
	gint _file_sender_size;
	GeeList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _file_sender_index;
	gint _tmp4_;
	gint _tmp5_;
	DinoFileSender* file_sender;
	GeeList* _tmp6_;
	gpointer _tmp7_;
	DinoFileSender* _tmp8_;
};

struct _Block15Data {
	int _ref_count_;
	DinoFileManager* self;
	DinoFileProvider* file_provider;
};

struct _DinoFileManagerGetFileMetaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoFileManager* self;
	DinoFileProvider* file_provider;
	DinoEntitiesFileTransfer* file_transfer;
	DinoEntitiesConversation* conversation;
	DinoFileReceiveData* receive_data_;
	DinoFileMeta* result;
	DinoFileReceiveData* receive_data;
	DinoFileReceiveData* _tmp0_;
	DinoFileMeta* file_meta;
	DinoFileMeta* _tmp1_;
	DinoFileMeta* _tmp2_;
	GeeList* _file_decryptor_list;
	GeeList* _tmp3_;
	gint _file_decryptor_size;
	GeeList* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gint _file_decryptor_index;
	gint _tmp7_;
	gint _tmp8_;
	DinoFileDecryptor* file_decryptor;
	GeeList* _tmp9_;
	gpointer _tmp10_;
	DinoFileDecryptor* _tmp11_;
	DinoFileReceiveData* _tmp12_;
	DinoFileDecryptor* _tmp13_;
	DinoFileReceiveData* _tmp14_;
	DinoFileReceiveData* _tmp15_;
	DinoFileMeta* _tmp16_;
	DinoFileReceiveData* _tmp17_;
	DinoFileMeta* _tmp18_;
	DinoFileMeta* _tmp19_;
	DinoFileMeta* _tmp20_;
	DinoFileMeta* _tmp21_;
	DinoFileMeta* _tmp22_;
	const gchar* _tmp23_;
	DinoFileMeta* _tmp24_;
	const gchar* _tmp25_;
	GError* _inner_error0_;
};

struct _DinoFileManagerDownloadFileInternalData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoFileManager* self;
	DinoFileProvider* file_provider;
	DinoEntitiesFileTransfer* file_transfer;
	DinoEntitiesConversation* conversation;
	DinoFileReceiveData* receive_data;
	DinoFileReceiveData* _tmp0_;
	DinoFileReceiveData* _tmp1_;
	DinoFileDecryptor* file_decryptor;
	GeeList* _decryptor_list;
	GeeList* _tmp2_;
	gint _decryptor_size;
	GeeList* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _decryptor_index;
	gint _tmp6_;
	gint _tmp7_;
	DinoFileDecryptor* decryptor;
	GeeList* _tmp8_;
	gpointer _tmp9_;
	DinoFileDecryptor* _tmp10_;
	DinoFileReceiveData* _tmp11_;
	DinoFileDecryptor* _tmp12_;
	DinoFileDecryptor* _tmp13_;
	DinoFileDecryptor* _tmp14_;
	DinoFileDecryptor* _tmp15_;
	DinoFileReceiveData* _tmp16_;
	DinoFileReceiveData* _tmp17_;
	DinoFileMeta* file_meta;
	DinoFileReceiveData* _tmp18_;
	DinoFileMeta* _tmp19_;
	DinoFileDecryptor* _tmp20_;
	DinoFileDecryptor* _tmp21_;
	DinoFileReceiveData* _tmp22_;
	DinoFileMeta* _tmp23_;
	DinoFileMeta* _tmp24_;
	GInputStream* download_input_stream;
	DinoFileReceiveData* _tmp25_;
	DinoFileMeta* _tmp26_;
	GInputStream* _tmp27_;
	GInputStream* input_stream;
	GInputStream* _tmp28_;
	GInputStream* _tmp29_;
	DinoFileDecryptor* _tmp30_;
	GInputStream* _tmp31_;
	DinoFileDecryptor* _tmp32_;
	GInputStream* _tmp33_;
	DinoFileReceiveData* _tmp34_;
	GInputStream* _tmp35_;
	GInputStream* _tmp36_;
	DinoLimitInputStream* limit_stream;
	GInputStream* _tmp37_;
	DinoLimitInputStream* _tmp38_;
	DinoLimitInputStream* _tmp39_;
	DinoLimitInputStream* _tmp40_;
	gchar* filename;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	GFile* file;
	gchar* _tmp49_;
	gchar* _tmp50_;
	const gchar* _tmp51_;
	gchar* _tmp52_;
	gchar* _tmp53_;
	GFile* _tmp54_;
	GFile* _tmp55_;
	GOutputStream* os;
	GFile* _tmp56_;
	GFileOutputStream* _tmp57_;
	guint8* buffer;
	guint8* _tmp58_;
	gint buffer_length1;
	gint _buffer_size_;
	gssize read;
	gssize _tmp59_;
	GInputStream* _tmp60_;
	guint8* _tmp61_;
	gint _tmp61__length1;
	GCancellable* _tmp62_;
	GCancellable* _tmp63_;
	GOutputStream* _tmp64_;
	guint8* _tmp65_;
	gint _tmp65__length1;
	GCancellable* _tmp66_;
	GCancellable* _tmp67_;
	GInputStream* _tmp68_;
	GCancellable* _tmp69_;
	GCancellable* _tmp70_;
	GOutputStream* _tmp71_;
	GCancellable* _tmp72_;
	GCancellable* _tmp73_;
	GeeList* supported_hashes;
	GeeList* _tmp74_;
	GeeList* _tmp75_;
	GeeList* _tmp76_;
	gboolean _tmp77_;
	gboolean _tmp78_;
	GeeArrayList* checksum_types;
	GeeArrayList* _tmp79_;
	GeeHashMap* hashes;
	GeeHashMap* _tmp80_;
	GeeList* _hash_list;
	GeeList* _tmp81_;
	gint _hash_size;
	GeeList* _tmp82_;
	gint _tmp83_;
	gint _tmp84_;
	gint _hash_index;
	gint _tmp85_;
	gint _tmp86_;
	XmppXepCryptographicHashesHash* hash;
	GeeList* _tmp87_;
	gpointer _tmp88_;
	GChecksumType* checksum_type;
	XmppXepCryptographicHashesHash* _tmp89_;
	const gchar* _tmp90_;
	GChecksumType* _tmp91_;
	GeeArrayList* _tmp92_;
	GChecksumType* _tmp93_;
	GeeHashMap* _tmp94_;
	GChecksumType* _tmp95_;
	XmppXepCryptographicHashesHash* _tmp96_;
	const gchar* _tmp97_;
	GeeHashMap* computed_hashes;
	GFile* _tmp98_;
	GeeArrayList* _tmp99_;
	GeeHashMap* _tmp100_;
	GeeIterator* _checksum_type_it;
	GeeHashMap* _tmp101_;
	GeeSet* _tmp102_;
	GeeSet* _tmp103_;
	GeeSet* _tmp104_;
	GeeIterator* _tmp105_;
	GeeIterator* _tmp106_;
	GeeIterator* _tmp107_;
	GChecksumType _vala1_checksum_type;
	GeeIterator* _tmp108_;
	gpointer _tmp109_;
	GeeHashMap* _tmp110_;
	gpointer _tmp111_;
	gchar* _tmp112_;
	GeeHashMap* _tmp113_;
	gpointer _tmp114_;
	gchar* _tmp115_;
	gboolean _tmp116_;
	const gchar* _tmp117_;
	const gchar* _tmp118_;
	const gchar* _tmp119_;
	GeeHashMap* _tmp120_;
	gpointer _tmp121_;
	gchar* _tmp122_;
	GeeHashMap* _tmp123_;
	gpointer _tmp124_;
	gchar* _tmp125_;
	GFile* _tmp126_;
	gchar* _tmp127_;
	gchar* _tmp128_;
	GFile* _tmp129_;
	gchar* _tmp130_;
	gchar* _tmp131_;
	GFileInfo* file_info;
	GFile* _tmp132_;
	GFile* _tmp133_;
	GFileInfo* _tmp134_;
	GFileInfo* _tmp135_;
	gboolean _tmp136_;
	GFileInfo* _tmp137_;
	const gchar* _tmp138_;
	const gchar* _tmp139_;
	const gchar* _tmp140_;
	GFileInfo* _tmp141_;
	const gchar* _tmp142_;
	GError* e;
	GError* _tmp143_;
	const gchar* _tmp144_;
	gboolean _tmp145_;
	gint _tmp146_;
	gint _tmp147_;
	gint _tmp148_;
	gint _tmp149_;
	GError* _inner_error0_;
};

struct _DinoFileManagerHandleIncomingFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoFileManager* self;
	DinoFileProvider* file_provider;
	gchar* info;
	XmppJid* from;
	GDateTime* time;
	GDateTime* local_time;
	DinoEntitiesConversation* conversation;
	DinoFileReceiveData* receive_data;
	DinoFileMeta* file_meta;
	DinoEntitiesFileTransfer* file_transfer;
	DinoEntitiesFileTransfer* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoFileTransferStorage* _tmp4_;
	DinoEntitiesFileTransfer* _tmp5_;
	DinoEntitiesFileTransfer* _tmp6_;
	DinoEntitiesFileTransfer* _tmp7_;
	DinoFileMeta* _tmp8_;
	DinoFileMeta* _tmp9_;
	GError* e;
	GError* _tmp10_;
	const gchar* _tmp11_;
	DinoEntitiesFileTransfer* _tmp12_;
	gboolean _tmp13_;
	DinoEntitiesFileTransfer* _tmp14_;
	gint64 _tmp15_;
	gint64 _tmp16_;
	DinoEntitiesFileTransfer* _tmp17_;
	gint64 _tmp18_;
	gint64 _tmp19_;
	DinoEntitiesFileTransfer* _tmp20_;
	DinoEntitiesFileTransfer* _tmp21_;
	GDateTime* _tmp22_;
	GDateTime* _tmp23_;
	DinoEntitiesFileTransfer* _tmp24_;
	GError* _inner_error0_;
};

struct _DinoFileManagerSaveFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoFileManager* self;
	DinoEntitiesFileTransfer* file_transfer;
	gchar* filename;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GFile* file;
	gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	GFile* _tmp13_;
	GFile* _tmp14_;
	GOutputStream* os;
	GFile* _tmp15_;
	GFileOutputStream* _tmp16_;
	GOutputStream* _tmp17_;
	GInputStream* _tmp18_;
	GInputStream* _tmp19_;
	const gchar* _tmp20_;
	GFileInputStream* _tmp21_;
	GFile* _tmp22_;
	GFileInputStream* _tmp23_;
	gint64 _tmp24_;
	gint64 _tmp25_;
	DinoLimitInputStream* _tmp26_;
	DinoLimitInputStream* _tmp27_;
	GError* e;
	GError* _tmp28_;
	const gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	GError* _tmp32_;
	GError* _tmp33_;
	GError* _inner_error0_;
};

struct _DinoParamSpecFileMeta {
	GParamSpec parent_instance;
};

struct _DinoParamSpecFileSendData {
	GParamSpec parent_instance;
};

struct _DinoHttpFileSendDataPrivate {
	gchar* _url_down;
	gchar* _url_up;
	GeeHashMap* _headers;
	gboolean _encrypt_message;
};

struct _DinoParamSpecFileReceiveData {
	GParamSpec parent_instance;
};

struct _DinoHttpFileReceiveDataPrivate {
	gchar* _url;
};

static gint DinoFileManager_private_offset;
static gpointer dino_file_manager_parent_class = NULL;
DinoModuleIdentity* dino_file_manager_IDENTITY = NULL;
static DinoStreamInteractionModuleIface * dino_file_manager_dino_stream_interaction_module_parent_iface = NULL;
static gpointer dino_file_meta_parent_class = NULL;
static gpointer dino_http_file_meta_parent_class = NULL;
static gpointer dino_file_send_data_parent_class = NULL;
static gint DinoHttpFileSendData_private_offset;
static gpointer dino_http_file_send_data_parent_class = NULL;
static gpointer dino_file_receive_data_parent_class = NULL;
static gint DinoHttpFileReceiveData_private_offset;
static gpointer dino_http_file_receive_data_parent_class = NULL;

static DinoFileManager* dino_file_manager_new (DinoStreamInteractor* stream_interactor,
                                        DinoDatabase* db);
static DinoFileManager* dino_file_manager_construct (GType object_type,
                                              DinoStreamInteractor* stream_interactor,
                                              DinoDatabase* db);
VALA_EXTERN DinoGenericFileMetadataProvider* dino_generic_file_metadata_provider_new (void);
VALA_EXTERN DinoGenericFileMetadataProvider* dino_generic_file_metadata_provider_construct (GType object_type);
VALA_EXTERN GType dino_generic_file_metadata_provider_get_type (void) G_GNUC_CONST ;
static void dino_file_manager_get_file_size_limits_data_free (gpointer _data);
static gboolean dino_file_manager_get_file_size_limits_co (DinoFileManagerGetFileSizeLimitsData* _data_);
static void dino_file_manager_get_file_size_limits_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void dino_file_manager_send_file_data_free (gpointer _data);
static gboolean dino_file_manager_send_file_co (DinoFileManagerSendFileData* _data_);
static void dino_file_manager_send_file_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dino_file_manager_save_file (DinoFileManager* self,
                                  DinoEntitiesFileTransfer* file_transfer,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
static void dino_file_manager_save_file_finish (DinoFileManager* self,
                                         GAsyncResult* _res_,
                                         GError** error);
static void dino_file_manager_download_file_data_free (gpointer _data);
static gboolean dino_file_manager_download_file_co (DinoFileManagerDownloadFileData* _data_);
static void dino_file_manager_download_file_internal (DinoFileManager* self,
                                               DinoFileProvider* file_provider,
                                               DinoEntitiesFileTransfer* file_transfer,
                                               DinoEntitiesConversation* conversation,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static void dino_file_manager_download_file_internal_finish (DinoFileManager* self,
                                                      GAsyncResult* _res_);
static void dino_file_manager_download_file_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void dino_file_manager_is_upload_available_data_free (gpointer _data);
static gboolean dino_file_manager_is_upload_available_co (DinoFileManagerIsUploadAvailableData* _data_);
static void dino_file_manager_is_upload_available_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static void __lambda37_ (Block15Data* _data15_,
                  const gchar* info,
                  XmppJid* from,
                  GDateTime* time,
                  GDateTime* local_time,
                  DinoEntitiesConversation* conversation,
                  DinoFileReceiveData* receive_data,
                  DinoFileMeta* file_meta);
static void dino_file_manager_handle_incoming_file (DinoFileManager* self,
                                             DinoFileProvider* file_provider,
                                             const gchar* info,
                                             XmppJid* from,
                                             GDateTime* time,
                                             GDateTime* local_time,
                                             DinoEntitiesConversation* conversation,
                                             DinoFileReceiveData* receive_data,
                                             DinoFileMeta* file_meta,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void dino_file_manager_handle_incoming_file_finish (DinoFileManager* self,
                                                    GAsyncResult* _res_);
static void ___lambda37__dino_file_provider_file_incoming (DinoFileProvider* _sender,
                                                    const gchar* info,
                                                    XmppJid* from,
                                                    GDateTime* time,
                                                    GDateTime* local_time,
                                                    DinoEntitiesConversation* conversation,
                                                    DinoFileReceiveData* receive_data,
                                                    DinoFileMeta* file_meta,
                                                    gpointer self);
static void __lambda45_ (DinoFileManager* self,
                  DinoEntitiesAccount* account);
static void ___lambda45__dino_file_sender_upload_available (DinoFileSender* _sender,
                                                     DinoEntitiesAccount* account,
                                                     gpointer self);
static gint __lambda46_ (DinoFileManager* self,
                  DinoFileSender* a,
                  DinoFileSender* b);
static gint ___lambda46__gcompare_data_func (gconstpointer a,
                                      gconstpointer b,
                                      gpointer self);
static void dino_file_manager_get_file_meta_data_free (gpointer _data);
static void dino_file_manager_get_file_meta (DinoFileManager* self,
                                      DinoFileProvider* file_provider,
                                      DinoEntitiesFileTransfer* file_transfer,
                                      DinoEntitiesConversation* conversation,
                                      DinoFileReceiveData* receive_data_,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
static DinoFileMeta* dino_file_manager_get_file_meta_finish (DinoFileManager* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static gboolean dino_file_manager_get_file_meta_co (DinoFileManagerGetFileMetaData* _data_);
static void dino_file_manager_get_file_meta_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void dino_file_manager_download_file_internal_data_free (gpointer _data);
static gboolean dino_file_manager_download_file_internal_co (DinoFileManagerDownloadFileInternalData* _data_);
static void dino_file_manager_download_file_internal_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static const char* _g_checksum_type_to_string (GChecksumType value);
static void dino_file_manager_handle_incoming_file_data_free (gpointer _data);
static gboolean dino_file_manager_handle_incoming_file_co (DinoFileManagerHandleIncomingFileData* _data_);
static void dino_file_manager_handle_incoming_file_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void ____lambda43_ (DinoFileManager* self,
                    GObject* _,
                    GAsyncResult* res);
static void _____lambda43__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static void dino_file_manager_save_file_data_free (gpointer _data);
static gboolean dino_file_manager_save_file_co (DinoFileManagerSaveFileData* _data_);
static void dino_file_manager_save_file_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dino_file_manager_set_sfs (DinoFileManager* self,
                                DinoStatelessFileSharing* value);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void dino_file_manager_finalize (GObject * obj);
static GType dino_file_manager_get_type_once (void);
static void _vala_dino_file_manager_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec);
static void _vala_dino_file_manager_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec);
static void dino_file_meta_finalize (DinoFileMeta * obj);
static GType dino_file_meta_get_type_once (void);
static void dino_http_file_meta_finalize (DinoFileMeta * obj);
static GType dino_http_file_meta_get_type_once (void);
static void dino_file_send_data_finalize (DinoFileSendData * obj);
static GType dino_file_send_data_get_type_once (void);
static void dino_http_file_send_data_finalize (DinoFileSendData * obj);
static GType dino_http_file_send_data_get_type_once (void);
static void dino_file_receive_data_finalize (DinoFileReceiveData * obj);
static GType dino_file_receive_data_get_type_once (void);
static void dino_http_file_receive_data_finalize (DinoFileReceiveData * obj);
static GType dino_http_file_receive_data_get_type_once (void);
static void g_cclosure_user_marshal_VOID__STRING_XMPP_JID_BOXED_BOXED_OBJECT_DINO_FILE_RECEIVE_DATA_DINO_FILE_META (GClosure * closure,
                                                                                                             GValue * return_value,
                                                                                                             guint n_param_values,
                                                                                                             const GValue * param_values,
                                                                                                             gpointer invocation_hint,
                                                                                                             gpointer marshal_data);
static GType dino_file_provider_get_type_once (void);
static GType dino_file_sender_get_type_once (void);
static GType dino_file_encryptor_get_type_once (void);
static GType dino_file_decryptor_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_file_manager_get_instance_private (DinoFileManager* self)
{
	return G_STRUCT_MEMBER_P (self, DinoFileManager_private_offset);
}

void
dino_file_manager_start (DinoStreamInteractor* stream_interactor,
                         DinoDatabase* db)
{
	DinoFileManager* m = NULL;
	DinoFileManager* _tmp0_;
	g_return_if_fail (stream_interactor != NULL);
	g_return_if_fail (db != NULL);
	_tmp0_ = dino_file_manager_new (stream_interactor, db);
	m = _tmp0_;
	dino_stream_interactor_add_module (stream_interactor, (DinoStreamInteractionModule*) m);
	_g_object_unref0 (m);
}

gchar*
dino_file_manager_get_storage_dir (void)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	_tmp0_ = dino_get_storage_dir ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_build_filename (_tmp1_, "files", NULL);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

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

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

static DinoFileManager*
dino_file_manager_construct (GType object_type,
                             DinoStreamInteractor* stream_interactor,
                             DinoDatabase* db)
{
	DinoFileManager * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoDatabase* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	DinoJingleFileProvider* _tmp4_;
	DinoJingleFileProvider* _tmp5_;
	DinoJingleFileSender* _tmp6_;
	DinoJingleFileSender* _tmp7_;
	DinoGenericFileMetadataProvider* _tmp8_;
	DinoGenericFileMetadataProvider* _tmp9_;
	DinoImageFileMetadataProvider* _tmp10_;
	DinoImageFileMetadataProvider* _tmp11_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoFileManager*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	_tmp1_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp1_;
	_tmp2_ = dino_file_manager_get_storage_dir ();
	_tmp3_ = _tmp2_;
	g_mkdir_with_parents (_tmp3_, 0700);
	_g_free0 (_tmp3_);
	_tmp4_ = dino_jingle_file_provider_new (stream_interactor);
	_tmp5_ = _tmp4_;
	dino_file_manager_add_provider (self, (DinoFileProvider*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = dino_jingle_file_sender_new (stream_interactor);
	_tmp7_ = _tmp6_;
	dino_file_manager_add_sender (self, (DinoFileSender*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = dino_generic_file_metadata_provider_new ();
	_tmp9_ = _tmp8_;
	dino_file_manager_add_metadata_provider (self, (DinoFileMetadataProvider*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = dino_image_file_metadata_provider_new ();
	_tmp11_ = _tmp10_;
	dino_file_manager_add_metadata_provider (self, (DinoFileMetadataProvider*) _tmp11_);
	_g_object_unref0 (_tmp11_);
	return self;
}

static DinoFileManager*
dino_file_manager_new (DinoStreamInteractor* stream_interactor,
                       DinoDatabase* db)
{
	return dino_file_manager_construct (DINO_TYPE_FILE_MANAGER, stream_interactor, db);
}

DinoFileProvider*
dino_file_manager_select_file_provider (DinoFileManager* self,
                                        DinoEntitiesFileTransfer* file_transfer)
{
	gboolean http_usable = FALSE;
	gint _tmp0_;
	gint _tmp1_;
	DinoFileProvider* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (file_transfer != NULL, NULL);
	_tmp0_ = dino_entities_file_transfer_get_provider (file_transfer);
	_tmp1_ = _tmp0_;
	http_usable = _tmp1_ == DINO_FILE_MANAGER_SFS_PROVIDER_ID;
	{
		GeeList* _file_provider_list = NULL;
		GeeList* _tmp2_;
		gint _file_provider_size = 0;
		GeeList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _file_provider_index = 0;
		_tmp2_ = self->priv->file_providers;
		_file_provider_list = _tmp2_;
		_tmp3_ = _file_provider_list;
		_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_file_provider_size = _tmp5_;
		_file_provider_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			DinoFileProvider* file_provider = NULL;
			GeeList* _tmp8_;
			gpointer _tmp9_;
			gint _tmp10_;
			gint _tmp11_;
			DinoFileProvider* _tmp12_;
			gboolean _tmp13_ = FALSE;
			_file_provider_index = _file_provider_index + 1;
			_tmp6_ = _file_provider_index;
			_tmp7_ = _file_provider_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _file_provider_list;
			_tmp9_ = gee_list_get (_tmp8_, _file_provider_index);
			file_provider = (DinoFileProvider*) _tmp9_;
			_tmp10_ = dino_entities_file_transfer_get_provider (file_transfer);
			_tmp11_ = _tmp10_;
			_tmp12_ = file_provider;
			if (_tmp11_ == dino_file_provider_get_id (_tmp12_)) {
				result = file_provider;
				return result;
			}
			if (http_usable) {
				DinoFileProvider* _tmp14_;
				_tmp14_ = file_provider;
				_tmp13_ = dino_file_provider_get_id (_tmp14_) == DINO_FILE_MANAGER_HTTP_PROVIDER_ID;
			} else {
				_tmp13_ = FALSE;
			}
			if (_tmp13_) {
				result = file_provider;
				return result;
			}
			_g_object_unref0 (file_provider);
		}
	}
	result = NULL;
	return result;
}

static void
dino_file_manager_get_file_size_limits_data_free (gpointer _data)
{
	DinoFileManagerGetFileSizeLimitsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoFileManagerGetFileSizeLimitsData, _data_);
}

void
dino_file_manager_get_file_size_limits (DinoFileManager* self,
                                        DinoEntitiesConversation* conversation,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DinoFileManagerGetFileSizeLimitsData* _data_;
	DinoFileManager* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conversation != NULL);
	_data_ = g_slice_new0 (DinoFileManagerGetFileSizeLimitsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_file_manager_get_file_size_limits_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp1_;
	dino_file_manager_get_file_size_limits_co (_data_);
}

GeeHashMap*
dino_file_manager_get_file_size_limits_finish (DinoFileManager* self,
                                               GAsyncResult* _res_)
{
	GeeHashMap* result;
	DinoFileManagerGetFileSizeLimitsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dino_file_manager_get_file_size_limits_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DinoFileManagerGetFileSizeLimitsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_file_manager_get_file_size_limits_co (_data_);
}

static gboolean
dino_file_manager_get_file_size_limits_co (DinoFileManagerGetFileSizeLimitsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, G_TYPE_LONG, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->ret = _data_->_tmp0_;
	{
		_data_->_tmp1_ = _data_->self->priv->file_senders;
		_data_->_sender_list = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->_sender_list;
		_data_->_tmp3_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_sender_size = _data_->_tmp4_;
		_data_->_sender_index = -1;
		while (TRUE) {
			_data_->_sender_index = _data_->_sender_index + 1;
			_data_->_tmp5_ = _data_->_sender_index;
			_data_->_tmp6_ = _data_->_sender_size;
			if (!(_data_->_tmp5_ < _data_->_tmp6_)) {
				break;
			}
			_data_->_tmp7_ = _data_->_sender_list;
			_data_->_tmp8_ = gee_list_get (_data_->_tmp7_, _data_->_sender_index);
			_data_->sender = (DinoFileSender*) _data_->_tmp8_;
			_data_->_tmp9_ = _data_->ret;
			_data_->_tmp10_ = _data_->sender;
			_data_->_tmp11_ = _data_->sender;
			_data_->_state_ = 1;
			dino_file_sender_get_file_size_limit (_data_->_tmp11_, _data_->conversation, dino_file_manager_get_file_size_limits_ready, _data_);
			return FALSE;
			_state_1:
			gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp9_, (gpointer) ((gintptr) dino_file_sender_get_id (_data_->_tmp10_)), (gpointer) ((gintptr) dino_file_sender_get_file_size_limit_finish (_data_->_tmp11_, _data_->_res_)));
			_g_object_unref0 (_data_->sender);
		}
	}
	_data_->result = _data_->ret;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dino_file_manager_send_file_data_free (gpointer _data)
{
	DinoFileManagerSendFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file);
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoFileManagerSendFileData, _data_);
}

void
dino_file_manager_send_file (DinoFileManager* self,
                             GFile* file,
                             DinoEntitiesConversation* conversation,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DinoFileManagerSendFileData* _data_;
	DinoFileManager* _tmp0_;
	GFile* _tmp1_;
	DinoEntitiesConversation* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	g_return_if_fail (conversation != NULL);
	_data_ = g_slice_new0 (DinoFileManagerSendFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_file_manager_send_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file);
	_g_object_unref0 (_data_->file);
	_data_->file = _tmp1_;
	_tmp2_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp2_;
	dino_file_manager_send_file_co (_data_);
}

void
dino_file_manager_send_file_finish (DinoFileManager* self,
                                    GAsyncResult* _res_)
{
	DinoFileManagerSendFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_file_manager_send_file_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DinoFileManagerSendFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_file_manager_send_file_co (_data_);
}

static gboolean
dino_file_manager_send_file_co (DinoFileManagerSendFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dino_entities_file_transfer_new ();
	_data_->file_transfer = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->file_transfer;
	_data_->_tmp2_ = dino_entities_conversation_get_account (_data_->conversation);
	_data_->_tmp3_ = _data_->_tmp2_;
	dino_entities_file_transfer_set_account (_data_->_tmp1_, _data_->_tmp3_);
	_data_->_tmp4_ = _data_->file_transfer;
	_data_->_tmp5_ = dino_entities_conversation_get_counterpart (_data_->conversation);
	_data_->_tmp6_ = _data_->_tmp5_;
	dino_entities_file_transfer_set_counterpart (_data_->_tmp4_, _data_->_tmp6_);
	_data_->_tmp7_ = dino_entities_conversation_get_type_ (_data_->conversation);
	_data_->_tmp8_ = _data_->_tmp7_;
	if (dino_entities_conversation_type_is_muc_semantic (_data_->_tmp8_)) {
		_data_->_tmp10_ = _data_->self->priv->stream_interactor;
		_data_->_tmp11_ = dino_muc_manager_IDENTITY;
		_data_->_tmp12_ = dino_stream_interactor_get_module (_data_->_tmp10_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp11_);
		_data_->_tmp13_ = (DinoMucManager*) _data_->_tmp12_;
		_data_->_tmp14_ = dino_entities_conversation_get_counterpart (_data_->conversation);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = dino_entities_conversation_get_account (_data_->conversation);
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_tmp18_ = dino_muc_manager_get_own_jid (_data_->_tmp13_, _data_->_tmp15_, _data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		_g_object_unref0 (_data_->_tmp13_);
		_data_->_tmp9_ = _data_->_tmp19_;
		if (_data_->_tmp9_ == NULL) {
			_data_->_tmp20_ = dino_entities_conversation_get_account (_data_->conversation);
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_tmp22_ = dino_entities_account_get_bare_jid (_data_->_tmp21_);
			_data_->_tmp23_ = _data_->_tmp22_;
			_xmpp_jid_unref0 (_data_->_tmp9_);
			_data_->_tmp9_ = _data_->_tmp23_;
		}
		_data_->_tmp24_ = _data_->file_transfer;
		dino_entities_file_transfer_set_ourpart (_data_->_tmp24_, _data_->_tmp9_);
		_xmpp_jid_unref0 (_data_->_tmp9_);
	} else {
		_data_->_tmp25_ = _data_->file_transfer;
		_data_->_tmp26_ = dino_entities_conversation_get_account (_data_->conversation);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp28_ = dino_entities_account_get_full_jid (_data_->_tmp27_);
		_data_->_tmp29_ = _data_->_tmp28_;
		dino_entities_file_transfer_set_ourpart (_data_->_tmp25_, _data_->_tmp29_);
	}
	_data_->_tmp30_ = _data_->file_transfer;
	dino_entities_file_transfer_set_direction (_data_->_tmp30_, DINO_ENTITIES_FILE_TRANSFER_DIRECTION_SENT);
	_data_->_tmp31_ = _data_->file_transfer;
	_data_->_tmp32_ = g_date_time_new_now_utc ();
	_data_->_tmp33_ = _data_->_tmp32_;
	dino_entities_file_transfer_set_time (_data_->_tmp31_, _data_->_tmp33_);
	_g_date_time_unref0 (_data_->_tmp33_);
	_data_->_tmp34_ = _data_->file_transfer;
	_data_->_tmp35_ = g_date_time_new_now_utc ();
	_data_->_tmp36_ = _data_->_tmp35_;
	dino_entities_file_transfer_set_local_time (_data_->_tmp34_, _data_->_tmp36_);
	_g_date_time_unref0 (_data_->_tmp36_);
	_data_->_tmp37_ = _data_->file_transfer;
	_data_->_tmp38_ = dino_entities_conversation_get_encryption (_data_->conversation);
	_data_->_tmp39_ = _data_->_tmp38_;
	dino_entities_file_transfer_set_encryption (_data_->_tmp37_, _data_->_tmp39_);
	_data_->_tmp40_ = xmpp_xep_file_metadata_element_file_metadata_new ();
	_data_->metadata = _data_->_tmp40_;
	{
		_data_->_tmp41_ = _data_->self->priv->file_metadata_providers;
		_data_->_file_metadata_provider_list = _data_->_tmp41_;
		_data_->_tmp42_ = _data_->_file_metadata_provider_list;
		_data_->_tmp43_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp42_);
		_data_->_tmp44_ = _data_->_tmp43_;
		_data_->_file_metadata_provider_size = _data_->_tmp44_;
		_data_->_file_metadata_provider_index = -1;
		while (TRUE) {
			_data_->_file_metadata_provider_index = _data_->_file_metadata_provider_index + 1;
			_data_->_tmp45_ = _data_->_file_metadata_provider_index;
			_data_->_tmp46_ = _data_->_file_metadata_provider_size;
			if (!(_data_->_tmp45_ < _data_->_tmp46_)) {
				break;
			}
			_data_->_tmp47_ = _data_->_file_metadata_provider_list;
			_data_->_tmp48_ = gee_list_get (_data_->_tmp47_, _data_->_file_metadata_provider_index);
			_data_->file_metadata_provider = (DinoFileMetadataProvider*) _data_->_tmp48_;
			_data_->_tmp49_ = _data_->file_metadata_provider;
			if (dino_file_metadata_provider_supports_file (_data_->_tmp49_, _data_->file)) {
				_data_->_tmp50_ = _data_->file_metadata_provider;
				_data_->_tmp51_ = _data_->metadata;
				_data_->_state_ = 1;
				dino_file_metadata_provider_fill_metadata (_data_->_tmp50_, _data_->file, _data_->_tmp51_, dino_file_manager_send_file_ready, _data_);
				return FALSE;
				_state_1:
				dino_file_metadata_provider_fill_metadata_finish (_data_->_tmp50_, _data_->_res_);
			}
			_g_object_unref0 (_data_->file_metadata_provider);
		}
	}
	_data_->_tmp52_ = _data_->file_transfer;
	_data_->_tmp53_ = _data_->metadata;
	dino_entities_file_transfer_set_file_metadata (_data_->_tmp52_, _data_->_tmp53_);
	{
		_data_->_state_ = 2;
		g_file_read_async (_data_->file, G_PRIORITY_DEFAULT, NULL, dino_file_manager_send_file_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp55_ = g_file_read_finish (_data_->file, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp54_ = _data_->_tmp55_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp56_ = _data_->file_transfer;
		dino_entities_file_transfer_set_input_stream (_data_->_tmp56_, (GInputStream*) _data_->_tmp54_);
		_data_->_tmp57_ = _data_->file_transfer;
		_data_->_state_ = 3;
		dino_file_manager_save_file (_data_->self, _data_->_tmp57_, dino_file_manager_send_file_ready, _data_);
		return FALSE;
		_state_3:
		dino_file_manager_save_file_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->_tmp54_);
			goto __catch0_g_error;
		}
		_data_->_tmp58_ = _data_->self->priv->stream_interactor;
		_data_->_tmp59_ = dino_file_transfer_storage_IDENTITY;
		_data_->_tmp60_ = dino_stream_interactor_get_module (_data_->_tmp58_, DINO_TYPE_FILE_TRANSFER_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp59_);
		_data_->_tmp61_ = (DinoFileTransferStorage*) _data_->_tmp60_;
		_data_->_tmp62_ = _data_->file_transfer;
		dino_file_transfer_storage_add_file (_data_->_tmp61_, _data_->_tmp62_);
		_g_object_unref0 (_data_->_tmp61_);
		_data_->_tmp63_ = _data_->file_transfer;
		_data_->_tmp64_ = dino_entities_file_transfer_get_time (_data_->_tmp63_);
		_data_->_tmp65_ = _data_->_tmp64_;
		dino_entities_conversation_set_last_active (_data_->conversation, _data_->_tmp65_);
		_data_->_tmp66_ = _data_->file_transfer;
		g_signal_emit (_data_->self, dino_file_manager_signals[DINO_FILE_MANAGER_RECEIVED_FILE_SIGNAL], 0, _data_->_tmp66_, _data_->conversation);
		_g_object_unref0 (_data_->_tmp54_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp67_ = _data_->file_transfer;
		dino_entities_file_transfer_set_state (_data_->_tmp67_, DINO_ENTITIES_FILE_TRANSFER_STATE_FAILED);
		_data_->_tmp68_ = _data_->e;
		_data_->_tmp69_ = _data_->_tmp68_->message;
		g_warning ("file_manager.vala:106: Error saving outgoing file: %s", _data_->_tmp69_);
		_g_error_free0 (_data_->e);
		_xmpp_xep_file_metadata_element_file_metadata_unref0 (_data_->metadata);
		_g_object_unref0 (_data_->file_transfer);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_xmpp_xep_file_metadata_element_file_metadata_unref0 (_data_->metadata);
		_g_object_unref0 (_data_->file_transfer);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp70_ = dino_file_meta_new ();
		_data_->file_meta = _data_->_tmp70_;
		_data_->_tmp71_ = _data_->file_meta;
		_data_->_tmp72_ = _data_->file_transfer;
		_data_->_tmp73_ = dino_entities_file_transfer_get_size (_data_->_tmp72_);
		_data_->_tmp74_ = _data_->_tmp73_;
		_data_->_tmp71_->size = _data_->_tmp74_;
		_data_->_tmp75_ = _data_->file_meta;
		_data_->_tmp76_ = _data_->file_transfer;
		_data_->_tmp77_ = dino_entities_file_transfer_get_mime_type (_data_->_tmp76_);
		_data_->_tmp78_ = _data_->_tmp77_;
		_data_->_tmp79_ = g_strdup (_data_->_tmp78_);
		_g_free0 (_data_->_tmp75_->mime_type);
		_data_->_tmp75_->mime_type = _data_->_tmp79_;
		_data_->file_sender = NULL;
		_data_->file_encryptor = NULL;
		{
			_data_->_tmp80_ = _data_->self->priv->file_senders;
			_data_->_sender_list = _data_->_tmp80_;
			_data_->_tmp81_ = _data_->_sender_list;
			_data_->_tmp82_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp81_);
			_data_->_tmp83_ = _data_->_tmp82_;
			_data_->_sender_size = _data_->_tmp83_;
			_data_->_sender_index = -1;
			while (TRUE) {
				_data_->_sender_index = _data_->_sender_index + 1;
				_data_->_tmp84_ = _data_->_sender_index;
				_data_->_tmp85_ = _data_->_sender_size;
				if (!(_data_->_tmp84_ < _data_->_tmp85_)) {
					break;
				}
				_data_->_tmp86_ = _data_->_sender_list;
				_data_->_tmp87_ = gee_list_get (_data_->_tmp86_, _data_->_sender_index);
				_data_->sender = (DinoFileSender*) _data_->_tmp87_;
				_data_->_tmp88_ = _data_->sender;
				_data_->_tmp89_ = _data_->file_transfer;
				_data_->_state_ = 4;
				dino_file_sender_can_send (_data_->_tmp88_, _data_->conversation, _data_->_tmp89_, dino_file_manager_send_file_ready, _data_);
				return FALSE;
				_state_4:
				if (dino_file_sender_can_send_finish (_data_->_tmp88_, _data_->_res_)) {
					_data_->_tmp91_ = _data_->file_transfer;
					_data_->_tmp92_ = dino_entities_file_transfer_get_encryption (_data_->_tmp91_);
					_data_->_tmp93_ = _data_->_tmp92_;
					if (_data_->_tmp93_ == DINO_ENTITIES_ENCRYPTION_NONE) {
						_data_->_tmp90_ = TRUE;
					} else {
						_data_->_tmp94_ = _data_->sender;
						_data_->_tmp95_ = _data_->file_transfer;
						_data_->_state_ = 5;
						dino_file_sender_can_encrypt (_data_->_tmp94_, _data_->conversation, _data_->_tmp95_, dino_file_manager_send_file_ready, _data_);
						return FALSE;
						_state_5:
						_data_->_tmp90_ = dino_file_sender_can_encrypt_finish (_data_->_tmp94_, _data_->_res_);
					}
					if (_data_->_tmp90_) {
						_data_->_tmp96_ = _data_->sender;
						_data_->_tmp97_ = _g_object_ref0 (_data_->_tmp96_);
						_g_object_unref0 (_data_->file_sender);
						_data_->file_sender = _data_->_tmp97_;
						_g_object_unref0 (_data_->sender);
						break;
					} else {
						{
							_data_->_tmp98_ = _data_->self->priv->file_encryptors;
							_data_->_encryptor_list = _data_->_tmp98_;
							_data_->_tmp99_ = _data_->_encryptor_list;
							_data_->_tmp100_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp99_);
							_data_->_tmp101_ = _data_->_tmp100_;
							_data_->_encryptor_size = _data_->_tmp101_;
							_data_->_encryptor_index = -1;
							while (TRUE) {
								_data_->_encryptor_index = _data_->_encryptor_index + 1;
								_data_->_tmp102_ = _data_->_encryptor_index;
								_data_->_tmp103_ = _data_->_encryptor_size;
								if (!(_data_->_tmp102_ < _data_->_tmp103_)) {
									break;
								}
								_data_->_tmp104_ = _data_->_encryptor_list;
								_data_->_tmp105_ = gee_list_get (_data_->_tmp104_, _data_->_encryptor_index);
								_data_->encryptor = (DinoFileEncryptor*) _data_->_tmp105_;
								_data_->_tmp106_ = _data_->encryptor;
								_data_->_tmp107_ = _data_->file_transfer;
								if (dino_file_encryptor_can_encrypt_file (_data_->_tmp106_, _data_->conversation, _data_->_tmp107_)) {
									_data_->_tmp108_ = _data_->encryptor;
									_data_->_tmp109_ = _g_object_ref0 (_data_->_tmp108_);
									_g_object_unref0 (_data_->file_encryptor);
									_data_->file_encryptor = _data_->_tmp109_;
									_g_object_unref0 (_data_->encryptor);
									break;
								}
								_g_object_unref0 (_data_->encryptor);
							}
						}
						_data_->_tmp110_ = _data_->file_encryptor;
						if (_data_->_tmp110_ != NULL) {
							_data_->_tmp111_ = _data_->sender;
							_data_->_tmp112_ = _g_object_ref0 (_data_->_tmp111_);
							_g_object_unref0 (_data_->file_sender);
							_data_->file_sender = _data_->_tmp112_;
							_g_object_unref0 (_data_->sender);
							break;
						}
					}
				}
				_g_object_unref0 (_data_->sender);
			}
		}
		_data_->_tmp113_ = _data_->file_sender;
		if (_data_->_tmp113_ == NULL) {
			_data_->_tmp114_ = g_error_new_literal (DINO_FILE_SEND_ERROR, DINO_FILE_SEND_ERROR_UPLOAD_FAILED, "No sender/encryptor combination available");
			_data_->_inner_error0_ = _data_->_tmp114_;
			_g_object_unref0 (_data_->file_encryptor);
			_g_object_unref0 (_data_->file_sender);
			_dino_file_meta_unref0 (_data_->file_meta);
			goto __catch1_g_error;
		}
		_data_->_tmp115_ = _data_->file_encryptor;
		if (_data_->_tmp115_ != NULL) {
			_data_->_tmp117_ = _data_->file_encryptor;
			_data_->_tmp118_ = _data_->file_transfer;
			_data_->_tmp119_ = dino_file_encryptor_encrypt_file (_data_->_tmp117_, _data_->conversation, _data_->_tmp118_, &_data_->_inner_error0_);
			_data_->_tmp116_ = _data_->_tmp119_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->file_encryptor);
				_g_object_unref0 (_data_->file_sender);
				_dino_file_meta_unref0 (_data_->file_meta);
				goto __catch1_g_error;
			}
			_data_->_tmp120_ = _data_->_tmp116_;
			_data_->_tmp116_ = NULL;
			_dino_file_meta_unref0 (_data_->file_meta);
			_data_->file_meta = _data_->_tmp120_;
			_dino_file_meta_unref0 (_data_->_tmp116_);
		}
		_data_->_tmp121_ = _data_->file_sender;
		_data_->_tmp122_ = _data_->file_transfer;
		_data_->_tmp123_ = _data_->file_meta;
		_data_->_state_ = 6;
		dino_file_sender_prepare_send_file (_data_->_tmp121_, _data_->conversation, _data_->_tmp122_, _data_->_tmp123_, dino_file_manager_send_file_ready, _data_);
		return FALSE;
		_state_6:
		_data_->_tmp124_ = dino_file_sender_prepare_send_file_finish (_data_->_tmp121_, _data_->_res_, &_data_->_inner_error0_);
		_data_->file_send_data = _data_->_tmp124_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->file_encryptor);
			_g_object_unref0 (_data_->file_sender);
			_dino_file_meta_unref0 (_data_->file_meta);
			goto __catch1_g_error;
		}
		_data_->_tmp125_ = _data_->file_encryptor;
		if (_data_->_tmp125_ != NULL) {
			_data_->_tmp127_ = _data_->file_encryptor;
			_data_->_tmp128_ = _data_->file_transfer;
			_data_->_tmp129_ = _data_->file_send_data;
			_data_->_tmp130_ = _data_->file_meta;
			_data_->_tmp131_ = dino_file_encryptor_preprocess_send_file (_data_->_tmp127_, _data_->conversation, _data_->_tmp128_, _data_->_tmp129_, _data_->_tmp130_, &_data_->_inner_error0_);
			_data_->_tmp126_ = _data_->_tmp131_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_dino_file_send_data_unref0 (_data_->file_send_data);
				_g_object_unref0 (_data_->file_encryptor);
				_g_object_unref0 (_data_->file_sender);
				_dino_file_meta_unref0 (_data_->file_meta);
				goto __catch1_g_error;
			}
			_data_->_tmp132_ = _data_->_tmp126_;
			_data_->_tmp126_ = NULL;
			_dino_file_send_data_unref0 (_data_->file_send_data);
			_data_->file_send_data = _data_->_tmp132_;
			_dino_file_send_data_unref0 (_data_->_tmp126_);
		}
		_data_->_tmp133_ = _data_->file_transfer;
		dino_entities_file_transfer_set_state (_data_->_tmp133_, DINO_ENTITIES_FILE_TRANSFER_STATE_IN_PROGRESS);
		_data_->_tmp134_ = _data_->file_transfer;
		_data_->_tmp135_ = dino_entities_file_transfer_get_input_stream (_data_->_tmp134_);
		_data_->_tmp136_ = _data_->_tmp135_;
		_data_->_tmp137_ = _g_object_ref0 (DINO_IS_LIMIT_INPUT_STREAM (_data_->_tmp136_) ? ((DinoLimitInputStream*) _data_->_tmp136_) : NULL);
		_data_->limit_stream = _data_->_tmp137_;
		_data_->_tmp138_ = _data_->limit_stream;
		if (_data_->_tmp138_ == NULL) {
			_data_->_tmp139_ = _data_->file_transfer;
			_data_->_tmp140_ = dino_entities_file_transfer_get_input_stream (_data_->_tmp139_);
			_data_->_tmp141_ = _data_->_tmp140_;
			_data_->_tmp142_ = _data_->file_meta;
			_data_->_tmp143_ = dino_limit_input_stream_new (_data_->_tmp141_, _data_->_tmp142_->size);
			_g_object_unref0 (_data_->limit_stream);
			_data_->limit_stream = _data_->_tmp143_;
			_data_->_tmp144_ = _data_->file_transfer;
			_data_->_tmp145_ = _data_->limit_stream;
			dino_entities_file_transfer_set_input_stream (_data_->_tmp144_, (GInputStream*) _data_->_tmp145_);
		}
		_data_->_tmp146_ = _data_->limit_stream;
		if (_data_->_tmp146_ != NULL) {
			_data_->_tmp147_ = _data_->limit_stream;
			_data_->_tmp148_ = _data_->file_transfer;
			g_object_bind_property_with_closures ((GObject*) _data_->_tmp147_, "retrieved-bytes", (GObject*) _data_->_tmp148_, "transferred-bytes", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		}
		_data_->_tmp149_ = _data_->file_sender;
		_data_->_tmp150_ = _data_->file_transfer;
		_data_->_tmp151_ = _data_->file_send_data;
		_data_->_tmp152_ = _data_->file_meta;
		_data_->_state_ = 7;
		dino_file_sender_send_file (_data_->_tmp149_, _data_->conversation, _data_->_tmp150_, _data_->_tmp151_, _data_->_tmp152_, dino_file_manager_send_file_ready, _data_);
		return FALSE;
		_state_7:
		dino_file_sender_send_file_finish (_data_->_tmp149_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->limit_stream);
			_dino_file_send_data_unref0 (_data_->file_send_data);
			_g_object_unref0 (_data_->file_encryptor);
			_g_object_unref0 (_data_->file_sender);
			_dino_file_meta_unref0 (_data_->file_meta);
			goto __catch1_g_error;
		}
		_data_->_tmp153_ = _data_->file_transfer;
		dino_entities_file_transfer_set_state (_data_->_tmp153_, DINO_ENTITIES_FILE_TRANSFER_STATE_COMPLETE);
		_g_object_unref0 (_data_->limit_stream);
		_dino_file_send_data_unref0 (_data_->file_send_data);
		_g_object_unref0 (_data_->file_encryptor);
		_g_object_unref0 (_data_->file_sender);
		_dino_file_meta_unref0 (_data_->file_meta);
	}
	goto __finally1;
	__catch1_g_error:
	{
		_data_->_vala1_e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp154_ = _data_->_vala1_e;
		_data_->_tmp155_ = _data_->_tmp154_->message;
		g_warning ("file_manager.vala:167: Send file error: %s", _data_->_tmp155_);
		_data_->_tmp156_ = _data_->file_transfer;
		dino_entities_file_transfer_set_state (_data_->_tmp156_, DINO_ENTITIES_FILE_TRANSFER_STATE_FAILED);
		_g_error_free0 (_data_->_vala1_e);
	}
	__finally1:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_xmpp_xep_file_metadata_element_file_metadata_unref0 (_data_->metadata);
		_g_object_unref0 (_data_->file_transfer);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_xmpp_xep_file_metadata_element_file_metadata_unref0 (_data_->metadata);
	_g_object_unref0 (_data_->file_transfer);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dino_file_manager_download_file_data_free (gpointer _data)
{
	DinoFileManagerDownloadFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file_transfer);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoFileManagerDownloadFileData, _data_);
}

void
dino_file_manager_download_file (DinoFileManager* self,
                                 DinoEntitiesFileTransfer* file_transfer,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DinoFileManagerDownloadFileData* _data_;
	DinoFileManager* _tmp0_;
	DinoEntitiesFileTransfer* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file_transfer != NULL);
	_data_ = g_slice_new0 (DinoFileManagerDownloadFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_file_manager_download_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file_transfer);
	_g_object_unref0 (_data_->file_transfer);
	_data_->file_transfer = _tmp1_;
	dino_file_manager_download_file_co (_data_);
}

void
dino_file_manager_download_file_finish (DinoFileManager* self,
                                        GAsyncResult* _res_)
{
	DinoFileManagerDownloadFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_file_manager_download_file_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DinoFileManagerDownloadFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_file_manager_download_file_co (_data_);
}

static gboolean
dino_file_manager_download_file_co (DinoFileManagerDownloadFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_conversation_manager_IDENTITY;
	_data_->_tmp2_ = dino_stream_interactor_get_module (_data_->_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
	_data_->_tmp3_ = (DinoConversationManager*) _data_->_tmp2_;
	_data_->_tmp4_ = dino_entities_file_transfer_get_counterpart (_data_->file_transfer);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = xmpp_jid_get_bare_jid (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dino_entities_file_transfer_get_account (_data_->file_transfer);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = dino_conversation_manager_get_conversation (_data_->_tmp3_, _data_->_tmp8_, _data_->_tmp10_, NULL);
	_data_->_tmp12_ = _data_->_tmp11_;
	_xmpp_jid_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->conversation = _data_->_tmp12_;
	_data_->_tmp13_ = dino_file_manager_select_file_provider (_data_->self, _data_->file_transfer);
	_data_->file_provider = _data_->_tmp13_;
	_data_->_state_ = 1;
	dino_file_manager_download_file_internal (_data_->self, _data_->file_provider, _data_->file_transfer, _data_->conversation, dino_file_manager_download_file_ready, _data_);
	return FALSE;
	_state_1:
	dino_file_manager_download_file_internal_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->file_provider);
	_g_object_unref0 (_data_->conversation);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dino_file_manager_is_upload_available_data_free (gpointer _data)
{
	DinoFileManagerIsUploadAvailableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoFileManagerIsUploadAvailableData, _data_);
}

void
dino_file_manager_is_upload_available (DinoFileManager* self,
                                       DinoEntitiesConversation* conversation,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DinoFileManagerIsUploadAvailableData* _data_;
	DinoFileManager* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DinoFileManagerIsUploadAvailableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_file_manager_is_upload_available_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp1_;
	dino_file_manager_is_upload_available_co (_data_);
}

gboolean
dino_file_manager_is_upload_available_finish (DinoFileManager* self,
                                              GAsyncResult* _res_)
{
	gboolean result;
	DinoFileManagerIsUploadAvailableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
dino_file_manager_is_upload_available_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	DinoFileManagerIsUploadAvailableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_file_manager_is_upload_available_co (_data_);
}

static gboolean
dino_file_manager_is_upload_available_co (DinoFileManagerIsUploadAvailableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->conversation == NULL) {
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp0_ = _data_->self->priv->file_senders;
		_data_->_file_sender_list = _data_->_tmp0_;
		_data_->_tmp1_ = _data_->_file_sender_list;
		_data_->_tmp2_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp1_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_file_sender_size = _data_->_tmp3_;
		_data_->_file_sender_index = -1;
		while (TRUE) {
			_data_->_file_sender_index = _data_->_file_sender_index + 1;
			_data_->_tmp4_ = _data_->_file_sender_index;
			_data_->_tmp5_ = _data_->_file_sender_size;
			if (!(_data_->_tmp4_ < _data_->_tmp5_)) {
				break;
			}
			_data_->_tmp6_ = _data_->_file_sender_list;
			_data_->_tmp7_ = gee_list_get (_data_->_tmp6_, _data_->_file_sender_index);
			_data_->file_sender = (DinoFileSender*) _data_->_tmp7_;
			_data_->_tmp8_ = _data_->file_sender;
			_data_->_state_ = 1;
			dino_file_sender_is_upload_available (_data_->_tmp8_, _data_->conversation, dino_file_manager_is_upload_available_ready, _data_);
			return FALSE;
			_state_1:
			if (dino_file_sender_is_upload_available_finish (_data_->_tmp8_, _data_->_res_)) {
				_data_->result = TRUE;
				_g_object_unref0 (_data_->file_sender);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->file_sender);
		}
	}
	_data_->result = FALSE;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block15Data*
block15_data_ref (Block15Data* _data15_)
{
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}

static void
block15_data_unref (void * _userdata_)
{
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		DinoFileManager* self;
		self = _data15_->self;
		_g_object_unref0 (_data15_->file_provider);
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}

static void
__lambda37_ (Block15Data* _data15_,
             const gchar* info,
             XmppJid* from,
             GDateTime* time,
             GDateTime* local_time,
             DinoEntitiesConversation* conversation,
             DinoFileReceiveData* receive_data,
             DinoFileMeta* file_meta)
{
	DinoFileManager* self;
	self = _data15_->self;
	g_return_if_fail (info != NULL);
	g_return_if_fail (from != NULL);
	g_return_if_fail (time != NULL);
	g_return_if_fail (local_time != NULL);
	g_return_if_fail (conversation != NULL);
	g_return_if_fail (receive_data != NULL);
	g_return_if_fail (file_meta != NULL);
	dino_file_manager_handle_incoming_file (self, _data15_->file_provider, info, from, time, local_time, conversation, receive_data, file_meta, NULL, NULL);
}

static void
___lambda37__dino_file_provider_file_incoming (DinoFileProvider* _sender,
                                               const gchar* info,
                                               XmppJid* from,
                                               GDateTime* time,
                                               GDateTime* local_time,
                                               DinoEntitiesConversation* conversation,
                                               DinoFileReceiveData* receive_data,
                                               DinoFileMeta* file_meta,
                                               gpointer self)
{
	__lambda37_ (self, info, from, time, local_time, conversation, receive_data, file_meta);
}

void
dino_file_manager_add_provider (DinoFileManager* self,
                                DinoFileProvider* file_provider)
{
	Block15Data* _data15_;
	DinoFileProvider* _tmp0_;
	GeeList* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file_provider != NULL);
	_data15_ = g_slice_new0 (Block15Data);
	_data15_->_ref_count_ = 1;
	_data15_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (file_provider);
	_g_object_unref0 (_data15_->file_provider);
	_data15_->file_provider = _tmp0_;
	_tmp1_ = self->priv->file_providers;
	gee_collection_add ((GeeCollection*) _tmp1_, _data15_->file_provider);
	g_signal_connect_data (_data15_->file_provider, "file-incoming", (GCallback) ___lambda37__dino_file_provider_file_incoming, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
	block15_data_unref (_data15_);
	_data15_ = NULL;
}

static void
__lambda45_ (DinoFileManager* self,
             DinoEntitiesAccount* account)
{
	g_return_if_fail (account != NULL);
	g_signal_emit (self, dino_file_manager_signals[DINO_FILE_MANAGER_UPLOAD_AVAILABLE_SIGNAL], 0, account);
}

static void
___lambda45__dino_file_sender_upload_available (DinoFileSender* _sender,
                                                DinoEntitiesAccount* account,
                                                gpointer self)
{
	__lambda45_ ((DinoFileManager*) self, account);
}

static gint
__lambda46_ (DinoFileManager* self,
             DinoFileSender* a,
             DinoFileSender* b)
{
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	result = (gint) (dino_file_sender_get_priority (b) - dino_file_sender_get_priority (a));
	return result;
}

static gint
___lambda46__gcompare_data_func (gconstpointer a,
                                 gconstpointer b,
                                 gpointer self)
{
	gint result;
	result = __lambda46_ ((DinoFileManager*) self, (DinoFileSender*) a, (DinoFileSender*) b);
	return result;
}

void
dino_file_manager_add_sender (DinoFileManager* self,
                              DinoFileSender* file_sender)
{
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file_sender != NULL);
	_tmp0_ = self->priv->file_senders;
	gee_collection_add ((GeeCollection*) _tmp0_, file_sender);
	g_signal_connect_object (file_sender, "upload-available", (GCallback) ___lambda45__dino_file_sender_upload_available, self, 0);
	_tmp1_ = self->priv->file_senders;
	gee_list_sort (_tmp1_, ___lambda46__gcompare_data_func, g_object_ref (self), g_object_unref);
}

void
dino_file_manager_add_file_encryptor (DinoFileManager* self,
                                      DinoFileEncryptor* encryptor)
{
	GeeList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (encryptor != NULL);
	_tmp0_ = self->priv->file_encryptors;
	gee_collection_add ((GeeCollection*) _tmp0_, encryptor);
}

void
dino_file_manager_add_file_decryptor (DinoFileManager* self,
                                      DinoFileDecryptor* decryptor)
{
	GeeList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (decryptor != NULL);
	_tmp0_ = self->priv->file_decryptors;
	gee_collection_add ((GeeCollection*) _tmp0_, decryptor);
}

void
dino_file_manager_add_metadata_provider (DinoFileManager* self,
                                         DinoFileMetadataProvider* file_metadata_provider)
{
	GeeList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file_metadata_provider != NULL);
	_tmp0_ = self->priv->file_metadata_providers;
	gee_collection_add ((GeeCollection*) _tmp0_, file_metadata_provider);
}

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

gboolean
dino_file_manager_is_sender_trustworthy (DinoFileManager* self,
                                         DinoEntitiesFileTransfer* file_transfer,
                                         DinoEntitiesConversation* conversation)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	XmppJid* relevant_jid = NULL;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	DinoEntitiesConversationType _tmp5_;
	DinoEntitiesConversationType _tmp6_;
	XmppJid* _tmp16_;
	gboolean in_roster = FALSE;
	DinoStreamInteractor* _tmp17_;
	DinoModuleIdentity* _tmp18_;
	gpointer _tmp19_;
	DinoRosterManager* _tmp20_;
	DinoEntitiesAccount* _tmp21_;
	DinoEntitiesAccount* _tmp22_;
	XmppJid* _tmp23_;
	XmppRosterItem* _tmp24_;
	XmppRosterItem* _tmp25_;
	gboolean _tmp26_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (file_transfer != NULL, FALSE);
	g_return_val_if_fail (conversation != NULL, FALSE);
	_tmp0_ = dino_entities_file_transfer_get_direction (file_transfer);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == DINO_ENTITIES_FILE_TRANSFER_DIRECTION_SENT) {
		result = TRUE;
		return result;
	}
	_tmp2_ = dino_entities_conversation_get_counterpart (conversation);
	_tmp3_ = _tmp2_;
	_tmp4_ = _xmpp_jid_ref0 (_tmp3_);
	relevant_jid = _tmp4_;
	_tmp5_ = dino_entities_conversation_get_type_ (conversation);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		DinoStreamInteractor* _tmp7_;
		DinoModuleIdentity* _tmp8_;
		gpointer _tmp9_;
		DinoMucManager* _tmp10_;
		XmppJid* _tmp11_;
		XmppJid* _tmp12_;
		DinoEntitiesAccount* _tmp13_;
		DinoEntitiesAccount* _tmp14_;
		XmppJid* _tmp15_;
		_tmp7_ = self->priv->stream_interactor;
		_tmp8_ = dino_muc_manager_IDENTITY;
		_tmp9_ = dino_stream_interactor_get_module (_tmp7_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp8_);
		_tmp10_ = (DinoMucManager*) _tmp9_;
		_tmp11_ = dino_entities_file_transfer_get_from (file_transfer);
		_tmp12_ = _tmp11_;
		_tmp13_ = dino_entities_conversation_get_account (conversation);
		_tmp14_ = _tmp13_;
		_tmp15_ = dino_muc_manager_get_real_jid (_tmp10_, _tmp12_, _tmp14_);
		_xmpp_jid_unref0 (relevant_jid);
		relevant_jid = _tmp15_;
		_g_object_unref0 (_tmp10_);
	}
	_tmp16_ = relevant_jid;
	if (_tmp16_ == NULL) {
		result = FALSE;
		_xmpp_jid_unref0 (relevant_jid);
		return result;
	}
	_tmp17_ = self->priv->stream_interactor;
	_tmp18_ = dino_roster_manager_IDENTITY;
	_tmp19_ = dino_stream_interactor_get_module (_tmp17_, DINO_TYPE_ROSTER_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp18_);
	_tmp20_ = (DinoRosterManager*) _tmp19_;
	_tmp21_ = dino_entities_conversation_get_account (conversation);
	_tmp22_ = _tmp21_;
	_tmp23_ = relevant_jid;
	_tmp24_ = dino_roster_manager_get_roster_item (_tmp20_, _tmp22_, _tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = _tmp25_ != NULL;
	_xmpp_roster_item_unref0 (_tmp25_);
	_g_object_unref0 (_tmp20_);
	in_roster = _tmp26_;
	result = in_roster;
	_xmpp_jid_unref0 (relevant_jid);
	return result;
}

static void
dino_file_manager_get_file_meta_data_free (gpointer _data)
{
	DinoFileManagerGetFileMetaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file_provider);
	_g_object_unref0 (_data_->file_transfer);
	_g_object_unref0 (_data_->conversation);
	_dino_file_receive_data_unref0 (_data_->receive_data_);
	_dino_file_meta_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoFileManagerGetFileMetaData, _data_);
}

static gpointer
_dino_file_receive_data_ref0 (gpointer self)
{
	return self ? dino_file_receive_data_ref (self) : NULL;
}

static void
dino_file_manager_get_file_meta (DinoFileManager* self,
                                 DinoFileProvider* file_provider,
                                 DinoEntitiesFileTransfer* file_transfer,
                                 DinoEntitiesConversation* conversation,
                                 DinoFileReceiveData* receive_data_,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DinoFileManagerGetFileMetaData* _data_;
	DinoFileManager* _tmp0_;
	DinoFileProvider* _tmp1_;
	DinoEntitiesFileTransfer* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	DinoFileReceiveData* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file_provider != NULL);
	g_return_if_fail (file_transfer != NULL);
	g_return_if_fail (conversation != NULL);
	g_return_if_fail (receive_data_ != NULL);
	_data_ = g_slice_new0 (DinoFileManagerGetFileMetaData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_file_manager_get_file_meta_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file_provider);
	_g_object_unref0 (_data_->file_provider);
	_data_->file_provider = _tmp1_;
	_tmp2_ = _g_object_ref0 (file_transfer);
	_g_object_unref0 (_data_->file_transfer);
	_data_->file_transfer = _tmp2_;
	_tmp3_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp3_;
	_tmp4_ = _dino_file_receive_data_ref0 (receive_data_);
	_dino_file_receive_data_unref0 (_data_->receive_data_);
	_data_->receive_data_ = _tmp4_;
	dino_file_manager_get_file_meta_co (_data_);
}

static DinoFileMeta*
dino_file_manager_get_file_meta_finish (DinoFileManager* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	DinoFileMeta* result;
	DinoFileManagerGetFileMetaData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dino_file_manager_get_file_meta_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DinoFileManagerGetFileMetaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_file_manager_get_file_meta_co (_data_);
}

static gboolean
dino_file_manager_get_file_meta_co (DinoFileManagerGetFileMetaData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _dino_file_receive_data_ref0 (_data_->receive_data_);
	_data_->receive_data = _data_->_tmp0_;
	_data_->_tmp1_ = dino_file_provider_get_file_meta (_data_->file_provider, _data_->file_transfer, &_data_->_inner_error0_);
	_data_->file_meta = _data_->_tmp1_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == DINO_FILE_RECEIVE_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_dino_file_receive_data_unref0 (_data_->receive_data);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_dino_file_receive_data_unref0 (_data_->receive_data);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp2_ = _data_->file_meta;
	if (_data_->_tmp2_->size == ((gint64) -1)) {
		{
			_data_->_tmp3_ = _data_->self->priv->file_decryptors;
			_data_->_file_decryptor_list = _data_->_tmp3_;
			_data_->_tmp4_ = _data_->_file_decryptor_list;
			_data_->_tmp5_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp4_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_data_->_file_decryptor_size = _data_->_tmp6_;
			_data_->_file_decryptor_index = -1;
			while (TRUE) {
				_data_->_file_decryptor_index = _data_->_file_decryptor_index + 1;
				_data_->_tmp7_ = _data_->_file_decryptor_index;
				_data_->_tmp8_ = _data_->_file_decryptor_size;
				if (!(_data_->_tmp7_ < _data_->_tmp8_)) {
					break;
				}
				_data_->_tmp9_ = _data_->_file_decryptor_list;
				_data_->_tmp10_ = gee_list_get (_data_->_tmp9_, _data_->_file_decryptor_index);
				_data_->file_decryptor = (DinoFileDecryptor*) _data_->_tmp10_;
				_data_->_tmp11_ = _data_->file_decryptor;
				_data_->_tmp12_ = _data_->receive_data;
				if (dino_file_decryptor_can_decrypt_file (_data_->_tmp11_, _data_->conversation, _data_->file_transfer, _data_->_tmp12_)) {
					_data_->_tmp13_ = _data_->file_decryptor;
					_data_->_tmp14_ = _data_->receive_data;
					_data_->_tmp15_ = dino_file_decryptor_prepare_get_meta_info (_data_->_tmp13_, _data_->conversation, _data_->file_transfer, _data_->_tmp14_);
					_dino_file_receive_data_unref0 (_data_->receive_data);
					_data_->receive_data = _data_->_tmp15_;
					_g_object_unref0 (_data_->file_decryptor);
					break;
				}
				_g_object_unref0 (_data_->file_decryptor);
			}
		}
		_data_->_tmp17_ = _data_->receive_data;
		_data_->_tmp18_ = _data_->file_meta;
		_data_->_state_ = 1;
		dino_file_provider_get_meta_info (_data_->file_provider, _data_->file_transfer, _data_->_tmp17_, _data_->_tmp18_, dino_file_manager_get_file_meta_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp19_ = dino_file_provider_get_meta_info_finish (_data_->file_provider, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp16_ = _data_->_tmp19_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == DINO_FILE_RECEIVE_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_dino_file_meta_unref0 (_data_->file_meta);
				_dino_file_receive_data_unref0 (_data_->receive_data);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_dino_file_meta_unref0 (_data_->file_meta);
				_dino_file_receive_data_unref0 (_data_->receive_data);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp20_ = _data_->_tmp16_;
		_data_->_tmp16_ = NULL;
		_dino_file_meta_unref0 (_data_->file_meta);
		_data_->file_meta = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->file_meta;
		dino_entities_file_transfer_set_size (_data_->file_transfer, (gint64) ((gint) _data_->_tmp21_->size));
		_data_->_tmp22_ = _data_->file_meta;
		_data_->_tmp23_ = _data_->_tmp22_->file_name;
		dino_entities_file_transfer_set_file_name (_data_->file_transfer, _data_->_tmp23_);
		_data_->_tmp24_ = _data_->file_meta;
		_data_->_tmp25_ = _data_->_tmp24_->mime_type;
		dino_entities_file_transfer_set_mime_type (_data_->file_transfer, _data_->_tmp25_);
		_dino_file_meta_unref0 (_data_->_tmp16_);
	}
	_data_->result = _data_->file_meta;
	_dino_file_receive_data_unref0 (_data_->receive_data);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dino_file_manager_download_file_internal_data_free (gpointer _data)
{
	DinoFileManagerDownloadFileInternalData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file_provider);
	_g_object_unref0 (_data_->file_transfer);
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoFileManagerDownloadFileInternalData, _data_);
}

static void
dino_file_manager_download_file_internal (DinoFileManager* self,
                                          DinoFileProvider* file_provider,
                                          DinoEntitiesFileTransfer* file_transfer,
                                          DinoEntitiesConversation* conversation,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	DinoFileManagerDownloadFileInternalData* _data_;
	DinoFileManager* _tmp0_;
	DinoFileProvider* _tmp1_;
	DinoEntitiesFileTransfer* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file_provider != NULL);
	g_return_if_fail (file_transfer != NULL);
	g_return_if_fail (conversation != NULL);
	_data_ = g_slice_new0 (DinoFileManagerDownloadFileInternalData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_file_manager_download_file_internal_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file_provider);
	_g_object_unref0 (_data_->file_provider);
	_data_->file_provider = _tmp1_;
	_tmp2_ = _g_object_ref0 (file_transfer);
	_g_object_unref0 (_data_->file_transfer);
	_data_->file_transfer = _tmp2_;
	_tmp3_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp3_;
	dino_file_manager_download_file_internal_co (_data_);
}

static void
dino_file_manager_download_file_internal_finish (DinoFileManager* self,
                                                 GAsyncResult* _res_)
{
	DinoFileManagerDownloadFileInternalData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_file_manager_download_file_internal_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	DinoFileManagerDownloadFileInternalData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_file_manager_download_file_internal_co (_data_);
}

static const char*
_g_checksum_type_to_string (GChecksumType value)
{
	switch (value) {
		case G_CHECKSUM_MD5:
		return "G_CHECKSUM_MD5";
		case G_CHECKSUM_SHA1:
		return "G_CHECKSUM_SHA1";
		case G_CHECKSUM_SHA256:
		return "G_CHECKSUM_SHA256";
		case G_CHECKSUM_SHA384:
		return "G_CHECKSUM_SHA384";
		case G_CHECKSUM_SHA512:
		return "G_CHECKSUM_SHA512";
	}
	return NULL;
}

static gboolean
dino_file_manager_download_file_internal_co (DinoFileManagerDownloadFileInternalData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = dino_file_provider_get_file_receive_data (_data_->file_provider, _data_->file_transfer);
		_data_->receive_data = _data_->_tmp0_;
		_data_->_tmp1_ = _data_->receive_data;
		if (_data_->_tmp1_ == NULL) {
			g_warning ("file_manager.vala:257: Don't have download data (yet)");
			_dino_file_receive_data_unref0 (_data_->receive_data);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->file_decryptor = NULL;
		{
			_data_->_tmp2_ = _data_->self->priv->file_decryptors;
			_data_->_decryptor_list = _data_->_tmp2_;
			_data_->_tmp3_ = _data_->_decryptor_list;
			_data_->_tmp4_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp3_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_data_->_decryptor_size = _data_->_tmp5_;
			_data_->_decryptor_index = -1;
			while (TRUE) {
				_data_->_decryptor_index = _data_->_decryptor_index + 1;
				_data_->_tmp6_ = _data_->_decryptor_index;
				_data_->_tmp7_ = _data_->_decryptor_size;
				if (!(_data_->_tmp6_ < _data_->_tmp7_)) {
					break;
				}
				_data_->_tmp8_ = _data_->_decryptor_list;
				_data_->_tmp9_ = gee_list_get (_data_->_tmp8_, _data_->_decryptor_index);
				_data_->decryptor = (DinoFileDecryptor*) _data_->_tmp9_;
				_data_->_tmp10_ = _data_->decryptor;
				_data_->_tmp11_ = _data_->receive_data;
				if (dino_file_decryptor_can_decrypt_file (_data_->_tmp10_, _data_->conversation, _data_->file_transfer, _data_->_tmp11_)) {
					_data_->_tmp12_ = _data_->decryptor;
					_data_->_tmp13_ = _g_object_ref0 (_data_->_tmp12_);
					_g_object_unref0 (_data_->file_decryptor);
					_data_->file_decryptor = _data_->_tmp13_;
					_g_object_unref0 (_data_->decryptor);
					break;
				}
				_g_object_unref0 (_data_->decryptor);
			}
		}
		_data_->_tmp14_ = _data_->file_decryptor;
		if (_data_->_tmp14_ != NULL) {
			_data_->_tmp15_ = _data_->file_decryptor;
			_data_->_tmp16_ = _data_->receive_data;
			_data_->_tmp17_ = dino_file_decryptor_prepare_get_meta_info (_data_->_tmp15_, _data_->conversation, _data_->file_transfer, _data_->_tmp16_);
			_dino_file_receive_data_unref0 (_data_->receive_data);
			_data_->receive_data = _data_->_tmp17_;
		}
		_data_->_tmp18_ = _data_->receive_data;
		_data_->_state_ = 1;
		dino_file_manager_get_file_meta (_data_->self, _data_->file_provider, _data_->file_transfer, _data_->conversation, _data_->_tmp18_, dino_file_manager_download_file_internal_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp19_ = dino_file_manager_get_file_meta_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->file_meta = _data_->_tmp19_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->file_decryptor);
			_dino_file_receive_data_unref0 (_data_->receive_data);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		dino_entities_file_transfer_set_state (_data_->file_transfer, DINO_ENTITIES_FILE_TRANSFER_STATE_IN_PROGRESS);
		_data_->_tmp20_ = _data_->file_decryptor;
		if (_data_->_tmp20_ != NULL) {
			_data_->_tmp21_ = _data_->file_decryptor;
			_data_->_tmp22_ = _data_->receive_data;
			_data_->_tmp23_ = _data_->file_meta;
			_data_->_tmp24_ = dino_file_decryptor_prepare_download_file (_data_->_tmp21_, _data_->conversation, _data_->file_transfer, _data_->_tmp22_, _data_->_tmp23_);
			_dino_file_meta_unref0 (_data_->file_meta);
			_data_->file_meta = _data_->_tmp24_;
		}
		_data_->_tmp25_ = _data_->receive_data;
		_data_->_tmp26_ = _data_->file_meta;
		_data_->_state_ = 2;
		dino_file_provider_download (_data_->file_provider, _data_->file_transfer, _data_->_tmp25_, _data_->_tmp26_, dino_file_manager_download_file_internal_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp27_ = dino_file_provider_download_finish (_data_->file_provider, _data_->_res_, &_data_->_inner_error0_);
		_data_->download_input_stream = _data_->_tmp27_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_dino_file_meta_unref0 (_data_->file_meta);
			_g_object_unref0 (_data_->file_decryptor);
			_dino_file_receive_data_unref0 (_data_->receive_data);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp28_ = _data_->download_input_stream;
		_data_->_tmp29_ = _g_object_ref0 (_data_->_tmp28_);
		_data_->input_stream = _data_->_tmp29_;
		_data_->_tmp30_ = _data_->file_decryptor;
		if (_data_->_tmp30_ != NULL) {
			_data_->_tmp32_ = _data_->file_decryptor;
			_data_->_tmp33_ = _data_->input_stream;
			_data_->_tmp34_ = _data_->receive_data;
			_data_->_state_ = 3;
			dino_file_decryptor_decrypt_file (_data_->_tmp32_, _data_->_tmp33_, _data_->conversation, _data_->file_transfer, _data_->_tmp34_, dino_file_manager_download_file_internal_ready, _data_);
			return FALSE;
			_state_3:
			_data_->_tmp35_ = dino_file_decryptor_decrypt_file_finish (_data_->_tmp32_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp31_ = _data_->_tmp35_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->input_stream);
				_g_object_unref0 (_data_->download_input_stream);
				_dino_file_meta_unref0 (_data_->file_meta);
				_g_object_unref0 (_data_->file_decryptor);
				_dino_file_receive_data_unref0 (_data_->receive_data);
				if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
					goto __catch0_g_io_error_cancelled;
				}
				goto __catch0_g_error;
			}
			_data_->_tmp36_ = _data_->_tmp31_;
			_data_->_tmp31_ = NULL;
			_g_object_unref0 (_data_->input_stream);
			_data_->input_stream = _data_->_tmp36_;
			_g_object_unref0 (_data_->_tmp31_);
		}
		_data_->_tmp37_ = _data_->download_input_stream;
		_data_->_tmp38_ = _g_object_ref0 (DINO_IS_LIMIT_INPUT_STREAM (_data_->_tmp37_) ? ((DinoLimitInputStream*) _data_->_tmp37_) : NULL);
		_data_->limit_stream = _data_->_tmp38_;
		_data_->_tmp39_ = _data_->limit_stream;
		if (_data_->_tmp39_ != NULL) {
			_data_->_tmp40_ = _data_->limit_stream;
			g_object_bind_property_with_closures ((GObject*) _data_->_tmp40_, "retrieved-bytes", (GObject*) _data_->file_transfer, "transferred-bytes", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		}
		_data_->_tmp41_ = g_strdup_printf ("%x", g_random_int ());
		_data_->_tmp42_ = _data_->_tmp41_;
		_data_->_tmp43_ = g_strconcat (_data_->_tmp42_, "_", NULL);
		_data_->_tmp44_ = _data_->_tmp43_;
		_data_->_tmp45_ = dino_entities_file_transfer_get_file_name (_data_->file_transfer);
		_data_->_tmp46_ = _data_->_tmp45_;
		_data_->_tmp47_ = g_strconcat (_data_->_tmp44_, _data_->_tmp46_, NULL);
		_data_->_tmp48_ = _data_->_tmp47_;
		_g_free0 (_data_->_tmp44_);
		_g_free0 (_data_->_tmp42_);
		_data_->filename = _data_->_tmp48_;
		_data_->_tmp49_ = dino_file_manager_get_storage_dir ();
		_data_->_tmp50_ = _data_->_tmp49_;
		_data_->_tmp51_ = _data_->filename;
		_data_->_tmp52_ = g_build_filename (_data_->_tmp50_, _data_->_tmp51_, NULL);
		_data_->_tmp53_ = _data_->_tmp52_;
		_data_->_tmp54_ = g_file_new_for_path (_data_->_tmp53_);
		_data_->_tmp55_ = _data_->_tmp54_;
		_g_free0 (_data_->_tmp53_);
		_g_free0 (_data_->_tmp50_);
		_data_->file = _data_->_tmp55_;
		_data_->_tmp56_ = _data_->file;
		_data_->_tmp57_ = g_file_create (_data_->_tmp56_, G_FILE_CREATE_REPLACE_DESTINATION, NULL, &_data_->_inner_error0_);
		_data_->os = (GOutputStream*) _data_->_tmp57_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->file);
			_g_free0 (_data_->filename);
			_g_object_unref0 (_data_->limit_stream);
			_g_object_unref0 (_data_->input_stream);
			_g_object_unref0 (_data_->download_input_stream);
			_dino_file_meta_unref0 (_data_->file_meta);
			_g_object_unref0 (_data_->file_decryptor);
			_dino_file_receive_data_unref0 (_data_->receive_data);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp58_ = g_new0 (guint8, 1024);
		_data_->buffer = _data_->_tmp58_;
		_data_->buffer_length1 = 1024;
		_data_->_buffer_size_ = _data_->buffer_length1;
		while (TRUE) {
			_data_->_tmp60_ = _data_->input_stream;
			_data_->_tmp61_ = _data_->buffer;
			_data_->_tmp61__length1 = _data_->buffer_length1;
			_data_->_tmp62_ = dino_entities_file_transfer_get_cancellable (_data_->file_transfer);
			_data_->_tmp63_ = _data_->_tmp62_;
			_data_->_state_ = 4;
			g_input_stream_read_async (_data_->_tmp60_, _data_->_tmp61_, (gsize) _data_->_tmp61__length1, G_PRIORITY_LOW, _data_->_tmp63_, dino_file_manager_download_file_internal_ready, _data_);
			return FALSE;
			_state_4:
			_data_->_tmp59_ = g_input_stream_read_finish (_data_->_tmp60_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_data_->buffer = (g_free (_data_->buffer), NULL);
				_g_object_unref0 (_data_->os);
				_g_object_unref0 (_data_->file);
				_g_free0 (_data_->filename);
				_g_object_unref0 (_data_->limit_stream);
				_g_object_unref0 (_data_->input_stream);
				_g_object_unref0 (_data_->download_input_stream);
				_dino_file_meta_unref0 (_data_->file_meta);
				_g_object_unref0 (_data_->file_decryptor);
				_dino_file_receive_data_unref0 (_data_->receive_data);
				if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
					goto __catch0_g_io_error_cancelled;
				}
				goto __catch0_g_error;
			}
			_data_->read = _data_->_tmp59_;
			if (!(_data_->read > ((gssize) 0))) {
				break;
			}
			_data_->buffer_length1 = (gint) _data_->read;
			_data_->_tmp64_ = _data_->os;
			_data_->_tmp65_ = _data_->buffer;
			_data_->_tmp65__length1 = _data_->buffer_length1;
			_data_->_tmp66_ = dino_entities_file_transfer_get_cancellable (_data_->file_transfer);
			_data_->_tmp67_ = _data_->_tmp66_;
			_data_->_state_ = 5;
			g_output_stream_write_async (_data_->_tmp64_, _data_->_tmp65_, (gsize) _data_->_tmp65__length1, G_PRIORITY_LOW, _data_->_tmp67_, dino_file_manager_download_file_internal_ready, _data_);
			return FALSE;
			_state_5:
			g_output_stream_write_finish (_data_->_tmp64_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_data_->buffer = (g_free (_data_->buffer), NULL);
				_g_object_unref0 (_data_->os);
				_g_object_unref0 (_data_->file);
				_g_free0 (_data_->filename);
				_g_object_unref0 (_data_->limit_stream);
				_g_object_unref0 (_data_->input_stream);
				_g_object_unref0 (_data_->download_input_stream);
				_dino_file_meta_unref0 (_data_->file_meta);
				_g_object_unref0 (_data_->file_decryptor);
				_dino_file_receive_data_unref0 (_data_->receive_data);
				if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
					goto __catch0_g_io_error_cancelled;
				}
				goto __catch0_g_error;
			}
			_data_->buffer_length1 = 1024;
		}
		_data_->_tmp68_ = _data_->input_stream;
		_data_->_tmp69_ = dino_entities_file_transfer_get_cancellable (_data_->file_transfer);
		_data_->_tmp70_ = _data_->_tmp69_;
		_data_->_state_ = 6;
		g_input_stream_close_async (_data_->_tmp68_, G_PRIORITY_LOW, _data_->_tmp70_, dino_file_manager_download_file_internal_ready, _data_);
		return FALSE;
		_state_6:
		g_input_stream_close_finish (_data_->_tmp68_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_data_->buffer = (g_free (_data_->buffer), NULL);
			_g_object_unref0 (_data_->os);
			_g_object_unref0 (_data_->file);
			_g_free0 (_data_->filename);
			_g_object_unref0 (_data_->limit_stream);
			_g_object_unref0 (_data_->input_stream);
			_g_object_unref0 (_data_->download_input_stream);
			_dino_file_meta_unref0 (_data_->file_meta);
			_g_object_unref0 (_data_->file_decryptor);
			_dino_file_receive_data_unref0 (_data_->receive_data);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp71_ = _data_->os;
		_data_->_tmp72_ = dino_entities_file_transfer_get_cancellable (_data_->file_transfer);
		_data_->_tmp73_ = _data_->_tmp72_;
		_data_->_state_ = 7;
		g_output_stream_close_async (_data_->_tmp71_, G_PRIORITY_LOW, _data_->_tmp73_, dino_file_manager_download_file_internal_ready, _data_);
		return FALSE;
		_state_7:
		g_output_stream_close_finish (_data_->_tmp71_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_data_->buffer = (g_free (_data_->buffer), NULL);
			_g_object_unref0 (_data_->os);
			_g_object_unref0 (_data_->file);
			_g_free0 (_data_->filename);
			_g_object_unref0 (_data_->limit_stream);
			_g_object_unref0 (_data_->input_stream);
			_g_object_unref0 (_data_->download_input_stream);
			_dino_file_meta_unref0 (_data_->file_meta);
			_g_object_unref0 (_data_->file_decryptor);
			_dino_file_receive_data_unref0 (_data_->receive_data);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp74_ = _data_->file_transfer->hashes;
		_data_->_tmp75_ = xmpp_xep_cryptographic_hashes_get_supported_hashes (_data_->_tmp74_);
		_data_->supported_hashes = _data_->_tmp75_;
		_data_->_tmp76_ = _data_->supported_hashes;
		_data_->_tmp77_ = gee_collection_get_is_empty ((GeeCollection*) _data_->_tmp76_);
		_data_->_tmp78_ = _data_->_tmp77_;
		if (!_data_->_tmp78_) {
			_data_->_tmp79_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL);
			_data_->checksum_types = _data_->_tmp79_;
			_data_->_tmp80_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
			_data_->hashes = _data_->_tmp80_;
			{
				_data_->_tmp81_ = _data_->supported_hashes;
				_data_->_hash_list = _data_->_tmp81_;
				_data_->_tmp82_ = _data_->_hash_list;
				_data_->_tmp83_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp82_);
				_data_->_tmp84_ = _data_->_tmp83_;
				_data_->_hash_size = _data_->_tmp84_;
				_data_->_hash_index = -1;
				while (TRUE) {
					_data_->_hash_index = _data_->_hash_index + 1;
					_data_->_tmp85_ = _data_->_hash_index;
					_data_->_tmp86_ = _data_->_hash_size;
					if (!(_data_->_tmp85_ < _data_->_tmp86_)) {
						break;
					}
					_data_->_tmp87_ = _data_->_hash_list;
					_data_->_tmp88_ = gee_list_get (_data_->_tmp87_, _data_->_hash_index);
					_data_->hash = (XmppXepCryptographicHashesHash*) _data_->_tmp88_;
					_data_->_tmp89_ = _data_->hash;
					_data_->_tmp90_ = _data_->_tmp89_->algo;
					_data_->_tmp91_ = xmpp_xep_cryptographic_hashes_hash_string_to_type (_data_->_tmp90_);
					_data_->checksum_type = _data_->_tmp91_;
					_data_->_tmp92_ = _data_->checksum_types;
					_data_->_tmp93_ = _data_->checksum_type;
					gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp92_, (gpointer) ((gintptr) (*_data_->_tmp93_)));
					_data_->_tmp94_ = _data_->hashes;
					_data_->_tmp95_ = _data_->checksum_type;
					_data_->_tmp96_ = _data_->hash;
					_data_->_tmp97_ = _data_->_tmp96_->val;
					gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp94_, (gpointer) ((gintptr) (*_data_->_tmp95_)), _data_->_tmp97_);
					_g_free0 (_data_->checksum_type);
					_g_object_unref0 (_data_->hash);
				}
			}
			_data_->_tmp98_ = _data_->file;
			_data_->_tmp99_ = _data_->checksum_types;
			_data_->_state_ = 8;
			dino_compute_file_hashes (_data_->_tmp98_, (GeeList*) _data_->_tmp99_, dino_file_manager_download_file_internal_ready, _data_);
			return FALSE;
			_state_8:
			_data_->_tmp100_ = dino_compute_file_hashes_finish (_data_->_res_);
			_data_->computed_hashes = _data_->_tmp100_;
			{
				_data_->_tmp101_ = _data_->hashes;
				_data_->_tmp102_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _data_->_tmp101_);
				_data_->_tmp103_ = _data_->_tmp102_;
				_data_->_tmp104_ = _data_->_tmp103_;
				_data_->_tmp105_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp104_);
				_data_->_tmp106_ = _data_->_tmp105_;
				_g_object_unref0 (_data_->_tmp104_);
				_data_->_checksum_type_it = _data_->_tmp106_;
				while (TRUE) {
					_data_->_tmp107_ = _data_->_checksum_type_it;
					if (!gee_iterator_next (_data_->_tmp107_)) {
						break;
					}
					_data_->_tmp108_ = _data_->_checksum_type_it;
					_data_->_tmp109_ = gee_iterator_get (_data_->_tmp108_);
					_data_->_vala1_checksum_type = (GChecksumType) ((gintptr) _data_->_tmp109_);
					_data_->_tmp110_ = _data_->hashes;
					_data_->_tmp111_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp110_, (gpointer) ((gintptr) _data_->_vala1_checksum_type));
					_data_->_tmp112_ = (gchar*) _data_->_tmp111_;
					_data_->_tmp113_ = _data_->computed_hashes;
					_data_->_tmp114_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp113_, (gpointer) ((gintptr) _data_->_vala1_checksum_type));
					_data_->_tmp115_ = (gchar*) _data_->_tmp114_;
					_data_->_tmp116_ = g_strcmp0 (_data_->_tmp112_, _data_->_tmp115_) != 0;
					_g_free0 (_data_->_tmp115_);
					_g_free0 (_data_->_tmp112_);
					if (_data_->_tmp116_) {
						_data_->_tmp117_ = dino_entities_file_transfer_get_file_name (_data_->file_transfer);
						_data_->_tmp118_ = _data_->_tmp117_;
						_data_->_tmp119_ = _g_checksum_type_to_string (_data_->_vala1_checksum_type);
						_data_->_tmp120_ = _data_->hashes;
						_data_->_tmp121_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp120_, (gpointer) ((gintptr) _data_->_vala1_checksum_type));
						_data_->_tmp122_ = (gchar*) _data_->_tmp121_;
						_data_->_tmp123_ = _data_->computed_hashes;
						_data_->_tmp124_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp123_, (gpointer) ((gintptr) _data_->_vala1_checksum_type));
						_data_->_tmp125_ = (gchar*) _data_->_tmp124_;
						g_warning ("file_manager.vala:323: Hash of downloaded file does not equal advertis" \
"ed hash, discarding: %s. %s should be %s, was %s", _data_->_tmp118_, _data_->_tmp119_, _data_->_tmp122_, _data_->_tmp125_);
						_g_free0 (_data_->_tmp125_);
						_g_free0 (_data_->_tmp122_);
						_data_->_tmp126_ = _data_->file;
						_data_->_tmp127_ = g_file_get_path (_data_->_tmp126_);
						_data_->_tmp128_ = _data_->_tmp127_;
						g_remove (_data_->_tmp128_);
						_g_free0 (_data_->_tmp128_);
						dino_entities_file_transfer_set_state (_data_->file_transfer, DINO_ENTITIES_FILE_TRANSFER_STATE_FAILED);
						_g_object_unref0 (_data_->_checksum_type_it);
						_g_object_unref0 (_data_->computed_hashes);
						_g_object_unref0 (_data_->hashes);
						_g_object_unref0 (_data_->checksum_types);
						_g_object_unref0 (_data_->supported_hashes);
						_data_->buffer = (g_free (_data_->buffer), NULL);
						_g_object_unref0 (_data_->os);
						_g_object_unref0 (_data_->file);
						_g_free0 (_data_->filename);
						_g_object_unref0 (_data_->limit_stream);
						_g_object_unref0 (_data_->input_stream);
						_g_object_unref0 (_data_->download_input_stream);
						_dino_file_meta_unref0 (_data_->file_meta);
						_g_object_unref0 (_data_->file_decryptor);
						_dino_file_receive_data_unref0 (_data_->receive_data);
						g_task_return_pointer (_data_->_async_result, _data_, NULL);
						if (_data_->_state_ != 0) {
							while (!g_task_get_completed (_data_->_async_result)) {
								g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
							}
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
				}
				_g_object_unref0 (_data_->_checksum_type_it);
			}
			_g_object_unref0 (_data_->computed_hashes);
			_g_object_unref0 (_data_->hashes);
			_g_object_unref0 (_data_->checksum_types);
		}
		_data_->_tmp129_ = _data_->file;
		_data_->_tmp130_ = g_file_get_basename (_data_->_tmp129_);
		_data_->_tmp131_ = _data_->_tmp130_;
		dino_entities_file_transfer_set_path (_data_->file_transfer, _data_->_tmp131_);
		_g_free0 (_data_->_tmp131_);
		_data_->_tmp132_ = dino_entities_file_transfer_get_file (_data_->file_transfer);
		_data_->_tmp133_ = _data_->_tmp132_;
		_data_->_tmp134_ = g_file_query_info (_data_->_tmp133_, "*", G_FILE_QUERY_INFO_NONE, NULL, &_data_->_inner_error0_);
		_data_->_tmp135_ = _data_->_tmp134_;
		_g_object_unref0 (_data_->_tmp133_);
		_data_->file_info = _data_->_tmp135_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->supported_hashes);
			_data_->buffer = (g_free (_data_->buffer), NULL);
			_g_object_unref0 (_data_->os);
			_g_object_unref0 (_data_->file);
			_g_free0 (_data_->filename);
			_g_object_unref0 (_data_->limit_stream);
			_g_object_unref0 (_data_->input_stream);
			_g_object_unref0 (_data_->download_input_stream);
			_dino_file_meta_unref0 (_data_->file_meta);
			_g_object_unref0 (_data_->file_decryptor);
			_dino_file_receive_data_unref0 (_data_->receive_data);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp137_ = _data_->file_info;
		_data_->_tmp138_ = g_file_info_get_content_type (_data_->_tmp137_);
		if (g_strcmp0 (_data_->_tmp138_, "application/octet-stream") != 0) {
			_data_->_tmp136_ = TRUE;
		} else {
			_data_->_tmp139_ = dino_entities_file_transfer_get_mime_type (_data_->file_transfer);
			_data_->_tmp140_ = _data_->_tmp139_;
			_data_->_tmp136_ = _data_->_tmp140_ == NULL;
		}
		if (_data_->_tmp136_) {
			_data_->_tmp141_ = _data_->file_info;
			_data_->_tmp142_ = g_file_info_get_content_type (_data_->_tmp141_);
			dino_entities_file_transfer_set_mime_type (_data_->file_transfer, _data_->_tmp142_);
		}
		dino_entities_file_transfer_set_state (_data_->file_transfer, DINO_ENTITIES_FILE_TRANSFER_STATE_COMPLETE);
		_g_object_unref0 (_data_->file_info);
		_g_object_unref0 (_data_->supported_hashes);
		_data_->buffer = (g_free (_data_->buffer), NULL);
		_g_object_unref0 (_data_->os);
		_g_object_unref0 (_data_->file);
		_g_free0 (_data_->filename);
		_g_object_unref0 (_data_->limit_stream);
		_g_object_unref0 (_data_->input_stream);
		_g_object_unref0 (_data_->download_input_stream);
		_dino_file_meta_unref0 (_data_->file_meta);
		_g_object_unref0 (_data_->file_decryptor);
		_dino_file_receive_data_unref0 (_data_->receive_data);
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_data_->_inner_error0_);
		g_print ("cancelled\n");
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp143_ = _data_->e;
		_data_->_tmp144_ = _data_->_tmp143_->message;
		g_warning ("file_manager.vala:344: Error downloading file: %s", _data_->_tmp144_);
		_data_->_tmp146_ = dino_entities_file_transfer_get_provider (_data_->file_transfer);
		_data_->_tmp147_ = _data_->_tmp146_;
		if (_data_->_tmp147_ == 0) {
			_data_->_tmp145_ = TRUE;
		} else {
			_data_->_tmp148_ = dino_entities_file_transfer_get_provider (_data_->file_transfer);
			_data_->_tmp149_ = _data_->_tmp148_;
			_data_->_tmp145_ = _data_->_tmp149_ == DINO_FILE_MANAGER_SFS_PROVIDER_ID;
		}
		if (_data_->_tmp145_) {
			dino_entities_file_transfer_set_state (_data_->file_transfer, DINO_ENTITIES_FILE_TRANSFER_STATE_NOT_STARTED);
		} else {
			dino_entities_file_transfer_set_state (_data_->file_transfer, DINO_ENTITIES_FILE_TRANSFER_STATE_FAILED);
		}
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

DinoEntitiesFileTransfer*
dino_file_manager_create_file_transfer_from_provider_incoming (DinoFileManager* self,
                                                               DinoFileProvider* file_provider,
                                                               const gchar* info,
                                                               XmppJid* from,
                                                               GDateTime* time,
                                                               GDateTime* local_time,
                                                               DinoEntitiesConversation* conversation,
                                                               DinoFileReceiveData* receive_data,
                                                               DinoFileMeta* file_meta)
{
	DinoEntitiesFileTransfer* file_transfer = NULL;
	DinoEntitiesFileTransfer* _tmp0_;
	DinoEntitiesFileTransfer* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	XmppJid* _tmp4_ = NULL;
	DinoEntitiesFileTransfer* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	DinoEntitiesFileTransfer* _tmp10_;
	DinoEntitiesConversationType _tmp11_;
	DinoEntitiesConversationType _tmp12_;
	DinoEntitiesFileTransfer* _tmp48_;
	DinoEntitiesFileTransfer* _tmp49_;
	DinoEntitiesFileTransfer* _tmp50_;
	DinoEntitiesFileTransfer* _tmp51_;
	const gchar* _tmp52_;
	DinoEntitiesFileTransfer* _tmp53_;
	DinoEntitiesFileTransfer* _tmp54_;
	DinoEntitiesEncryption encryption = 0;
	DinoEntitiesFileTransfer* _tmp55_;
	DinoEntitiesFileTransfer* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (file_provider != NULL, NULL);
	g_return_val_if_fail (info != NULL, NULL);
	g_return_val_if_fail (from != NULL, NULL);
	g_return_val_if_fail (time != NULL, NULL);
	g_return_val_if_fail (local_time != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	g_return_val_if_fail (receive_data != NULL, NULL);
	g_return_val_if_fail (file_meta != NULL, NULL);
	_tmp0_ = dino_entities_file_transfer_new ();
	file_transfer = _tmp0_;
	_tmp1_ = file_transfer;
	_tmp2_ = dino_entities_conversation_get_account (conversation);
	_tmp3_ = _tmp2_;
	dino_entities_file_transfer_set_account (_tmp1_, _tmp3_);
	_tmp5_ = file_transfer;
	_tmp6_ = dino_entities_file_transfer_get_direction (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_ == DINO_ENTITIES_FILE_TRANSFER_DIRECTION_RECEIVED) {
		_tmp4_ = from;
	} else {
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		_tmp8_ = dino_entities_conversation_get_counterpart (conversation);
		_tmp9_ = _tmp8_;
		_tmp4_ = _tmp9_;
	}
	_tmp10_ = file_transfer;
	dino_entities_file_transfer_set_counterpart (_tmp10_, _tmp4_);
	_tmp11_ = dino_entities_conversation_get_type_ (conversation);
	_tmp12_ = _tmp11_;
	if (dino_entities_conversation_type_is_muc_semantic (_tmp12_)) {
		XmppJid* _tmp13_ = NULL;
		DinoStreamInteractor* _tmp14_;
		DinoModuleIdentity* _tmp15_;
		gpointer _tmp16_;
		DinoMucManager* _tmp17_;
		XmppJid* _tmp18_;
		XmppJid* _tmp19_;
		DinoEntitiesAccount* _tmp20_;
		DinoEntitiesAccount* _tmp21_;
		XmppJid* _tmp22_;
		XmppJid* _tmp23_;
		DinoEntitiesFileTransfer* _tmp28_;
		gboolean _tmp29_ = FALSE;
		DinoEntitiesFileTransfer* _tmp30_;
		XmppJid* _tmp31_;
		XmppJid* _tmp32_;
		DinoEntitiesFileTransfer* _tmp33_;
		_tmp14_ = self->priv->stream_interactor;
		_tmp15_ = dino_muc_manager_IDENTITY;
		_tmp16_ = dino_stream_interactor_get_module (_tmp14_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp15_);
		_tmp17_ = (DinoMucManager*) _tmp16_;
		_tmp18_ = dino_entities_conversation_get_counterpart (conversation);
		_tmp19_ = _tmp18_;
		_tmp20_ = dino_entities_conversation_get_account (conversation);
		_tmp21_ = _tmp20_;
		_tmp22_ = dino_muc_manager_get_own_jid (_tmp17_, _tmp19_, _tmp21_);
		_tmp23_ = _tmp22_;
		_g_object_unref0 (_tmp17_);
		_tmp13_ = _tmp23_;
		if (_tmp13_ == NULL) {
			DinoEntitiesAccount* _tmp24_;
			DinoEntitiesAccount* _tmp25_;
			XmppJid* _tmp26_;
			XmppJid* _tmp27_;
			_tmp24_ = dino_entities_conversation_get_account (conversation);
			_tmp25_ = _tmp24_;
			_tmp26_ = dino_entities_account_get_bare_jid (_tmp25_);
			_tmp27_ = _tmp26_;
			_xmpp_jid_unref0 (_tmp13_);
			_tmp13_ = _tmp27_;
		}
		_tmp28_ = file_transfer;
		dino_entities_file_transfer_set_ourpart (_tmp28_, _tmp13_);
		_tmp30_ = file_transfer;
		_tmp31_ = dino_entities_file_transfer_get_ourpart (_tmp30_);
		_tmp32_ = _tmp31_;
		if (xmpp_jid_equals (from, _tmp32_)) {
			_tmp29_ = DINO_ENTITIES_FILE_TRANSFER_DIRECTION_SENT;
		} else {
			_tmp29_ = DINO_ENTITIES_FILE_TRANSFER_DIRECTION_RECEIVED;
		}
		_tmp33_ = file_transfer;
		dino_entities_file_transfer_set_direction (_tmp33_, _tmp29_);
		_xmpp_jid_unref0 (_tmp13_);
	} else {
		DinoEntitiesAccount* _tmp34_;
		DinoEntitiesAccount* _tmp35_;
		XmppJid* _tmp36_;
		XmppJid* _tmp37_;
		XmppJid* _tmp38_;
		gboolean _tmp39_;
		_tmp34_ = dino_entities_conversation_get_account (conversation);
		_tmp35_ = _tmp34_;
		_tmp36_ = dino_entities_account_get_bare_jid (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp38_ = _tmp37_;
		_tmp39_ = xmpp_jid_equals_bare (from, _tmp38_);
		_xmpp_jid_unref0 (_tmp38_);
		if (_tmp39_) {
			DinoEntitiesFileTransfer* _tmp40_;
			DinoEntitiesFileTransfer* _tmp41_;
			_tmp40_ = file_transfer;
			dino_entities_file_transfer_set_ourpart (_tmp40_, from);
			_tmp41_ = file_transfer;
			dino_entities_file_transfer_set_direction (_tmp41_, DINO_ENTITIES_FILE_TRANSFER_DIRECTION_SENT);
		} else {
			DinoEntitiesFileTransfer* _tmp42_;
			DinoEntitiesAccount* _tmp43_;
			DinoEntitiesAccount* _tmp44_;
			XmppJid* _tmp45_;
			XmppJid* _tmp46_;
			DinoEntitiesFileTransfer* _tmp47_;
			_tmp42_ = file_transfer;
			_tmp43_ = dino_entities_conversation_get_account (conversation);
			_tmp44_ = _tmp43_;
			_tmp45_ = dino_entities_account_get_full_jid (_tmp44_);
			_tmp46_ = _tmp45_;
			dino_entities_file_transfer_set_ourpart (_tmp42_, _tmp46_);
			_tmp47_ = file_transfer;
			dino_entities_file_transfer_set_direction (_tmp47_, DINO_ENTITIES_FILE_TRANSFER_DIRECTION_RECEIVED);
		}
	}
	_tmp48_ = file_transfer;
	dino_entities_file_transfer_set_time (_tmp48_, time);
	_tmp49_ = file_transfer;
	dino_entities_file_transfer_set_local_time (_tmp49_, local_time);
	_tmp50_ = file_transfer;
	dino_entities_file_transfer_set_provider (_tmp50_, dino_file_provider_get_id (file_provider));
	_tmp51_ = file_transfer;
	_tmp52_ = file_meta->file_name;
	dino_entities_file_transfer_set_file_name (_tmp51_, _tmp52_);
	_tmp53_ = file_transfer;
	dino_entities_file_transfer_set_size (_tmp53_, (gint64) ((gint) file_meta->size));
	_tmp54_ = file_transfer;
	dino_entities_file_transfer_set_info (_tmp54_, info);
	_tmp55_ = file_transfer;
	encryption = dino_file_provider_get_encryption (file_provider, _tmp55_, receive_data, file_meta);
	if (encryption != DINO_ENTITIES_ENCRYPTION_NONE) {
		DinoEntitiesFileTransfer* _tmp56_;
		_tmp56_ = file_transfer;
		dino_entities_file_transfer_set_encryption (_tmp56_, encryption);
	}
	{
		GeeList* _decryptor_list = NULL;
		GeeList* _tmp57_;
		gint _decryptor_size = 0;
		GeeList* _tmp58_;
		gint _tmp59_;
		gint _tmp60_;
		gint _decryptor_index = 0;
		_tmp57_ = self->priv->file_decryptors;
		_decryptor_list = _tmp57_;
		_tmp58_ = _decryptor_list;
		_tmp59_ = gee_collection_get_size ((GeeCollection*) _tmp58_);
		_tmp60_ = _tmp59_;
		_decryptor_size = _tmp60_;
		_decryptor_index = -1;
		while (TRUE) {
			gint _tmp61_;
			gint _tmp62_;
			DinoFileDecryptor* decryptor = NULL;
			GeeList* _tmp63_;
			gpointer _tmp64_;
			DinoFileDecryptor* _tmp65_;
			DinoEntitiesFileTransfer* _tmp66_;
			_decryptor_index = _decryptor_index + 1;
			_tmp61_ = _decryptor_index;
			_tmp62_ = _decryptor_size;
			if (!(_tmp61_ < _tmp62_)) {
				break;
			}
			_tmp63_ = _decryptor_list;
			_tmp64_ = gee_list_get (_tmp63_, _decryptor_index);
			decryptor = (DinoFileDecryptor*) _tmp64_;
			_tmp65_ = decryptor;
			_tmp66_ = file_transfer;
			if (dino_file_decryptor_can_decrypt_file (_tmp65_, conversation, _tmp66_, receive_data)) {
				DinoEntitiesFileTransfer* _tmp67_;
				DinoFileDecryptor* _tmp68_;
				_tmp67_ = file_transfer;
				_tmp68_ = decryptor;
				dino_entities_file_transfer_set_encryption (_tmp67_, dino_file_decryptor_get_encryption (_tmp68_));
			}
			_g_object_unref0 (decryptor);
		}
	}
	result = file_transfer;
	return result;
}

static void
dino_file_manager_handle_incoming_file_data_free (gpointer _data)
{
	DinoFileManagerHandleIncomingFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file_provider);
	_g_free0 (_data_->info);
	_xmpp_jid_unref0 (_data_->from);
	_g_date_time_unref0 (_data_->time);
	_g_date_time_unref0 (_data_->local_time);
	_g_object_unref0 (_data_->conversation);
	_dino_file_receive_data_unref0 (_data_->receive_data);
	_dino_file_meta_unref0 (_data_->file_meta);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoFileManagerHandleIncomingFileData, _data_);
}

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

static gpointer
_dino_file_meta_ref0 (gpointer self)
{
	return self ? dino_file_meta_ref (self) : NULL;
}

static void
dino_file_manager_handle_incoming_file (DinoFileManager* self,
                                        DinoFileProvider* file_provider,
                                        const gchar* info,
                                        XmppJid* from,
                                        GDateTime* time,
                                        GDateTime* local_time,
                                        DinoEntitiesConversation* conversation,
                                        DinoFileReceiveData* receive_data,
                                        DinoFileMeta* file_meta,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DinoFileManagerHandleIncomingFileData* _data_;
	DinoFileManager* _tmp0_;
	DinoFileProvider* _tmp1_;
	gchar* _tmp2_;
	XmppJid* _tmp3_;
	GDateTime* _tmp4_;
	GDateTime* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	DinoFileReceiveData* _tmp7_;
	DinoFileMeta* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file_provider != NULL);
	g_return_if_fail (info != NULL);
	g_return_if_fail (from != NULL);
	g_return_if_fail (time != NULL);
	g_return_if_fail (local_time != NULL);
	g_return_if_fail (conversation != NULL);
	g_return_if_fail (receive_data != NULL);
	g_return_if_fail (file_meta != NULL);
	_data_ = g_slice_new0 (DinoFileManagerHandleIncomingFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_file_manager_handle_incoming_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file_provider);
	_g_object_unref0 (_data_->file_provider);
	_data_->file_provider = _tmp1_;
	_tmp2_ = g_strdup (info);
	_g_free0 (_data_->info);
	_data_->info = _tmp2_;
	_tmp3_ = _xmpp_jid_ref0 (from);
	_xmpp_jid_unref0 (_data_->from);
	_data_->from = _tmp3_;
	_tmp4_ = _g_date_time_ref0 (time);
	_g_date_time_unref0 (_data_->time);
	_data_->time = _tmp4_;
	_tmp5_ = _g_date_time_ref0 (local_time);
	_g_date_time_unref0 (_data_->local_time);
	_data_->local_time = _tmp5_;
	_tmp6_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp6_;
	_tmp7_ = _dino_file_receive_data_ref0 (receive_data);
	_dino_file_receive_data_unref0 (_data_->receive_data);
	_data_->receive_data = _tmp7_;
	_tmp8_ = _dino_file_meta_ref0 (file_meta);
	_dino_file_meta_unref0 (_data_->file_meta);
	_data_->file_meta = _tmp8_;
	dino_file_manager_handle_incoming_file_co (_data_);
}

static void
dino_file_manager_handle_incoming_file_finish (DinoFileManager* self,
                                               GAsyncResult* _res_)
{
	DinoFileManagerHandleIncomingFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_file_manager_handle_incoming_file_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DinoFileManagerHandleIncomingFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_file_manager_handle_incoming_file_co (_data_);
}

static void
____lambda43_ (DinoFileManager* self,
               GObject* _,
               GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	dino_file_manager_download_file_internal_finish (self, res);
}

static void
_____lambda43__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	____lambda43_ ((DinoFileManager*) self, source_object, res);
	g_object_unref (self);
}

static gboolean
dino_file_manager_handle_incoming_file_co (DinoFileManagerHandleIncomingFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dino_file_manager_create_file_transfer_from_provider_incoming (_data_->self, _data_->file_provider, _data_->info, _data_->from, _data_->time, _data_->local_time, _data_->conversation, _data_->receive_data, _data_->file_meta);
	_data_->file_transfer = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->stream_interactor;
	_data_->_tmp2_ = dino_file_transfer_storage_IDENTITY;
	_data_->_tmp3_ = dino_stream_interactor_get_module (_data_->_tmp1_, DINO_TYPE_FILE_TRANSFER_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp2_);
	_data_->_tmp4_ = (DinoFileTransferStorage*) _data_->_tmp3_;
	_data_->_tmp5_ = _data_->file_transfer;
	dino_file_transfer_storage_add_file (_data_->_tmp4_, _data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->file_transfer;
	if (dino_file_manager_is_sender_trustworthy (_data_->self, _data_->_tmp6_, _data_->conversation)) {
		{
			_data_->_tmp7_ = _data_->file_transfer;
			_data_->_state_ = 1;
			dino_file_manager_get_file_meta (_data_->self, _data_->file_provider, _data_->_tmp7_, _data_->conversation, _data_->receive_data, dino_file_manager_handle_incoming_file_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp8_ = dino_file_manager_get_file_meta_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp9_ = _data_->_tmp8_;
			_dino_file_meta_unref0 (_data_->_tmp9_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp10_ = _data_->e;
			_data_->_tmp11_ = _data_->_tmp10_->message;
			g_warning ("file_manager.vala:396: Error downloading file: %s", _data_->_tmp11_);
			_data_->_tmp12_ = _data_->file_transfer;
			dino_entities_file_transfer_set_state (_data_->_tmp12_, DINO_ENTITIES_FILE_TRANSFER_STATE_FAILED);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->file_transfer);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp14_ = _data_->file_transfer;
		_data_->_tmp15_ = dino_entities_file_transfer_get_size (_data_->_tmp14_);
		_data_->_tmp16_ = _data_->_tmp15_;
		if (_data_->_tmp16_ >= ((gint64) 0)) {
			_data_->_tmp17_ = _data_->file_transfer;
			_data_->_tmp18_ = dino_entities_file_transfer_get_size (_data_->_tmp17_);
			_data_->_tmp19_ = _data_->_tmp18_;
			_data_->_tmp13_ = _data_->_tmp19_ < ((gint64) 5000000);
		} else {
			_data_->_tmp13_ = FALSE;
		}
		if (_data_->_tmp13_) {
			_data_->_tmp20_ = _data_->file_transfer;
			dino_file_manager_download_file_internal (_data_->self, _data_->file_provider, _data_->_tmp20_, _data_->conversation, _____lambda43__gasync_ready_callback, g_object_ref (_data_->self));
		}
	}
	_data_->_tmp21_ = _data_->file_transfer;
	_data_->_tmp22_ = dino_entities_file_transfer_get_time (_data_->_tmp21_);
	_data_->_tmp23_ = _data_->_tmp22_;
	dino_entities_conversation_set_last_active (_data_->conversation, _data_->_tmp23_);
	_data_->_tmp24_ = _data_->file_transfer;
	g_signal_emit (_data_->self, dino_file_manager_signals[DINO_FILE_MANAGER_RECEIVED_FILE_SIGNAL], 0, _data_->_tmp24_, _data_->conversation);
	_g_object_unref0 (_data_->file_transfer);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dino_file_manager_save_file_data_free (gpointer _data)
{
	DinoFileManagerSaveFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file_transfer);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoFileManagerSaveFileData, _data_);
}

static void
dino_file_manager_save_file (DinoFileManager* self,
                             DinoEntitiesFileTransfer* file_transfer,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DinoFileManagerSaveFileData* _data_;
	DinoFileManager* _tmp0_;
	DinoEntitiesFileTransfer* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file_transfer != NULL);
	_data_ = g_slice_new0 (DinoFileManagerSaveFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_file_manager_save_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (file_transfer);
	_g_object_unref0 (_data_->file_transfer);
	_data_->file_transfer = _tmp1_;
	dino_file_manager_save_file_co (_data_);
}

static void
dino_file_manager_save_file_finish (DinoFileManager* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	DinoFileManagerSaveFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dino_file_manager_save_file_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DinoFileManagerSaveFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_file_manager_save_file_co (_data_);
}

static gboolean
dino_file_manager_save_file_co (DinoFileManagerSaveFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = g_strdup_printf ("%x", g_random_int ());
		_data_->_tmp1_ = _data_->_tmp0_;
		_data_->_tmp2_ = g_strconcat (_data_->_tmp1_, "_", NULL);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = dino_entities_file_transfer_get_file_name (_data_->file_transfer);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = g_strconcat (_data_->_tmp3_, _data_->_tmp5_, NULL);
		_data_->_tmp7_ = _data_->_tmp6_;
		_g_free0 (_data_->_tmp3_);
		_g_free0 (_data_->_tmp1_);
		_data_->filename = _data_->_tmp7_;
		_data_->_tmp8_ = dino_file_manager_get_storage_dir ();
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = _data_->filename;
		_data_->_tmp11_ = g_build_filename (_data_->_tmp9_, _data_->_tmp10_, NULL);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = g_file_new_for_path (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_g_free0 (_data_->_tmp12_);
		_g_free0 (_data_->_tmp9_);
		_data_->file = _data_->_tmp14_;
		_data_->_tmp15_ = _data_->file;
		_data_->_tmp16_ = g_file_create (_data_->_tmp15_, G_FILE_CREATE_REPLACE_DESTINATION, NULL, &_data_->_inner_error0_);
		_data_->os = (GOutputStream*) _data_->_tmp16_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->file);
			_g_free0 (_data_->filename);
			goto __catch0_g_error;
		}
		_data_->_tmp17_ = _data_->os;
		_data_->_tmp18_ = dino_entities_file_transfer_get_input_stream (_data_->file_transfer);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_state_ = 1;
		g_output_stream_splice_async (_data_->_tmp17_, _data_->_tmp19_, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, G_PRIORITY_DEFAULT, NULL, dino_file_manager_save_file_ready, _data_);
		return FALSE;
		_state_1:
		g_output_stream_splice_finish (_data_->_tmp17_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->os);
			_g_object_unref0 (_data_->file);
			_g_free0 (_data_->filename);
			goto __catch0_g_error;
		}
		dino_entities_file_transfer_set_state (_data_->file_transfer, DINO_ENTITIES_FILE_TRANSFER_STATE_COMPLETE);
		_data_->_tmp20_ = _data_->filename;
		dino_entities_file_transfer_set_path (_data_->file_transfer, _data_->_tmp20_);
		_data_->_tmp22_ = _data_->file;
		_data_->_state_ = 2;
		g_file_read_async (_data_->_tmp22_, G_PRIORITY_DEFAULT, NULL, dino_file_manager_save_file_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp23_ = g_file_read_finish (_data_->_tmp22_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp21_ = _data_->_tmp23_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->os);
			_g_object_unref0 (_data_->file);
			_g_free0 (_data_->filename);
			goto __catch0_g_error;
		}
		_data_->_tmp24_ = dino_entities_file_transfer_get_size (_data_->file_transfer);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = dino_limit_input_stream_new ((GInputStream*) _data_->_tmp21_, _data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		dino_entities_file_transfer_set_input_stream (_data_->file_transfer, (GInputStream*) _data_->_tmp27_);
		_g_object_unref0 (_data_->_tmp27_);
		_g_object_unref0 (_data_->_tmp21_);
		_g_object_unref0 (_data_->os);
		_g_object_unref0 (_data_->file);
		_g_free0 (_data_->filename);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp28_ = _data_->e;
		_data_->_tmp29_ = _data_->_tmp28_->message;
		_data_->_tmp30_ = g_strdup_printf ("Saving file error: %s", _data_->_tmp29_);
		_data_->_tmp31_ = _data_->_tmp30_;
		_data_->_tmp32_ = g_error_new_literal (DINO_FILE_SEND_ERROR, DINO_FILE_SEND_ERROR_SAVE_FAILED, _data_->_tmp31_);
		_data_->_tmp33_ = _data_->_tmp32_;
		_g_free0 (_data_->_tmp31_);
		_data_->_inner_error0_ = _data_->_tmp33_;
		_g_error_free0 (_data_->e);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == DINO_FILE_SEND_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static const gchar*
dino_file_manager_real_get_id (DinoStreamInteractionModule* base)
{
	const gchar* result;
	DinoFileManager* self;
	DinoModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (DinoFileManager*) base;
	_tmp0_ = dino_file_manager_IDENTITY;
	_tmp1_ = dino_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

DinoStatelessFileSharing*
dino_file_manager_get_sfs (DinoFileManager* self)
{
	DinoStatelessFileSharing* result;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stateless_file_sharing_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_STATELESS_FILE_SHARING, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	result = (DinoStatelessFileSharing*) _tmp2_;
	return result;
}

static void
dino_file_manager_set_sfs (DinoFileManager* self,
                           DinoStatelessFileSharing* value)
{
	g_return_if_fail (self != NULL);
	g_object_notify_by_pspec ((GObject *) self, dino_file_manager_properties[DINO_FILE_MANAGER_SFS_PROPERTY]);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), data2);
}

static void
dino_file_manager_class_init (DinoFileManagerClass * klass,
                              gpointer klass_data)
{
	DinoModuleIdentity* _tmp0_;
	dino_file_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoFileManager_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_file_manager_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_file_manager_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_file_manager_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_FILE_MANAGER_ID_PROPERTY, dino_file_manager_properties[DINO_FILE_MANAGER_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_FILE_MANAGER_SFS_PROPERTY, dino_file_manager_properties[DINO_FILE_MANAGER_SFS_PROPERTY] = g_param_spec_object ("sfs", "sfs", "sfs", DINO_TYPE_STATELESS_FILE_SHARING, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	dino_file_manager_signals[DINO_FILE_MANAGER_UPLOAD_AVAILABLE_SIGNAL] = g_signal_new ("upload-available", DINO_TYPE_FILE_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_ENTITIES_TYPE_ACCOUNT);
	dino_file_manager_signals[DINO_FILE_MANAGER_RECEIVED_FILE_SIGNAL] = g_signal_new ("received-file", DINO_TYPE_FILE_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_FILE_TRANSFER, DINO_ENTITIES_TYPE_CONVERSATION);
	_tmp0_ = dino_module_identity_new (DINO_TYPE_FILE_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "file");
	dino_file_manager_IDENTITY = _tmp0_;
}

static void
dino_file_manager_dino_stream_interaction_module_interface_init (DinoStreamInteractionModuleIface * iface,
                                                                 gpointer iface_data)
{
	dino_file_manager_dino_stream_interaction_module_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_id = dino_file_manager_real_get_id;
}

static void
dino_file_manager_instance_init (DinoFileManager * self,
                                 gpointer klass)
{
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	GeeArrayList* _tmp4_;
	self->priv = dino_file_manager_get_instance_private (self);
	_tmp0_ = gee_array_list_new (DINO_TYPE_FILE_SENDER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->file_senders = (GeeList*) _tmp0_;
	_tmp1_ = gee_array_list_new (DINO_TYPE_FILE_ENCRYPTOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->file_encryptors = (GeeList*) _tmp1_;
	_tmp2_ = gee_array_list_new (DINO_TYPE_FILE_DECRYPTOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->file_decryptors = (GeeList*) _tmp2_;
	_tmp3_ = gee_array_list_new (DINO_TYPE_FILE_PROVIDER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->file_providers = (GeeList*) _tmp3_;
	_tmp4_ = gee_array_list_new (DINO_TYPE_FILE_METADATA_PROVIDER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->file_metadata_providers = (GeeList*) _tmp4_;
}

static void
dino_file_manager_finalize (GObject * obj)
{
	DinoFileManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_FILE_MANAGER, DinoFileManager);
	_g_object_unref0 (self->priv->stream_interactor);
	_qlite_database_unref0 (self->priv->db);
	_g_object_unref0 (self->priv->file_senders);
	_g_object_unref0 (self->priv->file_encryptors);
	_g_object_unref0 (self->priv->file_decryptors);
	_g_object_unref0 (self->priv->file_providers);
	_g_object_unref0 (self->priv->file_metadata_providers);
	G_OBJECT_CLASS (dino_file_manager_parent_class)->finalize (obj);
}

static GType
dino_file_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoFileManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_file_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoFileManager), 0, (GInstanceInitFunc) dino_file_manager_instance_init, NULL };
	static const GInterfaceInfo dino_stream_interaction_module_info = { (GInterfaceInitFunc) dino_file_manager_dino_stream_interaction_module_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_file_manager_type_id;
	dino_file_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoFileManager", &g_define_type_info, 0);
	g_type_add_interface_static (dino_file_manager_type_id, DINO_TYPE_STREAM_INTERACTION_MODULE, &dino_stream_interaction_module_info);
	DinoFileManager_private_offset = g_type_add_instance_private (dino_file_manager_type_id, sizeof (DinoFileManagerPrivate));
	return dino_file_manager_type_id;
}

GType
dino_file_manager_get_type (void)
{
	static volatile gsize dino_file_manager_type_id__once = 0;
	if (g_once_init_enter (&dino_file_manager_type_id__once)) {
		GType dino_file_manager_type_id;
		dino_file_manager_type_id = dino_file_manager_get_type_once ();
		g_once_init_leave (&dino_file_manager_type_id__once, dino_file_manager_type_id);
	}
	return dino_file_manager_type_id__once;
}

static void
_vala_dino_file_manager_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec)
{
	DinoFileManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_TYPE_FILE_MANAGER, DinoFileManager);
	switch (property_id) {
		case DINO_FILE_MANAGER_ID_PROPERTY:
		g_value_set_string (value, dino_stream_interaction_module_get_id ((DinoStreamInteractionModule*) self));
		break;
		case DINO_FILE_MANAGER_SFS_PROPERTY:
		g_value_take_object (value, dino_file_manager_get_sfs (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_file_manager_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec)
{
	DinoFileManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_TYPE_FILE_MANAGER, DinoFileManager);
	switch (property_id) {
		case DINO_FILE_MANAGER_SFS_PROPERTY:
		dino_file_manager_set_sfs (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

GQuark
dino_file_send_error_quark (void)
{
	return g_quark_from_static_string ("dino-file-send-error-quark");
}

static GType
dino_file_send_error_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_FILE_SEND_ERROR_ENCRYPTION_FAILED, "DINO_FILE_SEND_ERROR_ENCRYPTION_FAILED", "encryption-failed"}, {DINO_FILE_SEND_ERROR_UPLOAD_FAILED, "DINO_FILE_SEND_ERROR_UPLOAD_FAILED", "upload-failed"}, {DINO_FILE_SEND_ERROR_SAVE_FAILED, "DINO_FILE_SEND_ERROR_SAVE_FAILED", "save-failed"}, {0, NULL, NULL}};
	GType dino_file_send_error_type_id;
	dino_file_send_error_type_id = g_enum_register_static ("DinoFileSendError", values);
	return dino_file_send_error_type_id;
}

GType
dino_file_send_error_get_type (void)
{
	static volatile gsize dino_file_send_error_type_id__once = 0;
	if (g_once_init_enter (&dino_file_send_error_type_id__once)) {
		GType dino_file_send_error_type_id;
		dino_file_send_error_type_id = dino_file_send_error_get_type_once ();
		g_once_init_leave (&dino_file_send_error_type_id__once, dino_file_send_error_type_id);
	}
	return dino_file_send_error_type_id__once;
}

GQuark
dino_file_receive_error_quark (void)
{
	return g_quark_from_static_string ("dino-file-receive-error-quark");
}

static GType
dino_file_receive_error_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_FILE_RECEIVE_ERROR_GET_METADATA_FAILED, "DINO_FILE_RECEIVE_ERROR_GET_METADATA_FAILED", "get-metadata-failed"}, {DINO_FILE_RECEIVE_ERROR_DECRYPTION_FAILED, "DINO_FILE_RECEIVE_ERROR_DECRYPTION_FAILED", "decryption-failed"}, {0, NULL, NULL}};
	GType dino_file_receive_error_type_id;
	dino_file_receive_error_type_id = g_enum_register_static ("DinoFileReceiveError", values);
	return dino_file_receive_error_type_id;
}

GType
dino_file_receive_error_get_type (void)
{
	static volatile gsize dino_file_receive_error_type_id__once = 0;
	if (g_once_init_enter (&dino_file_receive_error_type_id__once)) {
		GType dino_file_receive_error_type_id;
		dino_file_receive_error_type_id = dino_file_receive_error_get_type_once ();
		g_once_init_leave (&dino_file_receive_error_type_id__once, dino_file_receive_error_type_id);
	}
	return dino_file_receive_error_type_id__once;
}

DinoFileMeta*
dino_file_meta_construct (GType object_type)
{
	DinoFileMeta* self = NULL;
	self = (DinoFileMeta*) g_type_create_instance (object_type);
	return self;
}

DinoFileMeta*
dino_file_meta_new (void)
{
	return dino_file_meta_construct (DINO_TYPE_FILE_META);
}

static void
dino_value_file_meta_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
dino_value_file_meta_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		dino_file_meta_unref (value->data[0].v_pointer);
	}
}

static void
dino_value_file_meta_copy_value (const GValue* src_value,
                                 GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dino_file_meta_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
dino_value_file_meta_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
dino_value_file_meta_collect_value (GValue* value,
                                    guint n_collect_values,
                                    GTypeCValue* collect_values,
                                    guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DinoFileMeta * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dino_file_meta_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dino_value_file_meta_lcopy_value (const GValue* value,
                                  guint n_collect_values,
                                  GTypeCValue* collect_values,
                                  guint collect_flags)
{
	DinoFileMeta ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dino_file_meta_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
dino_param_spec_file_meta (const gchar* name,
                           const gchar* nick,
                           const gchar* blurb,
                           GType object_type,
                           GParamFlags flags)
{
	DinoParamSpecFileMeta* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DINO_TYPE_FILE_META), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
dino_value_get_file_meta (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_META), NULL);
	return value->data[0].v_pointer;
}

void
dino_value_set_file_meta (GValue* value,
                          gpointer v_object)
{
	DinoFileMeta * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_META));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_TYPE_FILE_META));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dino_file_meta_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_file_meta_unref (old);
	}
}

void
dino_value_take_file_meta (GValue* value,
                           gpointer v_object)
{
	DinoFileMeta * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_META));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_TYPE_FILE_META));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_file_meta_unref (old);
	}
}

static void
dino_file_meta_class_init (DinoFileMetaClass * klass,
                           gpointer klass_data)
{
	dino_file_meta_parent_class = g_type_class_peek_parent (klass);
	((DinoFileMetaClass *) klass)->finalize = dino_file_meta_finalize;
}

static void
dino_file_meta_instance_init (DinoFileMeta * self,
                              gpointer klass)
{
	self->size = (gint64) -1;
	self->mime_type = NULL;
	self->file_name = NULL;
	self->encryption = DINO_ENTITIES_ENCRYPTION_NONE;
	self->ref_count = 1;
}

static void
dino_file_meta_finalize (DinoFileMeta * obj)
{
	DinoFileMeta * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_FILE_META, DinoFileMeta);
	g_signal_handlers_destroy (self);
	_g_free0 (self->mime_type);
	_g_free0 (self->file_name);
}

static GType
dino_file_meta_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dino_value_file_meta_init, dino_value_file_meta_free_value, dino_value_file_meta_copy_value, dino_value_file_meta_peek_pointer, "p", dino_value_file_meta_collect_value, "p", dino_value_file_meta_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DinoFileMetaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_file_meta_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoFileMeta), 0, (GInstanceInitFunc) dino_file_meta_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType dino_file_meta_type_id;
	dino_file_meta_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DinoFileMeta", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return dino_file_meta_type_id;
}

GType
dino_file_meta_get_type (void)
{
	static volatile gsize dino_file_meta_type_id__once = 0;
	if (g_once_init_enter (&dino_file_meta_type_id__once)) {
		GType dino_file_meta_type_id;
		dino_file_meta_type_id = dino_file_meta_get_type_once ();
		g_once_init_leave (&dino_file_meta_type_id__once, dino_file_meta_type_id);
	}
	return dino_file_meta_type_id__once;
}

gpointer
dino_file_meta_ref (gpointer instance)
{
	DinoFileMeta * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
dino_file_meta_unref (gpointer instance)
{
	DinoFileMeta * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DINO_FILE_META_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

DinoHttpFileMeta*
dino_http_file_meta_construct (GType object_type)
{
	DinoHttpFileMeta* self = NULL;
	self = (DinoHttpFileMeta*) dino_file_meta_construct (object_type);
	return self;
}

DinoHttpFileMeta*
dino_http_file_meta_new (void)
{
	return dino_http_file_meta_construct (DINO_TYPE_HTTP_FILE_META);
}

static void
dino_http_file_meta_class_init (DinoHttpFileMetaClass * klass,
                                gpointer klass_data)
{
	dino_http_file_meta_parent_class = g_type_class_peek_parent (klass);
	((DinoFileMetaClass *) klass)->finalize = dino_http_file_meta_finalize;
}

static void
dino_http_file_meta_instance_init (DinoHttpFileMeta * self,
                                   gpointer klass)
{
}

static void
dino_http_file_meta_finalize (DinoFileMeta * obj)
{
	DinoHttpFileMeta * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_HTTP_FILE_META, DinoHttpFileMeta);
	_g_object_unref0 (self->message);
	DINO_FILE_META_CLASS (dino_http_file_meta_parent_class)->finalize (obj);
}

static GType
dino_http_file_meta_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoHttpFileMetaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_http_file_meta_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoHttpFileMeta), 0, (GInstanceInitFunc) dino_http_file_meta_instance_init, NULL };
	GType dino_http_file_meta_type_id;
	dino_http_file_meta_type_id = g_type_register_static (DINO_TYPE_FILE_META, "DinoHttpFileMeta", &g_define_type_info, 0);
	return dino_http_file_meta_type_id;
}

GType
dino_http_file_meta_get_type (void)
{
	static volatile gsize dino_http_file_meta_type_id__once = 0;
	if (g_once_init_enter (&dino_http_file_meta_type_id__once)) {
		GType dino_http_file_meta_type_id;
		dino_http_file_meta_type_id = dino_http_file_meta_get_type_once ();
		g_once_init_leave (&dino_http_file_meta_type_id__once, dino_http_file_meta_type_id);
	}
	return dino_http_file_meta_type_id__once;
}

DinoFileSendData*
dino_file_send_data_construct (GType object_type)
{
	DinoFileSendData* self = NULL;
	self = (DinoFileSendData*) g_type_create_instance (object_type);
	return self;
}

DinoFileSendData*
dino_file_send_data_new (void)
{
	return dino_file_send_data_construct (DINO_TYPE_FILE_SEND_DATA);
}

static void
dino_value_file_send_data_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
dino_value_file_send_data_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		dino_file_send_data_unref (value->data[0].v_pointer);
	}
}

static void
dino_value_file_send_data_copy_value (const GValue* src_value,
                                      GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dino_file_send_data_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
dino_value_file_send_data_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
dino_value_file_send_data_collect_value (GValue* value,
                                         guint n_collect_values,
                                         GTypeCValue* collect_values,
                                         guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DinoFileSendData * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dino_file_send_data_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dino_value_file_send_data_lcopy_value (const GValue* value,
                                       guint n_collect_values,
                                       GTypeCValue* collect_values,
                                       guint collect_flags)
{
	DinoFileSendData ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dino_file_send_data_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
dino_param_spec_file_send_data (const gchar* name,
                                const gchar* nick,
                                const gchar* blurb,
                                GType object_type,
                                GParamFlags flags)
{
	DinoParamSpecFileSendData* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DINO_TYPE_FILE_SEND_DATA), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
dino_value_get_file_send_data (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_SEND_DATA), NULL);
	return value->data[0].v_pointer;
}

void
dino_value_set_file_send_data (GValue* value,
                               gpointer v_object)
{
	DinoFileSendData * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_SEND_DATA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_TYPE_FILE_SEND_DATA));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dino_file_send_data_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_file_send_data_unref (old);
	}
}

void
dino_value_take_file_send_data (GValue* value,
                                gpointer v_object)
{
	DinoFileSendData * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_SEND_DATA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_TYPE_FILE_SEND_DATA));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_file_send_data_unref (old);
	}
}

static void
dino_file_send_data_class_init (DinoFileSendDataClass * klass,
                                gpointer klass_data)
{
	dino_file_send_data_parent_class = g_type_class_peek_parent (klass);
	((DinoFileSendDataClass *) klass)->finalize = dino_file_send_data_finalize;
}

static void
dino_file_send_data_instance_init (DinoFileSendData * self,
                                   gpointer klass)
{
	self->ref_count = 1;
}

static void
dino_file_send_data_finalize (DinoFileSendData * obj)
{
	DinoFileSendData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_FILE_SEND_DATA, DinoFileSendData);
	g_signal_handlers_destroy (self);
}

static GType
dino_file_send_data_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dino_value_file_send_data_init, dino_value_file_send_data_free_value, dino_value_file_send_data_copy_value, dino_value_file_send_data_peek_pointer, "p", dino_value_file_send_data_collect_value, "p", dino_value_file_send_data_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DinoFileSendDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_file_send_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoFileSendData), 0, (GInstanceInitFunc) dino_file_send_data_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType dino_file_send_data_type_id;
	dino_file_send_data_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DinoFileSendData", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return dino_file_send_data_type_id;
}

GType
dino_file_send_data_get_type (void)
{
	static volatile gsize dino_file_send_data_type_id__once = 0;
	if (g_once_init_enter (&dino_file_send_data_type_id__once)) {
		GType dino_file_send_data_type_id;
		dino_file_send_data_type_id = dino_file_send_data_get_type_once ();
		g_once_init_leave (&dino_file_send_data_type_id__once, dino_file_send_data_type_id);
	}
	return dino_file_send_data_type_id__once;
}

gpointer
dino_file_send_data_ref (gpointer instance)
{
	DinoFileSendData * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
dino_file_send_data_unref (gpointer instance)
{
	DinoFileSendData * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DINO_FILE_SEND_DATA_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
dino_http_file_send_data_get_instance_private (DinoHttpFileSendData* self)
{
	return G_STRUCT_MEMBER_P (self, DinoHttpFileSendData_private_offset);
}

DinoHttpFileSendData*
dino_http_file_send_data_construct (GType object_type)
{
	DinoHttpFileSendData* self = NULL;
	self = (DinoHttpFileSendData*) dino_file_send_data_construct (object_type);
	return self;
}

DinoHttpFileSendData*
dino_http_file_send_data_new (void)
{
	return dino_http_file_send_data_construct (DINO_TYPE_HTTP_FILE_SEND_DATA);
}

const gchar*
dino_http_file_send_data_get_url_down (DinoHttpFileSendData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url_down;
	result = _tmp0_;
	return result;
}

void
dino_http_file_send_data_set_url_down (DinoHttpFileSendData* self,
                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_url_down);
	self->priv->_url_down = _tmp0_;
}

const gchar*
dino_http_file_send_data_get_url_up (DinoHttpFileSendData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url_up;
	result = _tmp0_;
	return result;
}

void
dino_http_file_send_data_set_url_up (DinoHttpFileSendData* self,
                                     const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_url_up);
	self->priv->_url_up = _tmp0_;
}

GeeHashMap*
dino_http_file_send_data_get_headers (DinoHttpFileSendData* self)
{
	GeeHashMap* result;
	GeeHashMap* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_headers;
	result = _tmp0_;
	return result;
}

void
dino_http_file_send_data_set_headers (DinoHttpFileSendData* self,
                                      GeeHashMap* value)
{
	GeeHashMap* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_headers);
	self->priv->_headers = _tmp0_;
}

gboolean
dino_http_file_send_data_get_encrypt_message (DinoHttpFileSendData* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_encrypt_message;
	return result;
}

void
dino_http_file_send_data_set_encrypt_message (DinoHttpFileSendData* self,
                                              gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_encrypt_message = value;
}

static void
dino_http_file_send_data_class_init (DinoHttpFileSendDataClass * klass,
                                     gpointer klass_data)
{
	dino_http_file_send_data_parent_class = g_type_class_peek_parent (klass);
	((DinoFileSendDataClass *) klass)->finalize = dino_http_file_send_data_finalize;
	g_type_class_adjust_private_offset (klass, &DinoHttpFileSendData_private_offset);
}

static void
dino_http_file_send_data_instance_init (DinoHttpFileSendData * self,
                                        gpointer klass)
{
	self->priv = dino_http_file_send_data_get_instance_private (self);
	self->priv->_encrypt_message = TRUE;
}

static void
dino_http_file_send_data_finalize (DinoFileSendData * obj)
{
	DinoHttpFileSendData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_HTTP_FILE_SEND_DATA, DinoHttpFileSendData);
	_g_free0 (self->priv->_url_down);
	_g_free0 (self->priv->_url_up);
	_g_object_unref0 (self->priv->_headers);
	DINO_FILE_SEND_DATA_CLASS (dino_http_file_send_data_parent_class)->finalize (obj);
}

static GType
dino_http_file_send_data_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoHttpFileSendDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_http_file_send_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoHttpFileSendData), 0, (GInstanceInitFunc) dino_http_file_send_data_instance_init, NULL };
	GType dino_http_file_send_data_type_id;
	dino_http_file_send_data_type_id = g_type_register_static (DINO_TYPE_FILE_SEND_DATA, "DinoHttpFileSendData", &g_define_type_info, 0);
	DinoHttpFileSendData_private_offset = g_type_add_instance_private (dino_http_file_send_data_type_id, sizeof (DinoHttpFileSendDataPrivate));
	return dino_http_file_send_data_type_id;
}

GType
dino_http_file_send_data_get_type (void)
{
	static volatile gsize dino_http_file_send_data_type_id__once = 0;
	if (g_once_init_enter (&dino_http_file_send_data_type_id__once)) {
		GType dino_http_file_send_data_type_id;
		dino_http_file_send_data_type_id = dino_http_file_send_data_get_type_once ();
		g_once_init_leave (&dino_http_file_send_data_type_id__once, dino_http_file_send_data_type_id);
	}
	return dino_http_file_send_data_type_id__once;
}

DinoFileReceiveData*
dino_file_receive_data_construct (GType object_type)
{
	DinoFileReceiveData* self = NULL;
	self = (DinoFileReceiveData*) g_type_create_instance (object_type);
	return self;
}

DinoFileReceiveData*
dino_file_receive_data_new (void)
{
	return dino_file_receive_data_construct (DINO_TYPE_FILE_RECEIVE_DATA);
}

static void
dino_value_file_receive_data_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
dino_value_file_receive_data_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		dino_file_receive_data_unref (value->data[0].v_pointer);
	}
}

static void
dino_value_file_receive_data_copy_value (const GValue* src_value,
                                         GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dino_file_receive_data_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
dino_value_file_receive_data_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
dino_value_file_receive_data_collect_value (GValue* value,
                                            guint n_collect_values,
                                            GTypeCValue* collect_values,
                                            guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DinoFileReceiveData * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dino_file_receive_data_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dino_value_file_receive_data_lcopy_value (const GValue* value,
                                          guint n_collect_values,
                                          GTypeCValue* collect_values,
                                          guint collect_flags)
{
	DinoFileReceiveData ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dino_file_receive_data_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
dino_param_spec_file_receive_data (const gchar* name,
                                   const gchar* nick,
                                   const gchar* blurb,
                                   GType object_type,
                                   GParamFlags flags)
{
	DinoParamSpecFileReceiveData* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DINO_TYPE_FILE_RECEIVE_DATA), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
dino_value_get_file_receive_data (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_RECEIVE_DATA), NULL);
	return value->data[0].v_pointer;
}

void
dino_value_set_file_receive_data (GValue* value,
                                  gpointer v_object)
{
	DinoFileReceiveData * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_RECEIVE_DATA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_TYPE_FILE_RECEIVE_DATA));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dino_file_receive_data_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_file_receive_data_unref (old);
	}
}

void
dino_value_take_file_receive_data (GValue* value,
                                   gpointer v_object)
{
	DinoFileReceiveData * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_TYPE_FILE_RECEIVE_DATA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_TYPE_FILE_RECEIVE_DATA));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_file_receive_data_unref (old);
	}
}

static void
dino_file_receive_data_class_init (DinoFileReceiveDataClass * klass,
                                   gpointer klass_data)
{
	dino_file_receive_data_parent_class = g_type_class_peek_parent (klass);
	((DinoFileReceiveDataClass *) klass)->finalize = dino_file_receive_data_finalize;
}

static void
dino_file_receive_data_instance_init (DinoFileReceiveData * self,
                                      gpointer klass)
{
	self->ref_count = 1;
}

static void
dino_file_receive_data_finalize (DinoFileReceiveData * obj)
{
	DinoFileReceiveData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_FILE_RECEIVE_DATA, DinoFileReceiveData);
	g_signal_handlers_destroy (self);
}

static GType
dino_file_receive_data_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dino_value_file_receive_data_init, dino_value_file_receive_data_free_value, dino_value_file_receive_data_copy_value, dino_value_file_receive_data_peek_pointer, "p", dino_value_file_receive_data_collect_value, "p", dino_value_file_receive_data_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DinoFileReceiveDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_file_receive_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoFileReceiveData), 0, (GInstanceInitFunc) dino_file_receive_data_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType dino_file_receive_data_type_id;
	dino_file_receive_data_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DinoFileReceiveData", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return dino_file_receive_data_type_id;
}

GType
dino_file_receive_data_get_type (void)
{
	static volatile gsize dino_file_receive_data_type_id__once = 0;
	if (g_once_init_enter (&dino_file_receive_data_type_id__once)) {
		GType dino_file_receive_data_type_id;
		dino_file_receive_data_type_id = dino_file_receive_data_get_type_once ();
		g_once_init_leave (&dino_file_receive_data_type_id__once, dino_file_receive_data_type_id);
	}
	return dino_file_receive_data_type_id__once;
}

gpointer
dino_file_receive_data_ref (gpointer instance)
{
	DinoFileReceiveData * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
dino_file_receive_data_unref (gpointer instance)
{
	DinoFileReceiveData * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DINO_FILE_RECEIVE_DATA_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
dino_http_file_receive_data_get_instance_private (DinoHttpFileReceiveData* self)
{
	return G_STRUCT_MEMBER_P (self, DinoHttpFileReceiveData_private_offset);
}

DinoHttpFileReceiveData*
dino_http_file_receive_data_construct (GType object_type)
{
	DinoHttpFileReceiveData* self = NULL;
	self = (DinoHttpFileReceiveData*) dino_file_receive_data_construct (object_type);
	return self;
}

DinoHttpFileReceiveData*
dino_http_file_receive_data_new (void)
{
	return dino_http_file_receive_data_construct (DINO_TYPE_HTTP_FILE_RECEIVE_DATA);
}

const gchar*
dino_http_file_receive_data_get_url (DinoHttpFileReceiveData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url;
	result = _tmp0_;
	return result;
}

void
dino_http_file_receive_data_set_url (DinoHttpFileReceiveData* self,
                                     const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_url);
	self->priv->_url = _tmp0_;
}

static void
dino_http_file_receive_data_class_init (DinoHttpFileReceiveDataClass * klass,
                                        gpointer klass_data)
{
	dino_http_file_receive_data_parent_class = g_type_class_peek_parent (klass);
	((DinoFileReceiveDataClass *) klass)->finalize = dino_http_file_receive_data_finalize;
	g_type_class_adjust_private_offset (klass, &DinoHttpFileReceiveData_private_offset);
}

static void
dino_http_file_receive_data_instance_init (DinoHttpFileReceiveData * self,
                                           gpointer klass)
{
	self->priv = dino_http_file_receive_data_get_instance_private (self);
}

static void
dino_http_file_receive_data_finalize (DinoFileReceiveData * obj)
{
	DinoHttpFileReceiveData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_HTTP_FILE_RECEIVE_DATA, DinoHttpFileReceiveData);
	_g_free0 (self->priv->_url);
	DINO_FILE_RECEIVE_DATA_CLASS (dino_http_file_receive_data_parent_class)->finalize (obj);
}

static GType
dino_http_file_receive_data_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoHttpFileReceiveDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_http_file_receive_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoHttpFileReceiveData), 0, (GInstanceInitFunc) dino_http_file_receive_data_instance_init, NULL };
	GType dino_http_file_receive_data_type_id;
	dino_http_file_receive_data_type_id = g_type_register_static (DINO_TYPE_FILE_RECEIVE_DATA, "DinoHttpFileReceiveData", &g_define_type_info, 0);
	DinoHttpFileReceiveData_private_offset = g_type_add_instance_private (dino_http_file_receive_data_type_id, sizeof (DinoHttpFileReceiveDataPrivate));
	return dino_http_file_receive_data_type_id;
}

GType
dino_http_file_receive_data_get_type (void)
{
	static volatile gsize dino_http_file_receive_data_type_id__once = 0;
	if (g_once_init_enter (&dino_http_file_receive_data_type_id__once)) {
		GType dino_http_file_receive_data_type_id;
		dino_http_file_receive_data_type_id = dino_http_file_receive_data_get_type_once ();
		g_once_init_leave (&dino_http_file_receive_data_type_id__once, dino_http_file_receive_data_type_id);
	}
	return dino_http_file_receive_data_type_id__once;
}

DinoEntitiesEncryption
dino_file_provider_get_encryption (DinoFileProvider* self,
                                   DinoEntitiesFileTransfer* file_transfer,
                                   DinoFileReceiveData* receive_data,
                                   DinoFileMeta* file_meta)
{
	DinoFileProviderIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = DINO_FILE_PROVIDER_GET_INTERFACE (self);
	if (_iface_->get_encryption) {
		return _iface_->get_encryption (self, file_transfer, receive_data, file_meta);
	}
	return 0;
}

DinoFileMeta*
dino_file_provider_get_file_meta (DinoFileProvider* self,
                                  DinoEntitiesFileTransfer* file_transfer,
                                  GError** error)
{
	DinoFileProviderIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = DINO_FILE_PROVIDER_GET_INTERFACE (self);
	if (_iface_->get_file_meta) {
		return _iface_->get_file_meta (self, file_transfer, error);
	}
	return NULL;
}

DinoFileReceiveData*
dino_file_provider_get_file_receive_data (DinoFileProvider* self,
                                          DinoEntitiesFileTransfer* file_transfer)
{
	DinoFileProviderIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = DINO_FILE_PROVIDER_GET_INTERFACE (self);
	if (_iface_->get_file_receive_data) {
		return _iface_->get_file_receive_data (self, file_transfer);
	}
	return NULL;
}

void
dino_file_provider_get_meta_info (DinoFileProvider* self,
                                  DinoEntitiesFileTransfer* file_transfer,
                                  DinoFileReceiveData* receive_data,
                                  DinoFileMeta* file_meta,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	DinoFileProviderIface* _iface_;
	_iface_ = DINO_FILE_PROVIDER_GET_INTERFACE (self);
	if (_iface_->get_meta_info) {
		_iface_->get_meta_info (self, file_transfer, receive_data, file_meta, _callback_, _user_data_);
	}
}

DinoFileMeta*
dino_file_provider_get_meta_info_finish (DinoFileProvider* self,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	DinoFileProviderIface* _iface_;
	_iface_ = DINO_FILE_PROVIDER_GET_INTERFACE (self);
	if (_iface_->get_meta_info_finish) {
		return _iface_->get_meta_info_finish (self, _res_, error);
	}
	return NULL;
}

void
dino_file_provider_download (DinoFileProvider* self,
                             DinoEntitiesFileTransfer* file_transfer,
                             DinoFileReceiveData* receive_data,
                             DinoFileMeta* file_meta,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DinoFileProviderIface* _iface_;
	_iface_ = DINO_FILE_PROVIDER_GET_INTERFACE (self);
	if (_iface_->download) {
		_iface_->download (self, file_transfer, receive_data, file_meta, _callback_, _user_data_);
	}
}

GInputStream*
dino_file_provider_download_finish (DinoFileProvider* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	DinoFileProviderIface* _iface_;
	_iface_ = DINO_FILE_PROVIDER_GET_INTERFACE (self);
	if (_iface_->download_finish) {
		return _iface_->download_finish (self, _res_, error);
	}
	return NULL;
}

gint
dino_file_provider_get_id (DinoFileProvider* self)
{
	DinoFileProviderIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = DINO_FILE_PROVIDER_GET_INTERFACE (self);
	if (_iface_->get_id) {
		return _iface_->get_id (self);
	}
	return -1;
}

static void
g_cclosure_user_marshal_VOID__STRING_XMPP_JID_BOXED_BOXED_OBJECT_DINO_FILE_RECEIVE_DATA_DINO_FILE_META (GClosure * closure,
                                                                                                        GValue * return_value,
                                                                                                        guint n_param_values,
                                                                                                        const GValue * param_values,
                                                                                                        gpointer invocation_hint,
                                                                                                        gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_XMPP_JID_BOXED_BOXED_OBJECT_DINO_FILE_RECEIVE_DATA_DINO_FILE_META) (gpointer data1, const char* arg_1, gpointer arg_2, gpointer arg_3, gpointer arg_4, gpointer arg_5, gpointer arg_6, gpointer arg_7, gpointer data2);
	register GMarshalFunc_VOID__STRING_XMPP_JID_BOXED_BOXED_OBJECT_DINO_FILE_RECEIVE_DATA_DINO_FILE_META callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 8);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_XMPP_JID_BOXED_BOXED_OBJECT_DINO_FILE_RECEIVE_DATA_DINO_FILE_META) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), xmpp_value_get_jid (param_values + 2), g_value_get_boxed (param_values + 3), g_value_get_boxed (param_values + 4), g_value_get_object (param_values + 5), dino_value_get_file_receive_data (param_values + 6), dino_value_get_file_meta (param_values + 7), data2);
}

static void
dino_file_provider_default_init (DinoFileProviderIface * iface,
                                 gpointer iface_data)
{
	dino_file_provider_signals[DINO_FILE_PROVIDER_FILE_INCOMING_SIGNAL] = g_signal_new ("file-incoming", DINO_TYPE_FILE_PROVIDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_XMPP_JID_BOXED_BOXED_OBJECT_DINO_FILE_RECEIVE_DATA_DINO_FILE_META, G_TYPE_NONE, 7, G_TYPE_STRING, XMPP_TYPE_JID, G_TYPE_DATE_TIME, G_TYPE_DATE_TIME, DINO_ENTITIES_TYPE_CONVERSATION, DINO_TYPE_FILE_RECEIVE_DATA, DINO_TYPE_FILE_META);
}

static GType
dino_file_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoFileProviderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_file_provider_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType dino_file_provider_type_id;
	dino_file_provider_type_id = g_type_register_static (G_TYPE_INTERFACE, "DinoFileProvider", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (dino_file_provider_type_id, G_TYPE_OBJECT);
	return dino_file_provider_type_id;
}

GType
dino_file_provider_get_type (void)
{
	static volatile gsize dino_file_provider_type_id__once = 0;
	if (g_once_init_enter (&dino_file_provider_type_id__once)) {
		GType dino_file_provider_type_id;
		dino_file_provider_type_id = dino_file_provider_get_type_once ();
		g_once_init_leave (&dino_file_provider_type_id__once, dino_file_provider_type_id);
	}
	return dino_file_provider_type_id__once;
}

void
dino_file_sender_is_upload_available (DinoFileSender* self,
                                      DinoEntitiesConversation* conversation,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->is_upload_available) {
		_iface_->is_upload_available (self, conversation, _callback_, _user_data_);
	}
}

gboolean
dino_file_sender_is_upload_available_finish (DinoFileSender* self,
                                             GAsyncResult* _res_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->is_upload_available_finish) {
		return _iface_->is_upload_available_finish (self, _res_);
	}
	return FALSE;
}

void
dino_file_sender_get_file_size_limit (DinoFileSender* self,
                                      DinoEntitiesConversation* conversation,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->get_file_size_limit) {
		_iface_->get_file_size_limit (self, conversation, _callback_, _user_data_);
	}
}

glong
dino_file_sender_get_file_size_limit_finish (DinoFileSender* self,
                                             GAsyncResult* _res_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->get_file_size_limit_finish) {
		return _iface_->get_file_size_limit_finish (self, _res_);
	}
	return -1L;
}

void
dino_file_sender_can_send (DinoFileSender* self,
                           DinoEntitiesConversation* conversation,
                           DinoEntitiesFileTransfer* file_transfer,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->can_send) {
		_iface_->can_send (self, conversation, file_transfer, _callback_, _user_data_);
	}
}

gboolean
dino_file_sender_can_send_finish (DinoFileSender* self,
                                  GAsyncResult* _res_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->can_send_finish) {
		return _iface_->can_send_finish (self, _res_);
	}
	return FALSE;
}

void
dino_file_sender_prepare_send_file (DinoFileSender* self,
                                    DinoEntitiesConversation* conversation,
                                    DinoEntitiesFileTransfer* file_transfer,
                                    DinoFileMeta* file_meta,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->prepare_send_file) {
		_iface_->prepare_send_file (self, conversation, file_transfer, file_meta, _callback_, _user_data_);
	}
}

DinoFileSendData*
dino_file_sender_prepare_send_file_finish (DinoFileSender* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->prepare_send_file_finish) {
		return _iface_->prepare_send_file_finish (self, _res_, error);
	}
	return NULL;
}

void
dino_file_sender_send_file (DinoFileSender* self,
                            DinoEntitiesConversation* conversation,
                            DinoEntitiesFileTransfer* file_transfer,
                            DinoFileSendData* file_send_data,
                            DinoFileMeta* file_meta,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->send_file) {
		_iface_->send_file (self, conversation, file_transfer, file_send_data, file_meta, _callback_, _user_data_);
	}
}

void
dino_file_sender_send_file_finish (DinoFileSender* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->send_file_finish) {
		_iface_->send_file_finish (self, _res_, error);
	}
}

void
dino_file_sender_can_encrypt (DinoFileSender* self,
                              DinoEntitiesConversation* conversation,
                              DinoEntitiesFileTransfer* file_transfer,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->can_encrypt) {
		_iface_->can_encrypt (self, conversation, file_transfer, _callback_, _user_data_);
	}
}

gboolean
dino_file_sender_can_encrypt_finish (DinoFileSender* self,
                                     GAsyncResult* _res_)
{
	DinoFileSenderIface* _iface_;
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->can_encrypt_finish) {
		return _iface_->can_encrypt_finish (self, _res_);
	}
	return FALSE;
}

gint
dino_file_sender_get_id (DinoFileSender* self)
{
	DinoFileSenderIface* _iface_;
	g_return_val_if_fail (self != NULL, -1);
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->get_id) {
		return _iface_->get_id (self);
	}
	return -1;
}

gfloat
dino_file_sender_get_priority (DinoFileSender* self)
{
	DinoFileSenderIface* _iface_;
	g_return_val_if_fail (self != NULL, -1.0F);
	_iface_ = DINO_FILE_SENDER_GET_INTERFACE (self);
	if (_iface_->get_priority) {
		return _iface_->get_priority (self);
	}
	return -1.0F;
}

static void
dino_file_sender_default_init (DinoFileSenderIface * iface,
                               gpointer iface_data)
{
	dino_file_sender_signals[DINO_FILE_SENDER_UPLOAD_AVAILABLE_SIGNAL] = g_signal_new ("upload-available", DINO_TYPE_FILE_SENDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_ENTITIES_TYPE_ACCOUNT);
}

static GType
dino_file_sender_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoFileSenderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_file_sender_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType dino_file_sender_type_id;
	dino_file_sender_type_id = g_type_register_static (G_TYPE_INTERFACE, "DinoFileSender", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (dino_file_sender_type_id, G_TYPE_OBJECT);
	return dino_file_sender_type_id;
}

GType
dino_file_sender_get_type (void)
{
	static volatile gsize dino_file_sender_type_id__once = 0;
	if (g_once_init_enter (&dino_file_sender_type_id__once)) {
		GType dino_file_sender_type_id;
		dino_file_sender_type_id = dino_file_sender_get_type_once ();
		g_once_init_leave (&dino_file_sender_type_id__once, dino_file_sender_type_id);
	}
	return dino_file_sender_type_id__once;
}

gboolean
dino_file_encryptor_can_encrypt_file (DinoFileEncryptor* self,
                                      DinoEntitiesConversation* conversation,
                                      DinoEntitiesFileTransfer* file_transfer)
{
	DinoFileEncryptorIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = DINO_FILE_ENCRYPTOR_GET_INTERFACE (self);
	if (_iface_->can_encrypt_file) {
		return _iface_->can_encrypt_file (self, conversation, file_transfer);
	}
	return FALSE;
}

DinoFileMeta*
dino_file_encryptor_encrypt_file (DinoFileEncryptor* self,
                                  DinoEntitiesConversation* conversation,
                                  DinoEntitiesFileTransfer* file_transfer,
                                  GError** error)
{
	DinoFileEncryptorIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = DINO_FILE_ENCRYPTOR_GET_INTERFACE (self);
	if (_iface_->encrypt_file) {
		return _iface_->encrypt_file (self, conversation, file_transfer, error);
	}
	return NULL;
}

DinoFileSendData*
dino_file_encryptor_preprocess_send_file (DinoFileEncryptor* self,
                                          DinoEntitiesConversation* conversation,
                                          DinoEntitiesFileTransfer* file_transfer,
                                          DinoFileSendData* file_send_data,
                                          DinoFileMeta* file_meta,
                                          GError** error)
{
	DinoFileEncryptorIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = DINO_FILE_ENCRYPTOR_GET_INTERFACE (self);
	if (_iface_->preprocess_send_file) {
		return _iface_->preprocess_send_file (self, conversation, file_transfer, file_send_data, file_meta, error);
	}
	return NULL;
}

static void
dino_file_encryptor_default_init (DinoFileEncryptorIface * iface,
                                  gpointer iface_data)
{
}

static GType
dino_file_encryptor_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoFileEncryptorIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_file_encryptor_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType dino_file_encryptor_type_id;
	dino_file_encryptor_type_id = g_type_register_static (G_TYPE_INTERFACE, "DinoFileEncryptor", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (dino_file_encryptor_type_id, G_TYPE_OBJECT);
	return dino_file_encryptor_type_id;
}

GType
dino_file_encryptor_get_type (void)
{
	static volatile gsize dino_file_encryptor_type_id__once = 0;
	if (g_once_init_enter (&dino_file_encryptor_type_id__once)) {
		GType dino_file_encryptor_type_id;
		dino_file_encryptor_type_id = dino_file_encryptor_get_type_once ();
		g_once_init_leave (&dino_file_encryptor_type_id__once, dino_file_encryptor_type_id);
	}
	return dino_file_encryptor_type_id__once;
}

DinoEntitiesEncryption
dino_file_decryptor_get_encryption (DinoFileDecryptor* self)
{
	DinoFileDecryptorIface* _iface_;
	g_return_val_if_fail (self != NULL, 0);
	_iface_ = DINO_FILE_DECRYPTOR_GET_INTERFACE (self);
	if (_iface_->get_encryption) {
		return _iface_->get_encryption (self);
	}
	return 0;
}

DinoFileReceiveData*
dino_file_decryptor_prepare_get_meta_info (DinoFileDecryptor* self,
                                           DinoEntitiesConversation* conversation,
                                           DinoEntitiesFileTransfer* file_transfer,
                                           DinoFileReceiveData* receive_data)
{
	DinoFileDecryptorIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = DINO_FILE_DECRYPTOR_GET_INTERFACE (self);
	if (_iface_->prepare_get_meta_info) {
		return _iface_->prepare_get_meta_info (self, conversation, file_transfer, receive_data);
	}
	return NULL;
}

DinoFileMeta*
dino_file_decryptor_prepare_download_file (DinoFileDecryptor* self,
                                           DinoEntitiesConversation* conversation,
                                           DinoEntitiesFileTransfer* file_transfer,
                                           DinoFileReceiveData* receive_data,
                                           DinoFileMeta* file_meta)
{
	DinoFileDecryptorIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = DINO_FILE_DECRYPTOR_GET_INTERFACE (self);
	if (_iface_->prepare_download_file) {
		return _iface_->prepare_download_file (self, conversation, file_transfer, receive_data, file_meta);
	}
	return NULL;
}

gboolean
dino_file_decryptor_can_decrypt_file (DinoFileDecryptor* self,
                                      DinoEntitiesConversation* conversation,
                                      DinoEntitiesFileTransfer* file_transfer,
                                      DinoFileReceiveData* receive_data)
{
	DinoFileDecryptorIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = DINO_FILE_DECRYPTOR_GET_INTERFACE (self);
	if (_iface_->can_decrypt_file) {
		return _iface_->can_decrypt_file (self, conversation, file_transfer, receive_data);
	}
	return FALSE;
}

void
dino_file_decryptor_decrypt_file (DinoFileDecryptor* self,
                                  GInputStream* encrypted_stream,
                                  DinoEntitiesConversation* conversation,
                                  DinoEntitiesFileTransfer* file_transfer,
                                  DinoFileReceiveData* receive_data,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	DinoFileDecryptorIface* _iface_;
	_iface_ = DINO_FILE_DECRYPTOR_GET_INTERFACE (self);
	if (_iface_->decrypt_file) {
		_iface_->decrypt_file (self, encrypted_stream, conversation, file_transfer, receive_data, _callback_, _user_data_);
	}
}

GInputStream*
dino_file_decryptor_decrypt_file_finish (DinoFileDecryptor* self,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	DinoFileDecryptorIface* _iface_;
	_iface_ = DINO_FILE_DECRYPTOR_GET_INTERFACE (self);
	if (_iface_->decrypt_file_finish) {
		return _iface_->decrypt_file_finish (self, _res_, error);
	}
	return NULL;
}

static void
dino_file_decryptor_default_init (DinoFileDecryptorIface * iface,
                                  gpointer iface_data)
{
}

static GType
dino_file_decryptor_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoFileDecryptorIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_file_decryptor_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType dino_file_decryptor_type_id;
	dino_file_decryptor_type_id = g_type_register_static (G_TYPE_INTERFACE, "DinoFileDecryptor", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (dino_file_decryptor_type_id, G_TYPE_OBJECT);
	return dino_file_decryptor_type_id;
}

GType
dino_file_decryptor_get_type (void)
{
	static volatile gsize dino_file_decryptor_type_id__once = 0;
	if (g_once_init_enter (&dino_file_decryptor_type_id__once)) {
		GType dino_file_decryptor_type_id;
		dino_file_decryptor_type_id = dino_file_decryptor_get_type_once ();
		g_once_init_leave (&dino_file_decryptor_type_id__once, dino_file_decryptor_type_id);
	}
	return dino_file_decryptor_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

