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

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

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

enum  {
	XMPP_XEP_BOOKMARKS2_MODULE_0_PROPERTY,
	XMPP_XEP_BOOKMARKS2_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_bookmarks2_module_properties[XMPP_XEP_BOOKMARKS2_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)))
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
typedef struct _XmppXepBookmarks2ModuleGetConferencesData XmppXepBookmarks2ModuleGetConferencesData;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_xep_pubsub_publish_options_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_pubsub_publish_options_unref (var), NULL)))
typedef struct _XmppXepBookmarks2ModuleAddConferenceData XmppXepBookmarks2ModuleAddConferenceData;
typedef struct _XmppXepBookmarks2ModuleReplaceConferenceData XmppXepBookmarks2ModuleReplaceConferenceData;
typedef struct _XmppXepBookmarks2ModuleRemoveConferenceData XmppXepBookmarks2ModuleRemoveConferenceData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	XMPP_XEP_BOOKMARKS2_FLAG_0_PROPERTY,
	XMPP_XEP_BOOKMARKS2_FLAG_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_bookmarks2_flag_properties[XMPP_XEP_BOOKMARKS2_FLAG_NUM_PROPERTIES];

struct _XmppXepBookmarks2ModuleGetConferencesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepBookmarks2Module* self;
	XmppXmppStream* stream;
	GeeSet* result;
	GeeHashMap* hm;
	XmppXepBookmarks2Flag* flag;
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepBookmarks2Flag* _tmp2_;
	XmppXepBookmarks2Flag* _tmp3_;
	GeeHashMap* _tmp4_;
	GeeHashMap* _tmp5_;
	GeeList* items;
	XmppModuleIdentity* _tmp6_;
	gpointer _tmp7_;
	XmppXepPubsubModule* _tmp8_;
	XmppFlagIdentity* _tmp9_;
	gpointer _tmp10_;
	XmppBindFlag* _tmp11_;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_;
	XmppJid* _tmp14_;
	XmppJid* _tmp15_;
	GeeList* _tmp16_;
	GeeList* _tmp17_;
	GeeList* _tmp18_;
	GeeHashMap* _tmp19_;
	GeeList* _item_node_list;
	GeeList* _tmp20_;
	gint _item_node_size;
	GeeList* _tmp21_;
	gint _tmp22_;
	gint _tmp23_;
	gint _item_node_index;
	gint _tmp24_;
	gint _tmp25_;
	XmppStanzaNode* item_node;
	GeeList* _tmp26_;
	gpointer _tmp27_;
	XmppConference* conference;
	XmppStanzaNode* _tmp28_;
	GeeList* _tmp29_;
	gpointer _tmp30_;
	XmppStanzaNode* _tmp31_;
	XmppStanzaNode* _tmp32_;
	const gchar* _tmp33_;
	XmppConference* _tmp34_;
	XmppConference* _tmp35_;
	XmppConference* _tmp36_;
	GeeHashMap* _tmp37_;
	XmppConference* _tmp38_;
	XmppJid* _tmp39_;
	XmppJid* _tmp40_;
	XmppConference* _tmp41_;
	GeeHashMap* _tmp42_;
	XmppXepBookmarks2Flag* _tmp43_;
	XmppXepBookmarks2Flag* _tmp44_;
	GeeHashSet* ret;
	GeeHashSet* _tmp45_;
	GeeIterator* _conference_it;
	GeeHashMap* _tmp46_;
	GeeCollection* _tmp47_;
	GeeCollection* _tmp48_;
	GeeCollection* _tmp49_;
	GeeIterator* _tmp50_;
	GeeIterator* _tmp51_;
	GeeIterator* _tmp52_;
	XmppConference* _vala1_conference;
	GeeIterator* _tmp53_;
	gpointer _tmp54_;
	GeeHashSet* _tmp55_;
	XmppConference* _tmp56_;
};

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

struct _XmppXepBookmarks2ModuleReplaceConferenceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepBookmarks2Module* self;
	XmppXmppStream* stream;
	XmppJid* muc_jid;
	XmppConference* modified_conference;
};

struct _XmppXepBookmarks2ModuleRemoveConferenceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepBookmarks2Module* self;
	XmppXmppStream* stream;
	XmppConference* conference;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepPubsubModule* _tmp2_;
	XmppFlagIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppBindFlag* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	XmppJid* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
};

static gpointer xmpp_xep_bookmarks2_module_parent_class = NULL;
XmppModuleIdentity* xmpp_xep_bookmarks2_module_IDENTITY = NULL;
static XmppBookmarksProviderIface * xmpp_xep_bookmarks2_module_xmpp_bookmarks_provider_parent_iface = NULL;
static gpointer xmpp_xep_bookmarks2_flag_parent_class = NULL;
XmppFlagIdentity* xmpp_xep_bookmarks2_flag_IDENTITY = NULL;

static void xmpp_xep_bookmarks2_module_real_get_conferences_data_free (gpointer _data);
static void xmpp_xep_bookmarks2_module_real_get_conferences (XmppBookmarksProvider* base,
                                                      XmppXmppStream* stream,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static gboolean xmpp_xep_bookmarks2_module_real_get_conferences_co (XmppXepBookmarks2ModuleGetConferencesData* _data_);
static void xmpp_xep_bookmarks2_module_get_conferences_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static guint _xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                              gpointer self);
static gboolean _xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                                    gconstpointer b,
                                                    gpointer self);
static XmppConference* xmpp_xep_bookmarks2_module_parse_item_node (XmppXepBookmarks2Module* self,
                                                            XmppStanzaNode* conference_node,
                                                            const gchar* id);
static void xmpp_xep_bookmarks2_module_real_add_conference_data_free (gpointer _data);
static void xmpp_xep_bookmarks2_module_real_add_conference (XmppBookmarksProvider* base,
                                                     XmppXmppStream* stream,
                                                     XmppConference* conference,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static gboolean xmpp_xep_bookmarks2_module_real_add_conference_co (XmppXepBookmarks2ModuleAddConferenceData* _data_);
static void xmpp_xep_bookmarks2_module_add_conference_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void xmpp_xep_bookmarks2_module_real_replace_conference_data_free (gpointer _data);
static void xmpp_xep_bookmarks2_module_real_replace_conference (XmppBookmarksProvider* base,
                                                         XmppXmppStream* stream,
                                                         XmppJid* muc_jid,
                                                         XmppConference* modified_conference,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static gboolean xmpp_xep_bookmarks2_module_real_replace_conference_co (XmppXepBookmarks2ModuleReplaceConferenceData* _data_);
static void xmpp_xep_bookmarks2_module_replace_conference_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static void xmpp_xep_bookmarks2_module_real_remove_conference_data_free (gpointer _data);
static void xmpp_xep_bookmarks2_module_real_remove_conference (XmppBookmarksProvider* base,
                                                        XmppXmppStream* stream,
                                                        XmppConference* conference,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_);
static gboolean xmpp_xep_bookmarks2_module_real_remove_conference_co (XmppXepBookmarks2ModuleRemoveConferenceData* _data_);
static void xmpp_xep_bookmarks2_module_remove_conference_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void xmpp_xep_bookmarks2_module_on_pupsub_item (XmppXepBookmarks2Module* self,
                                                XmppXmppStream* stream,
                                                XmppJid* jid,
                                                const gchar* id,
                                                XmppStanzaNode* node);
static void xmpp_xep_bookmarks2_module_on_pupsub_retract (XmppXepBookmarks2Module* self,
                                                   XmppXmppStream* stream,
                                                   XmppJid* jid,
                                                   const gchar* id);
static void xmpp_xep_bookmarks2_module_real_attach (XmppXmppStreamModule* base,
                                             XmppXmppStream* stream);
static void _xmpp_xep_bookmarks2_module_on_pupsub_item_xmpp_xep_pubsub_item_listener_delegate_result_func (XmppXmppStream* stream,
                                                                                                    XmppJid* jid,
                                                                                                    const gchar* id,
                                                                                                    XmppStanzaNode* node,
                                                                                                    gpointer self);
static void _xmpp_xep_bookmarks2_module_on_pupsub_retract_xmpp_xep_pubsub_retract_listener_delegate_result_func (XmppXmppStream* stream,
                                                                                                          XmppJid* jid,
                                                                                                          const gchar* id,
                                                                                                          gpointer self);
static void xmpp_xep_bookmarks2_module_real_detach (XmppXmppStreamModule* base,
                                             XmppXmppStream* stream);
static gchar* xmpp_xep_bookmarks2_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_xep_bookmarks2_module_real_get_id (XmppXmppStreamModule* base);
static void xmpp_xep_bookmarks2_module_finalize (GObject * obj);
static GType xmpp_xep_bookmarks2_module_get_type_once (void);
static gchar* xmpp_xep_bookmarks2_flag_real_get_ns (XmppXmppStreamFlag* base);
static gchar* xmpp_xep_bookmarks2_flag_real_get_id (XmppXmppStreamFlag* base);
static void xmpp_xep_bookmarks2_flag_finalize (GObject * obj);
static GType xmpp_xep_bookmarks2_flag_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

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

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

static void
xmpp_xep_bookmarks2_module_real_get_conferences (XmppBookmarksProvider* base,
                                                 XmppXmppStream* stream,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	XmppXepBookmarks2Module * self;
	XmppXepBookmarks2ModuleGetConferencesData* _data_;
	XmppXepBookmarks2Module* _tmp0_;
	XmppXmppStream* _tmp1_;
	g_return_if_fail (stream != NULL);
	self = (XmppXepBookmarks2Module*) base;
	_data_ = g_slice_new0 (XmppXepBookmarks2ModuleGetConferencesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_bookmarks2_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_bookmarks2_module_real_get_conferences_co (_data_);
}

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

static void
xmpp_xep_bookmarks2_module_get_conferences_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	XmppXepBookmarks2ModuleGetConferencesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks2_module_real_get_conferences_co (_data_);
}

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

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

static gboolean
xmpp_xep_bookmarks2_module_real_get_conferences_co (XmppXepBookmarks2ModuleGetConferencesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->hm = NULL;
	_data_->_tmp0_ = xmpp_xep_bookmarks2_flag_IDENTITY;
	_data_->_tmp1_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_XEP_BOOKMARKS2_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp0_);
	_data_->flag = (XmppXepBookmarks2Flag*) _data_->_tmp1_;
	_data_->_tmp2_ = _data_->flag;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp3_ = _data_->flag;
		_data_->_tmp4_ = _data_->_tmp3_->conferences;
		_data_->_tmp5_ = _g_object_ref0 (_data_->_tmp4_);
		_g_object_unref0 (_data_->hm);
		_data_->hm = _data_->_tmp5_;
	} else {
		_data_->_tmp6_ = xmpp_xep_pubsub_module_IDENTITY;
		_data_->_tmp7_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_PUBSUB_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp6_);
		_data_->_tmp8_ = (XmppXepPubsubModule*) _data_->_tmp7_;
		_data_->_tmp9_ = xmpp_bind_flag_IDENTITY;
		_data_->_tmp10_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp9_);
		_data_->_tmp11_ = (XmppBindFlag*) _data_->_tmp10_;
		_data_->_tmp12_ = _data_->_tmp11_->my_jid;
		_data_->_tmp13_ = xmpp_jid_get_bare_jid (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_state_ = 1;
		xmpp_xep_pubsub_module_request_all (_data_->_tmp8_, _data_->stream, _data_->_tmp15_, XMPP_XEP_BOOKMARKS2_NS_URI, xmpp_xep_bookmarks2_module_get_conferences_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp16_ = xmpp_xep_pubsub_module_request_all_finish (_data_->_tmp8_, _data_->_res_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_xmpp_jid_unref0 (_data_->_tmp15_);
		_g_object_unref0 (_data_->_tmp11_);
		_g_object_unref0 (_data_->_tmp8_);
		_data_->items = _data_->_tmp17_;
		_data_->_tmp18_ = _data_->items;
		if (_data_->_tmp18_ == NULL) {
			_data_->result = NULL;
			_g_object_unref0 (_data_->items);
			_g_object_unref0 (_data_->flag);
			_g_object_unref0 (_data_->hm);
			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_->_tmp19_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, XMPP_TYPE_CONFERENCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_jid_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
		_g_object_unref0 (_data_->hm);
		_data_->hm = _data_->_tmp19_;
		{
			_data_->_tmp20_ = _data_->items;
			_data_->_item_node_list = _data_->_tmp20_;
			_data_->_tmp21_ = _data_->_item_node_list;
			_data_->_tmp22_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp21_);
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->_item_node_size = _data_->_tmp23_;
			_data_->_item_node_index = -1;
			while (TRUE) {
				_data_->_item_node_index = _data_->_item_node_index + 1;
				_data_->_tmp24_ = _data_->_item_node_index;
				_data_->_tmp25_ = _data_->_item_node_size;
				if (!(_data_->_tmp24_ < _data_->_tmp25_)) {
					break;
				}
				_data_->_tmp26_ = _data_->_item_node_list;
				_data_->_tmp27_ = gee_list_get (_data_->_tmp26_, _data_->_item_node_index);
				_data_->item_node = (XmppStanzaNode*) _data_->_tmp27_;
				_data_->_tmp28_ = _data_->item_node;
				_data_->_tmp29_ = _data_->_tmp28_->sub_nodes;
				_data_->_tmp30_ = gee_list_get (_data_->_tmp29_, 0);
				_data_->_tmp31_ = (XmppStanzaNode*) _data_->_tmp30_;
				_data_->_tmp32_ = _data_->item_node;
				_data_->_tmp33_ = xmpp_stanza_node_get_attribute (_data_->_tmp32_, "id", NULL);
				_data_->_tmp34_ = xmpp_xep_bookmarks2_module_parse_item_node (_data_->self, _data_->_tmp31_, _data_->_tmp33_);
				_data_->_tmp35_ = _data_->_tmp34_;
				_xmpp_stanza_entry_unref0 (_data_->_tmp31_);
				_data_->conference = _data_->_tmp35_;
				_data_->_tmp36_ = _data_->conference;
				if (_data_->_tmp36_ == NULL) {
					_g_object_unref0 (_data_->conference);
					_xmpp_stanza_entry_unref0 (_data_->item_node);
					continue;
				}
				_data_->_tmp37_ = _data_->hm;
				_data_->_tmp38_ = _data_->conference;
				_data_->_tmp39_ = xmpp_conference_get_jid (_data_->_tmp38_);
				_data_->_tmp40_ = _data_->_tmp39_;
				_data_->_tmp41_ = _data_->conference;
				gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp37_, _data_->_tmp40_, _data_->_tmp41_);
				_g_object_unref0 (_data_->conference);
				_xmpp_stanza_entry_unref0 (_data_->item_node);
			}
		}
		_data_->_tmp42_ = _data_->hm;
		_data_->_tmp43_ = xmpp_xep_bookmarks2_flag_new (_data_->_tmp42_);
		_data_->_tmp44_ = _data_->_tmp43_;
		xmpp_xmpp_stream_add_flag (_data_->stream, (XmppXmppStreamFlag*) _data_->_tmp44_);
		_g_object_unref0 (_data_->_tmp44_);
		_g_object_unref0 (_data_->items);
	}
	_data_->_tmp45_ = gee_hash_set_new (XMPP_TYPE_CONFERENCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->ret = _data_->_tmp45_;
	{
		_data_->_tmp46_ = _data_->hm;
		_data_->_tmp47_ = gee_abstract_map_get_values ((GeeAbstractMap*) _data_->_tmp46_);
		_data_->_tmp48_ = _data_->_tmp47_;
		_data_->_tmp49_ = _data_->_tmp48_;
		_data_->_tmp50_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp49_);
		_data_->_tmp51_ = _data_->_tmp50_;
		_g_object_unref0 (_data_->_tmp49_);
		_data_->_conference_it = _data_->_tmp51_;
		while (TRUE) {
			_data_->_tmp52_ = _data_->_conference_it;
			if (!gee_iterator_next (_data_->_tmp52_)) {
				break;
			}
			_data_->_tmp53_ = _data_->_conference_it;
			_data_->_tmp54_ = gee_iterator_get (_data_->_tmp53_);
			_data_->_vala1_conference = (XmppConference*) _data_->_tmp54_;
			_data_->_tmp55_ = _data_->ret;
			_data_->_tmp56_ = _data_->_vala1_conference;
			gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp55_, _data_->_tmp56_);
			_g_object_unref0 (_data_->_vala1_conference);
		}
		_g_object_unref0 (_data_->_conference_it);
	}
	_data_->result = (GeeSet*) _data_->ret;
	_g_object_unref0 (_data_->flag);
	_g_object_unref0 (_data_->hm);
	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_bookmarks2_module_real_add_conference_data_free (gpointer _data)
{
	XmppXepBookmarks2ModuleAddConferenceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->conference);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepBookmarks2ModuleAddConferenceData, _data_);
}

static void
xmpp_xep_bookmarks2_module_real_add_conference (XmppBookmarksProvider* base,
                                                XmppXmppStream* stream,
                                                XmppConference* conference,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	XmppXepBookmarks2Module * self;
	XmppXepBookmarks2ModuleAddConferenceData* _data_;
	XmppXepBookmarks2Module* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppConference* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (conference != NULL);
	self = (XmppXepBookmarks2Module*) base;
	_data_ = g_slice_new0 (XmppXepBookmarks2ModuleAddConferenceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_bookmarks2_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_bookmarks2_module_real_add_conference_co (_data_);
}

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

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

static void
xmpp_xep_bookmarks2_module_add_conference_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	XmppXepBookmarks2ModuleAddConferenceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks2_module_real_add_conference_co (_data_);
}

static gboolean
xmpp_xep_bookmarks2_module_real_add_conference_co (XmppXepBookmarks2ModuleAddConferenceData* _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 ("conference", XMPP_XEP_BOOKMARKS2_NS_URI, NULL, NULL);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = xmpp_conference_get_autojoin (_data_->conference);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = bool_to_string (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = xmpp_stanza_node_put_attribute (_data_->_tmp3_, "autojoin", _data_->_tmp7_, NULL);
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_free0 (_data_->_tmp7_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp3_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp1_);
	_data_->conference_node = _data_->_tmp9_;
	_data_->_tmp10_ = xmpp_conference_get_name (_data_->conference);
	_data_->_tmp11_ = _data_->_tmp10_;
	if (_data_->_tmp11_ != NULL) {
		_data_->_tmp12_ = _data_->conference_node;
		_data_->_tmp13_ = xmpp_conference_get_name (_data_->conference);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp15_ = xmpp_stanza_node_put_attribute (_data_->_tmp12_, "name", _data_->_tmp14_, NULL);
		_data_->_tmp16_ = _data_->_tmp15_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp16_);
	}
	_data_->_tmp17_ = xmpp_conference_get_nick (_data_->conference);
	_data_->_tmp18_ = _data_->_tmp17_;
	if (_data_->_tmp18_ != NULL) {
		_data_->_tmp19_ = _data_->conference_node;
		_data_->_tmp20_ = xmpp_stanza_node_new_build ("nick", XMPP_XEP_BOOKMARKS2_NS_URI, NULL, NULL);
		_data_->_tmp21_ = _data_->_tmp20_;
		_data_->_tmp22_ = xmpp_conference_get_nick (_data_->conference);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp24_ = xmpp_stanza_node_new_text (_data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = xmpp_stanza_node_put_node (_data_->_tmp21_, _data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp28_ = xmpp_stanza_node_put_node (_data_->_tmp19_, _data_->_tmp27_);
		_data_->_tmp29_ = _data_->_tmp28_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp29_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp27_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp25_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp21_);
	}
	_data_->_tmp30_ = xmpp_conference_get_password (_data_->conference);
	_data_->_tmp31_ = _data_->_tmp30_;
	if (_data_->_tmp31_ != NULL) {
		_data_->_tmp32_ = _data_->conference_node;
		_data_->_tmp33_ = xmpp_stanza_node_new_build ("password", XMPP_XEP_BOOKMARKS2_NS_URI, NULL, NULL);
		_data_->_tmp34_ = _data_->_tmp33_;
		_data_->_tmp35_ = xmpp_conference_get_password (_data_->conference);
		_data_->_tmp36_ = _data_->_tmp35_;
		_data_->_tmp37_ = xmpp_stanza_node_new_text (_data_->_tmp36_);
		_data_->_tmp38_ = _data_->_tmp37_;
		_data_->_tmp39_ = xmpp_stanza_node_put_node (_data_->_tmp34_, _data_->_tmp38_);
		_data_->_tmp40_ = _data_->_tmp39_;
		_data_->_tmp41_ = xmpp_stanza_node_put_node (_data_->_tmp32_, _data_->_tmp40_);
		_data_->_tmp42_ = _data_->_tmp41_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp42_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp40_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp38_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp34_);
	}
	_data_->_tmp43_ = xmpp_xep_pubsub_publish_options_new ();
	_data_->_tmp44_ = _data_->_tmp43_;
	_data_->_tmp45_ = xmpp_xep_pubsub_publish_options_set_persist_items (_data_->_tmp44_, TRUE);
	_data_->_tmp46_ = _data_->_tmp45_;
	_data_->_tmp47_ = xmpp_xep_pubsub_publish_options_set_max_items (_data_->_tmp46_, "max");
	_data_->_tmp48_ = _data_->_tmp47_;
	_data_->_tmp49_ = xmpp_xep_pubsub_publish_options_set_send_last_published_item (_data_->_tmp48_, "never");
	_data_->_tmp50_ = _data_->_tmp49_;
	_data_->_tmp51_ = xmpp_xep_pubsub_publish_options_set_access_model (_data_->_tmp50_, "whitelist");
	_data_->_tmp52_ = _data_->_tmp51_;
	_xmpp_xep_pubsub_publish_options_unref0 (_data_->_tmp50_);
	_xmpp_xep_pubsub_publish_options_unref0 (_data_->_tmp48_);
	_xmpp_xep_pubsub_publish_options_unref0 (_data_->_tmp46_);
	_xmpp_xep_pubsub_publish_options_unref0 (_data_->_tmp44_);
	_data_->publish_options = _data_->_tmp52_;
	_data_->_tmp53_ = xmpp_xep_pubsub_module_IDENTITY;
	_data_->_tmp54_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_PUBSUB_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp53_);
	_data_->_tmp55_ = (XmppXepPubsubModule*) _data_->_tmp54_;
	_data_->_tmp56_ = xmpp_bind_flag_IDENTITY;
	_data_->_tmp57_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp56_);
	_data_->_tmp58_ = (XmppBindFlag*) _data_->_tmp57_;
	_data_->_tmp59_ = _data_->_tmp58_->my_jid;
	_data_->_tmp60_ = xmpp_jid_get_bare_jid (_data_->_tmp59_);
	_data_->_tmp61_ = _data_->_tmp60_;
	_data_->_tmp62_ = _data_->_tmp61_;
	_data_->_tmp63_ = xmpp_conference_get_jid (_data_->conference);
	_data_->_tmp64_ = _data_->_tmp63_;
	_data_->_tmp65_ = xmpp_jid_to_string (_data_->_tmp64_);
	_data_->_tmp66_ = _data_->_tmp65_;
	_data_->_tmp67_ = _data_->conference_node;
	_data_->_state_ = 1;
	xmpp_xep_pubsub_module_publish (_data_->_tmp55_, _data_->stream, _data_->_tmp62_, XMPP_XEP_BOOKMARKS2_NS_URI, _data_->_tmp66_, _data_->_tmp67_, _data_->publish_options, TRUE, xmpp_xep_bookmarks2_module_add_conference_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_xep_pubsub_module_publish_finish (_data_->_tmp55_, _data_->_res_);
	_g_free0 (_data_->_tmp66_);
	_xmpp_jid_unref0 (_data_->_tmp62_);
	_g_object_unref0 (_data_->_tmp58_);
	_g_object_unref0 (_data_->_tmp55_);
	_xmpp_xep_pubsub_publish_options_unref0 (_data_->publish_options);
	_xmpp_stanza_entry_unref0 (_data_->conference_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_bookmarks2_module_real_replace_conference_data_free (gpointer _data)
{
	XmppXepBookmarks2ModuleReplaceConferenceData* _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 (XmppXepBookmarks2ModuleReplaceConferenceData, _data_);
}

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

static void
xmpp_xep_bookmarks2_module_real_replace_conference (XmppBookmarksProvider* base,
                                                    XmppXmppStream* stream,
                                                    XmppJid* muc_jid,
                                                    XmppConference* modified_conference,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	XmppXepBookmarks2Module * self;
	XmppXepBookmarks2ModuleReplaceConferenceData* _data_;
	XmppXepBookmarks2Module* _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 = (XmppXepBookmarks2Module*) base;
	_data_ = g_slice_new0 (XmppXepBookmarks2ModuleReplaceConferenceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_bookmarks2_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_bookmarks2_module_real_replace_conference_co (_data_);
}

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

static void
xmpp_xep_bookmarks2_module_replace_conference_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	XmppXepBookmarks2ModuleReplaceConferenceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks2_module_real_replace_conference_co (_data_);
}

static gboolean
xmpp_xep_bookmarks2_module_real_replace_conference_co (XmppXepBookmarks2ModuleReplaceConferenceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	xmpp_bookmarks_provider_add_conference ((XmppBookmarksProvider*) _data_->self, _data_->stream, _data_->modified_conference, xmpp_xep_bookmarks2_module_replace_conference_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_bookmarks_provider_add_conference_finish ((XmppBookmarksProvider*) _data_->self, _data_->_res_);
	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_bookmarks2_module_real_remove_conference_data_free (gpointer _data)
{
	XmppXepBookmarks2ModuleRemoveConferenceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->conference);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepBookmarks2ModuleRemoveConferenceData, _data_);
}

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

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

static void
xmpp_xep_bookmarks2_module_remove_conference_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	XmppXepBookmarks2ModuleRemoveConferenceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_bookmarks2_module_real_remove_conference_co (_data_);
}

static gboolean
xmpp_xep_bookmarks2_module_real_remove_conference_co (XmppXepBookmarks2ModuleRemoveConferenceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_xep_pubsub_module_IDENTITY;
	_data_->_tmp1_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_PUBSUB_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp0_);
	_data_->_tmp2_ = (XmppXepPubsubModule*) _data_->_tmp1_;
	_data_->_tmp3_ = xmpp_bind_flag_IDENTITY;
	_data_->_tmp4_ = xmpp_xmpp_stream_get_flag (_data_->stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp3_);
	_data_->_tmp5_ = (XmppBindFlag*) _data_->_tmp4_;
	_data_->_tmp6_ = _data_->_tmp5_->my_jid;
	_data_->_tmp7_ = xmpp_jid_get_bare_jid (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = xmpp_conference_get_jid (_data_->conference);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = xmpp_jid_to_string (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_state_ = 1;
	xmpp_xep_pubsub_module_retract_item (_data_->_tmp2_, _data_->stream, _data_->_tmp9_, XMPP_XEP_BOOKMARKS2_NS_URI, _data_->_tmp13_, xmpp_xep_bookmarks2_module_remove_conference_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_xep_pubsub_module_retract_item_finish (_data_->_tmp2_, _data_->_res_);
	_g_free0 (_data_->_tmp13_);
	_xmpp_jid_unref0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp2_);
	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_bookmarks2_module_on_pupsub_item (XmppXepBookmarks2Module* self,
                                           XmppXmppStream* stream,
                                           XmppJid* jid,
                                           const gchar* id,
                                           XmppStanzaNode* node)
{
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppBindFlag* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	gboolean _tmp7_;
	XmppConference* conference = NULL;
	XmppConference* _tmp10_;
	XmppXepBookmarks2Flag* flag = NULL;
	XmppFlagIdentity* _tmp11_;
	gpointer _tmp12_;
	XmppXepBookmarks2Flag* _tmp13_;
	XmppConference* _tmp20_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (id != NULL);
	_tmp0_ = xmpp_bind_flag_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_flag (stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppBindFlag*) _tmp1_;
	_tmp3_ = _tmp2_->my_jid;
	_tmp4_ = xmpp_jid_get_bare_jid (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = !xmpp_jid_equals (jid, _tmp6_);
	_xmpp_jid_unref0 (_tmp6_);
	_g_object_unref0 (_tmp2_);
	if (_tmp7_) {
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp8_ = xmpp_jid_to_string (jid);
		_tmp9_ = _tmp8_;
		g_warning ("0402_bookmarks2.vala:72: Received alleged bookmarks:1 item from %s, ig" \
"noring", _tmp9_);
		_g_free0 (_tmp9_);
		return;
	}
	_tmp10_ = xmpp_xep_bookmarks2_module_parse_item_node (self, node, id);
	conference = _tmp10_;
	_tmp11_ = xmpp_xep_bookmarks2_flag_IDENTITY;
	_tmp12_ = xmpp_xmpp_stream_get_flag (stream, XMPP_XEP_BOOKMARKS2_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp11_);
	flag = (XmppXepBookmarks2Flag*) _tmp12_;
	_tmp13_ = flag;
	if (_tmp13_ != NULL) {
		XmppXepBookmarks2Flag* _tmp14_;
		GeeHashMap* _tmp15_;
		XmppConference* _tmp16_;
		XmppJid* _tmp17_;
		XmppJid* _tmp18_;
		XmppConference* _tmp19_;
		_tmp14_ = flag;
		_tmp15_ = _tmp14_->conferences;
		_tmp16_ = conference;
		_tmp17_ = xmpp_conference_get_jid (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = conference;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp15_, _tmp18_, _tmp19_);
	}
	_tmp20_ = conference;
	g_signal_emit_by_name ((XmppBookmarksProvider*) self, "conference-added", stream, _tmp20_);
	_g_object_unref0 (flag);
	_g_object_unref0 (conference);
}

static void
xmpp_xep_bookmarks2_module_on_pupsub_retract (XmppXepBookmarks2Module* self,
                                              XmppXmppStream* stream,
                                              XmppJid* jid,
                                              const gchar* id)
{
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppBindFlag* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	gboolean _tmp7_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (id != NULL);
	_tmp0_ = xmpp_bind_flag_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_flag (stream, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppBindFlag*) _tmp1_;
	_tmp3_ = _tmp2_->my_jid;
	_tmp4_ = xmpp_jid_get_bare_jid (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = !xmpp_jid_equals (jid, _tmp6_);
	_xmpp_jid_unref0 (_tmp6_);
	_g_object_unref0 (_tmp2_);
	if (_tmp7_) {
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp8_ = xmpp_jid_to_string (jid);
		_tmp9_ = _tmp8_;
		g_warning ("0402_bookmarks2.vala:86: Received alleged bookmarks:1 retract from %s," \
" ignoring", _tmp9_);
		_g_free0 (_tmp9_);
		return;
	}
	{
		XmppJid* jid_parsed = NULL;
		XmppJid* _tmp10_;
		XmppXepBookmarks2Flag* flag = NULL;
		XmppFlagIdentity* _tmp11_;
		gpointer _tmp12_;
		XmppXepBookmarks2Flag* _tmp13_;
		XmppJid* _tmp17_;
		_tmp10_ = xmpp_jid_new (id, &_inner_error0_);
		jid_parsed = _tmp10_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp11_ = xmpp_xep_bookmarks2_flag_IDENTITY;
		_tmp12_ = xmpp_xmpp_stream_get_flag (stream, XMPP_XEP_BOOKMARKS2_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp11_);
		flag = (XmppXepBookmarks2Flag*) _tmp12_;
		_tmp13_ = flag;
		if (_tmp13_ != NULL) {
			XmppXepBookmarks2Flag* _tmp14_;
			GeeHashMap* _tmp15_;
			XmppJid* _tmp16_;
			_tmp14_ = flag;
			_tmp15_ = _tmp14_->conferences;
			_tmp16_ = jid_parsed;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp15_, _tmp16_, NULL);
		}
		_tmp17_ = jid_parsed;
		g_signal_emit_by_name ((XmppBookmarksProvider*) self, "conference-removed", stream, _tmp17_);
		_g_object_unref0 (flag);
		_xmpp_jid_unref0 (jid_parsed);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GError* e = NULL;
		GError* _tmp18_;
		const gchar* _tmp19_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp18_ = e;
		_tmp19_ = _tmp18_->message;
		g_warning ("0402_bookmarks2.vala:98: Ignoring conference bookmark update with inva" \
"lid Jid: %s", _tmp19_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static XmppConference*
xmpp_xep_bookmarks2_module_parse_item_node (XmppXepBookmarks2Module* self,
                                            XmppStanzaNode* conference_node,
                                            const gchar* id)
{
	XmppConference* conference = NULL;
	XmppConference* _tmp0_;
	gboolean _tmp8_ = FALSE;
	const gchar* _tmp9_;
	XmppConference* _tmp11_;
	const gchar* _tmp12_;
	XmppConference* _tmp13_;
	XmppConference* _tmp14_;
	const gchar* _tmp15_;
	XmppConference* _tmp16_;
	const gchar* _tmp17_;
	GError* _inner_error0_ = NULL;
	XmppConference* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (conference_node != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = xmpp_conference_new ();
	conference = _tmp0_;
	{
		XmppJid* jid_parsed = NULL;
		XmppJid* _tmp1_;
		XmppJid* _tmp2_;
		const gchar* _tmp3_;
		XmppConference* _tmp4_;
		XmppJid* _tmp5_;
		_tmp1_ = xmpp_jid_new (id, &_inner_error0_);
		jid_parsed = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_error;
			}
			_g_object_unref0 (conference);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp2_ = jid_parsed;
		_tmp3_ = _tmp2_->resourcepart;
		if (_tmp3_ != NULL) {
			result = NULL;
			_xmpp_jid_unref0 (jid_parsed);
			_g_object_unref0 (conference);
			return result;
		}
		_tmp4_ = conference;
		_tmp5_ = jid_parsed;
		xmpp_conference_set_jid (_tmp4_, _tmp5_);
		_xmpp_jid_unref0 (jid_parsed);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GError* e = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		g_warning ("0402_bookmarks2.vala:109: Ignoring conference bookmark update with inv" \
"alid Jid: %s", _tmp7_);
		result = NULL;
		_g_error_free0 (e);
		_g_object_unref0 (conference);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (conference);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp9_ = ((XmppStanzaEntry*) conference_node)->name;
	if (g_strcmp0 (_tmp9_, "conference") != 0) {
		_tmp8_ = TRUE;
	} else {
		const gchar* _tmp10_;
		_tmp10_ = ((XmppStanzaEntry*) conference_node)->ns_uri;
		_tmp8_ = g_strcmp0 (_tmp10_, XMPP_XEP_BOOKMARKS2_NS_URI) != 0;
	}
	if (_tmp8_) {
		result = NULL;
		_g_object_unref0 (conference);
		return result;
	}
	_tmp11_ = conference;
	_tmp12_ = xmpp_stanza_node_get_attribute (conference_node, "name", XMPP_XEP_BOOKMARKS2_NS_URI);
	xmpp_conference_set_name (_tmp11_, _tmp12_);
	_tmp13_ = conference;
	xmpp_conference_set_autojoin (_tmp13_, xmpp_stanza_node_get_attribute_bool (conference_node, "autojoin", FALSE, XMPP_XEP_BOOKMARKS2_NS_URI));
	_tmp14_ = conference;
	_tmp15_ = xmpp_stanza_node_get_deep_string_content (conference_node, "nick", NULL);
	xmpp_conference_set_nick (_tmp14_, _tmp15_);
	_tmp16_ = conference;
	_tmp17_ = xmpp_stanza_node_get_deep_string_content (conference_node, "password", NULL);
	xmpp_conference_set_password (_tmp16_, _tmp17_);
	result = conference;
	return result;
}

static void
_xmpp_xep_bookmarks2_module_on_pupsub_item_xmpp_xep_pubsub_item_listener_delegate_result_func (XmppXmppStream* stream,
                                                                                               XmppJid* jid,
                                                                                               const gchar* id,
                                                                                               XmppStanzaNode* node,
                                                                                               gpointer self)
{
	xmpp_xep_bookmarks2_module_on_pupsub_item ((XmppXepBookmarks2Module*) self, stream, jid, id, node);
}

static void
_xmpp_xep_bookmarks2_module_on_pupsub_retract_xmpp_xep_pubsub_retract_listener_delegate_result_func (XmppXmppStream* stream,
                                                                                                     XmppJid* jid,
                                                                                                     const gchar* id,
                                                                                                     gpointer self)
{
	xmpp_xep_bookmarks2_module_on_pupsub_retract ((XmppXepBookmarks2Module*) self, stream, jid, id);
}

static void
xmpp_xep_bookmarks2_module_real_attach (XmppXmppStreamModule* base,
                                        XmppXmppStream* stream)
{
	XmppXepBookmarks2Module * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepPubsubModule* _tmp2_;
	self = (XmppXepBookmarks2Module*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_pubsub_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_PUBSUB_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepPubsubModule*) _tmp1_;
	xmpp_xep_pubsub_module_add_filtered_notification (_tmp2_, stream, XMPP_XEP_BOOKMARKS2_NS_URI, _xmpp_xep_bookmarks2_module_on_pupsub_item_xmpp_xep_pubsub_item_listener_delegate_result_func, g_object_ref (self), g_object_unref, _xmpp_xep_bookmarks2_module_on_pupsub_retract_xmpp_xep_pubsub_retract_listener_delegate_result_func, g_object_ref (self), g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (_tmp2_);
}

static void
xmpp_xep_bookmarks2_module_real_detach (XmppXmppStreamModule* base,
                                        XmppXmppStream* stream)
{
	XmppXepBookmarks2Module * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepPubsubModule* _tmp2_;
	self = (XmppXepBookmarks2Module*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_pubsub_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_PUBSUB_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepPubsubModule*) _tmp1_;
	xmpp_xep_pubsub_module_remove_filtered_notification (_tmp2_, stream, XMPP_XEP_BOOKMARKS2_NS_URI);
	_g_object_unref0 (_tmp2_);
}

static gchar*
xmpp_xep_bookmarks2_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppXepBookmarks2Module * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppXepBookmarks2Module*) base;
	_tmp0_ = g_strdup (XMPP_XEP_BOOKMARKS2_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_xep_bookmarks2_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppXepBookmarks2Module * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppXepBookmarks2Module*) base;
	_tmp0_ = xmpp_xep_bookmarks2_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

XmppXepBookmarks2Module*
xmpp_xep_bookmarks2_module_construct (GType object_type)
{
	XmppXepBookmarks2Module * self = NULL;
	self = (XmppXepBookmarks2Module*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppXepBookmarks2Module*
xmpp_xep_bookmarks2_module_new (void)
{
	return xmpp_xep_bookmarks2_module_construct (XMPP_XEP_BOOKMARKS2_TYPE_MODULE);
}

static void
xmpp_xep_bookmarks2_module_class_init (XmppXepBookmarks2ModuleClass * klass,
                                       gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_xep_bookmarks2_module_parent_class = g_type_class_peek_parent (klass);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_bookmarks2_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_bookmarks2_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_bookmarks2_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_bookmarks2_module_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_bookmarks2_module_finalize;
	_tmp0_ = xmpp_module_identity_new (XMPP_XEP_BOOKMARKS2_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_XEP_BOOKMARKS2_NS_URI, "0402_bookmarks2");
	xmpp_xep_bookmarks2_module_IDENTITY = _tmp0_;
}

static void
xmpp_xep_bookmarks2_module_xmpp_bookmarks_provider_interface_init (XmppBookmarksProviderIface * iface,
                                                                   gpointer iface_data)
{
	xmpp_xep_bookmarks2_module_xmpp_bookmarks_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_conferences = (void (*) (XmppBookmarksProvider*, XmppXmppStream*, GAsyncReadyCallback, gpointer)) xmpp_xep_bookmarks2_module_real_get_conferences;
	iface->get_conferences_finish = (GeeSet* (*) (XmppBookmarksProvider*, GAsyncResult*)) xmpp_xep_bookmarks2_module_get_conferences_finish;
	iface->add_conference = (void (*) (XmppBookmarksProvider*, XmppXmppStream*, XmppConference*, GAsyncReadyCallback, gpointer)) xmpp_xep_bookmarks2_module_real_add_conference;
	iface->add_conference_finish = (void (*) (XmppBookmarksProvider*, GAsyncResult*)) xmpp_xep_bookmarks2_module_add_conference_finish;
	iface->replace_conference = (void (*) (XmppBookmarksProvider*, XmppXmppStream*, XmppJid*, XmppConference*, GAsyncReadyCallback, gpointer)) xmpp_xep_bookmarks2_module_real_replace_conference;
	iface->replace_conference_finish = (void (*) (XmppBookmarksProvider*, GAsyncResult*)) xmpp_xep_bookmarks2_module_replace_conference_finish;
	iface->remove_conference = (void (*) (XmppBookmarksProvider*, XmppXmppStream*, XmppConference*, GAsyncReadyCallback, gpointer)) xmpp_xep_bookmarks2_module_real_remove_conference;
	iface->remove_conference_finish = (void (*) (XmppBookmarksProvider*, GAsyncResult*)) xmpp_xep_bookmarks2_module_remove_conference_finish;
}

static void
xmpp_xep_bookmarks2_module_instance_init (XmppXepBookmarks2Module * self,
                                          gpointer klass)
{
}

static void
xmpp_xep_bookmarks2_module_finalize (GObject * obj)
{
	XmppXepBookmarks2Module * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_BOOKMARKS2_TYPE_MODULE, XmppXepBookmarks2Module);
	G_OBJECT_CLASS (xmpp_xep_bookmarks2_module_parent_class)->finalize (obj);
}

static GType
xmpp_xep_bookmarks2_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepBookmarks2ModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_bookmarks2_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepBookmarks2Module), 0, (GInstanceInitFunc) xmpp_xep_bookmarks2_module_instance_init, NULL };
	static const GInterfaceInfo xmpp_bookmarks_provider_info = { (GInterfaceInitFunc) xmpp_xep_bookmarks2_module_xmpp_bookmarks_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_bookmarks2_module_type_id;
	xmpp_xep_bookmarks2_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppXepBookmarks2Module", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_bookmarks2_module_type_id, XMPP_TYPE_BOOKMARKS_PROVIDER, &xmpp_bookmarks_provider_info);
	return xmpp_xep_bookmarks2_module_type_id;
}

GType
xmpp_xep_bookmarks2_module_get_type (void)
{
	static volatile gsize xmpp_xep_bookmarks2_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_bookmarks2_module_type_id__once)) {
		GType xmpp_xep_bookmarks2_module_type_id;
		xmpp_xep_bookmarks2_module_type_id = xmpp_xep_bookmarks2_module_get_type_once ();
		g_once_init_leave (&xmpp_xep_bookmarks2_module_type_id__once, xmpp_xep_bookmarks2_module_type_id);
	}
	return xmpp_xep_bookmarks2_module_type_id__once;
}

XmppXepBookmarks2Flag*
xmpp_xep_bookmarks2_flag_construct (GType object_type,
                                    GeeHashMap* conferences)
{
	XmppXepBookmarks2Flag * self = NULL;
	GeeHashMap* _tmp0_;
	g_return_val_if_fail (conferences != NULL, NULL);
	self = (XmppXepBookmarks2Flag*) xmpp_xmpp_stream_flag_construct (object_type);
	_tmp0_ = _g_object_ref0 (conferences);
	_g_object_unref0 (self->conferences);
	self->conferences = _tmp0_;
	return self;
}

XmppXepBookmarks2Flag*
xmpp_xep_bookmarks2_flag_new (GeeHashMap* conferences)
{
	return xmpp_xep_bookmarks2_flag_construct (XMPP_XEP_BOOKMARKS2_TYPE_FLAG, conferences);
}

static gchar*
xmpp_xep_bookmarks2_flag_real_get_ns (XmppXmppStreamFlag* base)
{
	XmppXepBookmarks2Flag * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppXepBookmarks2Flag*) base;
	_tmp0_ = g_strdup (XMPP_XEP_BOOKMARKS2_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_xep_bookmarks2_flag_real_get_id (XmppXmppStreamFlag* base)
{
	XmppXepBookmarks2Flag * self;
	XmppFlagIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppXepBookmarks2Flag*) base;
	_tmp0_ = xmpp_xep_bookmarks2_flag_IDENTITY;
	_tmp1_ = xmpp_flag_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

static void
xmpp_xep_bookmarks2_flag_class_init (XmppXepBookmarks2FlagClass * klass,
                                     gpointer klass_data)
{
	XmppFlagIdentity* _tmp0_;
	xmpp_xep_bookmarks2_flag_parent_class = g_type_class_peek_parent (klass);
	((XmppXmppStreamFlagClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamFlag*)) xmpp_xep_bookmarks2_flag_real_get_ns;
	((XmppXmppStreamFlagClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamFlag*)) xmpp_xep_bookmarks2_flag_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_bookmarks2_flag_finalize;
	_tmp0_ = xmpp_flag_identity_new (XMPP_XEP_BOOKMARKS2_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_XEP_BOOKMARKS2_NS_URI, "bookmarks2");
	xmpp_xep_bookmarks2_flag_IDENTITY = _tmp0_;
}

static void
xmpp_xep_bookmarks2_flag_instance_init (XmppXepBookmarks2Flag * self,
                                        gpointer klass)
{
	GeeHashMap* _tmp0_;
	_tmp0_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, XMPP_TYPE_CONFERENCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_jid_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->conferences = _tmp0_;
}

static void
xmpp_xep_bookmarks2_flag_finalize (GObject * obj)
{
	XmppXepBookmarks2Flag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_BOOKMARKS2_TYPE_FLAG, XmppXepBookmarks2Flag);
	_g_object_unref0 (self->conferences);
	G_OBJECT_CLASS (xmpp_xep_bookmarks2_flag_parent_class)->finalize (obj);
}

static GType
xmpp_xep_bookmarks2_flag_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepBookmarks2FlagClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_bookmarks2_flag_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepBookmarks2Flag), 0, (GInstanceInitFunc) xmpp_xep_bookmarks2_flag_instance_init, NULL };
	GType xmpp_xep_bookmarks2_flag_type_id;
	xmpp_xep_bookmarks2_flag_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_FLAG, "XmppXepBookmarks2Flag", &g_define_type_info, 0);
	return xmpp_xep_bookmarks2_flag_type_id;
}

GType
xmpp_xep_bookmarks2_flag_get_type (void)
{
	static volatile gsize xmpp_xep_bookmarks2_flag_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_bookmarks2_flag_type_id__once)) {
		GType xmpp_xep_bookmarks2_flag_type_id;
		xmpp_xep_bookmarks2_flag_type_id = xmpp_xep_bookmarks2_flag_get_type_once ();
		g_once_init_leave (&xmpp_xep_bookmarks2_flag_type_id__once, xmpp_xep_bookmarks2_flag_type_id);
	}
	return xmpp_xep_bookmarks2_flag_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;
}

