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

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

#define XMPP_XEP_BOOKMARKS_NS_URI "storage:bookmarks"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	XMPP_XEP_BOOKMARKS_MODULE_0_PROPERTY,
	XMPP_XEP_BOOKMARKS_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_bookmarks_module_properties[XMPP_XEP_BOOKMARKS_MODULE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
typedef struct _XmppXepBookmarksModuleGetConferencesData XmppXepBookmarksModuleGetConferencesData;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _XmppXepBookmarksModuleSetConferencesData XmppXepBookmarksModuleSetConferencesData;
typedef struct _XmppXepBookmarksModuleAddConferenceData XmppXepBookmarksModuleAddConferenceData;
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
typedef struct _XmppXepBookmarksModuleReplaceConferenceData XmppXepBookmarksModuleReplaceConferenceData;
typedef struct _XmppXepBookmarksModuleRemoveConferenceData XmppXepBookmarksModuleRemoveConferenceData;

struct _XmppXepBookmarksModuleGetConferencesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepBookmarksModule* self;
	XmppXmppStream* stream;
	GeeSet* result;
	XmppStanzaNode* get_node;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* result_node;
	XmppModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	XmppXepPrivateXmlStorageModule* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	GeeSet* ret;
	GeeHashSet* _tmp11_;
	GeeList* conferences_node;
	XmppStanzaNode* _tmp12_;
	XmppStanzaNode* _tmp13_;
	XmppStanzaNode* _tmp14_;
	GeeList* _tmp15_;
	GeeList* _tmp16_;
	GeeList* _conference_node_list;
	GeeList* _tmp17_;
	gint _conference_node_size;
	GeeList* _tmp18_;
	gint _tmp19_;
	gint _tmp20_;
	gint _conference_node_index;
	gint _tmp21_;
	gint _tmp22_;
	XmppStanzaNode* conference_node;
	GeeList* _tmp23_;
	gpointer _tmp24_;
	XmppConference* conference;
	XmppStanzaNode* _tmp25_;
	XmppConference* _tmp26_;
	GeeSet* _tmp27_;
	XmppConference* _tmp28_;
};

struct _XmppXepBookmarksModuleSetConferencesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepBookmarksModule* self;
	XmppXmppStream* stream;
	GeeSet* conferences;
	XmppStanzaNode* storage_node;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	GeeIterator* _conference_it;
	GeeIterator* _tmp4_;
	GeeIterator* _tmp5_;
	XmppConference* conference;
	GeeIterator* _tmp6_;
	gpointer _tmp7_;
	XmppXepBookmarksBookmarks1Conference* bookmarks1conference;
	XmppConference* _tmp8_;
	XmppXepBookmarksBookmarks1Conference* _tmp9_;
	XmppXepBookmarksBookmarks1Conference* _tmp10_;
	XmppStanzaNode* _tmp11_;
	XmppXepBookmarksBookmarks1Conference* _tmp12_;
	XmppStanzaNode* _tmp13_;
	XmppStanzaNode* _tmp14_;
	XmppStanzaNode* _tmp15_;
	const gchar* _tmp16_;
	XmppConference* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	XmppStanzaNode* conference_node;
	XmppStanzaNode* _tmp20_;
	XmppStanzaNode* _tmp21_;
	XmppConference* _tmp22_;
	XmppJid* _tmp23_;
	XmppJid* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	XmppStanzaNode* _tmp27_;
	XmppStanzaNode* _tmp28_;
	XmppStanzaNode* _tmp29_;
	XmppStanzaNode* _tmp30_;
	XmppConference* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	XmppStanzaNode* _tmp34_;
	XmppConference* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	XmppStanzaNode* _tmp38_;
	XmppStanzaNode* _tmp39_;
	XmppConference* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	XmppStanzaNode* _tmp43_;
	XmppStanzaNode* _tmp44_;
	XmppStanzaNode* _tmp45_;
	XmppConference* _tmp46_;
	const gchar* _tmp47_;
	const gchar* _tmp48_;
	XmppStanzaNode* _tmp49_;
	XmppStanzaNode* _tmp50_;
	XmppStanzaNode* _tmp51_;
	XmppStanzaNode* _tmp52_;
	XmppStanzaNode* _tmp53_;
	XmppStanzaNode* _tmp54_;
	XmppStanzaNode* _tmp55_;
	XmppStanzaNode* _tmp56_;
	XmppStanzaNode* _tmp57_;
	XmppStanzaNode* _tmp58_;
	XmppModuleIdentity* _tmp59_;
	gpointer _tmp60_;
	XmppXepPrivateXmlStorageModule* _tmp61_;
	XmppStanzaNode* _tmp62_;
	XmppModuleIdentity* _tmp63_;
	gpointer _tmp64_;
	XmppXepBookmarksModule* _tmp65_;
};

struct _XmppXepBookmarksModuleAddConferenceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepBookmarksModule* self;
	XmppXmppStream* stream;
	XmppConference* conference;
	GeeSet* conferences;
	GeeSet* _tmp0_;
};

struct _XmppXepBookmarksModuleReplaceConferenceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepBookmarksModule* self;
	XmppXmppStream* stream;
	XmppJid* muc_jid;
	XmppConference* modified_conference;
	GeeSet* conferences;
	GeeSet* _tmp0_;
	GeeIterator* _conference_it;
	GeeSet* _tmp1_;
	GeeIterator* _tmp2_;
	GeeIterator* _tmp3_;
	XmppConference* conference;
	GeeIterator* _tmp4_;
	gpointer _tmp5_;
	XmppConference* _tmp6_;
	XmppJid* _tmp7_;
	XmppJid* _tmp8_;
	XmppConference* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	XmppConference* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	XmppConference* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	XmppConference* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	GeeSet* _tmp21_;
};

struct _XmppXepBookmarksModuleRemoveConferenceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepBookmarksModule* self;
	XmppXmppStream* stream;
	XmppConference* conference_remove;
	GeeSet* conferences;
	GeeSet* _tmp0_;
};

static gpointer xmpp_xep_bookmarks_module_parent_class = NULL;
XmppModuleIdentity* xmpp_xep_bookmarks_module_IDENTITY = NULL;
static XmppBookmarksProviderIface * xmpp_xep_bookmarks_module_xmpp_bookmarks_provider_parent_iface = NULL;

static void xmpp_xep_bookmarks_module_real_get_conferences_data_free (gpointer _data);
static void xmpp_xep_bookmarks_module_real_get_conferences (XmppBookmarksProvider* base,
                                                     XmppXmppStream* stream,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static gboolean xmpp_xep_bookmarks_module_real_get_conferences_co (XmppXepBookmarksModuleGetConferencesData* _data_);
static void xmpp_xep_bookmarks_module_get_conferences_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static guint _xmpp_conference_hash_func_gee_hash_data_func (gconstpointer v,
                                                     gpointer self);
static gboolean _xmpp_conference_equals_func_gee_equal_data_func (gconstpointer a,
                                                           gconstpointer b,
                                                           gpointer self);
static void xmpp_xep_bookmarks_module_set_conferences_data_free (gpointer _data);
static void xmpp_xep_bookmarks_module_set_conferences (XmppXepBookmarksModule* self,
                                                XmppXmppStream* stream,
                                                GeeSet* conferences,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static void xmpp_xep_bookmarks_module_set_conferences_finish (XmppXepBookmarksModule* self,
                                                       GAsyncResult* _res_);
static gboolean xmpp_xep_bookmarks_module_set_conferences_co (XmppXepBookmarksModuleSetConferencesData* _data_);
static void xmpp_xep_bookmarks_module_set_conferences_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void xmpp_xep_bookmarks_module_real_add_conference_data_free (gpointer _data);
static void xmpp_xep_bookmarks_module_real_add_conference (XmppBookmarksProvider* base,
                                                    XmppXmppStream* stream,
                                                    XmppConference* conference,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static gboolean xmpp_xep_bookmarks_module_real_add_conference_co (XmppXepBookmarksModuleAddConferenceData* _data_);
static void xmpp_xep_bookmarks_module_add_conference_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static void xmpp_xep_bookmarks_module_real_replace_conference_data_free (gpointer _data);
static void xmpp_xep_bookmarks_module_real_replace_conference (XmppBookmarksProvider* base,
                                                        XmppXmppStream* stream,
                                                        XmppJid* muc_jid,
                                                        XmppConference* modified_conference,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_);
static gboolean xmpp_xep_bookmarks_module_real_replace_conference_co (XmppXepBookmarksModuleReplaceConferenceData* _data_);
static void xmpp_xep_bookmarks_module_replace_conference_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void xmpp_xep_bookmarks_module_real_remove_conference_data_free (gpointer _data);
static void xmpp_xep_bookmarks_module_real_remove_conference (XmppBookmarksProvider* base,
                                                       XmppXmppStream* stream,
                                                       XmppConference* conference_remove,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_);
static gboolean xmpp_xep_bookmarks_module_real_remove_conference_co (XmppXepBookmarksModuleRemoveConferenceData* _data_);
static void xmpp_xep_bookmarks_module_remove_conference_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void xmpp_xep_bookmarks_module_real_attach (XmppXmppStreamModule* base,
                                            XmppXmppStream* stream);
static void xmpp_xep_bookmarks_module_real_detach (XmppXmppStreamModule* base,
                                            XmppXmppStream* stream);
static gchar* xmpp_xep_bookmarks_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_xep_bookmarks_module_real_get_id (XmppXmppStreamModule* base);
static void xmpp_xep_bookmarks_module_finalize (GObject * obj);
static GType xmpp_xep_bookmarks_module_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static void
xmpp_xep_bookmarks_module_real_get_conferences_data_free (gpointer _data)
{
	XmppXepBookmarksModuleGetConferencesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepBookmarksModuleGetConferencesData, _data_);
}

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

static void
xmpp_xep_bookmarks_module_real_get_conferences (XmppBookmarksProvider* base,
                                                XmppXmppStream* stream,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	XmppXepBookmarksModule * self;
	XmppXepBookmarksModuleGetConferencesData* _data_;
	XmppXepBookmarksModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	g_return_if_fail (stream != NULL);
	self = (XmppXepBookmarksModule*) base;
	_data_ = g_slice_new0 (XmppXepBookmarksModuleGetConferencesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_bookmarks_module_real_get_conferences_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	xmpp_xep_bookmarks_module_real_get_conferences_co (_data_);
}

static GeeSet*
xmpp_xep_bookmarks_module_get_conferences_finish (XmppBookmarksProvider* base,
                                                  GAsyncResult* _res_)
{
	GeeSet* result;
	XmppXepBookmarksModuleGetConferencesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_xep_bookmarks_module_get_conferences_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	XmppXepBookmarksModuleGetConferencesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks_module_real_get_conferences_co (_data_);
}

static guint
_xmpp_conference_hash_func_gee_hash_data_func (gconstpointer v,
                                               gpointer self)
{
	guint result;
	result = xmpp_conference_hash_func ((XmppConference*) v);
	return result;
}

static gboolean
_xmpp_conference_equals_func_gee_equal_data_func (gconstpointer a,
                                                  gconstpointer b,
                                                  gpointer self)
{
	gboolean result;
	result = xmpp_conference_equals_func ((XmppConference*) a, (XmppConference*) b);
	return result;
}

static gboolean
xmpp_xep_bookmarks_module_real_get_conferences_co (XmppXepBookmarksModuleGetConferencesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_stanza_node_new_build ("storage", XMPP_XEP_BOOKMARKS_NS_URI, NULL, NULL);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_xmpp_stanza_entry_unref0 (_data_->_tmp1_);
	_data_->get_node = _data_->_tmp3_;
	_data_->_tmp4_ = xmpp_xep_private_xml_storage_module_IDENTITY;
	_data_->_tmp5_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_PRIVATE_XML_STORAGE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp4_);
	_data_->_tmp6_ = (XmppXepPrivateXmlStorageModule*) _data_->_tmp5_;
	_data_->_tmp7_ = _data_->get_node;
	_data_->_state_ = 1;
	xmpp_xep_private_xml_storage_module_retrieve (_data_->_tmp6_, _data_->stream, _data_->_tmp7_, xmpp_xep_bookmarks_module_get_conferences_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = xmpp_xep_private_xml_storage_module_retrieve_finish (_data_->_tmp6_, _data_->_res_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_object_unref0 (_data_->_tmp6_);
	_data_->result_node = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->result_node;
	if (_data_->_tmp10_ == NULL) {
		_data_->result = NULL;
		_xmpp_stanza_entry_unref0 (_data_->result_node);
		_xmpp_stanza_entry_unref0 (_data_->get_node);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = gee_hash_set_new (XMPP_TYPE_CONFERENCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_conference_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_conference_equals_func_gee_equal_data_func, NULL, NULL);
	_data_->ret = (GeeSet*) _data_->_tmp11_;
	_data_->_tmp12_ = _data_->result_node;
	_data_->_tmp13_ = xmpp_stanza_node_get_subnode (_data_->_tmp12_, "storage", XMPP_XEP_BOOKMARKS_NS_URI, FALSE);
	_data_->_tmp14_ = _data_->_tmp13_;
	_data_->_tmp15_ = xmpp_stanza_node_get_subnodes (_data_->_tmp14_, "conference", XMPP_XEP_BOOKMARKS_NS_URI, FALSE);
	_data_->_tmp16_ = _data_->_tmp15_;
	_xmpp_stanza_entry_unref0 (_data_->_tmp14_);
	_data_->conferences_node = _data_->_tmp16_;
	{
		_data_->_tmp17_ = _data_->conferences_node;
		_data_->_conference_node_list = _data_->_tmp17_;
		_data_->_tmp18_ = _data_->_conference_node_list;
		_data_->_tmp19_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp18_);
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_conference_node_size = _data_->_tmp20_;
		_data_->_conference_node_index = -1;
		while (TRUE) {
			_data_->_conference_node_index = _data_->_conference_node_index + 1;
			_data_->_tmp21_ = _data_->_conference_node_index;
			_data_->_tmp22_ = _data_->_conference_node_size;
			if (!(_data_->_tmp21_ < _data_->_tmp22_)) {
				break;
			}
			_data_->_tmp23_ = _data_->_conference_node_list;
			_data_->_tmp24_ = gee_list_get (_data_->_tmp23_, _data_->_conference_node_index);
			_data_->conference_node = (XmppStanzaNode*) _data_->_tmp24_;
			_data_->_tmp25_ = _data_->conference_node;
			_data_->_tmp26_ = xmpp_xep_bookmarks_bookmarks1_conference_create_from_stanza_node (_data_->_tmp25_);
			_data_->conference = _data_->_tmp26_;
			_data_->_tmp27_ = _data_->ret;
			_data_->_tmp28_ = _data_->conference;
			gee_collection_add ((GeeCollection*) _data_->_tmp27_, _data_->_tmp28_);
			_g_object_unref0 (_data_->conference);
			_xmpp_stanza_entry_unref0 (_data_->conference_node);
		}
	}
	_data_->result = _data_->ret;
	_g_object_unref0 (_data_->conferences_node);
	_xmpp_stanza_entry_unref0 (_data_->result_node);
	_xmpp_stanza_entry_unref0 (_data_->get_node);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_bookmarks_module_set_conferences_data_free (gpointer _data)
{
	XmppXepBookmarksModuleSetConferencesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->conferences);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepBookmarksModuleSetConferencesData, _data_);
}

static void
xmpp_xep_bookmarks_module_set_conferences (XmppXepBookmarksModule* self,
                                           XmppXmppStream* stream,
                                           GeeSet* conferences,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	XmppXepBookmarksModuleSetConferencesData* _data_;
	XmppXepBookmarksModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	GeeSet* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (conferences != NULL);
	_data_ = g_slice_new0 (XmppXepBookmarksModuleSetConferencesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_bookmarks_module_set_conferences_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 (conferences);
	_g_object_unref0 (_data_->conferences);
	_data_->conferences = _tmp2_;
	xmpp_xep_bookmarks_module_set_conferences_co (_data_);
}

static void
xmpp_xep_bookmarks_module_set_conferences_finish (XmppXepBookmarksModule* self,
                                                  GAsyncResult* _res_)
{
	XmppXepBookmarksModuleSetConferencesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_bookmarks_module_set_conferences_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	XmppXepBookmarksModuleSetConferencesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks_module_set_conferences_co (_data_);
}

static gboolean
xmpp_xep_bookmarks_module_set_conferences_co (XmppXepBookmarksModuleSetConferencesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_stanza_node_new_build ("storage", XMPP_XEP_BOOKMARKS_NS_URI, NULL, NULL);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_xmpp_stanza_entry_unref0 (_data_->_tmp1_);
	_data_->storage_node = _data_->_tmp3_;
	{
		_data_->_tmp4_ = gee_iterable_iterator ((GeeIterable*) _data_->conferences);
		_data_->_conference_it = _data_->_tmp4_;
		while (TRUE) {
			_data_->_tmp5_ = _data_->_conference_it;
			if (!gee_iterator_next (_data_->_tmp5_)) {
				break;
			}
			_data_->_tmp6_ = _data_->_conference_it;
			_data_->_tmp7_ = gee_iterator_get (_data_->_tmp6_);
			_data_->conference = (XmppConference*) _data_->_tmp7_;
			_data_->_tmp8_ = _data_->conference;
			_data_->_tmp9_ = _g_object_ref0 (XMPP_XEP_BOOKMARKS_IS_BOOKMARKS1_CONFERENCE (_data_->_tmp8_) ? ((XmppXepBookmarksBookmarks1Conference*) _data_->_tmp8_) : NULL);
			_data_->bookmarks1conference = _data_->_tmp9_;
			_data_->_tmp10_ = _data_->bookmarks1conference;
			if (_data_->_tmp10_ != NULL) {
				_data_->_tmp11_ = _data_->storage_node;
				_data_->_tmp12_ = _data_->bookmarks1conference;
				_data_->_tmp13_ = _data_->_tmp12_->stanza_node;
				_data_->_tmp14_ = xmpp_stanza_node_put_node (_data_->_tmp11_, _data_->_tmp13_);
				_data_->_tmp15_ = _data_->_tmp14_;
				_xmpp_stanza_entry_unref0 (_data_->_tmp15_);
			} else {
				_data_->_tmp17_ = _data_->conference;
				_data_->_tmp18_ = xmpp_conference_get_autojoin (_data_->_tmp17_);
				_data_->_tmp19_ = _data_->_tmp18_;
				if (_data_->_tmp19_) {
					_data_->_tmp16_ = "true";
				} else {
					_data_->_tmp16_ = "false";
				}
				_data_->_tmp20_ = xmpp_stanza_node_new_build ("conference", XMPP_XEP_BOOKMARKS_NS_URI, NULL, NULL);
				_data_->_tmp21_ = _data_->_tmp20_;
				_data_->_tmp22_ = _data_->conference;
				_data_->_tmp23_ = xmpp_conference_get_jid (_data_->_tmp22_);
				_data_->_tmp24_ = _data_->_tmp23_;
				_data_->_tmp25_ = xmpp_jid_to_string (_data_->_tmp24_);
				_data_->_tmp26_ = _data_->_tmp25_;
				_data_->_tmp27_ = xmpp_stanza_node_put_attribute (_data_->_tmp21_, "jid", _data_->_tmp26_, NULL);
				_data_->_tmp28_ = _data_->_tmp27_;
				_data_->_tmp29_ = xmpp_stanza_node_put_attribute (_data_->_tmp28_, "autojoin", _data_->_tmp16_, NULL);
				_data_->_tmp30_ = _data_->_tmp29_;
				_xmpp_stanza_entry_unref0 (_data_->_tmp28_);
				_g_free0 (_data_->_tmp26_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp21_);
				_data_->conference_node = _data_->_tmp30_;
				_data_->_tmp31_ = _data_->conference;
				_data_->_tmp32_ = xmpp_conference_get_name (_data_->_tmp31_);
				_data_->_tmp33_ = _data_->_tmp32_;
				if (_data_->_tmp33_ != NULL) {
					_data_->_tmp34_ = _data_->conference_node;
					_data_->_tmp35_ = _data_->conference;
					_data_->_tmp36_ = xmpp_conference_get_name (_data_->_tmp35_);
					_data_->_tmp37_ = _data_->_tmp36_;
					_data_->_tmp38_ = xmpp_stanza_node_put_attribute (_data_->_tmp34_, "name", _data_->_tmp37_, NULL);
					_data_->_tmp39_ = _data_->_tmp38_;
					_xmpp_stanza_entry_unref0 (_data_->_tmp39_);
				}
				_data_->_tmp40_ = _data_->conference;
				_data_->_tmp41_ = xmpp_conference_get_nick (_data_->_tmp40_);
				_data_->_tmp42_ = _data_->_tmp41_;
				if (_data_->_tmp42_ != NULL) {
					_data_->_tmp43_ = _data_->conference_node;
					_data_->_tmp44_ = xmpp_stanza_node_new_build ("nick", XMPP_XEP_BOOKMARKS_NS_URI, NULL, NULL);
					_data_->_tmp45_ = _data_->_tmp44_;
					_data_->_tmp46_ = _data_->conference;
					_data_->_tmp47_ = xmpp_conference_get_nick (_data_->_tmp46_);
					_data_->_tmp48_ = _data_->_tmp47_;
					_data_->_tmp49_ = xmpp_stanza_node_new_text (_data_->_tmp48_);
					_data_->_tmp50_ = _data_->_tmp49_;
					_data_->_tmp51_ = xmpp_stanza_node_put_node (_data_->_tmp45_, _data_->_tmp50_);
					_data_->_tmp52_ = _data_->_tmp51_;
					_data_->_tmp53_ = xmpp_stanza_node_put_node (_data_->_tmp43_, _data_->_tmp52_);
					_data_->_tmp54_ = _data_->_tmp53_;
					_xmpp_stanza_entry_unref0 (_data_->_tmp54_);
					_xmpp_stanza_entry_unref0 (_data_->_tmp52_);
					_xmpp_stanza_entry_unref0 (_data_->_tmp50_);
					_xmpp_stanza_entry_unref0 (_data_->_tmp45_);
				}
				_data_->_tmp55_ = _data_->storage_node;
				_data_->_tmp56_ = _data_->conference_node;
				_data_->_tmp57_ = xmpp_stanza_node_put_node (_data_->_tmp55_, _data_->_tmp56_);
				_data_->_tmp58_ = _data_->_tmp57_;
				_xmpp_stanza_entry_unref0 (_data_->_tmp58_);
				_xmpp_stanza_entry_unref0 (_data_->conference_node);
			}
			_g_object_unref0 (_data_->bookmarks1conference);
			_g_object_unref0 (_data_->conference);
		}
		_g_object_unref0 (_data_->_conference_it);
	}
	_data_->_tmp59_ = xmpp_xep_private_xml_storage_module_IDENTITY;
	_data_->_tmp60_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_PRIVATE_XML_STORAGE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp59_);
	_data_->_tmp61_ = (XmppXepPrivateXmlStorageModule*) _data_->_tmp60_;
	_data_->_tmp62_ = _data_->storage_node;
	_data_->_state_ = 1;
	xmpp_xep_private_xml_storage_module_store (_data_->_tmp61_, _data_->stream, _data_->_tmp62_, xmpp_xep_bookmarks_module_set_conferences_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_xep_private_xml_storage_module_store_finish (_data_->_tmp61_, _data_->_res_);
	_g_object_unref0 (_data_->_tmp61_);
	_data_->_tmp63_ = xmpp_xep_bookmarks_module_IDENTITY;
	_data_->_tmp64_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_BOOKMARKS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp63_);
	_data_->_tmp65_ = (XmppXepBookmarksModule*) _data_->_tmp64_;
	g_signal_emit_by_name ((XmppBookmarksProvider*) _data_->_tmp65_, "received-conferences", _data_->stream, _data_->conferences);
	_g_object_unref0 (_data_->_tmp65_);
	_xmpp_stanza_entry_unref0 (_data_->storage_node);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_bookmarks_module_real_add_conference_data_free (gpointer _data)
{
	XmppXepBookmarksModuleAddConferenceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->conference);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepBookmarksModuleAddConferenceData, _data_);
}

static void
xmpp_xep_bookmarks_module_real_add_conference (XmppBookmarksProvider* base,
                                               XmppXmppStream* stream,
                                               XmppConference* conference,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	XmppXepBookmarksModule * self;
	XmppXepBookmarksModuleAddConferenceData* _data_;
	XmppXepBookmarksModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppConference* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (conference != NULL);
	self = (XmppXepBookmarksModule*) base;
	_data_ = g_slice_new0 (XmppXepBookmarksModuleAddConferenceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_bookmarks_module_real_add_conference_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 (conference);
	_g_object_unref0 (_data_->conference);
	_data_->conference = _tmp2_;
	xmpp_xep_bookmarks_module_real_add_conference_co (_data_);
}

static void
xmpp_xep_bookmarks_module_add_conference_finish (XmppBookmarksProvider* base,
                                                 GAsyncResult* _res_)
{
	XmppXepBookmarksModuleAddConferenceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_bookmarks_module_add_conference_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	XmppXepBookmarksModuleAddConferenceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks_module_real_add_conference_co (_data_);
}

static gboolean
xmpp_xep_bookmarks_module_real_add_conference_co (XmppXepBookmarksModuleAddConferenceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	xmpp_bookmarks_provider_get_conferences ((XmppBookmarksProvider*) _data_->self, _data_->stream, xmpp_xep_bookmarks_module_add_conference_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = xmpp_bookmarks_provider_get_conferences_finish ((XmppBookmarksProvider*) _data_->self, _data_->_res_);
	_data_->conferences = _data_->_tmp0_;
	gee_collection_add ((GeeCollection*) _data_->conferences, _data_->conference);
	_data_->_state_ = 2;
	xmpp_xep_bookmarks_module_set_conferences (_data_->self, _data_->stream, _data_->conferences, xmpp_xep_bookmarks_module_add_conference_ready, _data_);
	return FALSE;
	_state_2:
	xmpp_xep_bookmarks_module_set_conferences_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->conferences);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_bookmarks_module_real_replace_conference_data_free (gpointer _data)
{
	XmppXepBookmarksModuleReplaceConferenceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_jid_unref0 (_data_->muc_jid);
	_g_object_unref0 (_data_->modified_conference);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepBookmarksModuleReplaceConferenceData, _data_);
}

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

static void
xmpp_xep_bookmarks_module_real_replace_conference (XmppBookmarksProvider* base,
                                                   XmppXmppStream* stream,
                                                   XmppJid* muc_jid,
                                                   XmppConference* modified_conference,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_)
{
	XmppXepBookmarksModule * self;
	XmppXepBookmarksModuleReplaceConferenceData* _data_;
	XmppXepBookmarksModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppJid* _tmp2_;
	XmppConference* _tmp3_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (muc_jid != NULL);
	g_return_if_fail (modified_conference != NULL);
	self = (XmppXepBookmarksModule*) base;
	_data_ = g_slice_new0 (XmppXepBookmarksModuleReplaceConferenceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_bookmarks_module_real_replace_conference_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (muc_jid);
	_xmpp_jid_unref0 (_data_->muc_jid);
	_data_->muc_jid = _tmp2_;
	_tmp3_ = _g_object_ref0 (modified_conference);
	_g_object_unref0 (_data_->modified_conference);
	_data_->modified_conference = _tmp3_;
	xmpp_xep_bookmarks_module_real_replace_conference_co (_data_);
}

static void
xmpp_xep_bookmarks_module_replace_conference_finish (XmppBookmarksProvider* base,
                                                     GAsyncResult* _res_)
{
	XmppXepBookmarksModuleReplaceConferenceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_bookmarks_module_replace_conference_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	XmppXepBookmarksModuleReplaceConferenceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks_module_real_replace_conference_co (_data_);
}

static gboolean
xmpp_xep_bookmarks_module_real_replace_conference_co (XmppXepBookmarksModuleReplaceConferenceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	xmpp_bookmarks_provider_get_conferences ((XmppBookmarksProvider*) _data_->self, _data_->stream, xmpp_xep_bookmarks_module_replace_conference_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = xmpp_bookmarks_provider_get_conferences_finish ((XmppBookmarksProvider*) _data_->self, _data_->_res_);
	_data_->conferences = _data_->_tmp0_;
	{
		_data_->_tmp1_ = _data_->conferences;
		_data_->_tmp2_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp1_);
		_data_->_conference_it = _data_->_tmp2_;
		while (TRUE) {
			_data_->_tmp3_ = _data_->_conference_it;
			if (!gee_iterator_next (_data_->_tmp3_)) {
				break;
			}
			_data_->_tmp4_ = _data_->_conference_it;
			_data_->_tmp5_ = gee_iterator_get (_data_->_tmp4_);
			_data_->conference = (XmppConference*) _data_->_tmp5_;
			_data_->_tmp6_ = _data_->conference;
			_data_->_tmp7_ = xmpp_conference_get_jid (_data_->_tmp6_);
			_data_->_tmp8_ = _data_->_tmp7_;
			if (xmpp_jid_equals (_data_->_tmp8_, _data_->muc_jid)) {
				_data_->_tmp9_ = _data_->conference;
				_data_->_tmp10_ = xmpp_conference_get_autojoin (_data_->modified_conference);
				_data_->_tmp11_ = _data_->_tmp10_;
				xmpp_conference_set_autojoin (_data_->_tmp9_, _data_->_tmp11_);
				_data_->_tmp12_ = _data_->conference;
				_data_->_tmp13_ = xmpp_conference_get_name (_data_->modified_conference);
				_data_->_tmp14_ = _data_->_tmp13_;
				xmpp_conference_set_name (_data_->_tmp12_, _data_->_tmp14_);
				_data_->_tmp15_ = _data_->conference;
				_data_->_tmp16_ = xmpp_conference_get_nick (_data_->modified_conference);
				_data_->_tmp17_ = _data_->_tmp16_;
				xmpp_conference_set_nick (_data_->_tmp15_, _data_->_tmp17_);
				_data_->_tmp18_ = _data_->conference;
				_data_->_tmp19_ = xmpp_conference_get_password (_data_->modified_conference);
				_data_->_tmp20_ = _data_->_tmp19_;
				xmpp_conference_set_password (_data_->_tmp18_, _data_->_tmp20_);
			}
			_g_object_unref0 (_data_->conference);
		}
		_g_object_unref0 (_data_->_conference_it);
	}
	_data_->_tmp21_ = _data_->conferences;
	_data_->_state_ = 2;
	xmpp_xep_bookmarks_module_set_conferences (_data_->self, _data_->stream, _data_->_tmp21_, xmpp_xep_bookmarks_module_replace_conference_ready, _data_);
	return FALSE;
	_state_2:
	xmpp_xep_bookmarks_module_set_conferences_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->conferences);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_bookmarks_module_real_remove_conference_data_free (gpointer _data)
{
	XmppXepBookmarksModuleRemoveConferenceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->conference_remove);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepBookmarksModuleRemoveConferenceData, _data_);
}

static void
xmpp_xep_bookmarks_module_real_remove_conference (XmppBookmarksProvider* base,
                                                  XmppXmppStream* stream,
                                                  XmppConference* conference_remove,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_)
{
	XmppXepBookmarksModule * self;
	XmppXepBookmarksModuleRemoveConferenceData* _data_;
	XmppXepBookmarksModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppConference* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (conference_remove != NULL);
	self = (XmppXepBookmarksModule*) base;
	_data_ = g_slice_new0 (XmppXepBookmarksModuleRemoveConferenceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_bookmarks_module_real_remove_conference_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 (conference_remove);
	_g_object_unref0 (_data_->conference_remove);
	_data_->conference_remove = _tmp2_;
	xmpp_xep_bookmarks_module_real_remove_conference_co (_data_);
}

static void
xmpp_xep_bookmarks_module_remove_conference_finish (XmppBookmarksProvider* base,
                                                    GAsyncResult* _res_)
{
	XmppXepBookmarksModuleRemoveConferenceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_bookmarks_module_remove_conference_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	XmppXepBookmarksModuleRemoveConferenceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks_module_real_remove_conference_co (_data_);
}

static gboolean
xmpp_xep_bookmarks_module_real_remove_conference_co (XmppXepBookmarksModuleRemoveConferenceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	xmpp_bookmarks_provider_get_conferences ((XmppBookmarksProvider*) _data_->self, _data_->stream, xmpp_xep_bookmarks_module_remove_conference_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = xmpp_bookmarks_provider_get_conferences_finish ((XmppBookmarksProvider*) _data_->self, _data_->_res_);
	_data_->conferences = _data_->_tmp0_;
	gee_collection_remove ((GeeCollection*) _data_->conferences, _data_->conference_remove);
	_data_->_state_ = 2;
	xmpp_xep_bookmarks_module_set_conferences (_data_->self, _data_->stream, _data_->conferences, xmpp_xep_bookmarks_module_remove_conference_ready, _data_);
	return FALSE;
	_state_2:
	xmpp_xep_bookmarks_module_set_conferences_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->conferences);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

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

static gchar*
xmpp_xep_bookmarks_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppXepBookmarksModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppXepBookmarksModule*) base;
	_tmp0_ = g_strdup (XMPP_XEP_BOOKMARKS_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_xep_bookmarks_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppXepBookmarksModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppXepBookmarksModule*) base;
	_tmp0_ = xmpp_xep_bookmarks_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

XmppXepBookmarksModule*
xmpp_xep_bookmarks_module_construct (GType object_type)
{
	XmppXepBookmarksModule * self = NULL;
	self = (XmppXepBookmarksModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppXepBookmarksModule*
xmpp_xep_bookmarks_module_new (void)
{
	return xmpp_xep_bookmarks_module_construct (XMPP_XEP_BOOKMARKS_TYPE_MODULE);
}

static void
xmpp_xep_bookmarks_module_class_init (XmppXepBookmarksModuleClass * klass,
                                      gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_xep_bookmarks_module_parent_class = g_type_class_peek_parent (klass);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_bookmarks_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_bookmarks_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_bookmarks_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_bookmarks_module_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_bookmarks_module_finalize;
	_tmp0_ = xmpp_module_identity_new (XMPP_XEP_BOOKMARKS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_XEP_BOOKMARKS_NS_URI, "0048_bookmarks_module");
	xmpp_xep_bookmarks_module_IDENTITY = _tmp0_;
}

static void
xmpp_xep_bookmarks_module_xmpp_bookmarks_provider_interface_init (XmppBookmarksProviderIface * iface,
                                                                  gpointer iface_data)
{
	xmpp_xep_bookmarks_module_xmpp_bookmarks_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_conferences = (void (*) (XmppBookmarksProvider*, XmppXmppStream*, GAsyncReadyCallback, gpointer)) xmpp_xep_bookmarks_module_real_get_conferences;
	iface->get_conferences_finish = (GeeSet* (*) (XmppBookmarksProvider*, GAsyncResult*)) xmpp_xep_bookmarks_module_get_conferences_finish;
	iface->add_conference = (void (*) (XmppBookmarksProvider*, XmppXmppStream*, XmppConference*, GAsyncReadyCallback, gpointer)) xmpp_xep_bookmarks_module_real_add_conference;
	iface->add_conference_finish = (void (*) (XmppBookmarksProvider*, GAsyncResult*)) xmpp_xep_bookmarks_module_add_conference_finish;
	iface->replace_conference = (void (*) (XmppBookmarksProvider*, XmppXmppStream*, XmppJid*, XmppConference*, GAsyncReadyCallback, gpointer)) xmpp_xep_bookmarks_module_real_replace_conference;
	iface->replace_conference_finish = (void (*) (XmppBookmarksProvider*, GAsyncResult*)) xmpp_xep_bookmarks_module_replace_conference_finish;
	iface->remove_conference = (void (*) (XmppBookmarksProvider*, XmppXmppStream*, XmppConference*, GAsyncReadyCallback, gpointer)) xmpp_xep_bookmarks_module_real_remove_conference;
	iface->remove_conference_finish = (void (*) (XmppBookmarksProvider*, GAsyncResult*)) xmpp_xep_bookmarks_module_remove_conference_finish;
}

static void
xmpp_xep_bookmarks_module_instance_init (XmppXepBookmarksModule * self,
                                         gpointer klass)
{
}

static void
xmpp_xep_bookmarks_module_finalize (GObject * obj)
{
	XmppXepBookmarksModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_BOOKMARKS_TYPE_MODULE, XmppXepBookmarksModule);
	G_OBJECT_CLASS (xmpp_xep_bookmarks_module_parent_class)->finalize (obj);
}

static GType
xmpp_xep_bookmarks_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepBookmarksModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_bookmarks_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepBookmarksModule), 0, (GInstanceInitFunc) xmpp_xep_bookmarks_module_instance_init, NULL };
	static const GInterfaceInfo xmpp_bookmarks_provider_info = { (GInterfaceInitFunc) xmpp_xep_bookmarks_module_xmpp_bookmarks_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_bookmarks_module_type_id;
	xmpp_xep_bookmarks_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppXepBookmarksModule", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_bookmarks_module_type_id, XMPP_TYPE_BOOKMARKS_PROVIDER, &xmpp_bookmarks_provider_info);
	return xmpp_xep_bookmarks_module_type_id;
}

GType
xmpp_xep_bookmarks_module_get_type (void)
{
	static volatile gsize xmpp_xep_bookmarks_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_bookmarks_module_type_id__once)) {
		GType xmpp_xep_bookmarks_module_type_id;
		xmpp_xep_bookmarks_module_type_id = xmpp_xep_bookmarks_module_get_type_once ();
		g_once_init_leave (&xmpp_xep_bookmarks_module_type_id__once, xmpp_xep_bookmarks_module_type_id);
	}
	return xmpp_xep_bookmarks_module_type_id__once;
}

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

