/* content.c generated by valac 0.56.19, the Vala compiler
 * generated from content.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_CONTENT_0_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_STATE_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_ROLE_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_LOCAL_FULL_JID_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_PEER_FULL_JID_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_CONTENT_CREATOR_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_CONTENT_NAME_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_SENDERS_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_NUM_PROPERTIES];
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_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;
typedef struct _XmppXepJingleContentNodePrivate XmppXepJingleContentNodePrivate;
typedef struct _XmppXepJingleContentSelectNewTransportData XmppXepJingleContentSelectNewTransportData;
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
enum  {
	XMPP_XEP_JINGLE_CONTENT_SENDERS_MODIFY_INCOMING_SIGNAL,
	XMPP_XEP_JINGLE_CONTENT_NUM_SIGNALS
};
static guint xmpp_xep_jingle_content_signals[XMPP_XEP_JINGLE_CONTENT_NUM_SIGNALS] = {0};
enum  {
	XMPP_XEP_JINGLE_CONTENT_ENCRYPTION_0_PROPERTY,
	XMPP_XEP_JINGLE_CONTENT_ENCRYPTION_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_content_encryption_properties[XMPP_XEP_JINGLE_CONTENT_ENCRYPTION_NUM_PROPERTIES];

struct _XmppXepJingleContentPrivate {
	XmppXepJingleContentState _state;
	XmppXepJingleRole _role;
	XmppJid* _local_full_jid;
	XmppJid* _peer_full_jid;
	XmppXepJingleRole _content_creator;
	gchar* _content_name;
	XmppXepJingleSenders _senders;
	GeeSet* tried_transport_methods;
};

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 _XmppXepJingleContentSelectNewTransportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleContent* self;
	XmppXmppStream* stream;
	XmppXepJingleSession* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	XmppXmppStream* _tmp3_;
	XmppXepJingleTransport* new_transport;
	XmppXmppStream* _tmp4_;
	XmppModuleIdentity* _tmp5_;
	gpointer _tmp6_;
	XmppXepJingleModule* _tmp7_;
	XmppXmppStream* _tmp8_;
	XmppXepJingleTransport* _tmp9_;
	XmppXepJingleTransportType _tmp10_;
	XmppXepJingleTransportType _tmp11_;
	XmppXepJingleTransportParameters* _tmp12_;
	guint8 _tmp13_;
	guint8 _tmp14_;
	XmppJid* _tmp15_;
	GeeSet* _tmp16_;
	XmppXepJingleTransport* _tmp17_;
	XmppXepJingleTransport* _tmp18_;
	XmppXepJingleTransport* _tmp19_;
	XmppXepJingleSession* _tmp20_;
	GeeSet* _tmp21_;
	XmppXepJingleTransport* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	XmppXepJingleTransportParameters* _tmp25_;
	XmppXepJingleTransport* _tmp26_;
	XmppXmppStream* _tmp27_;
	XmppXepJingleTransportParameters* _tmp28_;
	guint8 _tmp29_;
	guint8 _tmp30_;
	XmppJid* _tmp31_;
	XmppJid* _tmp32_;
	XmppXepJingleTransportParameters* _tmp33_;
	XmppXepJingleTransportParameters* _tmp34_;
	XmppXepJingleTransportParameters* _tmp35_;
	XmppXepJingleSession* _tmp36_;
	XmppXepJingleTransportParameters* _tmp37_;
	GError* _inner_error0_;
};

static gint XmppXepJingleContent_private_offset;
static gpointer xmpp_xep_jingle_content_parent_class = NULL;
static gpointer xmpp_xep_jingle_content_encryption_parent_class = NULL;

static void xmpp_xep_jingle_content_set_content_name (XmppXepJingleContent* self,
                                               const gchar* value);
static void xmpp_xep_jingle_content_set_senders (XmppXepJingleContent* self,
                                          XmppXepJingleSenders value);
static void xmpp_xep_jingle_content_set_role (XmppXepJingleContent* self,
                                       XmppXepJingleRole value);
static void xmpp_xep_jingle_content_set_local_full_jid (XmppXepJingleContent* self,
                                                 XmppJid* value);
static void xmpp_xep_jingle_content_set_peer_full_jid (XmppXepJingleContent* self,
                                                XmppJid* value);
static void xmpp_xep_jingle_content_set_content_creator (XmppXepJingleContent* self,
                                                  XmppXepJingleRole value);
VALA_EXTERN void xmpp_xep_jingle_session_accept_content (XmppXepJingleSession* self,
                                             XmppXepJingleContent* content);
VALA_EXTERN void xmpp_xep_jingle_session_reject_content (XmppXepJingleSession* self,
                                             XmppXepJingleContent* content);
VALA_EXTERN void xmpp_xep_jingle_session_send_content_modify (XmppXepJingleSession* self,
                                                  XmppXepJingleContent* content,
                                                  XmppXepJingleSenders senders);
VALA_EXTERN void xmpp_xep_jingle_content_handle_content_modify (XmppXepJingleContent* self,
                                                    XmppXmppStream* stream,
                                                    XmppXepJingleSenders proposed_senders);
VALA_EXTERN void xmpp_xep_jingle_content_on_accept (XmppXepJingleContent* self,
                                        XmppXmppStream* stream);
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 void xmpp_xep_jingle_content_handle_accept (XmppXepJingleContent* self,
                                            XmppXmppStream* stream,
                                            XmppXepJingleContentNode* content_node);
static void xmpp_xep_jingle_content_select_new_transport_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_content_select_new_transport_co (XmppXepJingleContentSelectNewTransportData* _data_);
static void xmpp_xep_jingle_content_select_new_transport_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void xmpp_xep_jingle_content_set_transport_params (XmppXepJingleContent* self,
                                                   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_accept (XmppXepJingleSession* self,
                                                    XmppXepJingleContent* content,
                                                    XmppXepJingleTransportParameters* transport_params);
VALA_EXTERN void xmpp_xep_jingle_session_send_transport_info (XmppXepJingleSession* self,
                                                  XmppXepJingleContent* content,
                                                  XmppStanzaNode* transport);
VALA_EXTERN XmppStanzaNode* xmpp_xep_jingle_content_build_outer_content_node (XmppXepJingleContent* self);
static void xmpp_xep_jingle_content_finalize (GObject * obj);
static GType xmpp_xep_jingle_content_get_type_once (void);
static void _vala_xmpp_xep_jingle_content_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_content_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
static guint8* _vala_array_dup8 (guint8* self,
                          gssize length);
static guint8* _vala_array_dup9 (guint8* self,
                          gssize length);
static void xmpp_xep_jingle_content_encryption_finalize (GObject * obj);
static GType xmpp_xep_jingle_content_encryption_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_xep_jingle_content_get_instance_private (XmppXepJingleContent* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleContent_private_offset);
}

static GType
xmpp_xep_jingle_content_state_get_type_once (void)
{
	static const GEnumValue values[] = {{XMPP_XEP_JINGLE_CONTENT_STATE_PENDING, "XMPP_XEP_JINGLE_CONTENT_STATE_PENDING", "pending"}, {XMPP_XEP_JINGLE_CONTENT_STATE_WANTS_TO_BE_ACCEPTED, "XMPP_XEP_JINGLE_CONTENT_STATE_WANTS_TO_BE_ACCEPTED", "wants-to-be-accepted"}, {XMPP_XEP_JINGLE_CONTENT_STATE_ACCEPTED, "XMPP_XEP_JINGLE_CONTENT_STATE_ACCEPTED", "accepted"}, {XMPP_XEP_JINGLE_CONTENT_STATE_REPLACING_TRANSPORT, "XMPP_XEP_JINGLE_CONTENT_STATE_REPLACING_TRANSPORT", "replacing-transport"}, {XMPP_XEP_JINGLE_CONTENT_STATE_WAITING_FOR_TRANSPORT_REPLACE, "XMPP_XEP_JINGLE_CONTENT_STATE_WAITING_FOR_TRANSPORT_REPLACE", "waiting-for-transport-replace"}, {0, NULL, NULL}};
	GType xmpp_xep_jingle_content_state_type_id;
	xmpp_xep_jingle_content_state_type_id = g_enum_register_static ("XmppXepJingleContentState", values);
	return xmpp_xep_jingle_content_state_type_id;
}

GType
xmpp_xep_jingle_content_state_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_content_state_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_content_state_type_id__once)) {
		GType xmpp_xep_jingle_content_state_type_id;
		xmpp_xep_jingle_content_state_type_id = xmpp_xep_jingle_content_state_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_content_state_type_id__once, xmpp_xep_jingle_content_state_type_id);
	}
	return xmpp_xep_jingle_content_state_type_id__once;
}

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

XmppXepJingleContent*
xmpp_xep_jingle_content_construct_initiate_sent (GType object_type,
                                                 const gchar* content_name,
                                                 XmppXepJingleSenders senders,
                                                 XmppXepJingleContentType* content_type,
                                                 XmppXepJingleContentParameters* content_params,
                                                 XmppXepJingleTransport* transport,
                                                 XmppXepJingleTransportParameters* transport_params,
                                                 XmppXepJingleSecurityPrecondition* security_precondition,
                                                 XmppXepJingleSecurityParameters* security_params,
                                                 XmppJid* local_full_jid,
                                                 XmppJid* peer_full_jid)
{
	XmppXepJingleContent * self = NULL;
	XmppXepJingleContentType* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleTransport* _tmp2_;
	XmppXepJingleTransportParameters* _tmp3_;
	XmppXepJingleSecurityPrecondition* _tmp4_;
	XmppXepJingleSecurityParameters* _tmp5_;
	GeeSet* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	g_return_val_if_fail (content_name != NULL, NULL);
	g_return_val_if_fail (content_type != NULL, NULL);
	g_return_val_if_fail (content_params != NULL, NULL);
	g_return_val_if_fail (transport != NULL, NULL);
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	self = (XmppXepJingleContent*) g_object_new (object_type, NULL);
	xmpp_xep_jingle_content_set_content_name (self, content_name);
	xmpp_xep_jingle_content_set_senders (self, senders);
	xmpp_xep_jingle_content_set_role (self, XMPP_XEP_JINGLE_ROLE_INITIATOR);
	xmpp_xep_jingle_content_set_local_full_jid (self, local_full_jid);
	xmpp_xep_jingle_content_set_peer_full_jid (self, peer_full_jid);
	xmpp_xep_jingle_content_set_content_creator (self, XMPP_XEP_JINGLE_ROLE_INITIATOR);
	_tmp0_ = _g_object_ref0 (content_type);
	_g_object_unref0 (self->content_type);
	self->content_type = _tmp0_;
	_tmp1_ = _g_object_ref0 (content_params);
	_g_object_unref0 (self->content_params);
	self->content_params = _tmp1_;
	_tmp2_ = _g_object_ref0 (transport);
	_g_object_unref0 (self->transport);
	self->transport = _tmp2_;
	_tmp3_ = _g_object_ref0 (transport_params);
	_g_object_unref0 (self->transport_params);
	self->transport_params = _tmp3_;
	_tmp4_ = _g_object_ref0 (security_precondition);
	_g_object_unref0 (self->security_precondition);
	self->security_precondition = _tmp4_;
	_tmp5_ = _g_object_ref0 (security_params);
	_g_object_unref0 (self->security_params);
	self->security_params = _tmp5_;
	_tmp6_ = self->priv->tried_transport_methods;
	_tmp7_ = xmpp_xep_jingle_transport_get_ns_uri (transport);
	_tmp8_ = _tmp7_;
	gee_collection_add ((GeeCollection*) _tmp6_, _tmp8_);
	xmpp_xep_jingle_content_set_state (self, XMPP_XEP_JINGLE_CONTENT_STATE_PENDING);
	return self;
}

XmppXepJingleContent*
xmpp_xep_jingle_content_new_initiate_sent (const gchar* content_name,
                                           XmppXepJingleSenders senders,
                                           XmppXepJingleContentType* content_type,
                                           XmppXepJingleContentParameters* content_params,
                                           XmppXepJingleTransport* transport,
                                           XmppXepJingleTransportParameters* transport_params,
                                           XmppXepJingleSecurityPrecondition* security_precondition,
                                           XmppXepJingleSecurityParameters* security_params,
                                           XmppJid* local_full_jid,
                                           XmppJid* peer_full_jid)
{
	return xmpp_xep_jingle_content_construct_initiate_sent (XMPP_XEP_JINGLE_TYPE_CONTENT, content_name, senders, content_type, content_params, transport, transport_params, security_precondition, security_params, local_full_jid, peer_full_jid);
}

XmppXepJingleContent*
xmpp_xep_jingle_content_construct_initiate_received (GType object_type,
                                                     const gchar* content_name,
                                                     XmppXepJingleSenders senders,
                                                     XmppXepJingleContentType* content_type,
                                                     XmppXepJingleContentParameters* content_params,
                                                     XmppXepJingleTransport* transport,
                                                     XmppXepJingleTransportParameters* transport_params,
                                                     XmppXepJingleSecurityPrecondition* security_precondition,
                                                     XmppXepJingleSecurityParameters* security_params,
                                                     XmppJid* local_full_jid,
                                                     XmppJid* peer_full_jid,
                                                     GError** error)
{
	XmppXepJingleContent * self = NULL;
	XmppXepJingleContentType* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleTransport* _tmp2_;
	XmppXepJingleTransportParameters* _tmp3_;
	XmppXepJingleSecurityPrecondition* _tmp4_;
	XmppXepJingleSecurityParameters* _tmp5_;
	g_return_val_if_fail (content_name != NULL, NULL);
	g_return_val_if_fail (content_type != NULL, NULL);
	g_return_val_if_fail (content_params != NULL, NULL);
	g_return_val_if_fail (transport != NULL, NULL);
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	self = (XmppXepJingleContent*) g_object_new (object_type, NULL);
	xmpp_xep_jingle_content_set_content_name (self, content_name);
	xmpp_xep_jingle_content_set_senders (self, senders);
	xmpp_xep_jingle_content_set_role (self, XMPP_XEP_JINGLE_ROLE_RESPONDER);
	xmpp_xep_jingle_content_set_local_full_jid (self, local_full_jid);
	xmpp_xep_jingle_content_set_peer_full_jid (self, peer_full_jid);
	xmpp_xep_jingle_content_set_content_creator (self, XMPP_XEP_JINGLE_ROLE_INITIATOR);
	_tmp0_ = _g_object_ref0 (content_type);
	_g_object_unref0 (self->content_type);
	self->content_type = _tmp0_;
	_tmp1_ = _g_object_ref0 (content_params);
	_g_object_unref0 (self->content_params);
	self->content_params = _tmp1_;
	_tmp2_ = _g_object_ref0 (transport);
	_g_object_unref0 (self->transport);
	self->transport = _tmp2_;
	_tmp3_ = _g_object_ref0 (transport_params);
	_g_object_unref0 (self->transport_params);
	self->transport_params = _tmp3_;
	_tmp4_ = _g_object_ref0 (security_precondition);
	_g_object_unref0 (self->security_precondition);
	self->security_precondition = _tmp4_;
	_tmp5_ = _g_object_ref0 (security_params);
	_g_object_unref0 (self->security_params);
	self->security_params = _tmp5_;
	if (transport != NULL) {
		GeeSet* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp6_ = self->priv->tried_transport_methods;
		_tmp7_ = xmpp_xep_jingle_transport_get_ns_uri (transport);
		_tmp8_ = _tmp7_;
		gee_collection_add ((GeeCollection*) _tmp6_, _tmp8_);
	}
	xmpp_xep_jingle_content_set_state (self, XMPP_XEP_JINGLE_CONTENT_STATE_PENDING);
	return self;
}

XmppXepJingleContent*
xmpp_xep_jingle_content_new_initiate_received (const gchar* content_name,
                                               XmppXepJingleSenders senders,
                                               XmppXepJingleContentType* content_type,
                                               XmppXepJingleContentParameters* content_params,
                                               XmppXepJingleTransport* transport,
                                               XmppXepJingleTransportParameters* transport_params,
                                               XmppXepJingleSecurityPrecondition* security_precondition,
                                               XmppXepJingleSecurityParameters* security_params,
                                               XmppJid* local_full_jid,
                                               XmppJid* peer_full_jid,
                                               GError** error)
{
	return xmpp_xep_jingle_content_construct_initiate_received (XMPP_XEP_JINGLE_TYPE_CONTENT, content_name, senders, content_type, content_params, transport, transport_params, security_precondition, security_params, local_full_jid, peer_full_jid, error);
}

void
xmpp_xep_jingle_content_set_session (XmppXepJingleContent* self,
                                     XmppXepJingleSession* session)
{
	XmppXepJingleTransportParameters* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (session != NULL);
	self->session = session;
	_tmp0_ = self->transport_params;
	xmpp_xep_jingle_transport_parameters_set_content (_tmp0_, self);
}

void
xmpp_xep_jingle_content_accept (XmppXepJingleContent* self)
{
	XmppXepJingleContentState _tmp0_;
	XmppXepJingleSession* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ != XMPP_XEP_JINGLE_CONTENT_STATE_PENDING) {
		g_warning ("content.vala:99: accepting a non-pending content");
		return;
	}
	xmpp_xep_jingle_content_set_state (self, XMPP_XEP_JINGLE_CONTENT_STATE_WANTS_TO_BE_ACCEPTED);
	_tmp1_ = self->session;
	xmpp_xep_jingle_session_accept_content (_tmp1_, self);
}

void
xmpp_xep_jingle_content_reject (XmppXepJingleContent* self)
{
	XmppXepJingleContentState _tmp0_;
	XmppXepJingleSession* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ != XMPP_XEP_JINGLE_CONTENT_STATE_PENDING) {
		g_warning ("content.vala:108: rejecting a non-pending content");
		return;
	}
	_tmp1_ = self->session;
	xmpp_xep_jingle_session_reject_content (_tmp1_, self);
}

void
xmpp_xep_jingle_content_terminate (XmppXepJingleContent* self,
                                   gboolean we_terminated,
                                   const gchar* reason_name,
                                   const gchar* reason_text)
{
	XmppXepJingleContentState _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleTransportParameters* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == XMPP_XEP_JINGLE_CONTENT_STATE_PENDING) {
		g_warning ("content.vala:116: terminating a pending call");
		return;
	}
	_tmp1_ = self->content_params;
	xmpp_xep_jingle_content_parameters_terminate (_tmp1_, we_terminated, reason_name, reason_text);
	_tmp2_ = self->transport_params;
	g_object_run_dispose ((GObject*) _tmp2_);
	{
		GeeIterator* _connection_it = NULL;
		GeeMap* _tmp3_;
		GeeCollection* _tmp4_;
		GeeCollection* _tmp5_;
		GeeCollection* _tmp6_;
		GeeIterator* _tmp7_;
		GeeIterator* _tmp8_;
		_tmp3_ = self->component_connections;
		_tmp4_ = gee_map_get_values (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_);
		_tmp8_ = _tmp7_;
		_g_object_unref0 (_tmp6_);
		_connection_it = _tmp8_;
		while (TRUE) {
			GeeIterator* _tmp9_;
			XmppXepJingleComponentConnection* connection = NULL;
			GeeIterator* _tmp10_;
			gpointer _tmp11_;
			XmppXepJingleComponentConnection* _tmp12_;
			_tmp9_ = _connection_it;
			if (!gee_iterator_next (_tmp9_)) {
				break;
			}
			_tmp10_ = _connection_it;
			_tmp11_ = gee_iterator_get (_tmp10_);
			connection = (XmppXepJingleComponentConnection*) _tmp11_;
			_tmp12_ = connection;
			xmpp_xep_jingle_component_connection_terminate (_tmp12_, we_terminated, reason_name, reason_text, NULL, NULL);
			_g_object_unref0 (connection);
		}
		_g_object_unref0 (_connection_it);
	}
}

void
xmpp_xep_jingle_content_modify (XmppXepJingleContent* self,
                                XmppXepJingleSenders new_sender)
{
	XmppXepJingleSession* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->session;
	xmpp_xep_jingle_session_send_content_modify (_tmp0_, self, new_sender);
	xmpp_xep_jingle_content_set_senders (self, new_sender);
}

void
xmpp_xep_jingle_content_accept_content_modify (XmppXepJingleContent* self,
                                               XmppXepJingleSenders senders)
{
	g_return_if_fail (self != NULL);
	xmpp_xep_jingle_content_set_senders (self, senders);
}

void
xmpp_xep_jingle_content_handle_content_modify (XmppXepJingleContent* self,
                                               XmppXmppStream* stream,
                                               XmppXepJingleSenders proposed_senders)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_signal_emit (self, xmpp_xep_jingle_content_signals[XMPP_XEP_JINGLE_CONTENT_SENDERS_MODIFY_INCOMING_SIGNAL], 0, proposed_senders);
}

void
xmpp_xep_jingle_content_on_accept (XmppXepJingleContent* self,
                                   XmppXmppStream* stream)
{
	XmppXepJingleTransportParameters* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleSession* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	_tmp0_ = self->transport_params;
	xmpp_xep_jingle_transport_parameters_create_transport_connection (_tmp0_, stream, self);
	_tmp1_ = self->content_params;
	_tmp2_ = self->session;
	xmpp_xep_jingle_content_parameters_accept (_tmp1_, stream, _tmp2_, self);
}

void
xmpp_xep_jingle_content_handle_accept (XmppXepJingleContent* self,
                                       XmppXmppStream* stream,
                                       XmppXepJingleContentNode* content_node)
{
	XmppXepJingleTransportParameters* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppXepJingleTransportParameters* _tmp2_;
	XmppXepJingleContentParameters* _tmp3_;
	XmppXepJingleSession* _tmp4_;
	XmppStanzaNode* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (content_node != NULL);
	_tmp0_ = self->transport_params;
	_tmp1_ = content_node->transport;
	xmpp_xep_jingle_transport_parameters_handle_transport_accept (_tmp0_, _tmp1_, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
	_tmp2_ = self->transport_params;
	xmpp_xep_jingle_transport_parameters_create_transport_connection (_tmp2_, stream, self);
	_tmp3_ = self->content_params;
	_tmp4_ = self->session;
	_tmp5_ = content_node->description;
	xmpp_xep_jingle_content_parameters_handle_accept (_tmp3_, stream, _tmp4_, self, _tmp5_);
}

static void
xmpp_xep_jingle_content_select_new_transport_data_free (gpointer _data)
{
	XmppXepJingleContentSelectNewTransportData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleContentSelectNewTransportData, _data_);
}

void
xmpp_xep_jingle_content_select_new_transport (XmppXepJingleContent* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	XmppXepJingleContentSelectNewTransportData* _data_;
	XmppXepJingleContent* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppXepJingleContentSelectNewTransportData);
	_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_content_select_new_transport_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_xep_jingle_content_select_new_transport_co (_data_);
}

void
xmpp_xep_jingle_content_select_new_transport_finish (XmppXepJingleContent* self,
                                                     GAsyncResult* _res_)
{
	XmppXepJingleContentSelectNewTransportData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_jingle_content_select_new_transport_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	XmppXepJingleContentSelectNewTransportData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_content_select_new_transport_co (_data_);
}

static gboolean
xmpp_xep_jingle_content_select_new_transport_co (XmppXepJingleContentSelectNewTransportData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->session;
	_data_->_tmp1_ = xmpp_xep_jingle_session_get_stream (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->stream = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->stream;
	_data_->_tmp5_ = xmpp_xep_jingle_module_IDENTITY;
	_data_->_tmp6_ = xmpp_xmpp_stream_get_module (_data_->_tmp4_, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp5_);
	_data_->_tmp7_ = (XmppXepJingleModule*) _data_->_tmp6_;
	_data_->_tmp8_ = _data_->stream;
	_data_->_tmp9_ = _data_->self->transport;
	_data_->_tmp10_ = xmpp_xep_jingle_transport_get_type_ (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = _data_->self->transport_params;
	_data_->_tmp13_ = xmpp_xep_jingle_transport_parameters_get_components (_data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	_data_->_tmp15_ = _data_->self->priv->_peer_full_jid;
	_data_->_tmp16_ = _data_->self->priv->tried_transport_methods;
	_data_->_state_ = 1;
	xmpp_xep_jingle_module_select_transport (_data_->_tmp7_, _data_->_tmp8_, _data_->_tmp11_, _data_->_tmp14_, _data_->_tmp15_, _data_->_tmp16_, xmpp_xep_jingle_content_select_new_transport_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp17_ = xmpp_xep_jingle_module_select_transport_finish (_data_->_tmp7_, _data_->_res_);
	_data_->_tmp18_ = _data_->_tmp17_;
	_g_object_unref0 (_data_->_tmp7_);
	_data_->new_transport = _data_->_tmp18_;
	_data_->_tmp19_ = _data_->new_transport;
	if (_data_->_tmp19_ == NULL) {
		_data_->_tmp20_ = _data_->self->session;
		xmpp_xep_jingle_session_terminate (_data_->_tmp20_, XMPP_XEP_JINGLE_REASON_ELEMENT_FAILED_TRANSPORT, NULL, "failed transport");
		_g_object_unref0 (_data_->new_transport);
		_g_object_unref0 (_data_->stream);
		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_->_tmp21_ = _data_->self->priv->tried_transport_methods;
	_data_->_tmp22_ = _data_->new_transport;
	_data_->_tmp23_ = xmpp_xep_jingle_transport_get_ns_uri (_data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	gee_collection_add ((GeeCollection*) _data_->_tmp21_, _data_->_tmp24_);
	_data_->_tmp26_ = _data_->new_transport;
	_data_->_tmp27_ = _data_->stream;
	_data_->_tmp28_ = _data_->self->transport_params;
	_data_->_tmp29_ = xmpp_xep_jingle_transport_parameters_get_components (_data_->_tmp28_);
	_data_->_tmp30_ = _data_->_tmp29_;
	_data_->_tmp31_ = _data_->self->priv->_local_full_jid;
	_data_->_tmp32_ = _data_->self->priv->_peer_full_jid;
	_data_->_tmp33_ = xmpp_xep_jingle_transport_create_transport_parameters (_data_->_tmp26_, _data_->_tmp27_, _data_->_tmp30_, _data_->_tmp31_, _data_->_tmp32_, &_data_->_inner_error0_);
	_data_->_tmp25_ = _data_->_tmp33_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->new_transport);
		_g_object_unref0 (_data_->stream);
		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_->_tmp34_ = _data_->_tmp25_;
	_data_->_tmp25_ = NULL;
	_g_object_unref0 (_data_->self->transport_params);
	_data_->self->transport_params = _data_->_tmp34_;
	_data_->_tmp35_ = _data_->self->transport_params;
	xmpp_xep_jingle_content_set_transport_params (_data_->self, _data_->_tmp35_);
	_data_->_tmp36_ = _data_->self->session;
	_data_->_tmp37_ = _data_->self->transport_params;
	xmpp_xep_jingle_session_send_transport_replace (_data_->_tmp36_, _data_->self, _data_->_tmp37_);
	xmpp_xep_jingle_content_set_state (_data_->self, XMPP_XEP_JINGLE_CONTENT_STATE_REPLACING_TRANSPORT);
	_g_object_unref0 (_data_->_tmp25_);
	_g_object_unref0 (_data_->new_transport);
	_g_object_unref0 (_data_->stream);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
xmpp_xep_jingle_content_handle_transport_accept (XmppXepJingleContent* self,
                                                 XmppXmppStream* stream,
                                                 XmppStanzaNode* transport_node,
                                                 XmppStanzaNode* jingle,
                                                 XmppIqStanza* iq,
                                                 GError** error)
{
	XmppXepJingleContentState _tmp0_;
	const gchar* _tmp2_;
	XmppXepJingleTransport* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	XmppXepJingleTransportParameters* _tmp7_;
	XmppModuleIdentity* _tmp8_;
	gpointer _tmp9_;
	XmppIqModule* _tmp10_;
	XmppIqStanza* _tmp11_;
	XmppIqStanza* _tmp12_;
	XmppXepJingleTransportParameters* _tmp13_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (transport_node != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ != XMPP_XEP_JINGLE_CONTENT_STATE_REPLACING_TRANSPORT) {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_OUT_OF_ORDER, "no outstanding transport-replace request");
		_inner_error0_ = _tmp1_;
		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;
		}
	}
	_tmp2_ = ((XmppStanzaEntry*) transport_node)->ns_uri;
	_tmp3_ = self->transport;
	_tmp4_ = xmpp_xep_jingle_transport_get_ns_uri (_tmp3_);
	_tmp5_ = _tmp4_;
	if (g_strcmp0 (_tmp2_, _tmp5_) != 0) {
		GError* _tmp6_;
		_tmp6_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "transport-accept with unnegotiated transport method");
		_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->transport_params;
	xmpp_xep_jingle_transport_parameters_handle_transport_accept (_tmp7_, transport_node, &_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;
		}
	}
	_tmp8_ = xmpp_iq_module_IDENTITY;
	_tmp9_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp8_);
	_tmp10_ = (XmppIqModule*) _tmp9_;
	_tmp11_ = xmpp_iq_stanza_new_result (iq, NULL);
	_tmp12_ = _tmp11_;
	xmpp_iq_module_send_iq (_tmp10_, stream, _tmp12_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (_tmp10_);
	_tmp13_ = self->transport_params;
	xmpp_xep_jingle_transport_parameters_create_transport_connection (_tmp13_, stream, self);
}

void
xmpp_xep_jingle_content_handle_transport_reject (XmppXepJingleContent* self,
                                                 XmppXmppStream* stream,
                                                 XmppStanzaNode* jingle,
                                                 XmppIqStanza* iq,
                                                 GError** error)
{
	XmppXepJingleContentState _tmp0_;
	XmppModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	XmppIqModule* _tmp4_;
	XmppIqStanza* _tmp5_;
	XmppIqStanza* _tmp6_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = self->priv->_state;
	if (_tmp0_ != XMPP_XEP_JINGLE_CONTENT_STATE_REPLACING_TRANSPORT) {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_OUT_OF_ORDER, "no outstanding transport-replace request");
		_inner_error0_ = _tmp1_;
		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;
		}
	}
	_tmp2_ = xmpp_iq_module_IDENTITY;
	_tmp3_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (XmppIqModule*) _tmp3_;
	_tmp5_ = xmpp_iq_stanza_new_result (iq, NULL);
	_tmp6_ = _tmp5_;
	xmpp_iq_module_send_iq (_tmp4_, stream, _tmp6_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp6_);
	_g_object_unref0 (_tmp4_);
	xmpp_xep_jingle_content_select_new_transport (self, NULL, NULL);
}

void
xmpp_xep_jingle_content_handle_transport_replace (XmppXepJingleContent* self,
                                                  XmppXmppStream* stream,
                                                  XmppStanzaNode* transport_node,
                                                  XmppStanzaNode* jingle,
                                                  XmppIqStanza* iq,
                                                  GError** error)
{
	XmppXepJingleTransport* transport = NULL;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleModule* _tmp2_;
	const gchar* _tmp3_;
	XmppXepJingleTransport* _tmp4_;
	XmppXepJingleTransport* _tmp5_;
	XmppXepJingleTransportParameters* parameters = NULL;
	XmppXepJingleTransport* _tmp6_;
	XmppModuleIdentity* _tmp16_;
	gpointer _tmp17_;
	XmppIqModule* _tmp18_;
	XmppIqStanza* _tmp19_;
	XmppIqStanza* _tmp20_;
	gboolean _tmp21_ = FALSE;
	XmppXepJingleContentState _tmp22_;
	XmppXepJingleTransportParameters* _tmp25_;
	XmppXepJingleSession* _tmp26_;
	XmppXepJingleTransportParameters* _tmp27_;
	XmppXepJingleTransportParameters* _tmp28_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (transport_node != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = xmpp_xep_jingle_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepJingleModule*) _tmp1_;
	_tmp3_ = ((XmppStanzaEntry*) transport_node)->ns_uri;
	_tmp4_ = xmpp_xep_jingle_module_get_transport (_tmp2_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	transport = _tmp5_;
	parameters = NULL;
	_tmp6_ = transport;
	if (_tmp6_ != NULL) {
		XmppXepJingleTransportParameters* _tmp7_ = NULL;
		XmppXepJingleTransport* _tmp8_;
		XmppXepJingleContentType* _tmp9_;
		guint8 _tmp10_;
		guint8 _tmp11_;
		XmppJid* _tmp12_;
		XmppJid* _tmp13_;
		XmppXepJingleTransportParameters* _tmp14_;
		XmppXepJingleTransportParameters* _tmp15_;
		_tmp8_ = transport;
		_tmp9_ = self->content_type;
		_tmp10_ = xmpp_xep_jingle_content_type_get_required_components (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = self->priv->_local_full_jid;
		_tmp13_ = self->priv->_peer_full_jid;
		_tmp14_ = xmpp_xep_jingle_transport_parse_transport_parameters (_tmp8_, stream, _tmp11_, _tmp12_, _tmp13_, transport_node, &_inner_error0_);
		_tmp7_ = _tmp14_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_object_unref0 (parameters);
				_g_object_unref0 (transport);
				return;
			} else {
				_g_object_unref0 (parameters);
				_g_object_unref0 (transport);
				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;
			}
		}
		_tmp15_ = _tmp7_;
		_tmp7_ = NULL;
		_g_object_unref0 (parameters);
		parameters = _tmp15_;
		_g_object_unref0 (_tmp7_);
	}
	_tmp16_ = xmpp_iq_module_IDENTITY;
	_tmp17_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp16_);
	_tmp18_ = (XmppIqModule*) _tmp17_;
	_tmp19_ = xmpp_iq_stanza_new_result (iq, NULL);
	_tmp20_ = _tmp19_;
	xmpp_iq_module_send_iq (_tmp18_, stream, _tmp20_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp20_);
	_g_object_unref0 (_tmp18_);
	_tmp22_ = self->priv->_state;
	if (_tmp22_ != XMPP_XEP_JINGLE_CONTENT_STATE_WAITING_FOR_TRANSPORT_REPLACE) {
		_tmp21_ = TRUE;
	} else {
		XmppXepJingleTransport* _tmp23_;
		_tmp23_ = transport;
		_tmp21_ = _tmp23_ == NULL;
	}
	if (_tmp21_) {
		XmppXepJingleSession* _tmp24_;
		_tmp24_ = self->session;
		xmpp_xep_jingle_session_send_transport_reject (_tmp24_, self, transport_node);
		_g_object_unref0 (parameters);
		_g_object_unref0 (transport);
		return;
	}
	_tmp25_ = parameters;
	xmpp_xep_jingle_content_set_transport_params (self, _tmp25_);
	_tmp26_ = self->session;
	_tmp27_ = parameters;
	xmpp_xep_jingle_session_send_transport_accept (_tmp26_, self, _tmp27_);
	_tmp28_ = self->transport_params;
	xmpp_xep_jingle_transport_parameters_create_transport_connection (_tmp28_, stream, self);
	_g_object_unref0 (parameters);
	_g_object_unref0 (transport);
}

void
xmpp_xep_jingle_content_handle_transport_info (XmppXepJingleContent* self,
                                               XmppXmppStream* stream,
                                               XmppStanzaNode* transport,
                                               XmppStanzaNode* jingle,
                                               XmppIqStanza* iq,
                                               GError** error)
{
	XmppXepJingleTransportParameters* _tmp0_;
	XmppModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	XmppIqModule* _tmp3_;
	XmppIqStanza* _tmp4_;
	XmppIqStanza* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (transport != NULL);
	g_return_if_fail (jingle != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = self->transport_params;
	xmpp_xep_jingle_transport_parameters_handle_transport_info (_tmp0_, transport, &_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;
		}
	}
	_tmp1_ = xmpp_iq_module_IDENTITY;
	_tmp2_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (XmppIqModule*) _tmp2_;
	_tmp4_ = xmpp_iq_stanza_new_result (iq, NULL);
	_tmp5_ = _tmp4_;
	xmpp_iq_module_send_iq (_tmp3_, stream, _tmp5_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
}

void
xmpp_xep_jingle_content_on_description_info (XmppXepJingleContent* self,
                                             XmppXmppStream* stream,
                                             XmppStanzaNode* description,
                                             XmppStanzaNode* jinglq,
                                             XmppIqStanza* iq,
                                             GError** error)
{
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppIqModule* _tmp2_;
	XmppIqStanza* _tmp3_;
	XmppIqStanza* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (description != NULL);
	g_return_if_fail (jinglq != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = xmpp_iq_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppIqModule*) _tmp1_;
	_tmp3_ = xmpp_iq_stanza_new_result (iq, NULL);
	_tmp4_ = _tmp3_;
	xmpp_iq_module_send_iq (_tmp2_, stream, _tmp4_, NULL, NULL, NULL, G_PRIORITY_DEFAULT);
	_g_object_unref0 (_tmp4_);
	_g_object_unref0 (_tmp2_);
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

void
xmpp_xep_jingle_content_set_transport_connection (XmppXepJingleContent* self,
                                                  XmppXepJingleComponentConnection* conn,
                                                  guint8 component)
{
	const gchar* _tmp0_;
	XmppXepJingleContentState _tmp1_;
	GEnumValue* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GeeMap* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_content_name;
	_tmp1_ = self->priv->_state;
	_tmp2_ = g_enum_get_value (g_type_class_ref (XMPP_XEP_JINGLE_CONTENT_TYPE_STATE), _tmp1_);
	_tmp3_ = bool_to_string (conn != NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->component_connections;
	_tmp6_ = bool_to_string (gee_map_has_key (_tmp5_, (gpointer) ((guintptr) component)));
	_tmp7_ = _tmp6_;
	g_debug ("content.vala:215: set_transport_connection: %s, %s, %i, %s, overwrites" \
": %s", _tmp0_, (_tmp2_ != NULL) ? _tmp2_->value_name : NULL, component, _tmp4_, _tmp7_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp4_);
	if (conn != NULL) {
		GeeMap* _tmp8_;
		XmppXepJingleTransportParameters* _tmp9_;
		guint8 _tmp10_;
		guint8 _tmp11_;
		_tmp8_ = self->component_connections;
		gee_map_set (_tmp8_, (gpointer) ((guintptr) component), conn);
		_tmp9_ = self->transport_params;
		_tmp10_ = xmpp_xep_jingle_transport_parameters_get_components (_tmp9_);
		_tmp11_ = _tmp10_;
		if (_tmp11_ == component) {
			GeeSet* _tmp12_;
			xmpp_xep_jingle_content_set_state (self, XMPP_XEP_JINGLE_CONTENT_STATE_ACCEPTED);
			_tmp12_ = self->priv->tried_transport_methods;
			gee_collection_clear ((GeeCollection*) _tmp12_);
		}
	} else {
		XmppXepJingleRole _tmp13_;
		_tmp13_ = self->priv->_role;
		if (_tmp13_ == XMPP_XEP_JINGLE_ROLE_INITIATOR) {
			xmpp_xep_jingle_content_select_new_transport (self, NULL, NULL);
		} else {
			xmpp_xep_jingle_content_set_state (self, XMPP_XEP_JINGLE_CONTENT_STATE_WAITING_FOR_TRANSPORT_REPLACE);
		}
	}
}

static void
xmpp_xep_jingle_content_set_transport_params (XmppXepJingleContent* self,
                                              XmppXepJingleTransportParameters* transport_params)
{
	XmppXepJingleTransportParameters* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (transport_params != NULL);
	_tmp0_ = _g_object_ref0 (transport_params);
	_g_object_unref0 (self->transport_params);
	self->transport_params = _tmp0_;
}

XmppXepJingleComponentConnection*
xmpp_xep_jingle_content_get_transport_connection (XmppXepJingleContent* self,
                                                  guint8 component)
{
	GeeMap* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleComponentConnection* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->component_connections;
	_tmp1_ = gee_map_get (_tmp0_, (gpointer) ((guintptr) component));
	result = (XmppXepJingleComponentConnection*) _tmp1_;
	return result;
}

void
xmpp_xep_jingle_content_send_transport_info (XmppXepJingleContent* self,
                                             XmppStanzaNode* transport)
{
	XmppXepJingleSession* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (transport != NULL);
	_tmp0_ = self->session;
	xmpp_xep_jingle_session_send_transport_info (_tmp0_, self, transport);
}

XmppStanzaNode*
xmpp_xep_jingle_content_build_outer_content_node (XmppXepJingleContent* self)
{
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppXepJingleRole _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	const gchar* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("content", XMPP_XEP_JINGLE_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_content_creator;
	_tmp3_ = xmpp_xep_jingle_role_to_string (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_stanza_node_put_attribute (_tmp1_, "creator", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->_content_name;
	_tmp8_ = xmpp_stanza_node_put_attribute (_tmp6_, "name", _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_g_free0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	result = _tmp9_;
	return result;
}

XmppXepJingleContent*
xmpp_xep_jingle_content_construct (GType object_type)
{
	XmppXepJingleContent * self = NULL;
	self = (XmppXepJingleContent*) g_object_new (object_type, NULL);
	return self;
}

XmppXepJingleContent*
xmpp_xep_jingle_content_new (void)
{
	return xmpp_xep_jingle_content_construct (XMPP_XEP_JINGLE_TYPE_CONTENT);
}

XmppXepJingleContentState
xmpp_xep_jingle_content_get_state (XmppXepJingleContent* self)
{
	XmppXepJingleContentState result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_state;
	return result;
}

void
xmpp_xep_jingle_content_set_state (XmppXepJingleContent* self,
                                   XmppXepJingleContentState value)
{
	XmppXepJingleContentState old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_content_get_state (self);
	if (old_value != value) {
		self->priv->_state = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_STATE_PROPERTY]);
	}
}

XmppXepJingleRole
xmpp_xep_jingle_content_get_role (XmppXepJingleContent* self)
{
	XmppXepJingleRole result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_role;
	return result;
}

static void
xmpp_xep_jingle_content_set_role (XmppXepJingleContent* self,
                                  XmppXepJingleRole value)
{
	XmppXepJingleRole old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_content_get_role (self);
	if (old_value != value) {
		self->priv->_role = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_ROLE_PROPERTY]);
	}
}

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

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

static void
xmpp_xep_jingle_content_set_local_full_jid (XmppXepJingleContent* self,
                                            XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_content_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_content_properties[XMPP_XEP_JINGLE_CONTENT_LOCAL_FULL_JID_PROPERTY]);
	}
}

XmppJid*
xmpp_xep_jingle_content_get_peer_full_jid (XmppXepJingleContent* 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_content_set_peer_full_jid (XmppXepJingleContent* self,
                                           XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_content_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_content_properties[XMPP_XEP_JINGLE_CONTENT_PEER_FULL_JID_PROPERTY]);
	}
}

XmppXepJingleRole
xmpp_xep_jingle_content_get_content_creator (XmppXepJingleContent* self)
{
	XmppXepJingleRole result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_content_creator;
	return result;
}

static void
xmpp_xep_jingle_content_set_content_creator (XmppXepJingleContent* self,
                                             XmppXepJingleRole value)
{
	XmppXepJingleRole old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_content_get_content_creator (self);
	if (old_value != value) {
		self->priv->_content_creator = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_CONTENT_CREATOR_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_content_get_content_name (XmppXepJingleContent* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content_name;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_content_set_content_name (XmppXepJingleContent* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_content_get_content_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_content_name);
		self->priv->_content_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_CONTENT_NAME_PROPERTY]);
	}
}

XmppXepJingleSenders
xmpp_xep_jingle_content_get_senders (XmppXepJingleContent* self)
{
	XmppXepJingleSenders result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_senders;
	return result;
}

static void
xmpp_xep_jingle_content_set_senders (XmppXepJingleContent* self,
                                     XmppXepJingleSenders value)
{
	XmppXepJingleSenders old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_content_get_senders (self);
	if (old_value != value) {
		self->priv->_senders = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_SENDERS_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_content_class_init (XmppXepJingleContentClass * klass,
                                    gpointer klass_data)
{
	xmpp_xep_jingle_content_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleContent_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_content_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_content_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_content_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_CONTENT_STATE_PROPERTY, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_STATE_PROPERTY] = g_param_spec_enum ("state", "state", "state", XMPP_XEP_JINGLE_CONTENT_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_CONTENT_ROLE_PROPERTY, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_ROLE_PROPERTY] = g_param_spec_enum ("role", "role", "role", XMPP_XEP_JINGLE_TYPE_ROLE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_CONTENT_LOCAL_FULL_JID_PROPERTY, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_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_CONTENT_PEER_FULL_JID_PROPERTY, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_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_CONTENT_CONTENT_CREATOR_PROPERTY, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_CONTENT_CREATOR_PROPERTY] = g_param_spec_enum ("content-creator", "content-creator", "content-creator", XMPP_XEP_JINGLE_TYPE_ROLE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_CONTENT_CONTENT_NAME_PROPERTY, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_CONTENT_NAME_PROPERTY] = g_param_spec_string ("content-name", "content-name", "content-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_CONTENT_SENDERS_PROPERTY, xmpp_xep_jingle_content_properties[XMPP_XEP_JINGLE_CONTENT_SENDERS_PROPERTY] = g_param_spec_enum ("senders", "senders", "senders", XMPP_XEP_JINGLE_TYPE_SENDERS, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	xmpp_xep_jingle_content_signals[XMPP_XEP_JINGLE_CONTENT_SENDERS_MODIFY_INCOMING_SIGNAL] = g_signal_new ("senders-modify-incoming", XMPP_XEP_JINGLE_TYPE_CONTENT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, XMPP_XEP_JINGLE_TYPE_SENDERS);
}

static void
xmpp_xep_jingle_content_instance_init (XmppXepJingleContent * self,
                                       gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashSet* _tmp2_;
	self->priv = xmpp_xep_jingle_content_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_UCHAR, NULL, NULL, XMPP_XEP_JINGLE_TYPE_COMPONENT_CONNECTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->component_connections = (GeeMap*) _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, XMPP_XEP_JINGLE_TYPE_CONTENT_ENCRYPTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->encryptions = _tmp1_;
	_tmp2_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->tried_transport_methods = (GeeSet*) _tmp2_;
}

static void
xmpp_xep_jingle_content_finalize (GObject * obj)
{
	XmppXepJingleContent * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_TYPE_CONTENT, XmppXepJingleContent);
	_xmpp_jid_unref0 (self->priv->_local_full_jid);
	_xmpp_jid_unref0 (self->priv->_peer_full_jid);
	_g_free0 (self->priv->_content_name);
	_g_object_unref0 (self->content_type);
	_g_object_unref0 (self->content_params);
	_g_object_unref0 (self->transport);
	_g_object_unref0 (self->transport_params);
	_g_object_unref0 (self->security_precondition);
	_g_object_unref0 (self->security_params);
	_g_object_unref0 (self->component_connections);
	_g_object_unref0 (self->encryptions);
	_g_object_unref0 (self->priv->tried_transport_methods);
	G_OBJECT_CLASS (xmpp_xep_jingle_content_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_content_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleContentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_content_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleContent), 0, (GInstanceInitFunc) xmpp_xep_jingle_content_instance_init, NULL };
	GType xmpp_xep_jingle_content_type_id;
	xmpp_xep_jingle_content_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleContent", &g_define_type_info, 0);
	XmppXepJingleContent_private_offset = g_type_add_instance_private (xmpp_xep_jingle_content_type_id, sizeof (XmppXepJingleContentPrivate));
	return xmpp_xep_jingle_content_type_id;
}

GType
xmpp_xep_jingle_content_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_content_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_content_type_id__once)) {
		GType xmpp_xep_jingle_content_type_id;
		xmpp_xep_jingle_content_type_id = xmpp_xep_jingle_content_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_content_type_id__once, xmpp_xep_jingle_content_type_id);
	}
	return xmpp_xep_jingle_content_type_id__once;
}

static void
_vala_xmpp_xep_jingle_content_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	XmppXepJingleContent * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_TYPE_CONTENT, XmppXepJingleContent);
	switch (property_id) {
		case XMPP_XEP_JINGLE_CONTENT_STATE_PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_content_get_state (self));
		break;
		case XMPP_XEP_JINGLE_CONTENT_ROLE_PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_content_get_role (self));
		break;
		case XMPP_XEP_JINGLE_CONTENT_LOCAL_FULL_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_content_get_local_full_jid (self));
		break;
		case XMPP_XEP_JINGLE_CONTENT_PEER_FULL_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_content_get_peer_full_jid (self));
		break;
		case XMPP_XEP_JINGLE_CONTENT_CONTENT_CREATOR_PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_content_get_content_creator (self));
		break;
		case XMPP_XEP_JINGLE_CONTENT_CONTENT_NAME_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_content_get_content_name (self));
		break;
		case XMPP_XEP_JINGLE_CONTENT_SENDERS_PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_content_get_senders (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_content_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	XmppXepJingleContent * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_TYPE_CONTENT, XmppXepJingleContent);
	switch (property_id) {
		case XMPP_XEP_JINGLE_CONTENT_STATE_PROPERTY:
		xmpp_xep_jingle_content_set_state (self, g_value_get_enum (value));
		break;
		case XMPP_XEP_JINGLE_CONTENT_ROLE_PROPERTY:
		xmpp_xep_jingle_content_set_role (self, g_value_get_enum (value));
		break;
		case XMPP_XEP_JINGLE_CONTENT_LOCAL_FULL_JID_PROPERTY:
		xmpp_xep_jingle_content_set_local_full_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_XEP_JINGLE_CONTENT_PEER_FULL_JID_PROPERTY:
		xmpp_xep_jingle_content_set_peer_full_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_XEP_JINGLE_CONTENT_CONTENT_CREATOR_PROPERTY:
		xmpp_xep_jingle_content_set_content_creator (self, g_value_get_enum (value));
		break;
		case XMPP_XEP_JINGLE_CONTENT_CONTENT_NAME_PROPERTY:
		xmpp_xep_jingle_content_set_content_name (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_CONTENT_SENDERS_PROPERTY:
		xmpp_xep_jingle_content_set_senders (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static guint8*
_vala_array_dup8 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

static guint8*
_vala_array_dup9 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

XmppXepJingleContentEncryption*
xmpp_xep_jingle_content_encryption_construct (GType object_type,
                                              const gchar* encryption_ns,
                                              const gchar* encryption_name,
                                              guint8* our_key,
                                              gint our_key_length1,
                                              guint8* peer_key,
                                              gint peer_key_length1)
{
	XmppXepJingleContentEncryption * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	guint8* _tmp3_;
	gint _tmp3__length1;
	g_return_val_if_fail (encryption_ns != NULL, NULL);
	g_return_val_if_fail (encryption_name != NULL, NULL);
	self = (XmppXepJingleContentEncryption*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (encryption_ns);
	_g_free0 (self->encryption_ns);
	self->encryption_ns = _tmp0_;
	_tmp1_ = g_strdup (encryption_name);
	_g_free0 (self->encryption_name);
	self->encryption_name = _tmp1_;
	_tmp2_ = (our_key != NULL) ? _vala_array_dup8 (our_key, our_key_length1) : our_key;
	_tmp2__length1 = our_key_length1;
	self->our_key = (g_free (self->our_key), NULL);
	self->our_key = _tmp2_;
	self->our_key_length1 = _tmp2__length1;
	_tmp3_ = (peer_key != NULL) ? _vala_array_dup9 (peer_key, peer_key_length1) : peer_key;
	_tmp3__length1 = peer_key_length1;
	self->peer_key = (g_free (self->peer_key), NULL);
	self->peer_key = _tmp3_;
	self->peer_key_length1 = _tmp3__length1;
	return self;
}

XmppXepJingleContentEncryption*
xmpp_xep_jingle_content_encryption_new (const gchar* encryption_ns,
                                        const gchar* encryption_name,
                                        guint8* our_key,
                                        gint our_key_length1,
                                        guint8* peer_key,
                                        gint peer_key_length1)
{
	return xmpp_xep_jingle_content_encryption_construct (XMPP_XEP_JINGLE_TYPE_CONTENT_ENCRYPTION, encryption_ns, encryption_name, our_key, our_key_length1, peer_key, peer_key_length1);
}

static void
xmpp_xep_jingle_content_encryption_class_init (XmppXepJingleContentEncryptionClass * klass,
                                               gpointer klass_data)
{
	xmpp_xep_jingle_content_encryption_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_content_encryption_finalize;
}

static void
xmpp_xep_jingle_content_encryption_instance_init (XmppXepJingleContentEncryption * self,
                                                  gpointer klass)
{
}

static void
xmpp_xep_jingle_content_encryption_finalize (GObject * obj)
{
	XmppXepJingleContentEncryption * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_TYPE_CONTENT_ENCRYPTION, XmppXepJingleContentEncryption);
	_g_free0 (self->encryption_ns);
	_g_free0 (self->encryption_name);
	self->our_key = (g_free (self->our_key), NULL);
	self->peer_key = (g_free (self->peer_key), NULL);
	G_OBJECT_CLASS (xmpp_xep_jingle_content_encryption_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_content_encryption_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleContentEncryptionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_content_encryption_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleContentEncryption), 0, (GInstanceInitFunc) xmpp_xep_jingle_content_encryption_instance_init, NULL };
	GType xmpp_xep_jingle_content_encryption_type_id;
	xmpp_xep_jingle_content_encryption_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleContentEncryption", &g_define_type_info, 0);
	return xmpp_xep_jingle_content_encryption_type_id;
}

GType
xmpp_xep_jingle_content_encryption_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_content_encryption_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_content_encryption_type_id__once)) {
		GType xmpp_xep_jingle_content_encryption_type_id;
		xmpp_xep_jingle_content_encryption_type_id = xmpp_xep_jingle_content_encryption_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_content_encryption_type_id__once, xmpp_xep_jingle_content_encryption_type_id);
	}
	return xmpp_xep_jingle_content_encryption_type_id__once;
}

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

