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

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

#define XMPP_XEP_JINGLE_ERROR_NS_URI "urn:xmpp:jingle:errors:1"
#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_MODULE_0_PROPERTY,
	XMPP_XEP_JINGLE_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_module_properties[XMPP_XEP_JINGLE_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)))
typedef struct _XmppXepJingleModuleSelectTransportData XmppXepJingleModuleSelectTransportData;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _XmppXepJingleModuleIsJingleAvailableData XmppXepJingleModuleIsJingleAvailableData;
typedef struct _XmppXepJingleModuleIsAvailableData XmppXepJingleModuleIsAvailableData;
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
typedef struct _XmppXepJingleModuleCreateSessionData XmppXepJingleModuleCreateSessionData;
typedef struct _Block9Data Block9Data;

#define XMPP_XEP_JINGLE_TYPE_CONTENT_NODE (xmpp_xep_jingle_content_node_get_type ())
#define XMPP_XEP_JINGLE_CONTENT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XMPP_XEP_JINGLE_TYPE_CONTENT_NODE, XmppXepJingleContentNode))
#define XMPP_XEP_JINGLE_CONTENT_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XMPP_XEP_JINGLE_TYPE_CONTENT_NODE, XmppXepJingleContentNodeClass))
#define XMPP_XEP_JINGLE_IS_CONTENT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XMPP_XEP_JINGLE_TYPE_CONTENT_NODE))
#define XMPP_XEP_JINGLE_IS_CONTENT_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XMPP_XEP_JINGLE_TYPE_CONTENT_NODE))
#define XMPP_XEP_JINGLE_CONTENT_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XMPP_XEP_JINGLE_TYPE_CONTENT_NODE, XmppXepJingleContentNodeClass))

typedef struct _XmppXepJingleContentNode XmppXepJingleContentNode;
typedef struct _XmppXepJingleContentNodeClass XmppXepJingleContentNodeClass;
#define _xmpp_xep_jingle_content_node_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_content_node_unref (var), NULL)))
typedef struct _XmppXepJingleModuleHandleSessionInitiateData XmppXepJingleModuleHandleSessionInitiateData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _XmppXepJingleModuleOnIqSetData XmppXepJingleModuleOnIqSetData;
#define _xmpp_error_stanza_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_error_stanza_unref (var), NULL)))
typedef struct _XmppXepJingleModuleHandleIqSetData XmppXepJingleModuleHandleIqSetData;
enum  {
	XMPP_XEP_JINGLE_MODULE_SESSION_INITIATE_RECEIVED_SIGNAL,
	XMPP_XEP_JINGLE_MODULE_NUM_SIGNALS
};
static guint xmpp_xep_jingle_module_signals[XMPP_XEP_JINGLE_MODULE_NUM_SIGNALS] = {0};

struct _XmppXepJingleModulePrivate {
	GeeHashMap* content_types;
	GeeHashMap* session_info_types;
	GeeHashMap* transports;
	GeeHashMap* security_preconditions;
};

struct _XmppXepJingleModuleSelectTransportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleModule* self;
	XmppXmppStream* stream;
	XmppXepJingleTransportType type;
	guint8 components;
	XmppJid* receiver_full_jid;
	GeeSet* blacklist;
	XmppXepJingleTransport* result;
	XmppXepJingleTransport* _result_;
	GeeIterator* _transport_it;
	GeeHashMap* _tmp0_;
	GeeCollection* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _tmp5_;
	GeeIterator* _tmp6_;
	XmppXepJingleTransport* transport;
	GeeIterator* _tmp7_;
	gpointer _tmp8_;
	XmppXepJingleTransport* _tmp9_;
	XmppXepJingleTransportType _tmp10_;
	XmppXepJingleTransportType _tmp11_;
	XmppXepJingleTransport* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	XmppXepJingleTransport* _tmp15_;
	XmppXepJingleTransport* _tmp16_;
	XmppXepJingleTransport* _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	XmppXepJingleTransport* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	XmppXepJingleTransport* _tmp23_;
	XmppXepJingleTransport* _tmp24_;
};

struct _XmppXepJingleModuleIsJingleAvailableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleModule* self;
	XmppXmppStream* stream;
	XmppJid* full_jid;
	gboolean result;
	gboolean* has_jingle;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepServiceDiscoveryModule* _tmp2_;
	gboolean _tmp3_;
	gboolean* _tmp4_;
	gboolean* _tmp5_;
	gboolean _tmp6_;
	gboolean* _tmp7_;
	gboolean* _tmp8_;
};

struct _XmppXepJingleModuleIsAvailableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleModule* self;
	XmppXmppStream* stream;
	XmppXepJingleTransportType type;
	guint8 components;
	XmppJid* full_jid;
	gboolean result;
	gboolean _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	XmppXepJingleTransport* _tmp3_;
	XmppXepJingleTransport* _tmp4_;
};

struct _XmppXepJingleModuleCreateSessionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleModule* self;
	XmppXmppStream* stream;
	GeeList* contents;
	XmppJid* receiver_full_jid;
	gchar* sid;
	XmppJid* muji_room;
	XmppXepJingleSession* result;
	GError* _tmp0_;
	XmppJid* my_jid;
	XmppFlagIdentity* _tmp1_;
	gpointer _tmp2_;
	XmppBindFlag* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	GError* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	XmppXepJingleSession* session;
	XmppJid* _tmp12_;
	XmppXepJingleSession* _tmp13_;
	XmppXepJingleSession* _tmp14_;
	GeeList* _content_list;
	gint _content_size;
	GeeList* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	gint _content_index;
	gint _tmp18_;
	gint _tmp19_;
	XmppXepJingleContent* content;
	GeeList* _tmp20_;
	gpointer _tmp21_;
	XmppXepJingleSession* _tmp22_;
	XmppXepJingleContent* _tmp23_;
	XmppStanzaNode* initiate_jingle_iq;
	XmppStanzaNode* _tmp24_;
	XmppStanzaNode* _tmp25_;
	XmppStanzaNode* _tmp26_;
	XmppStanzaNode* _tmp27_;
	XmppStanzaNode* _tmp28_;
	XmppStanzaNode* _tmp29_;
	XmppJid* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	XmppStanzaNode* _tmp33_;
	XmppStanzaNode* _tmp34_;
	XmppXepJingleSession* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	XmppStanzaNode* _tmp38_;
	XmppStanzaNode* _tmp39_;
	GeeList* _vala1__content_list;
	gint _vala1__content_size;
	GeeList* _tmp40_;
	gint _tmp41_;
	gint _tmp42_;
	gint _vala1__content_index;
	gint _tmp43_;
	gint _tmp44_;
	XmppXepJingleContent* _vala1_content;
	GeeList* _tmp45_;
	gpointer _tmp46_;
	XmppStanzaNode* content_node;
	XmppStanzaNode* _tmp47_;
	XmppStanzaNode* _tmp48_;
	XmppStanzaNode* _tmp49_;
	XmppStanzaNode* _tmp50_;
	XmppXepJingleContent* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	XmppStanzaNode* _tmp54_;
	XmppStanzaNode* _tmp55_;
	XmppXepJingleContent* _tmp56_;
	XmppXepJingleSenders _tmp57_;
	XmppXepJingleSenders _tmp58_;
	gchar* _tmp59_;
	gchar* _tmp60_;
	XmppStanzaNode* _tmp61_;
	XmppStanzaNode* _tmp62_;
	XmppXepJingleContent* _tmp63_;
	XmppXepJingleContentParameters* _tmp64_;
	XmppStanzaNode* _tmp65_;
	XmppStanzaNode* _tmp66_;
	XmppStanzaNode* _tmp67_;
	XmppStanzaNode* _tmp68_;
	XmppXepJingleContent* _tmp69_;
	XmppXepJingleTransportParameters* _tmp70_;
	XmppStanzaNode* _tmp71_;
	XmppStanzaNode* _tmp72_;
	XmppStanzaNode* _tmp73_;
	XmppStanzaNode* _tmp74_;
	XmppXepJingleContent* _tmp75_;
	XmppXepJingleSecurityParameters* _tmp76_;
	XmppStanzaNode* _tmp77_;
	XmppXepJingleContent* _tmp78_;
	XmppXepJingleSecurityParameters* _tmp79_;
	XmppJid* _tmp80_;
	XmppStanzaNode* _tmp81_;
	XmppStanzaNode* _tmp82_;
	XmppStanzaNode* _tmp83_;
	XmppStanzaNode* _tmp84_;
	XmppStanzaNode* _tmp85_;
	XmppStanzaNode* _tmp86_;
	XmppStanzaNode* _tmp87_;
	XmppStanzaNode* _tmp88_;
	XmppStanzaNode* _tmp89_;
	XmppStanzaNode* _tmp90_;
	XmppStanzaNode* _tmp91_;
	XmppStanzaNode* _tmp92_;
	XmppStanzaNode* _tmp93_;
	gchar* _tmp94_;
	gchar* _tmp95_;
	XmppStanzaNode* _tmp96_;
	XmppStanzaNode* _tmp97_;
	XmppStanzaNode* _tmp98_;
	XmppStanzaNode* _tmp99_;
	XmppIqStanza* iq;
	XmppStanzaNode* _tmp100_;
	XmppJid* _tmp101_;
	XmppIqStanza* _tmp102_;
	XmppFlagIdentity* _tmp103_;
	gpointer _tmp104_;
	XmppXepJingleFlag* _tmp105_;
	XmppXepJingleSession* _tmp106_;
	XmppModuleIdentity* _tmp107_;
	gpointer _tmp108_;
	XmppIqModule* _tmp109_;
	XmppIqStanza* _tmp110_;
	GError* _inner_error0_;
};

struct _Block9Data {
	int _ref_count_;
	XmppXepJingleModule* self;
	gchar* sid;
	gpointer _async_data_;
};

struct _XmppXepJingleModuleHandleSessionInitiateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleModule* self;
	XmppXmppStream* stream;
	gchar* sid;
	XmppStanzaNode* jingle;
	XmppIqStanza* iq;
	Block9Data* _data9_;
	XmppJid* my_jid;
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppBindFlag* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	GError* _tmp7_;
	XmppXepJingleSession* session;
	XmppJid* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	XmppXepJingleSession* _tmp12_;
	XmppXepJingleSession* _tmp13_;
	XmppXepJingleSession* _tmp14_;
	gchar* muji_room_str;
	XmppStanzaNode* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	const gchar* _tmp18_;
	XmppJid* _tmp19_;
	const gchar* _tmp20_;
	XmppJid* _tmp21_;
	XmppXepJingleSession* _tmp22_;
	XmppFlagIdentity* _tmp23_;
	gpointer _tmp24_;
	XmppXepJingleFlag* _tmp25_;
	XmppXepJingleSession* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	GeeList* _tmp29_;
	GeeList* _tmp30_;
	GeeList* _content_node_list;
	gint _content_node_size;
	GeeList* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	gint _content_node_index;
	gint _tmp34_;
	gint _tmp35_;
	XmppXepJingleContentNode* content_node;
	GeeList* _tmp36_;
	gpointer _tmp37_;
	XmppXepJingleSession* _tmp38_;
	XmppXepJingleContentNode* _tmp39_;
	XmppJid* _tmp40_;
	XmppJid* _tmp41_;
	XmppJid* _tmp42_;
	XmppFlagIdentity* _tmp43_;
	gpointer _tmp44_;
	XmppXepJingleFlag* _tmp45_;
	XmppXepJingleSession* _tmp46_;
	XmppModuleIdentity* _tmp47_;
	gpointer _tmp48_;
	XmppIqModule* _tmp49_;
	XmppIqStanza* _tmp50_;
	XmppIqStanza* _tmp51_;
	XmppXepJingleSession* _tmp52_;
	GError* _inner_error0_;
};

struct _XmppXepJingleModuleOnIqSetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleModule* self;
	XmppXmppStream* stream;
	XmppIqStanza* iq;
	GError* e;
	GError* _tmp0_;
	GError* _inner_error0_;
};

struct _XmppXepJingleModuleHandleIqSetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleModule* self;
	XmppXmppStream* stream;
	XmppIqStanza* iq;
	XmppStanzaNode* jingle_node;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	GError* _tmp3_;
	gchar* sid;
	XmppStanzaNode* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* action;
	XmppStanzaNode* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	GError* _tmp13_;
	XmppXepJingleSession* session;
	XmppFlagIdentity* _tmp14_;
	gpointer _tmp15_;
	XmppXepJingleFlag* _tmp16_;
	const gchar* _tmp17_;
	XmppXepJingleSession* _tmp18_;
	XmppXepJingleSession* _tmp19_;
	const gchar* _tmp20_;
	XmppXepJingleSession* _tmp21_;
	XmppModuleIdentity* _tmp22_;
	gpointer _tmp23_;
	XmppIqModule* _tmp24_;
	XmppErrorStanza* _tmp25_;
	XmppErrorStanza* _tmp26_;
	XmppJid* _tmp27_;
	XmppJid* _tmp28_;
	XmppIqStanza* _tmp29_;
	XmppIqStanza* _tmp30_;
	const gchar* _tmp31_;
	XmppStanzaNode* _tmp32_;
	XmppXepJingleSession* _tmp33_;
	XmppStanzaNode* unknown_session;
	XmppStanzaNode* _tmp34_;
	XmppStanzaNode* _tmp35_;
	XmppStanzaNode* _tmp36_;
	XmppStanzaNode* _tmp37_;
	XmppModuleIdentity* _tmp38_;
	gpointer _tmp39_;
	XmppIqModule* _tmp40_;
	XmppStanzaNode* _tmp41_;
	XmppErrorStanza* _tmp42_;
	XmppErrorStanza* _tmp43_;
	XmppJid* _tmp44_;
	XmppJid* _tmp45_;
	XmppIqStanza* _tmp46_;
	XmppIqStanza* _tmp47_;
	XmppXepJingleSession* _tmp48_;
	const gchar* _tmp49_;
	XmppStanzaNode* _tmp50_;
	GError* _inner_error0_;
};

static gint XmppXepJingleModule_private_offset;
static gpointer xmpp_xep_jingle_module_parent_class = NULL;
XmppModuleIdentity* xmpp_xep_jingle_module_IDENTITY = NULL;
static XmppIqHandlerIface * xmpp_xep_jingle_module_xmpp_iq_handler_parent_iface = NULL;

static void xmpp_xep_jingle_module_real_attach (XmppXmppStreamModule* base,
                                         XmppXmppStream* stream);
static void xmpp_xep_jingle_module_real_detach (XmppXmppStreamModule* base,
                                         XmppXmppStream* stream);
static void xmpp_xep_jingle_module_select_transport_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_module_select_transport_co (XmppXepJingleModuleSelectTransportData* _data_);
static void xmpp_xep_jingle_module_select_transport_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void xmpp_xep_jingle_module_is_jingle_available_data_free (gpointer _data);
static void xmpp_xep_jingle_module_is_jingle_available (XmppXepJingleModule* self,
                                                 XmppXmppStream* stream,
                                                 XmppJid* full_jid,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static gboolean xmpp_xep_jingle_module_is_jingle_available_finish (XmppXepJingleModule* self,
                                                            GAsyncResult* _res_);
static gboolean xmpp_xep_jingle_module_is_jingle_available_co (XmppXepJingleModuleIsJingleAvailableData* _data_);
static void xmpp_xep_jingle_module_is_jingle_available_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static gboolean* _bool_dup (gboolean* self);
static void xmpp_xep_jingle_module_is_available_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_module_is_available_co (XmppXepJingleModuleIsAvailableData* _data_);
static void xmpp_xep_jingle_module_is_available_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void xmpp_xep_jingle_module_create_session_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_module_create_session_co (XmppXepJingleModuleCreateSessionData* _data_);
static void xmpp_xep_jingle_module_create_session_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void __lambda16_ (XmppXepJingleModule* self,
                  XmppXepJingleSession* session,
                  XmppXmppStream* stream,
                  gboolean _1,
                  const gchar* _2,
                  const gchar* _3);
static void ___lambda16__xmpp_xep_jingle_session_terminated (XmppXepJingleSession* _sender,
                                                      XmppXmppStream* stream,
                                                      gboolean we_terminated,
                                                      const gchar* reason_name,
                                                      const gchar* reason_text,
                                                      gpointer self);
VALA_EXTERN void xmpp_xep_jingle_session_insert_content (XmppXepJingleSession* self,
                                             XmppXepJingleContent* content);
static void __lambda17_ (XmppXepJingleModule* self,
                  XmppXmppStream* stream,
                  XmppIqStanza* iq);
static void ___lambda17__xmpp_iq_module_on_result (XmppXmppStream* stream,
                                            XmppIqStanza* iq,
                                            gpointer self);
static void xmpp_xep_jingle_module_handle_session_initiate_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_module_handle_session_initiate_co (XmppXepJingleModuleHandleSessionInitiateData* _data_);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
static void __lambda18_ (Block9Data* _data9_,
                  XmppXmppStream* stream);
static void ___lambda18__xmpp_xep_jingle_session_terminated (XmppXepJingleSession* _sender,
                                                      XmppXmppStream* stream,
                                                      gboolean we_terminated,
                                                      const gchar* reason_name,
                                                      const gchar* reason_text,
                                                      gpointer self);
VALA_EXTERN gpointer xmpp_xep_jingle_content_node_ref (gpointer instance);
VALA_EXTERN void xmpp_xep_jingle_content_node_unref (gpointer instance);
VALA_EXTERN GParamSpec* xmpp_xep_jingle_param_spec_content_node (const gchar* name,
                                                     const gchar* nick,
                                                     const gchar* blurb,
                                                     GType object_type,
                                                     GParamFlags flags);
VALA_EXTERN void xmpp_xep_jingle_value_set_content_node (GValue* value,
                                             gpointer v_object);
VALA_EXTERN void xmpp_xep_jingle_value_take_content_node (GValue* value,
                                              gpointer v_object);
VALA_EXTERN gpointer xmpp_xep_jingle_value_get_content_node (const GValue* value);
VALA_EXTERN GType xmpp_xep_jingle_content_node_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GeeList* xmpp_xep_jingle_get_content_nodes (XmppStanzaNode* jingle,
                                            GError** error);
VALA_EXTERN void xmpp_xep_jingle_session_insert_content_node (XmppXepJingleSession* self,
                                                  XmppXepJingleContentNode* content_node,
                                                  XmppJid* peer_full_jid,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
VALA_EXTERN void xmpp_xep_jingle_session_insert_content_node_finish (XmppXepJingleSession* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static void xmpp_xep_jingle_module_handle_session_initiate_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void xmpp_xep_jingle_module_real_on_iq_set_data_free (gpointer _data);
static void xmpp_xep_jingle_module_real_on_iq_set (XmppIqHandler* base,
                                            XmppXmppStream* stream,
                                            XmppIqStanza* iq,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
static gboolean xmpp_xep_jingle_module_real_on_iq_set_co (XmppXepJingleModuleOnIqSetData* _data_);
static void xmpp_xep_jingle_module_on_iq_set_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
VALA_EXTERN void xmpp_xep_jingle_send_iq_error (GError* iq_error,
                                    XmppXmppStream* stream,
                                    XmppIqStanza* iq);
static void xmpp_xep_jingle_module_handle_iq_set_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_module_handle_iq_set_co (XmppXepJingleModuleHandleIqSetData* _data_);
static void xmpp_xep_jingle_module_handle_iq_set_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static gchar* xmpp_xep_jingle_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_xep_jingle_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_module_finalize (GObject * obj);
static GType xmpp_xep_jingle_module_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_xep_jingle_module_get_instance_private (XmppXepJingleModule* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleModule_private_offset);
}

static void
xmpp_xep_jingle_module_real_attach (XmppXmppStreamModule* base,
                                    XmppXmppStream* stream)
{
	XmppXepJingleModule * self;
	XmppXepJingleFlag* _tmp0_;
	XmppXepJingleFlag* _tmp1_;
	XmppModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	XmppXepServiceDiscoveryModule* _tmp4_;
	XmppModuleIdentity* _tmp5_;
	gpointer _tmp6_;
	XmppIqModule* _tmp7_;
	self = (XmppXepJingleModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_jingle_flag_new ();
	_tmp1_ = _tmp0_;
	xmpp_xmpp_stream_add_flag (stream, (XmppXmppStreamFlag*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = xmpp_xep_service_discovery_module_IDENTITY;
	_tmp3_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (XmppXepServiceDiscoveryModule*) _tmp3_;
	xmpp_xep_service_discovery_module_add_feature (_tmp4_, stream, XMPP_XEP_JINGLE_NS_URI);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = xmpp_iq_module_IDENTITY;
	_tmp6_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp5_);
	_tmp7_ = (XmppIqModule*) _tmp6_;
	xmpp_iq_module_register_for_namespace (_tmp7_, XMPP_XEP_JINGLE_NS_URI, (XmppIqHandler*) self);
	_g_object_unref0 (_tmp7_);
}

static void
xmpp_xep_jingle_module_real_detach (XmppXmppStreamModule* base,
                                    XmppXmppStream* stream)
{
	XmppXepJingleModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepServiceDiscoveryModule* _tmp2_;
	XmppModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppIqModule* _tmp5_;
	self = (XmppXepJingleModule*) 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_NS_URI);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = xmpp_iq_module_IDENTITY;
	_tmp4_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
	_tmp5_ = (XmppIqModule*) _tmp4_;
	xmpp_iq_module_unregister_from_namespace (_tmp5_, XMPP_XEP_JINGLE_NS_URI, (XmppIqHandler*) self);
	_g_object_unref0 (_tmp5_);
}

void
xmpp_xep_jingle_module_register_content_type (XmppXepJingleModule* self,
                                              XmppXepJingleContentType* content_type)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content_type != NULL);
	_tmp0_ = self->priv->content_types;
	_tmp1_ = xmpp_xep_jingle_content_type_get_ns_uri (content_type);
	_tmp2_ = _tmp1_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, content_type);
}

void
xmpp_xep_jingle_module_register_session_info_type (XmppXepJingleModule* self,
                                                   XmppXepJingleSessionInfoNs* info_ns)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (info_ns != NULL);
	_tmp0_ = self->priv->session_info_types;
	_tmp1_ = xmpp_xep_jingle_session_info_ns_get_ns_uri (info_ns);
	_tmp2_ = _tmp1_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, info_ns);
}

XmppXepJingleContentType*
xmpp_xep_jingle_module_get_content_type (XmppXepJingleModule* self,
                                         const gchar* ns_uri)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	XmppXepJingleContentType* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (ns_uri != NULL, NULL);
	_tmp0_ = self->priv->content_types;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, ns_uri)) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->content_types;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, ns_uri);
	result = (XmppXepJingleContentType*) _tmp2_;
	return result;
}

XmppXepJingleSessionInfoNs*
xmpp_xep_jingle_module_get_session_info_type (XmppXepJingleModule* self,
                                              const gchar* ns_uri)
{
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleSessionInfoNs* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (ns_uri != NULL, NULL);
	_tmp0_ = self->priv->session_info_types;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, ns_uri);
	result = (XmppXepJingleSessionInfoNs*) _tmp1_;
	return result;
}

void
xmpp_xep_jingle_module_register_transport (XmppXepJingleModule* self,
                                           XmppXepJingleTransport* transport)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (transport != NULL);
	_tmp0_ = self->priv->transports;
	_tmp1_ = xmpp_xep_jingle_transport_get_ns_uri (transport);
	_tmp2_ = _tmp1_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, transport);
}

XmppXepJingleTransport*
xmpp_xep_jingle_module_get_transport (XmppXepJingleModule* self,
                                      const gchar* ns_uri)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	XmppXepJingleTransport* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (ns_uri != NULL, NULL);
	_tmp0_ = self->priv->transports;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, ns_uri)) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->transports;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, ns_uri);
	result = (XmppXepJingleTransport*) _tmp2_;
	return result;
}

static void
xmpp_xep_jingle_module_select_transport_data_free (gpointer _data)
{
	XmppXepJingleModuleSelectTransportData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_jid_unref0 (_data_->receiver_full_jid);
	_g_object_unref0 (_data_->blacklist);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleModuleSelectTransportData, _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_module_select_transport (XmppXepJingleModule* self,
                                         XmppXmppStream* stream,
                                         XmppXepJingleTransportType type,
                                         guint8 components,
                                         XmppJid* receiver_full_jid,
                                         GeeSet* blacklist,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	XmppXepJingleModuleSelectTransportData* _data_;
	XmppXepJingleModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppJid* _tmp2_;
	GeeSet* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (receiver_full_jid != NULL);
	g_return_if_fail (blacklist != NULL);
	_data_ = g_slice_new0 (XmppXepJingleModuleSelectTransportData);
	_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_module_select_transport_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_data_->type = type;
	_data_->components = components;
	_tmp2_ = _xmpp_jid_ref0 (receiver_full_jid);
	_xmpp_jid_unref0 (_data_->receiver_full_jid);
	_data_->receiver_full_jid = _tmp2_;
	_tmp3_ = _g_object_ref0 (blacklist);
	_g_object_unref0 (_data_->blacklist);
	_data_->blacklist = _tmp3_;
	xmpp_xep_jingle_module_select_transport_co (_data_);
}

XmppXepJingleTransport*
xmpp_xep_jingle_module_select_transport_finish (XmppXepJingleModule* self,
                                                GAsyncResult* _res_)
{
	XmppXepJingleTransport* result;
	XmppXepJingleModuleSelectTransportData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_xep_jingle_module_select_transport_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	XmppXepJingleModuleSelectTransportData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_module_select_transport_co (_data_);
}

static gboolean
xmpp_xep_jingle_module_select_transport_co (XmppXepJingleModuleSelectTransportData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_result_ = NULL;
	{
		_data_->_tmp0_ = _data_->self->priv->transports;
		_data_->_tmp1_ = gee_abstract_map_get_values ((GeeAbstractMap*) _data_->_tmp0_);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_g_object_unref0 (_data_->_tmp3_);
		_data_->_transport_it = _data_->_tmp5_;
		while (TRUE) {
			_data_->_tmp6_ = _data_->_transport_it;
			if (!gee_iterator_next (_data_->_tmp6_)) {
				break;
			}
			_data_->_tmp7_ = _data_->_transport_it;
			_data_->_tmp8_ = gee_iterator_get (_data_->_tmp7_);
			_data_->transport = (XmppXepJingleTransport*) _data_->_tmp8_;
			_data_->_tmp9_ = _data_->transport;
			_data_->_tmp10_ = xmpp_xep_jingle_transport_get_type_ (_data_->_tmp9_);
			_data_->_tmp11_ = _data_->_tmp10_;
			if (_data_->_tmp11_ != _data_->type) {
				_g_object_unref0 (_data_->transport);
				continue;
			}
			_data_->_tmp12_ = _data_->transport;
			_data_->_tmp13_ = xmpp_xep_jingle_transport_get_ns_uri (_data_->_tmp12_);
			_data_->_tmp14_ = _data_->_tmp13_;
			if (gee_collection_contains ((GeeCollection*) _data_->blacklist, _data_->_tmp14_)) {
				_g_object_unref0 (_data_->transport);
				continue;
			}
			_data_->_tmp15_ = _data_->transport;
			_data_->_state_ = 1;
			xmpp_xep_jingle_transport_is_transport_available (_data_->_tmp15_, _data_->stream, _data_->components, _data_->receiver_full_jid, xmpp_xep_jingle_module_select_transport_ready, _data_);
			return FALSE;
			_state_1:
			if (xmpp_xep_jingle_transport_is_transport_available_finish (_data_->_tmp15_, _data_->_res_)) {
				_data_->_tmp16_ = _data_->_result_;
				if (_data_->_tmp16_ != NULL) {
					_data_->_tmp17_ = _data_->_result_;
					_data_->_tmp18_ = xmpp_xep_jingle_transport_get_priority (_data_->_tmp17_);
					_data_->_tmp19_ = _data_->_tmp18_;
					_data_->_tmp20_ = _data_->transport;
					_data_->_tmp21_ = xmpp_xep_jingle_transport_get_priority (_data_->_tmp20_);
					_data_->_tmp22_ = _data_->_tmp21_;
					if (_data_->_tmp19_ >= _data_->_tmp22_) {
						_g_object_unref0 (_data_->transport);
						continue;
					}
				}
				_data_->_tmp23_ = _data_->transport;
				_data_->_tmp24_ = _g_object_ref0 (_data_->_tmp23_);
				_g_object_unref0 (_data_->_result_);
				_data_->_result_ = _data_->_tmp24_;
			}
			_g_object_unref0 (_data_->transport);
		}
		_g_object_unref0 (_data_->_transport_it);
	}
	_data_->result = _data_->_result_;
	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_module_register_security_precondition (XmppXepJingleModule* self,
                                                       XmppXepJingleSecurityPrecondition* precondition)
{
	GeeHashMap* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (precondition != NULL);
	_tmp0_ = self->priv->security_preconditions;
	_tmp1_ = xmpp_xep_jingle_security_precondition_security_ns_uri (precondition);
	_tmp2_ = _tmp1_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, precondition);
	_g_free0 (_tmp2_);
}

XmppXepJingleSecurityPrecondition*
xmpp_xep_jingle_module_get_security_precondition (XmppXepJingleModule* self,
                                                  const gchar* ns_uri)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	XmppXepJingleSecurityPrecondition* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (ns_uri == NULL) {
		result = NULL;
		return result;
	}
	_tmp0_ = self->priv->security_preconditions;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, ns_uri)) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->security_preconditions;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, ns_uri);
	result = (XmppXepJingleSecurityPrecondition*) _tmp2_;
	return result;
}

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

static void
xmpp_xep_jingle_module_is_jingle_available (XmppXepJingleModule* self,
                                            XmppXmppStream* stream,
                                            XmppJid* full_jid,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	XmppXepJingleModuleIsJingleAvailableData* _data_;
	XmppXepJingleModule* _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 (XmppXepJingleModuleIsJingleAvailableData);
	_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_module_is_jingle_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_module_is_jingle_available_co (_data_);
}

static gboolean
xmpp_xep_jingle_module_is_jingle_available_finish (XmppXepJingleModule* self,
                                                   GAsyncResult* _res_)
{
	gboolean result;
	XmppXepJingleModuleIsJingleAvailableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
xmpp_xep_jingle_module_is_jingle_available_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	XmppXepJingleModuleIsJingleAvailableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_module_is_jingle_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_module_is_jingle_available_co (XmppXepJingleModuleIsJingleAvailableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		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_NS_URI, xmpp_xep_jingle_module_is_jingle_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_jingle = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->has_jingle;
	if (_data_->_tmp7_ != NULL) {
		_data_->_tmp8_ = _data_->has_jingle;
		_data_->_tmp6_ = *_data_->_tmp8_;
	} else {
		_data_->_tmp6_ = FALSE;
	}
	_data_->result = _data_->_tmp6_;
	_g_free0 (_data_->has_jingle);
	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_module_is_available_data_free (gpointer _data)
{
	XmppXepJingleModuleIsAvailableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_jid_unref0 (_data_->full_jid);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleModuleIsAvailableData, _data_);
}

void
xmpp_xep_jingle_module_is_available (XmppXepJingleModule* self,
                                     XmppXmppStream* stream,
                                     XmppXepJingleTransportType type,
                                     guint8 components,
                                     XmppJid* full_jid,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	XmppXepJingleModuleIsAvailableData* _data_;
	XmppXepJingleModule* _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 (XmppXepJingleModuleIsAvailableData);
	_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_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_;
	_data_->type = type;
	_data_->components = components;
	_tmp2_ = _xmpp_jid_ref0 (full_jid);
	_xmpp_jid_unref0 (_data_->full_jid);
	_data_->full_jid = _tmp2_;
	xmpp_xep_jingle_module_is_available_co (_data_);
}

gboolean
xmpp_xep_jingle_module_is_available_finish (XmppXepJingleModule* self,
                                            GAsyncResult* _res_)
{
	gboolean result;
	XmppXepJingleModuleIsAvailableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
xmpp_xep_jingle_module_is_available_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	XmppXepJingleModuleIsAvailableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_module_is_available_co (_data_);
}

static gboolean
xmpp_xep_jingle_module_is_available_co (XmppXepJingleModuleIsAvailableData* _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_->_state_ = 1;
	xmpp_xep_jingle_module_is_jingle_available (_data_->self, _data_->stream, _data_->full_jid, xmpp_xep_jingle_module_is_available_ready, _data_);
	return FALSE;
	_state_1:
	if (xmpp_xep_jingle_module_is_jingle_available_finish (_data_->self, _data_->_res_)) {
		_data_->_tmp1_ = gee_set_empty (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_state_ = 2;
		xmpp_xep_jingle_module_select_transport (_data_->self, _data_->stream, _data_->type, _data_->components, _data_->full_jid, _data_->_tmp2_, xmpp_xep_jingle_module_is_available_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp3_ = xmpp_xep_jingle_module_select_transport_finish (_data_->self, _data_->_res_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp0_ = _data_->_tmp4_ != NULL;
		_g_object_unref0 (_data_->_tmp4_);
		_g_object_unref0 (_data_->_tmp2_);
	} else {
		_data_->_tmp0_ = 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_module_create_session_data_free (gpointer _data)
{
	XmppXepJingleModuleCreateSessionData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->contents);
	_xmpp_jid_unref0 (_data_->receiver_full_jid);
	_g_free0 (_data_->sid);
	_xmpp_jid_unref0 (_data_->muji_room);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleModuleCreateSessionData, _data_);
}

void
xmpp_xep_jingle_module_create_session (XmppXepJingleModule* self,
                                       XmppXmppStream* stream,
                                       GeeList* contents,
                                       XmppJid* receiver_full_jid,
                                       const gchar* sid,
                                       XmppJid* muji_room,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	XmppXepJingleModuleCreateSessionData* _data_;
	XmppXepJingleModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	GeeList* _tmp2_;
	XmppJid* _tmp3_;
	gchar* _tmp4_;
	XmppJid* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (contents != NULL);
	g_return_if_fail (receiver_full_jid != NULL);
	_data_ = g_slice_new0 (XmppXepJingleModuleCreateSessionData);
	_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_module_create_session_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 (contents);
	_g_object_unref0 (_data_->contents);
	_data_->contents = _tmp2_;
	_tmp3_ = _xmpp_jid_ref0 (receiver_full_jid);
	_xmpp_jid_unref0 (_data_->receiver_full_jid);
	_data_->receiver_full_jid = _tmp3_;
	_tmp4_ = g_strdup (sid);
	_g_free0 (_data_->sid);
	_data_->sid = _tmp4_;
	_tmp5_ = _xmpp_jid_ref0 (muji_room);
	_xmpp_jid_unref0 (_data_->muji_room);
	_data_->muji_room = _tmp5_;
	xmpp_xep_jingle_module_create_session_co (_data_);
}

XmppXepJingleSession*
xmpp_xep_jingle_module_create_session_finish (XmppXepJingleModule* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	XmppXepJingleSession* result;
	XmppXepJingleModuleCreateSessionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_xep_jingle_module_create_session_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	XmppXepJingleModuleCreateSessionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_module_create_session_co (_data_);
}

static void
__lambda16_ (XmppXepJingleModule* self,
             XmppXepJingleSession* session,
             XmppXmppStream* stream,
             gboolean _1,
             const gchar* _2,
             const gchar* _3)
{
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleFlag* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (session != NULL);
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_jingle_flag_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_flag (stream, XMPP_XEP_JINGLE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepJingleFlag*) _tmp1_;
	_tmp3_ = xmpp_xep_jingle_session_get_sid (session);
	_tmp4_ = _tmp3_;
	xmpp_xep_jingle_flag_remove_session (_tmp2_, _tmp4_);
	_g_object_unref0 (_tmp2_);
}

static void
___lambda16__xmpp_xep_jingle_session_terminated (XmppXepJingleSession* _sender,
                                                 XmppXmppStream* stream,
                                                 gboolean we_terminated,
                                                 const gchar* reason_name,
                                                 const gchar* reason_text,
                                                 gpointer self)
{
	__lambda16_ ((XmppXepJingleModule*) self, _sender, stream, we_terminated, reason_name, reason_text);
}

static void
__lambda17_ (XmppXepJingleModule* self,
             XmppXmppStream* stream,
             XmppIqStanza* iq)
{
	g_return_if_fail (stream != NULL);
	g_return_if_fail (iq != NULL);
	if (xmpp_stanza_is_error ((XmppStanza*) iq)) {
		XmppStanzaNode* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp0_ = ((XmppStanza*) iq)->stanza;
		_tmp1_ = xmpp_stanza_entry_to_string ((XmppStanzaEntry*) _tmp0_, 0);
		_tmp2_ = _tmp1_;
		g_warning ("jingle_module.vala:150: Jingle session-initiate got error: %s", _tmp2_);
		_g_free0 (_tmp2_);
	}
}

static void
___lambda17__xmpp_iq_module_on_result (XmppXmppStream* stream,
                                       XmppIqStanza* iq,
                                       gpointer self)
{
	__lambda17_ ((XmppXepJingleModule*) self, stream, iq);
}

static gboolean
xmpp_xep_jingle_module_create_session_co (XmppXepJingleModuleCreateSessionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	xmpp_xep_jingle_module_is_jingle_available (_data_->self, _data_->stream, _data_->receiver_full_jid, xmpp_xep_jingle_module_create_session_ready, _data_);
	return FALSE;
	_state_1:
	if (!xmpp_xep_jingle_module_is_jingle_available_finish (_data_->self, _data_->_res_)) {
		_data_->_tmp0_ = g_error_new_literal (XMPP_XEP_JINGLE_ERROR, XMPP_XEP_JINGLE_ERROR_NO_SHARED_PROTOCOLS, "No Jingle support");
		_data_->_inner_error0_ = _data_->_tmp0_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_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_->_tmp1_ = xmpp_bind_flag_IDENTITY;
	_data_->_tmp2_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
	_data_->_tmp3_ = (XmppBindFlag*) _data_->_tmp2_;
	_data_->_tmp4_ = _data_->_tmp3_->my_jid;
	_data_->_tmp5_ = _xmpp_jid_ref0 (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_g_object_unref0 (_data_->_tmp3_);
	_data_->my_jid = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->my_jid;
	if (_data_->_tmp7_ == NULL) {
		_data_->_tmp8_ = g_error_new_literal (XMPP_XEP_JINGLE_ERROR, XMPP_XEP_JINGLE_ERROR_GENERAL, "Couldn't determine own JID");
		_data_->_inner_error0_ = _data_->_tmp8_;
		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_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_jid_unref0 (_data_->my_jid);
			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_->_tmp10_ = g_strdup (_data_->sid);
	_data_->_tmp9_ = _data_->_tmp10_;
	if (_data_->_tmp9_ == NULL) {
		_data_->_tmp11_ = xmpp_random_uuid ();
		_g_free0 (_data_->_tmp9_);
		_data_->_tmp9_ = _data_->_tmp11_;
	}
	_data_->_tmp12_ = _data_->my_jid;
	_data_->_tmp13_ = xmpp_xep_jingle_session_new_initiate_sent (_data_->stream, _data_->_tmp9_, _data_->_tmp12_, _data_->receiver_full_jid);
	_data_->session = _data_->_tmp13_;
	_data_->_tmp14_ = _data_->session;
	g_signal_connect_object (_data_->_tmp14_, "terminated", (GCallback) ___lambda16__xmpp_xep_jingle_session_terminated, _data_->self, 0);
	{
		_data_->_content_list = _data_->contents;
		_data_->_tmp15_ = _data_->_content_list;
		_data_->_tmp16_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp15_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_content_size = _data_->_tmp17_;
		_data_->_content_index = -1;
		while (TRUE) {
			_data_->_content_index = _data_->_content_index + 1;
			_data_->_tmp18_ = _data_->_content_index;
			_data_->_tmp19_ = _data_->_content_size;
			if (!(_data_->_tmp18_ < _data_->_tmp19_)) {
				break;
			}
			_data_->_tmp20_ = _data_->_content_list;
			_data_->_tmp21_ = gee_list_get (_data_->_tmp20_, _data_->_content_index);
			_data_->content = (XmppXepJingleContent*) _data_->_tmp21_;
			_data_->_tmp22_ = _data_->session;
			_data_->_tmp23_ = _data_->content;
			xmpp_xep_jingle_session_insert_content (_data_->_tmp22_, _data_->_tmp23_);
			_g_object_unref0 (_data_->content);
		}
	}
	_data_->_tmp24_ = xmpp_stanza_node_new_build ("jingle", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
	_data_->_tmp25_ = _data_->_tmp24_;
	_data_->_tmp26_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp25_);
	_data_->_tmp27_ = _data_->_tmp26_;
	_data_->_tmp28_ = xmpp_stanza_node_put_attribute (_data_->_tmp27_, "action", "session-initiate", NULL);
	_data_->_tmp29_ = _data_->_tmp28_;
	_data_->_tmp30_ = _data_->my_jid;
	_data_->_tmp31_ = xmpp_jid_to_string (_data_->_tmp30_);
	_data_->_tmp32_ = _data_->_tmp31_;
	_data_->_tmp33_ = xmpp_stanza_node_put_attribute (_data_->_tmp29_, "initiator", _data_->_tmp32_, NULL);
	_data_->_tmp34_ = _data_->_tmp33_;
	_data_->_tmp35_ = _data_->session;
	_data_->_tmp36_ = xmpp_xep_jingle_session_get_sid (_data_->_tmp35_);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_tmp38_ = xmpp_stanza_node_put_attribute (_data_->_tmp34_, "sid", _data_->_tmp37_, NULL);
	_data_->_tmp39_ = _data_->_tmp38_;
	_xmpp_stanza_entry_unref0 (_data_->_tmp34_);
	_g_free0 (_data_->_tmp32_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp29_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp27_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp25_);
	_data_->initiate_jingle_iq = _data_->_tmp39_;
	{
		_data_->_vala1__content_list = _data_->contents;
		_data_->_tmp40_ = _data_->_vala1__content_list;
		_data_->_tmp41_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp40_);
		_data_->_tmp42_ = _data_->_tmp41_;
		_data_->_vala1__content_size = _data_->_tmp42_;
		_data_->_vala1__content_index = -1;
		while (TRUE) {
			_data_->_vala1__content_index = _data_->_vala1__content_index + 1;
			_data_->_tmp43_ = _data_->_vala1__content_index;
			_data_->_tmp44_ = _data_->_vala1__content_size;
			if (!(_data_->_tmp43_ < _data_->_tmp44_)) {
				break;
			}
			_data_->_tmp45_ = _data_->_vala1__content_list;
			_data_->_tmp46_ = gee_list_get (_data_->_tmp45_, _data_->_vala1__content_index);
			_data_->_vala1_content = (XmppXepJingleContent*) _data_->_tmp46_;
			_data_->_tmp47_ = xmpp_stanza_node_new_build ("content", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
			_data_->_tmp48_ = _data_->_tmp47_;
			_data_->_tmp49_ = xmpp_stanza_node_put_attribute (_data_->_tmp48_, "creator", "initiator", NULL);
			_data_->_tmp50_ = _data_->_tmp49_;
			_data_->_tmp51_ = _data_->_vala1_content;
			_data_->_tmp52_ = xmpp_xep_jingle_content_get_content_name (_data_->_tmp51_);
			_data_->_tmp53_ = _data_->_tmp52_;
			_data_->_tmp54_ = xmpp_stanza_node_put_attribute (_data_->_tmp50_, "name", _data_->_tmp53_, NULL);
			_data_->_tmp55_ = _data_->_tmp54_;
			_data_->_tmp56_ = _data_->_vala1_content;
			_data_->_tmp57_ = xmpp_xep_jingle_content_get_senders (_data_->_tmp56_);
			_data_->_tmp58_ = _data_->_tmp57_;
			_data_->_tmp59_ = xmpp_xep_jingle_senders_to_string (_data_->_tmp58_);
			_data_->_tmp60_ = _data_->_tmp59_;
			_data_->_tmp61_ = xmpp_stanza_node_put_attribute (_data_->_tmp55_, "senders", _data_->_tmp60_, NULL);
			_data_->_tmp62_ = _data_->_tmp61_;
			_data_->_tmp63_ = _data_->_vala1_content;
			_data_->_tmp64_ = _data_->_tmp63_->content_params;
			_data_->_tmp65_ = xmpp_xep_jingle_content_parameters_get_description_node (_data_->_tmp64_);
			_data_->_tmp66_ = _data_->_tmp65_;
			_data_->_tmp67_ = xmpp_stanza_node_put_node (_data_->_tmp62_, _data_->_tmp66_);
			_data_->_tmp68_ = _data_->_tmp67_;
			_data_->_tmp69_ = _data_->_vala1_content;
			_data_->_tmp70_ = _data_->_tmp69_->transport_params;
			_data_->_tmp71_ = xmpp_xep_jingle_transport_parameters_to_transport_stanza_node (_data_->_tmp70_, "session-initiate");
			_data_->_tmp72_ = _data_->_tmp71_;
			_data_->_tmp73_ = xmpp_stanza_node_put_node (_data_->_tmp68_, _data_->_tmp72_);
			_data_->_tmp74_ = _data_->_tmp73_;
			_xmpp_stanza_entry_unref0 (_data_->_tmp72_);
			_xmpp_stanza_entry_unref0 (_data_->_tmp68_);
			_xmpp_stanza_entry_unref0 (_data_->_tmp66_);
			_xmpp_stanza_entry_unref0 (_data_->_tmp62_);
			_g_free0 (_data_->_tmp60_);
			_xmpp_stanza_entry_unref0 (_data_->_tmp55_);
			_xmpp_stanza_entry_unref0 (_data_->_tmp50_);
			_xmpp_stanza_entry_unref0 (_data_->_tmp48_);
			_data_->content_node = _data_->_tmp74_;
			_data_->_tmp75_ = _data_->_vala1_content;
			_data_->_tmp76_ = _data_->_tmp75_->security_params;
			if (_data_->_tmp76_ != NULL) {
				_data_->_tmp77_ = _data_->content_node;
				_data_->_tmp78_ = _data_->_vala1_content;
				_data_->_tmp79_ = _data_->_tmp78_->security_params;
				_data_->_tmp80_ = _data_->my_jid;
				_data_->_tmp81_ = xmpp_xep_jingle_security_parameters_to_security_stanza_node (_data_->_tmp79_, _data_->stream, _data_->_tmp80_, _data_->receiver_full_jid);
				_data_->_tmp82_ = _data_->_tmp81_;
				_data_->_tmp83_ = xmpp_stanza_node_put_node (_data_->_tmp77_, _data_->_tmp82_);
				_data_->_tmp84_ = _data_->_tmp83_;
				_xmpp_stanza_entry_unref0 (_data_->_tmp84_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp82_);
			}
			_data_->_tmp85_ = _data_->initiate_jingle_iq;
			_data_->_tmp86_ = _data_->content_node;
			_data_->_tmp87_ = xmpp_stanza_node_put_node (_data_->_tmp85_, _data_->_tmp86_);
			_data_->_tmp88_ = _data_->_tmp87_;
			_xmpp_stanza_entry_unref0 (_data_->_tmp88_);
			_xmpp_stanza_entry_unref0 (_data_->content_node);
			_g_object_unref0 (_data_->_vala1_content);
		}
	}
	if (_data_->muji_room != NULL) {
		_data_->_tmp89_ = _data_->initiate_jingle_iq;
		_data_->_tmp90_ = xmpp_stanza_node_new_build ("muji", XMPP_XEP_MUJI_NS_URI, NULL, NULL);
		_data_->_tmp91_ = _data_->_tmp90_;
		_data_->_tmp92_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp91_);
		_data_->_tmp93_ = _data_->_tmp92_;
		_data_->_tmp94_ = xmpp_jid_to_string (_data_->muji_room);
		_data_->_tmp95_ = _data_->_tmp94_;
		_data_->_tmp96_ = xmpp_stanza_node_put_attribute (_data_->_tmp93_, "room", _data_->_tmp95_, NULL);
		_data_->_tmp97_ = _data_->_tmp96_;
		_data_->_tmp98_ = xmpp_stanza_node_put_node (_data_->_tmp89_, _data_->_tmp97_);
		_data_->_tmp99_ = _data_->_tmp98_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp99_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp97_);
		_g_free0 (_data_->_tmp95_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp93_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp91_);
	}
	_data_->_tmp100_ = _data_->initiate_jingle_iq;
	_data_->_tmp101_ = _xmpp_jid_ref0 (_data_->receiver_full_jid);
	_data_->_tmp102_ = NULL;
	_data_->_tmp102_ = xmpp_iq_stanza_new_set (_data_->_tmp100_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _data_->_tmp102_, _data_->_tmp101_);
	_xmpp_jid_unref0 (_data_->_tmp101_);
	_data_->iq = _data_->_tmp102_;
	_data_->_tmp103_ = xmpp_xep_jingle_flag_IDENTITY;
	_data_->_tmp104_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_XEP_JINGLE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp103_);
	_data_->_tmp105_ = (XmppXepJingleFlag*) _data_->_tmp104_;
	_data_->_tmp106_ = _data_->session;
	xmpp_xep_jingle_flag_add_session (_data_->_tmp105_, _data_->_tmp106_);
	_g_object_unref0 (_data_->_tmp105_);
	_data_->_tmp107_ = xmpp_iq_module_IDENTITY;
	_data_->_tmp108_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp107_);
	_data_->_tmp109_ = (XmppIqModule*) _data_->_tmp108_;
	_data_->_tmp110_ = _data_->iq;
	xmpp_iq_module_send_iq (_data_->_tmp109_, _data_->stream, _data_->_tmp110_, ___lambda17__xmpp_iq_module_on_result, g_object_ref (_data_->self), g_object_unref, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_data_->_tmp109_);
	_data_->result = _data_->session;
	_g_object_unref0 (_data_->iq);
	_xmpp_stanza_entry_unref0 (_data_->initiate_jingle_iq);
	_g_free0 (_data_->_tmp9_);
	_xmpp_jid_unref0 (_data_->my_jid);
	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_module_handle_session_initiate_data_free (gpointer _data)
{
	XmppXepJingleModuleHandleSessionInitiateData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_stanza_entry_unref0 (_data_->jingle);
	_g_object_unref0 (_data_->iq);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleModuleHandleSessionInitiateData, _data_);
}

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

void
xmpp_xep_jingle_module_handle_session_initiate (XmppXepJingleModule* self,
                                                XmppXmppStream* stream,
                                                const gchar* sid,
                                                XmppStanzaNode* jingle,
                                                XmppIqStanza* iq,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	XmppXepJingleModuleHandleSessionInitiateData* _data_;
	XmppXepJingleModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	gchar* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppIqStanza* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (sid != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	_data_ = g_slice_new0 (XmppXepJingleModuleHandleSessionInitiateData);
	_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_module_handle_session_initiate_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_strdup (sid);
	_g_free0 (_data_->sid);
	_data_->sid = _tmp2_;
	_tmp3_ = _xmpp_stanza_entry_ref0 (jingle);
	_xmpp_stanza_entry_unref0 (_data_->jingle);
	_data_->jingle = _tmp3_;
	_tmp4_ = _g_object_ref0 (iq);
	_g_object_unref0 (_data_->iq);
	_data_->iq = _tmp4_;
	xmpp_xep_jingle_module_handle_session_initiate_co (_data_);
}

void
xmpp_xep_jingle_module_handle_session_initiate_finish (XmppXepJingleModule* self,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	XmppXepJingleModuleHandleSessionInitiateData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		XmppXepJingleModule* self;
		self = _data9_->self;
		_g_free0 (_data9_->sid);
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}

static void
__lambda18_ (Block9Data* _data9_,
             XmppXmppStream* stream)
{
	XmppXepJingleModule* self;
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleFlag* _tmp2_;
	self = _data9_->self;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_jingle_flag_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_flag (stream, XMPP_XEP_JINGLE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepJingleFlag*) _tmp1_;
	xmpp_xep_jingle_flag_remove_session (_tmp2_, _data9_->sid);
	_g_object_unref0 (_tmp2_);
}

static void
___lambda18__xmpp_xep_jingle_session_terminated (XmppXepJingleSession* _sender,
                                                 XmppXmppStream* stream,
                                                 gboolean we_terminated,
                                                 const gchar* reason_name,
                                                 const gchar* reason_text,
                                                 gpointer self)
{
	__lambda18_ (self, stream);
}

static void
xmpp_xep_jingle_module_handle_session_initiate_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	XmppXepJingleModuleHandleSessionInitiateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_module_handle_session_initiate_co (_data_);
}

static gboolean
xmpp_xep_jingle_module_handle_session_initiate_co (XmppXepJingleModuleHandleSessionInitiateData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data9_ = g_slice_new0 (Block9Data);
	_data_->_data9_->_ref_count_ = 1;
	_data_->_data9_->self = g_object_ref (_data_->self);
	_g_free0 (_data_->_data9_->sid);
	_data_->_data9_->sid = _data_->sid;
	_data_->_data9_->_async_data_ = _data_;
	_data_->_tmp0_ = xmpp_bind_flag_IDENTITY;
	_data_->_tmp1_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp0_);
	_data_->_tmp2_ = (XmppBindFlag*) _data_->_tmp1_;
	_data_->_tmp3_ = _data_->_tmp2_->my_jid;
	_data_->_tmp4_ = _xmpp_jid_ref0 (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_g_object_unref0 (_data_->_tmp2_);
	_data_->my_jid = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->my_jid;
	if (_data_->_tmp6_ == NULL) {
		_data_->_tmp7_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_RESOURCE_CONSTRAINT, "Couldn't determine own JID");
		_data_->_inner_error0_ = _data_->_tmp7_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_jid_unref0 (_data_->my_jid);
			block9_data_unref (_data_->_data9_);
			_data_->_data9_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_jid_unref0 (_data_->my_jid);
			block9_data_unref (_data_->_data9_);
			_data_->_data9_ = 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_->_tmp8_ = _data_->my_jid;
	_data_->_tmp9_ = xmpp_stanza_get_from ((XmppStanza*) _data_->iq);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = xmpp_xep_jingle_session_new_initiate_received (_data_->stream, _data_->_data9_->sid, _data_->_tmp8_, _data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_xmpp_jid_unref0 (_data_->_tmp11_);
	_data_->session = _data_->_tmp13_;
	_data_->_tmp14_ = _data_->session;
	g_signal_connect_data (_data_->_tmp14_, "terminated", (GCallback) ___lambda18__xmpp_xep_jingle_session_terminated, block9_data_ref (_data_->_data9_), (GClosureNotify) block9_data_unref, 0);
	_data_->_tmp15_ = ((XmppStanza*) _data_->iq)->stanza;
	_data_->_tmp16_ = xmpp_stanza_node_get_deep_attribute (_data_->_tmp15_, XMPP_XEP_JINGLE_NS_URI ":jingle", XMPP_XEP_MUJI_NS_URI ":muji", "room", NULL);
	_data_->_tmp17_ = g_strdup (_data_->_tmp16_);
	_data_->muji_room_str = _data_->_tmp17_;
	_data_->_tmp18_ = _data_->muji_room_str;
	if (_data_->_tmp18_ != NULL) {
		{
			_data_->_tmp20_ = _data_->muji_room_str;
			_data_->_tmp21_ = xmpp_jid_new (_data_->_tmp20_, &_data_->_inner_error0_);
			_data_->_tmp19_ = _data_->_tmp21_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch0_xmpp_invalid_jid_error;
				}
				_g_free0 (_data_->muji_room_str);
				_g_object_unref0 (_data_->session);
				_xmpp_jid_unref0 (_data_->my_jid);
				block9_data_unref (_data_->_data9_);
				_data_->_data9_ = NULL;
				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_->_tmp22_ = _data_->session;
			xmpp_xep_jingle_session_set_muji_room (_data_->_tmp22_, _data_->_tmp19_);
			_xmpp_jid_unref0 (_data_->_tmp19_);
		}
		goto __finally0;
		__catch0_xmpp_invalid_jid_error:
		{
			g_clear_error (&_data_->_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_free0 (_data_->muji_room_str);
				_g_object_unref0 (_data_->session);
				_xmpp_jid_unref0 (_data_->my_jid);
				block9_data_unref (_data_->_data9_);
				_data_->_data9_ = NULL;
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_free0 (_data_->muji_room_str);
				_g_object_unref0 (_data_->session);
				_xmpp_jid_unref0 (_data_->my_jid);
				block9_data_unref (_data_->_data9_);
				_data_->_data9_ = 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_->_tmp23_ = xmpp_xep_jingle_flag_IDENTITY;
	_data_->_tmp24_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_XEP_JINGLE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp23_);
	_data_->_tmp25_ = (XmppXepJingleFlag*) _data_->_tmp24_;
	_data_->_tmp26_ = _data_->session;
	_data_->_tmp27_ = xmpp_xep_jingle_session_get_sid (_data_->_tmp26_);
	_data_->_tmp28_ = _data_->_tmp27_;
	xmpp_xep_jingle_flag_pre_add_session (_data_->_tmp25_, _data_->_tmp28_);
	_g_object_unref0 (_data_->_tmp25_);
	_data_->_tmp30_ = xmpp_xep_jingle_get_content_nodes (_data_->jingle, &_data_->_inner_error0_);
	_data_->_tmp29_ = _data_->_tmp30_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->muji_room_str);
			_g_object_unref0 (_data_->session);
			_xmpp_jid_unref0 (_data_->my_jid);
			block9_data_unref (_data_->_data9_);
			_data_->_data9_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->muji_room_str);
			_g_object_unref0 (_data_->session);
			_xmpp_jid_unref0 (_data_->my_jid);
			block9_data_unref (_data_->_data9_);
			_data_->_data9_ = 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_->_content_node_list = _data_->_tmp29_;
		_data_->_tmp31_ = _data_->_content_node_list;
		_data_->_tmp32_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp31_);
		_data_->_tmp33_ = _data_->_tmp32_;
		_data_->_content_node_size = _data_->_tmp33_;
		_data_->_content_node_index = -1;
		while (TRUE) {
			_data_->_content_node_index = _data_->_content_node_index + 1;
			_data_->_tmp34_ = _data_->_content_node_index;
			_data_->_tmp35_ = _data_->_content_node_size;
			if (!(_data_->_tmp34_ < _data_->_tmp35_)) {
				break;
			}
			_data_->_tmp36_ = _data_->_content_node_list;
			_data_->_tmp37_ = gee_list_get (_data_->_tmp36_, _data_->_content_node_index);
			_data_->content_node = (XmppXepJingleContentNode*) _data_->_tmp37_;
			_data_->_tmp38_ = _data_->session;
			_data_->_tmp39_ = _data_->content_node;
			_data_->_tmp40_ = xmpp_stanza_get_from ((XmppStanza*) _data_->iq);
			_data_->_tmp41_ = _data_->_tmp40_;
			_data_->_tmp42_ = _data_->_tmp41_;
			_data_->_state_ = 1;
			xmpp_xep_jingle_session_insert_content_node (_data_->_tmp38_, _data_->_tmp39_, _data_->_tmp42_, xmpp_xep_jingle_module_handle_session_initiate_ready, _data_);
			return FALSE;
			_state_1:
			xmpp_xep_jingle_session_insert_content_node_finish (_data_->_tmp38_, _data_->_res_, &_data_->_inner_error0_);
			_xmpp_jid_unref0 (_data_->_tmp42_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_xmpp_xep_jingle_content_node_unref0 (_data_->content_node);
					_g_object_unref0 (_data_->_tmp29_);
					_g_free0 (_data_->muji_room_str);
					_g_object_unref0 (_data_->session);
					_xmpp_jid_unref0 (_data_->my_jid);
					block9_data_unref (_data_->_data9_);
					_data_->_data9_ = NULL;
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_xmpp_xep_jingle_content_node_unref0 (_data_->content_node);
					_g_object_unref0 (_data_->_tmp29_);
					_g_free0 (_data_->muji_room_str);
					_g_object_unref0 (_data_->session);
					_xmpp_jid_unref0 (_data_->my_jid);
					block9_data_unref (_data_->_data9_);
					_data_->_data9_ = 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;
				}
			}
			_xmpp_xep_jingle_content_node_unref0 (_data_->content_node);
		}
	}
	_data_->_tmp43_ = xmpp_xep_jingle_flag_IDENTITY;
	_data_->_tmp44_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_XEP_JINGLE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp43_);
	_data_->_tmp45_ = (XmppXepJingleFlag*) _data_->_tmp44_;
	_data_->_tmp46_ = _data_->session;
	xmpp_xep_jingle_flag_add_session (_data_->_tmp45_, _data_->_tmp46_);
	_g_object_unref0 (_data_->_tmp45_);
	_data_->_tmp47_ = xmpp_iq_module_IDENTITY;
	_data_->_tmp48_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp47_);
	_data_->_tmp49_ = (XmppIqModule*) _data_->_tmp48_;
	_data_->_tmp50_ = xmpp_iq_stanza_new_result (_data_->iq, NULL);
	_data_->_tmp51_ = _data_->_tmp50_;
	xmpp_iq_module_send_iq (_data_->_tmp49_, _data_->stream, _data_->_tmp51_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_data_->_tmp51_);
	_g_object_unref0 (_data_->_tmp49_);
	_data_->_tmp52_ = _data_->session;
	g_signal_emit (_data_->self, xmpp_xep_jingle_module_signals[XMPP_XEP_JINGLE_MODULE_SESSION_INITIATE_RECEIVED_SIGNAL], 0, _data_->stream, _data_->_tmp52_);
	_g_object_unref0 (_data_->_tmp29_);
	_g_free0 (_data_->muji_room_str);
	_g_object_unref0 (_data_->session);
	_xmpp_jid_unref0 (_data_->my_jid);
	block9_data_unref (_data_->_data9_);
	_data_->_data9_ = 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 void
xmpp_xep_jingle_module_real_on_iq_set_data_free (gpointer _data)
{
	XmppXepJingleModuleOnIqSetData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->iq);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleModuleOnIqSetData, _data_);
}

static void
xmpp_xep_jingle_module_real_on_iq_set (XmppIqHandler* base,
                                       XmppXmppStream* stream,
                                       XmppIqStanza* iq,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	XmppXepJingleModule * self;
	XmppXepJingleModuleOnIqSetData* _data_;
	XmppXepJingleModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppIqStanza* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (iq != NULL);
	self = (XmppXepJingleModule*) base;
	_data_ = g_slice_new0 (XmppXepJingleModuleOnIqSetData);
	_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_module_real_on_iq_set_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 (iq);
	_g_object_unref0 (_data_->iq);
	_data_->iq = _tmp2_;
	xmpp_xep_jingle_module_real_on_iq_set_co (_data_);
}

static void
xmpp_xep_jingle_module_on_iq_set_finish (XmppIqHandler* base,
                                         GAsyncResult* _res_)
{
	XmppXepJingleModuleOnIqSetData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_jingle_module_on_iq_set_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	XmppXepJingleModuleOnIqSetData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_module_real_on_iq_set_co (_data_);
}

static gboolean
xmpp_xep_jingle_module_real_on_iq_set_co (XmppXepJingleModuleOnIqSetData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		xmpp_xep_jingle_module_handle_iq_set (_data_->self, _data_->stream, _data_->iq, xmpp_xep_jingle_module_on_iq_set_ready, _data_);
		return FALSE;
		_state_1:
		xmpp_xep_jingle_module_handle_iq_set_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
				goto __catch0_xmpp_xep_jingle_iq_error;
			}
			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;
		}
	}
	goto __finally0;
	__catch0_xmpp_xep_jingle_iq_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp0_ = _data_->e;
		xmpp_xep_jingle_send_iq_error (_data_->_tmp0_, _data_->stream, _data_->iq);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_jingle_module_handle_iq_set_data_free (gpointer _data)
{
	XmppXepJingleModuleHandleIqSetData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->iq);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleModuleHandleIqSetData, _data_);
}

void
xmpp_xep_jingle_module_handle_iq_set (XmppXepJingleModule* self,
                                      XmppXmppStream* stream,
                                      XmppIqStanza* iq,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	XmppXepJingleModuleHandleIqSetData* _data_;
	XmppXepJingleModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppIqStanza* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (iq != NULL);
	_data_ = g_slice_new0 (XmppXepJingleModuleHandleIqSetData);
	_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_module_handle_iq_set_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 (iq);
	_g_object_unref0 (_data_->iq);
	_data_->iq = _tmp2_;
	xmpp_xep_jingle_module_handle_iq_set_co (_data_);
}

void
xmpp_xep_jingle_module_handle_iq_set_finish (XmppXepJingleModule* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	XmppXepJingleModuleHandleIqSetData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
xmpp_xep_jingle_module_handle_iq_set_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	XmppXepJingleModuleHandleIqSetData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_module_handle_iq_set_co (_data_);
}

static gboolean
xmpp_xep_jingle_module_handle_iq_set_co (XmppXepJingleModuleHandleIqSetData* _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_ = ((XmppStanza*) _data_->iq)->stanza;
	_data_->_tmp1_ = xmpp_stanza_node_get_subnode (_data_->_tmp0_, "jingle", XMPP_XEP_JINGLE_NS_URI, FALSE);
	_data_->jingle_node = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->jingle_node;
	if (_data_->_tmp2_ == NULL) {
		_data_->_tmp3_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing jingle node");
		_data_->_inner_error0_ = _data_->_tmp3_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_xmpp_stanza_entry_unref0 (_data_->jingle_node);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_xmpp_stanza_entry_unref0 (_data_->jingle_node);
			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_->_tmp4_ = _data_->jingle_node;
	_data_->_tmp5_ = xmpp_stanza_node_get_attribute (_data_->_tmp4_, "sid", NULL);
	_data_->_tmp6_ = g_strdup (_data_->_tmp5_);
	_data_->sid = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->jingle_node;
	_data_->_tmp8_ = xmpp_stanza_node_get_attribute (_data_->_tmp7_, "action", NULL);
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->action = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->sid;
	if (_data_->_tmp11_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp12_ = _data_->action;
		_data_->_tmp10_ = _data_->_tmp12_ == NULL;
	}
	if (_data_->_tmp10_) {
		_data_->_tmp13_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing jingle node, sid or action");
		_data_->_inner_error0_ = _data_->_tmp13_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_free0 (_data_->action);
			_g_free0 (_data_->sid);
			_xmpp_stanza_entry_unref0 (_data_->jingle_node);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_free0 (_data_->action);
			_g_free0 (_data_->sid);
			_xmpp_stanza_entry_unref0 (_data_->jingle_node);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp14_ = xmpp_xep_jingle_flag_IDENTITY;
	_data_->_tmp15_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_XEP_JINGLE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp14_);
	_data_->_tmp16_ = (XmppXepJingleFlag*) _data_->_tmp15_;
	_data_->_tmp17_ = _data_->sid;
	_data_->_state_ = 1;
	xmpp_xep_jingle_flag_get_session (_data_->_tmp16_, _data_->_tmp17_, xmpp_xep_jingle_module_handle_iq_set_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp18_ = xmpp_xep_jingle_flag_get_session_finish (_data_->_tmp16_, _data_->_res_);
	_data_->_tmp19_ = _data_->_tmp18_;
	_g_object_unref0 (_data_->_tmp16_);
	_data_->session = _data_->_tmp19_;
	_data_->_tmp20_ = _data_->action;
	if (g_strcmp0 (_data_->_tmp20_, "session-initiate") == 0) {
		_data_->_tmp21_ = _data_->session;
		if (_data_->_tmp21_ != NULL) {
			_data_->_tmp22_ = xmpp_iq_module_IDENTITY;
			_data_->_tmp23_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp22_);
			_data_->_tmp24_ = (XmppIqModule*) _data_->_tmp23_;
			_data_->_tmp25_ = xmpp_error_stanza_new_build (XMPP_ERROR_STANZA_TYPE_MODIFY, XMPP_ERROR_STANZA_CONDITION_CONFLICT, "session ID already in use", NULL);
			_data_->_tmp26_ = _data_->_tmp25_;
			_data_->_tmp27_ = xmpp_stanza_get_from ((XmppStanza*) _data_->iq);
			_data_->_tmp28_ = _data_->_tmp27_;
			_data_->_tmp29_ = NULL;
			_data_->_tmp29_ = xmpp_iq_stanza_new_error (_data_->iq, _data_->_tmp26_);
			xmpp_stanza_set_to ((XmppStanza*) _data_->_tmp29_, _data_->_tmp28_);
			_xmpp_jid_unref0 (_data_->_tmp28_);
			_data_->_tmp30_ = _data_->_tmp29_;
			xmpp_iq_module_send_iq (_data_->_tmp24_, _data_->stream, _data_->_tmp30_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
			_g_object_unref0 (_data_->_tmp30_);
			_xmpp_error_stanza_unref0 (_data_->_tmp26_);
			_g_object_unref0 (_data_->_tmp24_);
			_g_object_unref0 (_data_->session);
			_g_free0 (_data_->action);
			_g_free0 (_data_->sid);
			_xmpp_stanza_entry_unref0 (_data_->jingle_node);
			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_->_tmp31_ = _data_->sid;
		_data_->_tmp32_ = _data_->jingle_node;
		_data_->_state_ = 2;
		xmpp_xep_jingle_module_handle_session_initiate (_data_->self, _data_->stream, _data_->_tmp31_, _data_->_tmp32_, _data_->iq, xmpp_xep_jingle_module_handle_iq_set_ready, _data_);
		return FALSE;
		_state_2:
		xmpp_xep_jingle_module_handle_session_initiate_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->session);
				_g_free0 (_data_->action);
				_g_free0 (_data_->sid);
				_xmpp_stanza_entry_unref0 (_data_->jingle_node);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_object_unref0 (_data_->session);
				_g_free0 (_data_->action);
				_g_free0 (_data_->sid);
				_xmpp_stanza_entry_unref0 (_data_->jingle_node);
				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_free0 (_data_->action);
		_g_free0 (_data_->sid);
		_xmpp_stanza_entry_unref0 (_data_->jingle_node);
		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_->_tmp33_ = _data_->session;
	if (_data_->_tmp33_ == NULL) {
		_data_->_tmp34_ = xmpp_stanza_node_new_build ("unknown-session", XMPP_XEP_JINGLE_ERROR_NS_URI, NULL, NULL);
		_data_->_tmp35_ = _data_->_tmp34_;
		_data_->_tmp36_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp35_);
		_data_->unknown_session = _data_->_tmp37_;
		_data_->_tmp38_ = xmpp_iq_module_IDENTITY;
		_data_->_tmp39_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp38_);
		_data_->_tmp40_ = (XmppIqModule*) _data_->_tmp39_;
		_data_->_tmp41_ = _data_->unknown_session;
		_data_->_tmp42_ = xmpp_error_stanza_new_item_not_found (_data_->_tmp41_);
		_data_->_tmp43_ = _data_->_tmp42_;
		_data_->_tmp44_ = xmpp_stanza_get_from ((XmppStanza*) _data_->iq);
		_data_->_tmp45_ = _data_->_tmp44_;
		_data_->_tmp46_ = NULL;
		_data_->_tmp46_ = xmpp_iq_stanza_new_error (_data_->iq, _data_->_tmp43_);
		xmpp_stanza_set_to ((XmppStanza*) _data_->_tmp46_, _data_->_tmp45_);
		_xmpp_jid_unref0 (_data_->_tmp45_);
		_data_->_tmp47_ = _data_->_tmp46_;
		xmpp_iq_module_send_iq (_data_->_tmp40_, _data_->stream, _data_->_tmp47_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
		_g_object_unref0 (_data_->_tmp47_);
		_xmpp_error_stanza_unref0 (_data_->_tmp43_);
		_g_object_unref0 (_data_->_tmp40_);
		_xmpp_stanza_entry_unref0 (_data_->unknown_session);
		_g_object_unref0 (_data_->session);
		_g_free0 (_data_->action);
		_g_free0 (_data_->sid);
		_xmpp_stanza_entry_unref0 (_data_->jingle_node);
		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_->_tmp48_ = _data_->session;
	_data_->_tmp49_ = _data_->action;
	_data_->_tmp50_ = _data_->jingle_node;
	xmpp_xep_jingle_session_handle_iq_set (_data_->_tmp48_, _data_->_tmp49_, _data_->_tmp50_, _data_->iq, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->session);
			_g_free0 (_data_->action);
			_g_free0 (_data_->sid);
			_xmpp_stanza_entry_unref0 (_data_->jingle_node);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->session);
			_g_free0 (_data_->action);
			_g_free0 (_data_->sid);
			_xmpp_stanza_entry_unref0 (_data_->jingle_node);
			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_free0 (_data_->action);
	_g_free0 (_data_->sid);
	_xmpp_stanza_entry_unref0 (_data_->jingle_node);
	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_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppXepJingleModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppXepJingleModule*) base;
	_tmp0_ = g_strdup (XMPP_XEP_JINGLE_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_xep_jingle_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppXepJingleModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppXepJingleModule*) base;
	_tmp0_ = xmpp_xep_jingle_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

XmppXepJingleModule*
xmpp_xep_jingle_module_construct (GType object_type)
{
	XmppXepJingleModule * self = NULL;
	self = (XmppXepJingleModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppXepJingleModule*
xmpp_xep_jingle_module_new (void)
{
	return xmpp_xep_jingle_module_construct (XMPP_XEP_JINGLE_TYPE_MODULE);
}

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_module_class_init (XmppXepJingleModuleClass * klass,
                                   gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_xep_jingle_module_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleModule_private_offset);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_jingle_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_jingle_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_jingle_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_jingle_module_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_module_finalize;
	xmpp_xep_jingle_module_signals[XMPP_XEP_JINGLE_MODULE_SESSION_INITIATE_RECEIVED_SIGNAL] = g_signal_new ("session-initiate-received", XMPP_XEP_JINGLE_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_TYPE_SESSION);
	_tmp0_ = xmpp_module_identity_new (XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_XEP_JINGLE_NS_URI, "0166_jingle");
	xmpp_xep_jingle_module_IDENTITY = _tmp0_;
}

static void
xmpp_xep_jingle_module_xmpp_iq_handler_interface_init (XmppIqHandlerIface * iface,
                                                       gpointer iface_data)
{
	xmpp_xep_jingle_module_xmpp_iq_handler_parent_iface = g_type_interface_peek_parent (iface);
	iface->on_iq_set = (void (*) (XmppIqHandler*, XmppXmppStream*, XmppIqStanza*, GAsyncReadyCallback, gpointer)) xmpp_xep_jingle_module_real_on_iq_set;
	iface->on_iq_set_finish = (void (*) (XmppIqHandler*, GAsyncResult*)) xmpp_xep_jingle_module_on_iq_set_finish;
}

static void
xmpp_xep_jingle_module_instance_init (XmppXepJingleModule * self,
                                      gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	self->priv = xmpp_xep_jingle_module_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, XMPP_XEP_JINGLE_TYPE_CONTENT_TYPE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->content_types = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, XMPP_XEP_JINGLE_TYPE_SESSION_INFO_NS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->session_info_types = _tmp1_;
	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, XMPP_XEP_JINGLE_TYPE_TRANSPORT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->transports = _tmp2_;
	_tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, XMPP_XEP_JINGLE_TYPE_SECURITY_PRECONDITION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->security_preconditions = _tmp3_;
}

static void
xmpp_xep_jingle_module_finalize (GObject * obj)
{
	XmppXepJingleModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_TYPE_MODULE, XmppXepJingleModule);
	_g_object_unref0 (self->priv->content_types);
	_g_object_unref0 (self->priv->session_info_types);
	_g_object_unref0 (self->priv->transports);
	_g_object_unref0 (self->priv->security_preconditions);
	G_OBJECT_CLASS (xmpp_xep_jingle_module_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleModule), 0, (GInstanceInitFunc) xmpp_xep_jingle_module_instance_init, NULL };
	static const GInterfaceInfo xmpp_iq_handler_info = { (GInterfaceInitFunc) xmpp_xep_jingle_module_xmpp_iq_handler_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_module_type_id;
	xmpp_xep_jingle_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppXepJingleModule", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_module_type_id, XMPP_IQ_TYPE_HANDLER, &xmpp_iq_handler_info);
	XmppXepJingleModule_private_offset = g_type_add_instance_private (xmpp_xep_jingle_module_type_id, sizeof (XmppXepJingleModulePrivate));
	return xmpp_xep_jingle_module_type_id;
}

GType
xmpp_xep_jingle_module_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_module_type_id__once)) {
		GType xmpp_xep_jingle_module_type_id;
		xmpp_xep_jingle_module_type_id = xmpp_xep_jingle_module_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_module_type_id__once, xmpp_xep_jingle_module_type_id);
	}
	return xmpp_xep_jingle_module_type_id__once;
}

void
xmpp_xep_jingle_send_iq_error (GError* iq_error,
                               XmppXmppStream* stream,
                               XmppIqStanza* iq)
{
	XmppErrorStanza* _error_ = NULL;
	XmppModuleIdentity* _tmp22_;
	gpointer _tmp23_;
	XmppIqModule* _tmp24_;
	XmppErrorStanza* _tmp25_;
	XmppJid* _tmp26_;
	XmppJid* _tmp27_;
	XmppIqStanza* _tmp28_ = NULL;
	XmppIqStanza* _tmp29_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (iq != NULL);
	if (g_error_matches (iq_error, XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST)) {
		const gchar* _tmp0_;
		XmppErrorStanza* _tmp1_;
		_tmp0_ = iq_error->message;
		_tmp1_ = xmpp_error_stanza_new_bad_request (_tmp0_);
		_xmpp_error_stanza_unref0 (_error_);
		_error_ = _tmp1_;
	} else {
		if (g_error_matches (iq_error, XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_NOT_ACCEPTABLE)) {
			const gchar* _tmp2_;
			XmppErrorStanza* _tmp3_;
			_tmp2_ = iq_error->message;
			_tmp3_ = xmpp_error_stanza_new_not_acceptable (_tmp2_);
			_xmpp_error_stanza_unref0 (_error_);
			_error_ = _tmp3_;
		} else {
			if (g_error_matches (iq_error, XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_NOT_IMPLEMENTED)) {
				const gchar* _tmp4_;
				XmppErrorStanza* _tmp5_;
				_tmp4_ = iq_error->message;
				_tmp5_ = xmpp_error_stanza_new_feature_not_implemented (_tmp4_);
				_xmpp_error_stanza_unref0 (_error_);
				_error_ = _tmp5_;
			} else {
				if (g_error_matches (iq_error, XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_UNSUPPORTED_INFO)) {
					XmppStanzaNode* unsupported_info = NULL;
					XmppStanzaNode* _tmp6_;
					XmppStanzaNode* _tmp7_;
					XmppStanzaNode* _tmp8_;
					XmppStanzaNode* _tmp9_;
					const gchar* _tmp10_;
					XmppStanzaNode* _tmp11_;
					XmppErrorStanza* _tmp12_;
					_tmp6_ = xmpp_stanza_node_new_build ("unsupported-info", XMPP_XEP_JINGLE_ERROR_NS_URI, NULL, NULL);
					_tmp7_ = _tmp6_;
					_tmp8_ = xmpp_stanza_node_add_self_xmlns (_tmp7_);
					_tmp9_ = _tmp8_;
					_xmpp_stanza_entry_unref0 (_tmp7_);
					unsupported_info = _tmp9_;
					_tmp10_ = iq_error->message;
					_tmp11_ = unsupported_info;
					_tmp12_ = xmpp_error_stanza_new_build (XMPP_ERROR_STANZA_TYPE_CANCEL, XMPP_ERROR_STANZA_CONDITION_FEATURE_NOT_IMPLEMENTED, _tmp10_, _tmp11_);
					_xmpp_error_stanza_unref0 (_error_);
					_error_ = _tmp12_;
					_xmpp_stanza_entry_unref0 (unsupported_info);
				} else {
					if (g_error_matches (iq_error, XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_OUT_OF_ORDER)) {
						XmppStanzaNode* out_of_order = NULL;
						XmppStanzaNode* _tmp13_;
						XmppStanzaNode* _tmp14_;
						XmppStanzaNode* _tmp15_;
						XmppStanzaNode* _tmp16_;
						const gchar* _tmp17_;
						XmppStanzaNode* _tmp18_;
						XmppErrorStanza* _tmp19_;
						_tmp13_ = xmpp_stanza_node_new_build ("out-of-order", XMPP_XEP_JINGLE_ERROR_NS_URI, NULL, NULL);
						_tmp14_ = _tmp13_;
						_tmp15_ = xmpp_stanza_node_add_self_xmlns (_tmp14_);
						_tmp16_ = _tmp15_;
						_xmpp_stanza_entry_unref0 (_tmp14_);
						out_of_order = _tmp16_;
						_tmp17_ = iq_error->message;
						_tmp18_ = out_of_order;
						_tmp19_ = xmpp_error_stanza_new_build (XMPP_ERROR_STANZA_TYPE_MODIFY, XMPP_ERROR_STANZA_CONDITION_UNEXPECTED_REQUEST, _tmp17_, _tmp18_);
						_xmpp_error_stanza_unref0 (_error_);
						_error_ = _tmp19_;
						_xmpp_stanza_entry_unref0 (out_of_order);
					} else {
						if (g_error_matches (iq_error, XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_RESOURCE_CONSTRAINT)) {
							const gchar* _tmp20_;
							XmppErrorStanza* _tmp21_;
							_tmp20_ = iq_error->message;
							_tmp21_ = xmpp_error_stanza_new_resource_constraint (_tmp20_);
							_xmpp_error_stanza_unref0 (_error_);
							_error_ = _tmp21_;
						} else {
							g_assert_not_reached ();
						}
					}
				}
			}
		}
	}
	_tmp22_ = xmpp_iq_module_IDENTITY;
	_tmp23_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp22_);
	_tmp24_ = (XmppIqModule*) _tmp23_;
	_tmp25_ = _error_;
	_tmp26_ = xmpp_stanza_get_from ((XmppStanza*) iq);
	_tmp27_ = _tmp26_;
	_tmp28_ = xmpp_iq_stanza_new_error (iq, _tmp25_);
	xmpp_stanza_set_to ((XmppStanza*) _tmp28_, _tmp27_);
	_xmpp_jid_unref0 (_tmp27_);
	_tmp29_ = _tmp28_;
	xmpp_iq_module_send_iq (_tmp24_, stream, _tmp29_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp29_);
	_g_object_unref0 (_tmp24_);
	_xmpp_error_stanza_unref0 (_error_);
}

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

