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

#include "xmpp-vala.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include <gobject/gvaluecollector.h>
#include <gio/gio.h>
#include <gee.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

#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _XmppMessageArchiveManagementParamSpecQueryResult XmppMessageArchiveManagementParamSpecQueryResult;
enum  {
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MODULE_0_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_message_archive_management_module_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MODULE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
typedef struct _XmppMessageArchiveManagementModuleQueryAvailabilityData XmppMessageArchiveManagementModuleQueryAvailabilityData;
enum  {
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MODULE_FEATURE_AVAILABLE_SIGNAL,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MODULE_NUM_SIGNALS
};
static guint xmpp_message_archive_management_module_signals[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MODULE_NUM_SIGNALS] = {0};
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#define _xmpp_xep_data_forms_data_form_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_data_forms_data_form_unref (var), NULL)))
#define _xmpp_message_archive_management_query_result_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_message_archive_management_query_result_unref (var), NULL)))
typedef struct _Block15Data Block15Data;
typedef struct _XmppMessageArchiveManagementQueryArchiveData XmppMessageArchiveManagementQueryArchiveData;
enum  {
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_0_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_ACTION_GROUP_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_AFTER_ACTIONS_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_NUM_PROPERTIES
};
static GParamSpec* xmpp_message_archive_management_received_pipeline_listener_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_NUM_PROPERTIES];
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _XmppMessageArchiveManagementReceivedPipelineListenerRunData XmppMessageArchiveManagementReceivedPipelineListenerRunData;
enum  {
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_0_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_COUGHT_UP_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_ACTIVE_QUERY_IDS_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_NUM_PROPERTIES
};
static GParamSpec* xmpp_message_archive_management_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_NUM_PROPERTIES];
enum  {
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_0_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SENDER_JID_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SERVER_TIME_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_MAM_ID_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_QUERY_ID_PROPERTY,
	XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_NUM_PROPERTIES
};
static GParamSpec* xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_NUM_PROPERTIES];

struct _XmppMessageArchiveManagementQueryResultPrivate {
	gboolean _error;
	gboolean _malformed;
	gboolean _complete;
	gchar* _first;
	gchar* _last;
};

struct _XmppMessageArchiveManagementParamSpecQueryResult {
	GParamSpec parent_instance;
};

struct _XmppMessageArchiveManagementModulePrivate {
	XmppMessageArchiveManagementReceivedPipelineListener* received_pipeline_listener;
};

struct _XmppMessageArchiveManagementModuleQueryAvailabilityData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppMessageArchiveManagementModule* self;
	XmppXmppStream* stream;
	XmppJid* own_jid;
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppBindFlag* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	gboolean mam_available;
	XmppModuleIdentity* _tmp7_;
	gpointer _tmp8_;
	XmppXepServiceDiscoveryModule* _tmp9_;
	XmppJid* _tmp10_;
	gboolean _tmp11_;
};

struct _Block15Data {
	int _ref_count_;
	XmppMessageArchiveManagementFlag* flag;
	gchar* query_id;
	gpointer _async_data_;
};

struct _XmppMessageArchiveManagementQueryArchiveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXmppStream* stream;
	XmppJid* mam_server;
	XmppStanzaNode* query_node;
	GCancellable* cancellable;
	XmppMessageArchiveManagementQueryResult* result;
	Block15Data* _data15_;
	XmppMessageArchiveManagementQueryResult* res;
	XmppMessageArchiveManagementQueryResult* _tmp0_;
	XmppMessageArchiveManagementFlag* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	XmppMessageArchiveManagementFlag* _tmp5_;
	const gchar* _tmp6_;
	XmppMessageArchiveManagementQueryResult* _tmp7_;
	XmppMessageArchiveManagementFlag* _tmp8_;
	GeeSet* _tmp9_;
	GeeSet* _tmp10_;
	const gchar* _tmp11_;
	XmppIqStanza* iq;
	XmppJid* _tmp12_;
	XmppIqStanza* _tmp13_;
	XmppIqStanza* result_iq;
	XmppModuleIdentity* _tmp14_;
	gpointer _tmp15_;
	XmppIqModule* _tmp16_;
	XmppIqStanza* _tmp17_;
	XmppIqStanza* _tmp18_;
	XmppIqStanza* _tmp19_;
	XmppStanzaNode* fin_node;
	XmppIqStanza* _tmp20_;
	XmppStanzaNode* _tmp21_;
	XmppStanzaNode* _tmp22_;
	XmppStanzaNode* _tmp23_;
	XmppMessageArchiveManagementQueryResult* _tmp24_;
	XmppStanzaNode* rsm_node;
	XmppStanzaNode* _tmp25_;
	XmppStanzaNode* _tmp26_;
	XmppStanzaNode* _tmp27_;
	XmppMessageArchiveManagementQueryResult* _tmp28_;
	XmppMessageArchiveManagementQueryResult* _tmp29_;
	XmppStanzaNode* _tmp30_;
	const gchar* _tmp31_;
	XmppMessageArchiveManagementQueryResult* _tmp32_;
	XmppStanzaNode* _tmp33_;
	const gchar* _tmp34_;
	XmppMessageArchiveManagementQueryResult* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	XmppMessageArchiveManagementQueryResult* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	XmppMessageArchiveManagementQueryResult* _tmp41_;
	XmppMessageArchiveManagementQueryResult* _tmp42_;
	XmppStanzaNode* _tmp43_;
	GError* _inner_error0_;
};

struct _XmppMessageArchiveManagementReceivedPipelineListenerPrivate {
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _XmppMessageArchiveManagementReceivedPipelineListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppMessageArchiveManagementReceivedPipelineListener* self;
	XmppXmppStream* stream;
	XmppMessageStanza* message;
	gboolean result;
	XmppMessageArchiveManagementFlag* flag;
	XmppMessageArchiveManagementFlag* _tmp0_;
	XmppStanzaNode* message_node;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* forward_node;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	GDateTime* datetime;
	XmppStanzaNode* _tmp6_;
	GDateTime* _tmp7_;
	gchar* mam_id;
	XmppStanzaNode* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* query_id;
	XmppStanzaNode* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	XmppJid* _tmp15_;
	XmppJid* _tmp16_;
	XmppJid* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	XmppMessageArchiveManagementFlag* _tmp20_;
	GeeSet* _tmp21_;
	GeeSet* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	XmppJid* _tmp26_;
	XmppJid* _tmp27_;
	XmppJid* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	XmppJid* inner_from;
	XmppJid* _tmp31_;
	XmppStanzaNode* _tmp32_;
	const gchar* _tmp33_;
	XmppJid* _tmp34_;
	XmppJid* _tmp35_;
	XmppJid* _tmp36_;
	XmppJid* _tmp37_;
	XmppJid* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gboolean _tmp41_;
	XmppJid* _tmp42_;
	XmppJid* _tmp43_;
	XmppJid* _tmp44_;
	XmppFlagIdentity* _tmp45_;
	gpointer _tmp46_;
	XmppBindFlag* _tmp47_;
	XmppJid* _tmp48_;
	XmppJid* _tmp49_;
	XmppJid* _tmp50_;
	XmppJid* _tmp51_;
	gboolean _tmp52_;
	XmppJid* _tmp53_;
	XmppJid* _tmp54_;
	XmppJid* _tmp55_;
	XmppJid* _tmp56_;
	XmppJid* _tmp57_;
	XmppJid* _tmp58_;
	XmppJid* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
	XmppJid* _tmp62_;
	gchar* _tmp63_;
	gchar* _tmp64_;
	XmppJid* _tmp65_;
	XmppJid* _tmp66_;
	XmppJid* _tmp67_;
	GDateTime* _tmp68_;
	const gchar* _tmp69_;
	const gchar* _tmp70_;
	XmppMessageArchiveManagementMessageFlag* _tmp71_;
	XmppMessageArchiveManagementMessageFlag* _tmp72_;
	XmppStanzaNode* _tmp73_;
	XmppStanzaNode* _tmp74_;
	GError* _inner_error0_;
};

struct _XmppMessageArchiveManagementFlagPrivate {
	gboolean _cought_up;
	GeeSet* _active_query_ids;
};

struct _XmppMessageArchiveManagementMessageFlagPrivate {
	XmppJid* _sender_jid;
	GDateTime* _server_time;
	gchar* _mam_id;
	gchar* _query_id;
};

static gint XmppMessageArchiveManagementQueryResult_private_offset;
static gpointer xmpp_message_archive_management_query_result_parent_class = NULL;
static gint XmppMessageArchiveManagementModule_private_offset;
static gpointer xmpp_message_archive_management_module_parent_class = NULL;
XmppModuleIdentity* xmpp_message_archive_management_module_IDENTITY = NULL;
static gint XmppMessageArchiveManagementReceivedPipelineListener_private_offset;
static gpointer xmpp_message_archive_management_received_pipeline_listener_parent_class = NULL;
static gint XmppMessageArchiveManagementFlag_private_offset;
static gpointer xmpp_message_archive_management_flag_parent_class = NULL;
XmppFlagIdentity* xmpp_message_archive_management_flag_IDENTITY = NULL;
static gint XmppMessageArchiveManagementMessageFlag_private_offset;
static gpointer xmpp_message_archive_management_message_flag_parent_class = NULL;

static void xmpp_message_archive_management_query_result_finalize (XmppMessageArchiveManagementQueryResult * obj);
static GType xmpp_message_archive_management_query_result_get_type_once (void);
static void xmpp_message_archive_management_module_real_attach (XmppXmppStreamModule* base,
                                                         XmppXmppStream* stream);
static void xmpp_message_archive_management_module_query_availability (XmppMessageArchiveManagementModule* self,
                                                                XmppXmppStream* stream,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
static void xmpp_message_archive_management_module_query_availability_finish (XmppMessageArchiveManagementModule* self,
                                                                       GAsyncResult* _res_);
static void _xmpp_message_archive_management_module_query_availability_xmpp_xmpp_stream_stream_negotiated (XmppXmppStream* _sender,
                                                                                                    XmppXmppStream* stream,
                                                                                                    gpointer self);
static void xmpp_message_archive_management_module_real_detach (XmppXmppStreamModule* base,
                                                         XmppXmppStream* stream);
static gchar* xmpp_message_archive_management_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_message_archive_management_module_real_get_id (XmppXmppStreamModule* base);
static void xmpp_message_archive_management_module_query_availability_data_free (gpointer _data);
static gboolean xmpp_message_archive_management_module_query_availability_co (XmppMessageArchiveManagementModuleQueryAvailabilityData* _data_);
static void xmpp_message_archive_management_module_query_availability_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_);
static void xmpp_message_archive_management_module_finalize (GObject * obj);
static GType xmpp_message_archive_management_module_get_type_once (void);
VALA_EXTERN XmppStanzaNode* xmpp_message_archive_management_create_base_query (XmppXmppStream* stream,
                                                                   const gchar* queryid,
                                                                   GeeList* fields);
VALA_EXTERN XmppXepDataFormsDataForm* xmpp_xep_data_forms_data_form_new (void);
VALA_EXTERN XmppXepDataFormsDataForm* xmpp_xep_data_forms_data_form_construct (GType object_type);
static void xmpp_message_archive_management_query_archive_data_free (gpointer _data);
VALA_EXTERN void xmpp_message_archive_management_query_archive (XmppXmppStream* stream,
                                                    XmppJid* mam_server,
                                                    XmppStanzaNode* query_node,
                                                    GCancellable* cancellable,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
VALA_EXTERN XmppMessageArchiveManagementQueryResult* xmpp_message_archive_management_query_archive_finish (GAsyncResult* _res_);
static gboolean xmpp_message_archive_management_query_archive_co (XmppMessageArchiveManagementQueryArchiveData* _data_);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static void xmpp_message_archive_management_query_archive_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static gboolean __lambda32_ (Block15Data* _data15_);
static gboolean ___lambda32__gsource_func (gpointer self);
static void xmpp_message_archive_management_received_pipeline_listener_real_run_data_free (gpointer _data);
static void xmpp_message_archive_management_received_pipeline_listener_real_run (XmppStanzaListener* base,
                                                                          XmppXmppStream* stream,
                                                                          XmppMessageStanza* message,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_);
static gboolean xmpp_message_archive_management_received_pipeline_listener_real_run_co (XmppMessageArchiveManagementReceivedPipelineListenerRunData* _data_);
static void xmpp_message_archive_management_received_pipeline_listener_finalize (GObject * obj);
static GType xmpp_message_archive_management_received_pipeline_listener_get_type_once (void);
static void _vala_xmpp_message_archive_management_received_pipeline_listener_get_property (GObject * object,
                                                                                    guint property_id,
                                                                                    GValue * value,
                                                                                    GParamSpec * pspec);
static gchar* xmpp_message_archive_management_flag_real_get_ns (XmppXmppStreamFlag* base);
static gchar* xmpp_message_archive_management_flag_real_get_id (XmppXmppStreamFlag* base);
static void xmpp_message_archive_management_flag_finalize (GObject * obj);
static GType xmpp_message_archive_management_flag_get_type_once (void);
static void _vala_xmpp_message_archive_management_flag_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_xmpp_message_archive_management_flag_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);
static void xmpp_message_archive_management_message_flag_set_sender_jid (XmppMessageArchiveManagementMessageFlag* self,
                                                                  XmppJid* value);
static void xmpp_message_archive_management_message_flag_set_server_time (XmppMessageArchiveManagementMessageFlag* self,
                                                                   GDateTime* value);
static void xmpp_message_archive_management_message_flag_set_mam_id (XmppMessageArchiveManagementMessageFlag* self,
                                                              const gchar* value);
static void xmpp_message_archive_management_message_flag_set_query_id (XmppMessageArchiveManagementMessageFlag* self,
                                                                const gchar* value);
static gchar* xmpp_message_archive_management_message_flag_real_get_ns (XmppMessageFlag* base);
static gchar* xmpp_message_archive_management_message_flag_real_get_id (XmppMessageFlag* base);
static void xmpp_message_archive_management_message_flag_finalize (GObject * obj);
static GType xmpp_message_archive_management_message_flag_get_type_once (void);
static void _vala_xmpp_message_archive_management_message_flag_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec);
static void _vala_xmpp_message_archive_management_message_flag_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_message_archive_management_query_result_get_instance_private (XmppMessageArchiveManagementQueryResult* self)
{
	return G_STRUCT_MEMBER_P (self, XmppMessageArchiveManagementQueryResult_private_offset);
}

XmppMessageArchiveManagementQueryResult*
xmpp_message_archive_management_query_result_construct (GType object_type)
{
	XmppMessageArchiveManagementQueryResult* self = NULL;
	self = (XmppMessageArchiveManagementQueryResult*) g_type_create_instance (object_type);
	return self;
}

XmppMessageArchiveManagementQueryResult*
xmpp_message_archive_management_query_result_new (void)
{
	return xmpp_message_archive_management_query_result_construct (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_QUERY_RESULT);
}

gboolean
xmpp_message_archive_management_query_result_get_error (XmppMessageArchiveManagementQueryResult* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_error;
	return result;
}

void
xmpp_message_archive_management_query_result_set_error (XmppMessageArchiveManagementQueryResult* self,
                                                        gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_error = value;
}

gboolean
xmpp_message_archive_management_query_result_get_malformed (XmppMessageArchiveManagementQueryResult* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_malformed;
	return result;
}

void
xmpp_message_archive_management_query_result_set_malformed (XmppMessageArchiveManagementQueryResult* self,
                                                            gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_malformed = value;
}

gboolean
xmpp_message_archive_management_query_result_get_complete (XmppMessageArchiveManagementQueryResult* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_complete;
	return result;
}

void
xmpp_message_archive_management_query_result_set_complete (XmppMessageArchiveManagementQueryResult* self,
                                                           gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_complete = value;
}

const gchar*
xmpp_message_archive_management_query_result_get_first (XmppMessageArchiveManagementQueryResult* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_first;
	result = _tmp0_;
	return result;
}

void
xmpp_message_archive_management_query_result_set_first (XmppMessageArchiveManagementQueryResult* self,
                                                        const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_first);
	self->priv->_first = _tmp0_;
}

const gchar*
xmpp_message_archive_management_query_result_get_last (XmppMessageArchiveManagementQueryResult* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_last;
	result = _tmp0_;
	return result;
}

void
xmpp_message_archive_management_query_result_set_last (XmppMessageArchiveManagementQueryResult* self,
                                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_last);
	self->priv->_last = _tmp0_;
}

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

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

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

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

static gchar*
xmpp_message_archive_management_value_query_result_collect_value (GValue* value,
                                                                  guint n_collect_values,
                                                                  GTypeCValue* collect_values,
                                                                  guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		XmppMessageArchiveManagementQueryResult * 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_message_archive_management_query_result_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
xmpp_message_archive_management_value_query_result_lcopy_value (const GValue* value,
                                                                guint n_collect_values,
                                                                GTypeCValue* collect_values,
                                                                guint collect_flags)
{
	XmppMessageArchiveManagementQueryResult ** 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_message_archive_management_query_result_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
xmpp_message_archive_management_param_spec_query_result (const gchar* name,
                                                         const gchar* nick,
                                                         const gchar* blurb,
                                                         GType object_type,
                                                         GParamFlags flags)
{
	XmppMessageArchiveManagementParamSpecQueryResult* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_QUERY_RESULT), 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_message_archive_management_value_get_query_result (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_QUERY_RESULT), NULL);
	return value->data[0].v_pointer;
}

void
xmpp_message_archive_management_value_set_query_result (GValue* value,
                                                        gpointer v_object)
{
	XmppMessageArchiveManagementQueryResult * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_QUERY_RESULT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_QUERY_RESULT));
		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_message_archive_management_query_result_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_message_archive_management_query_result_unref (old);
	}
}

void
xmpp_message_archive_management_value_take_query_result (GValue* value,
                                                         gpointer v_object)
{
	XmppMessageArchiveManagementQueryResult * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_QUERY_RESULT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_QUERY_RESULT));
		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_message_archive_management_query_result_unref (old);
	}
}

static void
xmpp_message_archive_management_query_result_class_init (XmppMessageArchiveManagementQueryResultClass * klass,
                                                         gpointer klass_data)
{
	xmpp_message_archive_management_query_result_parent_class = g_type_class_peek_parent (klass);
	((XmppMessageArchiveManagementQueryResultClass *) klass)->finalize = xmpp_message_archive_management_query_result_finalize;
	g_type_class_adjust_private_offset (klass, &XmppMessageArchiveManagementQueryResult_private_offset);
}

static void
xmpp_message_archive_management_query_result_instance_init (XmppMessageArchiveManagementQueryResult * self,
                                                            gpointer klass)
{
	self->priv = xmpp_message_archive_management_query_result_get_instance_private (self);
	self->priv->_error = FALSE;
	self->priv->_malformed = FALSE;
	self->priv->_complete = FALSE;
	self->ref_count = 1;
}

static void
xmpp_message_archive_management_query_result_finalize (XmppMessageArchiveManagementQueryResult * obj)
{
	XmppMessageArchiveManagementQueryResult * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_QUERY_RESULT, XmppMessageArchiveManagementQueryResult);
	g_signal_handlers_destroy (self);
	_g_free0 (self->priv->_first);
	_g_free0 (self->priv->_last);
}

static GType
xmpp_message_archive_management_query_result_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_message_archive_management_value_query_result_init, xmpp_message_archive_management_value_query_result_free_value, xmpp_message_archive_management_value_query_result_copy_value, xmpp_message_archive_management_value_query_result_peek_pointer, "p", xmpp_message_archive_management_value_query_result_collect_value, "p", xmpp_message_archive_management_value_query_result_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppMessageArchiveManagementQueryResultClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_message_archive_management_query_result_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppMessageArchiveManagementQueryResult), 0, (GInstanceInitFunc) xmpp_message_archive_management_query_result_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_message_archive_management_query_result_type_id;
	xmpp_message_archive_management_query_result_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppMessageArchiveManagementQueryResult", &g_define_type_info, &g_define_type_fundamental_info, 0);
	XmppMessageArchiveManagementQueryResult_private_offset = g_type_add_instance_private (xmpp_message_archive_management_query_result_type_id, sizeof (XmppMessageArchiveManagementQueryResultPrivate));
	return xmpp_message_archive_management_query_result_type_id;
}

GType
xmpp_message_archive_management_query_result_get_type (void)
{
	static volatile gsize xmpp_message_archive_management_query_result_type_id__once = 0;
	if (g_once_init_enter (&xmpp_message_archive_management_query_result_type_id__once)) {
		GType xmpp_message_archive_management_query_result_type_id;
		xmpp_message_archive_management_query_result_type_id = xmpp_message_archive_management_query_result_get_type_once ();
		g_once_init_leave (&xmpp_message_archive_management_query_result_type_id__once, xmpp_message_archive_management_query_result_type_id);
	}
	return xmpp_message_archive_management_query_result_type_id__once;
}

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

void
xmpp_message_archive_management_query_result_unref (gpointer instance)
{
	XmppMessageArchiveManagementQueryResult * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_MESSAGE_ARCHIVE_MANAGEMENT_QUERY_RESULT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
xmpp_message_archive_management_module_get_instance_private (XmppMessageArchiveManagementModule* self)
{
	return G_STRUCT_MEMBER_P (self, XmppMessageArchiveManagementModule_private_offset);
}

static void
_xmpp_message_archive_management_module_query_availability_xmpp_xmpp_stream_stream_negotiated (XmppXmppStream* _sender,
                                                                                               XmppXmppStream* stream,
                                                                                               gpointer self)
{
	xmpp_message_archive_management_module_query_availability ((XmppMessageArchiveManagementModule*) self, stream, NULL, NULL);
}

static void
xmpp_message_archive_management_module_real_attach (XmppXmppStreamModule* base,
                                                    XmppXmppStream* stream)
{
	XmppMessageArchiveManagementModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppMessageModule* _tmp2_;
	XmppStanzaListenerHolder* _tmp3_;
	XmppMessageArchiveManagementReceivedPipelineListener* _tmp4_;
	self = (XmppMessageArchiveManagementModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_message_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppMessageModule*) _tmp1_;
	_tmp3_ = _tmp2_->received_pipeline;
	_tmp4_ = self->priv->received_pipeline_listener;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp3_, (XmppOrderedListener*) _tmp4_);
	_g_object_unref0 (_tmp2_);
	g_signal_connect_object (stream, "stream-negotiated", (GCallback) _xmpp_message_archive_management_module_query_availability_xmpp_xmpp_stream_stream_negotiated, self, 0);
}

static void
xmpp_message_archive_management_module_real_detach (XmppXmppStreamModule* base,
                                                    XmppXmppStream* stream)
{
	XmppMessageArchiveManagementModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppMessageModule* _tmp2_;
	XmppStanzaListenerHolder* _tmp3_;
	XmppMessageArchiveManagementReceivedPipelineListener* _tmp4_;
	self = (XmppMessageArchiveManagementModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_message_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppMessageModule*) _tmp1_;
	_tmp3_ = _tmp2_->received_pipeline;
	_tmp4_ = self->priv->received_pipeline_listener;
	xmpp_listener_holder_disconnect ((XmppListenerHolder*) _tmp3_, (XmppOrderedListener*) _tmp4_);
	_g_object_unref0 (_tmp2_);
}

static gchar*
xmpp_message_archive_management_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppMessageArchiveManagementModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppMessageArchiveManagementModule*) base;
	_tmp0_ = g_strdup (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_message_archive_management_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppMessageArchiveManagementModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppMessageArchiveManagementModule*) base;
	_tmp0_ = xmpp_message_archive_management_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

static void
xmpp_message_archive_management_module_query_availability_data_free (gpointer _data)
{
	XmppMessageArchiveManagementModuleQueryAvailabilityData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppMessageArchiveManagementModuleQueryAvailabilityData, _data_);
}

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

static void
xmpp_message_archive_management_module_query_availability (XmppMessageArchiveManagementModule* self,
                                                           XmppXmppStream* stream,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	XmppMessageArchiveManagementModuleQueryAvailabilityData* _data_;
	XmppMessageArchiveManagementModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	_data_ = g_slice_new0 (XmppMessageArchiveManagementModuleQueryAvailabilityData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_message_archive_management_module_query_availability_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	xmpp_message_archive_management_module_query_availability_co (_data_);
}

static void
xmpp_message_archive_management_module_query_availability_finish (XmppMessageArchiveManagementModule* self,
                                                                  GAsyncResult* _res_)
{
	XmppMessageArchiveManagementModuleQueryAvailabilityData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_message_archive_management_module_query_availability_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_)
{
	XmppMessageArchiveManagementModuleQueryAvailabilityData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_message_archive_management_module_query_availability_co (_data_);
}

static gboolean
xmpp_message_archive_management_module_query_availability_co (XmppMessageArchiveManagementModuleQueryAvailabilityData* _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_jid_get_bare_jid (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->_tmp5_;
	_g_object_unref0 (_data_->_tmp2_);
	_data_->own_jid = _data_->_tmp6_;
	_data_->_tmp7_ = xmpp_xep_service_discovery_module_IDENTITY;
	_data_->_tmp8_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp7_);
	_data_->_tmp9_ = (XmppXepServiceDiscoveryModule*) _data_->_tmp8_;
	_data_->_tmp10_ = _data_->own_jid;
	_data_->_state_ = 1;
	xmpp_xep_service_discovery_module_has_entity_feature (_data_->_tmp9_, _data_->stream, _data_->_tmp10_, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI, xmpp_message_archive_management_module_query_availability_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = xmpp_xep_service_discovery_module_has_entity_feature_finish (_data_->_tmp9_, _data_->_res_);
	_g_object_unref0 (_data_->_tmp9_);
	_data_->mam_available = _data_->_tmp11_;
	if (_data_->mam_available) {
		g_signal_emit (_data_->self, xmpp_message_archive_management_module_signals[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MODULE_FEATURE_AVAILABLE_SIGNAL], 0, _data_->stream);
	}
	_xmpp_jid_unref0 (_data_->own_jid);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

XmppMessageArchiveManagementModule*
xmpp_message_archive_management_module_construct (GType object_type)
{
	XmppMessageArchiveManagementModule * self = NULL;
	self = (XmppMessageArchiveManagementModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppMessageArchiveManagementModule*
xmpp_message_archive_management_module_new (void)
{
	return xmpp_message_archive_management_module_construct (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MODULE);
}

static void
xmpp_message_archive_management_module_class_init (XmppMessageArchiveManagementModuleClass * klass,
                                                   gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_message_archive_management_module_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppMessageArchiveManagementModule_private_offset);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_message_archive_management_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_message_archive_management_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_message_archive_management_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_message_archive_management_module_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = xmpp_message_archive_management_module_finalize;
	xmpp_message_archive_management_module_signals[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MODULE_FEATURE_AVAILABLE_SIGNAL] = g_signal_new ("feature-available", XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MODULE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, XMPP_TYPE_XMPP_STREAM);
	_tmp0_ = xmpp_module_identity_new (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI, "0313_message_archive_management");
	xmpp_message_archive_management_module_IDENTITY = _tmp0_;
}

static void
xmpp_message_archive_management_module_instance_init (XmppMessageArchiveManagementModule * self,
                                                      gpointer klass)
{
	XmppMessageArchiveManagementReceivedPipelineListener* _tmp0_;
	self->priv = xmpp_message_archive_management_module_get_instance_private (self);
	_tmp0_ = xmpp_message_archive_management_received_pipeline_listener_new ();
	self->priv->received_pipeline_listener = _tmp0_;
}

static void
xmpp_message_archive_management_module_finalize (GObject * obj)
{
	XmppMessageArchiveManagementModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MODULE, XmppMessageArchiveManagementModule);
	_g_object_unref0 (self->priv->received_pipeline_listener);
	G_OBJECT_CLASS (xmpp_message_archive_management_module_parent_class)->finalize (obj);
}

static GType
xmpp_message_archive_management_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppMessageArchiveManagementModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_message_archive_management_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppMessageArchiveManagementModule), 0, (GInstanceInitFunc) xmpp_message_archive_management_module_instance_init, NULL };
	GType xmpp_message_archive_management_module_type_id;
	xmpp_message_archive_management_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppMessageArchiveManagementModule", &g_define_type_info, 0);
	XmppMessageArchiveManagementModule_private_offset = g_type_add_instance_private (xmpp_message_archive_management_module_type_id, sizeof (XmppMessageArchiveManagementModulePrivate));
	return xmpp_message_archive_management_module_type_id;
}

GType
xmpp_message_archive_management_module_get_type (void)
{
	static volatile gsize xmpp_message_archive_management_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_message_archive_management_module_type_id__once)) {
		GType xmpp_message_archive_management_module_type_id;
		xmpp_message_archive_management_module_type_id = xmpp_message_archive_management_module_get_type_once ();
		g_once_init_leave (&xmpp_message_archive_management_module_type_id__once, xmpp_message_archive_management_module_type_id);
	}
	return xmpp_message_archive_management_module_type_id__once;
}

XmppStanzaNode*
xmpp_message_archive_management_create_base_query (XmppXmppStream* stream,
                                                   const gchar* queryid,
                                                   GeeList* fields)
{
	XmppXepDataFormsDataForm* data_form = NULL;
	XmppXepDataFormsDataForm* _tmp0_;
	XmppXepDataFormsDataFormHiddenField* form_type_field = NULL;
	gchar* _tmp1_;
	XmppXepDataFormsDataFormHiddenField* _tmp2_ = NULL;
	XmppXepDataFormsDataFormHiddenField* _tmp3_;
	XmppXepDataFormsDataForm* _tmp4_;
	XmppXepDataFormsDataFormHiddenField* _tmp5_;
	XmppStanzaNode* query_node = NULL;
	XmppStanzaNode* _tmp15_;
	XmppStanzaNode* _tmp16_;
	XmppStanzaNode* _tmp17_;
	XmppStanzaNode* _tmp18_;
	XmppXepDataFormsDataForm* _tmp19_;
	XmppStanzaNode* _tmp20_;
	XmppStanzaNode* _tmp21_;
	XmppStanzaNode* _tmp22_;
	XmppStanzaNode* _tmp23_;
	XmppStanzaNode* _tmp24_;
	XmppStanzaNode* _tmp25_;
	XmppStanzaNode* result;
	g_return_val_if_fail (stream != NULL, NULL);
	g_return_val_if_fail (fields != NULL, NULL);
	_tmp0_ = xmpp_xep_data_forms_data_form_new ();
	data_form = _tmp0_;
	_tmp1_ = g_strdup ("FORM_TYPE");
	_tmp2_ = xmpp_xep_data_forms_data_form_hidden_field_new ();
	xmpp_xep_data_forms_data_form_field_set_var ((XmppXepDataFormsDataFormField*) _tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	form_type_field = _tmp2_;
	_tmp3_ = form_type_field;
	xmpp_xep_data_forms_data_form_field_set_value_string ((XmppXepDataFormsDataFormField*) _tmp3_, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI);
	_tmp4_ = data_form;
	_tmp5_ = form_type_field;
	xmpp_xep_data_forms_data_form_add_field (_tmp4_, (XmppXepDataFormsDataFormField*) _tmp5_);
	{
		GeeList* _field_list = NULL;
		gint _field_size = 0;
		GeeList* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		gint _field_index = 0;
		_field_list = fields;
		_tmp6_ = _field_list;
		_tmp7_ = gee_collection_get_size ((GeeCollection*) _tmp6_);
		_tmp8_ = _tmp7_;
		_field_size = _tmp8_;
		_field_index = -1;
		while (TRUE) {
			gint _tmp9_;
			gint _tmp10_;
			XmppXepDataFormsDataFormField* field = NULL;
			GeeList* _tmp11_;
			gpointer _tmp12_;
			XmppXepDataFormsDataForm* _tmp13_;
			XmppXepDataFormsDataFormField* _tmp14_;
			_field_index = _field_index + 1;
			_tmp9_ = _field_index;
			_tmp10_ = _field_size;
			if (!(_tmp9_ < _tmp10_)) {
				break;
			}
			_tmp11_ = _field_list;
			_tmp12_ = gee_list_get (_tmp11_, _field_index);
			field = (XmppXepDataFormsDataFormField*) _tmp12_;
			_tmp13_ = data_form;
			_tmp14_ = field;
			xmpp_xep_data_forms_data_form_add_field (_tmp13_, _tmp14_);
			_g_object_unref0 (field);
		}
	}
	_tmp15_ = xmpp_stanza_node_new_build ("query", XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI, NULL, NULL);
	_tmp16_ = _tmp15_;
	_tmp17_ = xmpp_stanza_node_add_self_xmlns (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = data_form;
	_tmp20_ = xmpp_xep_data_forms_data_form_get_submit_node (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = xmpp_stanza_node_put_node (_tmp18_, _tmp21_);
	_tmp23_ = _tmp22_;
	_xmpp_stanza_entry_unref0 (_tmp21_);
	_xmpp_stanza_entry_unref0 (_tmp18_);
	_xmpp_stanza_entry_unref0 (_tmp16_);
	query_node = _tmp23_;
	_tmp24_ = xmpp_stanza_node_put_attribute (query_node, "queryid", queryid, NULL);
	_tmp25_ = _tmp24_;
	_xmpp_stanza_entry_unref0 (_tmp25_);
	result = query_node;
	_g_object_unref0 (form_type_field);
	_xmpp_xep_data_forms_data_form_unref0 (data_form);
	return result;
}

static void
xmpp_message_archive_management_query_archive_data_free (gpointer _data)
{
	XmppMessageArchiveManagementQueryArchiveData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_jid_unref0 (_data_->mam_server);
	_xmpp_stanza_entry_unref0 (_data_->query_node);
	_g_object_unref0 (_data_->cancellable);
	_xmpp_message_archive_management_query_result_unref0 (_data_->result);
	g_slice_free (XmppMessageArchiveManagementQueryArchiveData, _data_);
}

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

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

void
xmpp_message_archive_management_query_archive (XmppXmppStream* stream,
                                               XmppJid* mam_server,
                                               XmppStanzaNode* query_node,
                                               GCancellable* cancellable,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	XmppMessageArchiveManagementQueryArchiveData* _data_;
	XmppXmppStream* _tmp0_;
	XmppJid* _tmp1_;
	XmppStanzaNode* _tmp2_;
	GCancellable* _tmp3_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (query_node != NULL);
	_data_ = g_slice_new0 (XmppMessageArchiveManagementQueryArchiveData);
	_data_->_async_result = g_task_new (NULL, cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_message_archive_management_query_archive_data_free);
	_tmp0_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (mam_server);
	_xmpp_jid_unref0 (_data_->mam_server);
	_data_->mam_server = _tmp1_;
	_tmp2_ = _xmpp_stanza_entry_ref0 (query_node);
	_xmpp_stanza_entry_unref0 (_data_->query_node);
	_data_->query_node = _tmp2_;
	_tmp3_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp3_;
	xmpp_message_archive_management_query_archive_co (_data_);
}

XmppMessageArchiveManagementQueryResult*
xmpp_message_archive_management_query_archive_finish (GAsyncResult* _res_)
{
	XmppMessageArchiveManagementQueryResult* result;
	XmppMessageArchiveManagementQueryArchiveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block15Data*
block15_data_ref (Block15Data* _data15_)
{
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}

static void
block15_data_unref (void * _userdata_)
{
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		_g_free0 (_data15_->query_id);
		_g_object_unref0 (_data15_->flag);
		g_slice_free (Block15Data, _data15_);
	}
}

static void
xmpp_message_archive_management_query_archive_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	XmppMessageArchiveManagementQueryArchiveData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_message_archive_management_query_archive_co (_data_);
}

static gboolean
__lambda32_ (Block15Data* _data15_)
{
	XmppMessageArchiveManagementFlag* _tmp0_;
	GeeSet* _tmp1_;
	GeeSet* _tmp2_;
	const gchar* _tmp3_;
	gboolean result;
	_tmp0_ = _data15_->flag;
	_tmp1_ = xmpp_message_archive_management_flag_get_active_query_ids (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _data15_->query_id;
	gee_collection_remove ((GeeCollection*) _tmp2_, _tmp3_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda32__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda32_ (self);
	return result;
}

static gboolean
xmpp_message_archive_management_query_archive_co (XmppMessageArchiveManagementQueryArchiveData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data15_ = g_slice_new0 (Block15Data);
	_data_->_data15_->_ref_count_ = 1;
	_data_->_data15_->_async_data_ = _data_;
	_data_->_tmp0_ = xmpp_message_archive_management_query_result_new ();
	_data_->res = _data_->_tmp0_;
	_data_->_tmp1_ = xmpp_message_archive_management_flag_get_flag (_data_->stream);
	_data_->_data15_->flag = _data_->_tmp1_;
	_data_->_tmp2_ = xmpp_stanza_node_get_attribute (_data_->query_node, "queryid", NULL);
	_data_->_tmp3_ = g_strdup (_data_->_tmp2_);
	_data_->_data15_->query_id = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->_data15_->flag;
	if (_data_->_tmp5_ == NULL) {
		_data_->_tmp4_ = TRUE;
	} else {
		_data_->_tmp6_ = _data_->_data15_->query_id;
		_data_->_tmp4_ = _data_->_tmp6_ == NULL;
	}
	if (_data_->_tmp4_) {
		_data_->_tmp7_ = _data_->res;
		xmpp_message_archive_management_query_result_set_error (_data_->_tmp7_, TRUE);
		_data_->result = _data_->res;
		block15_data_unref (_data_->_data15_);
		_data_->_data15_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = _data_->_data15_->flag;
	_data_->_tmp9_ = xmpp_message_archive_management_flag_get_active_query_ids (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->_data15_->query_id;
	gee_collection_add ((GeeCollection*) _data_->_tmp10_, _data_->_tmp11_);
	_data_->_tmp12_ = _xmpp_jid_ref0 (_data_->mam_server);
	_data_->_tmp13_ = NULL;
	_data_->_tmp13_ = xmpp_iq_stanza_new_set (_data_->query_node, NULL);
	xmpp_stanza_set_to ((XmppStanza*) _data_->_tmp13_, _data_->_tmp12_);
	_xmpp_jid_unref0 (_data_->_tmp12_);
	_data_->iq = _data_->_tmp13_;
	_data_->_tmp14_ = xmpp_iq_module_IDENTITY;
	_data_->_tmp15_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp14_);
	_data_->_tmp16_ = (XmppIqModule*) _data_->_tmp15_;
	_data_->_tmp17_ = _data_->iq;
	_data_->_state_ = 1;
	xmpp_iq_module_send_iq_async (_data_->_tmp16_, _data_->stream, _data_->_tmp17_, G_PRIORITY_LOW, _data_->cancellable, xmpp_message_archive_management_query_archive_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp18_ = xmpp_iq_module_send_iq_finish (_data_->_tmp16_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp19_ = _data_->_tmp18_;
	_g_object_unref0 (_data_->_tmp16_);
	_data_->result_iq = _data_->_tmp19_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->iq);
		_xmpp_message_archive_management_query_result_unref0 (_data_->res);
		block15_data_unref (_data_->_data15_);
		_data_->_data15_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp20_ = _data_->result_iq;
	_data_->_tmp21_ = ((XmppStanza*) _data_->_tmp20_)->stanza;
	_data_->_tmp22_ = xmpp_stanza_node_get_subnode (_data_->_tmp21_, "fin", XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI, FALSE);
	_data_->fin_node = _data_->_tmp22_;
	_data_->_tmp23_ = _data_->fin_node;
	if (_data_->_tmp23_ == NULL) {
		_data_->_tmp24_ = _data_->res;
		xmpp_message_archive_management_query_result_set_malformed (_data_->_tmp24_, TRUE);
		_data_->result = _data_->res;
		_xmpp_stanza_entry_unref0 (_data_->fin_node);
		_g_object_unref0 (_data_->result_iq);
		_g_object_unref0 (_data_->iq);
		block15_data_unref (_data_->_data15_);
		_data_->_data15_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp25_ = _data_->fin_node;
	_data_->_tmp26_ = xmpp_stanza_node_get_subnode (_data_->_tmp25_, "set", XMPP_RESULT_SET_MANAGEMENT_NS_URI, FALSE);
	_data_->rsm_node = _data_->_tmp26_;
	_data_->_tmp27_ = _data_->rsm_node;
	if (_data_->_tmp27_ == NULL) {
		_data_->_tmp28_ = _data_->res;
		xmpp_message_archive_management_query_result_set_malformed (_data_->_tmp28_, TRUE);
		_data_->result = _data_->res;
		_xmpp_stanza_entry_unref0 (_data_->rsm_node);
		_xmpp_stanza_entry_unref0 (_data_->fin_node);
		_g_object_unref0 (_data_->result_iq);
		_g_object_unref0 (_data_->iq);
		block15_data_unref (_data_->_data15_);
		_data_->_data15_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp29_ = _data_->res;
	_data_->_tmp30_ = _data_->rsm_node;
	_data_->_tmp31_ = xmpp_stanza_node_get_deep_string_content (_data_->_tmp30_, "first", NULL);
	xmpp_message_archive_management_query_result_set_first (_data_->_tmp29_, _data_->_tmp31_);
	_data_->_tmp32_ = _data_->res;
	_data_->_tmp33_ = _data_->rsm_node;
	_data_->_tmp34_ = xmpp_stanza_node_get_deep_string_content (_data_->_tmp33_, "last", NULL);
	xmpp_message_archive_management_query_result_set_last (_data_->_tmp32_, _data_->_tmp34_);
	_data_->_tmp35_ = _data_->res;
	_data_->_tmp36_ = xmpp_message_archive_management_query_result_get_first (_data_->_tmp35_);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_tmp38_ = _data_->res;
	_data_->_tmp39_ = xmpp_message_archive_management_query_result_get_last (_data_->_tmp38_);
	_data_->_tmp40_ = _data_->_tmp39_;
	if ((_data_->_tmp37_ == NULL) != (_data_->_tmp40_ == NULL)) {
		_data_->_tmp41_ = _data_->res;
		xmpp_message_archive_management_query_result_set_malformed (_data_->_tmp41_, TRUE);
		_data_->result = _data_->res;
		_xmpp_stanza_entry_unref0 (_data_->rsm_node);
		_xmpp_stanza_entry_unref0 (_data_->fin_node);
		_g_object_unref0 (_data_->result_iq);
		_g_object_unref0 (_data_->iq);
		block15_data_unref (_data_->_data15_);
		_data_->_data15_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp42_ = _data_->res;
	_data_->_tmp43_ = _data_->fin_node;
	xmpp_message_archive_management_query_result_set_complete (_data_->_tmp42_, xmpp_stanza_node_get_attribute_bool (_data_->_tmp43_, "complete", FALSE, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI));
	g_idle_add_full (G_PRIORITY_LOW, ___lambda32__gsource_func, block15_data_ref (_data_->_data15_), block15_data_unref);
	_data_->result = _data_->res;
	_xmpp_stanza_entry_unref0 (_data_->rsm_node);
	_xmpp_stanza_entry_unref0 (_data_->fin_node);
	_g_object_unref0 (_data_->result_iq);
	_g_object_unref0 (_data_->iq);
	block15_data_unref (_data_->_data15_);
	_data_->_data15_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static inline gpointer
xmpp_message_archive_management_received_pipeline_listener_get_instance_private (XmppMessageArchiveManagementReceivedPipelineListener* self)
{
	return G_STRUCT_MEMBER_P (self, XmppMessageArchiveManagementReceivedPipelineListener_private_offset);
}

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

static void
xmpp_message_archive_management_received_pipeline_listener_real_run (XmppStanzaListener* base,
                                                                     XmppXmppStream* stream,
                                                                     XmppMessageStanza* message,
                                                                     GAsyncReadyCallback _callback_,
                                                                     gpointer _user_data_)
{
	XmppMessageArchiveManagementReceivedPipelineListener * self;
	XmppMessageArchiveManagementReceivedPipelineListenerRunData* _data_;
	XmppMessageArchiveManagementReceivedPipelineListener* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppMessageStanza* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (message != NULL);
	self = (XmppMessageArchiveManagementReceivedPipelineListener*) base;
	_data_ = g_slice_new0 (XmppMessageArchiveManagementReceivedPipelineListenerRunData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_message_archive_management_received_pipeline_listener_real_run_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_archive_management_received_pipeline_listener_real_run_co (_data_);
}

static gboolean
xmpp_message_archive_management_received_pipeline_listener_run_finish (XmppStanzaListener* base,
                                                                       GAsyncResult* _res_)
{
	gboolean result;
	XmppMessageArchiveManagementReceivedPipelineListenerRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static gboolean
xmpp_message_archive_management_received_pipeline_listener_real_run_co (XmppMessageArchiveManagementReceivedPipelineListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_message_archive_management_flag_get_flag (_data_->stream);
	_data_->flag = _data_->_tmp0_;
	_data_->_tmp1_ = ((XmppStanza*) _data_->message)->stanza;
	_data_->_tmp2_ = xmpp_stanza_node_get_deep_subnode (_data_->_tmp1_, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI ":result", XMPP_STANZA_FORWARDING_NS_URI ":forwarded", XMPP_NS_URI ":message", NULL);
	_data_->message_node = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->message_node;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = ((XmppStanza*) _data_->message)->stanza;
		_data_->_tmp5_ = xmpp_stanza_node_get_deep_subnode (_data_->_tmp4_, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI ":result", XMPP_STANZA_FORWARDING_NS_URI ":forwarded", XMPP_XEP_DELAYED_DELIVERY_NS_URI ":delay", NULL);
		_data_->forward_node = _data_->_tmp5_;
		_data_->_tmp6_ = _data_->forward_node;
		_data_->_tmp7_ = xmpp_xep_delayed_delivery_get_time_for_node (_data_->_tmp6_);
		_data_->datetime = _data_->_tmp7_;
		_data_->_tmp8_ = ((XmppStanza*) _data_->message)->stanza;
		_data_->_tmp9_ = xmpp_stanza_node_get_deep_attribute (_data_->_tmp8_, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI ":result", XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI ":id", NULL);
		_data_->_tmp10_ = g_strdup (_data_->_tmp9_);
		_data_->mam_id = _data_->_tmp10_;
		_data_->_tmp11_ = ((XmppStanza*) _data_->message)->stanza;
		_data_->_tmp12_ = xmpp_stanza_node_get_deep_attribute (_data_->_tmp11_, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI ":result", XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI ":queryid", NULL);
		_data_->_tmp13_ = g_strdup (_data_->_tmp12_);
		_data_->query_id = _data_->_tmp13_;
		_data_->_tmp14_ = _data_->query_id;
		if (_data_->_tmp14_ == NULL) {
			_data_->_tmp15_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = _data_->_tmp16_;
			_data_->_tmp18_ = xmpp_jid_to_string (_data_->_tmp17_);
			_data_->_tmp19_ = _data_->_tmp18_;
			g_warning ("0313_message_archive_management.vala:111: Received MAM message without" \
" queryid from %s, ignoring", _data_->_tmp19_);
			_g_free0 (_data_->_tmp19_);
			_xmpp_jid_unref0 (_data_->_tmp17_);
			_data_->result = TRUE;
			_g_free0 (_data_->query_id);
			_g_free0 (_data_->mam_id);
			_g_date_time_unref0 (_data_->datetime);
			_xmpp_stanza_entry_unref0 (_data_->forward_node);
			_xmpp_stanza_entry_unref0 (_data_->message_node);
			_g_object_unref0 (_data_->flag);
			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_->_tmp20_ = _data_->flag;
		_data_->_tmp21_ = xmpp_message_archive_management_flag_get_active_query_ids (_data_->_tmp20_);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp23_ = _data_->query_id;
		if (!gee_collection_contains ((GeeCollection*) _data_->_tmp22_, _data_->_tmp23_)) {
			_data_->_tmp25_ = _data_->query_id;
			_data_->_tmp24_ = _data_->_tmp25_;
			if (_data_->_tmp24_ == NULL) {
				_data_->_tmp24_ = "<none>";
			}
			_data_->_tmp26_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
			_data_->_tmp27_ = _data_->_tmp26_;
			_data_->_tmp28_ = _data_->_tmp27_;
			_data_->_tmp29_ = xmpp_jid_to_string (_data_->_tmp28_);
			_data_->_tmp30_ = _data_->_tmp29_;
			g_warning ("0313_message_archive_management.vala:116: Received MAM message from %s" \
" with unknown query id %s, ignoring", _data_->_tmp30_, _data_->_tmp24_);
			_g_free0 (_data_->_tmp30_);
			_xmpp_jid_unref0 (_data_->_tmp28_);
			_data_->result = TRUE;
			_g_free0 (_data_->query_id);
			_g_free0 (_data_->mam_id);
			_g_date_time_unref0 (_data_->datetime);
			_xmpp_stanza_entry_unref0 (_data_->forward_node);
			_xmpp_stanza_entry_unref0 (_data_->message_node);
			_g_object_unref0 (_data_->flag);
			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_->inner_from = NULL;
		{
			_data_->_tmp32_ = _data_->message_node;
			_data_->_tmp33_ = xmpp_stanza_node_get_attribute (_data_->_tmp32_, "from", NULL);
			_data_->_tmp34_ = xmpp_jid_new (_data_->_tmp33_, &_data_->_inner_error0_);
			_data_->_tmp31_ = _data_->_tmp34_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch0_xmpp_invalid_jid_error;
				}
				_xmpp_jid_unref0 (_data_->inner_from);
				_g_free0 (_data_->query_id);
				_g_free0 (_data_->mam_id);
				_g_date_time_unref0 (_data_->datetime);
				_xmpp_stanza_entry_unref0 (_data_->forward_node);
				_xmpp_stanza_entry_unref0 (_data_->message_node);
				_g_object_unref0 (_data_->flag);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp35_ = _data_->_tmp31_;
			_data_->_tmp31_ = NULL;
			_xmpp_jid_unref0 (_data_->inner_from);
			_data_->inner_from = _data_->_tmp35_;
			_xmpp_jid_unref0 (_data_->_tmp31_);
		}
		goto __finally0;
		__catch0_xmpp_invalid_jid_error:
		{
			g_clear_error (&_data_->_inner_error0_);
			_data_->_tmp36_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
			_data_->_tmp37_ = _data_->_tmp36_;
			_data_->_tmp38_ = _data_->_tmp37_;
			_data_->_tmp39_ = xmpp_jid_to_string (_data_->_tmp38_);
			_data_->_tmp40_ = _data_->_tmp39_;
			g_warning ("0313_message_archive_management.vala:123: Received MAM message with in" \
"valid from attribute in forwarded message from %s, ignoring", _data_->_tmp40_);
			_g_free0 (_data_->_tmp40_);
			_xmpp_jid_unref0 (_data_->_tmp38_);
			_data_->result = TRUE;
			_xmpp_jid_unref0 (_data_->inner_from);
			_g_free0 (_data_->query_id);
			_g_free0 (_data_->mam_id);
			_g_date_time_unref0 (_data_->datetime);
			_xmpp_stanza_entry_unref0 (_data_->forward_node);
			_xmpp_stanza_entry_unref0 (_data_->message_node);
			_g_object_unref0 (_data_->flag);
			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;
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_xmpp_jid_unref0 (_data_->inner_from);
			_g_free0 (_data_->query_id);
			_g_free0 (_data_->mam_id);
			_g_date_time_unref0 (_data_->datetime);
			_xmpp_stanza_entry_unref0 (_data_->forward_node);
			_xmpp_stanza_entry_unref0 (_data_->message_node);
			_g_object_unref0 (_data_->flag);
			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_->_tmp42_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
		_data_->_tmp43_ = _data_->_tmp42_;
		_data_->_tmp44_ = _data_->_tmp43_;
		_data_->_tmp45_ = xmpp_bind_flag_IDENTITY;
		_data_->_tmp46_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp45_);
		_data_->_tmp47_ = (XmppBindFlag*) _data_->_tmp46_;
		_data_->_tmp48_ = _data_->_tmp47_->my_jid;
		_data_->_tmp49_ = xmpp_jid_get_bare_jid (_data_->_tmp48_);
		_data_->_tmp50_ = _data_->_tmp49_;
		_data_->_tmp51_ = _data_->_tmp50_;
		_data_->_tmp52_ = !xmpp_jid_equals (_data_->_tmp44_, _data_->_tmp51_);
		_xmpp_jid_unref0 (_data_->_tmp51_);
		_g_object_unref0 (_data_->_tmp47_);
		_xmpp_jid_unref0 (_data_->_tmp44_);
		if (_data_->_tmp52_) {
			_data_->_tmp53_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
			_data_->_tmp54_ = _data_->_tmp53_;
			_data_->_tmp55_ = _data_->_tmp54_;
			_data_->_tmp56_ = _data_->inner_from;
			_data_->_tmp41_ = !xmpp_jid_equals_bare (_data_->_tmp55_, _data_->_tmp56_);
			_xmpp_jid_unref0 (_data_->_tmp55_);
		} else {
			_data_->_tmp41_ = FALSE;
		}
		if (_data_->_tmp41_) {
			_data_->_tmp57_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
			_data_->_tmp58_ = _data_->_tmp57_;
			_data_->_tmp59_ = _data_->_tmp58_;
			_data_->_tmp60_ = xmpp_jid_to_string (_data_->_tmp59_);
			_data_->_tmp61_ = _data_->_tmp60_;
			_data_->_tmp62_ = _data_->inner_from;
			_data_->_tmp63_ = xmpp_jid_to_string (_data_->_tmp62_);
			_data_->_tmp64_ = _data_->_tmp63_;
			g_warning ("0313_message_archive_management.vala:127: Received MAM message from %s" \
" illegally impersonating %s, ignoring", _data_->_tmp61_, _data_->_tmp64_);
			_g_free0 (_data_->_tmp64_);
			_g_free0 (_data_->_tmp61_);
			_xmpp_jid_unref0 (_data_->_tmp59_);
			_data_->result = TRUE;
			_xmpp_jid_unref0 (_data_->inner_from);
			_g_free0 (_data_->query_id);
			_g_free0 (_data_->mam_id);
			_g_date_time_unref0 (_data_->datetime);
			_xmpp_stanza_entry_unref0 (_data_->forward_node);
			_xmpp_stanza_entry_unref0 (_data_->message_node);
			_g_object_unref0 (_data_->flag);
			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_->_tmp65_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
		_data_->_tmp66_ = _data_->_tmp65_;
		_data_->_tmp67_ = _data_->_tmp66_;
		_data_->_tmp68_ = _data_->datetime;
		_data_->_tmp69_ = _data_->mam_id;
		_data_->_tmp70_ = _data_->query_id;
		_data_->_tmp71_ = xmpp_message_archive_management_message_flag_new (_data_->_tmp67_, _data_->_tmp68_, _data_->_tmp69_, _data_->_tmp70_);
		_data_->_tmp72_ = _data_->_tmp71_;
		xmpp_message_stanza_add_flag (_data_->message, (XmppMessageFlag*) _data_->_tmp72_);
		_g_object_unref0 (_data_->_tmp72_);
		_xmpp_jid_unref0 (_data_->_tmp67_);
		_data_->_tmp73_ = _data_->message_node;
		_data_->_tmp74_ = _xmpp_stanza_entry_ref0 (_data_->_tmp73_);
		_xmpp_stanza_entry_unref0 (((XmppStanza*) _data_->message)->stanza);
		((XmppStanza*) _data_->message)->stanza = _data_->_tmp74_;
		_data_->message->rerun_parsing = TRUE;
		_xmpp_jid_unref0 (_data_->inner_from);
		_g_free0 (_data_->query_id);
		_g_free0 (_data_->mam_id);
		_g_date_time_unref0 (_data_->datetime);
		_xmpp_stanza_entry_unref0 (_data_->forward_node);
	}
	_data_->result = FALSE;
	_xmpp_stanza_entry_unref0 (_data_->message_node);
	_g_object_unref0 (_data_->flag);
	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;
}

XmppMessageArchiveManagementReceivedPipelineListener*
xmpp_message_archive_management_received_pipeline_listener_construct (GType object_type)
{
	XmppMessageArchiveManagementReceivedPipelineListener * self = NULL;
	self = (XmppMessageArchiveManagementReceivedPipelineListener*) xmpp_stanza_listener_construct (object_type, XMPP_TYPE_MESSAGE_STANZA, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	return self;
}

XmppMessageArchiveManagementReceivedPipelineListener*
xmpp_message_archive_management_received_pipeline_listener_new (void)
{
	return xmpp_message_archive_management_received_pipeline_listener_construct (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_RECEIVED_PIPELINE_LISTENER);
}

static const gchar*
xmpp_message_archive_management_received_pipeline_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	XmppMessageArchiveManagementReceivedPipelineListener* self;
	self = (XmppMessageArchiveManagementReceivedPipelineListener*) base;
	result = "EXTRACT_MESSAGE_1";
	return result;
}

static gchar**
xmpp_message_archive_management_received_pipeline_listener_real_get_after_actions (XmppOrderedListener* base,
                                                                                   gint* result_length1)
{
	gchar** result;
	XmppMessageArchiveManagementReceivedPipelineListener* self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	self = (XmppMessageArchiveManagementReceivedPipelineListener*) base;
	_tmp0_ = self->priv->after_actions_const;
	_tmp0__length1 = self->priv->after_actions_const_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static void
xmpp_message_archive_management_received_pipeline_listener_class_init (XmppMessageArchiveManagementReceivedPipelineListenerClass * klass,
                                                                       gpointer klass_data)
{
	xmpp_message_archive_management_received_pipeline_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppMessageArchiveManagementReceivedPipelineListener_private_offset);
	((XmppStanzaListenerClass *) klass)->run = (void (*) (XmppStanzaListener*, XmppXmppStream*, gconstpointer, GAsyncReadyCallback, gpointer)) xmpp_message_archive_management_received_pipeline_listener_real_run;
	((XmppStanzaListenerClass *) klass)->run_finish = (gboolean (*) (XmppStanzaListener*, GAsyncResult*)) xmpp_message_archive_management_received_pipeline_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) xmpp_message_archive_management_received_pipeline_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) xmpp_message_archive_management_received_pipeline_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_message_archive_management_received_pipeline_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_message_archive_management_received_pipeline_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_ACTION_GROUP_PROPERTY, xmpp_message_archive_management_received_pipeline_listener_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_ACTION_GROUP_PROPERTY] = g_param_spec_string ("action-group", "action-group", "action-group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_AFTER_ACTIONS_PROPERTY, xmpp_message_archive_management_received_pipeline_listener_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_AFTER_ACTIONS_PROPERTY] = g_param_spec_boxed ("after-actions", "after-actions", "after-actions", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_message_archive_management_received_pipeline_listener_instance_init (XmppMessageArchiveManagementReceivedPipelineListener * self,
                                                                          gpointer klass)
{
	gchar** _tmp0_;
	self->priv = xmpp_message_archive_management_received_pipeline_listener_get_instance_private (self);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	self->priv->after_actions_const = _tmp0_;
	self->priv->after_actions_const_length1 = 0;
	self->priv->_after_actions_const_size_ = self->priv->after_actions_const_length1;
}

static void
xmpp_message_archive_management_received_pipeline_listener_finalize (GObject * obj)
{
	XmppMessageArchiveManagementReceivedPipelineListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_RECEIVED_PIPELINE_LISTENER, XmppMessageArchiveManagementReceivedPipelineListener);
	self->priv->after_actions_const = (_vala_array_free (self->priv->after_actions_const, self->priv->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (xmpp_message_archive_management_received_pipeline_listener_parent_class)->finalize (obj);
}

static GType
xmpp_message_archive_management_received_pipeline_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppMessageArchiveManagementReceivedPipelineListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_message_archive_management_received_pipeline_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppMessageArchiveManagementReceivedPipelineListener), 0, (GInstanceInitFunc) xmpp_message_archive_management_received_pipeline_listener_instance_init, NULL };
	GType xmpp_message_archive_management_received_pipeline_listener_type_id;
	xmpp_message_archive_management_received_pipeline_listener_type_id = g_type_register_static (XMPP_TYPE_STANZA_LISTENER, "XmppMessageArchiveManagementReceivedPipelineListener", &g_define_type_info, 0);
	XmppMessageArchiveManagementReceivedPipelineListener_private_offset = g_type_add_instance_private (xmpp_message_archive_management_received_pipeline_listener_type_id, sizeof (XmppMessageArchiveManagementReceivedPipelineListenerPrivate));
	return xmpp_message_archive_management_received_pipeline_listener_type_id;
}

GType
xmpp_message_archive_management_received_pipeline_listener_get_type (void)
{
	static volatile gsize xmpp_message_archive_management_received_pipeline_listener_type_id__once = 0;
	if (g_once_init_enter (&xmpp_message_archive_management_received_pipeline_listener_type_id__once)) {
		GType xmpp_message_archive_management_received_pipeline_listener_type_id;
		xmpp_message_archive_management_received_pipeline_listener_type_id = xmpp_message_archive_management_received_pipeline_listener_get_type_once ();
		g_once_init_leave (&xmpp_message_archive_management_received_pipeline_listener_type_id__once, xmpp_message_archive_management_received_pipeline_listener_type_id);
	}
	return xmpp_message_archive_management_received_pipeline_listener_type_id__once;
}

static void
_vala_xmpp_message_archive_management_received_pipeline_listener_get_property (GObject * object,
                                                                               guint property_id,
                                                                               GValue * value,
                                                                               GParamSpec * pspec)
{
	XmppMessageArchiveManagementReceivedPipelineListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_RECEIVED_PIPELINE_LISTENER, XmppMessageArchiveManagementReceivedPipelineListener);
	switch (property_id) {
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_RECEIVED_PIPELINE_LISTENER_AFTER_ACTIONS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, xmpp_ordered_listener_get_after_actions ((XmppOrderedListener*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
xmpp_message_archive_management_flag_get_instance_private (XmppMessageArchiveManagementFlag* self)
{
	return G_STRUCT_MEMBER_P (self, XmppMessageArchiveManagementFlag_private_offset);
}

XmppMessageArchiveManagementFlag*
xmpp_message_archive_management_flag_get_flag (XmppXmppStream* stream)
{
	XmppMessageArchiveManagementFlag* flag = NULL;
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppMessageArchiveManagementFlag* _tmp2_;
	XmppMessageArchiveManagementFlag* result;
	g_return_val_if_fail (stream != NULL, NULL);
	_tmp0_ = xmpp_message_archive_management_flag_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_flag (stream, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	flag = (XmppMessageArchiveManagementFlag*) _tmp1_;
	_tmp2_ = flag;
	if (_tmp2_ == NULL) {
		XmppMessageArchiveManagementFlag* _tmp3_;
		XmppMessageArchiveManagementFlag* _tmp4_;
		_tmp3_ = xmpp_message_archive_management_flag_new ();
		_g_object_unref0 (flag);
		flag = _tmp3_;
		_tmp4_ = flag;
		xmpp_xmpp_stream_add_flag (stream, (XmppXmppStreamFlag*) _tmp4_);
	}
	result = flag;
	return result;
}

static gchar*
xmpp_message_archive_management_flag_real_get_ns (XmppXmppStreamFlag* base)
{
	XmppMessageArchiveManagementFlag * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppMessageArchiveManagementFlag*) base;
	_tmp0_ = g_strdup (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_message_archive_management_flag_real_get_id (XmppXmppStreamFlag* base)
{
	XmppMessageArchiveManagementFlag * self;
	XmppFlagIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppMessageArchiveManagementFlag*) base;
	_tmp0_ = xmpp_message_archive_management_flag_IDENTITY;
	_tmp1_ = xmpp_flag_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

XmppMessageArchiveManagementFlag*
xmpp_message_archive_management_flag_construct (GType object_type)
{
	XmppMessageArchiveManagementFlag * self = NULL;
	self = (XmppMessageArchiveManagementFlag*) xmpp_xmpp_stream_flag_construct (object_type);
	return self;
}

XmppMessageArchiveManagementFlag*
xmpp_message_archive_management_flag_new (void)
{
	return xmpp_message_archive_management_flag_construct (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_FLAG);
}

gboolean
xmpp_message_archive_management_flag_get_cought_up (XmppMessageArchiveManagementFlag* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_cought_up;
	return result;
}

void
xmpp_message_archive_management_flag_set_cought_up (XmppMessageArchiveManagementFlag* self,
                                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_message_archive_management_flag_get_cought_up (self);
	if (old_value != value) {
		self->priv->_cought_up = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_message_archive_management_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_COUGHT_UP_PROPERTY]);
	}
}

GeeSet*
xmpp_message_archive_management_flag_get_active_query_ids (XmppMessageArchiveManagementFlag* self)
{
	GeeSet* result;
	GeeSet* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_active_query_ids;
	result = _tmp0_;
	return result;
}

void
xmpp_message_archive_management_flag_set_active_query_ids (XmppMessageArchiveManagementFlag* self,
                                                           GeeSet* value)
{
	GeeSet* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_message_archive_management_flag_get_active_query_ids (self);
	if (old_value != value) {
		GeeSet* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_active_query_ids);
		self->priv->_active_query_ids = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_message_archive_management_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_ACTIVE_QUERY_IDS_PROPERTY]);
	}
}

static void
xmpp_message_archive_management_flag_class_init (XmppMessageArchiveManagementFlagClass * klass,
                                                 gpointer klass_data)
{
	XmppFlagIdentity* _tmp0_;
	xmpp_message_archive_management_flag_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppMessageArchiveManagementFlag_private_offset);
	((XmppXmppStreamFlagClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamFlag*)) xmpp_message_archive_management_flag_real_get_ns;
	((XmppXmppStreamFlagClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamFlag*)) xmpp_message_archive_management_flag_real_get_id;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_message_archive_management_flag_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_message_archive_management_flag_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_message_archive_management_flag_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_COUGHT_UP_PROPERTY, xmpp_message_archive_management_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_COUGHT_UP_PROPERTY] = g_param_spec_boolean ("cought-up", "cought-up", "cought-up", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_ACTIVE_QUERY_IDS_PROPERTY, xmpp_message_archive_management_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_ACTIVE_QUERY_IDS_PROPERTY] = g_param_spec_object ("active-query-ids", "active-query-ids", "active-query-ids", GEE_TYPE_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	_tmp0_ = xmpp_flag_identity_new (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI, "message_archive_management");
	xmpp_message_archive_management_flag_IDENTITY = _tmp0_;
}

static void
xmpp_message_archive_management_flag_instance_init (XmppMessageArchiveManagementFlag * self,
                                                    gpointer klass)
{
	GeeHashSet* _tmp0_;
	self->priv = xmpp_message_archive_management_flag_get_instance_private (self);
	self->priv->_cought_up = FALSE;
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->_active_query_ids = (GeeSet*) _tmp0_;
}

static void
xmpp_message_archive_management_flag_finalize (GObject * obj)
{
	XmppMessageArchiveManagementFlag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_FLAG, XmppMessageArchiveManagementFlag);
	_g_object_unref0 (self->priv->_active_query_ids);
	G_OBJECT_CLASS (xmpp_message_archive_management_flag_parent_class)->finalize (obj);
}

static GType
xmpp_message_archive_management_flag_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppMessageArchiveManagementFlagClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_message_archive_management_flag_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppMessageArchiveManagementFlag), 0, (GInstanceInitFunc) xmpp_message_archive_management_flag_instance_init, NULL };
	GType xmpp_message_archive_management_flag_type_id;
	xmpp_message_archive_management_flag_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_FLAG, "XmppMessageArchiveManagementFlag", &g_define_type_info, 0);
	XmppMessageArchiveManagementFlag_private_offset = g_type_add_instance_private (xmpp_message_archive_management_flag_type_id, sizeof (XmppMessageArchiveManagementFlagPrivate));
	return xmpp_message_archive_management_flag_type_id;
}

GType
xmpp_message_archive_management_flag_get_type (void)
{
	static volatile gsize xmpp_message_archive_management_flag_type_id__once = 0;
	if (g_once_init_enter (&xmpp_message_archive_management_flag_type_id__once)) {
		GType xmpp_message_archive_management_flag_type_id;
		xmpp_message_archive_management_flag_type_id = xmpp_message_archive_management_flag_get_type_once ();
		g_once_init_leave (&xmpp_message_archive_management_flag_type_id__once, xmpp_message_archive_management_flag_type_id);
	}
	return xmpp_message_archive_management_flag_type_id__once;
}

static void
_vala_xmpp_message_archive_management_flag_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	XmppMessageArchiveManagementFlag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_FLAG, XmppMessageArchiveManagementFlag);
	switch (property_id) {
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_COUGHT_UP_PROPERTY:
		g_value_set_boolean (value, xmpp_message_archive_management_flag_get_cought_up (self));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_ACTIVE_QUERY_IDS_PROPERTY:
		g_value_set_object (value, xmpp_message_archive_management_flag_get_active_query_ids (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_message_archive_management_flag_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	XmppMessageArchiveManagementFlag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_FLAG, XmppMessageArchiveManagementFlag);
	switch (property_id) {
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_COUGHT_UP_PROPERTY:
		xmpp_message_archive_management_flag_set_cought_up (self, g_value_get_boolean (value));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_FLAG_ACTIVE_QUERY_IDS_PROPERTY:
		xmpp_message_archive_management_flag_set_active_query_ids (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
xmpp_message_archive_management_message_flag_get_instance_private (XmppMessageArchiveManagementMessageFlag* self)
{
	return G_STRUCT_MEMBER_P (self, XmppMessageArchiveManagementMessageFlag_private_offset);
}

XmppMessageArchiveManagementMessageFlag*
xmpp_message_archive_management_message_flag_construct (GType object_type,
                                                        XmppJid* sender_jid,
                                                        GDateTime* server_time,
                                                        const gchar* mam_id,
                                                        const gchar* query_id)
{
	XmppMessageArchiveManagementMessageFlag * self = NULL;
	g_return_val_if_fail (sender_jid != NULL, NULL);
	self = (XmppMessageArchiveManagementMessageFlag*) xmpp_message_flag_construct (object_type);
	xmpp_message_archive_management_message_flag_set_sender_jid (self, sender_jid);
	xmpp_message_archive_management_message_flag_set_server_time (self, server_time);
	xmpp_message_archive_management_message_flag_set_mam_id (self, mam_id);
	xmpp_message_archive_management_message_flag_set_query_id (self, query_id);
	return self;
}

XmppMessageArchiveManagementMessageFlag*
xmpp_message_archive_management_message_flag_new (XmppJid* sender_jid,
                                                  GDateTime* server_time,
                                                  const gchar* mam_id,
                                                  const gchar* query_id)
{
	return xmpp_message_archive_management_message_flag_construct (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MESSAGE_FLAG, sender_jid, server_time, mam_id, query_id);
}

XmppMessageArchiveManagementMessageFlag*
xmpp_message_archive_management_message_flag_get_flag (XmppMessageStanza* message)
{
	XmppMessageFlag* _tmp0_;
	XmppMessageArchiveManagementMessageFlag* result;
	g_return_val_if_fail (message != NULL, NULL);
	_tmp0_ = xmpp_message_stanza_get_flag (message, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_ID);
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MESSAGE_FLAG, XmppMessageArchiveManagementMessageFlag);
	return result;
}

static gchar*
xmpp_message_archive_management_message_flag_real_get_ns (XmppMessageFlag* base)
{
	XmppMessageArchiveManagementMessageFlag * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppMessageArchiveManagementMessageFlag*) base;
	_tmp0_ = g_strdup (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_message_archive_management_message_flag_real_get_id (XmppMessageFlag* base)
{
	XmppMessageArchiveManagementMessageFlag * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppMessageArchiveManagementMessageFlag*) base;
	_tmp0_ = g_strdup (XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_ID);
	result = _tmp0_;
	return result;
}

XmppJid*
xmpp_message_archive_management_message_flag_get_sender_jid (XmppMessageArchiveManagementMessageFlag* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sender_jid;
	result = _tmp0_;
	return result;
}

static void
xmpp_message_archive_management_message_flag_set_sender_jid (XmppMessageArchiveManagementMessageFlag* self,
                                                             XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_message_archive_management_message_flag_get_sender_jid (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_sender_jid);
		self->priv->_sender_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SENDER_JID_PROPERTY]);
	}
}

GDateTime*
xmpp_message_archive_management_message_flag_get_server_time (XmppMessageArchiveManagementMessageFlag* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_server_time;
	result = _tmp0_;
	return result;
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

static void
xmpp_message_archive_management_message_flag_set_server_time (XmppMessageArchiveManagementMessageFlag* self,
                                                              GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_message_archive_management_message_flag_get_server_time (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_server_time);
		self->priv->_server_time = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SERVER_TIME_PROPERTY]);
	}
}

const gchar*
xmpp_message_archive_management_message_flag_get_mam_id (XmppMessageArchiveManagementMessageFlag* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_mam_id;
	result = _tmp0_;
	return result;
}

static void
xmpp_message_archive_management_message_flag_set_mam_id (XmppMessageArchiveManagementMessageFlag* self,
                                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_message_archive_management_message_flag_get_mam_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_mam_id);
		self->priv->_mam_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_MAM_ID_PROPERTY]);
	}
}

const gchar*
xmpp_message_archive_management_message_flag_get_query_id (XmppMessageArchiveManagementMessageFlag* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_query_id;
	result = _tmp0_;
	return result;
}

static void
xmpp_message_archive_management_message_flag_set_query_id (XmppMessageArchiveManagementMessageFlag* self,
                                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_message_archive_management_message_flag_get_query_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_query_id);
		self->priv->_query_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_QUERY_ID_PROPERTY]);
	}
}

static void
xmpp_message_archive_management_message_flag_class_init (XmppMessageArchiveManagementMessageFlagClass * klass,
                                                         gpointer klass_data)
{
	xmpp_message_archive_management_message_flag_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppMessageArchiveManagementMessageFlag_private_offset);
	((XmppMessageFlagClass *) klass)->get_ns = (gchar* (*) (XmppMessageFlag*)) xmpp_message_archive_management_message_flag_real_get_ns;
	((XmppMessageFlagClass *) klass)->get_id = (gchar* (*) (XmppMessageFlag*)) xmpp_message_archive_management_message_flag_real_get_id;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_message_archive_management_message_flag_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_message_archive_management_message_flag_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_message_archive_management_message_flag_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SENDER_JID_PROPERTY, xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SENDER_JID_PROPERTY] = xmpp_param_spec_jid ("sender-jid", "sender-jid", "sender-jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SERVER_TIME_PROPERTY, xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SERVER_TIME_PROPERTY] = g_param_spec_boxed ("server-time", "server-time", "server-time", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_MAM_ID_PROPERTY, xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_MAM_ID_PROPERTY] = g_param_spec_string ("mam-id", "mam-id", "mam-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_QUERY_ID_PROPERTY, xmpp_message_archive_management_message_flag_properties[XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_QUERY_ID_PROPERTY] = g_param_spec_string ("query-id", "query-id", "query-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_message_archive_management_message_flag_instance_init (XmppMessageArchiveManagementMessageFlag * self,
                                                            gpointer klass)
{
	self->priv = xmpp_message_archive_management_message_flag_get_instance_private (self);
}

static void
xmpp_message_archive_management_message_flag_finalize (GObject * obj)
{
	XmppMessageArchiveManagementMessageFlag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MESSAGE_FLAG, XmppMessageArchiveManagementMessageFlag);
	_xmpp_jid_unref0 (self->priv->_sender_jid);
	_g_date_time_unref0 (self->priv->_server_time);
	_g_free0 (self->priv->_mam_id);
	_g_free0 (self->priv->_query_id);
	G_OBJECT_CLASS (xmpp_message_archive_management_message_flag_parent_class)->finalize (obj);
}

static GType
xmpp_message_archive_management_message_flag_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppMessageArchiveManagementMessageFlagClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_message_archive_management_message_flag_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppMessageArchiveManagementMessageFlag), 0, (GInstanceInitFunc) xmpp_message_archive_management_message_flag_instance_init, NULL };
	GType xmpp_message_archive_management_message_flag_type_id;
	xmpp_message_archive_management_message_flag_type_id = g_type_register_static (XMPP_TYPE_MESSAGE_FLAG, "XmppMessageArchiveManagementMessageFlag", &g_define_type_info, 0);
	XmppMessageArchiveManagementMessageFlag_private_offset = g_type_add_instance_private (xmpp_message_archive_management_message_flag_type_id, sizeof (XmppMessageArchiveManagementMessageFlagPrivate));
	return xmpp_message_archive_management_message_flag_type_id;
}

GType
xmpp_message_archive_management_message_flag_get_type (void)
{
	static volatile gsize xmpp_message_archive_management_message_flag_type_id__once = 0;
	if (g_once_init_enter (&xmpp_message_archive_management_message_flag_type_id__once)) {
		GType xmpp_message_archive_management_message_flag_type_id;
		xmpp_message_archive_management_message_flag_type_id = xmpp_message_archive_management_message_flag_get_type_once ();
		g_once_init_leave (&xmpp_message_archive_management_message_flag_type_id__once, xmpp_message_archive_management_message_flag_type_id);
	}
	return xmpp_message_archive_management_message_flag_type_id__once;
}

static void
_vala_xmpp_message_archive_management_message_flag_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec)
{
	XmppMessageArchiveManagementMessageFlag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MESSAGE_FLAG, XmppMessageArchiveManagementMessageFlag);
	switch (property_id) {
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SENDER_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_message_archive_management_message_flag_get_sender_jid (self));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SERVER_TIME_PROPERTY:
		g_value_set_boxed (value, xmpp_message_archive_management_message_flag_get_server_time (self));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_MAM_ID_PROPERTY:
		g_value_set_string (value, xmpp_message_archive_management_message_flag_get_mam_id (self));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_QUERY_ID_PROPERTY:
		g_value_set_string (value, xmpp_message_archive_management_message_flag_get_query_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_message_archive_management_message_flag_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec)
{
	XmppMessageArchiveManagementMessageFlag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_TYPE_MESSAGE_FLAG, XmppMessageArchiveManagementMessageFlag);
	switch (property_id) {
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SENDER_JID_PROPERTY:
		xmpp_message_archive_management_message_flag_set_sender_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_SERVER_TIME_PROPERTY:
		xmpp_message_archive_management_message_flag_set_server_time (self, g_value_get_boxed (value));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_MAM_ID_PROPERTY:
		xmpp_message_archive_management_message_flag_set_mam_id (self, g_value_get_string (value));
		break;
		case XMPP_MESSAGE_ARCHIVE_MANAGEMENT_MESSAGE_FLAG_QUERY_ID_PROPERTY:
		xmpp_message_archive_management_message_flag_set_query_id (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

