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

#include "http-files.h"
#include "libdino.h"
#include <libsoup/soup.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include "xmpp-vala.h"
#include <gio/gio.h>
#include <gee.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_PLUGINS_HTTP_FILES_FILE_PROVIDER_0_PROPERTY,
	DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_http_files_file_provider_properties[DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_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_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER (dino_plugins_http_files_file_provider_received_message_listener_get_type ())
#define DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoPluginsHttpFilesFileProviderReceivedMessageListener))
#define DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoPluginsHttpFilesFileProviderReceivedMessageListenerClass))
#define DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_IS_RECEIVED_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER))
#define DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_IS_RECEIVED_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER))
#define DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoPluginsHttpFilesFileProviderReceivedMessageListenerClass))

typedef struct _DinoPluginsHttpFilesFileProviderReceivedMessageListener DinoPluginsHttpFilesFileProviderReceivedMessageListener;
typedef struct _DinoPluginsHttpFilesFileProviderReceivedMessageListenerClass DinoPluginsHttpFilesFileProviderReceivedMessageListenerClass;
#define _dino_file_meta_unref0(var) ((var == NULL) ? NULL : (var = (dino_file_meta_unref (var), NULL)))
#define _dino_file_receive_data_unref0(var) ((var == NULL) ? NULL : (var = (dino_file_receive_data_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_uri_unref0(var) ((var == NULL) ? NULL : (var = (g_uri_unref (var), NULL)))
typedef struct _DinoPluginsHttpFilesFileProviderGetMetaInfoData DinoPluginsHttpFilesFileProviderGetMetaInfoData;
typedef struct _Block2Data Block2Data;
typedef struct _DinoPluginsHttpFilesFileProviderDownloadData DinoPluginsHttpFilesFileProviderDownloadData;
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
typedef struct _DinoPluginsHttpFilesFileProviderReceivedMessageListenerPrivate DinoPluginsHttpFilesFileProviderReceivedMessageListenerPrivate;
enum  {
	DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_0_PROPERTY,
	DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY,
	DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY,
	DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_http_files_file_provider_received_message_listener_properties[DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_NUM_PROPERTIES];
typedef struct _DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _DinoPluginsHttpFilesFileProviderPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoDatabase* dino_db;
	SoupSession* session;
};

struct _Block1Data {
	int _ref_count_;
	DinoPluginsHttpFilesFileProvider* self;
	gchar* transfer_host;
	gchar* content_type;
	gchar* content_length;
	gpointer _async_data_;
};

struct _DinoPluginsHttpFilesFileProviderGetMetaInfoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoPluginsHttpFilesFileProvider* self;
	DinoEntitiesFileTransfer* file_transfer;
	DinoFileReceiveData* receive_data;
	DinoFileMeta* file_meta;
	DinoFileMeta* result;
	Block1Data* _data1_;
	DinoHttpFileReceiveData* http_receive_data;
	DinoHttpFileReceiveData* _tmp0_;
	DinoHttpFileReceiveData* _tmp1_;
	DinoFileMeta* _tmp2_;
	SoupMessage* head_message;
	DinoHttpFileReceiveData* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	SoupMessage* _tmp6_;
	SoupMessage* _tmp7_;
	SoupMessageHeaders* _tmp8_;
	SoupMessageHeaders* _tmp9_;
	GUri* _tmp10_;
	DinoHttpFileReceiveData* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GUri* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	SoupMessage* _tmp17_;
	SoupSession* _tmp18_;
	SoupMessage* _tmp19_;
	GInputStream* _tmp20_;
	GInputStream* _tmp21_;
	GError* _tmp22_;
	SoupMessage* _tmp23_;
	SoupMessageHeaders* _tmp24_;
	SoupMessageHeaders* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	DinoFileMeta* _tmp30_;
	GError* _inner_error0_;
};

struct _Block2Data {
	int _ref_count_;
	DinoPluginsHttpFilesFileProvider* self;
	gchar* transfer_host;
	gpointer _async_data_;
};

struct _DinoPluginsHttpFilesFileProviderDownloadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoPluginsHttpFilesFileProvider* self;
	DinoEntitiesFileTransfer* file_transfer;
	DinoFileReceiveData* receive_data;
	DinoFileMeta* file_meta;
	GInputStream* result;
	Block2Data* _data2_;
	DinoHttpFileReceiveData* http_receive_data;
	DinoHttpFileReceiveData* _tmp0_;
	DinoHttpFileReceiveData* _tmp1_;
	SoupMessage* get_message;
	DinoHttpFileReceiveData* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	SoupMessage* _tmp5_;
	GUri* _tmp6_;
	DinoHttpFileReceiveData* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	GUri* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	SoupMessage* _tmp13_;
	GInputStream* stream;
	SoupSession* _tmp14_;
	SoupMessage* _tmp15_;
	GCancellable* _tmp16_;
	GCancellable* _tmp17_;
	GInputStream* _tmp18_;
	GInputStream* _tmp19_;
	DinoLimitInputStream* _tmp20_;
	GError* _inner_error0_;
};

struct _DinoPluginsHttpFilesFileProviderReceivedMessageListener {
	DinoMessageListener parent_instance;
	DinoPluginsHttpFilesFileProviderReceivedMessageListenerPrivate * priv;
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _DinoPluginsHttpFilesFileProviderReceivedMessageListenerClass {
	DinoMessageListenerClass parent_class;
};

struct _DinoPluginsHttpFilesFileProviderReceivedMessageListenerPrivate {
	DinoPluginsHttpFilesFileProvider* outer;
	DinoStreamInteractor* stream_interactor;
};

struct _DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoPluginsHttpFilesFileProviderReceivedMessageListener* self;
	DinoEntitiesMessage* message;
	XmppMessageStanza* stanza;
	DinoEntitiesConversation* conversation;
	gboolean result;
	gboolean _tmp0_;
	GeeList* _tmp1_;
	GeeList* _tmp2_;
	gboolean _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	gchar* oob_url;
	gchar* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	GRegex* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gboolean normal_file;
	gboolean omemo_file;
	GRegex* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gboolean _tmp19_;
	DinoPluginsHttpFilesFileProvider* _tmp20_;
};

static gint DinoPluginsHttpFilesFileProvider_private_offset;
static gpointer dino_plugins_http_files_file_provider_parent_class = NULL;
static GRegex* dino_plugins_http_files_file_provider_http_url_regex;
static GRegex* dino_plugins_http_files_file_provider_http_url_regex = NULL;
static GRegex* dino_plugins_http_files_file_provider_omemo_url_regex;
static GRegex* dino_plugins_http_files_file_provider_omemo_url_regex = NULL;
static gint DinoPluginsHttpFilesFileProviderReceivedMessageListener_private_offset;
static gpointer dino_plugins_http_files_file_provider_received_message_listener_parent_class = NULL;
static DinoFileProviderIface * dino_plugins_http_files_file_provider_dino_file_provider_parent_iface = NULL;

static DinoPluginsHttpFilesFileProviderReceivedMessageListener* dino_plugins_http_files_file_provider_received_message_listener_new (DinoPluginsHttpFilesFileProvider* outer);
static DinoPluginsHttpFilesFileProviderReceivedMessageListener* dino_plugins_http_files_file_provider_received_message_listener_construct (GType object_type,
                                                                                                                                    DinoPluginsHttpFilesFileProvider* outer);
static GType dino_plugins_http_files_file_provider_received_message_listener_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void dino_plugins_http_files_file_provider_on_file_message (DinoPluginsHttpFilesFileProvider* self,
                                                            DinoEntitiesMessage* message,
                                                            DinoEntitiesConversation* conversation);
static gchar* dino_plugins_http_files_file_provider_extract_file_name_from_url (DinoPluginsHttpFilesFileProvider* self,
                                                                         const gchar* url);
static void dino_plugins_http_files_file_provider_real_get_meta_info_data_free (gpointer _data);
static void dino_plugins_http_files_file_provider_real_get_meta_info (DinoFileProvider* base,
                                                               DinoEntitiesFileTransfer* file_transfer,
                                                               DinoFileReceiveData* receive_data,
                                                               DinoFileMeta* file_meta,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_);
static gboolean dino_plugins_http_files_file_provider_real_get_meta_info_co (DinoPluginsHttpFilesFileProviderGetMetaInfoData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static gboolean __lambda4_ (Block1Data* _data1_,
                     GTlsCertificate* peer_cert,
                     GTlsCertificateFlags errors);
static gboolean ___lambda4__soup_message_accept_certificate (SoupMessage* _sender,
                                                      GTlsCertificate* tls_peer_certificate,
                                                      GTlsCertificateFlags tls_peer_errors,
                                                      gpointer self);
static void dino_plugins_http_files_file_provider_get_meta_info_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_);
static void __lambda5_ (Block1Data* _data1_,
                 const gchar* name,
                 const gchar* val);
static void ___lambda5__soup_message_headers_foreach_func (const gchar* name,
                                                    const gchar* value,
                                                    gpointer self);
static DinoEntitiesEncryption dino_plugins_http_files_file_provider_real_get_encryption (DinoFileProvider* base,
                                                                                  DinoEntitiesFileTransfer* file_transfer,
                                                                                  DinoFileReceiveData* receive_data,
                                                                                  DinoFileMeta* file_meta);
static void dino_plugins_http_files_file_provider_real_download_data_free (gpointer _data);
static void dino_plugins_http_files_file_provider_real_download (DinoFileProvider* base,
                                                          DinoEntitiesFileTransfer* file_transfer,
                                                          DinoFileReceiveData* receive_data,
                                                          DinoFileMeta* file_meta,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static gboolean dino_plugins_http_files_file_provider_real_download_co (DinoPluginsHttpFilesFileProviderDownloadData* _data_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static gboolean __lambda6_ (Block2Data* _data2_,
                     GTlsCertificate* peer_cert,
                     GTlsCertificateFlags errors);
static gboolean ___lambda6__soup_message_accept_certificate (SoupMessage* _sender,
                                                      GTlsCertificate* tls_peer_certificate,
                                                      GTlsCertificateFlags tls_peer_errors,
                                                      gpointer self);
static void dino_plugins_http_files_file_provider_download_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static DinoFileMeta* dino_plugins_http_files_file_provider_real_get_file_meta (DinoFileProvider* base,
                                                                        DinoEntitiesFileTransfer* file_transfer,
                                                                        GError** error);
static DinoFileReceiveData* dino_plugins_http_files_file_provider_real_get_file_receive_data (DinoFileProvider* base,
                                                                                       DinoEntitiesFileTransfer* file_transfer);
static gint dino_plugins_http_files_file_provider_real_get_id (DinoFileProvider* base);
static void dino_plugins_http_files_file_provider_received_message_listener_real_run_data_free (gpointer _data);
static void dino_plugins_http_files_file_provider_received_message_listener_real_run (DinoMessageListener* base,
                                                                               DinoEntitiesMessage* message,
                                                                               XmppMessageStanza* stanza,
                                                                               DinoEntitiesConversation* conversation,
                                                                               GAsyncReadyCallback _callback_,
                                                                               gpointer _user_data_);
static gboolean dino_plugins_http_files_file_provider_received_message_listener_real_run_co (DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData* _data_);
static void dino_plugins_http_files_file_provider_received_message_listener_finalize (GObject * obj);
static GType dino_plugins_http_files_file_provider_received_message_listener_get_type_once (void);
static void _vala_dino_plugins_http_files_file_provider_received_message_listener_get_property (GObject * object,
                                                                                         guint property_id,
                                                                                         GValue * value,
                                                                                         GParamSpec * pspec);
static void dino_plugins_http_files_file_provider_finalize (GObject * obj);
static GType dino_plugins_http_files_file_provider_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static GRegex* _tmp_regex_0 = NULL;
static GRegex* _tmp_regex_1 = NULL;

static inline gpointer
dino_plugins_http_files_file_provider_get_instance_private (DinoPluginsHttpFilesFileProvider* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsHttpFilesFileProvider_private_offset);
}

static inline GRegex*
_thread_safe_regex_init (GRegex** re,
                         const gchar * pattern,
                         GRegexCompileFlags compile_flags)
{
	if (g_once_init_enter ((volatile gsize*) re)) {
		GRegex* val = g_regex_new (pattern, compile_flags, 0, NULL);
		g_once_init_leave ((volatile gsize*) re, (gsize) val);
	}
	return *re;
}

static gpointer
_g_regex_ref0 (gpointer self)
{
	return self ? g_regex_ref (self) : NULL;
}

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 const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

DinoPluginsHttpFilesFileProvider*
dino_plugins_http_files_file_provider_construct (GType object_type,
                                                 DinoStreamInteractor* stream_interactor,
                                                 DinoDatabase* dino_db)
{
	DinoPluginsHttpFilesFileProvider * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoDatabase* _tmp1_;
	SoupSession* _tmp2_;
	SoupSession* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	DinoModuleIdentity* _tmp9_;
	gpointer _tmp10_;
	DinoMessageProcessor* _tmp11_;
	DinoMessageListenerHolder* _tmp12_;
	DinoPluginsHttpFilesFileProviderReceivedMessageListener* _tmp13_;
	DinoPluginsHttpFilesFileProviderReceivedMessageListener* _tmp14_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (dino_db != NULL, NULL);
	self = (DinoPluginsHttpFilesFileProvider*) 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 (dino_db);
	_qlite_database_unref0 (self->priv->dino_db);
	self->priv->dino_db = _tmp1_;
	_tmp2_ = soup_session_new ();
	_g_object_unref0 (self->priv->session);
	self->priv->session = _tmp2_;
	_tmp3_ = self->priv->session;
	_tmp4_ = dino_get_short_version ();
	_tmp5_ = _tmp4_;
	_tmp6_ = string_to_string (_tmp5_);
	_tmp7_ = g_strconcat ("Dino/", _tmp6_, " ", NULL);
	_tmp8_ = _tmp7_;
	soup_session_set_user_agent (_tmp3_, _tmp8_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp5_);
	_tmp9_ = dino_message_processor_IDENTITY;
	_tmp10_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MESSAGE_PROCESSOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp9_);
	_tmp11_ = (DinoMessageProcessor*) _tmp10_;
	_tmp12_ = _tmp11_->received_pipeline;
	_tmp13_ = dino_plugins_http_files_file_provider_received_message_listener_new (self);
	_tmp14_ = _tmp13_;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp12_, (XmppOrderedListener*) _tmp14_);
	_g_object_unref0 (_tmp14_);
	_g_object_unref0 (_tmp11_);
	return self;
}

DinoPluginsHttpFilesFileProvider*
dino_plugins_http_files_file_provider_new (DinoStreamInteractor* stream_interactor,
                                           DinoDatabase* dino_db)
{
	return dino_plugins_http_files_file_provider_construct (DINO_PLUGINS_HTTP_FILES_TYPE_FILE_PROVIDER, stream_interactor, dino_db);
}

static void
dino_plugins_http_files_file_provider_on_file_message (DinoPluginsHttpFilesFileProvider* self,
                                                       DinoEntitiesMessage* message,
                                                       DinoEntitiesConversation* conversation)
{
	gchar* additional_info = NULL;
	gint _tmp0_;
	gint _tmp1_;
	gchar* _tmp2_;
	DinoHttpFileReceiveData* receive_data = NULL;
	DinoHttpFileReceiveData* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	DinoHttpFileMeta* file_meta = NULL;
	DinoHttpFileMeta* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	DinoEntitiesMessage* _tmp10_;
	XmppJid* _tmp11_;
	XmppJid* _tmp12_;
	GDateTime* _tmp13_;
	GDateTime* _tmp14_;
	GDateTime* _tmp15_;
	GDateTime* _tmp16_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	g_return_if_fail (conversation != NULL);
	_tmp0_ = dino_entities_message_get_id (message);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf ("%i", _tmp1_);
	additional_info = _tmp2_;
	_tmp3_ = dino_http_file_receive_data_new ();
	receive_data = _tmp3_;
	_tmp4_ = dino_entities_message_get_body (message);
	_tmp5_ = _tmp4_;
	dino_http_file_receive_data_set_url (receive_data, _tmp5_);
	_tmp6_ = dino_http_file_meta_new ();
	file_meta = _tmp6_;
	_tmp7_ = dino_entities_message_get_body (message);
	_tmp8_ = _tmp7_;
	_tmp9_ = dino_plugins_http_files_file_provider_extract_file_name_from_url (self, _tmp8_);
	_g_free0 (((DinoFileMeta*) file_meta)->file_name);
	((DinoFileMeta*) file_meta)->file_name = _tmp9_;
	_tmp10_ = _g_object_ref0 (message);
	_g_object_unref0 (file_meta->message);
	file_meta->message = _tmp10_;
	_tmp11_ = dino_entities_message_get_from (message);
	_tmp12_ = _tmp11_;
	_tmp13_ = dino_entities_message_get_time (message);
	_tmp14_ = _tmp13_;
	_tmp15_ = dino_entities_message_get_local_time (message);
	_tmp16_ = _tmp15_;
	g_signal_emit_by_name ((DinoFileProvider*) self, "file-incoming", additional_info, _tmp12_, _tmp14_, _tmp16_, conversation, (DinoFileReceiveData*) receive_data, (DinoFileMeta*) file_meta);
	_dino_file_meta_unref0 (file_meta);
	_dino_file_receive_data_unref0 (receive_data);
	_g_free0 (additional_info);
}

static void
dino_plugins_http_files_file_provider_real_get_meta_info_data_free (gpointer _data)
{
	DinoPluginsHttpFilesFileProviderGetMetaInfoData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file_transfer);
	_dino_file_receive_data_unref0 (_data_->receive_data);
	_dino_file_meta_unref0 (_data_->file_meta);
	_dino_file_meta_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoPluginsHttpFilesFileProviderGetMetaInfoData, _data_);
}

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

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

static void
dino_plugins_http_files_file_provider_real_get_meta_info (DinoFileProvider* base,
                                                          DinoEntitiesFileTransfer* file_transfer,
                                                          DinoFileReceiveData* receive_data,
                                                          DinoFileMeta* file_meta,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_)
{
	DinoPluginsHttpFilesFileProvider * self;
	DinoPluginsHttpFilesFileProviderGetMetaInfoData* _data_;
	DinoPluginsHttpFilesFileProvider* _tmp0_;
	DinoEntitiesFileTransfer* _tmp1_;
	DinoFileReceiveData* _tmp2_;
	DinoFileMeta* _tmp3_;
	g_return_if_fail (file_transfer != NULL);
	g_return_if_fail (receive_data != NULL);
	g_return_if_fail (file_meta != NULL);
	self = (DinoPluginsHttpFilesFileProvider*) base;
	_data_ = g_slice_new0 (DinoPluginsHttpFilesFileProviderGetMetaInfoData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_plugins_http_files_file_provider_real_get_meta_info_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_;
	_tmp2_ = _dino_file_receive_data_ref0 (receive_data);
	_dino_file_receive_data_unref0 (_data_->receive_data);
	_data_->receive_data = _tmp2_;
	_tmp3_ = _dino_file_meta_ref0 (file_meta);
	_dino_file_meta_unref0 (_data_->file_meta);
	_data_->file_meta = _tmp3_;
	dino_plugins_http_files_file_provider_real_get_meta_info_co (_data_);
}

static DinoFileMeta*
dino_plugins_http_files_file_provider_get_meta_info_finish (DinoFileProvider* base,
                                                            GAsyncResult* _res_,
                                                            GError** error)
{
	DinoFileMeta* result;
	DinoPluginsHttpFilesFileProviderGetMetaInfoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		DinoPluginsHttpFilesFileProvider* self;
		self = _data1_->self;
		_g_free0 (_data1_->content_length);
		_g_free0 (_data1_->content_type);
		_g_free0 (_data1_->transfer_host);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static gboolean
__lambda4_ (Block1Data* _data1_,
            GTlsCertificate* peer_cert,
            GTlsCertificateFlags errors)
{
	DinoPluginsHttpFilesFileProvider* self;
	const gchar* _tmp0_;
	gboolean result;
	self = _data1_->self;
	g_return_val_if_fail (peer_cert != NULL, FALSE);
	_tmp0_ = _data1_->transfer_host;
	result = dino_connection_manager_on_invalid_certificate (_tmp0_, peer_cert, errors);
	return result;
}

static gboolean
___lambda4__soup_message_accept_certificate (SoupMessage* _sender,
                                             GTlsCertificate* tls_peer_certificate,
                                             GTlsCertificateFlags tls_peer_errors,
                                             gpointer self)
{
	gboolean result;
	result = __lambda4_ (self, tls_peer_certificate, tls_peer_errors);
	return result;
}

static void
dino_plugins_http_files_file_provider_get_meta_info_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_)
{
	DinoPluginsHttpFilesFileProviderGetMetaInfoData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_plugins_http_files_file_provider_real_get_meta_info_co (_data_);
}

static void
__lambda5_ (Block1Data* _data1_,
            const gchar* name,
            const gchar* val)
{
	DinoPluginsHttpFilesFileProvider* self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	self = _data1_->self;
	g_return_if_fail (name != NULL);
	g_return_if_fail (val != NULL);
	_tmp0_ = g_utf8_strdown (name, (gssize) -1);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strcmp0 (_tmp1_, "content-type") == 0;
	_g_free0 (_tmp1_);
	if (_tmp2_) {
		gchar* _tmp3_;
		_tmp3_ = g_strdup (val);
		_g_free0 (_data1_->content_type);
		_data1_->content_type = _tmp3_;
	}
	_tmp4_ = g_utf8_strdown (name, (gssize) -1);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strcmp0 (_tmp5_, "content-length") == 0;
	_g_free0 (_tmp5_);
	if (_tmp6_) {
		gchar* _tmp7_;
		_tmp7_ = g_strdup (val);
		_g_free0 (_data1_->content_length);
		_data1_->content_length = _tmp7_;
	}
}

static void
___lambda5__soup_message_headers_foreach_func (const gchar* name,
                                               const gchar* value,
                                               gpointer self)
{
	__lambda5_ (self, name, value);
}

static gint64
int64_parse (const gchar* str,
             guint _base)
{
	gint64 result;
	g_return_val_if_fail (str != NULL, -1LL);
	result = g_ascii_strtoll (str, NULL, _base);
	return result;
}

static gboolean
dino_plugins_http_files_file_provider_real_get_meta_info_co (DinoPluginsHttpFilesFileProviderGetMetaInfoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->self = g_object_ref (_data_->self);
	_data_->_data1_->_async_data_ = _data_;
	_data_->_tmp0_ = _dino_file_receive_data_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->receive_data, DINO_TYPE_HTTP_FILE_RECEIVE_DATA) ? ((DinoHttpFileReceiveData*) _data_->receive_data) : NULL);
	_data_->http_receive_data = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->http_receive_data;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp2_ = _dino_file_meta_ref0 (_data_->file_meta);
		_data_->result = _data_->_tmp2_;
		_dino_file_receive_data_unref0 (_data_->http_receive_data);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		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_->_tmp3_ = _data_->http_receive_data;
	_data_->_tmp4_ = dino_http_file_receive_data_get_url (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = soup_message_new ("HEAD", _data_->_tmp5_);
	_data_->head_message = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->head_message;
	_data_->_tmp8_ = soup_message_get_request_headers (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	soup_message_headers_append (_data_->_tmp9_, "Accept-Encoding", "identity");
	_data_->_tmp11_ = _data_->http_receive_data;
	_data_->_tmp12_ = dino_http_file_receive_data_get_url (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = g_uri_parse (_data_->_tmp13_, G_URI_FLAGS_NONE, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp14_;
	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_);
			_g_object_unref0 (_data_->head_message);
			_dino_file_receive_data_unref0 (_data_->http_receive_data);
			block1_data_unref (_data_->_data1_);
			_data_->_data1_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->head_message);
			_dino_file_receive_data_unref0 (_data_->http_receive_data);
			block1_data_unref (_data_->_data1_);
			_data_->_data1_ = 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;
		}
	}
	_data_->_tmp15_ = g_uri_get_host (_data_->_tmp10_);
	_data_->_tmp16_ = g_strdup (_data_->_tmp15_);
	_data_->_data1_->transfer_host = _data_->_tmp16_;
	_data_->_tmp17_ = _data_->head_message;
	g_signal_connect_data (_data_->_tmp17_, "accept-certificate", (GCallback) ___lambda4__soup_message_accept_certificate, block1_data_ref (_data_->_data1_), (GClosureNotify) block1_data_unref, 0);
	{
		_data_->_tmp18_ = _data_->self->priv->session;
		_data_->_tmp19_ = _data_->head_message;
		_data_->_state_ = 1;
		soup_session_send_async (_data_->_tmp18_, _data_->_tmp19_, G_PRIORITY_LOW, NULL, dino_plugins_http_files_file_provider_get_meta_info_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp20_ = soup_session_send_finish (_data_->_tmp18_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp21_ = _data_->_tmp20_;
		_g_object_unref0 (_data_->_tmp21_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->_tmp22_ = g_error_new_literal (DINO_FILE_RECEIVE_ERROR, DINO_FILE_RECEIVE_ERROR_GET_METADATA_FAILED, "HEAD request failed");
		_data_->_inner_error0_ = _data_->_tmp22_;
		goto __finally0;
	}
	__finally0:
	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_);
			_g_uri_unref0 (_data_->_tmp10_);
			_g_object_unref0 (_data_->head_message);
			_dino_file_receive_data_unref0 (_data_->http_receive_data);
			block1_data_unref (_data_->_data1_);
			_data_->_data1_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_uri_unref0 (_data_->_tmp10_);
			_g_object_unref0 (_data_->head_message);
			_dino_file_receive_data_unref0 (_data_->http_receive_data);
			block1_data_unref (_data_->_data1_);
			_data_->_data1_ = 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;
		}
	}
	_data_->_data1_->content_type = NULL;
	_data_->_data1_->content_length = NULL;
	_data_->_tmp23_ = _data_->head_message;
	_data_->_tmp24_ = soup_message_get_response_headers (_data_->_tmp23_);
	_data_->_tmp25_ = _data_->_tmp24_;
	soup_message_headers_foreach (_data_->_tmp25_, ___lambda5__soup_message_headers_foreach_func, _data_->_data1_);
	_data_->_tmp26_ = _data_->_data1_->content_type;
	_data_->_tmp27_ = g_strdup (_data_->_tmp26_);
	_g_free0 (_data_->file_meta->mime_type);
	_data_->file_meta->mime_type = _data_->_tmp27_;
	_data_->_tmp28_ = _data_->_data1_->content_length;
	if (_data_->_tmp28_ != NULL) {
		_data_->_tmp29_ = _data_->_data1_->content_length;
		_data_->file_meta->size = int64_parse (_data_->_tmp29_, (guint) 0);
	}
	_data_->_tmp30_ = _dino_file_meta_ref0 (_data_->file_meta);
	_data_->result = _data_->_tmp30_;
	_g_uri_unref0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->head_message);
	_dino_file_receive_data_unref0 (_data_->http_receive_data);
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = NULL;
	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 DinoEntitiesEncryption
dino_plugins_http_files_file_provider_real_get_encryption (DinoFileProvider* base,
                                                           DinoEntitiesFileTransfer* file_transfer,
                                                           DinoFileReceiveData* receive_data,
                                                           DinoFileMeta* file_meta)
{
	DinoPluginsHttpFilesFileProvider * self;
	DinoEntitiesEncryption result;
	self = (DinoPluginsHttpFilesFileProvider*) base;
	g_return_val_if_fail (file_transfer != NULL, 0);
	g_return_val_if_fail (receive_data != NULL, 0);
	g_return_val_if_fail (file_meta != NULL, 0);
	result = DINO_ENTITIES_ENCRYPTION_NONE;
	return result;
}

static void
dino_plugins_http_files_file_provider_real_download_data_free (gpointer _data)
{
	DinoPluginsHttpFilesFileProviderDownloadData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file_transfer);
	_dino_file_receive_data_unref0 (_data_->receive_data);
	_dino_file_meta_unref0 (_data_->file_meta);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoPluginsHttpFilesFileProviderDownloadData, _data_);
}

static void
dino_plugins_http_files_file_provider_real_download (DinoFileProvider* base,
                                                     DinoEntitiesFileTransfer* file_transfer,
                                                     DinoFileReceiveData* receive_data,
                                                     DinoFileMeta* file_meta,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	DinoPluginsHttpFilesFileProvider * self;
	DinoPluginsHttpFilesFileProviderDownloadData* _data_;
	DinoPluginsHttpFilesFileProvider* _tmp0_;
	DinoEntitiesFileTransfer* _tmp1_;
	DinoFileReceiveData* _tmp2_;
	DinoFileMeta* _tmp3_;
	g_return_if_fail (file_transfer != NULL);
	g_return_if_fail (receive_data != NULL);
	g_return_if_fail (file_meta != NULL);
	self = (DinoPluginsHttpFilesFileProvider*) base;
	_data_ = g_slice_new0 (DinoPluginsHttpFilesFileProviderDownloadData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_plugins_http_files_file_provider_real_download_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_;
	_tmp2_ = _dino_file_receive_data_ref0 (receive_data);
	_dino_file_receive_data_unref0 (_data_->receive_data);
	_data_->receive_data = _tmp2_;
	_tmp3_ = _dino_file_meta_ref0 (file_meta);
	_dino_file_meta_unref0 (_data_->file_meta);
	_data_->file_meta = _tmp3_;
	dino_plugins_http_files_file_provider_real_download_co (_data_);
}

static GInputStream*
dino_plugins_http_files_file_provider_download_finish (DinoFileProvider* base,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	GInputStream* result;
	DinoPluginsHttpFilesFileProviderDownloadData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		DinoPluginsHttpFilesFileProvider* self;
		self = _data2_->self;
		_g_free0 (_data2_->transfer_host);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static gboolean
__lambda6_ (Block2Data* _data2_,
            GTlsCertificate* peer_cert,
            GTlsCertificateFlags errors)
{
	DinoPluginsHttpFilesFileProvider* self;
	const gchar* _tmp0_;
	gboolean result;
	self = _data2_->self;
	g_return_val_if_fail (peer_cert != NULL, FALSE);
	_tmp0_ = _data2_->transfer_host;
	result = dino_connection_manager_on_invalid_certificate (_tmp0_, peer_cert, errors);
	return result;
}

static gboolean
___lambda6__soup_message_accept_certificate (SoupMessage* _sender,
                                             GTlsCertificate* tls_peer_certificate,
                                             GTlsCertificateFlags tls_peer_errors,
                                             gpointer self)
{
	gboolean result;
	result = __lambda6_ (self, tls_peer_certificate, tls_peer_errors);
	return result;
}

static void
dino_plugins_http_files_file_provider_download_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	DinoPluginsHttpFilesFileProviderDownloadData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_plugins_http_files_file_provider_real_download_co (_data_);
}

static gboolean
dino_plugins_http_files_file_provider_real_download_co (DinoPluginsHttpFilesFileProviderDownloadData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data2_ = g_slice_new0 (Block2Data);
	_data_->_data2_->_ref_count_ = 1;
	_data_->_data2_->self = g_object_ref (_data_->self);
	_data_->_data2_->_async_data_ = _data_;
	_data_->_tmp0_ = _dino_file_receive_data_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->receive_data, DINO_TYPE_HTTP_FILE_RECEIVE_DATA) ? ((DinoHttpFileReceiveData*) _data_->receive_data) : NULL);
	_data_->http_receive_data = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->http_receive_data;
	if (_data_->_tmp1_ == NULL) {
		_vala_assert (FALSE, "false");
	}
	_data_->_tmp2_ = _data_->http_receive_data;
	_data_->_tmp3_ = dino_http_file_receive_data_get_url (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = soup_message_new ("GET", _data_->_tmp4_);
	_data_->get_message = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->http_receive_data;
	_data_->_tmp8_ = dino_http_file_receive_data_get_url (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = g_uri_parse (_data_->_tmp9_, G_URI_FLAGS_NONE, &_data_->_inner_error0_);
	_data_->_tmp6_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->get_message);
			_dino_file_receive_data_unref0 (_data_->http_receive_data);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->get_message);
			_dino_file_receive_data_unref0 (_data_->http_receive_data);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = 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;
		}
	}
	_data_->_tmp11_ = g_uri_get_host (_data_->_tmp6_);
	_data_->_tmp12_ = g_strdup (_data_->_tmp11_);
	_data_->_data2_->transfer_host = _data_->_tmp12_;
	_data_->_tmp13_ = _data_->get_message;
	g_signal_connect_data (_data_->_tmp13_, "accept-certificate", (GCallback) ___lambda6__soup_message_accept_certificate, block2_data_ref (_data_->_data2_), (GClosureNotify) block2_data_unref, 0);
	_data_->_tmp14_ = _data_->self->priv->session;
	_data_->_tmp15_ = _data_->get_message;
	_data_->_tmp16_ = dino_entities_file_transfer_get_cancellable (_data_->file_transfer);
	_data_->_tmp17_ = _data_->_tmp16_;
	_data_->_state_ = 1;
	soup_session_send_async (_data_->_tmp14_, _data_->_tmp15_, G_PRIORITY_LOW, _data_->_tmp17_, dino_plugins_http_files_file_provider_download_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp18_ = soup_session_send_finish (_data_->_tmp14_, _data_->_res_, &_data_->_inner_error0_);
	_data_->stream = _data_->_tmp18_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_uri_unref0 (_data_->_tmp6_);
			_g_object_unref0 (_data_->get_message);
			_dino_file_receive_data_unref0 (_data_->http_receive_data);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_uri_unref0 (_data_->_tmp6_);
			_g_object_unref0 (_data_->get_message);
			_dino_file_receive_data_unref0 (_data_->http_receive_data);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = 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;
		}
	}
	if (_data_->file_meta->size != ((gint64) -1)) {
		_data_->_tmp19_ = _data_->stream;
		_data_->_tmp20_ = dino_limit_input_stream_new (_data_->_tmp19_, _data_->file_meta->size);
		_data_->result = (GInputStream*) _data_->_tmp20_;
		_g_object_unref0 (_data_->stream);
		_g_uri_unref0 (_data_->_tmp6_);
		_g_object_unref0 (_data_->get_message);
		_dino_file_receive_data_unref0 (_data_->http_receive_data);
		block2_data_unref (_data_->_data2_);
		_data_->_data2_ = NULL;
		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;
	} else {
		_data_->result = _data_->stream;
		_g_uri_unref0 (_data_->_tmp6_);
		_g_object_unref0 (_data_->get_message);
		_dino_file_receive_data_unref0 (_data_->http_receive_data);
		block2_data_unref (_data_->_data2_);
		_data_->_data2_ = NULL;
		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 DinoFileMeta*
dino_plugins_http_files_file_provider_real_get_file_meta (DinoFileProvider* base,
                                                          DinoEntitiesFileTransfer* file_transfer,
                                                          GError** error)
{
	DinoPluginsHttpFilesFileProvider * self;
	gint _tmp0_;
	gint _tmp1_;
	DinoEntitiesConversation* conversation = NULL;
	DinoStreamInteractor* _tmp15_;
	DinoModuleIdentity* _tmp16_;
	gpointer _tmp17_;
	DinoConversationManager* _tmp18_;
	XmppJid* _tmp19_;
	XmppJid* _tmp20_;
	XmppJid* _tmp21_;
	XmppJid* _tmp22_;
	XmppJid* _tmp23_;
	DinoEntitiesAccount* _tmp24_;
	DinoEntitiesAccount* _tmp25_;
	DinoEntitiesConversation* _tmp26_;
	DinoEntitiesConversation* _tmp27_;
	DinoEntitiesConversation* _tmp28_;
	DinoEntitiesMessage* message = NULL;
	DinoStreamInteractor* _tmp30_;
	DinoModuleIdentity* _tmp31_;
	gpointer _tmp32_;
	DinoMessageStorage* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	DinoEntitiesConversation* _tmp36_;
	DinoEntitiesMessage* _tmp37_;
	DinoEntitiesMessage* _tmp38_;
	DinoEntitiesMessage* _tmp39_;
	DinoHttpFileMeta* file_meta = NULL;
	DinoHttpFileMeta* _tmp41_;
	DinoHttpFileMeta* _tmp42_;
	gint64 _tmp43_;
	gint64 _tmp44_;
	DinoHttpFileMeta* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	gchar* _tmp48_;
	DinoHttpFileMeta* _tmp49_;
	DinoEntitiesMessage* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	gchar* _tmp53_;
	DinoHttpFileMeta* _tmp54_;
	DinoEntitiesMessage* _tmp55_;
	DinoEntitiesMessage* _tmp56_;
	GError* _inner_error0_ = NULL;
	DinoFileMeta* result;
	self = (DinoPluginsHttpFilesFileProvider*) base;
	g_return_val_if_fail (file_transfer != NULL, NULL);
	_tmp0_ = dino_entities_file_transfer_get_provider (file_transfer);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == DINO_FILE_MANAGER_SFS_PROVIDER_ID) {
		DinoHttpFileMeta* file_meta = NULL;
		DinoHttpFileMeta* _tmp2_;
		DinoHttpFileMeta* _tmp3_;
		gint64 _tmp4_;
		gint64 _tmp5_;
		DinoHttpFileMeta* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		DinoHttpFileMeta* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		DinoHttpFileMeta* _tmp14_;
		_tmp2_ = dino_http_file_meta_new ();
		file_meta = _tmp2_;
		_tmp3_ = file_meta;
		_tmp4_ = dino_entities_file_transfer_get_size (file_transfer);
		_tmp5_ = _tmp4_;
		((DinoFileMeta*) _tmp3_)->size = _tmp5_;
		_tmp6_ = file_meta;
		_tmp7_ = dino_entities_file_transfer_get_mime_type (file_transfer);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strdup (_tmp8_);
		_g_free0 (((DinoFileMeta*) _tmp6_)->mime_type);
		((DinoFileMeta*) _tmp6_)->mime_type = _tmp9_;
		_tmp10_ = file_meta;
		_tmp11_ = dino_entities_file_transfer_get_file_name (file_transfer);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_strdup (_tmp12_);
		_g_free0 (((DinoFileMeta*) _tmp10_)->file_name);
		((DinoFileMeta*) _tmp10_)->file_name = _tmp13_;
		_tmp14_ = file_meta;
		_g_object_unref0 (_tmp14_->message);
		_tmp14_->message = NULL;
		result = (DinoFileMeta*) file_meta;
		return result;
	}
	_tmp15_ = self->priv->stream_interactor;
	_tmp16_ = dino_conversation_manager_IDENTITY;
	_tmp17_ = dino_stream_interactor_get_module (_tmp15_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp16_);
	_tmp18_ = (DinoConversationManager*) _tmp17_;
	_tmp19_ = dino_entities_file_transfer_get_counterpart (file_transfer);
	_tmp20_ = _tmp19_;
	_tmp21_ = xmpp_jid_get_bare_jid (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_;
	_tmp24_ = dino_entities_file_transfer_get_account (file_transfer);
	_tmp25_ = _tmp24_;
	_tmp26_ = dino_conversation_manager_get_conversation (_tmp18_, _tmp23_, _tmp25_, NULL);
	_tmp27_ = _tmp26_;
	_xmpp_jid_unref0 (_tmp23_);
	_g_object_unref0 (_tmp18_);
	conversation = _tmp27_;
	_tmp28_ = conversation;
	if (_tmp28_ == NULL) {
		GError* _tmp29_;
		_tmp29_ = g_error_new_literal (DINO_FILE_RECEIVE_ERROR, DINO_FILE_RECEIVE_ERROR_GET_METADATA_FAILED, "No conversation");
		_inner_error0_ = _tmp29_;
		if (_inner_error0_->domain == DINO_FILE_RECEIVE_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (conversation);
			return NULL;
		} else {
			_g_object_unref0 (conversation);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp30_ = self->priv->stream_interactor;
	_tmp31_ = dino_message_storage_IDENTITY;
	_tmp32_ = dino_stream_interactor_get_module (_tmp30_, DINO_TYPE_MESSAGE_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp31_);
	_tmp33_ = (DinoMessageStorage*) _tmp32_;
	_tmp34_ = dino_entities_file_transfer_get_info (file_transfer);
	_tmp35_ = _tmp34_;
	_tmp36_ = conversation;
	_tmp37_ = dino_message_storage_get_message_by_id (_tmp33_, atoi (_tmp35_), _tmp36_);
	_tmp38_ = _tmp37_;
	_g_object_unref0 (_tmp33_);
	message = _tmp38_;
	_tmp39_ = message;
	if (_tmp39_ == NULL) {
		GError* _tmp40_;
		_tmp40_ = g_error_new_literal (DINO_FILE_RECEIVE_ERROR, DINO_FILE_RECEIVE_ERROR_GET_METADATA_FAILED, "No message");
		_inner_error0_ = _tmp40_;
		if (_inner_error0_->domain == DINO_FILE_RECEIVE_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (message);
			_g_object_unref0 (conversation);
			return NULL;
		} else {
			_g_object_unref0 (message);
			_g_object_unref0 (conversation);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp41_ = dino_http_file_meta_new ();
	file_meta = _tmp41_;
	_tmp42_ = file_meta;
	_tmp43_ = dino_entities_file_transfer_get_size (file_transfer);
	_tmp44_ = _tmp43_;
	((DinoFileMeta*) _tmp42_)->size = _tmp44_;
	_tmp45_ = file_meta;
	_tmp46_ = dino_entities_file_transfer_get_mime_type (file_transfer);
	_tmp47_ = _tmp46_;
	_tmp48_ = g_strdup (_tmp47_);
	_g_free0 (((DinoFileMeta*) _tmp45_)->mime_type);
	((DinoFileMeta*) _tmp45_)->mime_type = _tmp48_;
	_tmp49_ = file_meta;
	_tmp50_ = message;
	_tmp51_ = dino_entities_message_get_body (_tmp50_);
	_tmp52_ = _tmp51_;
	_tmp53_ = dino_plugins_http_files_file_provider_extract_file_name_from_url (self, _tmp52_);
	_g_free0 (((DinoFileMeta*) _tmp49_)->file_name);
	((DinoFileMeta*) _tmp49_)->file_name = _tmp53_;
	_tmp54_ = file_meta;
	_tmp55_ = message;
	_tmp56_ = _g_object_ref0 (_tmp55_);
	_g_object_unref0 (_tmp54_->message);
	_tmp54_->message = _tmp56_;
	result = (DinoFileMeta*) file_meta;
	_g_object_unref0 (message);
	_g_object_unref0 (conversation);
	return result;
}

static DinoFileReceiveData*
dino_plugins_http_files_file_provider_real_get_file_receive_data (DinoFileProvider* base,
                                                                  DinoEntitiesFileTransfer* file_transfer)
{
	DinoPluginsHttpFilesFileProvider * self;
	gint _tmp0_;
	gint _tmp1_;
	DinoEntitiesConversation* conversation = NULL;
	DinoStreamInteractor* _tmp15_;
	DinoModuleIdentity* _tmp16_;
	gpointer _tmp17_;
	DinoConversationManager* _tmp18_;
	XmppJid* _tmp19_;
	XmppJid* _tmp20_;
	XmppJid* _tmp21_;
	XmppJid* _tmp22_;
	XmppJid* _tmp23_;
	DinoEntitiesAccount* _tmp24_;
	DinoEntitiesAccount* _tmp25_;
	DinoEntitiesConversation* _tmp26_;
	DinoEntitiesConversation* _tmp27_;
	DinoEntitiesConversation* _tmp28_;
	DinoEntitiesMessage* message = NULL;
	DinoStreamInteractor* _tmp29_;
	DinoModuleIdentity* _tmp30_;
	gpointer _tmp31_;
	DinoMessageStorage* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	DinoEntitiesConversation* _tmp35_;
	DinoEntitiesMessage* _tmp36_;
	DinoEntitiesMessage* _tmp37_;
	DinoEntitiesMessage* _tmp38_;
	DinoHttpFileReceiveData* receive_data = NULL;
	DinoHttpFileReceiveData* _tmp39_;
	DinoHttpFileReceiveData* _tmp40_;
	DinoEntitiesMessage* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	DinoFileReceiveData* result;
	self = (DinoPluginsHttpFilesFileProvider*) base;
	g_return_val_if_fail (file_transfer != NULL, NULL);
	_tmp0_ = dino_entities_file_transfer_get_provider (file_transfer);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == DINO_FILE_MANAGER_SFS_PROVIDER_ID) {
		GeeList* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = file_transfer->sfs_sources;
		_tmp3_ = gee_collection_get_is_empty ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		if (!_tmp4_) {
			XmppXepStatelessFileSharingHttpSource* http_source = NULL;
			GeeList* _tmp5_;
			gpointer _tmp6_;
			XmppXepStatelessFileSharingSource* _tmp7_;
			XmppXepStatelessFileSharingHttpSource* _tmp8_;
			XmppXepStatelessFileSharingHttpSource* _tmp9_;
			_tmp5_ = file_transfer->sfs_sources;
			_tmp6_ = gee_list_get (_tmp5_, 0);
			_tmp7_ = (XmppXepStatelessFileSharingSource*) _tmp6_;
			_tmp8_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, XMPP_XEP_STATELESS_FILE_SHARING_TYPE_HTTP_SOURCE) ? ((XmppXepStatelessFileSharingHttpSource*) _tmp7_) : NULL;
			if (_tmp8_ == NULL) {
				_g_object_unref0 (_tmp7_);
			}
			http_source = _tmp8_;
			_tmp9_ = http_source;
			if (_tmp9_ != NULL) {
				DinoHttpFileReceiveData* receive_data = NULL;
				DinoHttpFileReceiveData* _tmp10_;
				DinoHttpFileReceiveData* _tmp11_;
				XmppXepStatelessFileSharingHttpSource* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				_tmp10_ = dino_http_file_receive_data_new ();
				receive_data = _tmp10_;
				_tmp11_ = receive_data;
				_tmp12_ = http_source;
				_tmp13_ = xmpp_xep_stateless_file_sharing_http_source_get_url (_tmp12_);
				_tmp14_ = _tmp13_;
				dino_http_file_receive_data_set_url (_tmp11_, _tmp14_);
				result = (DinoFileReceiveData*) receive_data;
				_g_object_unref0 (http_source);
				return result;
			}
			_g_object_unref0 (http_source);
		}
		result = NULL;
		return result;
	}
	_tmp15_ = self->priv->stream_interactor;
	_tmp16_ = dino_conversation_manager_IDENTITY;
	_tmp17_ = dino_stream_interactor_get_module (_tmp15_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp16_);
	_tmp18_ = (DinoConversationManager*) _tmp17_;
	_tmp19_ = dino_entities_file_transfer_get_counterpart (file_transfer);
	_tmp20_ = _tmp19_;
	_tmp21_ = xmpp_jid_get_bare_jid (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_;
	_tmp24_ = dino_entities_file_transfer_get_account (file_transfer);
	_tmp25_ = _tmp24_;
	_tmp26_ = dino_conversation_manager_get_conversation (_tmp18_, _tmp23_, _tmp25_, NULL);
	_tmp27_ = _tmp26_;
	_xmpp_jid_unref0 (_tmp23_);
	_g_object_unref0 (_tmp18_);
	conversation = _tmp27_;
	_tmp28_ = conversation;
	if (_tmp28_ == NULL) {
		result = NULL;
		_g_object_unref0 (conversation);
		return result;
	}
	_tmp29_ = self->priv->stream_interactor;
	_tmp30_ = dino_message_storage_IDENTITY;
	_tmp31_ = dino_stream_interactor_get_module (_tmp29_, DINO_TYPE_MESSAGE_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp30_);
	_tmp32_ = (DinoMessageStorage*) _tmp31_;
	_tmp33_ = dino_entities_file_transfer_get_info (file_transfer);
	_tmp34_ = _tmp33_;
	_tmp35_ = conversation;
	_tmp36_ = dino_message_storage_get_message_by_id (_tmp32_, atoi (_tmp34_), _tmp35_);
	_tmp37_ = _tmp36_;
	_g_object_unref0 (_tmp32_);
	message = _tmp37_;
	_tmp38_ = message;
	if (_tmp38_ == NULL) {
		result = NULL;
		_g_object_unref0 (message);
		_g_object_unref0 (conversation);
		return result;
	}
	_tmp39_ = dino_http_file_receive_data_new ();
	receive_data = _tmp39_;
	_tmp40_ = receive_data;
	_tmp41_ = message;
	_tmp42_ = dino_entities_message_get_body (_tmp41_);
	_tmp43_ = _tmp42_;
	dino_http_file_receive_data_set_url (_tmp40_, _tmp43_);
	result = (DinoFileReceiveData*) receive_data;
	_g_object_unref0 (message);
	_g_object_unref0 (conversation);
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static gint
string_last_index_of (const gchar* self,
                      const gchar* needle,
                      gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (needle != NULL, -1);
	_tmp0_ = g_strrstr (((gchar*) self) + start_index, (gchar*) needle);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

static gchar*
dino_plugins_http_files_file_provider_extract_file_name_from_url (DinoPluginsHttpFilesFileProvider* self,
                                                                  const gchar* url)
{
	gchar* ret = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (url != NULL, NULL);
	_tmp0_ = g_strdup (url);
	ret = _tmp0_;
	_tmp1_ = ret;
	if (string_contains (_tmp1_, "#")) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = ret;
		_tmp3_ = ret;
		_tmp4_ = string_substring (_tmp2_, (glong) 0, (glong) string_last_index_of (_tmp3_, "#", 0));
		_g_free0 (ret);
		ret = _tmp4_;
	}
	_tmp5_ = ret;
	_tmp6_ = ret;
	_tmp7_ = string_substring (_tmp5_, (glong) (string_last_index_of (_tmp6_, "/", 0) + 1), (glong) -1);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_uri_unescape_string (_tmp8_, NULL);
	_g_free0 (ret);
	ret = _tmp9_;
	_g_free0 (_tmp8_);
	result = ret;
	return result;
}

static gint
dino_plugins_http_files_file_provider_real_get_id (DinoFileProvider* base)
{
	DinoPluginsHttpFilesFileProvider * self;
	gint result;
	self = (DinoPluginsHttpFilesFileProvider*) base;
	result = 0;
	return result;
}

static inline gpointer
dino_plugins_http_files_file_provider_received_message_listener_get_instance_private (DinoPluginsHttpFilesFileProviderReceivedMessageListener* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsHttpFilesFileProviderReceivedMessageListener_private_offset);
}

static DinoPluginsHttpFilesFileProviderReceivedMessageListener*
dino_plugins_http_files_file_provider_received_message_listener_construct (GType object_type,
                                                                           DinoPluginsHttpFilesFileProvider* outer)
{
	DinoPluginsHttpFilesFileProviderReceivedMessageListener * self = NULL;
	DinoPluginsHttpFilesFileProvider* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoStreamInteractor* _tmp2_;
	g_return_val_if_fail (outer != NULL, NULL);
	self = (DinoPluginsHttpFilesFileProviderReceivedMessageListener*) dino_message_listener_construct (object_type);
	_tmp0_ = _g_object_ref0 (outer);
	_g_object_unref0 (self->priv->outer);
	self->priv->outer = _tmp0_;
	_tmp1_ = outer->priv->stream_interactor;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp2_;
	return self;
}

static DinoPluginsHttpFilesFileProviderReceivedMessageListener*
dino_plugins_http_files_file_provider_received_message_listener_new (DinoPluginsHttpFilesFileProvider* outer)
{
	return dino_plugins_http_files_file_provider_received_message_listener_construct (DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER, outer);
}

static void
dino_plugins_http_files_file_provider_received_message_listener_real_run_data_free (gpointer _data)
{
	DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->message);
	_g_object_unref0 (_data_->stanza);
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData, _data_);
}

static void
dino_plugins_http_files_file_provider_received_message_listener_real_run (DinoMessageListener* base,
                                                                          DinoEntitiesMessage* message,
                                                                          XmppMessageStanza* stanza,
                                                                          DinoEntitiesConversation* conversation,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_)
{
	DinoPluginsHttpFilesFileProviderReceivedMessageListener * self;
	DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData* _data_;
	DinoPluginsHttpFilesFileProviderReceivedMessageListener* _tmp0_;
	DinoEntitiesMessage* _tmp1_;
	XmppMessageStanza* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	g_return_if_fail (message != NULL);
	g_return_if_fail (stanza != NULL);
	g_return_if_fail (conversation != NULL);
	self = (DinoPluginsHttpFilesFileProviderReceivedMessageListener*) base;
	_data_ = g_slice_new0 (DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_plugins_http_files_file_provider_received_message_listener_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (message);
	_g_object_unref0 (_data_->message);
	_data_->message = _tmp1_;
	_tmp2_ = _g_object_ref0 (stanza);
	_g_object_unref0 (_data_->stanza);
	_data_->stanza = _tmp2_;
	_tmp3_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp3_;
	dino_plugins_http_files_file_provider_received_message_listener_real_run_co (_data_);
}

static gboolean
dino_plugins_http_files_file_provider_received_message_listener_run_finish (DinoMessageListener* base,
                                                                            GAsyncResult* _res_)
{
	gboolean result;
	DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static gboolean
dino_plugins_http_files_file_provider_received_message_listener_real_run_co (DinoPluginsHttpFilesFileProviderReceivedMessageListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = xmpp_xep_stateless_file_sharing_get_file_shares (_data_->stanza);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->_tmp2_ != NULL;
	_g_object_unref0 (_data_->_tmp2_);
	if (_data_->_tmp3_) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp4_ = xmpp_xep_stateless_file_sharing_get_source_attachments (_data_->stanza);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp0_ = _data_->_tmp5_ != NULL;
		_g_object_unref0 (_data_->_tmp5_);
	}
	if (_data_->_tmp0_) {
		_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_->_tmp6_ = xmpp_xep_out_of_band_data_get_url_from_message (_data_->stanza);
	_data_->oob_url = _data_->_tmp6_;
	_data_->_tmp9_ = _data_->oob_url;
	if (_data_->_tmp9_ != NULL) {
		_data_->_tmp10_ = _data_->oob_url;
		_data_->_tmp11_ = dino_entities_message_get_body (_data_->message);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp8_ = g_strcmp0 (_data_->_tmp10_, _data_->_tmp12_) == 0;
	} else {
		_data_->_tmp8_ = FALSE;
	}
	if (_data_->_tmp8_) {
		_data_->_tmp13_ = dino_plugins_http_files_file_provider_http_url_regex;
		_data_->_tmp14_ = dino_entities_message_get_body (_data_->message);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp7_ = g_regex_match (_data_->_tmp13_, _data_->_tmp15_, 0, NULL);
	} else {
		_data_->_tmp7_ = FALSE;
	}
	_data_->normal_file = _data_->_tmp7_;
	_data_->_tmp16_ = dino_plugins_http_files_file_provider_omemo_url_regex;
	_data_->_tmp17_ = dino_entities_message_get_body (_data_->message);
	_data_->_tmp18_ = _data_->_tmp17_;
	_data_->omemo_file = g_regex_match (_data_->_tmp16_, _data_->_tmp18_, 0, NULL);
	if (_data_->normal_file) {
		_data_->_tmp19_ = TRUE;
	} else {
		_data_->_tmp19_ = _data_->omemo_file;
	}
	if (_data_->_tmp19_) {
		_data_->_tmp20_ = _data_->self->priv->outer;
		dino_plugins_http_files_file_provider_on_file_message (_data_->_tmp20_, _data_->message, _data_->conversation);
		_data_->result = TRUE;
		_g_free0 (_data_->oob_url);
		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_->result = FALSE;
	_g_free0 (_data_->oob_url);
	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_plugins_http_files_file_provider_received_message_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	DinoPluginsHttpFilesFileProviderReceivedMessageListener* self;
	self = (DinoPluginsHttpFilesFileProviderReceivedMessageListener*) base;
	result = "MESSAGE_REINTERPRETING";
	return result;
}

static gchar**
dino_plugins_http_files_file_provider_received_message_listener_real_get_after_actions (XmppOrderedListener* base,
                                                                                        gint* result_length1)
{
	gchar** result;
	DinoPluginsHttpFilesFileProviderReceivedMessageListener* self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	self = (DinoPluginsHttpFilesFileProviderReceivedMessageListener*) base;
	_tmp0_ = self->after_actions_const;
	_tmp0__length1 = self->after_actions_const_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static void
dino_plugins_http_files_file_provider_received_message_listener_class_init (DinoPluginsHttpFilesFileProviderReceivedMessageListenerClass * klass,
                                                                            gpointer klass_data)
{
	dino_plugins_http_files_file_provider_received_message_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsHttpFilesFileProviderReceivedMessageListener_private_offset);
	((DinoMessageListenerClass *) klass)->run = (void (*) (DinoMessageListener*, DinoEntitiesMessage*, XmppMessageStanza*, DinoEntitiesConversation*, GAsyncReadyCallback, gpointer)) dino_plugins_http_files_file_provider_received_message_listener_real_run;
	((DinoMessageListenerClass *) klass)->run_finish = (gboolean (*) (DinoMessageListener*, GAsyncResult*)) dino_plugins_http_files_file_provider_received_message_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) dino_plugins_http_files_file_provider_received_message_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) dino_plugins_http_files_file_provider_received_message_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_plugins_http_files_file_provider_received_message_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_http_files_file_provider_received_message_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY, dino_plugins_http_files_file_provider_received_message_listener_properties[DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY] = g_param_spec_string ("action-group", "action-group", "action-group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY, dino_plugins_http_files_file_provider_received_message_listener_properties[DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY] = g_param_spec_boxed ("after-actions", "after-actions", "after-actions", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_plugins_http_files_file_provider_received_message_listener_instance_init (DinoPluginsHttpFilesFileProviderReceivedMessageListener * self,
                                                                               gpointer klass)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	self->priv = dino_plugins_http_files_file_provider_received_message_listener_get_instance_private (self);
	_tmp0_ = g_strdup ("STORE");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	self->after_actions_const = _tmp1_;
	self->after_actions_const_length1 = 1;
	self->_after_actions_const_size_ = self->after_actions_const_length1;
}

static void
dino_plugins_http_files_file_provider_received_message_listener_finalize (GObject * obj)
{
	DinoPluginsHttpFilesFileProviderReceivedMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoPluginsHttpFilesFileProviderReceivedMessageListener);
	self->after_actions_const = (_vala_array_free (self->after_actions_const, self->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->outer);
	_g_object_unref0 (self->priv->stream_interactor);
	G_OBJECT_CLASS (dino_plugins_http_files_file_provider_received_message_listener_parent_class)->finalize (obj);
}

static GType
dino_plugins_http_files_file_provider_received_message_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsHttpFilesFileProviderReceivedMessageListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_http_files_file_provider_received_message_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsHttpFilesFileProviderReceivedMessageListener), 0, (GInstanceInitFunc) dino_plugins_http_files_file_provider_received_message_listener_instance_init, NULL };
	GType dino_plugins_http_files_file_provider_received_message_listener_type_id;
	dino_plugins_http_files_file_provider_received_message_listener_type_id = g_type_register_static (DINO_TYPE_MESSAGE_LISTENER, "DinoPluginsHttpFilesFileProviderReceivedMessageListener", &g_define_type_info, 0);
	DinoPluginsHttpFilesFileProviderReceivedMessageListener_private_offset = g_type_add_instance_private (dino_plugins_http_files_file_provider_received_message_listener_type_id, sizeof (DinoPluginsHttpFilesFileProviderReceivedMessageListenerPrivate));
	return dino_plugins_http_files_file_provider_received_message_listener_type_id;
}

static GType
dino_plugins_http_files_file_provider_received_message_listener_get_type (void)
{
	static volatile gsize dino_plugins_http_files_file_provider_received_message_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_http_files_file_provider_received_message_listener_type_id__once)) {
		GType dino_plugins_http_files_file_provider_received_message_listener_type_id;
		dino_plugins_http_files_file_provider_received_message_listener_type_id = dino_plugins_http_files_file_provider_received_message_listener_get_type_once ();
		g_once_init_leave (&dino_plugins_http_files_file_provider_received_message_listener_type_id__once, dino_plugins_http_files_file_provider_received_message_listener_type_id);
	}
	return dino_plugins_http_files_file_provider_received_message_listener_type_id__once;
}

static void
_vala_dino_plugins_http_files_file_provider_received_message_listener_get_property (GObject * object,
                                                                                    guint property_id,
                                                                                    GValue * value,
                                                                                    GParamSpec * pspec)
{
	DinoPluginsHttpFilesFileProviderReceivedMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoPluginsHttpFilesFileProviderReceivedMessageListener);
	switch (property_id) {
		case DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case DINO_PLUGINS_HTTP_FILES_FILE_PROVIDER_RECEIVED_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, xmpp_ordered_listener_get_after_actions ((XmppOrderedListener*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
dino_plugins_http_files_file_provider_class_init (DinoPluginsHttpFilesFileProviderClass * klass,
                                                  gpointer klass_data)
{
	GRegex* _tmp0_;
	GRegex* _tmp1_;
	dino_plugins_http_files_file_provider_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsHttpFilesFileProvider_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_http_files_file_provider_finalize;
	_tmp0_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_0, "^https?:\\/\\/([^\\s#]*)$", 0));
	dino_plugins_http_files_file_provider_http_url_regex = _tmp0_;
	_tmp1_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_1, "^aesgcm:\\/\\/(.*)#(([A-Fa-f0-9]{2}){48}|([A-Fa-f0-9]{2}){44})$", 0));
	dino_plugins_http_files_file_provider_omemo_url_regex = _tmp1_;
}

static void
dino_plugins_http_files_file_provider_dino_file_provider_interface_init (DinoFileProviderIface * iface,
                                                                         gpointer iface_data)
{
	dino_plugins_http_files_file_provider_dino_file_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_meta_info = (void (*) (DinoFileProvider*, DinoEntitiesFileTransfer*, DinoFileReceiveData*, DinoFileMeta*, GAsyncReadyCallback, gpointer)) dino_plugins_http_files_file_provider_real_get_meta_info;
	iface->get_meta_info_finish = (DinoFileMeta* (*) (DinoFileProvider*, GAsyncResult*, GError**)) dino_plugins_http_files_file_provider_get_meta_info_finish;
	iface->get_encryption = (DinoEntitiesEncryption (*) (DinoFileProvider*, DinoEntitiesFileTransfer*, DinoFileReceiveData*, DinoFileMeta*)) dino_plugins_http_files_file_provider_real_get_encryption;
	iface->download = (void (*) (DinoFileProvider*, DinoEntitiesFileTransfer*, DinoFileReceiveData*, DinoFileMeta*, GAsyncReadyCallback, gpointer)) dino_plugins_http_files_file_provider_real_download;
	iface->download_finish = (GInputStream* (*) (DinoFileProvider*, GAsyncResult*, GError**)) dino_plugins_http_files_file_provider_download_finish;
	iface->get_file_meta = (DinoFileMeta* (*) (DinoFileProvider*, DinoEntitiesFileTransfer*, GError**)) dino_plugins_http_files_file_provider_real_get_file_meta;
	iface->get_file_receive_data = (DinoFileReceiveData* (*) (DinoFileProvider*, DinoEntitiesFileTransfer*)) dino_plugins_http_files_file_provider_real_get_file_receive_data;
	iface->get_id = (gint (*) (DinoFileProvider*)) dino_plugins_http_files_file_provider_real_get_id;
}

static void
dino_plugins_http_files_file_provider_instance_init (DinoPluginsHttpFilesFileProvider * self,
                                                     gpointer klass)
{
	self->priv = dino_plugins_http_files_file_provider_get_instance_private (self);
}

static void
dino_plugins_http_files_file_provider_finalize (GObject * obj)
{
	DinoPluginsHttpFilesFileProvider * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_HTTP_FILES_TYPE_FILE_PROVIDER, DinoPluginsHttpFilesFileProvider);
	_g_object_unref0 (self->priv->stream_interactor);
	_qlite_database_unref0 (self->priv->dino_db);
	_g_object_unref0 (self->priv->session);
	G_OBJECT_CLASS (dino_plugins_http_files_file_provider_parent_class)->finalize (obj);
}

static GType
dino_plugins_http_files_file_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsHttpFilesFileProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_http_files_file_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsHttpFilesFileProvider), 0, (GInstanceInitFunc) dino_plugins_http_files_file_provider_instance_init, NULL };
	static const GInterfaceInfo dino_file_provider_info = { (GInterfaceInitFunc) dino_plugins_http_files_file_provider_dino_file_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_plugins_http_files_file_provider_type_id;
	dino_plugins_http_files_file_provider_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoPluginsHttpFilesFileProvider", &g_define_type_info, 0);
	g_type_add_interface_static (dino_plugins_http_files_file_provider_type_id, DINO_TYPE_FILE_PROVIDER, &dino_file_provider_info);
	DinoPluginsHttpFilesFileProvider_private_offset = g_type_add_instance_private (dino_plugins_http_files_file_provider_type_id, sizeof (DinoPluginsHttpFilesFileProviderPrivate));
	return dino_plugins_http_files_file_provider_type_id;
}

GType
dino_plugins_http_files_file_provider_get_type (void)
{
	static volatile gsize dino_plugins_http_files_file_provider_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_http_files_file_provider_type_id__once)) {
		GType dino_plugins_http_files_file_provider_type_id;
		dino_plugins_http_files_file_provider_type_id = dino_plugins_http_files_file_provider_get_type_once ();
		g_once_init_leave (&dino_plugins_http_files_file_provider_type_id__once, dino_plugins_http_files_file_provider_type_id);
	}
	return dino_plugins_http_files_file_provider_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

