/* session.c generated by valac 0.56.19, the Vala compiler
 * generated from session.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>

#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_SESSION_0_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_STREAM_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_STATE_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_SID_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_LOCAL_FULL_JID_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_PEER_FULL_JID_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_WE_INITIATED_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_SECURITY_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_MUJI_ROOM_PROPERTY,
	XMPP_XEP_JINGLE_SESSION_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))

#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 _XmppXepJingleContentNodePrivate XmppXepJingleContentNodePrivate;
typedef struct _XmppXepJingleSessionInsertContentNodeData XmppXepJingleSessionInsertContentNodeData;
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
typedef struct _XmppXepJingleSessionAddContentData XmppXepJingleSessionAddContentData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _XmppXepJingleSessionHandleSessionInfoData XmppXepJingleSessionHandleSessionInfoData;
enum  {
	XMPP_XEP_JINGLE_SESSION_TERMINATED_SIGNAL,
	XMPP_XEP_JINGLE_SESSION_ADDITIONAL_CONTENT_ADD_INCOMING_SIGNAL,
	XMPP_XEP_JINGLE_SESSION_NUM_SIGNALS
};
static guint xmpp_xep_jingle_session_signals[XMPP_XEP_JINGLE_SESSION_NUM_SIGNALS] = {0};

struct _XmppXepJingleSessionPrivate {
	XmppXmppStream* _stream;
	XmppXepJingleSessionState _state;
	gchar* _sid;
	XmppJid* _local_full_jid;
	XmppJid* _peer_full_jid;
	gboolean _we_initiated;
	XmppJid* _muji_room;
};

struct _XmppXepJingleContentNode {
	GTypeInstance parent_instance;
	volatile int ref_count;
	XmppXepJingleContentNodePrivate * priv;
	XmppXepJingleRole creator;
	gchar* name;
	XmppXepJingleSenders senders;
	XmppStanzaNode* description;
	XmppStanzaNode* transport;
	XmppStanzaNode* security;
};

struct _XmppXepJingleContentNodeClass {
	GTypeClass parent_class;
	void (*finalize) (XmppXepJingleContentNode *self);
};

struct _XmppXepJingleSessionInsertContentNodeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSession* self;
	XmppXepJingleContentNode* content_node;
	XmppJid* peer_full_jid;
	gboolean _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	GError* _tmp3_;
	XmppJid* my_jid;
	XmppXmppStream* _tmp4_;
	XmppFlagIdentity* _tmp5_;
	gpointer _tmp6_;
	XmppBindFlag* _tmp7_;
	XmppJid* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppXepJingleTransport* transport;
	XmppXmppStream* _tmp11_;
	XmppModuleIdentity* _tmp12_;
	gpointer _tmp13_;
	XmppXepJingleModule* _tmp14_;
	XmppStanzaNode* _tmp15_;
	const gchar* _tmp16_;
	XmppXepJingleTransport* _tmp17_;
	XmppXepJingleTransport* _tmp18_;
	XmppXepJingleContentType* content_type;
	XmppXmppStream* _tmp19_;
	XmppModuleIdentity* _tmp20_;
	gpointer _tmp21_;
	XmppXepJingleModule* _tmp22_;
	XmppStanzaNode* _tmp23_;
	const gchar* _tmp24_;
	XmppXepJingleContentType* _tmp25_;
	XmppXepJingleContentType* _tmp26_;
	XmppXepJingleContentType* _tmp27_;
	GError* _tmp28_;
	XmppXepJingleTransportParameters* transport_params;
	XmppXepJingleTransport* _tmp29_;
	XmppXepJingleTransportParameters* _tmp30_;
	XmppXepJingleTransport* _tmp31_;
	XmppXmppStream* _tmp32_;
	XmppXepJingleContentType* _tmp33_;
	guint8 _tmp34_;
	guint8 _tmp35_;
	XmppJid* _tmp36_;
	XmppStanzaNode* _tmp37_;
	XmppXepJingleTransportParameters* _tmp38_;
	XmppXepJingleTransportParameters* _tmp39_;
	XmppXepJingleContentParameters* content_params;
	XmppXepJingleContentType* _tmp40_;
	XmppStanzaNode* _tmp41_;
	XmppXepJingleContentParameters* _tmp42_;
	XmppXepJingleSecurityPrecondition* _tmp43_;
	XmppStanzaNode* _tmp44_;
	XmppXmppStream* _tmp45_;
	XmppModuleIdentity* _tmp46_;
	gpointer _tmp47_;
	XmppXepJingleModule* _tmp48_;
	XmppStanzaNode* _tmp49_;
	const gchar* _tmp50_;
	XmppXepJingleSecurityPrecondition* _tmp51_;
	XmppXepJingleSecurityPrecondition* precondition;
	XmppXepJingleSecurityPrecondition* _tmp52_;
	XmppXepJingleSecurityParameters* security_params;
	XmppXepJingleSecurityPrecondition* _tmp53_;
	XmppXepJingleSecurityPrecondition* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	XmppXepJingleSecurityParameters* _tmp57_;
	XmppXepJingleSecurityPrecondition* _tmp58_;
	XmppXmppStream* _tmp59_;
	XmppJid* _tmp60_;
	XmppStanzaNode* _tmp61_;
	XmppXepJingleSecurityParameters* _tmp62_;
	XmppXepJingleSecurityParameters* _tmp63_;
	XmppStanzaNode* _tmp64_;
	GError* _tmp65_;
	XmppXepJingleTransportType type;
	XmppXepJingleContentType* _tmp66_;
	XmppXepJingleTransportType _tmp67_;
	XmppXepJingleTransportType _tmp68_;
	gboolean _tmp69_;
	XmppXepJingleTransport* _tmp70_;
	XmppXepJingleTransport* _tmp71_;
	XmppXepJingleTransportType _tmp72_;
	XmppXepJingleTransportType _tmp73_;
	GError* _tmp74_;
	XmppXepJingleContent* content;
	const gchar* _tmp75_;
	XmppXepJingleContentType* _tmp76_;
	XmppXepJingleContentParameters* _tmp77_;
	XmppXepJingleTransport* _tmp78_;
	XmppXepJingleTransportParameters* _tmp79_;
	XmppXepJingleSecurityPrecondition* _tmp80_;
	XmppXepJingleSecurityParameters* _tmp81_;
	XmppJid* _tmp82_;
	XmppXepJingleContent* _tmp83_;
	XmppXepJingleContent* _tmp84_;
	XmppXepJingleContentParameters* _tmp85_;
	XmppXmppStream* _tmp86_;
	XmppXepJingleContent* _tmp87_;
	XmppXepJingleSessionState _tmp88_;
	XmppXmppStream* _tmp89_;
	XmppXepJingleContent* _tmp90_;
	GError* _inner_error0_;
};

struct _XmppXepJingleSessionAddContentData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSession* self;
	XmppXepJingleContent* content;
	XmppStanzaNode* content_add_node;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	const gchar* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* _tmp11_;
	XmppStanzaNode* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	XmppStanzaNode* _tmp15_;
	XmppStanzaNode* _tmp16_;
	XmppXepJingleSenders _tmp17_;
	XmppXepJingleSenders _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	XmppStanzaNode* _tmp21_;
	XmppStanzaNode* _tmp22_;
	XmppXepJingleContentParameters* _tmp23_;
	XmppStanzaNode* _tmp24_;
	XmppStanzaNode* _tmp25_;
	XmppStanzaNode* _tmp26_;
	XmppStanzaNode* _tmp27_;
	XmppXepJingleTransportParameters* _tmp28_;
	XmppStanzaNode* _tmp29_;
	XmppStanzaNode* _tmp30_;
	XmppStanzaNode* _tmp31_;
	XmppStanzaNode* _tmp32_;
	XmppStanzaNode* _tmp33_;
	XmppStanzaNode* _tmp34_;
	XmppIqStanza* iq;
	XmppJid* _tmp35_;
	XmppJid* _tmp36_;
	XmppIqStanza* _tmp37_;
	XmppXmppStream* _tmp38_;
	XmppModuleIdentity* _tmp39_;
	gpointer _tmp40_;
	XmppIqModule* _tmp41_;
	XmppXmppStream* _tmp42_;
	XmppIqStanza* _tmp43_;
	XmppIqStanza* _tmp44_;
	GError* _inner_error0_;
};

struct _XmppXepJingleSessionHandleSessionInfoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSession* self;
	XmppStanzaNode* jingle;
	XmppIqStanza* iq;
	XmppStanzaNode* info;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppXmppStream* _tmp2_;
	XmppModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppIqModule* _tmp5_;
	XmppXmppStream* _tmp6_;
	XmppIqStanza* _tmp7_;
	XmppIqStanza* _tmp8_;
	XmppXepJingleSessionInfoNs* info_ns;
	XmppXmppStream* _tmp9_;
	XmppModuleIdentity* _tmp10_;
	gpointer _tmp11_;
	XmppXepJingleModule* _tmp12_;
	XmppStanzaNode* _tmp13_;
	const gchar* _tmp14_;
	XmppXepJingleSessionInfoNs* _tmp15_;
	XmppXepJingleSessionInfoNs* _tmp16_;
	XmppXepJingleSessionInfoNs* _tmp17_;
	GError* _tmp18_;
	XmppXepJingleSessionInfoNs* _tmp19_;
	XmppXmppStream* _tmp20_;
	XmppStanzaNode* _tmp21_;
	XmppIqStanza* result_iq;
	XmppJid* _tmp22_;
	XmppJid* _tmp23_;
	XmppIqStanza* _tmp24_;
	XmppXmppStream* _tmp25_;
	XmppModuleIdentity* _tmp26_;
	gpointer _tmp27_;
	XmppIqModule* _tmp28_;
	XmppXmppStream* _tmp29_;
	XmppIqStanza* _tmp30_;
	GError* _inner_error0_;
};

static gint XmppXepJingleSession_private_offset;
static gpointer xmpp_xep_jingle_session_parent_class = NULL;

static void xmpp_xep_jingle_session_set_sid (XmppXepJingleSession* self,
                                      const gchar* value);
static void xmpp_xep_jingle_session_set_local_full_jid (XmppXepJingleSession* self,
                                                 XmppJid* value);
static void xmpp_xep_jingle_session_set_peer_full_jid (XmppXepJingleSession* self,
                                                XmppJid* value);
static void xmpp_xep_jingle_session_set_we_initiated (XmppXepJingleSession* self,
                                               gboolean value);
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);
static void xmpp_xep_jingle_session_handle_session_accept (XmppXepJingleSession* self,
                                                    GeeList* content_nodes,
                                                    XmppStanzaNode* jingle,
                                                    XmppIqStanza* iq,
                                                    GError** error);
static void xmpp_xep_jingle_session_handle_session_info (XmppXepJingleSession* self,
                                                  XmppStanzaNode* jingle,
                                                  XmppIqStanza* iq,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static void xmpp_xep_jingle_session_handle_session_info_finish (XmppXepJingleSession* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static void xmpp_xep_jingle_session_handle_session_terminate (XmppXepJingleSession* self,
                                                       XmppStanzaNode* jingle,
                                                       XmppIqStanza* iq,
                                                       GError** error);
VALA_EXTERN XmppXepJingleContentNode* xmpp_xep_jingle_get_single_content_node (XmppStanzaNode* jingle,
                                                                   GError** error) G_GNUC_DEPRECATED ;
static void xmpp_xep_jingle_session_handle_content_accept (XmppXepJingleSession* self,
                                                    XmppXepJingleContentNode* content_node,
                                                    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_session_handle_content_modify (XmppXepJingleSession* self,
                                                    XmppXmppStream* stream,
                                                    XmppStanzaNode* jingle_node,
                                                    XmppIqStanza* iq,
                                                    GError** error);
VALA_EXTERN void xmpp_xep_jingle_session_insert_content (XmppXepJingleSession* self,
                                             XmppXepJingleContent* content);
static void xmpp_xep_jingle_session_insert_content_node_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_session_insert_content_node_co (XmppXepJingleSessionInsertContentNodeData* _data_);
static void xmpp_xep_jingle_session_insert_content_node_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void xmpp_xep_jingle_session_add_content_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_session_add_content_co (XmppXepJingleSessionAddContentData* _data_);
static void xmpp_xep_jingle_session_add_content_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
VALA_EXTERN void xmpp_xep_jingle_content_handle_accept (XmppXepJingleContent* self,
                                            XmppXmppStream* stream,
                                            XmppXepJingleContentNode* content_node);
VALA_EXTERN void xmpp_xep_jingle_content_handle_content_modify (XmppXepJingleContent* self,
                                                    XmppXmppStream* stream,
                                                    XmppXepJingleSenders proposed_senders);
static gboolean _vala_string_array_contains (const gchar* * stack,
                                      gssize stack_length,
                                      const const gchar* needle);
static void xmpp_xep_jingle_session_handle_session_info_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_session_handle_session_info_co (XmppXepJingleSessionHandleSessionInfoData* _data_);
VALA_EXTERN XmppStanzaNode* xmpp_xep_jingle_get_single_node_anyns (XmppStanzaNode* parent,
                                                       const gchar* node_name,
                                                       GError** error);
static void xmpp_xep_jingle_session_accept (XmppXepJingleSession* self);
VALA_EXTERN void xmpp_xep_jingle_content_on_accept (XmppXepJingleContent* self,
                                        XmppXmppStream* stream);
VALA_EXTERN void xmpp_xep_jingle_session_accept_content (XmppXepJingleSession* self,
                                             XmppXepJingleContent* content);
static void xmpp_xep_jingle_session_reject (XmppXepJingleSession* self);
VALA_EXTERN void xmpp_xep_jingle_session_reject_content (XmppXepJingleSession* self,
                                             XmppXepJingleContent* content);
VALA_EXTERN void xmpp_xep_jingle_session_send_session_info (XmppXepJingleSession* self,
                                                XmppStanzaNode* child_node);
static XmppStanzaNode* xmpp_xep_jingle_session_build_outer_session_node (XmppXepJingleSession* self,
                                                                  const gchar* action);
VALA_EXTERN void xmpp_xep_jingle_session_send_content_modify (XmppXepJingleSession* self,
                                                  XmppXepJingleContent* content,
                                                  XmppXepJingleSenders senders);
VALA_EXTERN XmppStanzaNode* xmpp_xep_jingle_content_build_outer_content_node (XmppXepJingleContent* self);
VALA_EXTERN void xmpp_xep_jingle_session_send_transport_accept (XmppXepJingleSession* self,
                                                    XmppXepJingleContent* content,
                                                    XmppXepJingleTransportParameters* transport_params);
VALA_EXTERN void xmpp_xep_jingle_session_send_transport_replace (XmppXepJingleSession* self,
                                                     XmppXepJingleContent* content,
                                                     XmppXepJingleTransportParameters* transport_params);
VALA_EXTERN void xmpp_xep_jingle_session_send_transport_reject (XmppXepJingleSession* self,
                                                    XmppXepJingleContent* content,
                                                    XmppStanzaNode* transport_node);
VALA_EXTERN void xmpp_xep_jingle_session_send_transport_info (XmppXepJingleSession* self,
                                                  XmppXepJingleContent* content,
                                                  XmppStanzaNode* transport);
static void g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN_STRING_STRING (GClosure * closure,
                                                                 GValue * return_value,
                                                                 guint n_param_values,
                                                                 const GValue * param_values,
                                                                 gpointer invocation_hint,
                                                                 gpointer marshal_data);
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_session_finalize (GObject * obj);
static GType xmpp_xep_jingle_session_get_type_once (void);
static void _vala_xmpp_xep_jingle_session_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_session_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

VALA_EXTERN const gchar* XMPP_XEP_JINGLE_REASON_ELEMENT_NORMAL_TERMINATE_REASONS[5];

static inline gpointer
xmpp_xep_jingle_session_get_instance_private (XmppXepJingleSession* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleSession_private_offset);
}

static GType
xmpp_xep_jingle_session_state_get_type_once (void)
{
	static const GEnumValue values[] = {{XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_SENT, "XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_SENT", "initiate-sent"}, {XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_RECEIVED, "XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_RECEIVED", "initiate-received"}, {XMPP_XEP_JINGLE_SESSION_STATE_ACTIVE, "XMPP_XEP_JINGLE_SESSION_STATE_ACTIVE", "active"}, {XMPP_XEP_JINGLE_SESSION_STATE_ENDED, "XMPP_XEP_JINGLE_SESSION_STATE_ENDED", "ended"}, {0, NULL, NULL}};
	GType xmpp_xep_jingle_session_state_type_id;
	xmpp_xep_jingle_session_state_type_id = g_enum_register_static ("XmppXepJingleSessionState", values);
	return xmpp_xep_jingle_session_state_type_id;
}

GType
xmpp_xep_jingle_session_state_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_session_state_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_session_state_type_id__once)) {
		GType xmpp_xep_jingle_session_state_type_id;
		xmpp_xep_jingle_session_state_type_id = xmpp_xep_jingle_session_state_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_session_state_type_id__once, xmpp_xep_jingle_session_state_type_id);
	}
	return xmpp_xep_jingle_session_state_type_id__once;
}

XmppXepJingleSession*
xmpp_xep_jingle_session_construct_initiate_sent (GType object_type,
                                                 XmppXmppStream* stream,
                                                 const gchar* sid,
                                                 XmppJid* local_full_jid,
                                                 XmppJid* peer_full_jid)
{
	XmppXepJingleSession * self = NULL;
	g_return_val_if_fail (stream != NULL, NULL);
	g_return_val_if_fail (sid != NULL, NULL);
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	self = (XmppXepJingleSession*) g_object_new (object_type, NULL);
	xmpp_xep_jingle_session_set_stream (self, stream);
	xmpp_xep_jingle_session_set_sid (self, sid);
	xmpp_xep_jingle_session_set_local_full_jid (self, local_full_jid);
	xmpp_xep_jingle_session_set_peer_full_jid (self, peer_full_jid);
	xmpp_xep_jingle_session_set_state (self, XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_SENT);
	xmpp_xep_jingle_session_set_we_initiated (self, TRUE);
	return self;
}

XmppXepJingleSession*
xmpp_xep_jingle_session_new_initiate_sent (XmppXmppStream* stream,
                                           const gchar* sid,
                                           XmppJid* local_full_jid,
                                           XmppJid* peer_full_jid)
{
	return xmpp_xep_jingle_session_construct_initiate_sent (XMPP_XEP_JINGLE_TYPE_SESSION, stream, sid, local_full_jid, peer_full_jid);
}

XmppXepJingleSession*
xmpp_xep_jingle_session_construct_initiate_received (GType object_type,
                                                     XmppXmppStream* stream,
                                                     const gchar* sid,
                                                     XmppJid* local_full_jid,
                                                     XmppJid* peer_full_jid)
{
	XmppXepJingleSession * self = NULL;
	g_return_val_if_fail (stream != NULL, NULL);
	g_return_val_if_fail (sid != NULL, NULL);
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	self = (XmppXepJingleSession*) g_object_new (object_type, NULL);
	xmpp_xep_jingle_session_set_stream (self, stream);
	xmpp_xep_jingle_session_set_sid (self, sid);
	xmpp_xep_jingle_session_set_local_full_jid (self, local_full_jid);
	xmpp_xep_jingle_session_set_peer_full_jid (self, peer_full_jid);
	xmpp_xep_jingle_session_set_state (self, XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_RECEIVED);
	xmpp_xep_jingle_session_set_we_initiated (self, FALSE);
	return self;
}

XmppXepJingleSession*
xmpp_xep_jingle_session_new_initiate_received (XmppXmppStream* stream,
                                               const gchar* sid,
                                               XmppJid* local_full_jid,
                                               XmppJid* peer_full_jid)
{
	return xmpp_xep_jingle_session_construct_initiate_received (XMPP_XEP_JINGLE_TYPE_SESSION, stream, sid, local_full_jid, peer_full_jid);
}

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

void
xmpp_xep_jingle_session_handle_iq_set (XmppXepJingleSession* self,
                                       const gchar* action,
                                       XmppStanzaNode* jingle,
                                       XmppIqStanza* iq,
                                       GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	if (g_str_has_prefix (action, "session-")) {
		const gchar* _tmp0_;
		GQuark _tmp2_ = 0U;
		static GQuark _tmp1_label0 = 0;
		static GQuark _tmp1_label1 = 0;
		static GQuark _tmp1_label2 = 0;
		_tmp0_ = action;
		_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
		if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("session-accept")))) {
			switch (0) {
				default:
				{
					GeeList* content_nodes = NULL;
					GeeList* _tmp3_;
					XmppXepJingleSessionState _tmp4_;
					GeeList* _tmp6_;
					_tmp3_ = xmpp_xep_jingle_get_content_nodes (jingle, &_inner_error0_);
					content_nodes = _tmp3_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							return;
						} else {
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
					_tmp4_ = self->priv->_state;
					if (_tmp4_ != XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_SENT) {
						GError* _tmp5_;
						_tmp5_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_OUT_OF_ORDER, "got session-accept while not waiting for one");
						_inner_error0_ = _tmp5_;
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							_g_object_unref0 (content_nodes);
							return;
						} else {
							_g_object_unref0 (content_nodes);
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
					_tmp6_ = content_nodes;
					xmpp_xep_jingle_session_handle_session_accept (self, _tmp6_, jingle, iq, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							_g_object_unref0 (content_nodes);
							return;
						} else {
							_g_object_unref0 (content_nodes);
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
					_g_object_unref0 (content_nodes);
					break;
				}
			}
		} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("session-info")))) {
			switch (0) {
				default:
				{
					xmpp_xep_jingle_session_handle_session_info (self, jingle, iq, NULL, NULL);
					break;
				}
			}
		} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("session-terminate")))) {
			switch (0) {
				default:
				{
					xmpp_xep_jingle_session_handle_session_terminate (self, jingle, iq, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							return;
						} else {
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
					break;
				}
			}
		} else {
			switch (0) {
				default:
				{
					GError* _tmp7_;
					_tmp7_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "invalid action");
					_inner_error0_ = _tmp7_;
					if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
						g_propagate_error (error, _inner_error0_);
						return;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
				}
			}
		}
	} else {
		if (g_str_has_prefix (action, "content-")) {
			const gchar* _tmp8_;
			GQuark _tmp10_ = 0U;
			static GQuark _tmp9_label0 = 0;
			static GQuark _tmp9_label1 = 0;
			static GQuark _tmp9_label2 = 0;
			static GQuark _tmp9_label3 = 0;
			static GQuark _tmp9_label4 = 0;
			_tmp8_ = action;
			_tmp10_ = (NULL == _tmp8_) ? 0 : g_quark_from_string (_tmp8_);
			if (_tmp10_ == ((0 != _tmp9_label0) ? _tmp9_label0 : (_tmp9_label0 = g_quark_from_static_string ("content-accept")))) {
				switch (0) {
					default:
					{
						XmppXepJingleContentNode* content_node = NULL;
						XmppXepJingleContentNode* _tmp11_;
						XmppXepJingleContentNode* _tmp12_;
						XmppXmppStream* _tmp13_;
						XmppModuleIdentity* _tmp14_;
						gpointer _tmp15_;
						XmppIqModule* _tmp16_;
						XmppXmppStream* _tmp17_;
						XmppIqStanza* _tmp18_;
						XmppIqStanza* _tmp19_;
						_tmp11_ = xmpp_xep_jingle_get_single_content_node (jingle, &_inner_error0_);
						content_node = _tmp11_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
								g_propagate_error (error, _inner_error0_);
								return;
							} else {
								g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
								g_clear_error (&_inner_error0_);
								return;
							}
						}
						_tmp12_ = content_node;
						xmpp_xep_jingle_session_handle_content_accept (self, _tmp12_, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
								g_propagate_error (error, _inner_error0_);
								_xmpp_xep_jingle_content_node_unref0 (content_node);
								return;
							} else {
								_xmpp_xep_jingle_content_node_unref0 (content_node);
								g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
								g_clear_error (&_inner_error0_);
								return;
							}
						}
						_tmp13_ = self->priv->_stream;
						_tmp14_ = xmpp_iq_module_IDENTITY;
						_tmp15_ = xmpp_xmpp_stream_get_module (_tmp13_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp14_);
						_tmp16_ = (XmppIqModule*) _tmp15_;
						_tmp17_ = self->priv->_stream;
						_tmp18_ = xmpp_iq_stanza_new_result (iq, NULL);
						_tmp19_ = _tmp18_;
						xmpp_iq_module_send_iq (_tmp16_, _tmp17_, _tmp19_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
						_g_object_unref0 (_tmp19_);
						_g_object_unref0 (_tmp16_);
						_xmpp_xep_jingle_content_node_unref0 (content_node);
						break;
					}
				}
			} else if (_tmp10_ == ((0 != _tmp9_label1) ? _tmp9_label1 : (_tmp9_label1 = g_quark_from_static_string ("content-add")))) {
				switch (0) {
					default:
					{
						XmppXepJingleContentNode* content_node = NULL;
						XmppXepJingleContentNode* _tmp20_;
						XmppXepJingleContentNode* _tmp21_;
						XmppJid* _tmp22_;
						XmppXmppStream* _tmp23_;
						XmppModuleIdentity* _tmp24_;
						gpointer _tmp25_;
						XmppIqModule* _tmp26_;
						XmppXmppStream* _tmp27_;
						XmppIqStanza* _tmp28_;
						XmppIqStanza* _tmp29_;
						_tmp20_ = xmpp_xep_jingle_get_single_content_node (jingle, &_inner_error0_);
						content_node = _tmp20_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
								g_propagate_error (error, _inner_error0_);
								return;
							} else {
								g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
								g_clear_error (&_inner_error0_);
								return;
							}
						}
						_tmp21_ = content_node;
						_tmp22_ = self->priv->_peer_full_jid;
						xmpp_xep_jingle_session_insert_content_node (self, _tmp21_, _tmp22_, NULL, NULL);
						_tmp23_ = self->priv->_stream;
						_tmp24_ = xmpp_iq_module_IDENTITY;
						_tmp25_ = xmpp_xmpp_stream_get_module (_tmp23_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp24_);
						_tmp26_ = (XmppIqModule*) _tmp25_;
						_tmp27_ = self->priv->_stream;
						_tmp28_ = xmpp_iq_stanza_new_result (iq, NULL);
						_tmp29_ = _tmp28_;
						xmpp_iq_module_send_iq (_tmp26_, _tmp27_, _tmp29_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
						_g_object_unref0 (_tmp29_);
						_g_object_unref0 (_tmp26_);
						_xmpp_xep_jingle_content_node_unref0 (content_node);
						break;
					}
				}
			} else if (_tmp10_ == ((0 != _tmp9_label2) ? _tmp9_label2 : (_tmp9_label2 = g_quark_from_static_string ("content-modify")))) {
				switch (0) {
					default:
					{
						XmppXmppStream* _tmp30_;
						_tmp30_ = self->priv->_stream;
						xmpp_xep_jingle_session_handle_content_modify (self, _tmp30_, jingle, iq, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
								g_propagate_error (error, _inner_error0_);
								return;
							} else {
								g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
								g_clear_error (&_inner_error0_);
								return;
							}
						}
						break;
					}
				}
			} else if ((_tmp10_ == ((0 != _tmp9_label3) ? _tmp9_label3 : (_tmp9_label3 = g_quark_from_static_string ("content-reject")))) || (_tmp10_ == ((0 != _tmp9_label4) ? _tmp9_label4 : (_tmp9_label4 = g_quark_from_static_string ("content-remove"))))) {
				switch (0) {
					default:
					{
						const gchar* _tmp31_;
						gchar* _tmp32_;
						gchar* _tmp33_;
						GError* _tmp34_;
						GError* _tmp35_;
						_tmp31_ = string_to_string (action);
						_tmp32_ = g_strconcat (_tmp31_, " is not implemented", NULL);
						_tmp33_ = _tmp32_;
						_tmp34_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_NOT_IMPLEMENTED, _tmp33_);
						_tmp35_ = _tmp34_;
						_g_free0 (_tmp33_);
						_inner_error0_ = _tmp35_;
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							return;
						} else {
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
				}
			} else {
				switch (0) {
					default:
					{
						GError* _tmp36_;
						_tmp36_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "invalid action");
						_inner_error0_ = _tmp36_;
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							return;
						} else {
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
				}
			}
		} else {
			if (g_str_has_prefix (action, "transport-")) {
				XmppXepJingleContentNode* content_node = NULL;
				XmppXepJingleContentNode* _tmp37_;
				GeeHashMap* _tmp38_;
				XmppXepJingleContentNode* _tmp39_;
				const gchar* _tmp40_;
				XmppXepJingleContentNode* _tmp42_;
				XmppStanzaNode* _tmp43_;
				XmppXepJingleContent* content = NULL;
				GeeHashMap* _tmp45_;
				XmppXepJingleContentNode* _tmp46_;
				const gchar* _tmp47_;
				gpointer _tmp48_;
				XmppXepJingleContentNode* _tmp49_;
				XmppXepJingleContent* _tmp50_;
				XmppXepJingleRole _tmp51_;
				XmppXepJingleRole _tmp52_;
				const gchar* _tmp56_;
				GQuark _tmp58_ = 0U;
				static GQuark _tmp57_label0 = 0;
				static GQuark _tmp57_label1 = 0;
				static GQuark _tmp57_label2 = 0;
				static GQuark _tmp57_label3 = 0;
				_tmp37_ = xmpp_xep_jingle_get_single_content_node (jingle, &_inner_error0_);
				content_node = _tmp37_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
						g_propagate_error (error, _inner_error0_);
						return;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
				}
				_tmp38_ = self->contents_map;
				_tmp39_ = content_node;
				_tmp40_ = _tmp39_->name;
				if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp38_, _tmp40_)) {
					GError* _tmp41_;
					_tmp41_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "unknown content");
					_inner_error0_ = _tmp41_;
					if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
						g_propagate_error (error, _inner_error0_);
						_xmpp_xep_jingle_content_node_unref0 (content_node);
						return;
					} else {
						_xmpp_xep_jingle_content_node_unref0 (content_node);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
				}
				_tmp42_ = content_node;
				_tmp43_ = _tmp42_->transport;
				if (_tmp43_ == NULL) {
					GError* _tmp44_;
					_tmp44_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing transport node");
					_inner_error0_ = _tmp44_;
					if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
						g_propagate_error (error, _inner_error0_);
						_xmpp_xep_jingle_content_node_unref0 (content_node);
						return;
					} else {
						_xmpp_xep_jingle_content_node_unref0 (content_node);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
				}
				_tmp45_ = self->contents_map;
				_tmp46_ = content_node;
				_tmp47_ = _tmp46_->name;
				_tmp48_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp45_, _tmp47_);
				content = (XmppXepJingleContent*) _tmp48_;
				_tmp49_ = content_node;
				_tmp50_ = content;
				_tmp51_ = xmpp_xep_jingle_content_get_content_creator (_tmp50_);
				_tmp52_ = _tmp51_;
				if (_tmp49_->creator != _tmp52_) {
					XmppJid* _tmp53_;
					gchar* _tmp54_;
					gchar* _tmp55_;
					_tmp53_ = self->priv->_peer_full_jid;
					_tmp54_ = xmpp_jid_to_string (_tmp53_);
					_tmp55_ = _tmp54_;
					g_warning ("session.vala:110: Received transport-* with unexpected content creator" \
" from %s", _tmp55_);
					_g_free0 (_tmp55_);
				}
				_tmp56_ = action;
				_tmp58_ = (NULL == _tmp56_) ? 0 : g_quark_from_string (_tmp56_);
				if (_tmp58_ == ((0 != _tmp57_label0) ? _tmp57_label0 : (_tmp57_label0 = g_quark_from_static_string ("transport-accept")))) {
					switch (0) {
						default:
						{
							XmppXepJingleContent* _tmp59_;
							XmppXmppStream* _tmp60_;
							XmppXepJingleContentNode* _tmp61_;
							XmppStanzaNode* _tmp62_;
							_tmp59_ = content;
							_tmp60_ = self->priv->_stream;
							_tmp61_ = content_node;
							_tmp62_ = _tmp61_->transport;
							xmpp_xep_jingle_content_handle_transport_accept (_tmp59_, _tmp60_, _tmp62_, jingle, iq, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
									g_propagate_error (error, _inner_error0_);
									_g_object_unref0 (content);
									_xmpp_xep_jingle_content_node_unref0 (content_node);
									return;
								} else {
									_g_object_unref0 (content);
									_xmpp_xep_jingle_content_node_unref0 (content_node);
									g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
									g_clear_error (&_inner_error0_);
									return;
								}
							}
							break;
						}
					}
				} else if (_tmp58_ == ((0 != _tmp57_label1) ? _tmp57_label1 : (_tmp57_label1 = g_quark_from_static_string ("transport-info")))) {
					switch (0) {
						default:
						{
							XmppXepJingleContent* _tmp63_;
							XmppXmppStream* _tmp64_;
							XmppXepJingleContentNode* _tmp65_;
							XmppStanzaNode* _tmp66_;
							_tmp63_ = content;
							_tmp64_ = self->priv->_stream;
							_tmp65_ = content_node;
							_tmp66_ = _tmp65_->transport;
							xmpp_xep_jingle_content_handle_transport_info (_tmp63_, _tmp64_, _tmp66_, jingle, iq, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
									g_propagate_error (error, _inner_error0_);
									_g_object_unref0 (content);
									_xmpp_xep_jingle_content_node_unref0 (content_node);
									return;
								} else {
									_g_object_unref0 (content);
									_xmpp_xep_jingle_content_node_unref0 (content_node);
									g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
									g_clear_error (&_inner_error0_);
									return;
								}
							}
							break;
						}
					}
				} else if (_tmp58_ == ((0 != _tmp57_label2) ? _tmp57_label2 : (_tmp57_label2 = g_quark_from_static_string ("transport-reject")))) {
					switch (0) {
						default:
						{
							XmppXepJingleContent* _tmp67_;
							XmppXmppStream* _tmp68_;
							_tmp67_ = content;
							_tmp68_ = self->priv->_stream;
							xmpp_xep_jingle_content_handle_transport_reject (_tmp67_, _tmp68_, jingle, iq, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
									g_propagate_error (error, _inner_error0_);
									_g_object_unref0 (content);
									_xmpp_xep_jingle_content_node_unref0 (content_node);
									return;
								} else {
									_g_object_unref0 (content);
									_xmpp_xep_jingle_content_node_unref0 (content_node);
									g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
									g_clear_error (&_inner_error0_);
									return;
								}
							}
							break;
						}
					}
				} else if (_tmp58_ == ((0 != _tmp57_label3) ? _tmp57_label3 : (_tmp57_label3 = g_quark_from_static_string ("transport-replace")))) {
					switch (0) {
						default:
						{
							XmppXepJingleContent* _tmp69_;
							XmppXmppStream* _tmp70_;
							XmppXepJingleContentNode* _tmp71_;
							XmppStanzaNode* _tmp72_;
							_tmp69_ = content;
							_tmp70_ = self->priv->_stream;
							_tmp71_ = content_node;
							_tmp72_ = _tmp71_->transport;
							xmpp_xep_jingle_content_handle_transport_replace (_tmp69_, _tmp70_, _tmp72_, jingle, iq, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
									g_propagate_error (error, _inner_error0_);
									_g_object_unref0 (content);
									_xmpp_xep_jingle_content_node_unref0 (content_node);
									return;
								} else {
									_g_object_unref0 (content);
									_xmpp_xep_jingle_content_node_unref0 (content_node);
									g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
									g_clear_error (&_inner_error0_);
									return;
								}
							}
							break;
						}
					}
				} else {
					switch (0) {
						default:
						{
							GError* _tmp73_;
							_tmp73_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "invalid action");
							_inner_error0_ = _tmp73_;
							if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
								g_propagate_error (error, _inner_error0_);
								_g_object_unref0 (content);
								_xmpp_xep_jingle_content_node_unref0 (content_node);
								return;
							} else {
								_g_object_unref0 (content);
								_xmpp_xep_jingle_content_node_unref0 (content_node);
								g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
								g_clear_error (&_inner_error0_);
								return;
							}
						}
					}
				}
				_g_object_unref0 (content);
				_xmpp_xep_jingle_content_node_unref0 (content_node);
			} else {
				if (g_strcmp0 (action, "description-info") == 0) {
					XmppXepJingleContentNode* content_node = NULL;
					XmppXepJingleContentNode* _tmp74_;
					GeeHashMap* _tmp75_;
					XmppXepJingleContentNode* _tmp76_;
					const gchar* _tmp77_;
					XmppXepJingleContent* content = NULL;
					GeeHashMap* _tmp79_;
					XmppXepJingleContentNode* _tmp80_;
					const gchar* _tmp81_;
					gpointer _tmp82_;
					XmppXepJingleContentNode* _tmp83_;
					XmppXepJingleContent* _tmp84_;
					XmppXepJingleRole _tmp85_;
					XmppXepJingleRole _tmp86_;
					XmppXepJingleContent* _tmp90_;
					XmppXmppStream* _tmp91_;
					XmppXepJingleContentNode* _tmp92_;
					XmppStanzaNode* _tmp93_;
					_tmp74_ = xmpp_xep_jingle_get_single_content_node (jingle, &_inner_error0_);
					content_node = _tmp74_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							return;
						} else {
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
					_tmp75_ = self->contents_map;
					_tmp76_ = content_node;
					_tmp77_ = _tmp76_->name;
					if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp75_, _tmp77_)) {
						GError* _tmp78_;
						_tmp78_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "unknown content");
						_inner_error0_ = _tmp78_;
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							_xmpp_xep_jingle_content_node_unref0 (content_node);
							return;
						} else {
							_xmpp_xep_jingle_content_node_unref0 (content_node);
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
					_tmp79_ = self->contents_map;
					_tmp80_ = content_node;
					_tmp81_ = _tmp80_->name;
					_tmp82_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp79_, _tmp81_);
					content = (XmppXepJingleContent*) _tmp82_;
					_tmp83_ = content_node;
					_tmp84_ = content;
					_tmp85_ = xmpp_xep_jingle_content_get_content_creator (_tmp84_);
					_tmp86_ = _tmp85_;
					if (_tmp83_->creator != _tmp86_) {
						XmppJid* _tmp87_;
						gchar* _tmp88_;
						gchar* _tmp89_;
						_tmp87_ = self->priv->_peer_full_jid;
						_tmp88_ = xmpp_jid_to_string (_tmp87_);
						_tmp89_ = _tmp88_;
						g_warning ("session.vala:138: Received description-info with unexpected content cr" \
"eator from %s", _tmp89_);
						_g_free0 (_tmp89_);
					}
					_tmp90_ = content;
					_tmp91_ = self->priv->_stream;
					_tmp92_ = content_node;
					_tmp93_ = _tmp92_->description;
					xmpp_xep_jingle_content_on_description_info (_tmp90_, _tmp91_, _tmp93_, jingle, iq, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							_g_object_unref0 (content);
							_xmpp_xep_jingle_content_node_unref0 (content_node);
							return;
						} else {
							_g_object_unref0 (content);
							_xmpp_xep_jingle_content_node_unref0 (content_node);
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
					_g_object_unref0 (content);
					_xmpp_xep_jingle_content_node_unref0 (content_node);
				} else {
					if (g_strcmp0 (action, "security-info") == 0) {
						const gchar* _tmp94_;
						gchar* _tmp95_;
						gchar* _tmp96_;
						GError* _tmp97_;
						GError* _tmp98_;
						_tmp94_ = string_to_string (action);
						_tmp95_ = g_strconcat (_tmp94_, " is not implemented", NULL);
						_tmp96_ = _tmp95_;
						_tmp97_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_NOT_IMPLEMENTED, _tmp96_);
						_tmp98_ = _tmp97_;
						_g_free0 (_tmp96_);
						_inner_error0_ = _tmp98_;
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							return;
						} else {
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					} else {
						GError* _tmp99_;
						_tmp99_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "invalid action");
						_inner_error0_ = _tmp99_;
						if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
							g_propagate_error (error, _inner_error0_);
							return;
						} else {
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return;
						}
					}
				}
			}
		}
	}
}

void
xmpp_xep_jingle_session_insert_content (XmppXepJingleSession* self,
                                        XmppXepJingleContent* content)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GeeList* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	_tmp0_ = self->contents_map;
	_tmp1_ = xmpp_xep_jingle_content_get_content_name (content);
	_tmp2_ = _tmp1_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, content);
	_tmp3_ = self->contents;
	gee_collection_add ((GeeCollection*) _tmp3_, content);
	xmpp_xep_jingle_content_set_session (content, self);
}

static void
xmpp_xep_jingle_session_insert_content_node_data_free (gpointer _data)
{
	XmppXepJingleSessionInsertContentNodeData* _data_;
	_data_ = _data;
	_xmpp_xep_jingle_content_node_unref0 (_data_->content_node);
	_xmpp_jid_unref0 (_data_->peer_full_jid);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSessionInsertContentNodeData, _data_);
}

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

static gpointer
_xmpp_xep_jingle_content_node_ref0 (gpointer self)
{
	return self ? xmpp_xep_jingle_content_node_ref (self) : NULL;
}

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

void
xmpp_xep_jingle_session_insert_content_node (XmppXepJingleSession* self,
                                             XmppXepJingleContentNode* content_node,
                                             XmppJid* peer_full_jid,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	XmppXepJingleSessionInsertContentNodeData* _data_;
	XmppXepJingleSession* _tmp0_;
	XmppXepJingleContentNode* _tmp1_;
	XmppJid* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content_node != NULL);
	g_return_if_fail (peer_full_jid != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSessionInsertContentNodeData);
	_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_session_insert_content_node_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _xmpp_xep_jingle_content_node_ref0 (content_node);
	_xmpp_xep_jingle_content_node_unref0 (_data_->content_node);
	_data_->content_node = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (peer_full_jid);
	_xmpp_jid_unref0 (_data_->peer_full_jid);
	_data_->peer_full_jid = _tmp2_;
	xmpp_xep_jingle_session_insert_content_node_co (_data_);
}

void
xmpp_xep_jingle_session_insert_content_node_finish (XmppXepJingleSession* self,
                                                    GAsyncResult* _res_,
                                                    GError** error)
{
	XmppXepJingleSessionInsertContentNodeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
xmpp_xep_jingle_session_insert_content_node_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	XmppXepJingleSessionInsertContentNodeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_session_insert_content_node_co (_data_);
}

static gboolean
xmpp_xep_jingle_session_insert_content_node_co (XmppXepJingleSessionInsertContentNodeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->content_node->description;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp2_ = _data_->content_node->transport;
		_data_->_tmp0_ = _data_->_tmp2_ == NULL;
	}
	if (_data_->_tmp0_) {
		_data_->_tmp3_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing description or transport 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_);
			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_->_tmp4_ = _data_->self->priv->_stream;
	_data_->_tmp5_ = xmpp_bind_flag_IDENTITY;
	_data_->_tmp6_ = xmpp_xmpp_stream_get_flag (_data_->_tmp4_, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp5_);
	_data_->_tmp7_ = (XmppBindFlag*) _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_->my_jid;
	_data_->_tmp9_ = _xmpp_jid_ref0 (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_g_object_unref0 (_data_->_tmp7_);
	_data_->my_jid = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->self->priv->_stream;
	_data_->_tmp12_ = xmpp_xep_jingle_module_IDENTITY;
	_data_->_tmp13_ = xmpp_xmpp_stream_get_module (_data_->_tmp11_, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp12_);
	_data_->_tmp14_ = (XmppXepJingleModule*) _data_->_tmp13_;
	_data_->_tmp15_ = _data_->content_node->transport;
	_data_->_tmp16_ = ((XmppStanzaEntry*) _data_->_tmp15_)->ns_uri;
	_data_->_tmp17_ = xmpp_xep_jingle_module_get_transport (_data_->_tmp14_, _data_->_tmp16_);
	_data_->_tmp18_ = _data_->_tmp17_;
	_g_object_unref0 (_data_->_tmp14_);
	_data_->transport = _data_->_tmp18_;
	_data_->_tmp19_ = _data_->self->priv->_stream;
	_data_->_tmp20_ = xmpp_xep_jingle_module_IDENTITY;
	_data_->_tmp21_ = xmpp_xmpp_stream_get_module (_data_->_tmp19_, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp20_);
	_data_->_tmp22_ = (XmppXepJingleModule*) _data_->_tmp21_;
	_data_->_tmp23_ = _data_->content_node->description;
	_data_->_tmp24_ = ((XmppStanzaEntry*) _data_->_tmp23_)->ns_uri;
	_data_->_tmp25_ = xmpp_xep_jingle_module_get_content_type (_data_->_tmp22_, _data_->_tmp24_);
	_data_->_tmp26_ = _data_->_tmp25_;
	_g_object_unref0 (_data_->_tmp22_);
	_data_->content_type = _data_->_tmp26_;
	_data_->_tmp27_ = _data_->content_type;
	if (_data_->_tmp27_ == NULL) {
		_data_->_tmp28_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_NOT_IMPLEMENTED, "unknown content type");
		_data_->_inner_error0_ = _data_->_tmp28_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->content_type);
			_g_object_unref0 (_data_->transport);
			_xmpp_jid_unref0 (_data_->my_jid);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->content_type);
			_g_object_unref0 (_data_->transport);
			_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_->transport_params = NULL;
	_data_->_tmp29_ = _data_->transport;
	if (_data_->_tmp29_ != NULL) {
		_data_->_tmp31_ = _data_->transport;
		_data_->_tmp32_ = _data_->self->priv->_stream;
		_data_->_tmp33_ = _data_->content_type;
		_data_->_tmp34_ = xmpp_xep_jingle_content_type_get_required_components (_data_->_tmp33_);
		_data_->_tmp35_ = _data_->_tmp34_;
		_data_->_tmp36_ = _data_->my_jid;
		_data_->_tmp37_ = _data_->content_node->transport;
		_data_->_tmp38_ = xmpp_xep_jingle_transport_parse_transport_parameters (_data_->_tmp31_, _data_->_tmp32_, _data_->_tmp35_, _data_->_tmp36_, _data_->peer_full_jid, _data_->_tmp37_, &_data_->_inner_error0_);
		_data_->_tmp30_ = _data_->_tmp38_;
		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_->transport_params);
				_g_object_unref0 (_data_->content_type);
				_g_object_unref0 (_data_->transport);
				_xmpp_jid_unref0 (_data_->my_jid);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_object_unref0 (_data_->transport_params);
				_g_object_unref0 (_data_->content_type);
				_g_object_unref0 (_data_->transport);
				_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_->_tmp39_ = _data_->_tmp30_;
		_data_->_tmp30_ = NULL;
		_g_object_unref0 (_data_->transport_params);
		_data_->transport_params = _data_->_tmp39_;
		_g_object_unref0 (_data_->_tmp30_);
	} else {
	}
	_data_->_tmp40_ = _data_->content_type;
	_data_->_tmp41_ = _data_->content_node->description;
	_data_->_tmp42_ = xmpp_xep_jingle_content_type_parse_content_parameters (_data_->_tmp40_, _data_->_tmp41_, &_data_->_inner_error0_);
	_data_->content_params = _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_);
			_g_object_unref0 (_data_->transport_params);
			_g_object_unref0 (_data_->content_type);
			_g_object_unref0 (_data_->transport);
			_xmpp_jid_unref0 (_data_->my_jid);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->transport_params);
			_g_object_unref0 (_data_->content_type);
			_g_object_unref0 (_data_->transport);
			_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_->_tmp44_ = _data_->content_node->security;
	if (_data_->_tmp44_ != NULL) {
		_data_->_tmp45_ = _data_->self->priv->_stream;
		_data_->_tmp46_ = xmpp_xep_jingle_module_IDENTITY;
		_data_->_tmp47_ = xmpp_xmpp_stream_get_module (_data_->_tmp45_, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp46_);
		_data_->_tmp48_ = (XmppXepJingleModule*) _data_->_tmp47_;
		_data_->_tmp49_ = _data_->content_node->security;
		_data_->_tmp50_ = ((XmppStanzaEntry*) _data_->_tmp49_)->ns_uri;
		_data_->_tmp51_ = xmpp_xep_jingle_module_get_security_precondition (_data_->_tmp48_, _data_->_tmp50_);
		_g_object_unref0 (_data_->_tmp43_);
		_data_->_tmp43_ = _data_->_tmp51_;
		_g_object_unref0 (_data_->_tmp48_);
	} else {
		_g_object_unref0 (_data_->_tmp43_);
		_data_->_tmp43_ = NULL;
	}
	_data_->_tmp52_ = _data_->_tmp43_;
	_data_->_tmp43_ = NULL;
	_data_->precondition = _data_->_tmp52_;
	_data_->security_params = NULL;
	_data_->_tmp53_ = _data_->precondition;
	if (_data_->_tmp53_ != NULL) {
		_data_->_tmp54_ = _data_->precondition;
		_data_->_tmp55_ = xmpp_xep_jingle_security_precondition_security_ns_uri (_data_->_tmp54_);
		_data_->_tmp56_ = _data_->_tmp55_;
		g_debug ("session.vala:183: Using precondition %s", _data_->_tmp56_);
		_g_free0 (_data_->_tmp56_);
		_data_->_tmp58_ = _data_->precondition;
		_data_->_tmp59_ = _data_->self->priv->_stream;
		_data_->_tmp60_ = _data_->my_jid;
		_data_->_tmp61_ = _data_->content_node->security;
		_data_->_tmp62_ = xmpp_xep_jingle_security_precondition_parse_security_parameters (_data_->_tmp58_, _data_->_tmp59_, _data_->_tmp60_, _data_->peer_full_jid, _data_->_tmp61_, &_data_->_inner_error0_);
		_data_->_tmp57_ = _data_->_tmp62_;
		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_->security_params);
				_g_object_unref0 (_data_->precondition);
				_g_object_unref0 (_data_->_tmp43_);
				_g_object_unref0 (_data_->content_params);
				_g_object_unref0 (_data_->transport_params);
				_g_object_unref0 (_data_->content_type);
				_g_object_unref0 (_data_->transport);
				_xmpp_jid_unref0 (_data_->my_jid);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_object_unref0 (_data_->security_params);
				_g_object_unref0 (_data_->precondition);
				_g_object_unref0 (_data_->_tmp43_);
				_g_object_unref0 (_data_->content_params);
				_g_object_unref0 (_data_->transport_params);
				_g_object_unref0 (_data_->content_type);
				_g_object_unref0 (_data_->transport);
				_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_->_tmp63_ = _data_->_tmp57_;
		_data_->_tmp57_ = NULL;
		_g_object_unref0 (_data_->security_params);
		_data_->security_params = _data_->_tmp63_;
		_g_object_unref0 (_data_->_tmp57_);
	} else {
		_data_->_tmp64_ = _data_->content_node->security;
		if (_data_->_tmp64_ != NULL) {
			_data_->_tmp65_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_NOT_IMPLEMENTED, "unknown security precondition");
			_data_->_inner_error0_ = _data_->_tmp65_;
			if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->security_params);
				_g_object_unref0 (_data_->precondition);
				_g_object_unref0 (_data_->_tmp43_);
				_g_object_unref0 (_data_->content_params);
				_g_object_unref0 (_data_->transport_params);
				_g_object_unref0 (_data_->content_type);
				_g_object_unref0 (_data_->transport);
				_xmpp_jid_unref0 (_data_->my_jid);
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_object_unref0 (_data_->security_params);
				_g_object_unref0 (_data_->precondition);
				_g_object_unref0 (_data_->_tmp43_);
				_g_object_unref0 (_data_->content_params);
				_g_object_unref0 (_data_->transport_params);
				_g_object_unref0 (_data_->content_type);
				_g_object_unref0 (_data_->transport);
				_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_->_tmp66_ = _data_->content_type;
	_data_->_tmp67_ = xmpp_xep_jingle_content_type_get_required_transport_type (_data_->_tmp66_);
	_data_->_tmp68_ = _data_->_tmp67_;
	_data_->type = _data_->_tmp68_;
	_data_->_tmp70_ = _data_->transport;
	if (_data_->_tmp70_ == NULL) {
		_data_->_tmp69_ = TRUE;
	} else {
		_data_->_tmp71_ = _data_->transport;
		_data_->_tmp72_ = xmpp_xep_jingle_transport_get_type_ (_data_->_tmp71_);
		_data_->_tmp73_ = _data_->_tmp72_;
		_data_->_tmp69_ = _data_->_tmp73_ != _data_->type;
	}
	if (_data_->_tmp69_) {
		xmpp_xep_jingle_session_terminate (_data_->self, XMPP_XEP_JINGLE_REASON_ELEMENT_UNSUPPORTED_TRANSPORTS, NULL, "unsupported transports");
		_data_->_tmp74_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_NOT_IMPLEMENTED, "unsupported transports");
		_data_->_inner_error0_ = _data_->_tmp74_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->security_params);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->_tmp43_);
			_g_object_unref0 (_data_->content_params);
			_g_object_unref0 (_data_->transport_params);
			_g_object_unref0 (_data_->content_type);
			_g_object_unref0 (_data_->transport);
			_xmpp_jid_unref0 (_data_->my_jid);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->security_params);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->_tmp43_);
			_g_object_unref0 (_data_->content_params);
			_g_object_unref0 (_data_->transport_params);
			_g_object_unref0 (_data_->content_type);
			_g_object_unref0 (_data_->transport);
			_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_->_tmp75_ = _data_->content_node->name;
	_data_->_tmp76_ = _data_->content_type;
	_data_->_tmp77_ = _data_->content_params;
	_data_->_tmp78_ = _data_->transport;
	_data_->_tmp79_ = _data_->transport_params;
	_data_->_tmp80_ = _data_->precondition;
	_data_->_tmp81_ = _data_->security_params;
	_data_->_tmp82_ = _data_->my_jid;
	_data_->_tmp83_ = xmpp_xep_jingle_content_new_initiate_received (_data_->_tmp75_, _data_->content_node->senders, _data_->_tmp76_, _data_->_tmp77_, _data_->_tmp78_, _data_->_tmp79_, _data_->_tmp80_, _data_->_tmp81_, _data_->_tmp82_, _data_->peer_full_jid, &_data_->_inner_error0_);
	_data_->content = _data_->_tmp83_;
	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_->security_params);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->_tmp43_);
			_g_object_unref0 (_data_->content_params);
			_g_object_unref0 (_data_->transport_params);
			_g_object_unref0 (_data_->content_type);
			_g_object_unref0 (_data_->transport);
			_xmpp_jid_unref0 (_data_->my_jid);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->security_params);
			_g_object_unref0 (_data_->precondition);
			_g_object_unref0 (_data_->_tmp43_);
			_g_object_unref0 (_data_->content_params);
			_g_object_unref0 (_data_->transport_params);
			_g_object_unref0 (_data_->content_type);
			_g_object_unref0 (_data_->transport);
			_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_->_tmp84_ = _data_->content;
	xmpp_xep_jingle_session_insert_content (_data_->self, _data_->_tmp84_);
	_data_->_tmp85_ = _data_->content_params;
	_data_->_tmp86_ = _data_->self->priv->_stream;
	_data_->_tmp87_ = _data_->content;
	_data_->_state_ = 1;
	xmpp_xep_jingle_content_parameters_handle_proposed_content (_data_->_tmp85_, _data_->_tmp86_, _data_->self, _data_->_tmp87_, xmpp_xep_jingle_session_insert_content_node_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_xep_jingle_content_parameters_handle_proposed_content_finish (_data_->_tmp85_, _data_->_res_);
	_data_->_tmp88_ = _data_->self->priv->_state;
	if (_data_->_tmp88_ == XMPP_XEP_JINGLE_SESSION_STATE_ACTIVE) {
		_data_->_tmp89_ = _data_->self->priv->_stream;
		_data_->_tmp90_ = _data_->content;
		g_signal_emit (_data_->self, xmpp_xep_jingle_session_signals[XMPP_XEP_JINGLE_SESSION_ADDITIONAL_CONTENT_ADD_INCOMING_SIGNAL], 0, _data_->_tmp89_, _data_->_tmp90_);
	}
	_g_object_unref0 (_data_->content);
	_g_object_unref0 (_data_->security_params);
	_g_object_unref0 (_data_->precondition);
	_g_object_unref0 (_data_->_tmp43_);
	_g_object_unref0 (_data_->content_params);
	_g_object_unref0 (_data_->transport_params);
	_g_object_unref0 (_data_->content_type);
	_g_object_unref0 (_data_->transport);
	_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_session_add_content_data_free (gpointer _data)
{
	XmppXepJingleSessionAddContentData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->content);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSessionAddContentData, _data_);
}

void
xmpp_xep_jingle_session_add_content (XmppXepJingleSession* self,
                                     XmppXepJingleContent* content,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	XmppXepJingleSessionAddContentData* _data_;
	XmppXepJingleSession* _tmp0_;
	XmppXepJingleContent* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSessionAddContentData);
	_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_session_add_content_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (content);
	_g_object_unref0 (_data_->content);
	_data_->content = _tmp1_;
	xmpp_xep_jingle_session_add_content_co (_data_);
}

void
xmpp_xep_jingle_session_add_content_finish (XmppXepJingleSession* self,
                                            GAsyncResult* _res_)
{
	XmppXepJingleSessionAddContentData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_jingle_session_add_content_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	XmppXepJingleSessionAddContentData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_session_add_content_co (_data_);
}

static gboolean
xmpp_xep_jingle_session_add_content_co (XmppXepJingleSessionAddContentData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	xmpp_xep_jingle_session_insert_content (_data_->self, _data_->content);
	_data_->_tmp0_ = xmpp_stanza_node_new_build ("jingle", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = xmpp_stanza_node_put_attribute (_data_->_tmp3_, "action", "content-add", NULL);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->self->priv->_sid;
	_data_->_tmp7_ = xmpp_stanza_node_put_attribute (_data_->_tmp5_, "sid", _data_->_tmp6_, NULL);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = xmpp_stanza_node_new_build ("content", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = xmpp_stanza_node_put_attribute (_data_->_tmp10_, "creator", "initiator", NULL);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = xmpp_xep_jingle_content_get_content_name (_data_->content);
	_data_->_tmp14_ = _data_->_tmp13_;
	_data_->_tmp15_ = xmpp_stanza_node_put_attribute (_data_->_tmp12_, "name", _data_->_tmp14_, NULL);
	_data_->_tmp16_ = _data_->_tmp15_;
	_data_->_tmp17_ = xmpp_xep_jingle_content_get_senders (_data_->content);
	_data_->_tmp18_ = _data_->_tmp17_;
	_data_->_tmp19_ = xmpp_xep_jingle_senders_to_string (_data_->_tmp18_);
	_data_->_tmp20_ = _data_->_tmp19_;
	_data_->_tmp21_ = xmpp_stanza_node_put_attribute (_data_->_tmp16_, "senders", _data_->_tmp20_, NULL);
	_data_->_tmp22_ = _data_->_tmp21_;
	_data_->_tmp23_ = _data_->content->content_params;
	_data_->_tmp24_ = xmpp_xep_jingle_content_parameters_get_description_node (_data_->_tmp23_);
	_data_->_tmp25_ = _data_->_tmp24_;
	_data_->_tmp26_ = xmpp_stanza_node_put_node (_data_->_tmp22_, _data_->_tmp25_);
	_data_->_tmp27_ = _data_->_tmp26_;
	_data_->_tmp28_ = _data_->content->transport_params;
	_data_->_tmp29_ = xmpp_xep_jingle_transport_parameters_to_transport_stanza_node (_data_->_tmp28_, "content-add");
	_data_->_tmp30_ = _data_->_tmp29_;
	_data_->_tmp31_ = xmpp_stanza_node_put_node (_data_->_tmp27_, _data_->_tmp30_);
	_data_->_tmp32_ = _data_->_tmp31_;
	_data_->_tmp33_ = xmpp_stanza_node_put_node (_data_->_tmp8_, _data_->_tmp32_);
	_data_->_tmp34_ = _data_->_tmp33_;
	_xmpp_stanza_entry_unref0 (_data_->_tmp32_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp30_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp27_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp25_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp22_);
	_g_free0 (_data_->_tmp20_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp16_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp12_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp10_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp8_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp3_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp1_);
	_data_->content_add_node = _data_->_tmp34_;
	_data_->_tmp35_ = _data_->self->priv->_peer_full_jid;
	_data_->_tmp36_ = _xmpp_jid_ref0 (_data_->_tmp35_);
	_data_->_tmp37_ = NULL;
	_data_->_tmp37_ = xmpp_iq_stanza_new_set (_data_->content_add_node, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _data_->_tmp37_, _data_->_tmp36_);
	_xmpp_jid_unref0 (_data_->_tmp36_);
	_data_->iq = _data_->_tmp37_;
	_data_->_tmp38_ = _data_->self->priv->_stream;
	_data_->_tmp39_ = xmpp_iq_module_IDENTITY;
	_data_->_tmp40_ = xmpp_xmpp_stream_get_module (_data_->_tmp38_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp39_);
	_data_->_tmp41_ = (XmppIqModule*) _data_->_tmp40_;
	_data_->_tmp42_ = _data_->self->priv->_stream;
	_data_->_state_ = 1;
	xmpp_iq_module_send_iq_async (_data_->_tmp41_, _data_->_tmp42_, _data_->iq, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_session_add_content_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp43_ = xmpp_iq_module_send_iq_finish (_data_->_tmp41_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp44_ = _data_->_tmp43_;
	_g_object_unref0 (_data_->_tmp44_);
	_g_object_unref0 (_data_->_tmp41_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->iq);
		_xmpp_stanza_entry_unref0 (_data_->content_add_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_->iq);
	_xmpp_stanza_entry_unref0 (_data_->content_add_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 void
xmpp_xep_jingle_session_handle_content_accept (XmppXepJingleSession* self,
                                               XmppXepJingleContentNode* content_node,
                                               GError** error)
{
	gboolean _tmp0_ = FALSE;
	XmppStanzaNode* _tmp1_;
	GeeHashMap* _tmp4_;
	const gchar* _tmp5_;
	XmppXepJingleContent* content = NULL;
	GeeHashMap* _tmp7_;
	const gchar* _tmp8_;
	gpointer _tmp9_;
	XmppXepJingleContent* _tmp10_;
	XmppXepJingleRole _tmp11_;
	XmppXepJingleRole _tmp12_;
	XmppXepJingleContent* _tmp13_;
	XmppXepJingleSenders _tmp14_;
	XmppXepJingleSenders _tmp15_;
	XmppStanzaNode* _tmp16_;
	const gchar* _tmp17_;
	XmppXepJingleContent* _tmp18_;
	XmppXepJingleTransportParameters* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	XmppXepJingleContent* _tmp23_;
	XmppXmppStream* _tmp24_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content_node != NULL);
	_tmp1_ = content_node->description;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		XmppStanzaNode* _tmp2_;
		_tmp2_ = content_node->transport;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		GError* _tmp3_;
		_tmp3_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing description or transport node");
		_inner_error0_ = _tmp3_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp4_ = self->contents_map;
	_tmp5_ = content_node->name;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp4_, _tmp5_)) {
		GError* _tmp6_;
		_tmp6_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "unknown content");
		_inner_error0_ = _tmp6_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp7_ = self->contents_map;
	_tmp8_ = content_node->name;
	_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, _tmp8_);
	content = (XmppXepJingleContent*) _tmp9_;
	_tmp10_ = content;
	_tmp11_ = xmpp_xep_jingle_content_get_content_creator (_tmp10_);
	_tmp12_ = _tmp11_;
	if (content_node->creator != _tmp12_) {
		g_warning ("session.vala:234: Counterpart accepts content with an unexpected `crea" \
"tor`");
	}
	_tmp13_ = content;
	_tmp14_ = xmpp_xep_jingle_content_get_senders (_tmp13_);
	_tmp15_ = _tmp14_;
	if (content_node->senders != _tmp15_) {
		g_warning ("session.vala:235: Counterpart accepts content with an unexpected `send" \
"ers`");
	}
	_tmp16_ = content_node->transport;
	_tmp17_ = ((XmppStanzaEntry*) _tmp16_)->ns_uri;
	_tmp18_ = content;
	_tmp19_ = _tmp18_->transport_params;
	_tmp20_ = xmpp_xep_jingle_transport_parameters_get_ns_uri (_tmp19_);
	_tmp21_ = _tmp20_;
	if (g_strcmp0 (_tmp17_, _tmp21_) != 0) {
		GError* _tmp22_;
		_tmp22_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "session-accept with unnegotiated transport method");
		_inner_error0_ = _tmp22_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (content);
			return;
		} else {
			_g_object_unref0 (content);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp23_ = content;
	_tmp24_ = self->priv->_stream;
	xmpp_xep_jingle_content_handle_accept (_tmp23_, _tmp24_, content_node);
	_g_object_unref0 (content);
}

static void
xmpp_xep_jingle_session_handle_content_modify (XmppXepJingleSession* self,
                                               XmppXmppStream* stream,
                                               XmppStanzaNode* jingle_node,
                                               XmppIqStanza* iq,
                                               GError** error)
{
	XmppXepJingleContentNode* content_node = NULL;
	XmppXepJingleContentNode* _tmp0_;
	XmppXepJingleContent* content = NULL;
	GeeHashMap* _tmp1_;
	XmppXepJingleContentNode* _tmp2_;
	const gchar* _tmp3_;
	gpointer _tmp4_;
	XmppXepJingleContent* _tmp5_;
	XmppXepJingleContentNode* _tmp7_;
	XmppXepJingleContent* _tmp8_;
	XmppXepJingleRole _tmp9_;
	XmppXepJingleRole _tmp10_;
	XmppIqStanza* result_iq = NULL;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_;
	XmppIqStanza* _tmp14_ = NULL;
	XmppModuleIdentity* _tmp15_;
	gpointer _tmp16_;
	XmppIqModule* _tmp17_;
	XmppIqStanza* _tmp18_;
	XmppXepJingleContent* _tmp19_;
	XmppXepJingleContentNode* _tmp20_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jingle_node != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = xmpp_xep_jingle_get_single_content_node (jingle_node, &_inner_error0_);
	content_node = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp1_ = self->contents_map;
	_tmp2_ = content_node;
	_tmp3_ = _tmp2_->name;
	_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp3_);
	content = (XmppXepJingleContent*) _tmp4_;
	_tmp5_ = content;
	if (_tmp5_ == NULL) {
		GError* _tmp6_;
		_tmp6_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "no such content");
		_inner_error0_ = _tmp6_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (content);
			_xmpp_xep_jingle_content_node_unref0 (content_node);
			return;
		} else {
			_g_object_unref0 (content);
			_xmpp_xep_jingle_content_node_unref0 (content_node);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp7_ = content_node;
	_tmp8_ = content;
	_tmp9_ = xmpp_xep_jingle_content_get_content_creator (_tmp8_);
	_tmp10_ = _tmp9_;
	if (_tmp7_->creator != _tmp10_) {
		GError* _tmp11_;
		_tmp11_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "mismatching creator");
		_inner_error0_ = _tmp11_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (content);
			_xmpp_xep_jingle_content_node_unref0 (content_node);
			return;
		} else {
			_g_object_unref0 (content);
			_xmpp_xep_jingle_content_node_unref0 (content_node);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp12_ = self->priv->_peer_full_jid;
	_tmp13_ = _xmpp_jid_ref0 (_tmp12_);
	_tmp14_ = xmpp_iq_stanza_new_result (iq, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp14_, _tmp13_);
	_xmpp_jid_unref0 (_tmp13_);
	result_iq = _tmp14_;
	_tmp15_ = xmpp_iq_module_IDENTITY;
	_tmp16_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp15_);
	_tmp17_ = (XmppIqModule*) _tmp16_;
	_tmp18_ = result_iq;
	xmpp_iq_module_send_iq (_tmp17_, stream, _tmp18_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp17_);
	_tmp19_ = content;
	_tmp20_ = content_node;
	xmpp_xep_jingle_content_handle_content_modify (_tmp19_, stream, _tmp20_->senders);
	_g_object_unref0 (result_iq);
	_g_object_unref0 (content);
	_xmpp_xep_jingle_content_node_unref0 (content_node);
}

static void
xmpp_xep_jingle_session_handle_session_accept (XmppXepJingleSession* self,
                                               GeeList* content_nodes,
                                               XmppStanzaNode* jingle,
                                               XmppIqStanza* iq,
                                               GError** error)
{
	gchar* responder_str = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	XmppJid* responder = NULL;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	const gchar* _tmp4_;
	XmppXmppStream* _tmp19_;
	XmppModuleIdentity* _tmp20_;
	gpointer _tmp21_;
	XmppIqModule* _tmp22_;
	XmppXmppStream* _tmp23_;
	XmppIqStanza* _tmp24_;
	XmppIqStanza* _tmp25_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content_nodes != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = xmpp_stanza_node_get_attribute (jingle, "responder", NULL);
	_tmp1_ = g_strdup (_tmp0_);
	responder_str = _tmp1_;
	_tmp2_ = xmpp_stanza_get_from ((XmppStanza*) iq);
	_tmp3_ = _tmp2_;
	responder = _tmp3_;
	_tmp4_ = responder_str;
	if (_tmp4_ != NULL) {
		{
			XmppJid* _tmp5_ = NULL;
			const gchar* _tmp6_;
			XmppJid* _tmp7_;
			XmppJid* _tmp8_;
			_tmp6_ = responder_str;
			_tmp7_ = xmpp_jid_new (_tmp6_, &_inner_error0_);
			_tmp5_ = _tmp7_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch0_xmpp_invalid_jid_error;
				}
				_xmpp_jid_unref0 (responder);
				_g_free0 (responder_str);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
			_tmp8_ = _tmp5_;
			_tmp5_ = NULL;
			_xmpp_jid_unref0 (responder);
			responder = _tmp8_;
			_xmpp_jid_unref0 (_tmp5_);
		}
		goto __finally0;
		__catch0_xmpp_invalid_jid_error:
		{
			GError* e = NULL;
			GError* _tmp9_;
			const gchar* _tmp10_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp9_ = e;
			_tmp10_ = _tmp9_->message;
			g_warning ("session.vala:262: Received invalid session accept: %s", _tmp10_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_xmpp_jid_unref0 (responder);
				_g_free0 (responder_str);
				return;
			} else {
				_xmpp_jid_unref0 (responder);
				_g_free0 (responder_str);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		}
	}
	{
		GeeList* _content_node_list = NULL;
		gint _content_node_size = 0;
		GeeList* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gint _content_node_index = 0;
		_content_node_list = content_nodes;
		_tmp11_ = _content_node_list;
		_tmp12_ = gee_collection_get_size ((GeeCollection*) _tmp11_);
		_tmp13_ = _tmp12_;
		_content_node_size = _tmp13_;
		_content_node_index = -1;
		while (TRUE) {
			gint _tmp14_;
			gint _tmp15_;
			XmppXepJingleContentNode* content_node = NULL;
			GeeList* _tmp16_;
			gpointer _tmp17_;
			XmppXepJingleContentNode* _tmp18_;
			_content_node_index = _content_node_index + 1;
			_tmp14_ = _content_node_index;
			_tmp15_ = _content_node_size;
			if (!(_tmp14_ < _tmp15_)) {
				break;
			}
			_tmp16_ = _content_node_list;
			_tmp17_ = gee_list_get (_tmp16_, _content_node_index);
			content_node = (XmppXepJingleContentNode*) _tmp17_;
			_tmp18_ = content_node;
			xmpp_xep_jingle_session_handle_content_accept (self, _tmp18_, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_xmpp_xep_jingle_content_node_unref0 (content_node);
					_xmpp_jid_unref0 (responder);
					_g_free0 (responder_str);
					return;
				} else {
					_xmpp_xep_jingle_content_node_unref0 (content_node);
					_xmpp_jid_unref0 (responder);
					_g_free0 (responder_str);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
			}
			_xmpp_xep_jingle_content_node_unref0 (content_node);
		}
	}
	_tmp19_ = self->priv->_stream;
	_tmp20_ = xmpp_iq_module_IDENTITY;
	_tmp21_ = xmpp_xmpp_stream_get_module (_tmp19_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp20_);
	_tmp22_ = (XmppIqModule*) _tmp21_;
	_tmp23_ = self->priv->_stream;
	_tmp24_ = xmpp_iq_stanza_new_result (iq, NULL);
	_tmp25_ = _tmp24_;
	xmpp_iq_module_send_iq (_tmp22_, _tmp23_, _tmp25_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp25_);
	_g_object_unref0 (_tmp22_);
	xmpp_xep_jingle_session_set_state (self, XMPP_XEP_JINGLE_SESSION_STATE_ACTIVE);
	_xmpp_jid_unref0 (responder);
	_g_free0 (responder_str);
}

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

static gboolean
_vala_string_array_contains (const gchar* * stack,
                             gssize stack_length,
                             const const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static void
xmpp_xep_jingle_session_handle_session_terminate (XmppXepJingleSession* self,
                                                  XmppStanzaNode* jingle,
                                                  XmppIqStanza* iq,
                                                  GError** error)
{
	gchar* reason_text = NULL;
	gchar* reason_name = NULL;
	XmppStanzaNode* reason_node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppXmppStream* _tmp60_;
	XmppModuleIdentity* _tmp61_;
	gpointer _tmp62_;
	XmppIqModule* _tmp63_;
	XmppXmppStream* _tmp64_;
	XmppIqStanza* _tmp65_;
	XmppIqStanza* _tmp66_;
	XmppXmppStream* _tmp67_;
	const gchar* _tmp68_;
	const gchar* _tmp69_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	reason_text = NULL;
	reason_name = NULL;
	_tmp0_ = ((XmppStanza*) iq)->stanza;
	_tmp1_ = xmpp_stanza_node_get_deep_subnode (_tmp0_, XMPP_XEP_JINGLE_NS_URI ":jingle", XMPP_XEP_JINGLE_NS_URI ":reason", NULL);
	reason_node = _tmp1_;
	_tmp2_ = reason_node;
	if (_tmp2_ != NULL) {
		XmppStanzaNode* _tmp3_;
		GeeList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		XmppStanzaNode* specific_reason_node = NULL;
		XmppStanzaNode* text_node = NULL;
		const gchar* _tmp27_ = NULL;
		XmppStanzaNode* _tmp28_;
		gchar* _tmp31_;
		const gchar* _tmp32_ = NULL;
		XmppStanzaNode* _tmp33_;
		gchar* _tmp36_;
		gboolean _tmp37_ = FALSE;
		const gchar* _tmp38_;
		_tmp3_ = reason_node;
		_tmp4_ = _tmp3_->sub_nodes;
		_tmp5_ = gee_collection_get_size ((GeeCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		if (_tmp6_ > 2) {
			XmppStanzaNode* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			_tmp7_ = ((XmppStanza*) iq)->stanza;
			_tmp8_ = xmpp_stanza_entry_to_string ((XmppStanzaEntry*) _tmp7_, 0);
			_tmp9_ = _tmp8_;
			g_warning ("session.vala:279: Jingle session-terminate reason node w/ >2 subnodes:" \
" %s", _tmp9_);
			_g_free0 (_tmp9_);
		}
		specific_reason_node = NULL;
		text_node = NULL;
		{
			GeeList* _node_list = NULL;
			XmppStanzaNode* _tmp10_;
			GeeList* _tmp11_;
			gint _node_size = 0;
			GeeList* _tmp12_;
			gint _tmp13_;
			gint _tmp14_;
			gint _node_index = 0;
			_tmp10_ = reason_node;
			_tmp11_ = _tmp10_->sub_nodes;
			_node_list = _tmp11_;
			_tmp12_ = _node_list;
			_tmp13_ = gee_collection_get_size ((GeeCollection*) _tmp12_);
			_tmp14_ = _tmp13_;
			_node_size = _tmp14_;
			_node_index = -1;
			while (TRUE) {
				gint _tmp15_;
				gint _tmp16_;
				XmppStanzaNode* node = NULL;
				GeeList* _tmp17_;
				gpointer _tmp18_;
				XmppStanzaNode* _tmp19_;
				const gchar* _tmp20_;
				_node_index = _node_index + 1;
				_tmp15_ = _node_index;
				_tmp16_ = _node_size;
				if (!(_tmp15_ < _tmp16_)) {
					break;
				}
				_tmp17_ = _node_list;
				_tmp18_ = gee_list_get (_tmp17_, _node_index);
				node = (XmppStanzaNode*) _tmp18_;
				_tmp19_ = node;
				_tmp20_ = ((XmppStanzaEntry*) _tmp19_)->name;
				if (g_strcmp0 (_tmp20_, "text") == 0) {
					XmppStanzaNode* _tmp21_;
					XmppStanzaNode* _tmp22_;
					_tmp21_ = node;
					_tmp22_ = _xmpp_stanza_entry_ref0 (_tmp21_);
					_xmpp_stanza_entry_unref0 (text_node);
					text_node = _tmp22_;
				} else {
					XmppStanzaNode* _tmp23_;
					const gchar* _tmp24_;
					_tmp23_ = node;
					_tmp24_ = ((XmppStanzaEntry*) _tmp23_)->ns_uri;
					if (g_strcmp0 (_tmp24_, XMPP_XEP_JINGLE_NS_URI) == 0) {
						XmppStanzaNode* _tmp25_;
						XmppStanzaNode* _tmp26_;
						_tmp25_ = node;
						_tmp26_ = _xmpp_stanza_entry_ref0 (_tmp25_);
						_xmpp_stanza_entry_unref0 (specific_reason_node);
						specific_reason_node = _tmp26_;
					}
				}
				_xmpp_stanza_entry_unref0 (node);
			}
		}
		_tmp28_ = specific_reason_node;
		if (_tmp28_ != NULL) {
			XmppStanzaNode* _tmp29_;
			const gchar* _tmp30_;
			_tmp29_ = specific_reason_node;
			_tmp30_ = ((XmppStanzaEntry*) _tmp29_)->name;
			_tmp27_ = _tmp30_;
		} else {
			_tmp27_ = NULL;
		}
		_tmp31_ = g_strdup (_tmp27_);
		_g_free0 (reason_name);
		reason_name = _tmp31_;
		_tmp33_ = text_node;
		if (_tmp33_ != NULL) {
			XmppStanzaNode* _tmp34_;
			const gchar* _tmp35_;
			_tmp34_ = text_node;
			_tmp35_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp34_);
			_tmp32_ = _tmp35_;
		} else {
			_tmp32_ = NULL;
		}
		_tmp36_ = g_strdup (_tmp32_);
		_g_free0 (reason_text);
		reason_text = _tmp36_;
		_tmp38_ = reason_name;
		if (_tmp38_ != NULL) {
			XmppStanzaNode* _tmp39_;
			const gchar* _tmp40_;
			_tmp39_ = specific_reason_node;
			_tmp40_ = ((XmppStanzaEntry*) _tmp39_)->name;
			_tmp37_ = !_vala_string_array_contains (XMPP_XEP_JINGLE_REASON_ELEMENT_NORMAL_TERMINATE_REASONS, G_N_ELEMENTS (XMPP_XEP_JINGLE_REASON_ELEMENT_NORMAL_TERMINATE_REASONS), _tmp40_);
		} else {
			_tmp37_ = FALSE;
		}
		if (_tmp37_) {
			const gchar* _tmp41_ = NULL;
			const gchar* _tmp42_;
			const gchar* _tmp43_ = NULL;
			const gchar* _tmp44_;
			_tmp42_ = reason_name;
			_tmp41_ = _tmp42_;
			if (_tmp41_ == NULL) {
				_tmp41_ = "";
			}
			_tmp44_ = reason_text;
			_tmp43_ = _tmp44_;
			if (_tmp43_ == NULL) {
				_tmp43_ = "";
			}
			g_warning ("session.vala:294: Jingle session terminated: %s : %s", _tmp41_, _tmp43_);
		} else {
			const gchar* _tmp45_ = NULL;
			const gchar* _tmp46_;
			const gchar* _tmp47_ = NULL;
			const gchar* _tmp48_;
			_tmp46_ = reason_name;
			_tmp45_ = _tmp46_;
			if (_tmp45_ == NULL) {
				_tmp45_ = "";
			}
			_tmp48_ = reason_text;
			_tmp47_ = _tmp48_;
			if (_tmp47_ == NULL) {
				_tmp47_ = "";
			}
			g_debug ("session.vala:296: Jingle session terminated: %s : %s", _tmp45_, _tmp47_);
		}
		_xmpp_stanza_entry_unref0 (text_node);
		_xmpp_stanza_entry_unref0 (specific_reason_node);
	}
	{
		GeeList* _content_list = NULL;
		GeeList* _tmp49_;
		gint _content_size = 0;
		GeeList* _tmp50_;
		gint _tmp51_;
		gint _tmp52_;
		gint _content_index = 0;
		_tmp49_ = self->contents;
		_content_list = _tmp49_;
		_tmp50_ = _content_list;
		_tmp51_ = gee_collection_get_size ((GeeCollection*) _tmp50_);
		_tmp52_ = _tmp51_;
		_content_size = _tmp52_;
		_content_index = -1;
		while (TRUE) {
			gint _tmp53_;
			gint _tmp54_;
			XmppXepJingleContent* content = NULL;
			GeeList* _tmp55_;
			gpointer _tmp56_;
			XmppXepJingleContent* _tmp57_;
			const gchar* _tmp58_;
			const gchar* _tmp59_;
			_content_index = _content_index + 1;
			_tmp53_ = _content_index;
			_tmp54_ = _content_size;
			if (!(_tmp53_ < _tmp54_)) {
				break;
			}
			_tmp55_ = _content_list;
			_tmp56_ = gee_list_get (_tmp55_, _content_index);
			content = (XmppXepJingleContent*) _tmp56_;
			_tmp57_ = content;
			_tmp58_ = reason_name;
			_tmp59_ = reason_text;
			xmpp_xep_jingle_content_terminate (_tmp57_, FALSE, _tmp58_, _tmp59_);
			_g_object_unref0 (content);
		}
	}
	_tmp60_ = self->priv->_stream;
	_tmp61_ = xmpp_iq_module_IDENTITY;
	_tmp62_ = xmpp_xmpp_stream_get_module (_tmp60_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp61_);
	_tmp63_ = (XmppIqModule*) _tmp62_;
	_tmp64_ = self->priv->_stream;
	_tmp65_ = xmpp_iq_stanza_new_result (iq, NULL);
	_tmp66_ = _tmp65_;
	xmpp_iq_module_send_iq (_tmp63_, _tmp64_, _tmp66_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp66_);
	_g_object_unref0 (_tmp63_);
	xmpp_xep_jingle_session_set_state (self, XMPP_XEP_JINGLE_SESSION_STATE_ENDED);
	_tmp67_ = self->priv->_stream;
	_tmp68_ = reason_name;
	_tmp69_ = reason_text;
	g_signal_emit (self, xmpp_xep_jingle_session_signals[XMPP_XEP_JINGLE_SESSION_TERMINATED_SIGNAL], 0, _tmp67_, FALSE, _tmp68_, _tmp69_);
	_xmpp_stanza_entry_unref0 (reason_node);
	_g_free0 (reason_name);
	_g_free0 (reason_text);
}

static void
xmpp_xep_jingle_session_handle_session_info_data_free (gpointer _data)
{
	XmppXepJingleSessionHandleSessionInfoData* _data_;
	_data_ = _data;
	_xmpp_stanza_entry_unref0 (_data_->jingle);
	_g_object_unref0 (_data_->iq);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSessionHandleSessionInfoData, _data_);
}

static void
xmpp_xep_jingle_session_handle_session_info (XmppXepJingleSession* self,
                                             XmppStanzaNode* jingle,
                                             XmppIqStanza* iq,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	XmppXepJingleSessionHandleSessionInfoData* _data_;
	XmppXepJingleSession* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppIqStanza* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSessionHandleSessionInfoData);
	_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_session_handle_session_info_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _xmpp_stanza_entry_ref0 (jingle);
	_xmpp_stanza_entry_unref0 (_data_->jingle);
	_data_->jingle = _tmp1_;
	_tmp2_ = _g_object_ref0 (iq);
	_g_object_unref0 (_data_->iq);
	_data_->iq = _tmp2_;
	xmpp_xep_jingle_session_handle_session_info_co (_data_);
}

static void
xmpp_xep_jingle_session_handle_session_info_finish (XmppXepJingleSession* self,
                                                    GAsyncResult* _res_,
                                                    GError** error)
{
	XmppXepJingleSessionHandleSessionInfoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
xmpp_xep_jingle_session_handle_session_info_co (XmppXepJingleSessionHandleSessionInfoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_xep_jingle_get_single_node_anyns (_data_->jingle, NULL, &_data_->_inner_error0_);
	_data_->info = _data_->_tmp0_;
	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_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_ = _data_->info;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp2_ = _data_->self->priv->_stream;
		_data_->_tmp3_ = xmpp_iq_module_IDENTITY;
		_data_->_tmp4_ = xmpp_xmpp_stream_get_module (_data_->_tmp2_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp3_);
		_data_->_tmp5_ = (XmppIqModule*) _data_->_tmp4_;
		_data_->_tmp6_ = _data_->self->priv->_stream;
		_data_->_tmp7_ = xmpp_iq_stanza_new_result (_data_->iq, NULL);
		_data_->_tmp8_ = _data_->_tmp7_;
		xmpp_iq_module_send_iq (_data_->_tmp5_, _data_->_tmp6_, _data_->_tmp8_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
		_g_object_unref0 (_data_->_tmp8_);
		_g_object_unref0 (_data_->_tmp5_);
		_xmpp_stanza_entry_unref0 (_data_->info);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->self->priv->_stream;
	_data_->_tmp10_ = xmpp_xep_jingle_module_IDENTITY;
	_data_->_tmp11_ = xmpp_xmpp_stream_get_module (_data_->_tmp9_, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp10_);
	_data_->_tmp12_ = (XmppXepJingleModule*) _data_->_tmp11_;
	_data_->_tmp13_ = _data_->info;
	_data_->_tmp14_ = ((XmppStanzaEntry*) _data_->_tmp13_)->ns_uri;
	_data_->_tmp15_ = xmpp_xep_jingle_module_get_session_info_type (_data_->_tmp12_, _data_->_tmp14_);
	_data_->_tmp16_ = _data_->_tmp15_;
	_g_object_unref0 (_data_->_tmp12_);
	_data_->info_ns = _data_->_tmp16_;
	_data_->_tmp17_ = _data_->info_ns;
	if (_data_->_tmp17_ == NULL) {
		_data_->_tmp18_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_UNSUPPORTED_INFO, "unknown session-info namespace");
		_data_->_inner_error0_ = _data_->_tmp18_;
		if (_data_->_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->info_ns);
			_xmpp_stanza_entry_unref0 (_data_->info);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->info_ns);
			_xmpp_stanza_entry_unref0 (_data_->info);
			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_->_tmp19_ = _data_->info_ns;
	_data_->_tmp20_ = _data_->self->priv->_stream;
	_data_->_tmp21_ = _data_->info;
	xmpp_xep_jingle_session_info_ns_handle_content_session_info (_data_->_tmp19_, _data_->_tmp20_, _data_->self, _data_->_tmp21_, _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_->info_ns);
			_xmpp_stanza_entry_unref0 (_data_->info);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->info_ns);
			_xmpp_stanza_entry_unref0 (_data_->info);
			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_->_tmp22_ = _data_->self->priv->_peer_full_jid;
	_data_->_tmp23_ = _xmpp_jid_ref0 (_data_->_tmp22_);
	_data_->_tmp24_ = NULL;
	_data_->_tmp24_ = xmpp_iq_stanza_new_result (_data_->iq, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _data_->_tmp24_, _data_->_tmp23_);
	_xmpp_jid_unref0 (_data_->_tmp23_);
	_data_->result_iq = _data_->_tmp24_;
	_data_->_tmp25_ = _data_->self->priv->_stream;
	_data_->_tmp26_ = xmpp_iq_module_IDENTITY;
	_data_->_tmp27_ = xmpp_xmpp_stream_get_module (_data_->_tmp25_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp26_);
	_data_->_tmp28_ = (XmppIqModule*) _data_->_tmp27_;
	_data_->_tmp29_ = _data_->self->priv->_stream;
	_data_->_tmp30_ = _data_->result_iq;
	xmpp_iq_module_send_iq (_data_->_tmp28_, _data_->_tmp29_, _data_->_tmp30_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_data_->_tmp28_);
	_g_object_unref0 (_data_->result_iq);
	_g_object_unref0 (_data_->info_ns);
	_xmpp_stanza_entry_unref0 (_data_->info);
	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_session_accept (XmppXepJingleSession* self)
{
	XmppXepJingleSessionState _tmp0_;
	XmppStanzaNode* jingle = NULL;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	const gchar* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppIqStanza* iq = NULL;
	XmppStanzaNode* _tmp50_;
	XmppJid* _tmp51_;
	XmppJid* _tmp52_;
	XmppIqStanza* _tmp53_ = NULL;
	XmppXmppStream* _tmp54_;
	XmppModuleIdentity* _tmp55_;
	gpointer _tmp56_;
	XmppIqModule* _tmp57_;
	XmppXmppStream* _tmp58_;
	XmppIqStanza* _tmp59_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ != XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_RECEIVED) {
		g_critical ("session.vala:329: Accepting a stream, but we're the initiator");
	}
	_tmp1_ = xmpp_stanza_node_new_build ("jingle", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_stanza_node_add_self_xmlns (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_stanza_node_put_attribute (_tmp4_, "action", "session-accept", NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->_sid;
	_tmp8_ = xmpp_stanza_node_put_attribute (_tmp6_, "sid", _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp2_);
	jingle = _tmp9_;
	{
		GeeList* _content_list = NULL;
		GeeList* _tmp10_;
		gint _content_size = 0;
		GeeList* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gint _content_index = 0;
		_tmp10_ = self->contents;
		_content_list = _tmp10_;
		_tmp11_ = _content_list;
		_tmp12_ = gee_collection_get_size ((GeeCollection*) _tmp11_);
		_tmp13_ = _tmp12_;
		_content_size = _tmp13_;
		_content_index = -1;
		while (TRUE) {
			gint _tmp14_;
			gint _tmp15_;
			XmppXepJingleContent* content = NULL;
			GeeList* _tmp16_;
			gpointer _tmp17_;
			XmppStanzaNode* content_node = NULL;
			XmppStanzaNode* _tmp18_;
			XmppStanzaNode* _tmp19_;
			XmppStanzaNode* _tmp20_;
			XmppStanzaNode* _tmp21_;
			XmppXepJingleContent* _tmp22_;
			const gchar* _tmp23_;
			const gchar* _tmp24_;
			XmppStanzaNode* _tmp25_;
			XmppStanzaNode* _tmp26_;
			XmppXepJingleContent* _tmp27_;
			XmppXepJingleSenders _tmp28_;
			XmppXepJingleSenders _tmp29_;
			gchar* _tmp30_;
			gchar* _tmp31_;
			XmppStanzaNode* _tmp32_;
			XmppStanzaNode* _tmp33_;
			XmppXepJingleContent* _tmp34_;
			XmppXepJingleContentParameters* _tmp35_;
			XmppStanzaNode* _tmp36_;
			XmppStanzaNode* _tmp37_;
			XmppStanzaNode* _tmp38_;
			XmppStanzaNode* _tmp39_;
			XmppXepJingleContent* _tmp40_;
			XmppXepJingleTransportParameters* _tmp41_;
			XmppStanzaNode* _tmp42_;
			XmppStanzaNode* _tmp43_;
			XmppStanzaNode* _tmp44_;
			XmppStanzaNode* _tmp45_;
			XmppStanzaNode* _tmp46_;
			XmppStanzaNode* _tmp47_;
			XmppStanzaNode* _tmp48_;
			XmppStanzaNode* _tmp49_;
			_content_index = _content_index + 1;
			_tmp14_ = _content_index;
			_tmp15_ = _content_size;
			if (!(_tmp14_ < _tmp15_)) {
				break;
			}
			_tmp16_ = _content_list;
			_tmp17_ = gee_list_get (_tmp16_, _content_index);
			content = (XmppXepJingleContent*) _tmp17_;
			_tmp18_ = xmpp_stanza_node_new_build ("content", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
			_tmp19_ = _tmp18_;
			_tmp20_ = xmpp_stanza_node_put_attribute (_tmp19_, "creator", "initiator", NULL);
			_tmp21_ = _tmp20_;
			_tmp22_ = content;
			_tmp23_ = xmpp_xep_jingle_content_get_content_name (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = xmpp_stanza_node_put_attribute (_tmp21_, "name", _tmp24_, NULL);
			_tmp26_ = _tmp25_;
			_tmp27_ = content;
			_tmp28_ = xmpp_xep_jingle_content_get_senders (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp30_ = xmpp_xep_jingle_senders_to_string (_tmp29_);
			_tmp31_ = _tmp30_;
			_tmp32_ = xmpp_stanza_node_put_attribute (_tmp26_, "senders", _tmp31_, NULL);
			_tmp33_ = _tmp32_;
			_tmp34_ = content;
			_tmp35_ = _tmp34_->content_params;
			_tmp36_ = xmpp_xep_jingle_content_parameters_get_description_node (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = xmpp_stanza_node_put_node (_tmp33_, _tmp37_);
			_tmp39_ = _tmp38_;
			_tmp40_ = content;
			_tmp41_ = _tmp40_->transport_params;
			_tmp42_ = xmpp_xep_jingle_transport_parameters_to_transport_stanza_node (_tmp41_, "session-accept");
			_tmp43_ = _tmp42_;
			_tmp44_ = xmpp_stanza_node_put_node (_tmp39_, _tmp43_);
			_tmp45_ = _tmp44_;
			_xmpp_stanza_entry_unref0 (_tmp43_);
			_xmpp_stanza_entry_unref0 (_tmp39_);
			_xmpp_stanza_entry_unref0 (_tmp37_);
			_xmpp_stanza_entry_unref0 (_tmp33_);
			_g_free0 (_tmp31_);
			_xmpp_stanza_entry_unref0 (_tmp26_);
			_xmpp_stanza_entry_unref0 (_tmp21_);
			_xmpp_stanza_entry_unref0 (_tmp19_);
			content_node = _tmp45_;
			_tmp46_ = jingle;
			_tmp47_ = content_node;
			_tmp48_ = xmpp_stanza_node_put_node (_tmp46_, _tmp47_);
			_tmp49_ = _tmp48_;
			_xmpp_stanza_entry_unref0 (_tmp49_);
			_xmpp_stanza_entry_unref0 (content_node);
			_g_object_unref0 (content);
		}
	}
	_tmp50_ = jingle;
	_tmp51_ = self->priv->_peer_full_jid;
	_tmp52_ = _xmpp_jid_ref0 (_tmp51_);
	_tmp53_ = xmpp_iq_stanza_new_set (_tmp50_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp53_, _tmp52_);
	_xmpp_jid_unref0 (_tmp52_);
	iq = _tmp53_;
	_tmp54_ = self->priv->_stream;
	_tmp55_ = xmpp_iq_module_IDENTITY;
	_tmp56_ = xmpp_xmpp_stream_get_module (_tmp54_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp55_);
	_tmp57_ = (XmppIqModule*) _tmp56_;
	_tmp58_ = self->priv->_stream;
	_tmp59_ = iq;
	xmpp_iq_module_send_iq (_tmp57_, _tmp58_, _tmp59_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp57_);
	{
		GeeList* _content2_list = NULL;
		GeeList* _tmp60_;
		gint _content2_size = 0;
		GeeList* _tmp61_;
		gint _tmp62_;
		gint _tmp63_;
		gint _content2_index = 0;
		_tmp60_ = self->contents;
		_content2_list = _tmp60_;
		_tmp61_ = _content2_list;
		_tmp62_ = gee_collection_get_size ((GeeCollection*) _tmp61_);
		_tmp63_ = _tmp62_;
		_content2_size = _tmp63_;
		_content2_index = -1;
		while (TRUE) {
			gint _tmp64_;
			gint _tmp65_;
			XmppXepJingleContent* content2 = NULL;
			GeeList* _tmp66_;
			gpointer _tmp67_;
			XmppXepJingleContent* _tmp68_;
			XmppXmppStream* _tmp69_;
			_content2_index = _content2_index + 1;
			_tmp64_ = _content2_index;
			_tmp65_ = _content2_size;
			if (!(_tmp64_ < _tmp65_)) {
				break;
			}
			_tmp66_ = _content2_list;
			_tmp67_ = gee_list_get (_tmp66_, _content2_index);
			content2 = (XmppXepJingleContent*) _tmp67_;
			_tmp68_ = content2;
			_tmp69_ = self->priv->_stream;
			xmpp_xep_jingle_content_on_accept (_tmp68_, _tmp69_);
			_g_object_unref0 (content2);
		}
	}
	xmpp_xep_jingle_session_set_state (self, XMPP_XEP_JINGLE_SESSION_STATE_ACTIVE);
	_g_object_unref0 (iq);
	_xmpp_stanza_entry_unref0 (jingle);
}

void
xmpp_xep_jingle_session_accept_content (XmppXepJingleSession* self,
                                        XmppXepJingleContent* content)
{
	XmppXepJingleSessionState _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_RECEIVED) {
		gboolean all_accepted = FALSE;
		all_accepted = TRUE;
		{
			GeeList* _c_list = NULL;
			GeeList* _tmp1_;
			gint _c_size = 0;
			GeeList* _tmp2_;
			gint _tmp3_;
			gint _tmp4_;
			gint _c_index = 0;
			_tmp1_ = self->contents;
			_c_list = _tmp1_;
			_tmp2_ = _c_list;
			_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
			_tmp4_ = _tmp3_;
			_c_size = _tmp4_;
			_c_index = -1;
			while (TRUE) {
				gint _tmp5_;
				gint _tmp6_;
				XmppXepJingleContent* c = NULL;
				GeeList* _tmp7_;
				gpointer _tmp8_;
				XmppXepJingleContent* _tmp9_;
				XmppXepJingleContentState _tmp10_;
				XmppXepJingleContentState _tmp11_;
				_c_index = _c_index + 1;
				_tmp5_ = _c_index;
				_tmp6_ = _c_size;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				_tmp7_ = _c_list;
				_tmp8_ = gee_list_get (_tmp7_, _c_index);
				c = (XmppXepJingleContent*) _tmp8_;
				_tmp9_ = c;
				_tmp10_ = xmpp_xep_jingle_content_get_state (_tmp9_);
				_tmp11_ = _tmp10_;
				if (_tmp11_ != XMPP_XEP_JINGLE_CONTENT_STATE_WANTS_TO_BE_ACCEPTED) {
					all_accepted = FALSE;
				}
				_g_object_unref0 (c);
			}
		}
		if (all_accepted) {
			xmpp_xep_jingle_session_accept (self);
		}
	} else {
		XmppXepJingleSessionState _tmp12_;
		_tmp12_ = self->priv->_state;
		if (_tmp12_ == XMPP_XEP_JINGLE_SESSION_STATE_ACTIVE) {
			XmppStanzaNode* content_accept_node = NULL;
			XmppStanzaNode* _tmp13_;
			XmppStanzaNode* _tmp14_;
			XmppStanzaNode* _tmp15_;
			XmppStanzaNode* _tmp16_;
			XmppStanzaNode* _tmp17_;
			XmppStanzaNode* _tmp18_;
			const gchar* _tmp19_;
			XmppStanzaNode* _tmp20_;
			XmppStanzaNode* _tmp21_;
			XmppStanzaNode* _tmp22_;
			XmppStanzaNode* _tmp23_;
			XmppStanzaNode* _tmp24_;
			XmppStanzaNode* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			XmppStanzaNode* _tmp28_;
			XmppStanzaNode* _tmp29_;
			XmppXepJingleSenders _tmp30_;
			XmppXepJingleSenders _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			XmppStanzaNode* _tmp34_;
			XmppStanzaNode* _tmp35_;
			XmppXepJingleContentParameters* _tmp36_;
			XmppStanzaNode* _tmp37_;
			XmppStanzaNode* _tmp38_;
			XmppStanzaNode* _tmp39_;
			XmppStanzaNode* _tmp40_;
			XmppXepJingleTransportParameters* _tmp41_;
			XmppStanzaNode* _tmp42_;
			XmppStanzaNode* _tmp43_;
			XmppStanzaNode* _tmp44_;
			XmppStanzaNode* _tmp45_;
			XmppStanzaNode* _tmp46_;
			XmppStanzaNode* _tmp47_;
			XmppIqStanza* iq = NULL;
			XmppStanzaNode* _tmp48_;
			XmppJid* _tmp49_;
			XmppJid* _tmp50_;
			XmppIqStanza* _tmp51_ = NULL;
			XmppXmppStream* _tmp52_;
			XmppModuleIdentity* _tmp53_;
			gpointer _tmp54_;
			XmppIqModule* _tmp55_;
			XmppXmppStream* _tmp56_;
			XmppIqStanza* _tmp57_;
			XmppXmppStream* _tmp58_;
			_tmp13_ = xmpp_stanza_node_new_build ("jingle", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
			_tmp14_ = _tmp13_;
			_tmp15_ = xmpp_stanza_node_add_self_xmlns (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = xmpp_stanza_node_put_attribute (_tmp16_, "action", "content-accept", NULL);
			_tmp18_ = _tmp17_;
			_tmp19_ = self->priv->_sid;
			_tmp20_ = xmpp_stanza_node_put_attribute (_tmp18_, "sid", _tmp19_, NULL);
			_tmp21_ = _tmp20_;
			_tmp22_ = xmpp_stanza_node_new_build ("content", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
			_tmp23_ = _tmp22_;
			_tmp24_ = xmpp_stanza_node_put_attribute (_tmp23_, "creator", "initiator", NULL);
			_tmp25_ = _tmp24_;
			_tmp26_ = xmpp_xep_jingle_content_get_content_name (content);
			_tmp27_ = _tmp26_;
			_tmp28_ = xmpp_stanza_node_put_attribute (_tmp25_, "name", _tmp27_, NULL);
			_tmp29_ = _tmp28_;
			_tmp30_ = xmpp_xep_jingle_content_get_senders (content);
			_tmp31_ = _tmp30_;
			_tmp32_ = xmpp_xep_jingle_senders_to_string (_tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = xmpp_stanza_node_put_attribute (_tmp29_, "senders", _tmp33_, NULL);
			_tmp35_ = _tmp34_;
			_tmp36_ = content->content_params;
			_tmp37_ = xmpp_xep_jingle_content_parameters_get_description_node (_tmp36_);
			_tmp38_ = _tmp37_;
			_tmp39_ = xmpp_stanza_node_put_node (_tmp35_, _tmp38_);
			_tmp40_ = _tmp39_;
			_tmp41_ = content->transport_params;
			_tmp42_ = xmpp_xep_jingle_transport_parameters_to_transport_stanza_node (_tmp41_, "content-accept");
			_tmp43_ = _tmp42_;
			_tmp44_ = xmpp_stanza_node_put_node (_tmp40_, _tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = xmpp_stanza_node_put_node (_tmp21_, _tmp45_);
			_tmp47_ = _tmp46_;
			_xmpp_stanza_entry_unref0 (_tmp45_);
			_xmpp_stanza_entry_unref0 (_tmp43_);
			_xmpp_stanza_entry_unref0 (_tmp40_);
			_xmpp_stanza_entry_unref0 (_tmp38_);
			_xmpp_stanza_entry_unref0 (_tmp35_);
			_g_free0 (_tmp33_);
			_xmpp_stanza_entry_unref0 (_tmp29_);
			_xmpp_stanza_entry_unref0 (_tmp25_);
			_xmpp_stanza_entry_unref0 (_tmp23_);
			_xmpp_stanza_entry_unref0 (_tmp21_);
			_xmpp_stanza_entry_unref0 (_tmp18_);
			_xmpp_stanza_entry_unref0 (_tmp16_);
			_xmpp_stanza_entry_unref0 (_tmp14_);
			content_accept_node = _tmp47_;
			_tmp48_ = content_accept_node;
			_tmp49_ = self->priv->_peer_full_jid;
			_tmp50_ = _xmpp_jid_ref0 (_tmp49_);
			_tmp51_ = xmpp_iq_stanza_new_set (_tmp48_, NULL);
			xmpp_stanza_set_to ((XmppStanza*) _tmp51_, _tmp50_);
			_xmpp_jid_unref0 (_tmp50_);
			iq = _tmp51_;
			_tmp52_ = self->priv->_stream;
			_tmp53_ = xmpp_iq_module_IDENTITY;
			_tmp54_ = xmpp_xmpp_stream_get_module (_tmp52_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp53_);
			_tmp55_ = (XmppIqModule*) _tmp54_;
			_tmp56_ = self->priv->_stream;
			_tmp57_ = iq;
			xmpp_iq_module_send_iq (_tmp55_, _tmp56_, _tmp57_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
			_g_object_unref0 (_tmp55_);
			_tmp58_ = self->priv->_stream;
			xmpp_xep_jingle_content_on_accept (content, _tmp58_);
			_g_object_unref0 (iq);
			_xmpp_stanza_entry_unref0 (content_accept_node);
		}
	}
}

static void
xmpp_xep_jingle_session_reject (XmppXepJingleSession* self)
{
	XmppXepJingleSessionState _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ != XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_RECEIVED) {
		g_critical ("session.vala:387: Accepting a stream, but we're the initiator");
	}
	xmpp_xep_jingle_session_terminate (self, XMPP_XEP_JINGLE_REASON_ELEMENT_DECLINE, NULL, "declined");
}

void
xmpp_xep_jingle_session_reject_content (XmppXepJingleSession* self,
                                        XmppXepJingleContent* content)
{
	XmppXepJingleSessionState _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_INITIATE_RECEIVED) {
		xmpp_xep_jingle_session_reject (self);
	} else {
		g_warning ("session.vala:395: not really handeling content rejects");
	}
}

void
xmpp_xep_jingle_session_set_application_error (XmppXepJingleSession* self,
                                               XmppStanzaNode* application_reason)
{
	g_return_if_fail (self != NULL);
	xmpp_xep_jingle_session_terminate (self, XMPP_XEP_JINGLE_REASON_ELEMENT_FAILED_APPLICATION, NULL, "application error");
}

void
xmpp_xep_jingle_session_terminate (XmppXepJingleSession* self,
                                   const gchar* reason_name,
                                   const gchar* reason_text,
                                   const gchar* local_reason)
{
	XmppXepJingleSessionState _tmp0_;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	const gchar* _tmp4_;
	XmppXepJingleSessionState _tmp5_;
	XmppStanzaNode* terminate_iq = NULL;
	XmppStanzaNode* _tmp18_;
	XmppStanzaNode* _tmp19_;
	XmppStanzaNode* _tmp20_;
	XmppStanzaNode* _tmp21_;
	XmppStanzaNode* _tmp22_;
	XmppStanzaNode* _tmp23_;
	const gchar* _tmp24_;
	XmppStanzaNode* _tmp25_;
	XmppStanzaNode* _tmp26_;
	gboolean _tmp27_ = FALSE;
	XmppIqStanza* iq = NULL;
	XmppStanzaNode* _tmp47_;
	XmppJid* _tmp48_;
	XmppJid* _tmp49_;
	XmppIqStanza* _tmp50_ = NULL;
	XmppXmppStream* _tmp51_;
	XmppModuleIdentity* _tmp52_;
	gpointer _tmp53_;
	XmppIqModule* _tmp54_;
	XmppXmppStream* _tmp55_;
	XmppIqStanza* _tmp56_;
	XmppXmppStream* _tmp57_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_ENDED) {
		return;
	}
	_tmp1_ = reason_name;
	if (_tmp1_ == NULL) {
		_tmp1_ = "-";
	}
	_tmp2_ = reason_text;
	if (_tmp2_ == NULL) {
		_tmp2_ = "-";
	}
	_tmp3_ = local_reason;
	if (_tmp3_ == NULL) {
		_tmp3_ = "-";
	}
	_tmp4_ = self->priv->_sid;
	g_debug ("session.vala:405: Jingle session %s terminated: %s; %s; %s", _tmp4_, _tmp1_, _tmp2_, _tmp3_);
	_tmp5_ = self->priv->_state;
	if (_tmp5_ == XMPP_XEP_JINGLE_SESSION_STATE_ACTIVE) {
		gchar* reason_str = NULL;
		if (local_reason != NULL) {
			const gchar* _tmp6_;
			gchar* _tmp7_;
			_tmp6_ = string_to_string (local_reason);
			_tmp7_ = g_strconcat ("local session-terminate: ", _tmp6_, NULL);
			_g_free0 (reason_str);
			reason_str = _tmp7_;
		} else {
			gchar* _tmp8_;
			_tmp8_ = g_strdup ("local session-terminate");
			_g_free0 (reason_str);
			reason_str = _tmp8_;
		}
		{
			GeeList* _content_list = NULL;
			GeeList* _tmp9_;
			gint _content_size = 0;
			GeeList* _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			gint _content_index = 0;
			_tmp9_ = self->contents;
			_content_list = _tmp9_;
			_tmp10_ = _content_list;
			_tmp11_ = gee_collection_get_size ((GeeCollection*) _tmp10_);
			_tmp12_ = _tmp11_;
			_content_size = _tmp12_;
			_content_index = -1;
			while (TRUE) {
				gint _tmp13_;
				gint _tmp14_;
				XmppXepJingleContent* content = NULL;
				GeeList* _tmp15_;
				gpointer _tmp16_;
				XmppXepJingleContent* _tmp17_;
				_content_index = _content_index + 1;
				_tmp13_ = _content_index;
				_tmp14_ = _content_size;
				if (!(_tmp13_ < _tmp14_)) {
					break;
				}
				_tmp15_ = _content_list;
				_tmp16_ = gee_list_get (_tmp15_, _content_index);
				content = (XmppXepJingleContent*) _tmp16_;
				_tmp17_ = content;
				xmpp_xep_jingle_content_terminate (_tmp17_, TRUE, reason_name, reason_text);
				_g_object_unref0 (content);
			}
		}
		_g_free0 (reason_str);
	}
	_tmp18_ = xmpp_stanza_node_new_build ("jingle", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
	_tmp19_ = _tmp18_;
	_tmp20_ = xmpp_stanza_node_add_self_xmlns (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = xmpp_stanza_node_put_attribute (_tmp21_, "action", "session-terminate", NULL);
	_tmp23_ = _tmp22_;
	_tmp24_ = self->priv->_sid;
	_tmp25_ = xmpp_stanza_node_put_attribute (_tmp23_, "sid", _tmp24_, NULL);
	_tmp26_ = _tmp25_;
	_xmpp_stanza_entry_unref0 (_tmp23_);
	_xmpp_stanza_entry_unref0 (_tmp21_);
	_xmpp_stanza_entry_unref0 (_tmp19_);
	terminate_iq = _tmp26_;
	if (reason_name != NULL) {
		_tmp27_ = TRUE;
	} else {
		_tmp27_ = reason_text != NULL;
	}
	if (_tmp27_) {
		XmppStanzaNode* reason_node = NULL;
		XmppStanzaNode* _tmp28_;
		XmppStanzaNode* _tmp43_;
		XmppStanzaNode* _tmp44_;
		XmppStanzaNode* _tmp45_;
		XmppStanzaNode* _tmp46_;
		_tmp28_ = xmpp_stanza_node_new_build ("reason", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
		reason_node = _tmp28_;
		if (reason_name != NULL) {
			XmppStanzaNode* _tmp29_;
			XmppStanzaNode* _tmp30_;
			XmppStanzaNode* _tmp31_;
			XmppStanzaNode* _tmp32_;
			XmppStanzaNode* _tmp33_;
			_tmp29_ = reason_node;
			_tmp30_ = xmpp_stanza_node_new_build (reason_name, XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
			_tmp31_ = _tmp30_;
			_tmp32_ = xmpp_stanza_node_put_node (_tmp29_, _tmp31_);
			_tmp33_ = _tmp32_;
			_xmpp_stanza_entry_unref0 (_tmp33_);
			_xmpp_stanza_entry_unref0 (_tmp31_);
		}
		if (reason_text != NULL) {
			XmppStanzaNode* _tmp34_;
			XmppStanzaNode* _tmp35_;
			XmppStanzaNode* _tmp36_;
			XmppStanzaNode* _tmp37_;
			XmppStanzaNode* _tmp38_;
			XmppStanzaNode* _tmp39_;
			XmppStanzaNode* _tmp40_;
			XmppStanzaNode* _tmp41_;
			XmppStanzaNode* _tmp42_;
			_tmp34_ = reason_node;
			_tmp35_ = xmpp_stanza_node_new_build ("text", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
			_tmp36_ = _tmp35_;
			_tmp37_ = xmpp_stanza_node_new_text (reason_text);
			_tmp38_ = _tmp37_;
			_tmp39_ = xmpp_stanza_node_put_node (_tmp36_, _tmp38_);
			_tmp40_ = _tmp39_;
			_tmp41_ = xmpp_stanza_node_put_node (_tmp34_, _tmp40_);
			_tmp42_ = _tmp41_;
			_xmpp_stanza_entry_unref0 (_tmp42_);
			_xmpp_stanza_entry_unref0 (_tmp40_);
			_xmpp_stanza_entry_unref0 (_tmp38_);
			_xmpp_stanza_entry_unref0 (_tmp36_);
		}
		_tmp43_ = terminate_iq;
		_tmp44_ = reason_node;
		_tmp45_ = xmpp_stanza_node_put_node (_tmp43_, _tmp44_);
		_tmp46_ = _tmp45_;
		_xmpp_stanza_entry_unref0 (_tmp46_);
		_xmpp_stanza_entry_unref0 (reason_node);
	}
	_tmp47_ = terminate_iq;
	_tmp48_ = self->priv->_peer_full_jid;
	_tmp49_ = _xmpp_jid_ref0 (_tmp48_);
	_tmp50_ = xmpp_iq_stanza_new_set (_tmp47_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp50_, _tmp49_);
	_xmpp_jid_unref0 (_tmp49_);
	iq = _tmp50_;
	_tmp51_ = self->priv->_stream;
	_tmp52_ = xmpp_iq_module_IDENTITY;
	_tmp53_ = xmpp_xmpp_stream_get_module (_tmp51_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp52_);
	_tmp54_ = (XmppIqModule*) _tmp53_;
	_tmp55_ = self->priv->_stream;
	_tmp56_ = iq;
	xmpp_iq_module_send_iq (_tmp54_, _tmp55_, _tmp56_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp54_);
	xmpp_xep_jingle_session_set_state (self, XMPP_XEP_JINGLE_SESSION_STATE_ENDED);
	_tmp57_ = self->priv->_stream;
	g_signal_emit (self, xmpp_xep_jingle_session_signals[XMPP_XEP_JINGLE_SESSION_TERMINATED_SIGNAL], 0, _tmp57_, TRUE, reason_name, reason_text);
	_g_object_unref0 (iq);
	_xmpp_stanza_entry_unref0 (terminate_iq);
}

void
xmpp_xep_jingle_session_send_session_info (XmppXepJingleSession* self,
                                           XmppStanzaNode* child_node)
{
	XmppXepJingleSessionState _tmp0_;
	XmppStanzaNode* jingle_node = NULL;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppIqStanza* iq = NULL;
	XmppStanzaNode* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	XmppIqStanza* _tmp8_ = NULL;
	XmppXmppStream* _tmp9_;
	XmppModuleIdentity* _tmp10_;
	gpointer _tmp11_;
	XmppIqModule* _tmp12_;
	XmppXmppStream* _tmp13_;
	XmppIqStanza* _tmp14_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (child_node != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_ENDED) {
		return;
	}
	_tmp1_ = xmpp_xep_jingle_session_build_outer_session_node (self, "session-info");
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_stanza_node_put_node (_tmp2_, child_node);
	_tmp4_ = _tmp3_;
	_xmpp_stanza_entry_unref0 (_tmp2_);
	jingle_node = _tmp4_;
	_tmp5_ = jingle_node;
	_tmp6_ = self->priv->_peer_full_jid;
	_tmp7_ = _xmpp_jid_ref0 (_tmp6_);
	_tmp8_ = xmpp_iq_stanza_new_set (_tmp5_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp8_, _tmp7_);
	_xmpp_jid_unref0 (_tmp7_);
	iq = _tmp8_;
	_tmp9_ = self->priv->_stream;
	_tmp10_ = xmpp_iq_module_IDENTITY;
	_tmp11_ = xmpp_xmpp_stream_get_module (_tmp9_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp10_);
	_tmp12_ = (XmppIqModule*) _tmp11_;
	_tmp13_ = self->priv->_stream;
	_tmp14_ = iq;
	xmpp_iq_module_send_iq (_tmp12_, _tmp13_, _tmp14_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (iq);
	_xmpp_stanza_entry_unref0 (jingle_node);
}

void
xmpp_xep_jingle_session_send_content_modify (XmppXepJingleSession* self,
                                             XmppXepJingleContent* content,
                                             XmppXepJingleSenders senders)
{
	XmppXepJingleSessionState _tmp0_;
	XmppStanzaNode* jingle_node = NULL;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppIqStanza* iq = NULL;
	XmppStanzaNode* _tmp11_;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_;
	XmppIqStanza* _tmp14_ = NULL;
	XmppXmppStream* _tmp15_;
	XmppModuleIdentity* _tmp16_;
	gpointer _tmp17_;
	XmppIqModule* _tmp18_;
	XmppXmppStream* _tmp19_;
	XmppIqStanza* _tmp20_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_ENDED) {
		return;
	}
	_tmp1_ = xmpp_xep_jingle_session_build_outer_session_node (self, "content-modify");
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_xep_jingle_content_build_outer_content_node (content);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_xep_jingle_senders_to_string (senders);
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_stanza_node_put_attribute (_tmp4_, "senders", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = xmpp_stanza_node_put_node (_tmp2_, _tmp8_);
	_tmp10_ = _tmp9_;
	_xmpp_stanza_entry_unref0 (_tmp8_);
	_g_free0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp2_);
	jingle_node = _tmp10_;
	_tmp11_ = jingle_node;
	_tmp12_ = self->priv->_peer_full_jid;
	_tmp13_ = _xmpp_jid_ref0 (_tmp12_);
	_tmp14_ = xmpp_iq_stanza_new_set (_tmp11_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp14_, _tmp13_);
	_xmpp_jid_unref0 (_tmp13_);
	iq = _tmp14_;
	_tmp15_ = self->priv->_stream;
	_tmp16_ = xmpp_iq_module_IDENTITY;
	_tmp17_ = xmpp_xmpp_stream_get_module (_tmp15_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp16_);
	_tmp18_ = (XmppIqModule*) _tmp17_;
	_tmp19_ = self->priv->_stream;
	_tmp20_ = iq;
	xmpp_iq_module_send_iq (_tmp18_, _tmp19_, _tmp20_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp18_);
	_g_object_unref0 (iq);
	_xmpp_stanza_entry_unref0 (jingle_node);
}

void
xmpp_xep_jingle_session_send_transport_accept (XmppXepJingleSession* self,
                                               XmppXepJingleContent* content,
                                               XmppXepJingleTransportParameters* transport_params)
{
	XmppXepJingleSessionState _tmp0_;
	XmppStanzaNode* jingle_node = NULL;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppIqStanza* iq_response = NULL;
	XmppStanzaNode* _tmp11_;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_;
	XmppIqStanza* _tmp14_ = NULL;
	XmppXmppStream* _tmp15_;
	XmppModuleIdentity* _tmp16_;
	gpointer _tmp17_;
	XmppIqModule* _tmp18_;
	XmppXmppStream* _tmp19_;
	XmppIqStanza* _tmp20_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	g_return_if_fail (transport_params != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_ENDED) {
		return;
	}
	_tmp1_ = xmpp_xep_jingle_session_build_outer_session_node (self, "transport-accept");
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_xep_jingle_content_build_outer_content_node (content);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_xep_jingle_transport_parameters_to_transport_stanza_node (transport_params, "transport-accept");
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_stanza_node_put_node (_tmp4_, _tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = xmpp_stanza_node_put_node (_tmp2_, _tmp8_);
	_tmp10_ = _tmp9_;
	_xmpp_stanza_entry_unref0 (_tmp8_);
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp2_);
	jingle_node = _tmp10_;
	_tmp11_ = jingle_node;
	_tmp12_ = self->priv->_peer_full_jid;
	_tmp13_ = _xmpp_jid_ref0 (_tmp12_);
	_tmp14_ = xmpp_iq_stanza_new_set (_tmp11_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp14_, _tmp13_);
	_xmpp_jid_unref0 (_tmp13_);
	iq_response = _tmp14_;
	_tmp15_ = self->priv->_stream;
	_tmp16_ = xmpp_iq_module_IDENTITY;
	_tmp17_ = xmpp_xmpp_stream_get_module (_tmp15_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp16_);
	_tmp18_ = (XmppIqModule*) _tmp17_;
	_tmp19_ = self->priv->_stream;
	_tmp20_ = iq_response;
	xmpp_iq_module_send_iq (_tmp18_, _tmp19_, _tmp20_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp18_);
	_g_object_unref0 (iq_response);
	_xmpp_stanza_entry_unref0 (jingle_node);
}

void
xmpp_xep_jingle_session_send_transport_replace (XmppXepJingleSession* self,
                                                XmppXepJingleContent* content,
                                                XmppXepJingleTransportParameters* transport_params)
{
	XmppXepJingleSessionState _tmp0_;
	XmppStanzaNode* jingle_node = NULL;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppIqStanza* iq = NULL;
	XmppStanzaNode* _tmp11_;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_;
	XmppIqStanza* _tmp14_ = NULL;
	XmppXmppStream* _tmp15_;
	XmppModuleIdentity* _tmp16_;
	gpointer _tmp17_;
	XmppIqModule* _tmp18_;
	XmppXmppStream* _tmp19_;
	XmppIqStanza* _tmp20_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	g_return_if_fail (transport_params != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_ENDED) {
		return;
	}
	_tmp1_ = xmpp_xep_jingle_session_build_outer_session_node (self, "transport-replace");
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_xep_jingle_content_build_outer_content_node (content);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_xep_jingle_transport_parameters_to_transport_stanza_node (transport_params, "transport-replace");
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_stanza_node_put_node (_tmp4_, _tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = xmpp_stanza_node_put_node (_tmp2_, _tmp8_);
	_tmp10_ = _tmp9_;
	_xmpp_stanza_entry_unref0 (_tmp8_);
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp2_);
	jingle_node = _tmp10_;
	_tmp11_ = jingle_node;
	_tmp12_ = self->priv->_peer_full_jid;
	_tmp13_ = _xmpp_jid_ref0 (_tmp12_);
	_tmp14_ = xmpp_iq_stanza_new_set (_tmp11_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp14_, _tmp13_);
	_xmpp_jid_unref0 (_tmp13_);
	iq = _tmp14_;
	_tmp15_ = self->priv->_stream;
	_tmp16_ = xmpp_iq_module_IDENTITY;
	_tmp17_ = xmpp_xmpp_stream_get_module (_tmp15_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp16_);
	_tmp18_ = (XmppIqModule*) _tmp17_;
	_tmp19_ = self->priv->_stream;
	_tmp20_ = iq;
	xmpp_iq_module_send_iq (_tmp18_, _tmp19_, _tmp20_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp18_);
	_g_object_unref0 (iq);
	_xmpp_stanza_entry_unref0 (jingle_node);
}

void
xmpp_xep_jingle_session_send_transport_reject (XmppXepJingleSession* self,
                                               XmppXepJingleContent* content,
                                               XmppStanzaNode* transport_node)
{
	XmppXepJingleSessionState _tmp0_;
	XmppStanzaNode* jingle_node = NULL;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppIqStanza* iq_response = NULL;
	XmppStanzaNode* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	XmppIqStanza* _tmp12_ = NULL;
	XmppXmppStream* _tmp13_;
	XmppModuleIdentity* _tmp14_;
	gpointer _tmp15_;
	XmppIqModule* _tmp16_;
	XmppXmppStream* _tmp17_;
	XmppIqStanza* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	g_return_if_fail (transport_node != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_ENDED) {
		return;
	}
	_tmp1_ = xmpp_xep_jingle_session_build_outer_session_node (self, "transport-reject");
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_xep_jingle_content_build_outer_content_node (content);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_stanza_node_put_node (_tmp4_, transport_node);
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_stanza_node_put_node (_tmp2_, _tmp6_);
	_tmp8_ = _tmp7_;
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp2_);
	jingle_node = _tmp8_;
	_tmp9_ = jingle_node;
	_tmp10_ = self->priv->_peer_full_jid;
	_tmp11_ = _xmpp_jid_ref0 (_tmp10_);
	_tmp12_ = xmpp_iq_stanza_new_set (_tmp9_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp12_, _tmp11_);
	_xmpp_jid_unref0 (_tmp11_);
	iq_response = _tmp12_;
	_tmp13_ = self->priv->_stream;
	_tmp14_ = xmpp_iq_module_IDENTITY;
	_tmp15_ = xmpp_xmpp_stream_get_module (_tmp13_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp14_);
	_tmp16_ = (XmppIqModule*) _tmp15_;
	_tmp17_ = self->priv->_stream;
	_tmp18_ = iq_response;
	xmpp_iq_module_send_iq (_tmp16_, _tmp17_, _tmp18_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (iq_response);
	_xmpp_stanza_entry_unref0 (jingle_node);
}

void
xmpp_xep_jingle_session_send_transport_info (XmppXepJingleSession* self,
                                             XmppXepJingleContent* content,
                                             XmppStanzaNode* transport)
{
	XmppXepJingleSessionState _tmp0_;
	XmppStanzaNode* jingle_node = NULL;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppIqStanza* iq = NULL;
	XmppStanzaNode* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	XmppIqStanza* _tmp12_ = NULL;
	XmppXmppStream* _tmp13_;
	XmppModuleIdentity* _tmp14_;
	gpointer _tmp15_;
	XmppIqModule* _tmp16_;
	XmppXmppStream* _tmp17_;
	XmppIqStanza* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	g_return_if_fail (transport != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_SESSION_STATE_ENDED) {
		return;
	}
	_tmp1_ = xmpp_xep_jingle_session_build_outer_session_node (self, "transport-info");
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_xep_jingle_content_build_outer_content_node (content);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_stanza_node_put_node (_tmp4_, transport);
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_stanza_node_put_node (_tmp2_, _tmp6_);
	_tmp8_ = _tmp7_;
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp2_);
	jingle_node = _tmp8_;
	_tmp9_ = jingle_node;
	_tmp10_ = self->priv->_peer_full_jid;
	_tmp11_ = _xmpp_jid_ref0 (_tmp10_);
	_tmp12_ = xmpp_iq_stanza_new_set (_tmp9_, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _tmp12_, _tmp11_);
	_xmpp_jid_unref0 (_tmp11_);
	iq = _tmp12_;
	_tmp13_ = self->priv->_stream;
	_tmp14_ = xmpp_iq_module_IDENTITY;
	_tmp15_ = xmpp_xmpp_stream_get_module (_tmp13_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp14_);
	_tmp16_ = (XmppIqModule*) _tmp15_;
	_tmp17_ = self->priv->_stream;
	_tmp18_ = iq;
	xmpp_iq_module_send_iq (_tmp16_, _tmp17_, _tmp18_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (iq);
	_xmpp_stanza_entry_unref0 (jingle_node);
}

static XmppStanzaNode*
xmpp_xep_jingle_session_build_outer_session_node (XmppXepJingleSession* self,
                                                  const gchar* action)
{
	gchar* _tmp0_ = NULL;
	gboolean _tmp1_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* _tmp11_;
	XmppStanzaNode* _tmp12_;
	XmppStanzaNode* _tmp13_;
	const gchar* _tmp14_;
	XmppStanzaNode* _tmp15_;
	XmppStanzaNode* _tmp16_;
	XmppStanzaNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (action != NULL, NULL);
	_tmp1_ = self->priv->_we_initiated;
	if (_tmp1_) {
		XmppJid* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = self->priv->_local_full_jid;
		_tmp3_ = xmpp_jid_to_string (_tmp2_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp3_;
	} else {
		XmppJid* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = self->priv->_peer_full_jid;
		_tmp5_ = xmpp_jid_to_string (_tmp4_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
	}
	_tmp6_ = xmpp_stanza_node_new_build ("jingle", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = xmpp_stanza_node_add_self_xmlns (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = xmpp_stanza_node_put_attribute (_tmp9_, "action", action, NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = xmpp_stanza_node_put_attribute (_tmp11_, "initiator", _tmp0_, NULL);
	_tmp13_ = _tmp12_;
	_tmp14_ = self->priv->_sid;
	_tmp15_ = xmpp_stanza_node_put_attribute (_tmp13_, "sid", _tmp14_, NULL);
	_tmp16_ = _tmp15_;
	_xmpp_stanza_entry_unref0 (_tmp13_);
	_xmpp_stanza_entry_unref0 (_tmp11_);
	_xmpp_stanza_entry_unref0 (_tmp9_);
	_xmpp_stanza_entry_unref0 (_tmp7_);
	result = _tmp16_;
	_g_free0 (_tmp0_);
	return result;
}

gboolean
xmpp_xep_jingle_session_senders_include_us (XmppXepJingleSession* self,
                                            XmppXepJingleSenders senders)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	switch (senders) {
		case XMPP_XEP_JINGLE_SENDERS_BOTH:
		{
			result = TRUE;
			return result;
		}
		case XMPP_XEP_JINGLE_SENDERS_NONE:
		{
			result = FALSE;
			return result;
		}
		case XMPP_XEP_JINGLE_SENDERS_INITIATOR:
		{
			gboolean _tmp0_;
			_tmp0_ = self->priv->_we_initiated;
			result = _tmp0_;
			return result;
		}
		case XMPP_XEP_JINGLE_SENDERS_RESPONDER:
		{
			gboolean _tmp1_;
			_tmp1_ = self->priv->_we_initiated;
			result = !_tmp1_;
			return result;
		}
		default:
		break;
	}
	g_assert_not_reached ();
}

gboolean
xmpp_xep_jingle_session_senders_include_counterpart (XmppXepJingleSession* self,
                                                     XmppXepJingleSenders senders)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	switch (senders) {
		case XMPP_XEP_JINGLE_SENDERS_BOTH:
		{
			result = TRUE;
			return result;
		}
		case XMPP_XEP_JINGLE_SENDERS_NONE:
		{
			result = FALSE;
			return result;
		}
		case XMPP_XEP_JINGLE_SENDERS_INITIATOR:
		{
			gboolean _tmp0_;
			_tmp0_ = self->priv->_we_initiated;
			result = !_tmp0_;
			return result;
		}
		case XMPP_XEP_JINGLE_SENDERS_RESPONDER:
		{
			gboolean _tmp1_;
			_tmp1_ = self->priv->_we_initiated;
			result = _tmp1_;
			return result;
		}
		default:
		break;
	}
	g_assert_not_reached ();
}

XmppXepJingleSession*
xmpp_xep_jingle_session_construct (GType object_type)
{
	XmppXepJingleSession * self = NULL;
	self = (XmppXepJingleSession*) g_object_new (object_type, NULL);
	return self;
}

XmppXepJingleSession*
xmpp_xep_jingle_session_new (void)
{
	return xmpp_xep_jingle_session_construct (XMPP_XEP_JINGLE_TYPE_SESSION);
}

XmppXmppStream*
xmpp_xep_jingle_session_get_stream (XmppXepJingleSession* self)
{
	XmppXmppStream* result;
	XmppXmppStream* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_stream;
	result = _tmp0_;
	return result;
}

void
xmpp_xep_jingle_session_set_stream (XmppXepJingleSession* self,
                                    XmppXmppStream* value)
{
	XmppXmppStream* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_session_get_stream (self);
	if (old_value != value) {
		XmppXmppStream* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_stream);
		self->priv->_stream = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_STREAM_PROPERTY]);
	}
}

XmppXepJingleSessionState
xmpp_xep_jingle_session_get_state (XmppXepJingleSession* self)
{
	XmppXepJingleSessionState result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_state;
	return result;
}

void
xmpp_xep_jingle_session_set_state (XmppXepJingleSession* self,
                                   XmppXepJingleSessionState value)
{
	XmppXepJingleSessionState old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_session_get_state (self);
	if (old_value != value) {
		self->priv->_state = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_STATE_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_session_get_sid (XmppXepJingleSession* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sid;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_session_set_sid (XmppXepJingleSession* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_session_get_sid (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_sid);
		self->priv->_sid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_SID_PROPERTY]);
	}
}

XmppJid*
xmpp_xep_jingle_session_get_local_full_jid (XmppXepJingleSession* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_local_full_jid;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_session_set_local_full_jid (XmppXepJingleSession* self,
                                            XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_session_get_local_full_jid (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_local_full_jid);
		self->priv->_local_full_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_LOCAL_FULL_JID_PROPERTY]);
	}
}

XmppJid*
xmpp_xep_jingle_session_get_peer_full_jid (XmppXepJingleSession* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_peer_full_jid;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_session_set_peer_full_jid (XmppXepJingleSession* self,
                                           XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_session_get_peer_full_jid (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_peer_full_jid);
		self->priv->_peer_full_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_PEER_FULL_JID_PROPERTY]);
	}
}

gboolean
xmpp_xep_jingle_session_get_we_initiated (XmppXepJingleSession* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_we_initiated;
	return result;
}

static void
xmpp_xep_jingle_session_set_we_initiated (XmppXepJingleSession* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_session_get_we_initiated (self);
	if (old_value != value) {
		self->priv->_we_initiated = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_WE_INITIATED_PROPERTY]);
	}
}

XmppXepJingleSecurityParameters*
xmpp_xep_jingle_session_get_security (XmppXepJingleSession* self)
{
	XmppXepJingleSecurityParameters* result;
	GeeList* _tmp0_;
	gint _tmp1_ = 0;
	gpointer* _tmp2_;
	XmppXepJingleContent** _tmp3_;
	gint _tmp3__length1;
	XmppXepJingleContent* _tmp4_;
	XmppXepJingleSecurityParameters* _tmp5_;
	XmppXepJingleSecurityParameters* _tmp6_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->contents;
	_tmp2_ = gee_collection_to_array ((GeeCollection*) _tmp0_, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	_tmp4_ = _tmp3_[0];
	_tmp5_ = _tmp4_->security_params;
	_tmp6_ = _tmp5_;
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_object_unref), NULL);
	result = _tmp6_;
	return result;
}

XmppJid*
xmpp_xep_jingle_session_get_muji_room (XmppXepJingleSession* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_muji_room;
	result = _tmp0_;
	return result;
}

void
xmpp_xep_jingle_session_set_muji_room (XmppXepJingleSession* self,
                                       XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_session_get_muji_room (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_muji_room);
		self->priv->_muji_room = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_MUJI_ROOM_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN_STRING_STRING (GClosure * closure,
                                                            GValue * return_value,
                                                            guint n_param_values,
                                                            const GValue * param_values,
                                                            gpointer invocation_hint,
                                                            gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_BOOLEAN_STRING_STRING) (gpointer data1, gpointer arg_1, gboolean arg_2, const char* arg_3, const char* arg_4, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_BOOLEAN_STRING_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 5);
	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_BOOLEAN_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_boolean (param_values + 2), g_value_get_string (param_values + 3), g_value_get_string (param_values + 4), data2);
}

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_session_class_init (XmppXepJingleSessionClass * klass,
                                    gpointer klass_data)
{
	xmpp_xep_jingle_session_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleSession_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_session_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_session_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_session_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SESSION_STREAM_PROPERTY, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_STREAM_PROPERTY] = g_param_spec_object ("stream", "stream", "stream", XMPP_TYPE_XMPP_STREAM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SESSION_STATE_PROPERTY, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_STATE_PROPERTY] = g_param_spec_enum ("state", "state", "state", XMPP_XEP_JINGLE_SESSION_TYPE_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SESSION_SID_PROPERTY, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_SID_PROPERTY] = g_param_spec_string ("sid", "sid", "sid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SESSION_LOCAL_FULL_JID_PROPERTY, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_LOCAL_FULL_JID_PROPERTY] = xmpp_param_spec_jid ("local-full-jid", "local-full-jid", "local-full-jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SESSION_PEER_FULL_JID_PROPERTY, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_PEER_FULL_JID_PROPERTY] = xmpp_param_spec_jid ("peer-full-jid", "peer-full-jid", "peer-full-jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SESSION_WE_INITIATED_PROPERTY, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_WE_INITIATED_PROPERTY] = g_param_spec_boolean ("we-initiated", "we-initiated", "we-initiated", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SESSION_SECURITY_PROPERTY, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_SECURITY_PROPERTY] = g_param_spec_object ("security", "security", "security", XMPP_XEP_JINGLE_TYPE_SECURITY_PARAMETERS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SESSION_MUJI_ROOM_PROPERTY, xmpp_xep_jingle_session_properties[XMPP_XEP_JINGLE_SESSION_MUJI_ROOM_PROPERTY] = xmpp_param_spec_jid ("muji-room", "muji-room", "muji-room", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	xmpp_xep_jingle_session_signals[XMPP_XEP_JINGLE_SESSION_TERMINATED_SIGNAL] = g_signal_new ("terminated", XMPP_XEP_JINGLE_TYPE_SESSION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN_STRING_STRING, G_TYPE_NONE, 4, XMPP_TYPE_XMPP_STREAM, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING);
	xmpp_xep_jingle_session_signals[XMPP_XEP_JINGLE_SESSION_ADDITIONAL_CONTENT_ADD_INCOMING_SIGNAL] = g_signal_new ("additional-content-add-incoming", XMPP_XEP_JINGLE_TYPE_SESSION, 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_CONTENT);
}

static void
xmpp_xep_jingle_session_instance_init (XmppXepJingleSession * self,
                                       gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeArrayList* _tmp1_;
	self->priv = xmpp_xep_jingle_session_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, XMPP_XEP_JINGLE_TYPE_CONTENT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->contents_map = _tmp0_;
	_tmp1_ = gee_array_list_new (XMPP_XEP_JINGLE_TYPE_CONTENT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->contents = (GeeList*) _tmp1_;
}

static void
xmpp_xep_jingle_session_finalize (GObject * obj)
{
	XmppXepJingleSession * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_TYPE_SESSION, XmppXepJingleSession);
	_g_object_unref0 (self->priv->_stream);
	_g_free0 (self->priv->_sid);
	_xmpp_jid_unref0 (self->priv->_local_full_jid);
	_xmpp_jid_unref0 (self->priv->_peer_full_jid);
	_g_object_unref0 (self->contents_map);
	_g_object_unref0 (self->contents);
	_xmpp_jid_unref0 (self->priv->_muji_room);
	G_OBJECT_CLASS (xmpp_xep_jingle_session_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_session_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleSessionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_session_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleSession), 0, (GInstanceInitFunc) xmpp_xep_jingle_session_instance_init, NULL };
	GType xmpp_xep_jingle_session_type_id;
	xmpp_xep_jingle_session_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleSession", &g_define_type_info, 0);
	XmppXepJingleSession_private_offset = g_type_add_instance_private (xmpp_xep_jingle_session_type_id, sizeof (XmppXepJingleSessionPrivate));
	return xmpp_xep_jingle_session_type_id;
}

GType
xmpp_xep_jingle_session_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_session_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_session_type_id__once)) {
		GType xmpp_xep_jingle_session_type_id;
		xmpp_xep_jingle_session_type_id = xmpp_xep_jingle_session_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_session_type_id__once, xmpp_xep_jingle_session_type_id);
	}
	return xmpp_xep_jingle_session_type_id__once;
}

static void
_vala_xmpp_xep_jingle_session_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	XmppXepJingleSession * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_TYPE_SESSION, XmppXepJingleSession);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SESSION_STREAM_PROPERTY:
		g_value_set_object (value, xmpp_xep_jingle_session_get_stream (self));
		break;
		case XMPP_XEP_JINGLE_SESSION_STATE_PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_session_get_state (self));
		break;
		case XMPP_XEP_JINGLE_SESSION_SID_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_session_get_sid (self));
		break;
		case XMPP_XEP_JINGLE_SESSION_LOCAL_FULL_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_session_get_local_full_jid (self));
		break;
		case XMPP_XEP_JINGLE_SESSION_PEER_FULL_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_session_get_peer_full_jid (self));
		break;
		case XMPP_XEP_JINGLE_SESSION_WE_INITIATED_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_session_get_we_initiated (self));
		break;
		case XMPP_XEP_JINGLE_SESSION_SECURITY_PROPERTY:
		g_value_set_object (value, xmpp_xep_jingle_session_get_security (self));
		break;
		case XMPP_XEP_JINGLE_SESSION_MUJI_ROOM_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_session_get_muji_room (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_session_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	XmppXepJingleSession * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_TYPE_SESSION, XmppXepJingleSession);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SESSION_STREAM_PROPERTY:
		xmpp_xep_jingle_session_set_stream (self, g_value_get_object (value));
		break;
		case XMPP_XEP_JINGLE_SESSION_STATE_PROPERTY:
		xmpp_xep_jingle_session_set_state (self, g_value_get_enum (value));
		break;
		case XMPP_XEP_JINGLE_SESSION_SID_PROPERTY:
		xmpp_xep_jingle_session_set_sid (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_SESSION_LOCAL_FULL_JID_PROPERTY:
		xmpp_xep_jingle_session_set_local_full_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_XEP_JINGLE_SESSION_PEER_FULL_JID_PROPERTY:
		xmpp_xep_jingle_session_set_peer_full_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_XEP_JINGLE_SESSION_WE_INITIATED_PROPERTY:
		xmpp_xep_jingle_session_set_we_initiated (self, g_value_get_boolean (value));
		break;
		case XMPP_XEP_JINGLE_SESSION_MUJI_ROOM_PROPERTY:
		xmpp_xep_jingle_session_set_muji_room (self, xmpp_value_get_jid (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

