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

#define XMPP_NS_URI "jabber:client"
#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_MESSAGE_MODULE_0_PROPERTY,
	XMPP_MESSAGE_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_message_module_properties[XMPP_MESSAGE_MODULE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _XmppMessageModuleSendMessageData XmppMessageModuleSendMessageData;
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#define _xmpp_error_stanza_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_error_stanza_unref (var), NULL)))
typedef struct _XmppMessageModuleReceivedMessageStanzaAsyncData XmppMessageModuleReceivedMessageStanzaAsyncData;
enum  {
	XMPP_MESSAGE_MODULE_RECEIVED_MESSAGE_SIGNAL,
	XMPP_MESSAGE_MODULE_RECEIVED_ERROR_SIGNAL,
	XMPP_MESSAGE_MODULE_RECEIVED_MESSAGE_UNPROCESSED_SIGNAL,
	XMPP_MESSAGE_MODULE_NUM_SIGNALS
};
static guint xmpp_message_module_signals[XMPP_MESSAGE_MODULE_NUM_SIGNALS] = {0};

struct _XmppMessageModuleSendMessageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppMessageModule* self;
	XmppXmppStream* stream;
	XmppMessageStanza* message;
	XmppStanzaListenerHolder* _tmp0_;
	XmppStanzaNode* _tmp1_;
	GError* _inner_error0_;
};

struct _XmppMessageModuleReceivedMessageStanzaAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppMessageModule* self;
	XmppXmppStream* stream;
	XmppStanzaNode* node;
	XmppMessageStanza* message;
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppBindFlag* _tmp2_;
	XmppJid* _tmp3_;
	XmppMessageStanza* _tmp4_;
	XmppMessageStanza* _tmp5_;
	XmppMessageStanza* _tmp6_;
	XmppMessageStanza* _tmp7_;
	XmppErrorStanza* error_stanza;
	XmppMessageStanza* _tmp8_;
	XmppErrorStanza* _tmp9_;
	XmppErrorStanza* _tmp10_;
	XmppMessageStanza* _tmp11_;
	XmppErrorStanza* _tmp12_;
	gboolean abort;
	XmppStanzaListenerHolder* _tmp13_;
	XmppMessageStanza* _tmp14_;
	XmppMessageStanza* _tmp15_;
};

static gpointer xmpp_message_module_parent_class = NULL;
XmppModuleIdentity* xmpp_message_module_IDENTITY = NULL;

static void xmpp_message_module_send_message_data_free (gpointer _data);
static gboolean xmpp_message_module_send_message_co (XmppMessageModuleSendMessageData* _data_);
static void xmpp_message_module_send_message_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static void xmpp_message_module_received_message_stanza_async_data_free (gpointer _data);
static gboolean xmpp_message_module_received_message_stanza_async_co (XmppMessageModuleReceivedMessageStanzaAsyncData* _data_);
static void xmpp_message_module_received_message_stanza_async_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_);
static void xmpp_message_module_received_message_stanza (XmppMessageModule* self,
                                                  XmppXmppStream* stream,
                                                  XmppStanzaNode* node);
static void xmpp_message_module_real_attach (XmppXmppStreamModule* base,
                                      XmppXmppStream* stream);
static void _xmpp_message_module_received_message_stanza_xmpp_xmpp_stream_received_message_stanza (XmppXmppStream* _sender,
                                                                                            XmppXmppStream* stream,
                                                                                            XmppStanzaNode* node,
                                                                                            gpointer self);
static void xmpp_message_module_real_detach (XmppXmppStreamModule* base,
                                      XmppXmppStream* stream);
static gchar* xmpp_message_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_message_module_real_get_id (XmppXmppStreamModule* base);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_XMPP_ERROR_STANZA (GClosure * closure,
                                                                    GValue * return_value,
                                                                    guint n_param_values,
                                                                    const GValue * param_values,
                                                                    gpointer invocation_hint,
                                                                    gpointer marshal_data);
static void xmpp_message_module_finalize (GObject * obj);
static GType xmpp_message_module_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static void
xmpp_message_module_send_message_data_free (gpointer _data)
{
	XmppMessageModuleSendMessageData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->message);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppMessageModuleSendMessageData, _data_);
}

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

void
xmpp_message_module_send_message (XmppMessageModule* self,
                                  XmppXmppStream* stream,
                                  XmppMessageStanza* message,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	XmppMessageModuleSendMessageData* _data_;
	XmppMessageModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppMessageStanza* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (message != NULL);
	_data_ = g_slice_new0 (XmppMessageModuleSendMessageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_message_module_send_message_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 (message);
	_g_object_unref0 (_data_->message);
	_data_->message = _tmp2_;
	xmpp_message_module_send_message_co (_data_);
}

void
xmpp_message_module_send_message_finish (XmppMessageModule* self,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	XmppMessageModuleSendMessageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
xmpp_message_module_send_message_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	XmppMessageModuleSendMessageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_message_module_send_message_co (_data_);
}

static gboolean
xmpp_message_module_send_message_co (XmppMessageModuleSendMessageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->send_pipeline;
	_data_->_state_ = 1;
	xmpp_stanza_listener_holder_run (_data_->_tmp0_, _data_->stream, _data_->message, xmpp_message_module_send_message_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_stanza_listener_holder_run_finish (_data_->_tmp0_, _data_->_res_);
	_data_->_tmp1_ = ((XmppStanza*) _data_->message)->stanza;
	_data_->_state_ = 2;
	xmpp_xmpp_stream_write_async (_data_->stream, _data_->_tmp1_, G_PRIORITY_DEFAULT, NULL, xmpp_message_module_send_message_ready, _data_);
	return FALSE;
	_state_2:
	xmpp_xmpp_stream_write_finish (_data_->stream, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	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_message_module_received_message_stanza_async_data_free (gpointer _data)
{
	XmppMessageModuleReceivedMessageStanzaAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_stanza_entry_unref0 (_data_->node);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppMessageModuleReceivedMessageStanzaAsyncData, _data_);
}

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

void
xmpp_message_module_received_message_stanza_async (XmppMessageModule* self,
                                                   XmppXmppStream* stream,
                                                   XmppStanzaNode* node,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_)
{
	XmppMessageModuleReceivedMessageStanzaAsyncData* _data_;
	XmppMessageModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppStanzaNode* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (node != NULL);
	_data_ = g_slice_new0 (XmppMessageModuleReceivedMessageStanzaAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_message_module_received_message_stanza_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _xmpp_stanza_entry_ref0 (node);
	_xmpp_stanza_entry_unref0 (_data_->node);
	_data_->node = _tmp2_;
	xmpp_message_module_received_message_stanza_async_co (_data_);
}

void
xmpp_message_module_received_message_stanza_finish (XmppMessageModule* self,
                                                    GAsyncResult* _res_)
{
	XmppMessageModuleReceivedMessageStanzaAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_message_module_received_message_stanza_async_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_)
{
	XmppMessageModuleReceivedMessageStanzaAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_message_module_received_message_stanza_async_co (_data_);
}

static gboolean
xmpp_message_module_received_message_stanza_async_co (XmppMessageModuleReceivedMessageStanzaAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_bind_flag_IDENTITY;
	_data_->_tmp1_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp0_);
	_data_->_tmp2_ = (XmppBindFlag*) _data_->_tmp1_;
	_data_->_tmp3_ = _data_->_tmp2_->my_jid;
	_data_->_tmp4_ = xmpp_message_stanza_new_from_stanza (_data_->node, _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_g_object_unref0 (_data_->_tmp2_);
	_data_->message = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->message;
	g_signal_emit (_data_->self, xmpp_message_module_signals[XMPP_MESSAGE_MODULE_RECEIVED_MESSAGE_UNPROCESSED_SIGNAL], 0, _data_->stream, _data_->_tmp6_);
	_data_->_tmp7_ = _data_->message;
	if (xmpp_stanza_is_error ((XmppStanza*) _data_->_tmp7_)) {
		_data_->_tmp8_ = _data_->message;
		_data_->_tmp9_ = xmpp_stanza_get_error ((XmppStanza*) _data_->_tmp8_);
		_data_->error_stanza = _data_->_tmp9_;
		_data_->_tmp10_ = _data_->error_stanza;
		if (_data_->_tmp10_ == NULL) {
			_xmpp_error_stanza_unref0 (_data_->error_stanza);
			_g_object_unref0 (_data_->message);
			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_->_tmp11_ = _data_->message;
		_data_->_tmp12_ = _data_->error_stanza;
		g_signal_emit (_data_->self, xmpp_message_module_signals[XMPP_MESSAGE_MODULE_RECEIVED_ERROR_SIGNAL], 0, _data_->stream, _data_->_tmp11_, _data_->_tmp12_);
		_xmpp_error_stanza_unref0 (_data_->error_stanza);
	} else {
		_data_->_tmp13_ = _data_->self->received_pipeline;
		_data_->_tmp14_ = _data_->message;
		_data_->_state_ = 1;
		xmpp_stanza_listener_holder_run (_data_->_tmp13_, _data_->stream, _data_->_tmp14_, xmpp_message_module_received_message_stanza_async_ready, _data_);
		return FALSE;
		_state_1:
		_data_->abort = xmpp_stanza_listener_holder_run_finish (_data_->_tmp13_, _data_->_res_);
		if (_data_->abort) {
			_g_object_unref0 (_data_->message);
			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_->_tmp15_ = _data_->message;
		g_signal_emit (_data_->self, xmpp_message_module_signals[XMPP_MESSAGE_MODULE_RECEIVED_MESSAGE_SIGNAL], 0, _data_->stream, _data_->_tmp15_);
	}
	_g_object_unref0 (_data_->message);
	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_message_module_received_message_stanza (XmppMessageModule* self,
                                             XmppXmppStream* stream,
                                             XmppStanzaNode* node)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (node != NULL);
	xmpp_message_module_received_message_stanza_async (self, stream, node, NULL, NULL);
}

static void
_xmpp_message_module_received_message_stanza_xmpp_xmpp_stream_received_message_stanza (XmppXmppStream* _sender,
                                                                                       XmppXmppStream* stream,
                                                                                       XmppStanzaNode* node,
                                                                                       gpointer self)
{
	xmpp_message_module_received_message_stanza ((XmppMessageModule*) self, stream, node);
}

static void
xmpp_message_module_real_attach (XmppXmppStreamModule* base,
                                 XmppXmppStream* stream)
{
	XmppMessageModule * self;
	self = (XmppMessageModule*) base;
	g_return_if_fail (stream != NULL);
	g_signal_connect_object (stream, "received-message-stanza", (GCallback) _xmpp_message_module_received_message_stanza_xmpp_xmpp_stream_received_message_stanza, self, 0);
}

static void
xmpp_message_module_real_detach (XmppXmppStreamModule* base,
                                 XmppXmppStream* stream)
{
	XmppMessageModule * self;
	guint _tmp0_;
	self = (XmppMessageModule*) base;
	g_return_if_fail (stream != NULL);
	g_signal_parse_name ("received-message-stanza", XMPP_TYPE_XMPP_STREAM, &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (stream, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _xmpp_message_module_received_message_stanza_xmpp_xmpp_stream_received_message_stanza, self);
}

static gchar*
xmpp_message_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppMessageModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppMessageModule*) base;
	_tmp0_ = g_strdup (XMPP_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_message_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppMessageModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppMessageModule*) base;
	_tmp0_ = xmpp_message_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

XmppMessageModule*
xmpp_message_module_construct (GType object_type)
{
	XmppMessageModule * self = NULL;
	self = (XmppMessageModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppMessageModule*
xmpp_message_module_new (void)
{
	return xmpp_message_module_construct (XMPP_TYPE_MESSAGE_MODULE);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), data2);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_OBJECT_XMPP_ERROR_STANZA (GClosure * closure,
                                                               GValue * return_value,
                                                               guint n_param_values,
                                                               const GValue * param_values,
                                                               gpointer invocation_hint,
                                                               gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT_XMPP_ERROR_STANZA) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT_XMPP_ERROR_STANZA callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT_XMPP_ERROR_STANZA) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), xmpp_value_get_error_stanza (param_values + 3), data2);
}

static void
xmpp_message_module_class_init (XmppMessageModuleClass * klass,
                                gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_message_module_parent_class = g_type_class_peek_parent (klass);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_message_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_message_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_message_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_message_module_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = xmpp_message_module_finalize;
	xmpp_message_module_signals[XMPP_MESSAGE_MODULE_RECEIVED_MESSAGE_SIGNAL] = g_signal_new ("received-message", XMPP_TYPE_MESSAGE_MODULE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, XMPP_TYPE_XMPP_STREAM, XMPP_TYPE_MESSAGE_STANZA);
	xmpp_message_module_signals[XMPP_MESSAGE_MODULE_RECEIVED_ERROR_SIGNAL] = g_signal_new ("received-error", XMPP_TYPE_MESSAGE_MODULE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_XMPP_ERROR_STANZA, G_TYPE_NONE, 3, XMPP_TYPE_XMPP_STREAM, XMPP_TYPE_MESSAGE_STANZA, XMPP_TYPE_ERROR_STANZA);
	xmpp_message_module_signals[XMPP_MESSAGE_MODULE_RECEIVED_MESSAGE_UNPROCESSED_SIGNAL] = g_signal_new ("received-message-unprocessed", XMPP_TYPE_MESSAGE_MODULE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, XMPP_TYPE_XMPP_STREAM, XMPP_TYPE_MESSAGE_STANZA);
	_tmp0_ = xmpp_module_identity_new (XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_NS_URI, "message_module");
	xmpp_message_module_IDENTITY = _tmp0_;
}

static void
xmpp_message_module_instance_init (XmppMessageModule * self,
                                   gpointer klass)
{
	XmppStanzaListenerHolder* _tmp0_;
	XmppStanzaListenerHolder* _tmp1_;
	_tmp0_ = xmpp_stanza_listener_holder_new (XMPP_TYPE_MESSAGE_STANZA, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	self->received_pipeline = _tmp0_;
	_tmp1_ = xmpp_stanza_listener_holder_new (XMPP_TYPE_MESSAGE_STANZA, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	self->send_pipeline = _tmp1_;
}

static void
xmpp_message_module_finalize (GObject * obj)
{
	XmppMessageModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_TYPE_MESSAGE_MODULE, XmppMessageModule);
	_g_object_unref0 (self->received_pipeline);
	_g_object_unref0 (self->send_pipeline);
	G_OBJECT_CLASS (xmpp_message_module_parent_class)->finalize (obj);
}

static GType
xmpp_message_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppMessageModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_message_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppMessageModule), 0, (GInstanceInitFunc) xmpp_message_module_instance_init, NULL };
	GType xmpp_message_module_type_id;
	xmpp_message_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppMessageModule", &g_define_type_info, 0);
	return xmpp_message_module_type_id;
}

GType
xmpp_message_module_get_type (void)
{
	static volatile gsize xmpp_message_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_message_module_type_id__once)) {
		GType xmpp_message_module_type_id;
		xmpp_message_module_type_id = xmpp_message_module_get_type_once ();
		g_once_init_leave (&xmpp_message_module_type_id__once, xmpp_message_module_type_id);
	}
	return xmpp_message_module_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;
}

