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

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

#define XMPP_XEP_COIN_NS_RFC "urn:ietf:params:xml:ns:conference-info"
#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_COIN_MODULE_0_PROPERTY,
	XMPP_XEP_COIN_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_coin_module_properties[XMPP_XEP_COIN_MODULE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#define _xmpp_xep_coin_conference_info_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_coin_conference_info_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
typedef struct _XmppXepCoinModuleOnIqSetData XmppXepCoinModuleOnIqSetData;
enum  {
	XMPP_XEP_COIN_MODULE_COIN_INFO_RECEIVED_SIGNAL,
	XMPP_XEP_COIN_MODULE_NUM_SIGNALS
};
static guint xmpp_xep_coin_module_signals[XMPP_XEP_COIN_MODULE_NUM_SIGNALS] = {0};
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_xep_coin_conference_media_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_coin_conference_media_unref (var), NULL)))
#define _xmpp_xep_coin_conference_user_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_coin_conference_user_unref (var), NULL)))
typedef struct _XmppXepCoinParamSpecConferenceInfo XmppXepCoinParamSpecConferenceInfo;
typedef struct _XmppXepCoinParamSpecConferenceUser XmppXepCoinParamSpecConferenceUser;
typedef struct _XmppXepCoinParamSpecConferenceMedia XmppXepCoinParamSpecConferenceMedia;

struct _XmppXepCoinModuleOnIqSetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepCoinModule* self;
	XmppXmppStream* stream;
	XmppIqStanza* iq;
	XmppXepCoinConferenceInfo* info;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppXepCoinConferenceInfo* _tmp3_;
	XmppXepCoinConferenceInfo* _tmp4_;
	XmppXepCoinConferenceInfo* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	XmppJid* _tmp8_;
	XmppXepCoinConferenceInfo* _tmp9_;
};

struct _XmppXepCoinParamSpecConferenceInfo {
	GParamSpec parent_instance;
};

struct _XmppXepCoinParamSpecConferenceUser {
	GParamSpec parent_instance;
};

struct _XmppXepCoinParamSpecConferenceMedia {
	GParamSpec parent_instance;
};

static gpointer xmpp_xep_coin_module_parent_class = NULL;
XmppModuleIdentity* xmpp_xep_coin_module_IDENTITY = NULL;
static XmppIqHandlerIface * xmpp_xep_coin_module_xmpp_iq_handler_parent_iface = NULL;
static gpointer xmpp_xep_coin_conference_info_parent_class = NULL;
static gpointer xmpp_xep_coin_conference_user_parent_class = NULL;
static gpointer xmpp_xep_coin_conference_media_parent_class = NULL;

static void xmpp_xep_coin_module_real_on_iq_set_data_free (gpointer _data);
static void xmpp_xep_coin_module_real_on_iq_set (XmppIqHandler* base,
                                          XmppXmppStream* stream,
                                          XmppIqStanza* iq,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static gboolean xmpp_xep_coin_module_real_on_iq_set_co (XmppXepCoinModuleOnIqSetData* _data_);
static void xmpp_xep_coin_module_real_attach (XmppXmppStreamModule* base,
                                       XmppXmppStream* stream);
static void xmpp_xep_coin_module_real_detach (XmppXmppStreamModule* base,
                                       XmppXmppStream* stream);
static gchar* xmpp_xep_coin_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_xep_coin_module_real_get_id (XmppXmppStreamModule* base);
static void g_cclosure_user_marshal_VOID__XMPP_JID_XMPP_XEP_COIN_CONFERENCE_INFO (GClosure * closure,
                                                                           GValue * return_value,
                                                                           guint n_param_values,
                                                                           const GValue * param_values,
                                                                           gpointer invocation_hint,
                                                                           gpointer marshal_data);
static void xmpp_xep_coin_module_finalize (GObject * obj);
static GType xmpp_xep_coin_module_get_type_once (void);
static guint _xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                              gpointer self);
static gboolean _xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                                    gconstpointer b,
                                                    gpointer self);
static void xmpp_xep_coin_conference_info_finalize (XmppXepCoinConferenceInfo * obj);
static GType xmpp_xep_coin_conference_info_get_type_once (void);
static void xmpp_xep_coin_conference_user_finalize (XmppXepCoinConferenceUser * obj);
static GType xmpp_xep_coin_conference_user_get_type_once (void);
static void xmpp_xep_coin_conference_media_finalize (XmppXepCoinConferenceMedia * obj);
static GType xmpp_xep_coin_conference_media_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

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

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

static void
xmpp_xep_coin_module_real_on_iq_set (XmppIqHandler* base,
                                     XmppXmppStream* stream,
                                     XmppIqStanza* iq,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	XmppXepCoinModule * self;
	XmppXepCoinModuleOnIqSetData* _data_;
	XmppXepCoinModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppIqStanza* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (iq != NULL);
	self = (XmppXepCoinModule*) base;
	_data_ = g_slice_new0 (XmppXepCoinModuleOnIqSetData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_coin_module_real_on_iq_set_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _g_object_ref0 (iq);
	_g_object_unref0 (_data_->iq);
	_data_->iq = _tmp2_;
	xmpp_xep_coin_module_real_on_iq_set_co (_data_);
}

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

static gboolean
xmpp_xep_coin_module_real_on_iq_set_co (XmppXepCoinModuleOnIqSetData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = ((XmppStanza*) _data_->iq)->stanza;
	_data_->_tmp1_ = xmpp_stanza_node_get_subnode (_data_->_tmp0_, "conference-info", XMPP_XEP_COIN_NS_RFC, FALSE);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = xmpp_xep_coin_parse_node (_data_->_tmp2_, NULL);
	_data_->_tmp4_ = _data_->_tmp3_;
	_xmpp_stanza_entry_unref0 (_data_->_tmp2_);
	_data_->info = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->info;
	if (_data_->_tmp5_ == NULL) {
		_xmpp_xep_coin_conference_info_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_->_tmp6_ = xmpp_stanza_get_from ((XmppStanza*) _data_->iq);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->info;
	g_signal_emit (_data_->self, xmpp_xep_coin_module_signals[XMPP_XEP_COIN_MODULE_COIN_INFO_RECEIVED_SIGNAL], 0, _data_->_tmp8_, _data_->_tmp9_);
	_xmpp_jid_unref0 (_data_->_tmp8_);
	_xmpp_xep_coin_conference_info_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_coin_module_real_attach (XmppXmppStreamModule* base,
                                  XmppXmppStream* stream)
{
	XmppXepCoinModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppIqModule* _tmp2_;
	self = (XmppXepCoinModule*) base;
	g_return_if_fail (stream != 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_;
	xmpp_iq_module_register_for_namespace (_tmp2_, XMPP_XEP_COIN_NS_RFC, (XmppIqHandler*) self);
	_g_object_unref0 (_tmp2_);
}

static void
xmpp_xep_coin_module_real_detach (XmppXmppStreamModule* base,
                                  XmppXmppStream* stream)
{
	XmppXepCoinModule * self;
	self = (XmppXepCoinModule*) base;
	g_return_if_fail (stream != NULL);
}

static gchar*
xmpp_xep_coin_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppXepCoinModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppXepCoinModule*) base;
	_tmp0_ = g_strdup (XMPP_XEP_COIN_NS_RFC);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_xep_coin_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppXepCoinModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppXepCoinModule*) base;
	_tmp0_ = xmpp_xep_coin_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

XmppXepCoinModule*
xmpp_xep_coin_module_construct (GType object_type)
{
	XmppXepCoinModule * self = NULL;
	self = (XmppXepCoinModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppXepCoinModule*
xmpp_xep_coin_module_new (void)
{
	return xmpp_xep_coin_module_construct (XMPP_XEP_COIN_TYPE_MODULE);
}

static void
g_cclosure_user_marshal_VOID__XMPP_JID_XMPP_XEP_COIN_CONFERENCE_INFO (GClosure * closure,
                                                                      GValue * return_value,
                                                                      guint n_param_values,
                                                                      const GValue * param_values,
                                                                      gpointer invocation_hint,
                                                                      gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__XMPP_JID_XMPP_XEP_COIN_CONFERENCE_INFO) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__XMPP_JID_XMPP_XEP_COIN_CONFERENCE_INFO 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__XMPP_JID_XMPP_XEP_COIN_CONFERENCE_INFO) (marshal_data ? marshal_data : cc->callback);
	callback (data1, xmpp_value_get_jid (param_values + 1), xmpp_xep_coin_value_get_conference_info (param_values + 2), data2);
}

static void
xmpp_xep_coin_module_class_init (XmppXepCoinModuleClass * klass,
                                 gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_xep_coin_module_parent_class = g_type_class_peek_parent (klass);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_coin_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_coin_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_coin_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_coin_module_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_coin_module_finalize;
	xmpp_xep_coin_module_signals[XMPP_XEP_COIN_MODULE_COIN_INFO_RECEIVED_SIGNAL] = g_signal_new ("coin-info-received", XMPP_XEP_COIN_TYPE_MODULE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__XMPP_JID_XMPP_XEP_COIN_CONFERENCE_INFO, G_TYPE_NONE, 2, XMPP_TYPE_JID, XMPP_XEP_COIN_TYPE_CONFERENCE_INFO);
	_tmp0_ = xmpp_module_identity_new (XMPP_XEP_COIN_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_XEP_COIN_NS_RFC, "0298_coin");
	xmpp_xep_coin_module_IDENTITY = _tmp0_;
}

static void
xmpp_xep_coin_module_xmpp_iq_handler_interface_init (XmppIqHandlerIface * iface,
                                                     gpointer iface_data)
{
	xmpp_xep_coin_module_xmpp_iq_handler_parent_iface = g_type_interface_peek_parent (iface);
	iface->on_iq_set = (void (*) (XmppIqHandler*, XmppXmppStream*, XmppIqStanza*, GAsyncReadyCallback, gpointer)) xmpp_xep_coin_module_real_on_iq_set;
	iface->on_iq_set_finish = (void (*) (XmppIqHandler*, GAsyncResult*)) xmpp_xep_coin_module_on_iq_set_finish;
}

static void
xmpp_xep_coin_module_instance_init (XmppXepCoinModule * self,
                                    gpointer klass)
{
}

static void
xmpp_xep_coin_module_finalize (GObject * obj)
{
	XmppXepCoinModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_COIN_TYPE_MODULE, XmppXepCoinModule);
	G_OBJECT_CLASS (xmpp_xep_coin_module_parent_class)->finalize (obj);
}

static GType
xmpp_xep_coin_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepCoinModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_coin_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepCoinModule), 0, (GInstanceInitFunc) xmpp_xep_coin_module_instance_init, NULL };
	static const GInterfaceInfo xmpp_iq_handler_info = { (GInterfaceInitFunc) xmpp_xep_coin_module_xmpp_iq_handler_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_coin_module_type_id;
	xmpp_xep_coin_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppXepCoinModule", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_coin_module_type_id, XMPP_IQ_TYPE_HANDLER, &xmpp_iq_handler_info);
	return xmpp_xep_coin_module_type_id;
}

GType
xmpp_xep_coin_module_get_type (void)
{
	static volatile gsize xmpp_xep_coin_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_coin_module_type_id__once)) {
		GType xmpp_xep_coin_module_type_id;
		xmpp_xep_coin_module_type_id = xmpp_xep_coin_module_get_type_once ();
		g_once_init_leave (&xmpp_xep_coin_module_type_id__once, xmpp_xep_coin_module_type_id);
	}
	return xmpp_xep_coin_module_type_id__once;
}

static gpointer
_xmpp_xep_coin_conference_info_ref0 (gpointer self)
{
	return self ? xmpp_xep_coin_conference_info_ref (self) : NULL;
}

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

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

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

XmppXepCoinConferenceInfo*
xmpp_xep_coin_parse_node (XmppStanzaNode* conference_node,
                          XmppXepCoinConferenceInfo* previous_conference_info)
{
	gchar* version_str = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* conference_state = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_ = FALSE;
	const gchar* _tmp5_;
	gint version = 0;
	const gchar* _tmp7_;
	gboolean _tmp8_ = FALSE;
	XmppXepCoinConferenceInfo* _tmp9_ = NULL;
	XmppXepCoinConferenceInfo* _tmp10_;
	XmppXepCoinConferenceInfo* conference_info = NULL;
	XmppXepCoinConferenceInfo* _tmp12_;
	XmppXepCoinConferenceInfo* _tmp13_;
	GeeList* user_nodes = NULL;
	GeeList* _tmp14_;
	GError* _inner_error0_ = NULL;
	XmppXepCoinConferenceInfo* result;
	g_return_val_if_fail (conference_node != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_get_attribute (conference_node, "version", NULL);
	_tmp1_ = g_strdup (_tmp0_);
	version_str = _tmp1_;
	_tmp2_ = xmpp_stanza_node_get_attribute (conference_node, "state", NULL);
	_tmp3_ = g_strdup (_tmp2_);
	conference_state = _tmp3_;
	_tmp5_ = version_str;
	if (_tmp5_ == NULL) {
		_tmp4_ = TRUE;
	} else {
		const gchar* _tmp6_;
		_tmp6_ = conference_state;
		_tmp4_ = _tmp6_ == NULL;
	}
	if (_tmp4_) {
		result = NULL;
		_g_free0 (conference_state);
		_g_free0 (version_str);
		return result;
	}
	_tmp7_ = version_str;
	version = atoi (_tmp7_);
	if (previous_conference_info != NULL) {
		_tmp8_ = version <= previous_conference_info->version;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		result = NULL;
		_g_free0 (conference_state);
		_g_free0 (version_str);
		return result;
	}
	_tmp10_ = _xmpp_xep_coin_conference_info_ref0 (previous_conference_info);
	_tmp9_ = _tmp10_;
	if (_tmp9_ == NULL) {
		XmppXepCoinConferenceInfo* _tmp11_;
		_tmp11_ = xmpp_xep_coin_conference_info_new ();
		_xmpp_xep_coin_conference_info_unref0 (_tmp9_);
		_tmp9_ = _tmp11_;
	}
	_tmp12_ = _tmp9_;
	_tmp9_ = NULL;
	conference_info = _tmp12_;
	_tmp13_ = conference_info;
	_tmp13_->version = version;
	_tmp14_ = xmpp_stanza_node_get_deep_subnodes (conference_node, XMPP_XEP_COIN_NS_RFC ":users", XMPP_XEP_COIN_NS_RFC ":user", NULL);
	user_nodes = _tmp14_;
	{
		GeeList* _user_node_list = NULL;
		GeeList* _tmp15_;
		gint _user_node_size = 0;
		GeeList* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		gint _user_node_index = 0;
		_tmp15_ = user_nodes;
		_user_node_list = _tmp15_;
		_tmp16_ = _user_node_list;
		_tmp17_ = gee_collection_get_size ((GeeCollection*) _tmp16_);
		_tmp18_ = _tmp17_;
		_user_node_size = _tmp18_;
		_user_node_index = -1;
		while (TRUE) {
			gint _tmp19_;
			gint _tmp20_;
			XmppStanzaNode* user_node = NULL;
			GeeList* _tmp21_;
			gpointer _tmp22_;
			gchar* jid_string = NULL;
			XmppStanzaNode* _tmp23_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			const gchar* _tmp26_;
			XmppJid* jid = NULL;
			gchar* user_state = NULL;
			XmppStanzaNode* _tmp34_;
			const gchar* _tmp35_;
			gchar* _tmp36_;
			gboolean _tmp37_ = FALSE;
			const gchar* _tmp38_;
			const gchar* _tmp40_;
			XmppXepCoinConferenceUser* user = NULL;
			XmppXepCoinConferenceUser* _tmp44_;
			XmppXepCoinConferenceUser* _tmp45_;
			XmppJid* _tmp46_;
			XmppJid* _tmp47_;
			XmppXepCoinConferenceUser* _tmp48_;
			XmppStanzaNode* _tmp49_;
			const gchar* _tmp50_;
			gchar* _tmp51_;
			GeeList* endpoint_nodes = NULL;
			XmppStanzaNode* _tmp52_;
			GeeList* _tmp53_;
			_user_node_index = _user_node_index + 1;
			_tmp19_ = _user_node_index;
			_tmp20_ = _user_node_size;
			if (!(_tmp19_ < _tmp20_)) {
				break;
			}
			_tmp21_ = _user_node_list;
			_tmp22_ = gee_list_get (_tmp21_, _user_node_index);
			user_node = (XmppStanzaNode*) _tmp22_;
			_tmp23_ = user_node;
			_tmp24_ = xmpp_stanza_node_get_attribute (_tmp23_, "entity", NULL);
			_tmp25_ = g_strdup (_tmp24_);
			jid_string = _tmp25_;
			_tmp26_ = jid_string;
			if (_tmp26_ == NULL) {
				_g_free0 (jid_string);
				_xmpp_stanza_entry_unref0 (user_node);
				continue;
			}
			jid = NULL;
			{
				XmppJid* _tmp27_ = NULL;
				const gchar* _tmp28_;
				gchar* _tmp29_;
				gchar* _tmp30_;
				XmppJid* _tmp31_;
				XmppJid* _tmp32_;
				XmppJid* _tmp33_;
				_tmp28_ = jid_string;
				_tmp29_ = string_substring (_tmp28_, (glong) 4, (glong) -1);
				_tmp30_ = _tmp29_;
				_tmp31_ = xmpp_jid_new (_tmp30_, &_inner_error0_);
				_tmp32_ = _tmp31_;
				_g_free0 (_tmp30_);
				_tmp27_ = _tmp32_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp33_ = _tmp27_;
				_tmp27_ = NULL;
				_xmpp_jid_unref0 (jid);
				jid = _tmp33_;
				_xmpp_jid_unref0 (_tmp27_);
			}
			goto __finally0;
			__catch0_g_error:
			{
				g_clear_error (&_inner_error0_);
				_xmpp_jid_unref0 (jid);
				_g_free0 (jid_string);
				_xmpp_stanza_entry_unref0 (user_node);
				continue;
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_xmpp_jid_unref0 (jid);
				_g_free0 (jid_string);
				_xmpp_stanza_entry_unref0 (user_node);
				_g_object_unref0 (user_nodes);
				_xmpp_xep_coin_conference_info_unref0 (conference_info);
				_xmpp_xep_coin_conference_info_unref0 (_tmp9_);
				_g_free0 (conference_state);
				_g_free0 (version_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 NULL;
			}
			_tmp34_ = user_node;
			_tmp35_ = xmpp_stanza_node_get_attribute (_tmp34_, "state", NULL);
			_tmp36_ = g_strdup (_tmp35_);
			user_state = _tmp36_;
			_tmp38_ = conference_state;
			if (g_strcmp0 (_tmp38_, "full") == 0) {
				const gchar* _tmp39_;
				_tmp39_ = user_state;
				_tmp37_ = g_strcmp0 (_tmp39_, "full") != 0;
			} else {
				_tmp37_ = FALSE;
			}
			if (_tmp37_) {
				result = NULL;
				_g_free0 (user_state);
				_xmpp_jid_unref0 (jid);
				_g_free0 (jid_string);
				_xmpp_stanza_entry_unref0 (user_node);
				_g_object_unref0 (user_nodes);
				_xmpp_xep_coin_conference_info_unref0 (conference_info);
				_xmpp_xep_coin_conference_info_unref0 (_tmp9_);
				_g_free0 (conference_state);
				_g_free0 (version_str);
				return result;
			}
			_tmp40_ = user_state;
			if (g_strcmp0 (_tmp40_, "deleted") == 0) {
				XmppXepCoinConferenceInfo* _tmp41_;
				GeeHashMap* _tmp42_;
				XmppJid* _tmp43_;
				_tmp41_ = conference_info;
				_tmp42_ = _tmp41_->users;
				_tmp43_ = jid;
				gee_abstract_map_unset ((GeeAbstractMap*) _tmp42_, _tmp43_, NULL);
				_g_free0 (user_state);
				_xmpp_jid_unref0 (jid);
				_g_free0 (jid_string);
				_xmpp_stanza_entry_unref0 (user_node);
				continue;
			}
			_tmp44_ = xmpp_xep_coin_conference_user_new ();
			user = _tmp44_;
			_tmp45_ = user;
			_tmp46_ = jid;
			_tmp47_ = _xmpp_jid_ref0 (_tmp46_);
			_xmpp_jid_unref0 (_tmp45_->jid);
			_tmp45_->jid = _tmp47_;
			_tmp48_ = user;
			_tmp49_ = user_node;
			_tmp50_ = xmpp_stanza_node_get_deep_string_content (_tmp49_, XMPP_XEP_COIN_NS_RFC ":display-text", NULL);
			_tmp51_ = g_strdup (_tmp50_);
			_g_free0 (_tmp48_->display_text);
			_tmp48_->display_text = _tmp51_;
			_tmp52_ = user_node;
			_tmp53_ = xmpp_stanza_node_get_subnodes (_tmp52_, "endpoint", NULL, FALSE);
			endpoint_nodes = _tmp53_;
			{
				GeeList* _entpoint_node_list = NULL;
				GeeList* _tmp54_;
				gint _entpoint_node_size = 0;
				GeeList* _tmp55_;
				gint _tmp56_;
				gint _tmp57_;
				gint _entpoint_node_index = 0;
				_tmp54_ = endpoint_nodes;
				_entpoint_node_list = _tmp54_;
				_tmp55_ = _entpoint_node_list;
				_tmp56_ = gee_collection_get_size ((GeeCollection*) _tmp55_);
				_tmp57_ = _tmp56_;
				_entpoint_node_size = _tmp57_;
				_entpoint_node_index = -1;
				while (TRUE) {
					gint _tmp58_;
					gint _tmp59_;
					XmppStanzaNode* entpoint_node = NULL;
					GeeList* _tmp60_;
					gpointer _tmp61_;
					GeeList* media_nodes = NULL;
					XmppStanzaNode* _tmp62_;
					GeeList* _tmp63_;
					XmppXepCoinConferenceInfo* _tmp97_;
					GeeHashMap* _tmp98_;
					XmppXepCoinConferenceUser* _tmp99_;
					XmppJid* _tmp100_;
					XmppXepCoinConferenceUser* _tmp101_;
					_entpoint_node_index = _entpoint_node_index + 1;
					_tmp58_ = _entpoint_node_index;
					_tmp59_ = _entpoint_node_size;
					if (!(_tmp58_ < _tmp59_)) {
						break;
					}
					_tmp60_ = _entpoint_node_list;
					_tmp61_ = gee_list_get (_tmp60_, _entpoint_node_index);
					entpoint_node = (XmppStanzaNode*) _tmp61_;
					_tmp62_ = entpoint_node;
					_tmp63_ = xmpp_stanza_node_get_subnodes (_tmp62_, "media", NULL, FALSE);
					media_nodes = _tmp63_;
					{
						GeeList* _media_node_list = NULL;
						GeeList* _tmp64_;
						gint _media_node_size = 0;
						GeeList* _tmp65_;
						gint _tmp66_;
						gint _tmp67_;
						gint _media_node_index = 0;
						_tmp64_ = media_nodes;
						_media_node_list = _tmp64_;
						_tmp65_ = _media_node_list;
						_tmp66_ = gee_collection_get_size ((GeeCollection*) _tmp65_);
						_tmp67_ = _tmp66_;
						_media_node_size = _tmp67_;
						_media_node_index = -1;
						while (TRUE) {
							gint _tmp68_;
							gint _tmp69_;
							XmppStanzaNode* media_node = NULL;
							GeeList* _tmp70_;
							gpointer _tmp71_;
							gchar* id = NULL;
							XmppStanzaNode* _tmp72_;
							const gchar* _tmp73_;
							gchar* _tmp74_;
							gchar* ty = NULL;
							XmppStanzaNode* _tmp75_;
							const gchar* _tmp76_;
							gchar* _tmp77_;
							gchar* src_id_str = NULL;
							XmppStanzaNode* _tmp78_;
							const gchar* _tmp79_;
							gchar* _tmp80_;
							const gchar* _tmp81_;
							XmppXepCoinConferenceMedia* media = NULL;
							XmppXepCoinConferenceMedia* _tmp82_;
							XmppXepCoinConferenceMedia* _tmp83_;
							const gchar* _tmp84_;
							gchar* _tmp85_;
							gint _tmp86_ = 0;
							const gchar* _tmp87_;
							XmppXepCoinConferenceMedia* _tmp89_;
							XmppXepCoinConferenceMedia* _tmp90_;
							const gchar* _tmp91_;
							gchar* _tmp92_;
							XmppXepCoinConferenceUser* _tmp93_;
							GeeHashMap* _tmp94_;
							const gchar* _tmp95_;
							XmppXepCoinConferenceMedia* _tmp96_;
							_media_node_index = _media_node_index + 1;
							_tmp68_ = _media_node_index;
							_tmp69_ = _media_node_size;
							if (!(_tmp68_ < _tmp69_)) {
								break;
							}
							_tmp70_ = _media_node_list;
							_tmp71_ = gee_list_get (_tmp70_, _media_node_index);
							media_node = (XmppStanzaNode*) _tmp71_;
							_tmp72_ = media_node;
							_tmp73_ = xmpp_stanza_node_get_attribute (_tmp72_, "id", NULL);
							_tmp74_ = g_strdup (_tmp73_);
							id = _tmp74_;
							_tmp75_ = media_node;
							_tmp76_ = xmpp_stanza_node_get_deep_string_content (_tmp75_, XMPP_XEP_COIN_NS_RFC ":type", NULL);
							_tmp77_ = g_strdup (_tmp76_);
							ty = _tmp77_;
							_tmp78_ = media_node;
							_tmp79_ = xmpp_stanza_node_get_deep_string_content (_tmp78_, XMPP_XEP_COIN_NS_RFC ":src-id", NULL);
							_tmp80_ = g_strdup (_tmp79_);
							src_id_str = _tmp80_;
							_tmp81_ = id;
							if (_tmp81_ == NULL) {
								_g_free0 (src_id_str);
								_g_free0 (ty);
								_g_free0 (id);
								_xmpp_stanza_entry_unref0 (media_node);
								continue;
							}
							_tmp82_ = xmpp_xep_coin_conference_media_new ();
							media = _tmp82_;
							_tmp83_ = media;
							_tmp84_ = id;
							_tmp85_ = g_strdup (_tmp84_);
							_g_free0 (_tmp83_->id);
							_tmp83_->id = _tmp85_;
							_tmp87_ = src_id_str;
							if (_tmp87_ != NULL) {
								const gchar* _tmp88_;
								_tmp88_ = src_id_str;
								_tmp86_ = atoi (_tmp88_);
							} else {
								_tmp86_ = -1;
							}
							_tmp89_ = media;
							_tmp89_->src_id = _tmp86_;
							_tmp90_ = media;
							_tmp91_ = ty;
							_tmp92_ = g_strdup (_tmp91_);
							_g_free0 (_tmp90_->ty);
							_tmp90_->ty = _tmp92_;
							_tmp93_ = user;
							_tmp94_ = _tmp93_->medias;
							_tmp95_ = id;
							_tmp96_ = media;
							gee_abstract_map_set ((GeeAbstractMap*) _tmp94_, _tmp95_, _tmp96_);
							_xmpp_xep_coin_conference_media_unref0 (media);
							_g_free0 (src_id_str);
							_g_free0 (ty);
							_g_free0 (id);
							_xmpp_stanza_entry_unref0 (media_node);
						}
					}
					_tmp97_ = conference_info;
					_tmp98_ = _tmp97_->users;
					_tmp99_ = user;
					_tmp100_ = _tmp99_->jid;
					_tmp101_ = user;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp98_, _tmp100_, _tmp101_);
					_g_object_unref0 (media_nodes);
					_xmpp_stanza_entry_unref0 (entpoint_node);
				}
			}
			_g_object_unref0 (endpoint_nodes);
			_xmpp_xep_coin_conference_user_unref0 (user);
			_g_free0 (user_state);
			_xmpp_jid_unref0 (jid);
			_g_free0 (jid_string);
			_xmpp_stanza_entry_unref0 (user_node);
		}
	}
	result = conference_info;
	_g_object_unref0 (user_nodes);
	_xmpp_xep_coin_conference_info_unref0 (_tmp9_);
	_g_free0 (conference_state);
	_g_free0 (version_str);
	return result;
}

static guint
_xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                        gpointer self)
{
	guint result;
	result = xmpp_jid_hash_func ((XmppJid*) v);
	return result;
}

static gboolean
_xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                           gconstpointer b,
                                           gpointer self)
{
	gboolean result;
	result = xmpp_jid_equals_func ((XmppJid*) a, (XmppJid*) b);
	return result;
}

XmppStanzaNode*
xmpp_xep_coin_conference_info_to_xml (XmppXepCoinConferenceInfo* self)
{
	XmppStanzaNode* ret = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* users_node = NULL;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* _tmp26_;
	XmppStanzaNode* _tmp27_;
	XmppStanzaNode* _tmp28_;
	XmppStanzaNode* _tmp29_;
	XmppStanzaNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("conference-info", XMPP_XEP_COIN_NS_RFC, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_stanza_node_add_self_xmlns (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf ("%i", self->version);
	_tmp5_ = _tmp4_;
	_tmp6_ = xmpp_stanza_node_put_attribute (_tmp3_, "version", _tmp5_, NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = xmpp_stanza_node_put_attribute (_tmp7_, "state", "full", NULL);
	_tmp9_ = _tmp8_;
	_xmpp_stanza_entry_unref0 (_tmp7_);
	_g_free0 (_tmp5_);
	_xmpp_stanza_entry_unref0 (_tmp3_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	ret = _tmp9_;
	_tmp10_ = xmpp_stanza_node_new_build ("users", XMPP_XEP_COIN_NS_RFC, NULL, NULL);
	users_node = _tmp10_;
	{
		GeeIterator* _user_it = NULL;
		GeeHashMap* _tmp11_;
		GeeCollection* _tmp12_;
		GeeCollection* _tmp13_;
		GeeCollection* _tmp14_;
		GeeIterator* _tmp15_;
		GeeIterator* _tmp16_;
		_tmp11_ = self->users;
		_tmp12_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = _tmp13_;
		_tmp15_ = gee_iterable_iterator ((GeeIterable*) _tmp14_);
		_tmp16_ = _tmp15_;
		_g_object_unref0 (_tmp14_);
		_user_it = _tmp16_;
		while (TRUE) {
			GeeIterator* _tmp17_;
			XmppXepCoinConferenceUser* user = NULL;
			GeeIterator* _tmp18_;
			gpointer _tmp19_;
			XmppStanzaNode* _tmp20_;
			XmppXepCoinConferenceUser* _tmp21_;
			XmppStanzaNode* _tmp22_;
			XmppStanzaNode* _tmp23_;
			XmppStanzaNode* _tmp24_;
			XmppStanzaNode* _tmp25_;
			_tmp17_ = _user_it;
			if (!gee_iterator_next (_tmp17_)) {
				break;
			}
			_tmp18_ = _user_it;
			_tmp19_ = gee_iterator_get (_tmp18_);
			user = (XmppXepCoinConferenceUser*) _tmp19_;
			_tmp20_ = users_node;
			_tmp21_ = user;
			_tmp22_ = xmpp_xep_coin_conference_user_to_xml (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = xmpp_stanza_node_put_node (_tmp20_, _tmp23_);
			_tmp25_ = _tmp24_;
			_xmpp_stanza_entry_unref0 (_tmp25_);
			_xmpp_stanza_entry_unref0 (_tmp23_);
			_xmpp_xep_coin_conference_user_unref0 (user);
		}
		_g_object_unref0 (_user_it);
	}
	_tmp26_ = ret;
	_tmp27_ = users_node;
	_tmp28_ = xmpp_stanza_node_put_node (_tmp26_, _tmp27_);
	_tmp29_ = _tmp28_;
	_xmpp_stanza_entry_unref0 (_tmp29_);
	result = ret;
	_xmpp_stanza_entry_unref0 (users_node);
	return result;
}

XmppXepCoinConferenceInfo*
xmpp_xep_coin_conference_info_construct (GType object_type)
{
	XmppXepCoinConferenceInfo* self = NULL;
	self = (XmppXepCoinConferenceInfo*) g_type_create_instance (object_type);
	return self;
}

XmppXepCoinConferenceInfo*
xmpp_xep_coin_conference_info_new (void)
{
	return xmpp_xep_coin_conference_info_construct (XMPP_XEP_COIN_TYPE_CONFERENCE_INFO);
}

static void
xmpp_xep_coin_value_conference_info_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
xmpp_xep_coin_value_conference_info_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		xmpp_xep_coin_conference_info_unref (value->data[0].v_pointer);
	}
}

static void
xmpp_xep_coin_value_conference_info_copy_value (const GValue* src_value,
                                                GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = xmpp_xep_coin_conference_info_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
xmpp_xep_coin_value_conference_info_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
xmpp_xep_coin_value_conference_info_collect_value (GValue* value,
                                                   guint n_collect_values,
                                                   GTypeCValue* collect_values,
                                                   guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		XmppXepCoinConferenceInfo * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = xmpp_xep_coin_conference_info_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
xmpp_xep_coin_value_conference_info_lcopy_value (const GValue* value,
                                                 guint n_collect_values,
                                                 GTypeCValue* collect_values,
                                                 guint collect_flags)
{
	XmppXepCoinConferenceInfo ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = xmpp_xep_coin_conference_info_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
xmpp_xep_coin_param_spec_conference_info (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags)
{
	XmppXepCoinParamSpecConferenceInfo* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_XEP_COIN_TYPE_CONFERENCE_INFO), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
xmpp_xep_coin_value_get_conference_info (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_INFO), NULL);
	return value->data[0].v_pointer;
}

void
xmpp_xep_coin_value_set_conference_info (GValue* value,
                                         gpointer v_object)
{
	XmppXepCoinConferenceInfo * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_INFO));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_COIN_TYPE_CONFERENCE_INFO));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		xmpp_xep_coin_conference_info_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_coin_conference_info_unref (old);
	}
}

void
xmpp_xep_coin_value_take_conference_info (GValue* value,
                                          gpointer v_object)
{
	XmppXepCoinConferenceInfo * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_INFO));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_COIN_TYPE_CONFERENCE_INFO));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_coin_conference_info_unref (old);
	}
}

static void
xmpp_xep_coin_conference_info_class_init (XmppXepCoinConferenceInfoClass * klass,
                                          gpointer klass_data)
{
	xmpp_xep_coin_conference_info_parent_class = g_type_class_peek_parent (klass);
	((XmppXepCoinConferenceInfoClass *) klass)->finalize = xmpp_xep_coin_conference_info_finalize;
}

static void
xmpp_xep_coin_conference_info_instance_init (XmppXepCoinConferenceInfo * self,
                                             gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->version = -1;
	_tmp0_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, XMPP_XEP_COIN_TYPE_CONFERENCE_USER, (GBoxedCopyFunc) xmpp_xep_coin_conference_user_ref, (GDestroyNotify) xmpp_xep_coin_conference_user_unref, _xmpp_jid_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->users = _tmp0_;
	self->ref_count = 1;
}

static void
xmpp_xep_coin_conference_info_finalize (XmppXepCoinConferenceInfo * obj)
{
	XmppXepCoinConferenceInfo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_COIN_TYPE_CONFERENCE_INFO, XmppXepCoinConferenceInfo);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->users);
}

static GType
xmpp_xep_coin_conference_info_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_xep_coin_value_conference_info_init, xmpp_xep_coin_value_conference_info_free_value, xmpp_xep_coin_value_conference_info_copy_value, xmpp_xep_coin_value_conference_info_peek_pointer, "p", xmpp_xep_coin_value_conference_info_collect_value, "p", xmpp_xep_coin_value_conference_info_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepCoinConferenceInfoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_coin_conference_info_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepCoinConferenceInfo), 0, (GInstanceInitFunc) xmpp_xep_coin_conference_info_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType xmpp_xep_coin_conference_info_type_id;
	xmpp_xep_coin_conference_info_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppXepCoinConferenceInfo", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return xmpp_xep_coin_conference_info_type_id;
}

GType
xmpp_xep_coin_conference_info_get_type (void)
{
	static volatile gsize xmpp_xep_coin_conference_info_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_coin_conference_info_type_id__once)) {
		GType xmpp_xep_coin_conference_info_type_id;
		xmpp_xep_coin_conference_info_type_id = xmpp_xep_coin_conference_info_get_type_once ();
		g_once_init_leave (&xmpp_xep_coin_conference_info_type_id__once, xmpp_xep_coin_conference_info_type_id);
	}
	return xmpp_xep_coin_conference_info_type_id__once;
}

gpointer
xmpp_xep_coin_conference_info_ref (gpointer instance)
{
	XmppXepCoinConferenceInfo * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
xmpp_xep_coin_conference_info_unref (gpointer instance)
{
	XmppXepCoinConferenceInfo * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_XEP_COIN_CONFERENCE_INFO_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

XmppStanzaNode*
xmpp_xep_coin_conference_user_to_xml (XmppXepCoinConferenceUser* self)
{
	XmppStanzaNode* user_node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppJid* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("user", XMPP_XEP_COIN_NS_RFC, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->jid;
	_tmp3_ = xmpp_jid_to_string (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_stanza_node_put_attribute (_tmp1_, "entity", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	user_node = _tmp6_;
	{
		GeeIterator* _media_it = NULL;
		GeeHashMap* _tmp7_;
		GeeCollection* _tmp8_;
		GeeCollection* _tmp9_;
		GeeCollection* _tmp10_;
		GeeIterator* _tmp11_;
		GeeIterator* _tmp12_;
		_tmp7_ = self->medias;
		_tmp8_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		_tmp11_ = gee_iterable_iterator ((GeeIterable*) _tmp10_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (_tmp10_);
		_media_it = _tmp12_;
		while (TRUE) {
			GeeIterator* _tmp13_;
			XmppXepCoinConferenceMedia* media = NULL;
			GeeIterator* _tmp14_;
			gpointer _tmp15_;
			XmppStanzaNode* _tmp16_;
			XmppXepCoinConferenceMedia* _tmp17_;
			XmppStanzaNode* _tmp18_;
			XmppStanzaNode* _tmp19_;
			XmppStanzaNode* _tmp20_;
			XmppStanzaNode* _tmp21_;
			_tmp13_ = _media_it;
			if (!gee_iterator_next (_tmp13_)) {
				break;
			}
			_tmp14_ = _media_it;
			_tmp15_ = gee_iterator_get (_tmp14_);
			media = (XmppXepCoinConferenceMedia*) _tmp15_;
			_tmp16_ = user_node;
			_tmp17_ = media;
			_tmp18_ = xmpp_xep_coin_conference_media_to_xml (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = xmpp_stanza_node_put_node (_tmp16_, _tmp19_);
			_tmp21_ = _tmp20_;
			_xmpp_stanza_entry_unref0 (_tmp21_);
			_xmpp_stanza_entry_unref0 (_tmp19_);
			_xmpp_xep_coin_conference_media_unref0 (media);
		}
		_g_object_unref0 (_media_it);
	}
	result = user_node;
	return result;
}

XmppXepCoinConferenceUser*
xmpp_xep_coin_conference_user_construct (GType object_type)
{
	XmppXepCoinConferenceUser* self = NULL;
	self = (XmppXepCoinConferenceUser*) g_type_create_instance (object_type);
	return self;
}

XmppXepCoinConferenceUser*
xmpp_xep_coin_conference_user_new (void)
{
	return xmpp_xep_coin_conference_user_construct (XMPP_XEP_COIN_TYPE_CONFERENCE_USER);
}

static void
xmpp_xep_coin_value_conference_user_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
xmpp_xep_coin_value_conference_user_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		xmpp_xep_coin_conference_user_unref (value->data[0].v_pointer);
	}
}

static void
xmpp_xep_coin_value_conference_user_copy_value (const GValue* src_value,
                                                GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = xmpp_xep_coin_conference_user_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
xmpp_xep_coin_value_conference_user_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
xmpp_xep_coin_value_conference_user_collect_value (GValue* value,
                                                   guint n_collect_values,
                                                   GTypeCValue* collect_values,
                                                   guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		XmppXepCoinConferenceUser * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = xmpp_xep_coin_conference_user_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
xmpp_xep_coin_value_conference_user_lcopy_value (const GValue* value,
                                                 guint n_collect_values,
                                                 GTypeCValue* collect_values,
                                                 guint collect_flags)
{
	XmppXepCoinConferenceUser ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = xmpp_xep_coin_conference_user_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
xmpp_xep_coin_param_spec_conference_user (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags)
{
	XmppXepCoinParamSpecConferenceUser* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_XEP_COIN_TYPE_CONFERENCE_USER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
xmpp_xep_coin_value_get_conference_user (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_USER), NULL);
	return value->data[0].v_pointer;
}

void
xmpp_xep_coin_value_set_conference_user (GValue* value,
                                         gpointer v_object)
{
	XmppXepCoinConferenceUser * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_USER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_COIN_TYPE_CONFERENCE_USER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		xmpp_xep_coin_conference_user_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_coin_conference_user_unref (old);
	}
}

void
xmpp_xep_coin_value_take_conference_user (GValue* value,
                                          gpointer v_object)
{
	XmppXepCoinConferenceUser * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_USER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_COIN_TYPE_CONFERENCE_USER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_coin_conference_user_unref (old);
	}
}

static void
xmpp_xep_coin_conference_user_class_init (XmppXepCoinConferenceUserClass * klass,
                                          gpointer klass_data)
{
	xmpp_xep_coin_conference_user_parent_class = g_type_class_peek_parent (klass);
	((XmppXepCoinConferenceUserClass *) klass)->finalize = xmpp_xep_coin_conference_user_finalize;
}

static void
xmpp_xep_coin_conference_user_instance_init (XmppXepCoinConferenceUser * self,
                                             gpointer klass)
{
	GeeHashMap* _tmp0_;
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA, (GBoxedCopyFunc) xmpp_xep_coin_conference_media_ref, (GDestroyNotify) xmpp_xep_coin_conference_media_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->medias = _tmp0_;
	self->ref_count = 1;
}

static void
xmpp_xep_coin_conference_user_finalize (XmppXepCoinConferenceUser * obj)
{
	XmppXepCoinConferenceUser * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_COIN_TYPE_CONFERENCE_USER, XmppXepCoinConferenceUser);
	g_signal_handlers_destroy (self);
	_xmpp_jid_unref0 (self->jid);
	_g_free0 (self->display_text);
	_g_object_unref0 (self->medias);
}

static GType
xmpp_xep_coin_conference_user_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_xep_coin_value_conference_user_init, xmpp_xep_coin_value_conference_user_free_value, xmpp_xep_coin_value_conference_user_copy_value, xmpp_xep_coin_value_conference_user_peek_pointer, "p", xmpp_xep_coin_value_conference_user_collect_value, "p", xmpp_xep_coin_value_conference_user_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepCoinConferenceUserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_coin_conference_user_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepCoinConferenceUser), 0, (GInstanceInitFunc) xmpp_xep_coin_conference_user_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType xmpp_xep_coin_conference_user_type_id;
	xmpp_xep_coin_conference_user_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppXepCoinConferenceUser", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return xmpp_xep_coin_conference_user_type_id;
}

GType
xmpp_xep_coin_conference_user_get_type (void)
{
	static volatile gsize xmpp_xep_coin_conference_user_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_coin_conference_user_type_id__once)) {
		GType xmpp_xep_coin_conference_user_type_id;
		xmpp_xep_coin_conference_user_type_id = xmpp_xep_coin_conference_user_get_type_once ();
		g_once_init_leave (&xmpp_xep_coin_conference_user_type_id__once, xmpp_xep_coin_conference_user_type_id);
	}
	return xmpp_xep_coin_conference_user_type_id__once;
}

gpointer
xmpp_xep_coin_conference_user_ref (gpointer instance)
{
	XmppXepCoinConferenceUser * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
xmpp_xep_coin_conference_user_unref (gpointer instance)
{
	XmppXepCoinConferenceUser * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_XEP_COIN_CONFERENCE_USER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

XmppStanzaNode*
xmpp_xep_coin_conference_media_to_xml (XmppXepCoinConferenceMedia* self)
{
	XmppStanzaNode* media_node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	const gchar* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	const gchar* _tmp5_;
	XmppStanzaNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("media", XMPP_XEP_COIN_NS_RFC, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->id;
	_tmp3_ = xmpp_stanza_node_put_attribute (_tmp1_, "id", _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_xmpp_stanza_entry_unref0 (_tmp1_);
	media_node = _tmp4_;
	_tmp5_ = self->ty;
	if (_tmp5_ != NULL) {
		XmppStanzaNode* _tmp6_;
		XmppStanzaNode* _tmp7_;
		XmppStanzaNode* _tmp8_;
		const gchar* _tmp9_;
		XmppStanzaNode* _tmp10_;
		XmppStanzaNode* _tmp11_;
		XmppStanzaNode* _tmp12_;
		XmppStanzaNode* _tmp13_;
		XmppStanzaNode* _tmp14_;
		XmppStanzaNode* _tmp15_;
		_tmp6_ = media_node;
		_tmp7_ = xmpp_stanza_node_new_build ("type", XMPP_XEP_COIN_NS_RFC, NULL, NULL);
		_tmp8_ = _tmp7_;
		_tmp9_ = self->ty;
		_tmp10_ = xmpp_stanza_node_new_text (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = xmpp_stanza_node_put_node (_tmp8_, _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = xmpp_stanza_node_put_node (_tmp6_, _tmp13_);
		_tmp15_ = _tmp14_;
		_xmpp_stanza_entry_unref0 (_tmp15_);
		_xmpp_stanza_entry_unref0 (_tmp13_);
		_xmpp_stanza_entry_unref0 (_tmp11_);
		_xmpp_stanza_entry_unref0 (_tmp8_);
	}
	if (self->src_id != -1) {
		XmppStanzaNode* _tmp16_;
		XmppStanzaNode* _tmp17_;
		XmppStanzaNode* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		XmppStanzaNode* _tmp21_;
		XmppStanzaNode* _tmp22_;
		XmppStanzaNode* _tmp23_;
		XmppStanzaNode* _tmp24_;
		XmppStanzaNode* _tmp25_;
		XmppStanzaNode* _tmp26_;
		_tmp16_ = media_node;
		_tmp17_ = xmpp_stanza_node_new_build ("src-id", XMPP_XEP_COIN_NS_RFC, NULL, NULL);
		_tmp18_ = _tmp17_;
		_tmp19_ = g_strdup_printf ("%i", self->src_id);
		_tmp20_ = _tmp19_;
		_tmp21_ = xmpp_stanza_node_new_text (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = xmpp_stanza_node_put_node (_tmp18_, _tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = xmpp_stanza_node_put_node (_tmp16_, _tmp24_);
		_tmp26_ = _tmp25_;
		_xmpp_stanza_entry_unref0 (_tmp26_);
		_xmpp_stanza_entry_unref0 (_tmp24_);
		_xmpp_stanza_entry_unref0 (_tmp22_);
		_g_free0 (_tmp20_);
		_xmpp_stanza_entry_unref0 (_tmp18_);
	}
	result = media_node;
	return result;
}

XmppXepCoinConferenceMedia*
xmpp_xep_coin_conference_media_construct (GType object_type)
{
	XmppXepCoinConferenceMedia* self = NULL;
	self = (XmppXepCoinConferenceMedia*) g_type_create_instance (object_type);
	return self;
}

XmppXepCoinConferenceMedia*
xmpp_xep_coin_conference_media_new (void)
{
	return xmpp_xep_coin_conference_media_construct (XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA);
}

static void
xmpp_xep_coin_value_conference_media_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
xmpp_xep_coin_value_conference_media_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		xmpp_xep_coin_conference_media_unref (value->data[0].v_pointer);
	}
}

static void
xmpp_xep_coin_value_conference_media_copy_value (const GValue* src_value,
                                                 GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = xmpp_xep_coin_conference_media_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
xmpp_xep_coin_value_conference_media_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
xmpp_xep_coin_value_conference_media_collect_value (GValue* value,
                                                    guint n_collect_values,
                                                    GTypeCValue* collect_values,
                                                    guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		XmppXepCoinConferenceMedia * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = xmpp_xep_coin_conference_media_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
xmpp_xep_coin_value_conference_media_lcopy_value (const GValue* value,
                                                  guint n_collect_values,
                                                  GTypeCValue* collect_values,
                                                  guint collect_flags)
{
	XmppXepCoinConferenceMedia ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = xmpp_xep_coin_conference_media_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
xmpp_xep_coin_param_spec_conference_media (const gchar* name,
                                           const gchar* nick,
                                           const gchar* blurb,
                                           GType object_type,
                                           GParamFlags flags)
{
	XmppXepCoinParamSpecConferenceMedia* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
xmpp_xep_coin_value_get_conference_media (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA), NULL);
	return value->data[0].v_pointer;
}

void
xmpp_xep_coin_value_set_conference_media (GValue* value,
                                          gpointer v_object)
{
	XmppXepCoinConferenceMedia * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		xmpp_xep_coin_conference_media_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_coin_conference_media_unref (old);
	}
}

void
xmpp_xep_coin_value_take_conference_media (GValue* value,
                                           gpointer v_object)
{
	XmppXepCoinConferenceMedia * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_coin_conference_media_unref (old);
	}
}

static void
xmpp_xep_coin_conference_media_class_init (XmppXepCoinConferenceMediaClass * klass,
                                           gpointer klass_data)
{
	xmpp_xep_coin_conference_media_parent_class = g_type_class_peek_parent (klass);
	((XmppXepCoinConferenceMediaClass *) klass)->finalize = xmpp_xep_coin_conference_media_finalize;
}

static void
xmpp_xep_coin_conference_media_instance_init (XmppXepCoinConferenceMedia * self,
                                              gpointer klass)
{
	self->src_id = -1;
	self->ref_count = 1;
}

static void
xmpp_xep_coin_conference_media_finalize (XmppXepCoinConferenceMedia * obj)
{
	XmppXepCoinConferenceMedia * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_COIN_TYPE_CONFERENCE_MEDIA, XmppXepCoinConferenceMedia);
	g_signal_handlers_destroy (self);
	_g_free0 (self->id);
	_g_free0 (self->ty);
}

static GType
xmpp_xep_coin_conference_media_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_xep_coin_value_conference_media_init, xmpp_xep_coin_value_conference_media_free_value, xmpp_xep_coin_value_conference_media_copy_value, xmpp_xep_coin_value_conference_media_peek_pointer, "p", xmpp_xep_coin_value_conference_media_collect_value, "p", xmpp_xep_coin_value_conference_media_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepCoinConferenceMediaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_coin_conference_media_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepCoinConferenceMedia), 0, (GInstanceInitFunc) xmpp_xep_coin_conference_media_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType xmpp_xep_coin_conference_media_type_id;
	xmpp_xep_coin_conference_media_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppXepCoinConferenceMedia", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return xmpp_xep_coin_conference_media_type_id;
}

GType
xmpp_xep_coin_conference_media_get_type (void)
{
	static volatile gsize xmpp_xep_coin_conference_media_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_coin_conference_media_type_id__once)) {
		GType xmpp_xep_coin_conference_media_type_id;
		xmpp_xep_coin_conference_media_type_id = xmpp_xep_coin_conference_media_get_type_once ();
		g_once_init_leave (&xmpp_xep_coin_conference_media_type_id__once, xmpp_xep_coin_conference_media_type_id);
	}
	return xmpp_xep_coin_conference_media_type_id__once;
}

gpointer
xmpp_xep_coin_conference_media_ref (gpointer instance)
{
	XmppXepCoinConferenceMedia * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
xmpp_xep_coin_conference_media_unref (gpointer instance)
{
	XmppXepCoinConferenceMedia * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_XEP_COIN_CONFERENCE_MEDIA_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

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

