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

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "xmpp-vala.h"
#include <glib-object.h>
#include <gio/gio.h>
#include <gee.h>

#define XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI "urn:xmpp:jingle:apps:file-transfer:5"
#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  {
	XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_0_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_NS_URI_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_REQUIRED_TRANSPORT_TYPE_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_REQUIRED_COMPONENTS_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_file_transfer_module_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
typedef struct _XmppXepJingleFileTransferModuleIsAvailableData XmppXepJingleFileTransferModuleIsAvailableData;
typedef struct _Block12Data Block12Data;
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
typedef struct _Block13Data Block13Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _XmppXepJingleFileTransferModuleOfferFileStreamData XmppXepJingleFileTransferModuleOfferFileStreamData;
enum  {
	XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_FILE_INCOMING_SIGNAL,
	XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_NUM_SIGNALS
};
static guint xmpp_xep_jingle_file_transfer_module_signals[XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_NUM_SIGNALS] = {0};
enum  {
	XMPP_XEP_JINGLE_FILE_TRANSFER_SESSION_INFO_TYPE_0_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_SESSION_INFO_TYPE_NS_URI_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_SESSION_INFO_TYPE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_file_transfer_session_info_type_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_SESSION_INFO_TYPE_NUM_PROPERTIES];
enum  {
	XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_0_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_NAME_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_SIZE_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_ORIGINAL_DESCRIPTION_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_file_transfer_parameters_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_NUM_PROPERTIES];
typedef struct _XmppXepJingleFileTransferParametersHandleProposedContentData XmppXepJingleFileTransferParametersHandleProposedContentData;

#define XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM (xmpp_xep_jingle_file_transfer_file_transfer_input_stream_get_type ())
#define XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM, XmppXepJingleFileTransferFileTransferInputStream))
#define XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM, XmppXepJingleFileTransferFileTransferInputStreamClass))
#define XMPP_XEP_JINGLE_FILE_TRANSFER_IS_FILE_TRANSFER_INPUT_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM))
#define XMPP_XEP_JINGLE_FILE_TRANSFER_IS_FILE_TRANSFER_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM))
#define XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM, XmppXepJingleFileTransferFileTransferInputStreamClass))

typedef struct _XmppXepJingleFileTransferFileTransferInputStream XmppXepJingleFileTransferFileTransferInputStream;
typedef struct _XmppXepJingleFileTransferFileTransferInputStreamClass XmppXepJingleFileTransferFileTransferInputStreamClass;
typedef struct _XmppXepJingleFileTransferFileTransferInputStreamPrivate XmppXepJingleFileTransferFileTransferInputStreamPrivate;
enum  {
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_0_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_file_transfer_file_transfer_input_stream_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_NUM_PROPERTIES];
typedef struct _XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData;
typedef struct _XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData;
enum  {
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_CLOSED_SIGNAL,
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_NUM_SIGNALS
};
static guint xmpp_xep_jingle_file_transfer_file_transfer_input_stream_signals[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_NUM_SIGNALS] = {0};
enum  {
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_0_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_PEER_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_FILE_NAME_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_SIZE_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_SECURITY_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_STREAM_PROPERTY,
	XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_file_transfer_file_transfer_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_NUM_PROPERTIES];
typedef struct _XmppXepJingleFileTransferFileTransferAcceptData XmppXepJingleFileTransferFileTransferAcceptData;

struct _XmppXepJingleFileTransferModuleIsAvailableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleFileTransferModule* self;
	XmppXmppStream* stream;
	XmppJid* full_jid;
	gboolean result;
	gboolean* has_feature;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepServiceDiscoveryModule* _tmp2_;
	gboolean _tmp3_;
	gboolean* _tmp4_;
	gboolean* _tmp5_;
	gboolean _tmp6_;
	gboolean* _tmp7_;
	gboolean* _tmp8_;
	XmppModuleIdentity* _tmp9_;
	gpointer _tmp10_;
	XmppXepJingleModule* _tmp11_;
	XmppXepJingleTransportType _tmp12_;
	XmppXepJingleTransportType _tmp13_;
	guint8 _tmp14_;
	guint8 _tmp15_;
	gboolean _tmp16_;
};

struct _Block12Data {
	int _ref_count_;
	XmppXepJingleFileTransferModule* self;
	XmppXepJingleContent* content;
	gpointer _async_data_;
};

struct _Block13Data {
	int _ref_count_;
	Block12Data * _data12_;
	gulong content_notify_id;
};

struct _XmppXepJingleFileTransferModuleOfferFileStreamData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleFileTransferModule* self;
	XmppXmppStream* stream;
	XmppJid* receiver_full_jid;
	GInputStream* input_stream;
	gchar* basename;
	gint64 size;
	gchar* precondition_name;
	GObject* precondition_options;
	Block12Data* _data12_;
	XmppStanzaNode* file_node;
	XmppStanzaNode* description;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* _tmp11_;
	XmppStanzaNode* _tmp12_;
	XmppStanzaNode* _tmp13_;
	XmppStanzaNode* _tmp14_;
	XmppStanzaNode* _tmp15_;
	XmppStanzaNode* _tmp16_;
	XmppStanzaNode* _tmp17_;
	XmppStanzaNode* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	XmppStanzaNode* _tmp21_;
	XmppStanzaNode* _tmp22_;
	XmppStanzaNode* _tmp23_;
	XmppStanzaNode* _tmp24_;
	XmppStanzaNode* _tmp25_;
	XmppStanzaNode* _tmp26_;
	XmppXepJingleFileTransferParameters* parameters;
	XmppStanzaNode* _tmp27_;
	XmppXepJingleFileTransferParameters* _tmp28_;
	XmppXepJingleModule* jingle_module;
	XmppModuleIdentity* _tmp29_;
	gpointer _tmp30_;
	XmppXepJingleTransport* transport;
	XmppXepJingleModule* _tmp31_;
	XmppXepJingleTransportType _tmp32_;
	XmppXepJingleTransportType _tmp33_;
	guint8 _tmp34_;
	guint8 _tmp35_;
	GeeSet* _tmp36_;
	GeeSet* _tmp37_;
	XmppXepJingleTransport* _tmp38_;
	XmppXepJingleTransport* _tmp39_;
	XmppXepJingleTransport* _tmp40_;
	GError* _tmp41_;
	XmppXepJingleSecurityPrecondition* precondition;
	XmppXepJingleModule* _tmp42_;
	XmppXepJingleSecurityPrecondition* _tmp43_;
	gboolean _tmp44_;
	XmppXepJingleSecurityPrecondition* _tmp45_;
	GError* _tmp46_;
	XmppJid* my_jid;
	XmppFlagIdentity* _tmp47_;
	gpointer _tmp48_;
	XmppBindFlag* _tmp49_;
	XmppJid* _tmp50_;
	XmppJid* _tmp51_;
	XmppJid* _tmp52_;
	XmppJid* _tmp53_;
	GError* _tmp54_;
	XmppXepJingleTransportParameters* transport_params;
	XmppXepJingleTransport* _tmp55_;
	guint8 _tmp56_;
	guint8 _tmp57_;
	XmppJid* _tmp58_;
	XmppXepJingleTransportParameters* _tmp59_;
	XmppXepJingleSecurityParameters* _tmp60_;
	XmppXepJingleSecurityPrecondition* _tmp61_;
	XmppXepJingleSecurityPrecondition* _tmp62_;
	XmppJid* _tmp63_;
	XmppXepJingleSecurityParameters* _tmp64_;
	XmppXepJingleSecurityParameters* security_params;
	XmppXepJingleSecurityParameters* _tmp65_;
	XmppXepJingleFileTransferParameters* _tmp66_;
	XmppXepJingleTransport* _tmp67_;
	XmppXepJingleTransportParameters* _tmp68_;
	XmppXepJingleSecurityPrecondition* _tmp69_;
	XmppXepJingleSecurityParameters* _tmp70_;
	XmppJid* _tmp71_;
	XmppXepJingleContent* _tmp72_;
	GeeArrayList* contents;
	GeeArrayList* _tmp73_;
	GeeArrayList* _tmp74_;
	XmppXepJingleContent* _tmp75_;
	XmppXepJingleSession* session;
	Block13Data* _data13_;
	XmppXepJingleSession* _tmp76_;
	XmppXepJingleModule* _tmp77_;
	GeeArrayList* _tmp78_;
	XmppXepJingleSession* _tmp79_;
	XmppXepJingleSession* _tmp80_;
	XmppXepJingleContent* _tmp81_;
	gulong _tmp82_;
	XmppXepJingleStreamingConnection* connection;
	XmppXepJingleContent* _tmp83_;
	GeeMap* _tmp84_;
	gpointer _tmp85_;
	XmppXepJingleComponentConnection* _tmp86_;
	XmppXepJingleStreamingConnection* _tmp87_;
	gboolean _tmp88_;
	XmppXepJingleStreamingConnection* _tmp89_;
	XmppXepJingleStreamingConnection* _tmp90_;
	GeeFuture* _tmp91_;
	GeeFuture* _tmp92_;
	GIOStream* io_stream;
	XmppXepJingleStreamingConnection* _tmp93_;
	GeeFuture* _tmp94_;
	GeeFuture* _tmp95_;
	gconstpointer _tmp96_;
	GIOStream* _tmp97_;
	GIOStream* _tmp98_;
	GInputStream* _tmp99_;
	GInputStream* _tmp100_;
	GIOStream* _tmp101_;
	GOutputStream* _tmp102_;
	GOutputStream* _tmp103_;
	XmppXepJingleStreamingConnection* _tmp104_;
	GError* e;
	XmppXepJingleSession* _tmp105_;
	XmppXepJingleSession* _tmp106_;
	GError* _tmp107_;
	const gchar* _tmp108_;
	GError* _tmp109_;
	const gchar* _tmp110_;
	GError* _tmp111_;
	const gchar* _tmp112_;
	GError* _tmp113_;
	GError* _inner_error0_;
};

struct _XmppXepJingleFileTransferParametersPrivate {
	XmppXepJingleFileTransferModule* parent;
	gchar* media_type;
	gchar* _name;
	gint64 _size;
	XmppStanzaNode* _original_description;
};

struct _XmppXepJingleFileTransferParametersHandleProposedContentData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleFileTransferParameters* self;
	XmppXmppStream* stream;
	XmppXepJingleSession* session;
	XmppXepJingleContent* content;
	XmppXepJingleFileTransferModule* _tmp0_;
	XmppXepJingleFileTransferFileTransfer* _tmp1_;
	XmppXepJingleFileTransferFileTransfer* _tmp2_;
};

struct _XmppXepJingleFileTransferFileTransferInputStream {
	GInputStream parent_instance;
	XmppXepJingleFileTransferFileTransferInputStreamPrivate * priv;
};

struct _XmppXepJingleFileTransferFileTransferInputStreamClass {
	GInputStreamClass parent_class;
};

struct _XmppXepJingleFileTransferFileTransferInputStreamPrivate {
	GInputStream* inner;
	gint64 remaining_size;
};

struct _XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleFileTransferFileTransferInputStream* self;
	guint8* buffer_;
	gsize buffer__length1;
	gint io_priority;
	GCancellable* cancellable;
	gssize result;
	guint8* buffer;
	gint buffer_length1;
	gint _buffer_size_;
	guint8* _tmp0_;
	gint _tmp0__length1;
	guint8* _tmp1_;
	gint _tmp1__length1;
	gssize _tmp2_;
	GInputStream* _tmp3_;
	guint8* _tmp4_;
	gint _tmp4__length1;
	GError* _inner_error0_;
};

struct _XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleFileTransferFileTransferInputStream* self;
	gint io_priority;
	GCancellable* cancellable;
	gboolean result;
	gboolean _tmp0_;
	GInputStream* _tmp1_;
	GError* _inner_error0_;
};

struct _XmppXepJingleFileTransferFileTransferPrivate {
	XmppXepJingleSession* session;
	XmppXepJingleContent* content;
	XmppXepJingleFileTransferParameters* parameters;
	GInputStream* _stream;
};

struct _XmppXepJingleFileTransferFileTransferAcceptData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleFileTransferFileTransfer* self;
	XmppXmppStream* stream;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleStreamingConnection* connection;
	XmppXepJingleContent* _tmp1_;
	GeeMap* _tmp2_;
	GeeCollection* _tmp3_;
	GeeCollection* _tmp4_;
	GeeCollection* _tmp5_;
	gint _tmp6_;
	gpointer* _tmp7_;
	XmppXepJingleComponentConnection** _tmp8_;
	gint _tmp8__length1;
	XmppXepJingleComponentConnection* _tmp9_;
	XmppXepJingleStreamingConnection* _tmp10_;
	XmppXepJingleStreamingConnection* _tmp11_;
	GIOStream* io_stream;
	XmppXepJingleStreamingConnection* _tmp12_;
	GeeFuture* _tmp13_;
	GeeFuture* _tmp14_;
	gconstpointer _tmp15_;
	GIOStream* _tmp16_;
	XmppXepJingleFileTransferFileTransferInputStream* ft_stream;
	GIOStream* _tmp17_;
	GInputStream* _tmp18_;
	GInputStream* _tmp19_;
	gint64 _tmp20_;
	gint64 _tmp21_;
	XmppXepJingleFileTransferFileTransferInputStream* _tmp22_;
	GIOStream* _tmp23_;
	GOutputStream* _tmp24_;
	GOutputStream* _tmp25_;
	XmppXepJingleFileTransferFileTransferInputStream* _tmp26_;
	XmppXepJingleFileTransferFileTransferInputStream* _tmp27_;
	XmppXepJingleStreamingConnection* _tmp28_;
	GeeFuture* _tmp29_;
	GeeFuture* _tmp30_;
	GError* _tmp31_;
	GError* _tmp32_;
	const gchar* _tmp33_;
	GError* e;
	GError* _tmp34_;
	const gchar* _tmp35_;
	GError* _inner_error0_;
};

static gpointer xmpp_xep_jingle_file_transfer_module_parent_class = NULL;
XmppModuleIdentity* xmpp_xep_jingle_file_transfer_module_IDENTITY = NULL;
static XmppXepJingleContentTypeIface * xmpp_xep_jingle_file_transfer_module_xmpp_xep_jingle_content_type_parent_iface = NULL;
static gpointer xmpp_xep_jingle_file_transfer_session_info_type_parent_class = NULL;
static XmppXepJingleSessionInfoNsIface * xmpp_xep_jingle_file_transfer_session_info_type_xmpp_xep_jingle_session_info_ns_parent_iface = NULL;
static gint XmppXepJingleFileTransferParameters_private_offset;
static gpointer xmpp_xep_jingle_file_transfer_parameters_parent_class = NULL;
static XmppXepJingleContentParametersIface * xmpp_xep_jingle_file_transfer_parameters_xmpp_xep_jingle_content_parameters_parent_iface = NULL;
static gint XmppXepJingleFileTransferFileTransferInputStream_private_offset;
static gpointer xmpp_xep_jingle_file_transfer_file_transfer_input_stream_parent_class = NULL;
static gint XmppXepJingleFileTransferFileTransfer_private_offset;
static gpointer xmpp_xep_jingle_file_transfer_file_transfer_parent_class = NULL;

static void xmpp_xep_jingle_file_transfer_module_real_attach (XmppXmppStreamModule* base,
                                                       XmppXmppStream* stream);
static void xmpp_xep_jingle_file_transfer_module_real_detach (XmppXmppStreamModule* base,
                                                       XmppXmppStream* stream);
static XmppXepJingleContentParameters* xmpp_xep_jingle_file_transfer_module_real_parse_content_parameters (XmppXepJingleContentType* base,
                                                                                                    XmppStanzaNode* description,
                                                                                                    GError** error);
static void xmpp_xep_jingle_file_transfer_module_is_available_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_file_transfer_module_is_available_co (XmppXepJingleFileTransferModuleIsAvailableData* _data_);
static void xmpp_xep_jingle_file_transfer_module_is_available_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_);
static gboolean* _bool_dup (gboolean* self);
static void xmpp_xep_jingle_file_transfer_module_offer_file_stream_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_file_transfer_module_offer_file_stream_co (XmppXepJingleFileTransferModuleOfferFileStreamData* _data_);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static void xmpp_xep_jingle_file_transfer_module_offer_file_stream_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static void ___lambda28_ (Block13Data* _data13_);
static gboolean _xmpp_xep_jingle_file_transfer_module_offer_file_stream_co_gsource_func (gpointer self);
static void ____lambda28__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static gchar* xmpp_xep_jingle_file_transfer_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_xep_jingle_file_transfer_module_real_get_id (XmppXmppStreamModule* base);
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 xmpp_xep_jingle_file_transfer_module_finalize (GObject * obj);
static GType xmpp_xep_jingle_file_transfer_module_get_type_once (void);
static void _vala_xmpp_xep_jingle_file_transfer_module_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void xmpp_xep_jingle_file_transfer_session_info_type_real_handle_content_session_info (XmppXepJingleSessionInfoNs* base,
                                                                                       XmppXmppStream* stream,
                                                                                       XmppXepJingleSession* session,
                                                                                       XmppStanzaNode* info,
                                                                                       XmppIqStanza* iq,
                                                                                       GError** error);
static GType xmpp_xep_jingle_file_transfer_session_info_type_get_type_once (void);
static void _vala_xmpp_xep_jingle_file_transfer_session_info_type_get_property (GObject * object,
                                                                         guint property_id,
                                                                         GValue * value,
                                                                         GParamSpec * pspec);
static void xmpp_xep_jingle_file_transfer_parameters_set_original_description (XmppXepJingleFileTransferParameters* self,
                                                                        XmppStanzaNode* value);
static void xmpp_xep_jingle_file_transfer_parameters_set_name (XmppXepJingleFileTransferParameters* self,
                                                        const gchar* value);
static void xmpp_xep_jingle_file_transfer_parameters_set_size (XmppXepJingleFileTransferParameters* self,
                                                        gint64 value);
static XmppStanzaNode* xmpp_xep_jingle_file_transfer_parameters_real_get_description_node (XmppXepJingleContentParameters* base);
static void xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content_data_free (gpointer _data);
static void xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content (XmppXepJingleContentParameters* base,
                                                                            XmppXmppStream* stream,
                                                                            XmppXepJingleSession* session,
                                                                            XmppXepJingleContent* content,
                                                                            GAsyncReadyCallback _callback_,
                                                                            gpointer _user_data_);
static gboolean xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content_co (XmppXepJingleFileTransferParametersHandleProposedContentData* _data_);
static void xmpp_xep_jingle_file_transfer_parameters_real_accept (XmppXepJingleContentParameters* base,
                                                           XmppXmppStream* stream,
                                                           XmppXepJingleSession* session,
                                                           XmppXepJingleContent* content);
static void xmpp_xep_jingle_file_transfer_parameters_real_handle_accept (XmppXepJingleContentParameters* base,
                                                                  XmppXmppStream* stream,
                                                                  XmppXepJingleSession* session,
                                                                  XmppXepJingleContent* content,
                                                                  XmppStanzaNode* description_node);
static void xmpp_xep_jingle_file_transfer_parameters_real_terminate (XmppXepJingleContentParameters* base,
                                                              gboolean we_terminated,
                                                              const gchar* reason_name,
                                                              const gchar* reason_text);
static void xmpp_xep_jingle_file_transfer_parameters_finalize (GObject * obj);
static GType xmpp_xep_jingle_file_transfer_parameters_get_type_once (void);
static void _vala_xmpp_xep_jingle_file_transfer_parameters_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_file_transfer_parameters_set_property (GObject * object,
                                                                  guint property_id,
                                                                  const GValue * value,
                                                                  GParamSpec * pspec);
VALA_EXTERN GType xmpp_xep_jingle_file_transfer_file_transfer_input_stream_get_type (void) G_GNUC_CONST ;
VALA_EXTERN XmppXepJingleFileTransferFileTransferInputStream* xmpp_xep_jingle_file_transfer_file_transfer_input_stream_new (GInputStream* inner,
                                                                                                                gint64 max_size);
VALA_EXTERN XmppXepJingleFileTransferFileTransferInputStream* xmpp_xep_jingle_file_transfer_file_transfer_input_stream_construct (GType object_type,
                                                                                                                      GInputStream* inner,
                                                                                                                      gint64 max_size);
static gssize xmpp_xep_jingle_file_transfer_file_transfer_input_stream_update_remaining (XmppXepJingleFileTransferFileTransferInputStream* self,
                                                                                  gssize read);
static gssize xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read (GInputStream* base,
                                                                           guint8* buffer_,
                                                                           gsize buffer__length1,
                                                                           GCancellable* cancellable,
                                                                           GError** error);
static void xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async_data_free (gpointer _data);
static void xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async (GInputStream* base,
                                                                               guint8* buffer_,
                                                                               gsize buffer__length1,
                                                                               gint io_priority,
                                                                               GCancellable* cancellable,
                                                                               GAsyncReadyCallback _callback_,
                                                                               gpointer _user_data_);
static gboolean xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async_co (XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData* _data_);
static void xmpp_xep_jingle_file_transfer_file_transfer_input_stream_read_async_ready (GObject* source_object,
                                                                                GAsyncResult* _res_,
                                                                                gpointer _user_data_);
static gboolean xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close (GInputStream* base,
                                                                              GCancellable* cancellable,
                                                                              GError** error);
static void xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async_data_free (gpointer _data);
static void xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async (GInputStream* base,
                                                                                gint io_priority,
                                                                                GCancellable* cancellable,
                                                                                GAsyncReadyCallback _callback_,
                                                                                gpointer _user_data_);
static gboolean xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async_co (XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData* _data_);
static void xmpp_xep_jingle_file_transfer_file_transfer_input_stream_close_async_ready (GObject* source_object,
                                                                                 GAsyncResult* _res_,
                                                                                 gpointer _user_data_);
static void xmpp_xep_jingle_file_transfer_file_transfer_input_stream_finalize (GObject * obj);
static GType xmpp_xep_jingle_file_transfer_file_transfer_input_stream_get_type_once (void);
static void xmpp_xep_jingle_file_transfer_file_transfer_accept_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_file_transfer_file_transfer_accept_co (XmppXepJingleFileTransferFileTransferAcceptData* _data_);
static void xmpp_xep_jingle_file_transfer_file_transfer_accept_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_);
static void ___lambda27_ (XmppXepJingleFileTransferFileTransfer* self);
static void ____lambda27__xmpp_xep_jingle_file_transfer_file_transfer_input_stream_closed (XmppXepJingleFileTransferFileTransferInputStream* _sender,
                                                                                    gpointer self);
static void xmpp_xep_jingle_file_transfer_file_transfer_set_stream (XmppXepJingleFileTransferFileTransfer* self,
                                                             GInputStream* value);
static void xmpp_xep_jingle_file_transfer_file_transfer_finalize (GObject * obj);
static GType xmpp_xep_jingle_file_transfer_file_transfer_get_type_once (void);
static void _vala_xmpp_xep_jingle_file_transfer_file_transfer_get_property (GObject * object,
                                                                     guint property_id,
                                                                     GValue * value,
                                                                     GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_file_transfer_file_transfer_set_property (GObject * object,
                                                                     guint property_id,
                                                                     const GValue * value,
                                                                     GParamSpec * pspec);
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 inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static void
xmpp_xep_jingle_file_transfer_module_real_attach (XmppXmppStreamModule* base,
                                                  XmppXmppStream* stream)
{
	XmppXepJingleFileTransferModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepServiceDiscoveryModule* _tmp2_;
	XmppModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppXepJingleModule* _tmp5_;
	XmppModuleIdentity* _tmp6_;
	gpointer _tmp7_;
	XmppXepJingleModule* _tmp8_;
	XmppXepJingleFileTransferSessionInfoType* _tmp9_;
	self = (XmppXepJingleFileTransferModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_service_discovery_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepServiceDiscoveryModule*) _tmp1_;
	xmpp_xep_service_discovery_module_add_feature (_tmp2_, stream, XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = xmpp_xep_jingle_module_IDENTITY;
	_tmp4_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
	_tmp5_ = (XmppXepJingleModule*) _tmp4_;
	xmpp_xep_jingle_module_register_content_type (_tmp5_, (XmppXepJingleContentType*) self);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = xmpp_xep_jingle_module_IDENTITY;
	_tmp7_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
	_tmp8_ = (XmppXepJingleModule*) _tmp7_;
	_tmp9_ = self->session_info_type;
	xmpp_xep_jingle_module_register_session_info_type (_tmp8_, (XmppXepJingleSessionInfoNs*) _tmp9_);
	_g_object_unref0 (_tmp8_);
}

static void
xmpp_xep_jingle_file_transfer_module_real_detach (XmppXmppStreamModule* base,
                                                  XmppXmppStream* stream)
{
	XmppXepJingleFileTransferModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepServiceDiscoveryModule* _tmp2_;
	self = (XmppXepJingleFileTransferModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_service_discovery_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepServiceDiscoveryModule*) _tmp1_;
	xmpp_xep_service_discovery_module_remove_feature (_tmp2_, stream, XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI);
	_g_object_unref0 (_tmp2_);
}

static XmppXepJingleContentParameters*
xmpp_xep_jingle_file_transfer_module_real_parse_content_parameters (XmppXepJingleContentType* base,
                                                                    XmppStanzaNode* description,
                                                                    GError** error)
{
	XmppXepJingleFileTransferModule * self;
	XmppXepJingleFileTransferParameters* _tmp0_ = NULL;
	XmppXepJingleFileTransferParameters* _tmp1_;
	XmppXepJingleFileTransferParameters* _tmp2_;
	GError* _inner_error0_ = NULL;
	XmppXepJingleContentParameters* result;
	self = (XmppXepJingleFileTransferModule*) base;
	g_return_val_if_fail (description != NULL, NULL);
	_tmp1_ = xmpp_xep_jingle_file_transfer_parameters_parse (self, description, &_inner_error0_);
	_tmp0_ = _tmp1_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp2_ = _tmp0_;
	_tmp0_ = NULL;
	result = (XmppXepJingleContentParameters*) _tmp2_;
	_g_object_unref0 (_tmp0_);
	return result;
}

XmppXepJingleContentParameters*
xmpp_xep_jingle_file_transfer_module_create_content_parameters (XmppXepJingleFileTransferModule* self,
                                                                GObject* object,
                                                                GError** error)
{
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (object != NULL, NULL);
	g_assert_not_reached ();
}

static void
xmpp_xep_jingle_file_transfer_module_is_available_data_free (gpointer _data)
{
	XmppXepJingleFileTransferModuleIsAvailableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_jid_unref0 (_data_->full_jid);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleFileTransferModuleIsAvailableData, _data_);
}

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

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

void
xmpp_xep_jingle_file_transfer_module_is_available (XmppXepJingleFileTransferModule* self,
                                                   XmppXmppStream* stream,
                                                   XmppJid* full_jid,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_)
{
	XmppXepJingleFileTransferModuleIsAvailableData* _data_;
	XmppXepJingleFileTransferModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppJid* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (full_jid != NULL);
	_data_ = g_slice_new0 (XmppXepJingleFileTransferModuleIsAvailableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_file_transfer_module_is_available_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (full_jid);
	_xmpp_jid_unref0 (_data_->full_jid);
	_data_->full_jid = _tmp2_;
	xmpp_xep_jingle_file_transfer_module_is_available_co (_data_);
}

gboolean
xmpp_xep_jingle_file_transfer_module_is_available_finish (XmppXepJingleFileTransferModule* self,
                                                          GAsyncResult* _res_)
{
	gboolean result;
	XmppXepJingleFileTransferModuleIsAvailableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_module_is_available_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_)
{
	XmppXepJingleFileTransferModuleIsAvailableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_file_transfer_module_is_available_co (_data_);
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

static gboolean
xmpp_xep_jingle_file_transfer_module_is_available_co (XmppXepJingleFileTransferModuleIsAvailableData* _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_ = xmpp_xep_service_discovery_module_IDENTITY;
	_data_->_tmp1_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp0_);
	_data_->_tmp2_ = (XmppXepServiceDiscoveryModule*) _data_->_tmp1_;
	_data_->_state_ = 1;
	xmpp_xep_service_discovery_module_has_entity_feature (_data_->_tmp2_, _data_->stream, _data_->full_jid, XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, xmpp_xep_jingle_file_transfer_module_is_available_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = xmpp_xep_service_discovery_module_has_entity_feature_finish (_data_->_tmp2_, _data_->_res_);
	_data_->_tmp4_ = __bool_dup0 (&_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_g_object_unref0 (_data_->_tmp2_);
	_data_->has_feature = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->has_feature;
	if (_data_->_tmp7_ == NULL) {
		_data_->_tmp6_ = TRUE;
	} else {
		_data_->_tmp8_ = _data_->has_feature;
		_data_->_tmp6_ = !((gboolean) (*_data_->_tmp8_));
	}
	if (_data_->_tmp6_) {
		_data_->result = FALSE;
		_g_free0 (_data_->has_feature);
		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_->_tmp9_ = xmpp_xep_jingle_module_IDENTITY;
	_data_->_tmp10_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp9_);
	_data_->_tmp11_ = (XmppXepJingleModule*) _data_->_tmp10_;
	_data_->_tmp12_ = xmpp_xep_jingle_content_type_get_required_transport_type ((XmppXepJingleContentType*) _data_->self);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = xmpp_xep_jingle_content_type_get_required_components ((XmppXepJingleContentType*) _data_->self);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_state_ = 2;
	xmpp_xep_jingle_module_is_available (_data_->_tmp11_, _data_->stream, _data_->_tmp13_, _data_->_tmp15_, _data_->full_jid, xmpp_xep_jingle_file_transfer_module_is_available_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp16_ = xmpp_xep_jingle_module_is_available_finish (_data_->_tmp11_, _data_->_res_);
	_g_object_unref0 (_data_->_tmp11_);
	_data_->result = _data_->_tmp16_;
	_g_free0 (_data_->has_feature);
	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
xmpp_xep_jingle_file_transfer_module_offer_file_stream_data_free (gpointer _data)
{
	XmppXepJingleFileTransferModuleOfferFileStreamData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_jid_unref0 (_data_->receiver_full_jid);
	_g_object_unref0 (_data_->input_stream);
	_g_free0 (_data_->basename);
	_g_free0 (_data_->precondition_name);
	_g_object_unref0 (_data_->precondition_options);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleFileTransferModuleOfferFileStreamData, _data_);
}

void
xmpp_xep_jingle_file_transfer_module_offer_file_stream (XmppXepJingleFileTransferModule* self,
                                                        XmppXmppStream* stream,
                                                        XmppJid* receiver_full_jid,
                                                        GInputStream* input_stream,
                                                        const gchar* basename,
                                                        gint64 size,
                                                        const gchar* precondition_name,
                                                        GObject* precondition_options,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_)
{
	XmppXepJingleFileTransferModuleOfferFileStreamData* _data_;
	XmppXepJingleFileTransferModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppJid* _tmp2_;
	GInputStream* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GObject* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (receiver_full_jid != NULL);
	g_return_if_fail (input_stream != NULL);
	g_return_if_fail (basename != NULL);
	_data_ = g_slice_new0 (XmppXepJingleFileTransferModuleOfferFileStreamData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_file_transfer_module_offer_file_stream_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (receiver_full_jid);
	_xmpp_jid_unref0 (_data_->receiver_full_jid);
	_data_->receiver_full_jid = _tmp2_;
	_tmp3_ = _g_object_ref0 (input_stream);
	_g_object_unref0 (_data_->input_stream);
	_data_->input_stream = _tmp3_;
	_tmp4_ = g_strdup (basename);
	_g_free0 (_data_->basename);
	_data_->basename = _tmp4_;
	_data_->size = size;
	_tmp5_ = g_strdup (precondition_name);
	_g_free0 (_data_->precondition_name);
	_data_->precondition_name = _tmp5_;
	_tmp6_ = _g_object_ref0 (precondition_options);
	_g_object_unref0 (_data_->precondition_options);
	_data_->precondition_options = _tmp6_;
	xmpp_xep_jingle_file_transfer_module_offer_file_stream_co (_data_);
}

void
xmpp_xep_jingle_file_transfer_module_offer_file_stream_finish (XmppXepJingleFileTransferModule* self,
                                                               GAsyncResult* _res_,
                                                               GError** error)
{
	XmppXepJingleFileTransferModuleOfferFileStreamData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static Block12Data*
block12_data_ref (Block12Data* _data12_)
{
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}

static void
block12_data_unref (void * _userdata_)
{
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		XmppXepJingleFileTransferModule* self;
		self = _data12_->self;
		_g_object_unref0 (_data12_->content);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}

static void
xmpp_xep_jingle_file_transfer_module_offer_file_stream_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_)
{
	XmppXepJingleFileTransferModuleOfferFileStreamData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_file_transfer_module_offer_file_stream_co (_data_);
}

static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		XmppXepJingleFileTransferModule* self;
		self = _data13_->_data12_->self;
		block12_data_unref (_data13_->_data12_);
		_data13_->_data12_ = NULL;
		g_slice_free (Block13Data, _data13_);
	}
}

static gboolean
_xmpp_xep_jingle_file_transfer_module_offer_file_stream_co_gsource_func (gpointer self)
{
	gboolean result;
	result = xmpp_xep_jingle_file_transfer_module_offer_file_stream_co (self);
	return result;
}

static void
___lambda28_ (Block13Data* _data13_)
{
	Block12Data* _data12_;
	XmppXepJingleFileTransferModule* self;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContentState _tmp1_;
	XmppXepJingleContentState _tmp2_;
	_data12_ = _data13_->_data12_;
	self = _data12_->self;
	_tmp0_ = _data12_->content;
	_tmp1_ = xmpp_xep_jingle_content_get_state (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == XMPP_XEP_JINGLE_CONTENT_STATE_ACCEPTED) {
		XmppXepJingleContent* _tmp3_;
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _xmpp_xep_jingle_file_transfer_module_offer_file_stream_co_gsource_func, _data12_->_async_data_, NULL);
		_tmp3_ = _data12_->content;
		g_signal_handler_disconnect ((GObject*) _tmp3_, _data13_->content_notify_id);
	}
}

static void
____lambda28__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	___lambda28_ (self);
}

static gboolean
xmpp_xep_jingle_file_transfer_module_offer_file_stream_co (XmppXepJingleFileTransferModuleOfferFileStreamData* _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_->_data12_ = g_slice_new0 (Block12Data);
	_data_->_data12_->_ref_count_ = 1;
	_data_->_data12_->self = g_object_ref (_data_->self);
	_data_->_data12_->_async_data_ = _data_;
	_data_->_tmp0_ = xmpp_stanza_node_new_build ("description", XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, NULL, NULL);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = xmpp_stanza_node_new_build ("file", XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, NULL, NULL);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = xmpp_stanza_node_new_build ("name", XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, NULL, NULL);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = xmpp_stanza_node_new_text (_data_->basename);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = xmpp_stanza_node_put_node (_data_->_tmp7_, _data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = xmpp_stanza_node_put_node (_data_->_tmp5_, _data_->_tmp11_);
	_xmpp_stanza_entry_unref0 (_data_->file_node);
	_data_->file_node = _data_->_tmp12_;
	_data_->_tmp13_ = _data_->file_node;
	_data_->_tmp14_ = xmpp_stanza_node_put_node (_data_->_tmp3_, _data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_xmpp_stanza_entry_unref0 (_data_->_tmp11_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp9_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp7_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp3_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp1_);
	_data_->description = _data_->_tmp15_;
	if (_data_->size > ((gint64) 0)) {
		_data_->_tmp16_ = _data_->file_node;
		_data_->_tmp17_ = xmpp_stanza_node_new_build ("size", XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, NULL, NULL);
		_data_->_tmp18_ = _data_->_tmp17_;
		_data_->_tmp19_ = g_strdup_printf ("%" G_GINT64_FORMAT, _data_->size);
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_tmp21_ = xmpp_stanza_node_new_text (_data_->_tmp20_);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp23_ = xmpp_stanza_node_put_node (_data_->_tmp18_, _data_->_tmp22_);
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_tmp25_ = xmpp_stanza_node_put_node (_data_->_tmp16_, _data_->_tmp24_);
		_data_->_tmp26_ = _data_->_tmp25_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp26_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp24_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp22_);
		_g_free0 (_data_->_tmp20_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp18_);
	} else {
		g_warning ("0234_jingle_file_transfer.vala:56: Sending file %s without size, likel" \
"y going to cause problems down the road...", _data_->basename);
	}
	_data_->_tmp27_ = _data_->description;
	_data_->_tmp28_ = xmpp_xep_jingle_file_transfer_parameters_parse (_data_->self, _data_->_tmp27_, &_data_->_inner_error0_);
	_data_->parameters = _data_->_tmp28_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = 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_->_tmp29_ = xmpp_xep_jingle_module_IDENTITY;
	_data_->_tmp30_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp29_);
	_data_->jingle_module = (XmppXepJingleModule*) _data_->_tmp30_;
	_data_->_tmp31_ = _data_->jingle_module;
	_data_->_tmp32_ = xmpp_xep_jingle_content_type_get_required_transport_type ((XmppXepJingleContentType*) _data_->self);
	_data_->_tmp33_ = _data_->_tmp32_;
	_data_->_tmp34_ = xmpp_xep_jingle_content_type_get_required_components ((XmppXepJingleContentType*) _data_->self);
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_tmp36_ = gee_set_empty (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_state_ = 1;
	xmpp_xep_jingle_module_select_transport (_data_->_tmp31_, _data_->stream, _data_->_tmp33_, _data_->_tmp35_, _data_->receiver_full_jid, _data_->_tmp37_, xmpp_xep_jingle_file_transfer_module_offer_file_stream_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp38_ = xmpp_xep_jingle_module_select_transport_finish (_data_->_tmp31_, _data_->_res_);
	_data_->_tmp39_ = _data_->_tmp38_;
	_g_object_unref0 (_data_->_tmp37_);
	_data_->transport = _data_->_tmp39_;
	_data_->_tmp40_ = _data_->transport;
	if (_data_->_tmp40_ == NULL) {
		_data_->_tmp41_ = g_error_new_literal (XMPP_XEP_JINGLE_ERROR, XMPP_XEP_JINGLE_ERROR_NO_SHARED_PROTOCOLS, "No suitable transports");
		_data_->_inner_error0_ = _data_->_tmp41_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = 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_->_tmp42_ = _data_->jingle_module;
	_data_->_tmp43_ = xmpp_xep_jingle_module_get_security_precondition (_data_->_tmp42_, _data_->precondition_name);
	_data_->precondition = _data_->_tmp43_;
	if (_data_->precondition_name != NULL) {
		_data_->_tmp45_ = _data_->precondition;
		_data_->_tmp44_ = _data_->_tmp45_ == NULL;
	} else {
		_data_->_tmp44_ = FALSE;
	}
	if (_data_->_tmp44_) {
		_data_->_tmp46_ = g_error_new_literal (XMPP_XEP_JINGLE_ERROR, XMPP_XEP_JINGLE_ERROR_UNSUPPORTED_SECURITY, "No suitable security precondiiton found");
		_data_->_inner_error0_ = _data_->_tmp46_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = 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_->_tmp47_ = xmpp_bind_flag_IDENTITY;
	_data_->_tmp48_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp47_);
	_data_->_tmp49_ = (XmppBindFlag*) _data_->_tmp48_;
	_data_->_tmp50_ = _data_->_tmp49_->my_jid;
	_data_->_tmp51_ = _xmpp_jid_ref0 (_data_->_tmp50_);
	_data_->_tmp52_ = _data_->_tmp51_;
	_g_object_unref0 (_data_->_tmp49_);
	_data_->my_jid = _data_->_tmp52_;
	_data_->_tmp53_ = _data_->my_jid;
	if (_data_->_tmp53_ == NULL) {
		_data_->_tmp54_ = g_error_new_literal (XMPP_XEP_JINGLE_ERROR, XMPP_XEP_JINGLE_ERROR_GENERAL, "Couldn't determine own JID");
		_data_->_inner_error0_ = _data_->_tmp54_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_jid_unref0 (_data_->my_jid);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_jid_unref0 (_data_->my_jid);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = 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_->_tmp55_ = _data_->transport;
	_data_->_tmp56_ = xmpp_xep_jingle_content_type_get_required_components ((XmppXepJingleContentType*) _data_->self);
	_data_->_tmp57_ = _data_->_tmp56_;
	_data_->_tmp58_ = _data_->my_jid;
	_data_->_tmp59_ = xmpp_xep_jingle_transport_create_transport_parameters (_data_->_tmp55_, _data_->stream, _data_->_tmp57_, _data_->_tmp58_, _data_->receiver_full_jid, &_data_->_inner_error0_);
	_data_->transport_params = _data_->_tmp59_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_jid_unref0 (_data_->my_jid);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_jid_unref0 (_data_->my_jid);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = 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_->_tmp61_ = _data_->precondition;
	if (_data_->_tmp61_ != NULL) {
		_data_->_tmp62_ = _data_->precondition;
		_data_->_tmp63_ = _data_->my_jid;
		_data_->_tmp64_ = xmpp_xep_jingle_security_precondition_create_security_parameters (_data_->_tmp62_, _data_->stream, _data_->_tmp63_, _data_->receiver_full_jid, _data_->precondition_options, &_data_->_inner_error0_);
		_g_object_unref0 (_data_->_tmp60_);
		_data_->_tmp60_ = _data_->_tmp64_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->_tmp60_);
				_g_object_unref0 (_data_->transport_params);
				_xmpp_jid_unref0 (_data_->my_jid);
				_g_object_unref0 (_data_->precondition);
				_g_object_unref0 (_data_->transport);
				_g_object_unref0 (_data_->jingle_module);
				_g_object_unref0 (_data_->parameters);
				_xmpp_stanza_entry_unref0 (_data_->description);
				_xmpp_stanza_entry_unref0 (_data_->file_node);
				block12_data_unref (_data_->_data12_);
				_data_->_data12_ = NULL;
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_object_unref0 (_data_->_tmp60_);
				_g_object_unref0 (_data_->transport_params);
				_xmpp_jid_unref0 (_data_->my_jid);
				_g_object_unref0 (_data_->precondition);
				_g_object_unref0 (_data_->transport);
				_g_object_unref0 (_data_->jingle_module);
				_g_object_unref0 (_data_->parameters);
				_xmpp_stanza_entry_unref0 (_data_->description);
				_xmpp_stanza_entry_unref0 (_data_->file_node);
				block12_data_unref (_data_->_data12_);
				_data_->_data12_ = 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;
			}
		}
	} else {
		_g_object_unref0 (_data_->_tmp60_);
		_data_->_tmp60_ = NULL;
	}
	_data_->_tmp65_ = _data_->_tmp60_;
	_data_->_tmp60_ = NULL;
	_data_->security_params = _data_->_tmp65_;
	_data_->_tmp66_ = _data_->parameters;
	_data_->_tmp67_ = _data_->transport;
	_data_->_tmp68_ = _data_->transport_params;
	_data_->_tmp69_ = _data_->precondition;
	_data_->_tmp70_ = _data_->security_params;
	_data_->_tmp71_ = _data_->my_jid;
	_data_->_tmp72_ = xmpp_xep_jingle_content_new_initiate_sent ("a-file-offer", XMPP_XEP_JINGLE_SENDERS_INITIATOR, (XmppXepJingleContentType*) _data_->self, (XmppXepJingleContentParameters*) _data_->_tmp66_, _data_->_tmp67_, _data_->_tmp68_, _data_->_tmp69_, _data_->_tmp70_, _data_->_tmp71_, _data_->receiver_full_jid);
	_data_->_data12_->content = _data_->_tmp72_;
	_data_->_tmp73_ = gee_array_list_new (XMPP_XEP_JINGLE_TYPE_CONTENT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data_->contents = _data_->_tmp73_;
	_data_->_tmp74_ = _data_->contents;
	_data_->_tmp75_ = _data_->_data12_->content;
	gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp74_, _data_->_tmp75_);
	_data_->session = NULL;
	{
		_data_->_data13_ = g_slice_new0 (Block13Data);
		_data_->_data13_->_ref_count_ = 1;
		_data_->_data13_->_data12_ = block12_data_ref (_data_->_data12_);
		_data_->_tmp77_ = _data_->jingle_module;
		_data_->_tmp78_ = _data_->contents;
		_data_->_state_ = 2;
		xmpp_xep_jingle_module_create_session (_data_->_tmp77_, _data_->stream, (GeeList*) _data_->_tmp78_, _data_->receiver_full_jid, NULL, NULL, xmpp_xep_jingle_file_transfer_module_offer_file_stream_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp79_ = xmpp_xep_jingle_module_create_session_finish (_data_->_tmp77_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp76_ = _data_->_tmp79_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block13_data_unref (_data_->_data13_);
			_data_->_data13_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp80_ = _data_->_tmp76_;
		_data_->_tmp76_ = NULL;
		_g_object_unref0 (_data_->session);
		_data_->session = _data_->_tmp80_;
		_data_->_data13_->content_notify_id = (gulong) 0;
		_data_->_tmp81_ = _data_->_data12_->content;
		_data_->_tmp82_ = g_signal_connect_data ((GObject*) _data_->_tmp81_, "notify::state", (GCallback) ____lambda28__g_object_notify, block13_data_ref (_data_->_data13_), (GClosureNotify) block13_data_unref, 0);
		_data_->_data13_->content_notify_id = _data_->_tmp82_;
		_data_->_state_ = 3;
		return FALSE;
		_state_3:
		;
		_data_->_tmp83_ = _data_->_data12_->content;
		_data_->_tmp84_ = _data_->_tmp83_->component_connections;
		_data_->_tmp85_ = gee_map_get (_data_->_tmp84_, (gpointer) ((guintptr) 1));
		_data_->_tmp86_ = (XmppXepJingleComponentConnection*) _data_->_tmp85_;
		_data_->_tmp87_ = XMPP_XEP_JINGLE_IS_STREAMING_CONNECTION (_data_->_tmp86_) ? ((XmppXepJingleStreamingConnection*) _data_->_tmp86_) : NULL;
		if (_data_->_tmp87_ == NULL) {
			_g_object_unref0 (_data_->_tmp86_);
		}
		_data_->connection = _data_->_tmp87_;
		_data_->_tmp89_ = _data_->connection;
		if (_data_->_tmp89_ == NULL) {
			_data_->_tmp88_ = TRUE;
		} else {
			_data_->_tmp90_ = _data_->connection;
			_data_->_tmp91_ = xmpp_xep_jingle_streaming_connection_get_stream (_data_->_tmp90_);
			_data_->_tmp92_ = _data_->_tmp91_;
			_data_->_tmp88_ = _data_->_tmp92_ == NULL;
		}
		if (_data_->_tmp88_) {
			g_warning ("0234_jingle_file_transfer.vala:105: Connection or stream not null");
			_g_object_unref0 (_data_->connection);
			_g_object_unref0 (_data_->_tmp76_);
			block13_data_unref (_data_->_data13_);
			_data_->_data13_ = NULL;
			_g_object_unref0 (_data_->session);
			_g_object_unref0 (_data_->contents);
			_g_object_unref0 (_data_->security_params);
			_g_object_unref0 (_data_->_tmp60_);
			_g_object_unref0 (_data_->transport_params);
			_xmpp_jid_unref0 (_data_->my_jid);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = 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_->_tmp93_ = _data_->connection;
		_data_->_tmp94_ = xmpp_xep_jingle_streaming_connection_get_stream (_data_->_tmp93_);
		_data_->_tmp95_ = _data_->_tmp94_;
		_data_->_state_ = 4;
		gee_future_wait_async (_data_->_tmp95_, xmpp_xep_jingle_file_transfer_module_offer_file_stream_ready, _data_);
		return FALSE;
		_state_4:
		_data_->_tmp96_ = gee_future_wait_finish (_data_->_tmp95_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp97_ = _g_object_ref0 ((GIOStream*) _data_->_tmp96_);
		_data_->io_stream = _data_->_tmp97_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->connection);
			_g_object_unref0 (_data_->_tmp76_);
			block13_data_unref (_data_->_data13_);
			_data_->_data13_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp98_ = _data_->io_stream;
		_data_->_tmp99_ = g_io_stream_get_input_stream (_data_->_tmp98_);
		_data_->_tmp100_ = _data_->_tmp99_;
		_data_->_state_ = 5;
		g_input_stream_close_async (_data_->_tmp100_, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_file_transfer_module_offer_file_stream_ready, _data_);
		return FALSE;
		_state_5:
		g_input_stream_close_finish (_data_->_tmp100_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->io_stream);
			_g_object_unref0 (_data_->connection);
			_g_object_unref0 (_data_->_tmp76_);
			block13_data_unref (_data_->_data13_);
			_data_->_data13_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp101_ = _data_->io_stream;
		_data_->_tmp102_ = g_io_stream_get_output_stream (_data_->_tmp101_);
		_data_->_tmp103_ = _data_->_tmp102_;
		_data_->_state_ = 6;
		g_output_stream_splice_async (_data_->_tmp103_, _data_->input_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_file_transfer_module_offer_file_stream_ready, _data_);
		return FALSE;
		_state_6:
		g_output_stream_splice_finish (_data_->_tmp103_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->io_stream);
			_g_object_unref0 (_data_->connection);
			_g_object_unref0 (_data_->_tmp76_);
			block13_data_unref (_data_->_data13_);
			_data_->_data13_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp104_ = _data_->connection;
		_data_->_state_ = 7;
		xmpp_xep_jingle_component_connection_terminate ((XmppXepJingleComponentConnection*) _data_->_tmp104_, TRUE, NULL, NULL, xmpp_xep_jingle_file_transfer_module_offer_file_stream_ready, _data_);
		return FALSE;
		_state_7:
		xmpp_xep_jingle_component_connection_terminate_finish ((XmppXepJingleComponentConnection*) _data_->_tmp104_, _data_->_res_);
		_g_object_unref0 (_data_->io_stream);
		_g_object_unref0 (_data_->connection);
		_g_object_unref0 (_data_->_tmp76_);
		block13_data_unref (_data_->_data13_);
		_data_->_data13_ = NULL;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp105_ = _data_->session;
		if (_data_->_tmp105_ != NULL) {
			_data_->_tmp106_ = _data_->session;
			_data_->_tmp107_ = _data_->e;
			_data_->_tmp108_ = _data_->_tmp107_->message;
			_data_->_tmp109_ = _data_->e;
			_data_->_tmp110_ = _data_->_tmp109_->message;
			xmpp_xep_jingle_session_terminate (_data_->_tmp106_, XMPP_XEP_JINGLE_REASON_ELEMENT_FAILED_TRANSPORT, _data_->_tmp108_, _data_->_tmp110_);
		}
		_data_->_tmp111_ = _data_->e;
		_data_->_tmp112_ = _data_->_tmp111_->message;
		_data_->_tmp113_ = g_error_new (XMPP_XEP_JINGLE_ERROR, XMPP_XEP_JINGLE_ERROR_GENERAL, "Couldn't send file via Jingle: %s", _data_->_tmp112_);
		_data_->_inner_error0_ = _data_->_tmp113_;
		_g_error_free0 (_data_->e);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->session);
			_g_object_unref0 (_data_->contents);
			_g_object_unref0 (_data_->security_params);
			_g_object_unref0 (_data_->_tmp60_);
			_g_object_unref0 (_data_->transport_params);
			_xmpp_jid_unref0 (_data_->my_jid);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->session);
			_g_object_unref0 (_data_->contents);
			_g_object_unref0 (_data_->security_params);
			_g_object_unref0 (_data_->_tmp60_);
			_g_object_unref0 (_data_->transport_params);
			_xmpp_jid_unref0 (_data_->my_jid);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->transport);
			_g_object_unref0 (_data_->jingle_module);
			_g_object_unref0 (_data_->parameters);
			_xmpp_stanza_entry_unref0 (_data_->description);
			_xmpp_stanza_entry_unref0 (_data_->file_node);
			block12_data_unref (_data_->_data12_);
			_data_->_data12_ = 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_object_unref0 (_data_->session);
	_g_object_unref0 (_data_->contents);
	_g_object_unref0 (_data_->security_params);
	_g_object_unref0 (_data_->_tmp60_);
	_g_object_unref0 (_data_->transport_params);
	_xmpp_jid_unref0 (_data_->my_jid);
	_g_object_unref0 (_data_->precondition);
	_g_object_unref0 (_data_->transport);
	_g_object_unref0 (_data_->jingle_module);
	_g_object_unref0 (_data_->parameters);
	_xmpp_stanza_entry_unref0 (_data_->description);
	_xmpp_stanza_entry_unref0 (_data_->file_node);
	block12_data_unref (_data_->_data12_);
	_data_->_data12_ = 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 gchar*
xmpp_xep_jingle_file_transfer_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppXepJingleFileTransferModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppXepJingleFileTransferModule*) base;
	_tmp0_ = g_strdup (XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_xep_jingle_file_transfer_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppXepJingleFileTransferModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppXepJingleFileTransferModule*) base;
	_tmp0_ = xmpp_xep_jingle_file_transfer_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

XmppXepJingleFileTransferModule*
xmpp_xep_jingle_file_transfer_module_construct (GType object_type)
{
	XmppXepJingleFileTransferModule * self = NULL;
	self = (XmppXepJingleFileTransferModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppXepJingleFileTransferModule*
xmpp_xep_jingle_file_transfer_module_new (void)
{
	return xmpp_xep_jingle_file_transfer_module_construct (XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_MODULE);
}

static const gchar*
xmpp_xep_jingle_file_transfer_module_real_get_ns_uri (XmppXepJingleContentType* base)
{
	const gchar* result;
	XmppXepJingleFileTransferModule* self;
	self = (XmppXepJingleFileTransferModule*) base;
	result = XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI;
	return result;
}

static XmppXepJingleTransportType
xmpp_xep_jingle_file_transfer_module_real_get_required_transport_type (XmppXepJingleContentType* base)
{
	XmppXepJingleTransportType result;
	XmppXepJingleFileTransferModule* self;
	self = (XmppXepJingleFileTransferModule*) base;
	result = XMPP_XEP_JINGLE_TRANSPORT_TYPE_STREAMING;
	return result;
}

static guint8
xmpp_xep_jingle_file_transfer_module_real_get_required_components (XmppXepJingleContentType* base)
{
	guint8 result;
	XmppXepJingleFileTransferModule* self;
	self = (XmppXepJingleFileTransferModule*) base;
	result = (guint8) 1;
	return result;
}

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
xmpp_xep_jingle_file_transfer_module_class_init (XmppXepJingleFileTransferModuleClass * klass,
                                                 gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_xep_jingle_file_transfer_module_parent_class = g_type_class_peek_parent (klass);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_jingle_file_transfer_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_jingle_file_transfer_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_jingle_file_transfer_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_jingle_file_transfer_module_real_get_id;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_file_transfer_module_get_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_file_transfer_module_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_NS_URI_PROPERTY, xmpp_xep_jingle_file_transfer_module_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_NS_URI_PROPERTY] = g_param_spec_string ("ns-uri", "ns-uri", "ns-uri", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_REQUIRED_TRANSPORT_TYPE_PROPERTY, xmpp_xep_jingle_file_transfer_module_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_REQUIRED_TRANSPORT_TYPE_PROPERTY] = g_param_spec_enum ("required-transport-type", "required-transport-type", "required-transport-type", XMPP_XEP_JINGLE_TYPE_TRANSPORT_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_REQUIRED_COMPONENTS_PROPERTY, xmpp_xep_jingle_file_transfer_module_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_REQUIRED_COMPONENTS_PROPERTY] = g_param_spec_uchar ("required-components", "required-components", "required-components", 0, G_MAXUINT8, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	xmpp_xep_jingle_file_transfer_module_signals[XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_FILE_INCOMING_SIGNAL] = g_signal_new ("file-incoming", XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_MODULE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, XMPP_TYPE_XMPP_STREAM, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER);
	_tmp0_ = xmpp_module_identity_new (XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, "0234_jingle_file_transfer");
	xmpp_xep_jingle_file_transfer_module_IDENTITY = _tmp0_;
}

static void
xmpp_xep_jingle_file_transfer_module_xmpp_xep_jingle_content_type_interface_init (XmppXepJingleContentTypeIface * iface,
                                                                                  gpointer iface_data)
{
	xmpp_xep_jingle_file_transfer_module_xmpp_xep_jingle_content_type_parent_iface = g_type_interface_peek_parent (iface);
	iface->parse_content_parameters = (XmppXepJingleContentParameters* (*) (XmppXepJingleContentType*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_file_transfer_module_real_parse_content_parameters;
	iface->get_ns_uri = xmpp_xep_jingle_file_transfer_module_real_get_ns_uri;
	iface->get_required_transport_type = xmpp_xep_jingle_file_transfer_module_real_get_required_transport_type;
	iface->get_required_components = xmpp_xep_jingle_file_transfer_module_real_get_required_components;
}

static void
xmpp_xep_jingle_file_transfer_module_instance_init (XmppXepJingleFileTransferModule * self,
                                                    gpointer klass)
{
	XmppXepJingleFileTransferSessionInfoType* _tmp0_;
	_tmp0_ = xmpp_xep_jingle_file_transfer_session_info_type_new ();
	self->session_info_type = _tmp0_;
}

static void
xmpp_xep_jingle_file_transfer_module_finalize (GObject * obj)
{
	XmppXepJingleFileTransferModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_MODULE, XmppXepJingleFileTransferModule);
	_g_object_unref0 (self->session_info_type);
	G_OBJECT_CLASS (xmpp_xep_jingle_file_transfer_module_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_file_transfer_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleFileTransferModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_file_transfer_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleFileTransferModule), 0, (GInstanceInitFunc) xmpp_xep_jingle_file_transfer_module_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_content_type_info = { (GInterfaceInitFunc) xmpp_xep_jingle_file_transfer_module_xmpp_xep_jingle_content_type_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_file_transfer_module_type_id;
	xmpp_xep_jingle_file_transfer_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppXepJingleFileTransferModule", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_file_transfer_module_type_id, XMPP_XEP_JINGLE_TYPE_CONTENT_TYPE, &xmpp_xep_jingle_content_type_info);
	return xmpp_xep_jingle_file_transfer_module_type_id;
}

GType
xmpp_xep_jingle_file_transfer_module_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_file_transfer_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_file_transfer_module_type_id__once)) {
		GType xmpp_xep_jingle_file_transfer_module_type_id;
		xmpp_xep_jingle_file_transfer_module_type_id = xmpp_xep_jingle_file_transfer_module_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_file_transfer_module_type_id__once, xmpp_xep_jingle_file_transfer_module_type_id);
	}
	return xmpp_xep_jingle_file_transfer_module_type_id__once;
}

static void
_vala_xmpp_xep_jingle_file_transfer_module_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	XmppXepJingleFileTransferModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_MODULE, XmppXepJingleFileTransferModule);
	switch (property_id) {
		case XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_NS_URI_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_content_type_get_ns_uri ((XmppXepJingleContentType*) self));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_REQUIRED_TRANSPORT_TYPE_PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_content_type_get_required_transport_type ((XmppXepJingleContentType*) self));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_REQUIRED_COMPONENTS_PROPERTY:
		g_value_set_uchar (value, xmpp_xep_jingle_content_type_get_required_components ((XmppXepJingleContentType*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_session_info_type_real_handle_content_session_info (XmppXepJingleSessionInfoNs* base,
                                                                                  XmppXmppStream* stream,
                                                                                  XmppXepJingleSession* session,
                                                                                  XmppStanzaNode* info,
                                                                                  XmppIqStanza* iq,
                                                                                  GError** error)
{
	XmppXepJingleFileTransferSessionInfoType * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	GError* _inner_error0_ = NULL;
	self = (XmppXepJingleFileTransferSessionInfoType*) base;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	g_return_if_fail (info != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = ((XmppStanzaEntry*) info)->name;
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("received")))) {
		switch (0) {
			default:
			{
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("checksum")))) {
		switch (0) {
			default:
			{
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				gchar* _tmp6_;
				gchar* _tmp7_;
				GError* _tmp8_;
				GError* _tmp9_;
				_tmp4_ = ((XmppStanzaEntry*) info)->name;
				_tmp5_ = string_to_string (_tmp4_);
				_tmp6_ = g_strconcat ("unsupported file transfer info ", _tmp5_, NULL);
				_tmp7_ = _tmp6_;
				_tmp8_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_UNSUPPORTED_INFO, _tmp7_);
				_tmp9_ = _tmp8_;
				_g_free0 (_tmp7_);
				_inner_error0_ = _tmp9_;
				if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
					g_propagate_error (error, _inner_error0_);
					return;
				} else {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
			}
		}
	}
}

XmppXepJingleFileTransferSessionInfoType*
xmpp_xep_jingle_file_transfer_session_info_type_construct (GType object_type)
{
	XmppXepJingleFileTransferSessionInfoType * self = NULL;
	self = (XmppXepJingleFileTransferSessionInfoType*) g_object_new (object_type, NULL);
	return self;
}

XmppXepJingleFileTransferSessionInfoType*
xmpp_xep_jingle_file_transfer_session_info_type_new (void)
{
	return xmpp_xep_jingle_file_transfer_session_info_type_construct (XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_SESSION_INFO_TYPE);
}

static const gchar*
xmpp_xep_jingle_file_transfer_session_info_type_real_get_ns_uri (XmppXepJingleSessionInfoNs* base)
{
	const gchar* result;
	XmppXepJingleFileTransferSessionInfoType* self;
	self = (XmppXepJingleFileTransferSessionInfoType*) base;
	result = XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_session_info_type_class_init (XmppXepJingleFileTransferSessionInfoTypeClass * klass,
                                                            gpointer klass_data)
{
	xmpp_xep_jingle_file_transfer_session_info_type_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_file_transfer_session_info_type_get_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_SESSION_INFO_TYPE_NS_URI_PROPERTY, xmpp_xep_jingle_file_transfer_session_info_type_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_SESSION_INFO_TYPE_NS_URI_PROPERTY] = g_param_spec_string ("ns-uri", "ns-uri", "ns-uri", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_xep_jingle_file_transfer_session_info_type_xmpp_xep_jingle_session_info_ns_interface_init (XmppXepJingleSessionInfoNsIface * iface,
                                                                                                gpointer iface_data)
{
	xmpp_xep_jingle_file_transfer_session_info_type_xmpp_xep_jingle_session_info_ns_parent_iface = g_type_interface_peek_parent (iface);
	iface->handle_content_session_info = (void (*) (XmppXepJingleSessionInfoNs*, XmppXmppStream*, XmppXepJingleSession*, XmppStanzaNode*, XmppIqStanza*, GError**)) xmpp_xep_jingle_file_transfer_session_info_type_real_handle_content_session_info;
	iface->get_ns_uri = xmpp_xep_jingle_file_transfer_session_info_type_real_get_ns_uri;
}

static void
xmpp_xep_jingle_file_transfer_session_info_type_instance_init (XmppXepJingleFileTransferSessionInfoType * self,
                                                               gpointer klass)
{
}

static GType
xmpp_xep_jingle_file_transfer_session_info_type_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleFileTransferSessionInfoTypeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_file_transfer_session_info_type_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleFileTransferSessionInfoType), 0, (GInstanceInitFunc) xmpp_xep_jingle_file_transfer_session_info_type_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_session_info_ns_info = { (GInterfaceInitFunc) xmpp_xep_jingle_file_transfer_session_info_type_xmpp_xep_jingle_session_info_ns_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_file_transfer_session_info_type_type_id;
	xmpp_xep_jingle_file_transfer_session_info_type_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleFileTransferSessionInfoType", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_file_transfer_session_info_type_type_id, XMPP_XEP_JINGLE_TYPE_SESSION_INFO_NS, &xmpp_xep_jingle_session_info_ns_info);
	return xmpp_xep_jingle_file_transfer_session_info_type_type_id;
}

GType
xmpp_xep_jingle_file_transfer_session_info_type_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_file_transfer_session_info_type_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_file_transfer_session_info_type_type_id__once)) {
		GType xmpp_xep_jingle_file_transfer_session_info_type_type_id;
		xmpp_xep_jingle_file_transfer_session_info_type_type_id = xmpp_xep_jingle_file_transfer_session_info_type_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_file_transfer_session_info_type_type_id__once, xmpp_xep_jingle_file_transfer_session_info_type_type_id);
	}
	return xmpp_xep_jingle_file_transfer_session_info_type_type_id__once;
}

static void
_vala_xmpp_xep_jingle_file_transfer_session_info_type_get_property (GObject * object,
                                                                    guint property_id,
                                                                    GValue * value,
                                                                    GParamSpec * pspec)
{
	XmppXepJingleFileTransferSessionInfoType * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_SESSION_INFO_TYPE, XmppXepJingleFileTransferSessionInfoType);
	switch (property_id) {
		case XMPP_XEP_JINGLE_FILE_TRANSFER_SESSION_INFO_TYPE_NS_URI_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_session_info_ns_get_ns_uri ((XmppXepJingleSessionInfoNs*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
xmpp_xep_jingle_file_transfer_parameters_get_instance_private (XmppXepJingleFileTransferParameters* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleFileTransferParameters_private_offset);
}

XmppXepJingleFileTransferParameters*
xmpp_xep_jingle_file_transfer_parameters_construct (GType object_type,
                                                    XmppXepJingleFileTransferModule* parent,
                                                    XmppStanzaNode* original_description,
                                                    const gchar* media_type,
                                                    const gchar* name,
                                                    gint64 size)
{
	XmppXepJingleFileTransferParameters * self = NULL;
	XmppXepJingleFileTransferModule* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (original_description != NULL, NULL);
	self = (XmppXepJingleFileTransferParameters*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (self->priv->parent);
	self->priv->parent = _tmp0_;
	xmpp_xep_jingle_file_transfer_parameters_set_original_description (self, original_description);
	_tmp1_ = g_strdup (media_type);
	_g_free0 (self->priv->media_type);
	self->priv->media_type = _tmp1_;
	xmpp_xep_jingle_file_transfer_parameters_set_name (self, name);
	xmpp_xep_jingle_file_transfer_parameters_set_size (self, size);
	return self;
}

XmppXepJingleFileTransferParameters*
xmpp_xep_jingle_file_transfer_parameters_new (XmppXepJingleFileTransferModule* parent,
                                              XmppStanzaNode* original_description,
                                              const gchar* media_type,
                                              const gchar* name,
                                              gint64 size)
{
	return xmpp_xep_jingle_file_transfer_parameters_construct (XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_PARAMETERS, parent, original_description, media_type, name, size);
}

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;
}

XmppXepJingleFileTransferParameters*
xmpp_xep_jingle_file_transfer_parameters_parse (XmppXepJingleFileTransferModule* parent,
                                                XmppStanzaNode* description,
                                                GError** error)
{
	GeeList* files = NULL;
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	XmppStanzaNode* file = NULL;
	GeeList* _tmp5_;
	gpointer _tmp6_;
	XmppStanzaNode* media_type_node = NULL;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* name_node = NULL;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* size_node = NULL;
	XmppStanzaNode* _tmp11_;
	XmppStanzaNode* _tmp12_;
	const gchar* _tmp13_ = NULL;
	XmppStanzaNode* _tmp14_;
	gchar* media_type = NULL;
	gchar* _tmp17_;
	const gchar* _tmp18_ = NULL;
	XmppStanzaNode* _tmp19_;
	gchar* name = NULL;
	gchar* _tmp22_;
	const gchar* _tmp23_ = NULL;
	XmppStanzaNode* _tmp24_;
	gchar* size_raw = NULL;
	gchar* _tmp27_;
	const gchar* _tmp28_;
	gint64 size = 0LL;
	const gchar* _tmp30_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	XmppXepJingleFileTransferParameters* _tmp34_;
	GError* _inner_error0_ = NULL;
	XmppXepJingleFileTransferParameters* result;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (description != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_get_subnodes (description, "file", XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, FALSE);
	files = _tmp0_;
	_tmp1_ = files;
	_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != 1) {
		GError* _tmp4_;
		_tmp4_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "there needs to be exactly one file node");
		_inner_error0_ = _tmp4_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (files);
			return NULL;
		} else {
			_g_object_unref0 (files);
			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;
		}
	}
	_tmp5_ = files;
	_tmp6_ = gee_list_get (_tmp5_, 0);
	file = (XmppStanzaNode*) _tmp6_;
	_tmp7_ = file;
	_tmp8_ = xmpp_stanza_node_get_subnode (_tmp7_, "media-type", XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, FALSE);
	media_type_node = _tmp8_;
	_tmp9_ = file;
	_tmp10_ = xmpp_stanza_node_get_subnode (_tmp9_, "name", XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, FALSE);
	name_node = _tmp10_;
	_tmp11_ = file;
	_tmp12_ = xmpp_stanza_node_get_subnode (_tmp11_, "size", XMPP_XEP_JINGLE_FILE_TRANSFER_NS_URI, FALSE);
	size_node = _tmp12_;
	_tmp14_ = media_type_node;
	if (_tmp14_ != NULL) {
		XmppStanzaNode* _tmp15_;
		const gchar* _tmp16_;
		_tmp15_ = media_type_node;
		_tmp16_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp15_);
		_tmp13_ = _tmp16_;
	} else {
		_tmp13_ = NULL;
	}
	_tmp17_ = g_strdup (_tmp13_);
	media_type = _tmp17_;
	_tmp19_ = name_node;
	if (_tmp19_ != NULL) {
		XmppStanzaNode* _tmp20_;
		const gchar* _tmp21_;
		_tmp20_ = name_node;
		_tmp21_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp20_);
		_tmp18_ = _tmp21_;
	} else {
		_tmp18_ = NULL;
	}
	_tmp22_ = g_strdup (_tmp18_);
	name = _tmp22_;
	_tmp24_ = size_node;
	if (_tmp24_ != NULL) {
		XmppStanzaNode* _tmp25_;
		const gchar* _tmp26_;
		_tmp25_ = size_node;
		_tmp26_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp25_);
		_tmp23_ = _tmp26_;
	} else {
		_tmp23_ = NULL;
	}
	_tmp27_ = g_strdup (_tmp23_);
	size_raw = _tmp27_;
	_tmp28_ = size_raw;
	if (_tmp28_ == NULL) {
		GError* _tmp29_;
		_tmp29_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "file offer without file size");
		_inner_error0_ = _tmp29_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (size_raw);
			_g_free0 (name);
			_g_free0 (media_type);
			_xmpp_stanza_entry_unref0 (size_node);
			_xmpp_stanza_entry_unref0 (name_node);
			_xmpp_stanza_entry_unref0 (media_type_node);
			_xmpp_stanza_entry_unref0 (file);
			_g_object_unref0 (files);
			return NULL;
		} else {
			_g_free0 (size_raw);
			_g_free0 (name);
			_g_free0 (media_type);
			_xmpp_stanza_entry_unref0 (size_node);
			_xmpp_stanza_entry_unref0 (name_node);
			_xmpp_stanza_entry_unref0 (media_type_node);
			_xmpp_stanza_entry_unref0 (file);
			_g_object_unref0 (files);
			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_ = size_raw;
	size = int64_parse (_tmp30_, (guint) 0);
	if (size < ((gint64) 0)) {
		GError* _tmp31_;
		_tmp31_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "negative file size is invalid");
		_inner_error0_ = _tmp31_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (size_raw);
			_g_free0 (name);
			_g_free0 (media_type);
			_xmpp_stanza_entry_unref0 (size_node);
			_xmpp_stanza_entry_unref0 (name_node);
			_xmpp_stanza_entry_unref0 (media_type_node);
			_xmpp_stanza_entry_unref0 (file);
			_g_object_unref0 (files);
			return NULL;
		} else {
			_g_free0 (size_raw);
			_g_free0 (name);
			_g_free0 (media_type);
			_xmpp_stanza_entry_unref0 (size_node);
			_xmpp_stanza_entry_unref0 (name_node);
			_xmpp_stanza_entry_unref0 (media_type_node);
			_xmpp_stanza_entry_unref0 (file);
			_g_object_unref0 (files);
			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;
		}
	}
	_tmp32_ = media_type;
	_tmp33_ = name;
	_tmp34_ = xmpp_xep_jingle_file_transfer_parameters_new (parent, description, _tmp32_, _tmp33_, size);
	result = _tmp34_;
	_g_free0 (size_raw);
	_g_free0 (name);
	_g_free0 (media_type);
	_xmpp_stanza_entry_unref0 (size_node);
	_xmpp_stanza_entry_unref0 (name_node);
	_xmpp_stanza_entry_unref0 (media_type_node);
	_xmpp_stanza_entry_unref0 (file);
	_g_object_unref0 (files);
	return result;
}

static gpointer
_xmpp_stanza_entry_ref0 (gpointer self)
{
	return self ? xmpp_stanza_entry_ref (self) : NULL;
}

static XmppStanzaNode*
xmpp_xep_jingle_file_transfer_parameters_real_get_description_node (XmppXepJingleContentParameters* base)
{
	XmppXepJingleFileTransferParameters * self;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* result;
	self = (XmppXepJingleFileTransferParameters*) base;
	_tmp0_ = self->priv->_original_description;
	_tmp1_ = _xmpp_stanza_entry_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content_data_free (gpointer _data)
{
	XmppXepJingleFileTransferParametersHandleProposedContentData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->session);
	_g_object_unref0 (_data_->content);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleFileTransferParametersHandleProposedContentData, _data_);
}

static void
xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content (XmppXepJingleContentParameters* base,
                                                                       XmppXmppStream* stream,
                                                                       XmppXepJingleSession* session,
                                                                       XmppXepJingleContent* content,
                                                                       GAsyncReadyCallback _callback_,
                                                                       gpointer _user_data_)
{
	XmppXepJingleFileTransferParameters * self;
	XmppXepJingleFileTransferParametersHandleProposedContentData* _data_;
	XmppXepJingleFileTransferParameters* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXepJingleSession* _tmp2_;
	XmppXepJingleContent* _tmp3_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	g_return_if_fail (content != NULL);
	self = (XmppXepJingleFileTransferParameters*) base;
	_data_ = g_slice_new0 (XmppXepJingleFileTransferParametersHandleProposedContentData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _g_object_ref0 (session);
	_g_object_unref0 (_data_->session);
	_data_->session = _tmp2_;
	_tmp3_ = _g_object_ref0 (content);
	_g_object_unref0 (_data_->content);
	_data_->content = _tmp3_;
	xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content_co (_data_);
}

static void
xmpp_xep_jingle_file_transfer_parameters_handle_proposed_content_finish (XmppXepJingleContentParameters* base,
                                                                         GAsyncResult* _res_)
{
	XmppXepJingleFileTransferParametersHandleProposedContentData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content_co (XmppXepJingleFileTransferParametersHandleProposedContentData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->parent;
	_data_->_tmp1_ = xmpp_xep_jingle_file_transfer_file_transfer_new (_data_->session, _data_->content, _data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	g_signal_emit (_data_->_tmp0_, xmpp_xep_jingle_file_transfer_module_signals[XMPP_XEP_JINGLE_FILE_TRANSFER_MODULE_FILE_INCOMING_SIGNAL], 0, _data_->stream, _data_->_tmp2_);
	_g_object_unref0 (_data_->_tmp2_);
	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;
}

void
xmpp_xep_jingle_file_transfer_parameters_modify (XmppXepJingleFileTransferParameters* self,
                                                 XmppXmppStream* stream,
                                                 XmppXepJingleSession* session,
                                                 XmppXepJingleContent* content,
                                                 XmppXepJingleSenders senders)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	g_return_if_fail (content != NULL);
}

static void
xmpp_xep_jingle_file_transfer_parameters_real_accept (XmppXepJingleContentParameters* base,
                                                      XmppXmppStream* stream,
                                                      XmppXepJingleSession* session,
                                                      XmppXepJingleContent* content)
{
	XmppXepJingleFileTransferParameters * self;
	self = (XmppXepJingleFileTransferParameters*) base;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	g_return_if_fail (content != NULL);
}

static void
xmpp_xep_jingle_file_transfer_parameters_real_handle_accept (XmppXepJingleContentParameters* base,
                                                             XmppXmppStream* stream,
                                                             XmppXepJingleSession* session,
                                                             XmppXepJingleContent* content,
                                                             XmppStanzaNode* description_node)
{
	XmppXepJingleFileTransferParameters * self;
	self = (XmppXepJingleFileTransferParameters*) base;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	g_return_if_fail (content != NULL);
	g_return_if_fail (description_node != NULL);
}

static void
xmpp_xep_jingle_file_transfer_parameters_real_terminate (XmppXepJingleContentParameters* base,
                                                         gboolean we_terminated,
                                                         const gchar* reason_name,
                                                         const gchar* reason_text)
{
	XmppXepJingleFileTransferParameters * self;
	self = (XmppXepJingleFileTransferParameters*) base;
}

const gchar*
xmpp_xep_jingle_file_transfer_parameters_get_name (XmppXepJingleFileTransferParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_parameters_set_name (XmppXepJingleFileTransferParameters* self,
                                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_file_transfer_parameters_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_file_transfer_parameters_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_NAME_PROPERTY]);
	}
}

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

static void
xmpp_xep_jingle_file_transfer_parameters_set_size (XmppXepJingleFileTransferParameters* self,
                                                   gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_file_transfer_parameters_get_size (self);
	if (old_value != value) {
		self->priv->_size = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_file_transfer_parameters_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_SIZE_PROPERTY]);
	}
}

XmppStanzaNode*
xmpp_xep_jingle_file_transfer_parameters_get_original_description (XmppXepJingleFileTransferParameters* self)
{
	XmppStanzaNode* result;
	XmppStanzaNode* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_original_description;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_parameters_set_original_description (XmppXepJingleFileTransferParameters* self,
                                                                   XmppStanzaNode* value)
{
	XmppStanzaNode* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_file_transfer_parameters_get_original_description (self);
	if (old_value != value) {
		XmppStanzaNode* _tmp0_;
		_tmp0_ = _xmpp_stanza_entry_ref0 (value);
		_xmpp_stanza_entry_unref0 (self->priv->_original_description);
		self->priv->_original_description = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_file_transfer_parameters_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_ORIGINAL_DESCRIPTION_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_file_transfer_parameters_class_init (XmppXepJingleFileTransferParametersClass * klass,
                                                     gpointer klass_data)
{
	xmpp_xep_jingle_file_transfer_parameters_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleFileTransferParameters_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_file_transfer_parameters_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_file_transfer_parameters_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_file_transfer_parameters_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_NAME_PROPERTY, xmpp_xep_jingle_file_transfer_parameters_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_SIZE_PROPERTY, xmpp_xep_jingle_file_transfer_parameters_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_SIZE_PROPERTY] = g_param_spec_int64 ("size", "size", "size", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_ORIGINAL_DESCRIPTION_PROPERTY, xmpp_xep_jingle_file_transfer_parameters_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_ORIGINAL_DESCRIPTION_PROPERTY] = xmpp_param_spec_stanza_entry ("original-description", "original-description", "original-description", XMPP_TYPE_STANZA_NODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_xep_jingle_file_transfer_parameters_xmpp_xep_jingle_content_parameters_interface_init (XmppXepJingleContentParametersIface * iface,
                                                                                            gpointer iface_data)
{
	xmpp_xep_jingle_file_transfer_parameters_xmpp_xep_jingle_content_parameters_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_description_node = (XmppStanzaNode* (*) (XmppXepJingleContentParameters*)) xmpp_xep_jingle_file_transfer_parameters_real_get_description_node;
	iface->handle_proposed_content = (void (*) (XmppXepJingleContentParameters*, XmppXmppStream*, XmppXepJingleSession*, XmppXepJingleContent*, GAsyncReadyCallback, gpointer)) xmpp_xep_jingle_file_transfer_parameters_real_handle_proposed_content;
	iface->handle_proposed_content_finish = (void (*) (XmppXepJingleContentParameters*, GAsyncResult*)) xmpp_xep_jingle_file_transfer_parameters_handle_proposed_content_finish;
	iface->accept = (void (*) (XmppXepJingleContentParameters*, XmppXmppStream*, XmppXepJingleSession*, XmppXepJingleContent*)) xmpp_xep_jingle_file_transfer_parameters_real_accept;
	iface->handle_accept = (void (*) (XmppXepJingleContentParameters*, XmppXmppStream*, XmppXepJingleSession*, XmppXepJingleContent*, XmppStanzaNode*)) xmpp_xep_jingle_file_transfer_parameters_real_handle_accept;
	iface->terminate = (void (*) (XmppXepJingleContentParameters*, gboolean, const gchar*, const gchar*)) xmpp_xep_jingle_file_transfer_parameters_real_terminate;
}

static void
xmpp_xep_jingle_file_transfer_parameters_instance_init (XmppXepJingleFileTransferParameters * self,
                                                        gpointer klass)
{
	self->priv = xmpp_xep_jingle_file_transfer_parameters_get_instance_private (self);
}

static void
xmpp_xep_jingle_file_transfer_parameters_finalize (GObject * obj)
{
	XmppXepJingleFileTransferParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_PARAMETERS, XmppXepJingleFileTransferParameters);
	_g_object_unref0 (self->priv->parent);
	_g_free0 (self->priv->media_type);
	_g_free0 (self->priv->_name);
	_xmpp_stanza_entry_unref0 (self->priv->_original_description);
	G_OBJECT_CLASS (xmpp_xep_jingle_file_transfer_parameters_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_file_transfer_parameters_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleFileTransferParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_file_transfer_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleFileTransferParameters), 0, (GInstanceInitFunc) xmpp_xep_jingle_file_transfer_parameters_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_content_parameters_info = { (GInterfaceInitFunc) xmpp_xep_jingle_file_transfer_parameters_xmpp_xep_jingle_content_parameters_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_file_transfer_parameters_type_id;
	xmpp_xep_jingle_file_transfer_parameters_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleFileTransferParameters", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_file_transfer_parameters_type_id, XMPP_XEP_JINGLE_TYPE_CONTENT_PARAMETERS, &xmpp_xep_jingle_content_parameters_info);
	XmppXepJingleFileTransferParameters_private_offset = g_type_add_instance_private (xmpp_xep_jingle_file_transfer_parameters_type_id, sizeof (XmppXepJingleFileTransferParametersPrivate));
	return xmpp_xep_jingle_file_transfer_parameters_type_id;
}

GType
xmpp_xep_jingle_file_transfer_parameters_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_file_transfer_parameters_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_file_transfer_parameters_type_id__once)) {
		GType xmpp_xep_jingle_file_transfer_parameters_type_id;
		xmpp_xep_jingle_file_transfer_parameters_type_id = xmpp_xep_jingle_file_transfer_parameters_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_file_transfer_parameters_type_id__once, xmpp_xep_jingle_file_transfer_parameters_type_id);
	}
	return xmpp_xep_jingle_file_transfer_parameters_type_id__once;
}

static void
_vala_xmpp_xep_jingle_file_transfer_parameters_get_property (GObject * object,
                                                             guint property_id,
                                                             GValue * value,
                                                             GParamSpec * pspec)
{
	XmppXepJingleFileTransferParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_PARAMETERS, XmppXepJingleFileTransferParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_NAME_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_file_transfer_parameters_get_name (self));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_SIZE_PROPERTY:
		g_value_set_int64 (value, xmpp_xep_jingle_file_transfer_parameters_get_size (self));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_ORIGINAL_DESCRIPTION_PROPERTY:
		xmpp_value_set_stanza_entry (value, xmpp_xep_jingle_file_transfer_parameters_get_original_description (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_file_transfer_parameters_set_property (GObject * object,
                                                             guint property_id,
                                                             const GValue * value,
                                                             GParamSpec * pspec)
{
	XmppXepJingleFileTransferParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_PARAMETERS, XmppXepJingleFileTransferParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_NAME_PROPERTY:
		xmpp_xep_jingle_file_transfer_parameters_set_name (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_SIZE_PROPERTY:
		xmpp_xep_jingle_file_transfer_parameters_set_size (self, g_value_get_int64 (value));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_PARAMETERS_ORIGINAL_DESCRIPTION_PROPERTY:
		xmpp_xep_jingle_file_transfer_parameters_set_original_description (self, xmpp_value_get_stanza_entry (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_get_instance_private (XmppXepJingleFileTransferFileTransferInputStream* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleFileTransferFileTransferInputStream_private_offset);
}

XmppXepJingleFileTransferFileTransferInputStream*
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_construct (GType object_type,
                                                                    GInputStream* inner,
                                                                    gint64 max_size)
{
	XmppXepJingleFileTransferFileTransferInputStream * self = NULL;
	GInputStream* _tmp0_;
	g_return_val_if_fail (inner != NULL, NULL);
	self = (XmppXepJingleFileTransferFileTransferInputStream*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (inner);
	_g_object_unref0 (self->priv->inner);
	self->priv->inner = _tmp0_;
	self->priv->remaining_size = max_size;
	return self;
}

XmppXepJingleFileTransferFileTransferInputStream*
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_new (GInputStream* inner,
                                                              gint64 max_size)
{
	return xmpp_xep_jingle_file_transfer_file_transfer_input_stream_construct (XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM, inner, max_size);
}

static gssize
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_update_remaining (XmppXepJingleFileTransferFileTransferInputStream* self,
                                                                           gssize read)
{
	gssize result;
	g_return_val_if_fail (self != NULL, -1L);
	self->priv->remaining_size = self->priv->remaining_size - read;
	result = read;
	return result;
}

static gssize
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read (GInputStream* base,
                                                                    guint8* buffer_,
                                                                    gsize buffer__length1,
                                                                    GCancellable* cancellable,
                                                                    GError** error)
{
	XmppXepJingleFileTransferFileTransferInputStream * self;
	guint8* buffer = NULL;
	gint buffer_length1;
	gint _buffer_size_;
	guint8* _tmp0_;
	gint _tmp0__length1;
	gssize _tmp2_ = 0L;
	GInputStream* _tmp3_;
	guint8* _tmp4_;
	gint _tmp4__length1;
	GError* _inner_error0_ = NULL;
	gssize result;
	self = (XmppXepJingleFileTransferFileTransferInputStream*) base;
	buffer = buffer_;
	buffer_length1 = buffer__length1;
	_buffer_size_ = buffer_length1;
	if (self->priv->remaining_size <= ((gint64) 0)) {
		result = (gssize) 0;
		return result;
	}
	_tmp0_ = buffer;
	_tmp0__length1 = buffer_length1;
	if (((gint64) _tmp0__length1) > self->priv->remaining_size) {
		guint8* _tmp1_;
		gint _tmp1__length1;
		_tmp1_ = buffer;
		_tmp1__length1 = buffer_length1;
		buffer = _tmp1_ + 0;
		buffer_length1 = ((gint) self->priv->remaining_size) - 0;
		_buffer_size_ = buffer_length1;
	}
	_tmp3_ = self->priv->inner;
	_tmp4_ = buffer;
	_tmp4__length1 = buffer_length1;
	_tmp2_ = g_input_stream_read (_tmp3_, _tmp4_, (gsize) _tmp4__length1, cancellable, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == G_IO_ERROR) {
			gssize _tmp5_ = -1L;
			g_propagate_error (error, _inner_error0_);
			return _tmp5_;
		} else {
			gssize _tmp6_ = -1L;
			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 _tmp6_;
		}
	}
	result = xmpp_xep_jingle_file_transfer_file_transfer_input_stream_update_remaining (self, _tmp2_);
	return result;
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async_data_free (gpointer _data)
{
	XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData, _data_);
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async (GInputStream* base,
                                                                          guint8* buffer_,
                                                                          gsize buffer__length1,
                                                                          gint io_priority,
                                                                          GCancellable* cancellable,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_)
{
	XmppXepJingleFileTransferFileTransferInputStream * self;
	XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData* _data_;
	XmppXepJingleFileTransferFileTransferInputStream* _tmp0_;
	GCancellable* _tmp1_;
	self = (XmppXepJingleFileTransferFileTransferInputStream*) base;
	_data_ = g_slice_new0 (XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->buffer_ = buffer_;
	_data_->buffer__length1 = buffer__length1;
	_data_->io_priority = io_priority;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async_co (_data_);
}

static gssize
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_read_finish (GInputStream* base,
                                                                      GAsyncResult* _res_,
                                                                      GError** error)
{
	gssize result;
	XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gssize _tmp0_ = 0L;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_read_async_ready (GObject* source_object,
                                                                           GAsyncResult* _res_,
                                                                           gpointer _user_data_)
{
	XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async_co (_data_);
}

static gboolean
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async_co (XmppXepJingleFileTransferFileTransferInputStreamReadAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->buffer = _data_->buffer_;
	_data_->buffer_length1 = _data_->buffer__length1;
	_data_->_buffer_size_ = _data_->buffer_length1;
	if (_data_->self->priv->remaining_size <= ((gint64) 0)) {
		_data_->result = (gssize) 0;
		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_->buffer;
	_data_->_tmp0__length1 = _data_->buffer_length1;
	if (((gint64) _data_->_tmp0__length1) > _data_->self->priv->remaining_size) {
		_data_->_tmp1_ = _data_->buffer;
		_data_->_tmp1__length1 = _data_->buffer_length1;
		_data_->buffer = _data_->_tmp1_ + 0;
		_data_->buffer_length1 = ((gint) _data_->self->priv->remaining_size) - 0;
		_data_->_buffer_size_ = _data_->buffer_length1;
	}
	_data_->_tmp3_ = _data_->self->priv->inner;
	_data_->_tmp4_ = _data_->buffer;
	_data_->_tmp4__length1 = _data_->buffer_length1;
	_data_->_state_ = 1;
	g_input_stream_read_async (_data_->_tmp3_, _data_->_tmp4_, (gsize) _data_->_tmp4__length1, _data_->io_priority, _data_->cancellable, xmpp_xep_jingle_file_transfer_file_transfer_input_stream_read_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = g_input_stream_read_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error0_);
	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_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;
		}
	}
	_data_->result = xmpp_xep_jingle_file_transfer_file_transfer_input_stream_update_remaining (_data_->self, _data_->_tmp2_);
	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 gboolean
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close (GInputStream* base,
                                                                     GCancellable* cancellable,
                                                                     GError** error)
{
	XmppXepJingleFileTransferFileTransferInputStream * self;
	gboolean _tmp0_ = FALSE;
	GInputStream* _tmp1_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = (XmppXepJingleFileTransferFileTransferInputStream*) base;
	g_signal_emit (self, xmpp_xep_jingle_file_transfer_file_transfer_input_stream_signals[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_CLOSED_SIGNAL], 0);
	_tmp1_ = self->priv->inner;
	_tmp0_ = g_input_stream_close (_tmp1_, cancellable, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == G_IO_ERROR) {
			gboolean _tmp2_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			return _tmp2_;
		} else {
			gboolean _tmp3_ = FALSE;
			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 _tmp3_;
		}
	}
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async_data_free (gpointer _data)
{
	XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData, _data_);
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async (GInputStream* base,
                                                                           gint io_priority,
                                                                           GCancellable* cancellable,
                                                                           GAsyncReadyCallback _callback_,
                                                                           gpointer _user_data_)
{
	XmppXepJingleFileTransferFileTransferInputStream * self;
	XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData* _data_;
	XmppXepJingleFileTransferFileTransferInputStream* _tmp0_;
	GCancellable* _tmp1_;
	self = (XmppXepJingleFileTransferFileTransferInputStream*) base;
	_data_ = g_slice_new0 (XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->io_priority = io_priority;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async_co (_data_);
}

static gboolean
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_close_finish (GInputStream* base,
                                                                       GAsyncResult* _res_,
                                                                       GError** error)
{
	gboolean result;
	XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_close_async_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_)
{
	XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async_co (_data_);
}

static gboolean
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async_co (XmppXepJingleFileTransferFileTransferInputStreamCloseAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_signal_emit (_data_->self, xmpp_xep_jingle_file_transfer_file_transfer_input_stream_signals[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_CLOSED_SIGNAL], 0);
	_data_->_tmp1_ = _data_->self->priv->inner;
	_data_->_state_ = 1;
	g_input_stream_close_async (_data_->_tmp1_, _data_->io_priority, _data_->cancellable, xmpp_xep_jingle_file_transfer_file_transfer_input_stream_close_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = g_input_stream_close_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
	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_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;
		}
	}
	_data_->result = _data_->_tmp0_;
	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
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_class_init (XmppXepJingleFileTransferFileTransferInputStreamClass * klass,
                                                                     gpointer klass_data)
{
	xmpp_xep_jingle_file_transfer_file_transfer_input_stream_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleFileTransferFileTransferInputStream_private_offset);
	((GInputStreamClass *) klass)->read_fn = (gssize (*) (GInputStream*, guint8*, gsize, GCancellable*, GError**)) xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read;
	((GInputStreamClass *) klass)->read_async = (void (*) (GInputStream*, guint8*, gsize, gint, GCancellable*, GAsyncReadyCallback, gpointer)) xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_read_async;
	((GInputStreamClass *) klass)->read_finish = (gssize (*) (GInputStream*, GAsyncResult*, GError**)) xmpp_xep_jingle_file_transfer_file_transfer_input_stream_read_finish;
	((GInputStreamClass *) klass)->close_fn = (gboolean (*) (GInputStream*, GCancellable*, GError**)) xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close;
	((GInputStreamClass *) klass)->close_async = (void (*) (GInputStream*, gint, GCancellable*, GAsyncReadyCallback, gpointer)) xmpp_xep_jingle_file_transfer_file_transfer_input_stream_real_close_async;
	((GInputStreamClass *) klass)->close_finish = (gboolean (*) (GInputStream*, GAsyncResult*, GError**)) xmpp_xep_jingle_file_transfer_file_transfer_input_stream_close_finish;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_file_transfer_file_transfer_input_stream_finalize;
	xmpp_xep_jingle_file_transfer_file_transfer_input_stream_signals[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_INPUT_STREAM_CLOSED_SIGNAL] = g_signal_new ("closed", XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_instance_init (XmppXepJingleFileTransferFileTransferInputStream * self,
                                                                        gpointer klass)
{
	self->priv = xmpp_xep_jingle_file_transfer_file_transfer_input_stream_get_instance_private (self);
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_finalize (GObject * obj)
{
	XmppXepJingleFileTransferFileTransferInputStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER_INPUT_STREAM, XmppXepJingleFileTransferFileTransferInputStream);
	_g_object_unref0 (self->priv->inner);
	G_OBJECT_CLASS (xmpp_xep_jingle_file_transfer_file_transfer_input_stream_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleFileTransferFileTransferInputStreamClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_file_transfer_file_transfer_input_stream_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleFileTransferFileTransferInputStream), 0, (GInstanceInitFunc) xmpp_xep_jingle_file_transfer_file_transfer_input_stream_instance_init, NULL };
	GType xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id;
	xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id = g_type_register_static (g_input_stream_get_type (), "XmppXepJingleFileTransferFileTransferInputStream", &g_define_type_info, 0);
	XmppXepJingleFileTransferFileTransferInputStream_private_offset = g_type_add_instance_private (xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id, sizeof (XmppXepJingleFileTransferFileTransferInputStreamPrivate));
	return xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id;
}

GType
xmpp_xep_jingle_file_transfer_file_transfer_input_stream_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id__once)) {
		GType xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id;
		xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id = xmpp_xep_jingle_file_transfer_file_transfer_input_stream_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id__once, xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id);
	}
	return xmpp_xep_jingle_file_transfer_file_transfer_input_stream_type_id__once;
}

static inline gpointer
xmpp_xep_jingle_file_transfer_file_transfer_get_instance_private (XmppXepJingleFileTransferFileTransfer* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleFileTransferFileTransfer_private_offset);
}

XmppXepJingleFileTransferFileTransfer*
xmpp_xep_jingle_file_transfer_file_transfer_construct (GType object_type,
                                                       XmppXepJingleSession* session,
                                                       XmppXepJingleContent* content,
                                                       XmppXepJingleFileTransferParameters* parameters)
{
	XmppXepJingleFileTransferFileTransfer * self = NULL;
	XmppXepJingleSession* _tmp0_;
	XmppXepJingleContent* _tmp1_;
	XmppXepJingleFileTransferParameters* _tmp2_;
	g_return_val_if_fail (session != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	g_return_val_if_fail (parameters != NULL, NULL);
	self = (XmppXepJingleFileTransferFileTransfer*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (session);
	_g_object_unref0 (self->priv->session);
	self->priv->session = _tmp0_;
	_tmp1_ = _g_object_ref0 (content);
	_g_object_unref0 (self->priv->content);
	self->priv->content = _tmp1_;
	_tmp2_ = _g_object_ref0 (parameters);
	_g_object_unref0 (self->priv->parameters);
	self->priv->parameters = _tmp2_;
	return self;
}

XmppXepJingleFileTransferFileTransfer*
xmpp_xep_jingle_file_transfer_file_transfer_new (XmppXepJingleSession* session,
                                                 XmppXepJingleContent* content,
                                                 XmppXepJingleFileTransferParameters* parameters)
{
	return xmpp_xep_jingle_file_transfer_file_transfer_construct (XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER, session, content, parameters);
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_accept_data_free (gpointer _data)
{
	XmppXepJingleFileTransferFileTransferAcceptData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleFileTransferFileTransferAcceptData, _data_);
}

void
xmpp_xep_jingle_file_transfer_file_transfer_accept (XmppXepJingleFileTransferFileTransfer* self,
                                                    XmppXmppStream* stream,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	XmppXepJingleFileTransferFileTransferAcceptData* _data_;
	XmppXepJingleFileTransferFileTransfer* _tmp0_;
	XmppXmppStream* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	_data_ = g_slice_new0 (XmppXepJingleFileTransferFileTransferAcceptData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_file_transfer_file_transfer_accept_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	xmpp_xep_jingle_file_transfer_file_transfer_accept_co (_data_);
}

void
xmpp_xep_jingle_file_transfer_file_transfer_accept_finish (XmppXepJingleFileTransferFileTransfer* self,
                                                           GAsyncResult* _res_,
                                                           GError** error)
{
	XmppXepJingleFileTransferFileTransferAcceptData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_accept_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_)
{
	XmppXepJingleFileTransferFileTransferAcceptData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_file_transfer_file_transfer_accept_co (_data_);
}

static void
___lambda27_ (XmppXepJingleFileTransferFileTransfer* self)
{
	XmppXepJingleSession* _tmp0_;
	_tmp0_ = self->priv->session;
	xmpp_xep_jingle_session_terminate (_tmp0_, XMPP_XEP_JINGLE_REASON_ELEMENT_SUCCESS, NULL, NULL);
}

static void
____lambda27__xmpp_xep_jingle_file_transfer_file_transfer_input_stream_closed (XmppXepJingleFileTransferFileTransferInputStream* _sender,
                                                                               gpointer self)
{
	___lambda27_ ((XmppXepJingleFileTransferFileTransfer*) self);
}

static gboolean
xmpp_xep_jingle_file_transfer_file_transfer_accept_co (XmppXepJingleFileTransferFileTransferAcceptData* _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->content;
	xmpp_xep_jingle_content_accept (_data_->_tmp0_);
	_data_->_tmp1_ = _data_->self->priv->content;
	_data_->_tmp2_ = _data_->_tmp1_->component_connections;
	_data_->_tmp3_ = gee_map_get_values (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = 0;
	_data_->_tmp7_ = gee_collection_to_array (_data_->_tmp5_, &_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp8__length1 = _data_->_tmp6_;
	_data_->_tmp9_ = _data_->_tmp8_[0];
	_data_->_tmp10_ = _g_object_ref0 (XMPP_XEP_JINGLE_IS_STREAMING_CONNECTION (_data_->_tmp9_) ? ((XmppXepJingleStreamingConnection*) _data_->_tmp9_) : NULL);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp8_ = (_vala_array_free (_data_->_tmp8_, _data_->_tmp8__length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_data_->_tmp5_);
	_data_->connection = _data_->_tmp11_;
	{
		_data_->_tmp12_ = _data_->connection;
		_data_->_tmp13_ = xmpp_xep_jingle_streaming_connection_get_stream (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_state_ = 1;
		gee_future_wait_async (_data_->_tmp14_, xmpp_xep_jingle_file_transfer_file_transfer_accept_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp15_ = gee_future_wait_finish (_data_->_tmp14_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp16_ = _g_object_ref0 ((GIOStream*) _data_->_tmp15_);
		_data_->io_stream = _data_->_tmp16_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (g_error_matches (_data_->_inner_error0_, GEE_FUTURE_ERROR, GEE_FUTURE_ERROR_EXCEPTION)) {
				goto __catch0_gee_future_error_exception;
			}
			if (_data_->_inner_error0_->domain == GEE_FUTURE_ERROR) {
				goto __catch0_gee_future_error;
			}
			_g_object_unref0 (_data_->connection);
			g_critical ("file %s: line %d: unexpected 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_->_tmp17_ = _data_->io_stream;
		_data_->_tmp18_ = g_io_stream_get_input_stream (_data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_tmp20_ = xmpp_xep_jingle_file_transfer_file_transfer_get_size (_data_->self);
		_data_->_tmp21_ = _data_->_tmp20_;
		_data_->_tmp22_ = xmpp_xep_jingle_file_transfer_file_transfer_input_stream_new (_data_->_tmp19_, _data_->_tmp21_);
		_data_->ft_stream = _data_->_tmp22_;
		_data_->_tmp23_ = _data_->io_stream;
		_data_->_tmp24_ = g_io_stream_get_output_stream (_data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		g_output_stream_close (_data_->_tmp25_, NULL, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->ft_stream);
			_g_object_unref0 (_data_->io_stream);
			if (g_error_matches (_data_->_inner_error0_, GEE_FUTURE_ERROR, GEE_FUTURE_ERROR_EXCEPTION)) {
				goto __catch0_gee_future_error_exception;
			}
			if (_data_->_inner_error0_->domain == GEE_FUTURE_ERROR) {
				goto __catch0_gee_future_error;
			}
			goto __finally0;
		}
		_data_->_tmp26_ = _data_->ft_stream;
		g_signal_connect_object (_data_->_tmp26_, "closed", (GCallback) ____lambda27__xmpp_xep_jingle_file_transfer_file_transfer_input_stream_closed, _data_->self, 0);
		_data_->_tmp27_ = _data_->ft_stream;
		xmpp_xep_jingle_file_transfer_file_transfer_set_stream (_data_->self, (GInputStream*) _data_->_tmp27_);
		_g_object_unref0 (_data_->ft_stream);
		_g_object_unref0 (_data_->io_stream);
	}
	goto __finally0;
	__catch0_gee_future_error_exception:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->_tmp28_ = _data_->connection;
		_data_->_tmp29_ = xmpp_xep_jingle_streaming_connection_get_stream (_data_->_tmp28_);
		_data_->_tmp30_ = _data_->_tmp29_;
		_data_->_tmp31_ = gee_future_get_exception (_data_->_tmp30_);
		_data_->_tmp32_ = _data_->_tmp31_;
		_data_->_tmp33_ = _data_->_tmp32_->message;
		g_warning ("0234_jingle_file_transfer.vala:286: Error accepting Jingle file-transf" \
"er: %s", _data_->_tmp33_);
	}
	goto __finally0;
	__catch0_gee_future_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp34_ = _data_->e;
		_data_->_tmp35_ = _data_->_tmp34_->message;
		g_warning ("0234_jingle_file_transfer.vala:288: FutureError accepting Jingle file-" \
"transfer: %s", _data_->_tmp35_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	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_->connection);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->connection);
			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_object_unref0 (_data_->connection);
	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;
}

void
xmpp_xep_jingle_file_transfer_file_transfer_reject (XmppXepJingleFileTransferFileTransfer* self,
                                                    XmppXmppStream* stream)
{
	XmppXepJingleContent* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	_tmp0_ = self->priv->content;
	xmpp_xep_jingle_content_reject (_tmp0_);
}

XmppJid*
xmpp_xep_jingle_file_transfer_file_transfer_get_peer (XmppXepJingleFileTransferFileTransfer* self)
{
	XmppJid* result;
	XmppXepJingleSession* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->session;
	_tmp1_ = xmpp_xep_jingle_session_get_peer_full_jid (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

const gchar*
xmpp_xep_jingle_file_transfer_file_transfer_get_file_name (XmppXepJingleFileTransferFileTransfer* self)
{
	const gchar* result;
	XmppXepJingleFileTransferParameters* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->parameters;
	_tmp1_ = xmpp_xep_jingle_file_transfer_parameters_get_name (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

gint64
xmpp_xep_jingle_file_transfer_file_transfer_get_size (XmppXepJingleFileTransferFileTransfer* self)
{
	gint64 result;
	XmppXepJingleFileTransferParameters* _tmp0_;
	gint64 _tmp1_;
	gint64 _tmp2_;
	g_return_val_if_fail (self != NULL, -1LL);
	_tmp0_ = self->priv->parameters;
	_tmp1_ = xmpp_xep_jingle_file_transfer_parameters_get_size (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

XmppXepJingleSecurityParameters*
xmpp_xep_jingle_file_transfer_file_transfer_get_security (XmppXepJingleFileTransferFileTransfer* self)
{
	XmppXepJingleSecurityParameters* result;
	XmppXepJingleSession* _tmp0_;
	XmppXepJingleSecurityParameters* _tmp1_;
	XmppXepJingleSecurityParameters* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->session;
	_tmp1_ = xmpp_xep_jingle_session_get_security (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

GInputStream*
xmpp_xep_jingle_file_transfer_file_transfer_get_stream (XmppXepJingleFileTransferFileTransfer* self)
{
	GInputStream* result;
	GInputStream* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_stream;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_set_stream (XmppXepJingleFileTransferFileTransfer* self,
                                                        GInputStream* value)
{
	GInputStream* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_file_transfer_file_transfer_get_stream (self);
	if (old_value != value) {
		GInputStream* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_stream);
		self->priv->_stream = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_file_transfer_file_transfer_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_STREAM_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_class_init (XmppXepJingleFileTransferFileTransferClass * klass,
                                                        gpointer klass_data)
{
	xmpp_xep_jingle_file_transfer_file_transfer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleFileTransferFileTransfer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_file_transfer_file_transfer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_file_transfer_file_transfer_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_file_transfer_file_transfer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_PEER_PROPERTY, xmpp_xep_jingle_file_transfer_file_transfer_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_PEER_PROPERTY] = xmpp_param_spec_jid ("peer", "peer", "peer", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_FILE_NAME_PROPERTY, xmpp_xep_jingle_file_transfer_file_transfer_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_FILE_NAME_PROPERTY] = g_param_spec_string ("file-name", "file-name", "file-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_SIZE_PROPERTY, xmpp_xep_jingle_file_transfer_file_transfer_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_SIZE_PROPERTY] = g_param_spec_int64 ("size", "size", "size", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_SECURITY_PROPERTY, xmpp_xep_jingle_file_transfer_file_transfer_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_SECURITY_PROPERTY] = g_param_spec_object ("security", "security", "security", XMPP_XEP_JINGLE_TYPE_SECURITY_PARAMETERS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_STREAM_PROPERTY, xmpp_xep_jingle_file_transfer_file_transfer_properties[XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_STREAM_PROPERTY] = g_param_spec_object ("stream", "stream", "stream", g_input_stream_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_instance_init (XmppXepJingleFileTransferFileTransfer * self,
                                                           gpointer klass)
{
	self->priv = xmpp_xep_jingle_file_transfer_file_transfer_get_instance_private (self);
}

static void
xmpp_xep_jingle_file_transfer_file_transfer_finalize (GObject * obj)
{
	XmppXepJingleFileTransferFileTransfer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER, XmppXepJingleFileTransferFileTransfer);
	_g_object_unref0 (self->priv->session);
	_g_object_unref0 (self->priv->content);
	_g_object_unref0 (self->priv->parameters);
	_g_object_unref0 (self->priv->_stream);
	G_OBJECT_CLASS (xmpp_xep_jingle_file_transfer_file_transfer_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_file_transfer_file_transfer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleFileTransferFileTransferClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_file_transfer_file_transfer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleFileTransferFileTransfer), 0, (GInstanceInitFunc) xmpp_xep_jingle_file_transfer_file_transfer_instance_init, NULL };
	GType xmpp_xep_jingle_file_transfer_file_transfer_type_id;
	xmpp_xep_jingle_file_transfer_file_transfer_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleFileTransferFileTransfer", &g_define_type_info, 0);
	XmppXepJingleFileTransferFileTransfer_private_offset = g_type_add_instance_private (xmpp_xep_jingle_file_transfer_file_transfer_type_id, sizeof (XmppXepJingleFileTransferFileTransferPrivate));
	return xmpp_xep_jingle_file_transfer_file_transfer_type_id;
}

GType
xmpp_xep_jingle_file_transfer_file_transfer_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_file_transfer_file_transfer_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_file_transfer_file_transfer_type_id__once)) {
		GType xmpp_xep_jingle_file_transfer_file_transfer_type_id;
		xmpp_xep_jingle_file_transfer_file_transfer_type_id = xmpp_xep_jingle_file_transfer_file_transfer_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_file_transfer_file_transfer_type_id__once, xmpp_xep_jingle_file_transfer_file_transfer_type_id);
	}
	return xmpp_xep_jingle_file_transfer_file_transfer_type_id__once;
}

static void
_vala_xmpp_xep_jingle_file_transfer_file_transfer_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec)
{
	XmppXepJingleFileTransferFileTransfer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER, XmppXepJingleFileTransferFileTransfer);
	switch (property_id) {
		case XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_PEER_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_file_transfer_file_transfer_get_peer (self));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_FILE_NAME_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_file_transfer_file_transfer_get_file_name (self));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_SIZE_PROPERTY:
		g_value_set_int64 (value, xmpp_xep_jingle_file_transfer_file_transfer_get_size (self));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_SECURITY_PROPERTY:
		g_value_set_object (value, xmpp_xep_jingle_file_transfer_file_transfer_get_security (self));
		break;
		case XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_STREAM_PROPERTY:
		g_value_set_object (value, xmpp_xep_jingle_file_transfer_file_transfer_get_stream (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_file_transfer_file_transfer_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec)
{
	XmppXepJingleFileTransferFileTransfer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_FILE_TRANSFER_TYPE_FILE_TRANSFER, XmppXepJingleFileTransferFileTransfer);
	switch (property_id) {
		case XMPP_XEP_JINGLE_FILE_TRANSFER_FILE_TRANSFER_STREAM_PROPERTY:
		xmpp_xep_jingle_file_transfer_file_transfer_set_stream (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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);
}

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;
}

