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

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

#define DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER (dino_muc_manager_received_message_listener_get_type ())
#define DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoMucManagerReceivedMessageListener))
#define DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoMucManagerReceivedMessageListenerClass))
#define DINO_MUC_MANAGER_IS_RECEIVED_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER))
#define DINO_MUC_MANAGER_IS_RECEIVED_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER))
#define DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoMucManagerReceivedMessageListenerClass))

typedef struct _DinoMucManagerReceivedMessageListener DinoMucManagerReceivedMessageListener;
typedef struct _DinoMucManagerReceivedMessageListenerClass DinoMucManagerReceivedMessageListenerClass;
enum  {
	DINO_MUC_MANAGER_0_PROPERTY,
	DINO_MUC_MANAGER_ID_PROPERTY,
	DINO_MUC_MANAGER_NUM_PROPERTIES
};
static GParamSpec* dino_muc_manager_properties[DINO_MUC_MANAGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block23Data Block23Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_xep_muc_join_result_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_muc_join_result_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
typedef struct _Block24Data Block24Data;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _Block25Data Block25Data;
#define _dino_history_sync_unref0(var) ((var == NULL) ? NULL : (var = (dino_history_sync_unref (var), NULL)))
#define _qlite_row_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_unref (var), NULL)))
typedef struct _DinoMucManagerJoinData DinoMucManagerJoinData;
#define _xmpp_xep_data_forms_data_form_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_data_forms_data_form_unref (var), NULL)))
typedef struct _DinoMucManagerGetConfigFormData DinoMucManagerGetConfigFormData;
typedef struct _DinoMucManagerSetConfigFormData DinoMucManagerSetConfigFormData;
typedef struct _DinoMucManagerChangeNickData DinoMucManagerChangeNickData;
typedef struct _DinoMucManagerGetBookmarksData DinoMucManagerGetBookmarksData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block26Data Block26Data;
#define _xmpp_xep_service_discovery_items_result_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_service_discovery_items_result_unref (var), NULL)))
#define _xmpp_xep_service_discovery_item_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_service_discovery_item_unref (var), NULL)))
#define _xmpp_xep_service_discovery_identity_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_service_discovery_identity_unref (var), NULL)))
typedef struct _DinoMucManagerSearchDefaultMucServerData DinoMucManagerSearchDefaultMucServerData;
typedef struct _DinoMucManagerOnStreamNegotiatedData DinoMucManagerOnStreamNegotiatedData;
typedef struct _Block27Data Block27Data;
typedef struct _DinoMucManagerInitializeBookmarksProviderData DinoMucManagerInitializeBookmarksProviderData;
typedef struct _Block28Data Block28Data;
typedef struct _Block29Data Block29Data;
typedef struct _Block30Data Block30Data;
typedef struct _Block31Data Block31Data;
typedef struct _Block32Data Block32Data;
typedef struct _DinoMucManagerReceivedMessageListenerPrivate DinoMucManagerReceivedMessageListenerPrivate;
enum  {
	DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_0_PROPERTY,
	DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY,
	DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY,
	DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_muc_manager_received_message_listener_properties[DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_NUM_PROPERTIES];
typedef struct _DinoMucManagerReceivedMessageListenerRunData DinoMucManagerReceivedMessageListenerRunData;
enum  {
	DINO_MUC_MANAGER_LEFT_SIGNAL,
	DINO_MUC_MANAGER_SUBJECT_SET_SIGNAL,
	DINO_MUC_MANAGER_ROOM_INFO_UPDATED_SIGNAL,
	DINO_MUC_MANAGER_PRIVATE_ROOM_OCCUPANT_UPDATED_SIGNAL,
	DINO_MUC_MANAGER_INVITE_RECEIVED_SIGNAL,
	DINO_MUC_MANAGER_VOICE_REQUEST_RECEIVED_SIGNAL,
	DINO_MUC_MANAGER_RECEIVED_OCCUPANT_ROLE_SIGNAL,
	DINO_MUC_MANAGER_BOOKMARKS_UPDATED_SIGNAL,
	DINO_MUC_MANAGER_CONFERENCE_ADDED_SIGNAL,
	DINO_MUC_MANAGER_CONFERENCE_REMOVED_SIGNAL,
	DINO_MUC_MANAGER_NUM_SIGNALS
};
static guint dino_muc_manager_signals[DINO_MUC_MANAGER_NUM_SIGNALS] = {0};

struct _DinoMucManagerPrivate {
	DinoStreamInteractor* stream_interactor;
	GeeHashMap* mucs_joined;
	GeeHashMap* mucs_joining;
	GeeHashMap* mucs_sync_cancellables;
	GeeHashMap* enter_errors;
	DinoMucManagerReceivedMessageListener* received_message_listener;
	GeeHashMap* bookmarks_provider;
	GeeHashMap* invites;
	GeeHashMap* own_occupant_ids;
};

struct _Block23Data {
	int _ref_count_;
	DinoMucManager* self;
	DinoStreamInteractor* stream_interactor;
};

struct _Block24Data {
	int _ref_count_;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppJid* jid;
	gpointer _async_data_;
};

struct _Block25Data {
	int _ref_count_;
	Block24Data * _data24_;
	DinoHistorySync* history_sync;
};

struct _DinoMucManagerJoinData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppJid* jid;
	gchar* nick;
	gchar* password;
	gboolean already_autojoin;
	GCancellable* cancellable;
	XmppXepMucJoinResult* result;
	Block24Data* _data24_;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* nick_;
	gchar* _tmp9_;
	GDateTime* history_since;
	DinoEntitiesConversation* conversation;
	DinoStreamInteractor* _tmp10_;
	DinoModuleIdentity* _tmp11_;
	gpointer _tmp12_;
	DinoConversationManager* _tmp13_;
	DinoEntitiesConversation* _tmp14_;
	DinoEntitiesConversation* _tmp15_;
	DinoEntitiesConversation* _tmp16_;
	DinoEntitiesMessage* last_message;
	DinoStreamInteractor* _tmp17_;
	DinoModuleIdentity* _tmp18_;
	gpointer _tmp19_;
	DinoMessageStorage* _tmp20_;
	DinoEntitiesConversation* _tmp21_;
	DinoEntitiesMessage* _tmp22_;
	DinoEntitiesMessage* _tmp23_;
	DinoEntitiesMessage* _tmp24_;
	DinoEntitiesMessage* _tmp25_;
	GDateTime* _tmp26_;
	GDateTime* _tmp27_;
	GDateTime* _tmp28_;
	gboolean receive_history;
	DinoEntityInfo* entity_info;
	DinoStreamInteractor* _tmp29_;
	DinoModuleIdentity* _tmp30_;
	gpointer _tmp31_;
	gboolean can_do_mam;
	DinoEntityInfo* _tmp32_;
	GeeHashMap* _tmp33_;
	GeeHashMap* _tmp34_;
	GeeHashSet* _tmp35_;
	GeeHashSet* _tmp36_;
	GeeHashMap* _tmp37_;
	gpointer _tmp38_;
	GeeHashSet* _tmp39_;
	XmppXepMucJoinResult* res;
	XmppXmppStream* _tmp40_;
	XmppModuleIdentity* _tmp41_;
	gpointer _tmp42_;
	XmppXepMucModule* _tmp43_;
	XmppXmppStream* _tmp44_;
	XmppJid* _tmp45_;
	XmppJid* _tmp46_;
	XmppJid* _tmp47_;
	const gchar* _tmp48_;
	GDateTime* _tmp49_;
	XmppXepMucJoinResult* _tmp50_;
	XmppXepMucJoinResult* _tmp51_;
	GeeHashMap* _tmp52_;
	gpointer _tmp53_;
	GeeHashSet* _tmp54_;
	XmppXepMucJoinResult* _tmp55_;
	const gchar* _tmp56_;
	GeeHashMap* _tmp57_;
	XmppXmppStream* _tmp58_;
	DinoStreamInteractor* _tmp59_;
	DinoModuleIdentity* _tmp60_;
	gpointer _tmp61_;
	DinoMessageProcessor* _tmp62_;
	DinoEntitiesConversation* joined_conversation;
	DinoStreamInteractor* _tmp63_;
	DinoModuleIdentity* _tmp64_;
	gpointer _tmp65_;
	DinoConversationManager* _tmp66_;
	DinoEntitiesConversationType _tmp67_;
	DinoEntitiesConversation* _tmp68_;
	DinoEntitiesConversation* _tmp69_;
	DinoEntitiesConversation* _tmp70_;
	DinoStreamInteractor* _tmp71_;
	DinoModuleIdentity* _tmp72_;
	gpointer _tmp73_;
	DinoConversationManager* _tmp74_;
	DinoEntitiesConversation* _tmp75_;
	Block25Data* _data25_;
	DinoStreamInteractor* _tmp76_;
	DinoModuleIdentity* _tmp77_;
	gpointer _tmp78_;
	DinoMessageProcessor* _tmp79_;
	DinoHistorySync* _tmp80_;
	DinoHistorySync* _tmp81_;
	DinoHistorySync* _tmp82_;
	DinoEntitiesConversation* _tmp83_;
	DinoHistorySync* _tmp84_;
	XmppJid* _tmp85_;
	XmppJid* _tmp86_;
	XmppJid* _tmp87_;
	GDateTime* _tmp88_;
	GDateTime* _tmp89_;
	QliteRow* _tmp90_;
	QliteRow* _tmp91_;
	GeeHashMap* _tmp92_;
	GeeHashMap* _tmp93_;
	GeeHashMap* _tmp94_;
	GeeHashMap* _tmp95_;
	GeeHashMap* _tmp96_;
	gpointer _tmp97_;
	GeeHashMap* _tmp98_;
	XmppJid* _tmp99_;
	XmppJid* _tmp100_;
	XmppJid* _tmp101_;
	gboolean _tmp102_;
	GeeHashMap* _tmp103_;
	gpointer _tmp104_;
	GeeHashMap* _tmp105_;
	XmppJid* _tmp106_;
	XmppJid* _tmp107_;
	XmppJid* _tmp108_;
	GCancellable* _tmp109_;
	GCancellable* _tmp110_;
	GDateTime* fetch_from_time;
	DinoEntitiesConversation* _tmp111_;
	GDateTime* _tmp112_;
	GDateTime* _tmp113_;
	GDateTime* _tmp114_;
	DinoHistorySync* _tmp115_;
	XmppJid* _tmp116_;
	XmppJid* _tmp117_;
	XmppJid* _tmp118_;
	GeeHashMap* _tmp119_;
	gpointer _tmp120_;
	GeeHashMap* _tmp121_;
	XmppJid* _tmp122_;
	XmppJid* _tmp123_;
	XmppJid* _tmp124_;
	gpointer _tmp125_;
	GCancellable* _tmp126_;
	GDateTime* _tmp127_;
	XmppXepMucJoinResult* _tmp128_;
	XmppXepMucMucEnterError* _tmp129_;
	GeeHashMap* _tmp130_;
	XmppXepMucJoinResult* _tmp131_;
	XmppXepMucMucEnterError* _tmp132_;
	GeeHashMap* _tmp133_;
	GeeHashMap* _tmp134_;
	GeeHashSet* _tmp135_;
	GeeHashSet* _tmp136_;
	const gchar* _tmp137_;
	XmppXepMucJoinResult* _tmp138_;
	const gchar* _tmp139_;
	const gchar* _tmp140_;
	XmppJid* _tmp141_;
	XmppJid* _tmp142_;
	GeeHashMap* _tmp143_;
	gpointer _tmp144_;
	GeeHashSet* _tmp145_;
	GError* _inner_error0_;
};

struct _DinoMucManagerGetConfigFormData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppJid* jid;
	XmppXepDataFormsDataForm* result;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	XmppXmppStream* _tmp3_;
	XmppModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	XmppXepMucModule* _tmp6_;
	XmppXmppStream* _tmp7_;
	XmppXepDataFormsDataForm* _tmp8_;
	XmppXepDataFormsDataForm* _tmp9_;
};

struct _DinoMucManagerSetConfigFormData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppJid* jid;
	XmppXepDataFormsDataForm* data_form;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	XmppXmppStream* _tmp3_;
	XmppModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	XmppXepMucModule* _tmp6_;
	XmppXmppStream* _tmp7_;
};

struct _DinoMucManagerChangeNickData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManager* self;
	DinoEntitiesConversation* conversation;
	gchar* new_nick;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	XmppXmppStream* _tmp3_;
	XmppXmppStream* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	XmppJid* _tmp8_;
	XmppXmppStream* _tmp9_;
	XmppModuleIdentity* _tmp10_;
	gpointer _tmp11_;
	XmppXepMucModule* _tmp12_;
	XmppXmppStream* _tmp13_;
	XmppJid* _tmp14_;
	XmppJid* _tmp15_;
	GeeHashMap* _tmp16_;
	DinoEntitiesAccount* _tmp17_;
	DinoEntitiesAccount* _tmp18_;
	GeeHashMap* _tmp19_;
	DinoEntitiesAccount* _tmp20_;
	DinoEntitiesAccount* _tmp21_;
	gpointer _tmp22_;
	GeeHashSet* _tmp23_;
	XmppJid* _tmp24_;
	XmppJid* _tmp25_;
	XmppJid* _tmp26_;
	XmppJid* _tmp27_;
	XmppJid* _tmp28_;
	XmppJid* _tmp29_;
	GeeHashMap* _tmp30_;
	DinoEntitiesAccount* _tmp31_;
	DinoEntitiesAccount* _tmp32_;
	gpointer _tmp33_;
	GeeHashSet* _tmp34_;
	GeeSet* conferences;
	GeeHashMap* _tmp35_;
	DinoEntitiesAccount* _tmp36_;
	DinoEntitiesAccount* _tmp37_;
	gpointer _tmp38_;
	XmppBookmarksProvider* _tmp39_;
	XmppXmppStream* _tmp40_;
	GeeSet* _tmp41_;
	GeeSet* _tmp42_;
	GeeSet* _tmp43_;
	GeeIterator* _conference_it;
	GeeSet* _tmp44_;
	GeeIterator* _tmp45_;
	GeeIterator* _tmp46_;
	XmppConference* conference;
	GeeIterator* _tmp47_;
	gpointer _tmp48_;
	XmppConference* _tmp49_;
	XmppJid* _tmp50_;
	XmppJid* _tmp51_;
	XmppJid* _tmp52_;
	XmppJid* _tmp53_;
	XmppConference* new_conference;
	XmppJid* _tmp54_;
	XmppJid* _tmp55_;
	XmppJid* _tmp56_;
	gchar* _tmp57_;
	XmppConference* _tmp58_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	gchar* _tmp61_;
	XmppConference* _tmp62_;
	const gchar* _tmp63_;
	const gchar* _tmp64_;
	gchar* _tmp65_;
	XmppConference* _tmp66_;
	gboolean _tmp67_;
	gboolean _tmp68_;
	XmppConference* _tmp69_;
	GeeHashMap* _tmp70_;
	DinoEntitiesAccount* _tmp71_;
	DinoEntitiesAccount* _tmp72_;
	gpointer _tmp73_;
	XmppBookmarksProvider* _tmp74_;
	XmppXmppStream* _tmp75_;
	XmppJid* _tmp76_;
	XmppJid* _tmp77_;
	XmppConference* _tmp78_;
	GError* _inner_error0_;
};

struct _DinoMucManagerGetBookmarksData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	GeeSet* result;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	GeeHashMap* _tmp3_;
	gpointer _tmp4_;
	XmppBookmarksProvider* _tmp5_;
	XmppXmppStream* _tmp6_;
	GeeSet* _tmp7_;
	GeeSet* _tmp8_;
};

struct _Block26Data {
	int _ref_count_;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
};

struct _DinoMucManagerSearchDefaultMucServerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	XmppXepServiceDiscoveryItemsResult* items_result;
	XmppXmppStream* _tmp3_;
	XmppModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	XmppXepServiceDiscoveryModule* _tmp6_;
	XmppXmppStream* _tmp7_;
	XmppXmppStream* _tmp8_;
	XmppJid* _tmp9_;
	XmppXepServiceDiscoveryItemsResult* _tmp10_;
	XmppXepServiceDiscoveryItemsResult* _tmp11_;
	XmppXepServiceDiscoveryItemsResult* _tmp12_;
	gint i;
	gboolean _tmp13_;
	gint _tmp14_;
	GeeArrayList* _item_list;
	XmppXepServiceDiscoveryItemsResult* _tmp15_;
	GeeArrayList* _tmp16_;
	GeeArrayList* _tmp17_;
	gint _item_size;
	GeeArrayList* _tmp18_;
	gint _tmp19_;
	gint _tmp20_;
	gint _item_index;
	gint _tmp21_;
	gint _tmp22_;
	XmppXepServiceDiscoveryItem* item;
	GeeArrayList* _tmp23_;
	gpointer _tmp24_;
	gboolean _tmp25_;
	gboolean _tmp26_;
	XmppXepServiceDiscoveryItem* _tmp27_;
	XmppJid* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gboolean _tmp31_;
	XmppXepServiceDiscoveryItem* _tmp32_;
	XmppJid* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	XmppXepServiceDiscoveryItem* _tmp36_;
	XmppJid* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gboolean promising_upload_item;
	gboolean _tmp40_;
	gboolean _tmp41_;
	gboolean _tmp42_;
	GeeSet* identities;
	DinoStreamInteractor* _tmp43_;
	DinoModuleIdentity* _tmp44_;
	gpointer _tmp45_;
	DinoEntityInfo* _tmp46_;
	XmppXepServiceDiscoveryItem* _tmp47_;
	XmppJid* _tmp48_;
	GeeSet* _tmp49_;
	GeeSet* _tmp50_;
	GeeSet* _tmp51_;
	GeeIterator* _identity_it;
	GeeSet* _tmp52_;
	GeeIterator* _tmp53_;
	GeeIterator* _tmp54_;
	XmppXepServiceDiscoveryIdentity* identity;
	GeeIterator* _tmp55_;
	gpointer _tmp56_;
	XmppXepServiceDiscoveryIdentity* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	GeeHashMap* _tmp60_;
	XmppXepServiceDiscoveryItem* _tmp61_;
	XmppJid* _tmp62_;
	XmppJid* _tmp63_;
	XmppJid* _tmp64_;
	XmppJid* _tmp65_;
	gchar* _tmp66_;
	gchar* _tmp67_;
	XmppXepServiceDiscoveryItem* _tmp68_;
	XmppJid* _tmp69_;
	gchar* _tmp70_;
	gchar* _tmp71_;
};

struct _DinoMucManagerOnStreamNegotiatedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppXmppStream* stream;
	GeeHashMap* _tmp0_;
	GeeIterator* _cancellable_it;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	GeeHashMap* _tmp3_;
	GeeCollection* _tmp4_;
	GeeCollection* _tmp5_;
	GeeCollection* _tmp6_;
	GeeIterator* _tmp7_;
	GeeIterator* _tmp8_;
	GeeIterator* _tmp9_;
	GCancellable* cancellable;
	GeeIterator* _tmp10_;
	gpointer _tmp11_;
	GCancellable* _tmp12_;
	GCancellable* _tmp13_;
	GeeSet* conferences;
	GeeHashMap* _tmp14_;
	gpointer _tmp15_;
	XmppBookmarksProvider* _tmp16_;
	GeeSet* _tmp17_;
	GeeSet* _tmp18_;
	GeeSet* _tmp19_;
	GeeSet* _tmp20_;
	GeeHashMap* _tmp21_;
};

struct _Block27Data {
	int _ref_count_;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	gpointer _async_data_;
};

struct _DinoMucManagerInitializeBookmarksProviderData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	Block27Data* _data27_;
	GeeHashMap* _tmp0_;
	gboolean has_feature;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoEntityInfo* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	gboolean _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	GeeHashMap* _tmp14_;
	DinoStreamInteractor* _tmp15_;
	DinoModuleManager* _tmp16_;
	XmppModuleIdentity* _tmp17_;
	gpointer _tmp18_;
	XmppXepBookmarks2Module* _tmp19_;
	XmppJid* _tmp20_;
	XmppJid* _tmp21_;
	XmppJid* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GeeHashMap* _tmp25_;
	DinoStreamInteractor* _tmp26_;
	DinoModuleManager* _tmp27_;
	XmppModuleIdentity* _tmp28_;
	gpointer _tmp29_;
	XmppXepBookmarksModule* _tmp30_;
	GeeHashMap* _tmp31_;
	gpointer _tmp32_;
	XmppBookmarksProvider* _tmp33_;
	GeeHashMap* _tmp34_;
	gpointer _tmp35_;
	XmppBookmarksProvider* _tmp36_;
	GeeHashMap* _tmp37_;
	gpointer _tmp38_;
	XmppBookmarksProvider* _tmp39_;
};

struct _Block28Data {
	int _ref_count_;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppJid* room_jid;
};

struct _Block29Data {
	int _ref_count_;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppXmppStream* stream;
	XmppJid* jid;
	gchar* nick;
	gchar* password;
};

struct _Block30Data {
	int _ref_count_;
	DinoMucManager* self;
	DinoEntitiesAccount* account;
	XmppXmppStream* stream;
	XmppJid* jid;
};

struct _Block31Data {
	int _ref_count_;
	DinoMucManager* self;
	XmppXmppStream* stream;
	DinoEntitiesAccount* account;
};

struct _Block32Data {
	int _ref_count_;
	Block31Data * _data31_;
	XmppJid* jid;
	gboolean joined;
};

struct _DinoMucManagerReceivedMessageListener {
	DinoMessageListener parent_instance;
	DinoMucManagerReceivedMessageListenerPrivate * priv;
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _DinoMucManagerReceivedMessageListenerClass {
	DinoMessageListenerClass parent_class;
};

struct _DinoMucManagerReceivedMessageListenerPrivate {
	DinoStreamInteractor* stream_interactor;
};

struct _DinoMucManagerReceivedMessageListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMucManagerReceivedMessageListener* self;
	DinoEntitiesMessage* message;
	XmppMessageStanza* stanza;
	DinoEntitiesConversation* conversation;
	gboolean result;
	DinoEntitiesConversationType _tmp0_;
	DinoEntitiesConversationType _tmp1_;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	DinoEntitiesAccount* _tmp4_;
	XmppXmppStream* _tmp5_;
	XmppXmppStream* _tmp6_;
	XmppXepDelayedDeliveryMessageFlag* _tmp7_;
	XmppXepDelayedDeliveryMessageFlag* _tmp8_;
	gboolean _tmp9_;
	XmppJid* real_jid;
	XmppXmppStream* _tmp10_;
	XmppFlagIdentity* _tmp11_;
	gpointer _tmp12_;
	XmppXepMucFlag* _tmp13_;
	XmppJid* _tmp14_;
	XmppJid* _tmp15_;
	XmppJid* _tmp16_;
	XmppJid* _tmp17_;
	gboolean _tmp18_;
	XmppJid* _tmp19_;
	XmppJid* _tmp20_;
	XmppJid* _tmp21_;
	XmppJid* _tmp22_;
	XmppJid* _tmp23_;
	XmppJid* _tmp24_;
	XmppJid* _tmp25_;
	XmppJid* _tmp26_;
	XmppJid* own_muc_jid;
	DinoStreamInteractor* _tmp27_;
	DinoModuleIdentity* _tmp28_;
	gpointer _tmp29_;
	DinoMucManager* _tmp30_;
	XmppJid* _tmp31_;
	XmppJid* _tmp32_;
	XmppJid* _tmp33_;
	XmppJid* _tmp34_;
	XmppJid* _tmp35_;
	DinoEntitiesAccount* _tmp36_;
	DinoEntitiesAccount* _tmp37_;
	XmppJid* _tmp38_;
	XmppJid* _tmp39_;
	gboolean _tmp40_;
	gboolean _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	XmppJid* _tmp44_;
	XmppJid* _tmp45_;
	XmppJid* _tmp46_;
	XmppJid* _tmp47_;
	DinoEntitiesMessage* m;
	DinoStreamInteractor* _tmp48_;
	DinoModuleIdentity* _tmp49_;
	gpointer _tmp50_;
	DinoMessageStorage* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	DinoEntitiesMessage* _tmp54_;
	DinoEntitiesMessage* _tmp55_;
	DinoEntitiesMessage* _tmp56_;
	DinoEntitiesMessage* _tmp57_;
	gchar* server_id;
	DinoEntitiesMessage* _tmp58_;
	XmppJid* _tmp59_;
	XmppJid* _tmp60_;
	XmppJid* _tmp61_;
	XmppJid* _tmp62_;
	XmppJid* _tmp63_;
	gchar* _tmp64_;
	gchar* _tmp65_;
	const gchar* _tmp66_;
	DinoEntitiesMessage* _tmp67_;
	const gchar* _tmp68_;
};

static gint DinoMucManager_private_offset;
static gpointer dino_muc_manager_parent_class = NULL;
DinoModuleIdentity* dino_muc_manager_IDENTITY = NULL;
static gint DinoMucManagerReceivedMessageListener_private_offset;
static gpointer dino_muc_manager_received_message_listener_parent_class = NULL;
static DinoStreamInteractionModuleIface * dino_muc_manager_dino_stream_interaction_module_parent_iface = NULL;

static GType dino_muc_manager_received_message_listener_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static guint _dino_entities_account_hash_func_gee_hash_data_func (gconstpointer v,
                                                           gpointer self);
static gboolean _dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                                 gconstpointer b,
                                                                 gpointer self);
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 DinoMucManager* dino_muc_manager_new (DinoStreamInteractor* stream_interactor);
static DinoMucManager* dino_muc_manager_construct (GType object_type,
                                            DinoStreamInteractor* stream_interactor);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static DinoMucManagerReceivedMessageListener* dino_muc_manager_received_message_listener_new (DinoStreamInteractor* stream_interactor);
static DinoMucManagerReceivedMessageListener* dino_muc_manager_received_message_listener_construct (GType object_type,
                                                                                             DinoStreamInteractor* stream_interactor);
static void dino_muc_manager_on_account_added (DinoMucManager* self,
                                        DinoEntitiesAccount* account);
static void _dino_muc_manager_on_account_added_dino_stream_interactor_account_added (DinoStreamInteractor* _sender,
                                                                              DinoEntitiesAccount* account,
                                                                              gpointer self);
static void dino_muc_manager_on_stream_negotiated (DinoMucManager* self,
                                            DinoEntitiesAccount* account,
                                            XmppXmppStream* stream,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
static void dino_muc_manager_on_stream_negotiated_finish (DinoMucManager* self,
                                                   GAsyncResult* _res_);
static void _dino_muc_manager_on_stream_negotiated_dino_stream_interactor_stream_negotiated (DinoStreamInteractor* _sender,
                                                                                      DinoEntitiesAccount* account,
                                                                                      XmppXmppStream* stream,
                                                                                      gpointer self);
static void __lambda98_ (DinoMucManager* self,
                  DinoEntitiesConversation* conversation);
static void ___lambda98__dino_conversation_manager_conversation_deactivated (DinoConversationManager* _sender,
                                                                      DinoEntitiesConversation* conversation,
                                                                      gpointer self);
static void __lambda99_ (DinoMucManager* self,
                  DinoEntitiesAccount* account,
                  XmppXmppStream* stream);
static void dino_muc_manager_self_ping (DinoMucManager* self,
                                 DinoEntitiesAccount* account);
static void ___lambda99__dino_stream_interactor_stream_resumed (DinoStreamInteractor* _sender,
                                                         DinoEntitiesAccount* account,
                                                         XmppXmppStream* stream,
                                                         gpointer self);
static gboolean __lambda102_ (Block23Data* _data23_);
static gboolean ___lambda102__gsource_func (gpointer self);
static void dino_muc_manager_on_build_message_stanza (DinoMucManager* self,
                                               DinoEntitiesMessage* message,
                                               XmppMessageStanza* message_stanza,
                                               DinoEntitiesConversation* conversation);
static void _dino_muc_manager_on_build_message_stanza_dino_message_processor_build_message_stanza (DinoMessageProcessor* _sender,
                                                                                            DinoEntitiesMessage* message,
                                                                                            XmppMessageStanza* message_stanza,
                                                                                            DinoEntitiesConversation* conversation,
                                                                                            gpointer self);
static void dino_muc_manager_join_data_free (gpointer _data);
static gboolean dino_muc_manager_join_co (DinoMucManagerJoinData* _data_);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static void dino_muc_manager_join_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_);
static guint _xmpp_jid_hash_bare_func_gee_hash_data_func (gconstpointer v,
                                                   gpointer self);
static gboolean _xmpp_jid_equals_bare_func_gee_equal_data_func (gconstpointer a,
                                                         gconstpointer b,
                                                         gpointer self);
static void dino_muc_manager_set_autojoin (DinoMucManager* self,
                                    DinoEntitiesAccount* account,
                                    XmppXmppStream* stream,
                                    XmppJid* jid,
                                    const gchar* nick,
                                    const gchar* password);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static void ______lambda94_ (Block25Data* _data25_,
                      GObject* _,
                      GAsyncResult* res);
static void _______lambda94__gasync_ready_callback (GObject* source_object,
                                             GAsyncResult* res,
                                             gpointer self);
static void dino_muc_manager_unset_autojoin (DinoMucManager* self,
                                      DinoEntitiesAccount* account,
                                      XmppXmppStream* stream,
                                      XmppJid* jid);
static void dino_muc_manager_cancel_sync (DinoMucManager* self,
                                   DinoEntitiesAccount* account,
                                   XmppJid* jid);
static void dino_muc_manager_get_config_form_data_free (gpointer _data);
static gboolean dino_muc_manager_get_config_form_co (DinoMucManagerGetConfigFormData* _data_);
static void dino_muc_manager_get_config_form_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static void dino_muc_manager_set_config_form_data_free (gpointer _data);
static gboolean dino_muc_manager_set_config_form_co (DinoMucManagerSetConfigFormData* _data_);
static void dino_muc_manager_set_config_form_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static void dino_muc_manager_change_nick_data_free (gpointer _data);
static gboolean dino_muc_manager_change_nick_co (DinoMucManagerChangeNickData* _data_);
static void dino_muc_manager_change_nick_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dino_muc_manager_get_bookmarks_data_free (gpointer _data);
static gboolean dino_muc_manager_get_bookmarks_co (DinoMucManagerGetBookmarksData* _data_);
static void dino_muc_manager_get_bookmarks_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static XmppXepMucFlag* dino_muc_manager_get_muc_flag (DinoMucManager* self,
                                               DinoEntitiesAccount* account);
static XmppXepMucAffiliation* _xmpp_xep_muc_affiliation_dup (XmppXepMucAffiliation* self);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static void __lambda22_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  XmppJid* jid,
                  XmppXepMucStatusCode code);
static void ___lambda22__xmpp_xep_muc_module_self_removed_from_room (XmppXepMucModule* _sender,
                                                              XmppXmppStream* stream,
                                                              XmppJid* jid,
                                                              XmppXepMucStatusCode code,
                                                              gpointer self);
static void __lambda23_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  const gchar* subject,
                  XmppJid* jid);
static void ___lambda23__xmpp_xep_muc_module_subject_set (XmppXepMucModule* _sender,
                                                   XmppXmppStream* stream,
                                                   const gchar* subject,
                                                   XmppJid* jid,
                                                   gpointer self);
static void __lambda24_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  XmppJid* room_jid,
                  XmppJid* from_jid,
                  const gchar* password,
                  const gchar* reason);
static void dino_muc_manager_on_invite_received (DinoMucManager* self,
                                          DinoEntitiesAccount* account,
                                          XmppJid* room_jid,
                                          XmppJid* from_jid,
                                          const gchar* password,
                                          const gchar* reason);
static void ___lambda24__xmpp_xep_muc_module_invite_received (XmppXepMucModule* _sender,
                                                       XmppXmppStream* stream,
                                                       XmppJid* room_jid,
                                                       XmppJid* from_jid,
                                                       const gchar* password,
                                                       const gchar* reason,
                                                       gpointer self);
static void __lambda26_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  XmppJid* room_jid,
                  XmppJid* from_jid,
                  const gchar* password,
                  const gchar* reason);
static void ___lambda26__xmpp_xep_direct_muc_invitations_module_invite_received (XmppXepDirectMucInvitationsModule* _sender,
                                                                          XmppXmppStream* stream,
                                                                          XmppJid* room_jid,
                                                                          XmppJid* from_jid,
                                                                          const gchar* password,
                                                                          const gchar* reason,
                                                                          gpointer self);
static void __lambda27_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  XmppJid* room_jid,
                  XmppJid* from_jid,
                  const gchar* nick);
static void ___lambda27__xmpp_xep_muc_module_voice_request_received (XmppXepMucModule* _sender,
                                                              XmppXmppStream* stream,
                                                              XmppJid* room_jid,
                                                              XmppJid* from_jid,
                                                              const gchar* nick,
                                                              gpointer self);
static void __lambda28_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  XmppJid* from_jid,
                  XmppXepMucRole* role);
static void ___lambda28__xmpp_xep_muc_module_received_occupant_role (XmppXepMucModule* _sender,
                                                              XmppXmppStream* stream,
                                                              XmppJid* jid,
                                                              XmppXepMucRole* role,
                                                              gpointer self);
static void __lambda29_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  XmppJid* muc_jid);
static void ___lambda29__xmpp_xep_muc_module_room_info_updated (XmppXepMucModule* _sender,
                                                         XmppXmppStream* stream,
                                                         XmppJid* muc_jid,
                                                         gpointer self);
static void __lambda30_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  XmppJid* room,
                  XmppJid* occupant);
static void ___lambda30__xmpp_xep_muc_module_received_occupant_jid (XmppXepMucModule* _sender,
                                                             XmppXmppStream* stream,
                                                             XmppJid* jid,
                                                             XmppJid* real_jid,
                                                             gpointer self);
static void __lambda91_ (Block26Data* _data26_,
                  XmppXmppStream* stream,
                  XmppJid* jid,
                  const gchar* occupant_id);
static void ___lambda91__xmpp_xep_occupant_ids_module_received_own_occupant_id (XmppXepOccupantIdsModule* _sender,
                                                                         XmppXmppStream* stream,
                                                                         XmppJid* jid,
                                                                         const gchar* occupant_id,
                                                                         gpointer self);
static void dino_muc_manager_search_default_muc_server_data_free (gpointer _data);
static void dino_muc_manager_search_default_muc_server (DinoMucManager* self,
                                                 DinoEntitiesAccount* account,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void dino_muc_manager_search_default_muc_server_finish (DinoMucManager* self,
                                                        GAsyncResult* _res_);
static gboolean dino_muc_manager_search_default_muc_server_co (DinoMucManagerSearchDefaultMucServerData* _data_);
static void dino_muc_manager_search_default_muc_server_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static void dino_muc_manager_on_stream_negotiated_data_free (gpointer _data);
static gboolean dino_muc_manager_on_stream_negotiated_co (DinoMucManagerOnStreamNegotiatedData* _data_);
static void dino_muc_manager_initialize_bookmarks_provider (DinoMucManager* self,
                                                     DinoEntitiesAccount* account,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static void dino_muc_manager_initialize_bookmarks_provider_finish (DinoMucManager* self,
                                                            GAsyncResult* _res_);
static void dino_muc_manager_on_stream_negotiated_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void dino_muc_manager_join_all_active (DinoMucManager* self,
                                       DinoEntitiesAccount* account);
static void dino_muc_manager_sync_autojoin_active (DinoMucManager* self,
                                            DinoEntitiesAccount* account,
                                            GeeSet* conferences);
static void dino_muc_manager_initialize_bookmarks_provider_data_free (gpointer _data);
static gboolean dino_muc_manager_initialize_bookmarks_provider_co (DinoMucManagerInitializeBookmarksProviderData* _data_);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static void dino_muc_manager_initialize_bookmarks_provider_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void __lambda92_ (Block27Data* _data27_,
                  XmppXmppStream* stream,
                  GeeSet* conferences);
static void ___lambda92__xmpp_bookmarks_provider_received_conferences (XmppBookmarksProvider* _sender,
                                                                XmppXmppStream* stream,
                                                                GeeSet* conferences,
                                                                gpointer self);
static void __lambda96_ (Block27Data* _data27_,
                  XmppXmppStream* stream,
                  XmppConference* conference);
static void dino_muc_manager_on_conference_added (DinoMucManager* self,
                                           DinoEntitiesAccount* account,
                                           XmppConference* conference);
static void ___lambda96__xmpp_bookmarks_provider_conference_added (XmppBookmarksProvider* _sender,
                                                            XmppXmppStream* stream,
                                                            XmppConference* conferences,
                                                            gpointer self);
static void __lambda97_ (Block27Data* _data27_,
                  XmppXmppStream* stream,
                  XmppJid* jid);
static void dino_muc_manager_on_conference_removed (DinoMucManager* self,
                                             DinoEntitiesAccount* account,
                                             XmppJid* jid);
static void ___lambda97__xmpp_bookmarks_provider_conference_removed (XmppBookmarksProvider* _sender,
                                                              XmppXmppStream* stream,
                                                              XmppJid* jid,
                                                              gpointer self);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static gboolean __lambda25_ (Block28Data* _data28_);
static gboolean ___lambda25__gsource_func (gpointer self);
static Block29Data* block29_data_ref (Block29Data* _data29_);
static void block29_data_unref (void * _userdata_);
static void __lambda93_ (Block29Data* _data29_,
                  GObject* _,
                  GAsyncResult* res);
static void ___lambda93__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
static void __lambda95_ (Block30Data* _data30_,
                  GObject* _,
                  GAsyncResult* res);
static void ___lambda95__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static void ____lambda100_ (Block32Data* _data32_,
                     GObject* _,
                     GAsyncResult* res);
static void _____lambda100__gasync_ready_callback (GObject* source_object,
                                            GAsyncResult* res,
                                            gpointer self);
static gboolean ____lambda101_ (Block32Data* _data32_);
static gboolean _____lambda101__gsource_func (gpointer self);
static void g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_STRING (GClosure * closure,
                                                           GValue * return_value,
                                                           guint n_param_values,
                                                           const GValue * param_values,
                                                           gpointer invocation_hint,
                                                           gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_XMPP_JID (GClosure * closure,
                                                             GValue * return_value,
                                                             guint n_param_values,
                                                             const GValue * param_values,
                                                             gpointer invocation_hint,
                                                             gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_XMPP_JID_STRING_STRING (GClosure * closure,
                                                                           GValue * return_value,
                                                                           guint n_param_values,
                                                                           const GValue * param_values,
                                                                           gpointer invocation_hint,
                                                                           gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_XMPP_JID_STRING (GClosure * closure,
                                                                    GValue * return_value,
                                                                    guint n_param_values,
                                                                    const GValue * param_values,
                                                                    gpointer invocation_hint,
                                                                    gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_POINTER (GClosure * closure,
                                                            GValue * return_value,
                                                            guint n_param_values,
                                                            const GValue * param_values,
                                                            gpointer invocation_hint,
                                                            gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void dino_muc_manager_received_message_listener_real_run_data_free (gpointer _data);
static void dino_muc_manager_received_message_listener_real_run (DinoMessageListener* base,
                                                          DinoEntitiesMessage* message,
                                                          XmppMessageStanza* stanza,
                                                          DinoEntitiesConversation* conversation,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static gboolean dino_muc_manager_received_message_listener_real_run_co (DinoMucManagerReceivedMessageListenerRunData* _data_);
static void dino_muc_manager_received_message_listener_finalize (GObject * obj);
static GType dino_muc_manager_received_message_listener_get_type_once (void);
static void _vala_dino_muc_manager_received_message_listener_get_property (GObject * object,
                                                                    guint property_id,
                                                                    GValue * value,
                                                                    GParamSpec * pspec);
static void dino_muc_manager_finalize (GObject * obj);
static GType dino_muc_manager_get_type_once (void);
static void _vala_dino_muc_manager_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_muc_manager_get_instance_private (DinoMucManager* self)
{
	return G_STRUCT_MEMBER_P (self, DinoMucManager_private_offset);
}

static guint
_dino_entities_account_hash_func_gee_hash_data_func (gconstpointer v,
                                                     gpointer self)
{
	guint result;
	result = dino_entities_account_hash_func ((DinoEntitiesAccount*) v);
	return result;
}

static gboolean
_dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                        gconstpointer b,
                                                        gpointer self)
{
	gboolean result;
	result = dino_entities_account_equals_func ((DinoEntitiesAccount*) a, (DinoEntitiesAccount*) b);
	return result;
}

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

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

void
dino_muc_manager_start (DinoStreamInteractor* stream_interactor)
{
	DinoMucManager* m = NULL;
	DinoMucManager* _tmp0_;
	g_return_if_fail (stream_interactor != NULL);
	_tmp0_ = dino_muc_manager_new (stream_interactor);
	m = _tmp0_;
	dino_stream_interactor_add_module (stream_interactor, (DinoStreamInteractionModule*) m);
	_g_object_unref0 (m);
}

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

static Block23Data*
block23_data_ref (Block23Data* _data23_)
{
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}

static void
block23_data_unref (void * _userdata_)
{
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		DinoMucManager* self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->stream_interactor);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}

static void
_dino_muc_manager_on_account_added_dino_stream_interactor_account_added (DinoStreamInteractor* _sender,
                                                                         DinoEntitiesAccount* account,
                                                                         gpointer self)
{
	dino_muc_manager_on_account_added ((DinoMucManager*) self, account);
}

static void
_dino_muc_manager_on_stream_negotiated_dino_stream_interactor_stream_negotiated (DinoStreamInteractor* _sender,
                                                                                 DinoEntitiesAccount* account,
                                                                                 XmppXmppStream* stream,
                                                                                 gpointer self)
{
	dino_muc_manager_on_stream_negotiated ((DinoMucManager*) self, account, stream, NULL, NULL);
}

static void
__lambda98_ (DinoMucManager* self,
             DinoEntitiesConversation* conversation)
{
	DinoEntitiesConversationType _tmp0_;
	DinoEntitiesConversationType _tmp1_;
	g_return_if_fail (conversation != NULL);
	_tmp0_ = dino_entities_conversation_get_type_ (conversation);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		DinoEntitiesAccount* _tmp2_;
		DinoEntitiesAccount* _tmp3_;
		XmppJid* _tmp4_;
		XmppJid* _tmp5_;
		_tmp2_ = dino_entities_conversation_get_account (conversation);
		_tmp3_ = _tmp2_;
		_tmp4_ = dino_entities_conversation_get_counterpart (conversation);
		_tmp5_ = _tmp4_;
		dino_muc_manager_part (self, _tmp3_, _tmp5_);
	}
}

static void
___lambda98__dino_conversation_manager_conversation_deactivated (DinoConversationManager* _sender,
                                                                 DinoEntitiesConversation* conversation,
                                                                 gpointer self)
{
	__lambda98_ ((DinoMucManager*) self, conversation);
}

static void
__lambda99_ (DinoMucManager* self,
             DinoEntitiesAccount* account,
             XmppXmppStream* stream)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (stream != NULL);
	dino_muc_manager_self_ping (self, account);
}

static void
___lambda99__dino_stream_interactor_stream_resumed (DinoStreamInteractor* _sender,
                                                    DinoEntitiesAccount* account,
                                                    XmppXmppStream* stream,
                                                    gpointer self)
{
	__lambda99_ ((DinoMucManager*) self, account, stream);
}

static gboolean
__lambda102_ (Block23Data* _data23_)
{
	DinoMucManager* self;
	gboolean result;
	self = _data23_->self;
	{
		GeeArrayList* _account_list = NULL;
		GeeArrayList* _tmp0_;
		gint _account_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _account_index = 0;
		_tmp0_ = dino_stream_interactor_get_accounts (_data23_->stream_interactor);
		_account_list = _tmp0_;
		_tmp1_ = _account_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_account_size = _tmp3_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			DinoEntitiesAccount* account = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			DinoEntitiesAccount* _tmp8_;
			_account_index = _account_index + 1;
			_tmp4_ = _account_index;
			_tmp5_ = _account_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _account_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _account_index);
			account = (DinoEntitiesAccount*) _tmp7_;
			_tmp8_ = account;
			dino_muc_manager_self_ping (self, _tmp8_);
			_g_object_unref0 (account);
		}
		_g_object_unref0 (_account_list);
	}
	result = TRUE;
	return result;
}

static gboolean
___lambda102__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda102_ (self);
	return result;
}

static void
_dino_muc_manager_on_build_message_stanza_dino_message_processor_build_message_stanza (DinoMessageProcessor* _sender,
                                                                                       DinoEntitiesMessage* message,
                                                                                       XmppMessageStanza* message_stanza,
                                                                                       DinoEntitiesConversation* conversation,
                                                                                       gpointer self)
{
	dino_muc_manager_on_build_message_stanza ((DinoMucManager*) self, message, message_stanza, conversation);
}

static DinoMucManager*
dino_muc_manager_construct (GType object_type,
                            DinoStreamInteractor* stream_interactor)
{
	DinoMucManager * self = NULL;
	Block23Data* _data23_;
	DinoStreamInteractor* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoMucManagerReceivedMessageListener* _tmp2_;
	DinoModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	DinoMessageProcessor* _tmp5_;
	DinoMessageListenerHolder* _tmp6_;
	DinoMucManagerReceivedMessageListener* _tmp7_;
	DinoModuleIdentity* _tmp8_;
	gpointer _tmp9_;
	DinoConversationManager* _tmp10_;
	DinoModuleIdentity* _tmp11_;
	gpointer _tmp12_;
	DinoMessageProcessor* _tmp13_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (_data23_->stream_interactor);
	_data23_->stream_interactor = _tmp0_;
	self = (DinoMucManager*) g_object_new (object_type, NULL);
	_data23_->self = g_object_ref (self);
	_tmp1_ = _g_object_ref0 (_data23_->stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp1_;
	_tmp2_ = dino_muc_manager_received_message_listener_new (_data23_->stream_interactor);
	_g_object_unref0 (self->priv->received_message_listener);
	self->priv->received_message_listener = _tmp2_;
	g_signal_connect_object (_data23_->stream_interactor, "account-added", (GCallback) _dino_muc_manager_on_account_added_dino_stream_interactor_account_added, self, 0);
	g_signal_connect_object (_data23_->stream_interactor, "stream-negotiated", (GCallback) _dino_muc_manager_on_stream_negotiated_dino_stream_interactor_stream_negotiated, self, 0);
	_tmp3_ = dino_message_processor_IDENTITY;
	_tmp4_ = dino_stream_interactor_get_module (_data23_->stream_interactor, DINO_TYPE_MESSAGE_PROCESSOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
	_tmp5_ = (DinoMessageProcessor*) _tmp4_;
	_tmp6_ = _tmp5_->received_pipeline;
	_tmp7_ = self->priv->received_message_listener;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp6_, (XmppOrderedListener*) _tmp7_);
	_g_object_unref0 (_tmp5_);
	_tmp8_ = dino_conversation_manager_IDENTITY;
	_tmp9_ = dino_stream_interactor_get_module (_data23_->stream_interactor, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp8_);
	_tmp10_ = (DinoConversationManager*) _tmp9_;
	g_signal_connect_object (_tmp10_, "conversation-deactivated", (GCallback) ___lambda98__dino_conversation_manager_conversation_deactivated, self, 0);
	_g_object_unref0 (_tmp10_);
	g_signal_connect_object (_data23_->stream_interactor, "stream-resumed", (GCallback) ___lambda99__dino_stream_interactor_stream_resumed, self, 0);
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) (60 * 3), ___lambda102__gsource_func, block23_data_ref (_data23_), block23_data_unref);
	_tmp11_ = dino_message_processor_IDENTITY;
	_tmp12_ = dino_stream_interactor_get_module (_data23_->stream_interactor, DINO_TYPE_MESSAGE_PROCESSOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp11_);
	_tmp13_ = (DinoMessageProcessor*) _tmp12_;
	g_signal_connect_object (_tmp13_, "build-message-stanza", (GCallback) _dino_muc_manager_on_build_message_stanza_dino_message_processor_build_message_stanza, self, 0);
	_g_object_unref0 (_tmp13_);
	block23_data_unref (_data23_);
	_data23_ = NULL;
	return self;
}

static DinoMucManager*
dino_muc_manager_new (DinoStreamInteractor* stream_interactor)
{
	return dino_muc_manager_construct (DINO_TYPE_MUC_MANAGER, stream_interactor);
}

static void
dino_muc_manager_join_data_free (gpointer _data)
{
	DinoMucManagerJoinData* _data_;
	_data_ = _data;
	_g_free0 (_data_->nick);
	_g_free0 (_data_->password);
	_g_object_unref0 (_data_->cancellable);
	_xmpp_xep_muc_join_result_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerJoinData, _data_);
}

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

void
dino_muc_manager_join (DinoMucManager* self,
                       DinoEntitiesAccount* account,
                       XmppJid* jid,
                       const gchar* nick,
                       const gchar* password,
                       gboolean already_autojoin,
                       GCancellable* cancellable,
                       GAsyncReadyCallback _callback_,
                       gpointer _user_data_)
{
	DinoMucManagerJoinData* _data_;
	DinoMucManager* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppJid* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GCancellable* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_data_ = g_slice_new0 (DinoMucManagerJoinData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_join_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (_data_->jid);
	_data_->jid = _tmp2_;
	_tmp3_ = g_strdup (nick);
	_g_free0 (_data_->nick);
	_data_->nick = _tmp3_;
	_tmp4_ = g_strdup (password);
	_g_free0 (_data_->password);
	_data_->password = _tmp4_;
	_data_->already_autojoin = already_autojoin;
	_tmp5_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp5_;
	dino_muc_manager_join_co (_data_);
}

XmppXepMucJoinResult*
dino_muc_manager_join_finish (DinoMucManager* self,
                              GAsyncResult* _res_)
{
	XmppXepMucJoinResult* result;
	DinoMucManagerJoinData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block24Data*
block24_data_ref (Block24Data* _data24_)
{
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}

static void
block24_data_unref (void * _userdata_)
{
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		DinoMucManager* self;
		self = _data24_->self;
		_g_object_unref0 (_data24_->account);
		_xmpp_jid_unref0 (_data24_->jid);
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}

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

static void
dino_muc_manager_join_ready (GObject* source_object,
                             GAsyncResult* _res_,
                             gpointer _user_data_)
{
	DinoMucManagerJoinData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_muc_manager_join_co (_data_);
}

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

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

static Block25Data*
block25_data_ref (Block25Data* _data25_)
{
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}

static void
block25_data_unref (void * _userdata_)
{
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		DinoMucManager* self;
		self = _data25_->_data24_->self;
		_dino_history_sync_unref0 (_data25_->history_sync);
		block24_data_unref (_data25_->_data24_);
		_data25_->_data24_ = NULL;
		g_slice_free (Block25Data, _data25_);
	}
}

static gpointer
_dino_history_sync_ref0 (gpointer self)
{
	return self ? dino_history_sync_ref (self) : NULL;
}

static void
______lambda94_ (Block25Data* _data25_,
                 GObject* _,
                 GAsyncResult* res)
{
	Block24Data* _data24_;
	DinoMucManager* self;
	DinoHistorySync* _tmp0_;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	GeeHashMap* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	_data24_ = _data25_->_data24_;
	self = _data24_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = _data25_->history_sync;
	dino_history_sync_fetch_everything_finish (_tmp0_, res);
	_tmp1_ = self->priv->mucs_sync_cancellables;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _data24_->account);
	_tmp3_ = (GeeHashMap*) _tmp2_;
	_tmp4_ = xmpp_jid_get_bare_jid (_data24_->jid);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp3_, _tmp6_, NULL);
	_xmpp_jid_unref0 (_tmp6_);
	_g_object_unref0 (_tmp3_);
}

static void
_______lambda94__gasync_ready_callback (GObject* source_object,
                                        GAsyncResult* res,
                                        gpointer self)
{
	______lambda94_ (self, source_object, res);
	block25_data_unref (self);
}

static gboolean
dino_muc_manager_join_co (DinoMucManagerJoinData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data24_ = g_slice_new0 (Block24Data);
	_data_->_data24_->_ref_count_ = 1;
	_data_->_data24_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data24_->account);
	_data_->_data24_->account = _data_->account;
	_xmpp_jid_unref0 (_data_->_data24_->jid);
	_data_->_data24_->jid = _data_->jid;
	_data_->_data24_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_stream_interactor_get_stream (_data_->_tmp0_, _data_->_data24_->account);
	_data_->stream = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->stream;
	if (_data_->_tmp2_ == NULL) {
		_data_->result = NULL;
		_g_object_unref0 (_data_->stream);
		block24_data_unref (_data_->_data24_);
		_data_->_data24_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->nick;
	if (_data_->_tmp3_ == NULL) {
		_data_->_tmp4_ = dino_entities_account_get_localpart (_data_->_data24_->account);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp3_ = _data_->_tmp5_;
	}
	_data_->_tmp6_ = _data_->_tmp3_;
	if (_data_->_tmp6_ == NULL) {
		_data_->_tmp7_ = dino_entities_account_get_domainpart (_data_->_data24_->account);
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_tmp6_ = _data_->_tmp8_;
	}
	_data_->_tmp9_ = g_strdup (_data_->_tmp6_);
	_data_->nick_ = _data_->_tmp9_;
	_data_->history_since = NULL;
	_data_->_tmp10_ = _data_->self->priv->stream_interactor;
	_data_->_tmp11_ = dino_conversation_manager_IDENTITY;
	_data_->_tmp12_ = dino_stream_interactor_get_module (_data_->_tmp10_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp11_);
	_data_->_tmp13_ = (DinoConversationManager*) _data_->_tmp12_;
	_data_->_tmp14_ = dino_conversation_manager_get_conversation (_data_->_tmp13_, _data_->_data24_->jid, _data_->_data24_->account, NULL);
	_data_->_tmp15_ = _data_->_tmp14_;
	_g_object_unref0 (_data_->_tmp13_);
	_data_->conversation = _data_->_tmp15_;
	_data_->_tmp16_ = _data_->conversation;
	if (_data_->_tmp16_ != NULL) {
		_data_->_tmp17_ = _data_->self->priv->stream_interactor;
		_data_->_tmp18_ = dino_message_storage_IDENTITY;
		_data_->_tmp19_ = dino_stream_interactor_get_module (_data_->_tmp17_, DINO_TYPE_MESSAGE_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp18_);
		_data_->_tmp20_ = (DinoMessageStorage*) _data_->_tmp19_;
		_data_->_tmp21_ = _data_->conversation;
		_data_->_tmp22_ = dino_message_storage_get_last_message (_data_->_tmp20_, _data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_g_object_unref0 (_data_->_tmp20_);
		_data_->last_message = _data_->_tmp23_;
		_data_->_tmp24_ = _data_->last_message;
		if (_data_->_tmp24_ != NULL) {
			_data_->_tmp25_ = _data_->last_message;
			_data_->_tmp26_ = dino_entities_message_get_time (_data_->_tmp25_);
			_data_->_tmp27_ = _data_->_tmp26_;
			_data_->_tmp28_ = _g_date_time_ref0 (_data_->_tmp27_);
			_g_date_time_unref0 (_data_->history_since);
			_data_->history_since = _data_->_tmp28_;
		}
		_g_object_unref0 (_data_->last_message);
	}
	_data_->receive_history = TRUE;
	_data_->_tmp29_ = _data_->self->priv->stream_interactor;
	_data_->_tmp30_ = dino_entity_info_IDENTITY;
	_data_->_tmp31_ = dino_stream_interactor_get_module (_data_->_tmp29_, DINO_TYPE_ENTITY_INFO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp30_);
	_data_->entity_info = (DinoEntityInfo*) _data_->_tmp31_;
	_data_->_tmp32_ = _data_->entity_info;
	_data_->_state_ = 1;
	dino_entity_info_has_feature (_data_->_tmp32_, _data_->_data24_->account, _data_->_data24_->jid, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI, dino_muc_manager_join_ready, _data_);
	return FALSE;
	_state_1:
	_data_->can_do_mam = dino_entity_info_has_feature_finish (_data_->_tmp32_, _data_->_res_);
	if (_data_->can_do_mam) {
		_data_->receive_history = FALSE;
		_g_date_time_unref0 (_data_->history_since);
		_data_->history_since = NULL;
	}
	_data_->_tmp33_ = _data_->self->priv->mucs_joining;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp33_, _data_->_data24_->account)) {
		_data_->_tmp34_ = _data_->self->priv->mucs_joining;
		_data_->_tmp35_ = gee_hash_set_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, _xmpp_jid_hash_bare_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_bare_func_gee_equal_data_func, NULL, NULL);
		_data_->_tmp36_ = _data_->_tmp35_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp34_, _data_->_data24_->account, _data_->_tmp36_);
		_g_object_unref0 (_data_->_tmp36_);
	}
	_data_->_tmp37_ = _data_->self->priv->mucs_joining;
	_data_->_tmp38_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp37_, _data_->_data24_->account);
	_data_->_tmp39_ = (GeeHashSet*) _data_->_tmp38_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp39_, _data_->_data24_->jid);
	_g_object_unref0 (_data_->_tmp39_);
	_data_->_tmp40_ = _data_->stream;
	_data_->_tmp41_ = xmpp_xep_muc_module_IDENTITY;
	_data_->_tmp42_ = xmpp_xmpp_stream_get_module (_data_->_tmp40_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp41_);
	_data_->_tmp43_ = (XmppXepMucModule*) _data_->_tmp42_;
	_data_->_tmp44_ = _data_->stream;
	_data_->_tmp45_ = xmpp_jid_get_bare_jid (_data_->_data24_->jid);
	_data_->_tmp46_ = _data_->_tmp45_;
	_data_->_tmp47_ = _data_->_tmp46_;
	_data_->_tmp48_ = _data_->nick_;
	_data_->_tmp49_ = _data_->history_since;
	_data_->_state_ = 2;
	xmpp_xep_muc_module_enter (_data_->_tmp43_, _data_->_tmp44_, _data_->_tmp47_, _data_->_tmp48_, _data_->password, _data_->_tmp49_, _data_->receive_history, NULL, dino_muc_manager_join_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp50_ = xmpp_xep_muc_module_enter_finish (_data_->_tmp43_, _data_->_res_);
	_data_->_tmp51_ = _data_->_tmp50_;
	_xmpp_jid_unref0 (_data_->_tmp47_);
	_g_object_unref0 (_data_->_tmp43_);
	_data_->res = _data_->_tmp51_;
	_data_->_tmp52_ = _data_->self->priv->mucs_joining;
	_data_->_tmp53_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp52_, _data_->_data24_->account);
	_data_->_tmp54_ = (GeeHashSet*) _data_->_tmp53_;
	gee_abstract_collection_remove ((GeeAbstractCollection*) _data_->_tmp54_, _data_->_data24_->jid);
	_g_object_unref0 (_data_->_tmp54_);
	_data_->_tmp55_ = _data_->res;
	_data_->_tmp56_ = _data_->_tmp55_->nick;
	if (_data_->_tmp56_ != NULL) {
		_data_->_tmp57_ = _data_->self->priv->enter_errors;
		gee_abstract_map_unset ((GeeAbstractMap*) _data_->_tmp57_, _data_->_data24_->jid, NULL);
		if (!_data_->already_autojoin) {
			_data_->_tmp58_ = _data_->stream;
			dino_muc_manager_set_autojoin (_data_->self, _data_->_data24_->account, _data_->_tmp58_, _data_->_data24_->jid, _data_->nick, _data_->password);
		}
		_data_->_tmp59_ = _data_->self->priv->stream_interactor;
		_data_->_tmp60_ = dino_message_processor_IDENTITY;
		_data_->_tmp61_ = dino_stream_interactor_get_module (_data_->_tmp59_, DINO_TYPE_MESSAGE_PROCESSOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp60_);
		_data_->_tmp62_ = (DinoMessageProcessor*) _data_->_tmp61_;
		dino_message_processor_send_unsent_muc_messages (_data_->_tmp62_, _data_->_data24_->account, _data_->_data24_->jid);
		_g_object_unref0 (_data_->_tmp62_);
		_data_->_tmp63_ = _data_->self->priv->stream_interactor;
		_data_->_tmp64_ = dino_conversation_manager_IDENTITY;
		_data_->_tmp65_ = dino_stream_interactor_get_module (_data_->_tmp63_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp64_);
		_data_->_tmp66_ = (DinoConversationManager*) _data_->_tmp65_;
		_data_->_tmp67_ = DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT;
		_data_->_tmp68_ = dino_conversation_manager_create_conversation (_data_->_tmp66_, _data_->_data24_->jid, _data_->_data24_->account, &_data_->_tmp67_);
		_data_->_tmp69_ = _data_->_tmp68_;
		_g_object_unref0 (_data_->_tmp66_);
		_data_->joined_conversation = _data_->_tmp69_;
		_data_->_tmp70_ = _data_->joined_conversation;
		dino_entities_conversation_set_nickname (_data_->_tmp70_, _data_->nick);
		_data_->_tmp71_ = _data_->self->priv->stream_interactor;
		_data_->_tmp72_ = dino_conversation_manager_IDENTITY;
		_data_->_tmp73_ = dino_stream_interactor_get_module (_data_->_tmp71_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp72_);
		_data_->_tmp74_ = (DinoConversationManager*) _data_->_tmp73_;
		_data_->_tmp75_ = _data_->joined_conversation;
		dino_conversation_manager_start_conversation (_data_->_tmp74_, _data_->_tmp75_);
		_g_object_unref0 (_data_->_tmp74_);
		if (_data_->can_do_mam) {
			_data_->_data25_ = g_slice_new0 (Block25Data);
			_data_->_data25_->_ref_count_ = 1;
			_data_->_data25_->_data24_ = block24_data_ref (_data_->_data24_);
			_data_->_tmp76_ = _data_->self->priv->stream_interactor;
			_data_->_tmp77_ = dino_message_processor_IDENTITY;
			_data_->_tmp78_ = dino_stream_interactor_get_module (_data_->_tmp76_, DINO_TYPE_MESSAGE_PROCESSOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp77_);
			_data_->_tmp79_ = (DinoMessageProcessor*) _data_->_tmp78_;
			_data_->_tmp80_ = _data_->_tmp79_->history_sync;
			_data_->_tmp81_ = _dino_history_sync_ref0 (_data_->_tmp80_);
			_data_->_tmp82_ = _data_->_tmp81_;
			_g_object_unref0 (_data_->_tmp79_);
			_data_->_data25_->history_sync = _data_->_tmp82_;
			_data_->_tmp83_ = _data_->conversation;
			if (_data_->_tmp83_ == NULL) {
				_data_->_tmp84_ = _data_->_data25_->history_sync;
				_data_->_tmp85_ = xmpp_jid_get_bare_jid (_data_->_data24_->jid);
				_data_->_tmp86_ = _data_->_tmp85_;
				_data_->_tmp87_ = _data_->_tmp86_;
				_data_->_tmp88_ = g_date_time_new_from_unix_utc ((gint64) 0);
				_data_->_tmp89_ = _data_->_tmp88_;
				_data_->_state_ = 3;
				dino_history_sync_fetch_latest_page (_data_->_tmp84_, _data_->_data24_->account, _data_->_tmp87_, NULL, _data_->_tmp89_, _data_->cancellable, dino_muc_manager_join_ready, _data_);
				return FALSE;
				_state_3:
				_data_->_tmp90_ = dino_history_sync_fetch_latest_page_finish (_data_->_tmp84_, _data_->_res_);
				_data_->_tmp91_ = _data_->_tmp90_;
				_qlite_row_unref0 (_data_->_tmp91_);
				_g_date_time_unref0 (_data_->_tmp89_);
				_xmpp_jid_unref0 (_data_->_tmp87_);
			} else {
				_data_->_tmp92_ = _data_->self->priv->mucs_sync_cancellables;
				if (!gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp92_, _data_->_data24_->account)) {
					_data_->_tmp93_ = _data_->self->priv->mucs_sync_cancellables;
					_data_->_tmp94_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, g_cancellable_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
					_data_->_tmp95_ = _data_->_tmp94_;
					gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp93_, _data_->_data24_->account, _data_->_tmp95_);
					_g_object_unref0 (_data_->_tmp95_);
				}
				_data_->_tmp96_ = _data_->self->priv->mucs_sync_cancellables;
				_data_->_tmp97_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp96_, _data_->_data24_->account);
				_data_->_tmp98_ = (GeeHashMap*) _data_->_tmp97_;
				_data_->_tmp99_ = xmpp_jid_get_bare_jid (_data_->_data24_->jid);
				_data_->_tmp100_ = _data_->_tmp99_;
				_data_->_tmp101_ = _data_->_tmp100_;
				_data_->_tmp102_ = !gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp98_, _data_->_tmp101_);
				_xmpp_jid_unref0 (_data_->_tmp101_);
				_g_object_unref0 (_data_->_tmp98_);
				if (_data_->_tmp102_) {
					_data_->_tmp103_ = _data_->self->priv->mucs_sync_cancellables;
					_data_->_tmp104_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp103_, _data_->_data24_->account);
					_data_->_tmp105_ = (GeeHashMap*) _data_->_tmp104_;
					_data_->_tmp106_ = xmpp_jid_get_bare_jid (_data_->_data24_->jid);
					_data_->_tmp107_ = _data_->_tmp106_;
					_data_->_tmp108_ = _data_->_tmp107_;
					_data_->_tmp109_ = g_cancellable_new ();
					_data_->_tmp110_ = _data_->_tmp109_;
					gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp105_, _data_->_tmp108_, _data_->_tmp110_);
					_g_object_unref0 (_data_->_tmp110_);
					_xmpp_jid_unref0 (_data_->_tmp108_);
					_g_object_unref0 (_data_->_tmp105_);
					_data_->_tmp111_ = _data_->conversation;
					_data_->_tmp112_ = dino_entities_conversation_get_active_last_changed (_data_->_tmp111_);
					_data_->_tmp113_ = _data_->_tmp112_;
					_data_->_tmp114_ = g_date_time_add (_data_->_tmp113_, (-G_TIME_SPAN_DAY) * 5);
					_data_->fetch_from_time = _data_->_tmp114_;
					_data_->_tmp115_ = _data_->_data25_->history_sync;
					_data_->_tmp116_ = xmpp_jid_get_bare_jid (_data_->_data24_->jid);
					_data_->_tmp117_ = _data_->_tmp116_;
					_data_->_tmp118_ = _data_->_tmp117_;
					_data_->_tmp119_ = _data_->self->priv->mucs_sync_cancellables;
					_data_->_tmp120_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp119_, _data_->_data24_->account);
					_data_->_tmp121_ = (GeeHashMap*) _data_->_tmp120_;
					_data_->_tmp122_ = xmpp_jid_get_bare_jid (_data_->_data24_->jid);
					_data_->_tmp123_ = _data_->_tmp122_;
					_data_->_tmp124_ = _data_->_tmp123_;
					_data_->_tmp125_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp121_, _data_->_tmp124_);
					_data_->_tmp126_ = (GCancellable*) _data_->_tmp125_;
					_data_->_tmp127_ = _data_->fetch_from_time;
					dino_history_sync_fetch_everything (_data_->_tmp115_, _data_->_data24_->account, _data_->_tmp118_, _data_->_tmp126_, _data_->_tmp127_, _______lambda94__gasync_ready_callback, block25_data_ref (_data_->_data25_));
					_g_object_unref0 (_data_->_tmp126_);
					_xmpp_jid_unref0 (_data_->_tmp124_);
					_g_object_unref0 (_data_->_tmp121_);
					_xmpp_jid_unref0 (_data_->_tmp118_);
					_g_date_time_unref0 (_data_->fetch_from_time);
				}
			}
			block25_data_unref (_data_->_data25_);
			_data_->_data25_ = NULL;
		}
		_g_object_unref0 (_data_->joined_conversation);
	} else {
		_data_->_tmp128_ = _data_->res;
		_data_->_tmp129_ = _data_->_tmp128_->muc_error;
		if (_data_->_tmp129_ != NULL) {
			_data_->_tmp130_ = _data_->self->priv->enter_errors;
			_data_->_tmp131_ = _data_->res;
			_data_->_tmp132_ = _data_->_tmp131_->muc_error;
			gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp130_, _data_->_data24_->jid, (gpointer) ((gintptr) (*_data_->_tmp132_)));
		}
	}
	_data_->_tmp133_ = _data_->self->priv->mucs_joined;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp133_, _data_->_data24_->account)) {
		_data_->_tmp134_ = _data_->self->priv->mucs_joined;
		_data_->_tmp135_ = gee_hash_set_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, _xmpp_jid_hash_bare_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_bare_func_gee_equal_data_func, NULL, NULL);
		_data_->_tmp136_ = _data_->_tmp135_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp134_, _data_->_data24_->account, _data_->_tmp136_);
		_g_object_unref0 (_data_->_tmp136_);
	}
	_data_->_tmp138_ = _data_->res;
	_data_->_tmp139_ = _data_->_tmp138_->nick;
	_data_->_tmp137_ = _data_->_tmp139_;
	if (_data_->_tmp137_ == NULL) {
		_data_->_tmp140_ = _data_->nick_;
		_data_->_tmp137_ = _data_->_tmp140_;
	}
	_data_->_tmp142_ = xmpp_jid_with_resource (_data_->_data24_->jid, _data_->_tmp137_, &_data_->_inner_error0_);
	_data_->_tmp141_ = _data_->_tmp142_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_xmpp_xep_muc_join_result_unref0 (_data_->res);
		_g_object_unref0 (_data_->entity_info);
		_g_object_unref0 (_data_->conversation);
		_g_date_time_unref0 (_data_->history_since);
		_g_free0 (_data_->nick_);
		_g_object_unref0 (_data_->stream);
		block24_data_unref (_data_->_data24_);
		_data_->_data24_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp143_ = _data_->self->priv->mucs_joined;
	_data_->_tmp144_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp143_, _data_->_data24_->account);
	_data_->_tmp145_ = (GeeHashSet*) _data_->_tmp144_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp145_, _data_->_tmp141_);
	_g_object_unref0 (_data_->_tmp145_);
	_data_->result = _data_->res;
	_xmpp_jid_unref0 (_data_->_tmp141_);
	_g_object_unref0 (_data_->entity_info);
	_g_object_unref0 (_data_->conversation);
	_g_date_time_unref0 (_data_->history_since);
	_g_free0 (_data_->nick_);
	_g_object_unref0 (_data_->stream);
	block24_data_unref (_data_->_data24_);
	_data_->_data24_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
dino_muc_manager_part (DinoMucManager* self,
                       DinoEntitiesAccount* account,
                       XmppJid* jid)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp8_;
	XmppXmppStream* _tmp9_;
	XmppXmppStream* _tmp10_;
	DinoEntitiesConversation* conversation = NULL;
	DinoStreamInteractor* _tmp20_;
	DinoModuleIdentity* _tmp21_;
	gpointer _tmp22_;
	DinoConversationManager* _tmp23_;
	DinoEntitiesConversationType _tmp24_;
	DinoEntitiesConversation* _tmp25_;
	DinoEntitiesConversation* _tmp26_;
	DinoEntitiesConversation* _tmp27_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp1_ = self->priv->mucs_joined;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, account)) {
		GeeHashMap* _tmp2_;
		gpointer _tmp3_;
		GeeHashSet* _tmp4_;
		_tmp2_ = self->priv->mucs_joined;
		_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp2_, account);
		_tmp4_ = (GeeHashSet*) _tmp3_;
		_tmp0_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp4_, jid);
		_g_object_unref0 (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeHashMap* _tmp5_;
		gpointer _tmp6_;
		GeeHashSet* _tmp7_;
		_tmp5_ = self->priv->mucs_joined;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp5_, account);
		_tmp7_ = (GeeHashSet*) _tmp6_;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp7_, jid);
		_g_object_unref0 (_tmp7_);
	}
	_tmp8_ = self->priv->stream_interactor;
	_tmp9_ = dino_stream_interactor_get_stream (_tmp8_, account);
	stream = _tmp9_;
	_tmp10_ = stream;
	if (_tmp10_ != NULL) {
		XmppXmppStream* _tmp11_;
		XmppXmppStream* _tmp12_;
		XmppModuleIdentity* _tmp13_;
		gpointer _tmp14_;
		XmppXepMucModule* _tmp15_;
		XmppXmppStream* _tmp16_;
		XmppJid* _tmp17_;
		XmppJid* _tmp18_;
		XmppJid* _tmp19_;
		_tmp11_ = stream;
		dino_muc_manager_unset_autojoin (self, account, _tmp11_, jid);
		_tmp12_ = stream;
		_tmp13_ = xmpp_xep_muc_module_IDENTITY;
		_tmp14_ = xmpp_xmpp_stream_get_module (_tmp12_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp13_);
		_tmp15_ = (XmppXepMucModule*) _tmp14_;
		_tmp16_ = stream;
		_tmp17_ = xmpp_jid_get_bare_jid (jid);
		_tmp18_ = _tmp17_;
		_tmp19_ = _tmp18_;
		xmpp_xep_muc_module_exit (_tmp15_, _tmp16_, _tmp19_);
		_xmpp_jid_unref0 (_tmp19_);
		_g_object_unref0 (_tmp15_);
	}
	_tmp20_ = self->priv->stream_interactor;
	_tmp21_ = dino_conversation_manager_IDENTITY;
	_tmp22_ = dino_stream_interactor_get_module (_tmp20_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp21_);
	_tmp23_ = (DinoConversationManager*) _tmp22_;
	_tmp24_ = DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT;
	_tmp25_ = dino_conversation_manager_get_conversation (_tmp23_, jid, account, &_tmp24_);
	_tmp26_ = _tmp25_;
	_g_object_unref0 (_tmp23_);
	conversation = _tmp26_;
	_tmp27_ = conversation;
	if (_tmp27_ != NULL) {
		DinoStreamInteractor* _tmp28_;
		DinoModuleIdentity* _tmp29_;
		gpointer _tmp30_;
		DinoConversationManager* _tmp31_;
		DinoEntitiesConversation* _tmp32_;
		_tmp28_ = self->priv->stream_interactor;
		_tmp29_ = dino_conversation_manager_IDENTITY;
		_tmp30_ = dino_stream_interactor_get_module (_tmp28_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp29_);
		_tmp31_ = (DinoConversationManager*) _tmp30_;
		_tmp32_ = conversation;
		dino_conversation_manager_close_conversation (_tmp31_, _tmp32_);
		_g_object_unref0 (_tmp31_);
	}
	dino_muc_manager_cancel_sync (self, account, jid);
	_g_object_unref0 (conversation);
	_g_object_unref0 (stream);
}

static void
dino_muc_manager_cancel_sync (DinoMucManager* self,
                              DinoEntitiesAccount* account,
                              XmppJid* jid)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GeeHashMap* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp2_ = self->priv->mucs_sync_cancellables;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp2_, account)) {
		GeeHashMap* _tmp3_;
		gpointer _tmp4_;
		GeeHashMap* _tmp5_;
		XmppJid* _tmp6_;
		XmppJid* _tmp7_;
		XmppJid* _tmp8_;
		_tmp3_ = self->priv->mucs_sync_cancellables;
		_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, account);
		_tmp5_ = (GeeHashMap*) _tmp4_;
		_tmp6_ = xmpp_jid_get_bare_jid (jid);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp1_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp5_, _tmp8_);
		_xmpp_jid_unref0 (_tmp8_);
		_g_object_unref0 (_tmp5_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GeeHashMap* _tmp9_;
		gpointer _tmp10_;
		GeeHashMap* _tmp11_;
		XmppJid* _tmp12_;
		XmppJid* _tmp13_;
		XmppJid* _tmp14_;
		gpointer _tmp15_;
		GCancellable* _tmp16_;
		_tmp9_ = self->priv->mucs_sync_cancellables;
		_tmp10_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, account);
		_tmp11_ = (GeeHashMap*) _tmp10_;
		_tmp12_ = xmpp_jid_get_bare_jid (jid);
		_tmp13_ = _tmp12_;
		_tmp14_ = _tmp13_;
		_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp11_, _tmp14_);
		_tmp16_ = (GCancellable*) _tmp15_;
		_tmp0_ = !g_cancellable_is_cancelled (_tmp16_);
		_g_object_unref0 (_tmp16_);
		_xmpp_jid_unref0 (_tmp14_);
		_g_object_unref0 (_tmp11_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeHashMap* _tmp17_;
		gpointer _tmp18_;
		GeeHashMap* _tmp19_;
		XmppJid* _tmp20_;
		XmppJid* _tmp21_;
		XmppJid* _tmp22_;
		gpointer _tmp23_;
		GCancellable* _tmp24_;
		_tmp17_ = self->priv->mucs_sync_cancellables;
		_tmp18_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp17_, account);
		_tmp19_ = (GeeHashMap*) _tmp18_;
		_tmp20_ = xmpp_jid_get_bare_jid (jid);
		_tmp21_ = _tmp20_;
		_tmp22_ = _tmp21_;
		_tmp23_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp19_, _tmp22_);
		_tmp24_ = (GCancellable*) _tmp23_;
		g_cancellable_cancel (_tmp24_);
		_g_object_unref0 (_tmp24_);
		_xmpp_jid_unref0 (_tmp22_);
		_g_object_unref0 (_tmp19_);
	}
}

static void
dino_muc_manager_get_config_form_data_free (gpointer _data)
{
	DinoMucManagerGetConfigFormData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_xmpp_jid_unref0 (_data_->jid);
	_xmpp_xep_data_forms_data_form_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerGetConfigFormData, _data_);
}

void
dino_muc_manager_get_config_form (DinoMucManager* self,
                                  DinoEntitiesAccount* account,
                                  XmppJid* jid,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	DinoMucManagerGetConfigFormData* _data_;
	DinoMucManager* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppJid* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_data_ = g_slice_new0 (DinoMucManagerGetConfigFormData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_get_config_form_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (_data_->jid);
	_data_->jid = _tmp2_;
	dino_muc_manager_get_config_form_co (_data_);
}

XmppXepDataFormsDataForm*
dino_muc_manager_get_config_form_finish (DinoMucManager* self,
                                         GAsyncResult* _res_)
{
	XmppXepDataFormsDataForm* result;
	DinoMucManagerGetConfigFormData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dino_muc_manager_get_config_form_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	DinoMucManagerGetConfigFormData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_muc_manager_get_config_form_co (_data_);
}

static gboolean
dino_muc_manager_get_config_form_co (DinoMucManagerGetConfigFormData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_stream_interactor_get_stream (_data_->_tmp0_, _data_->account);
	_data_->stream = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->stream;
	if (_data_->_tmp2_ == NULL) {
		_data_->result = NULL;
		_g_object_unref0 (_data_->stream);
		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_->_tmp3_ = _data_->stream;
	_data_->_tmp4_ = xmpp_xep_muc_module_IDENTITY;
	_data_->_tmp5_ = xmpp_xmpp_stream_get_module (_data_->_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp4_);
	_data_->_tmp6_ = (XmppXepMucModule*) _data_->_tmp5_;
	_data_->_tmp7_ = _data_->stream;
	_data_->_state_ = 1;
	xmpp_xep_muc_module_get_config_form (_data_->_tmp6_, _data_->_tmp7_, _data_->jid, dino_muc_manager_get_config_form_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = xmpp_xep_muc_module_get_config_form_finish (_data_->_tmp6_, _data_->_res_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_object_unref0 (_data_->_tmp6_);
	_data_->result = _data_->_tmp9_;
	_g_object_unref0 (_data_->stream);
	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
dino_muc_manager_set_config_form_data_free (gpointer _data)
{
	DinoMucManagerSetConfigFormData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_xmpp_jid_unref0 (_data_->jid);
	_xmpp_xep_data_forms_data_form_unref0 (_data_->data_form);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerSetConfigFormData, _data_);
}

static gpointer
_xmpp_xep_data_forms_data_form_ref0 (gpointer self)
{
	return self ? xmpp_xep_data_forms_data_form_ref (self) : NULL;
}

void
dino_muc_manager_set_config_form (DinoMucManager* self,
                                  DinoEntitiesAccount* account,
                                  XmppJid* jid,
                                  XmppXepDataFormsDataForm* data_form,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	DinoMucManagerSetConfigFormData* _data_;
	DinoMucManager* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppJid* _tmp2_;
	XmppXepDataFormsDataForm* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (data_form != NULL);
	_data_ = g_slice_new0 (DinoMucManagerSetConfigFormData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_set_config_form_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (_data_->jid);
	_data_->jid = _tmp2_;
	_tmp3_ = _xmpp_xep_data_forms_data_form_ref0 (data_form);
	_xmpp_xep_data_forms_data_form_unref0 (_data_->data_form);
	_data_->data_form = _tmp3_;
	dino_muc_manager_set_config_form_co (_data_);
}

void
dino_muc_manager_set_config_form_finish (DinoMucManager* self,
                                         GAsyncResult* _res_)
{
	DinoMucManagerSetConfigFormData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_muc_manager_set_config_form_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	DinoMucManagerSetConfigFormData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_muc_manager_set_config_form_co (_data_);
}

static gboolean
dino_muc_manager_set_config_form_co (DinoMucManagerSetConfigFormData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_stream_interactor_get_stream (_data_->_tmp0_, _data_->account);
	_data_->stream = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->stream;
	if (_data_->_tmp2_ == NULL) {
		_g_object_unref0 (_data_->stream);
		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_->_tmp3_ = _data_->stream;
	_data_->_tmp4_ = xmpp_xep_muc_module_IDENTITY;
	_data_->_tmp5_ = xmpp_xmpp_stream_get_module (_data_->_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp4_);
	_data_->_tmp6_ = (XmppXepMucModule*) _data_->_tmp5_;
	_data_->_tmp7_ = _data_->stream;
	_data_->_state_ = 1;
	xmpp_xep_muc_module_set_config_form (_data_->_tmp6_, _data_->_tmp7_, _data_->jid, _data_->data_form, dino_muc_manager_set_config_form_ready, _data_);
	return FALSE;
	_state_1:
	xmpp_xep_muc_module_set_config_form_finish (_data_->_tmp6_, _data_->_res_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->stream);
	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;
}

void
dino_muc_manager_change_subject (DinoMucManager* self,
                                 DinoEntitiesAccount* account,
                                 XmppJid* jid,
                                 const gchar* subject)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (subject != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		XmppXmppStream* _tmp3_;
		XmppModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		XmppXepMucModule* _tmp6_;
		XmppXmppStream* _tmp7_;
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		XmppJid* _tmp10_;
		_tmp3_ = stream;
		_tmp4_ = xmpp_xep_muc_module_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_module (_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (XmppXepMucModule*) _tmp5_;
		_tmp7_ = stream;
		_tmp8_ = xmpp_jid_get_bare_jid (jid);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		xmpp_xep_muc_module_change_subject (_tmp6_, _tmp7_, _tmp10_, subject);
		_xmpp_jid_unref0 (_tmp10_);
		_g_object_unref0 (_tmp6_);
	}
	_g_object_unref0 (stream);
}

static void
dino_muc_manager_change_nick_data_free (gpointer _data)
{
	DinoMucManagerChangeNickData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->conversation);
	_g_free0 (_data_->new_nick);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerChangeNickData, _data_);
}

void
dino_muc_manager_change_nick (DinoMucManager* self,
                              DinoEntitiesConversation* conversation,
                              const gchar* new_nick,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DinoMucManagerChangeNickData* _data_;
	DinoMucManager* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conversation != NULL);
	g_return_if_fail (new_nick != NULL);
	_data_ = g_slice_new0 (DinoMucManagerChangeNickData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_change_nick_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp1_;
	_tmp2_ = g_strdup (new_nick);
	_g_free0 (_data_->new_nick);
	_data_->new_nick = _tmp2_;
	dino_muc_manager_change_nick_co (_data_);
}

void
dino_muc_manager_change_nick_finish (DinoMucManager* self,
                                     GAsyncResult* _res_)
{
	DinoMucManagerChangeNickData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_muc_manager_change_nick_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DinoMucManagerChangeNickData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_muc_manager_change_nick_co (_data_);
}

static gboolean
dino_muc_manager_change_nick_co (DinoMucManagerChangeNickData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_entities_conversation_get_account (_data_->conversation);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = dino_stream_interactor_get_stream (_data_->_tmp0_, _data_->_tmp2_);
	_data_->stream = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->stream;
	if (_data_->_tmp4_ == NULL) {
		_g_object_unref0 (_data_->stream);
		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_->_tmp5_ = dino_entities_conversation_get_counterpart (_data_->conversation);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = xmpp_jid_with_resource (_data_->_tmp6_, _data_->new_nick, &_data_->_inner_error0_);
		_data_->_tmp8_ = _data_->_tmp7_;
		_xmpp_jid_unref0 (_data_->_tmp8_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_error;
			}
			_g_object_unref0 (_data_->stream);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->stream);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->stream;
	_data_->_tmp10_ = xmpp_xep_muc_module_IDENTITY;
	_data_->_tmp11_ = xmpp_xmpp_stream_get_module (_data_->_tmp9_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp10_);
	_data_->_tmp12_ = (XmppXepMucModule*) _data_->_tmp11_;
	_data_->_tmp13_ = _data_->stream;
	_data_->_tmp14_ = dino_entities_conversation_get_counterpart (_data_->conversation);
	_data_->_tmp15_ = _data_->_tmp14_;
	xmpp_xep_muc_module_change_nick (_data_->_tmp12_, _data_->_tmp13_, _data_->_tmp15_, _data_->new_nick);
	_g_object_unref0 (_data_->_tmp12_);
	dino_entities_conversation_set_nickname (_data_->conversation, _data_->new_nick);
	_data_->_tmp16_ = _data_->self->priv->mucs_joined;
	_data_->_tmp17_ = dino_entities_conversation_get_account (_data_->conversation);
	_data_->_tmp18_ = _data_->_tmp17_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp16_, _data_->_tmp18_)) {
		_data_->_tmp19_ = _data_->self->priv->mucs_joined;
		_data_->_tmp20_ = dino_entities_conversation_get_account (_data_->conversation);
		_data_->_tmp21_ = _data_->_tmp20_;
		_data_->_tmp22_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp19_, _data_->_tmp21_);
		_data_->_tmp23_ = (GeeHashSet*) _data_->_tmp22_;
		_data_->_tmp24_ = dino_entities_conversation_get_counterpart (_data_->conversation);
		_data_->_tmp25_ = _data_->_tmp24_;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _data_->_tmp23_, _data_->_tmp25_);
		_g_object_unref0 (_data_->_tmp23_);
		_data_->_tmp27_ = dino_entities_conversation_get_counterpart (_data_->conversation);
		_data_->_tmp28_ = _data_->_tmp27_;
		_data_->_tmp29_ = xmpp_jid_with_resource (_data_->_tmp28_, _data_->new_nick, &_data_->_inner_error0_);
		_data_->_tmp26_ = _data_->_tmp29_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stream);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp30_ = _data_->self->priv->mucs_joined;
		_data_->_tmp31_ = dino_entities_conversation_get_account (_data_->conversation);
		_data_->_tmp32_ = _data_->_tmp31_;
		_data_->_tmp33_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp30_, _data_->_tmp32_);
		_data_->_tmp34_ = (GeeHashSet*) _data_->_tmp33_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp34_, _data_->_tmp26_);
		_g_object_unref0 (_data_->_tmp34_);
		_xmpp_jid_unref0 (_data_->_tmp26_);
	}
	_data_->_tmp35_ = _data_->self->priv->bookmarks_provider;
	_data_->_tmp36_ = dino_entities_conversation_get_account (_data_->conversation);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_tmp38_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp35_, _data_->_tmp37_);
	_data_->_tmp39_ = (XmppBookmarksProvider*) _data_->_tmp38_;
	_data_->_tmp40_ = _data_->stream;
	_data_->_state_ = 1;
	xmpp_bookmarks_provider_get_conferences (_data_->_tmp39_, _data_->_tmp40_, dino_muc_manager_change_nick_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp41_ = xmpp_bookmarks_provider_get_conferences_finish (_data_->_tmp39_, _data_->_res_);
	_data_->_tmp42_ = _data_->_tmp41_;
	_g_object_unref0 (_data_->_tmp39_);
	_data_->conferences = _data_->_tmp42_;
	_data_->_tmp43_ = _data_->conferences;
	if (_data_->_tmp43_ == NULL) {
		_g_object_unref0 (_data_->conferences);
		_g_object_unref0 (_data_->stream);
		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_->_tmp44_ = _data_->conferences;
		_data_->_tmp45_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp44_);
		_data_->_conference_it = _data_->_tmp45_;
		while (TRUE) {
			_data_->_tmp46_ = _data_->_conference_it;
			if (!gee_iterator_next (_data_->_tmp46_)) {
				break;
			}
			_data_->_tmp47_ = _data_->_conference_it;
			_data_->_tmp48_ = gee_iterator_get (_data_->_tmp47_);
			_data_->conference = (XmppConference*) _data_->_tmp48_;
			_data_->_tmp49_ = _data_->conference;
			_data_->_tmp50_ = xmpp_conference_get_jid (_data_->_tmp49_);
			_data_->_tmp51_ = _data_->_tmp50_;
			_data_->_tmp52_ = dino_entities_conversation_get_counterpart (_data_->conversation);
			_data_->_tmp53_ = _data_->_tmp52_;
			if (xmpp_jid_equals (_data_->_tmp51_, _data_->_tmp53_)) {
				_data_->_tmp54_ = dino_entities_conversation_get_counterpart (_data_->conversation);
				_data_->_tmp55_ = _data_->_tmp54_;
				_data_->_tmp56_ = _xmpp_jid_ref0 (_data_->_tmp55_);
				_data_->_tmp57_ = g_strdup (_data_->new_nick);
				_data_->_tmp58_ = _data_->conference;
				_data_->_tmp59_ = xmpp_conference_get_name (_data_->_tmp58_);
				_data_->_tmp60_ = _data_->_tmp59_;
				_data_->_tmp61_ = g_strdup (_data_->_tmp60_);
				_data_->_tmp62_ = _data_->conference;
				_data_->_tmp63_ = xmpp_conference_get_password (_data_->_tmp62_);
				_data_->_tmp64_ = _data_->_tmp63_;
				_data_->_tmp65_ = g_strdup (_data_->_tmp64_);
				_data_->_tmp66_ = _data_->conference;
				_data_->_tmp67_ = xmpp_conference_get_autojoin (_data_->_tmp66_);
				_data_->_tmp68_ = _data_->_tmp67_;
				_data_->_tmp69_ = NULL;
				_data_->_tmp69_ = xmpp_conference_new ();
				xmpp_conference_set_jid (_data_->_tmp69_, _data_->_tmp56_);
				_xmpp_jid_unref0 (_data_->_tmp56_);
				xmpp_conference_set_nick (_data_->_tmp69_, _data_->_tmp57_);
				_g_free0 (_data_->_tmp57_);
				xmpp_conference_set_name (_data_->_tmp69_, _data_->_tmp61_);
				_g_free0 (_data_->_tmp61_);
				xmpp_conference_set_password (_data_->_tmp69_, _data_->_tmp65_);
				_g_free0 (_data_->_tmp65_);
				xmpp_conference_set_autojoin (_data_->_tmp69_, _data_->_tmp68_);
				_data_->new_conference = _data_->_tmp69_;
				_data_->_tmp70_ = _data_->self->priv->bookmarks_provider;
				_data_->_tmp71_ = dino_entities_conversation_get_account (_data_->conversation);
				_data_->_tmp72_ = _data_->_tmp71_;
				_data_->_tmp73_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp70_, _data_->_tmp72_);
				_data_->_tmp74_ = (XmppBookmarksProvider*) _data_->_tmp73_;
				_data_->_tmp75_ = _data_->stream;
				_data_->_tmp76_ = dino_entities_conversation_get_counterpart (_data_->conversation);
				_data_->_tmp77_ = _data_->_tmp76_;
				_data_->_tmp78_ = _data_->new_conference;
				xmpp_bookmarks_provider_replace_conference (_data_->_tmp74_, _data_->_tmp75_, _data_->_tmp77_, _data_->_tmp78_, NULL, NULL);
				_g_object_unref0 (_data_->_tmp74_);
				_g_object_unref0 (_data_->new_conference);
				_g_object_unref0 (_data_->conference);
				break;
			}
			_g_object_unref0 (_data_->conference);
		}
		_g_object_unref0 (_data_->_conference_it);
	}
	_g_object_unref0 (_data_->conferences);
	_g_object_unref0 (_data_->stream);
	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;
}

void
dino_muc_manager_invite (DinoMucManager* self,
                         DinoEntitiesAccount* account,
                         XmppJid* muc,
                         XmppJid* invitee)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (muc != NULL);
	g_return_if_fail (invitee != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		XmppXmppStream* _tmp3_;
		XmppModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		XmppXepMucModule* _tmp6_;
		XmppXmppStream* _tmp7_;
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		XmppJid* _tmp10_;
		XmppJid* _tmp11_;
		XmppJid* _tmp12_;
		XmppJid* _tmp13_;
		_tmp3_ = stream;
		_tmp4_ = xmpp_xep_muc_module_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_module (_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (XmppXepMucModule*) _tmp5_;
		_tmp7_ = stream;
		_tmp8_ = xmpp_jid_get_bare_jid (muc);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		_tmp11_ = xmpp_jid_get_bare_jid (invitee);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		xmpp_xep_muc_module_invite (_tmp6_, _tmp7_, _tmp10_, _tmp13_);
		_xmpp_jid_unref0 (_tmp13_);
		_xmpp_jid_unref0 (_tmp10_);
		_g_object_unref0 (_tmp6_);
	}
	_g_object_unref0 (stream);
}

void
dino_muc_manager_kick (DinoMucManager* self,
                       DinoEntitiesAccount* account,
                       XmppJid* jid,
                       const gchar* nick)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (nick != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		XmppXmppStream* _tmp3_;
		XmppModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		XmppXepMucModule* _tmp6_;
		XmppXmppStream* _tmp7_;
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		XmppJid* _tmp10_;
		_tmp3_ = stream;
		_tmp4_ = xmpp_xep_muc_module_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_module (_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (XmppXepMucModule*) _tmp5_;
		_tmp7_ = stream;
		_tmp8_ = xmpp_jid_get_bare_jid (jid);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		xmpp_xep_muc_module_kick (_tmp6_, _tmp7_, _tmp10_, nick);
		_xmpp_jid_unref0 (_tmp10_);
		_g_object_unref0 (_tmp6_);
	}
	_g_object_unref0 (stream);
}

void
dino_muc_manager_change_affiliation (DinoMucManager* self,
                                     DinoEntitiesAccount* account,
                                     XmppJid* jid,
                                     const gchar* nick,
                                     const gchar* role)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (nick != NULL);
	g_return_if_fail (role != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		XmppXmppStream* _tmp3_;
		XmppModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		XmppXepMucModule* _tmp6_;
		XmppXmppStream* _tmp7_;
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		XmppJid* _tmp10_;
		_tmp3_ = stream;
		_tmp4_ = xmpp_xep_muc_module_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_module (_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (XmppXepMucModule*) _tmp5_;
		_tmp7_ = stream;
		_tmp8_ = xmpp_jid_get_bare_jid (jid);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		xmpp_xep_muc_module_change_affiliation (_tmp6_, _tmp7_, _tmp10_, NULL, nick, role, NULL, NULL);
		_xmpp_jid_unref0 (_tmp10_);
		_g_object_unref0 (_tmp6_);
	}
	_g_object_unref0 (stream);
}

void
dino_muc_manager_change_role (DinoMucManager* self,
                              DinoEntitiesAccount* account,
                              XmppJid* jid,
                              const gchar* nick,
                              const gchar* role)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (nick != NULL);
	g_return_if_fail (role != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		XmppXmppStream* _tmp3_;
		XmppModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		XmppXepMucModule* _tmp6_;
		XmppXmppStream* _tmp7_;
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		XmppJid* _tmp10_;
		_tmp3_ = stream;
		_tmp4_ = xmpp_xep_muc_module_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_module (_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (XmppXepMucModule*) _tmp5_;
		_tmp7_ = stream;
		_tmp8_ = xmpp_jid_get_bare_jid (jid);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		xmpp_xep_muc_module_change_role (_tmp6_, _tmp7_, _tmp10_, nick, role);
		_xmpp_jid_unref0 (_tmp10_);
		_g_object_unref0 (_tmp6_);
	}
	_g_object_unref0 (stream);
}

void
dino_muc_manager_request_voice (DinoMucManager* self,
                                DinoEntitiesAccount* account,
                                XmppJid* jid)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		XmppXmppStream* _tmp3_;
		XmppModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		XmppXepMucModule* _tmp6_;
		XmppXmppStream* _tmp7_;
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		XmppJid* _tmp10_;
		_tmp3_ = stream;
		_tmp4_ = xmpp_xep_muc_module_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_module (_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (XmppXepMucModule*) _tmp5_;
		_tmp7_ = stream;
		_tmp8_ = xmpp_jid_get_bare_jid (jid);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		xmpp_xep_muc_module_request_voice (_tmp6_, _tmp7_, _tmp10_);
		_xmpp_jid_unref0 (_tmp10_);
		_g_object_unref0 (_tmp6_);
	}
	_g_object_unref0 (stream);
}

gboolean
dino_muc_manager_kick_possible (DinoMucManager* self,
                                DinoEntitiesAccount* account,
                                XmppJid* occupant)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	g_return_val_if_fail (occupant != NULL, FALSE);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		XmppXmppStream* _tmp3_;
		XmppModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		XmppXepMucModule* _tmp6_;
		XmppXmppStream* _tmp7_;
		gboolean _tmp8_;
		_tmp3_ = stream;
		_tmp4_ = xmpp_xep_muc_module_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_module (_tmp3_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (XmppXepMucModule*) _tmp5_;
		_tmp7_ = stream;
		_tmp8_ = xmpp_xep_muc_module_kick_possible (_tmp6_, _tmp7_, occupant);
		_g_object_unref0 (_tmp6_);
		result = _tmp8_;
		_g_object_unref0 (stream);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (stream);
	return result;
}

gboolean
dino_muc_manager_is_private_room (DinoMucManager* self,
                                  DinoEntitiesAccount* account,
                                  XmppJid* jid)
{
	DinoEntityInfo* entity_info = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	gboolean _tmp3_ = FALSE;
	DinoEntityInfo* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	g_return_val_if_fail (jid != NULL, FALSE);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_entity_info_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_ENTITY_INFO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	entity_info = (DinoEntityInfo*) _tmp2_;
	_tmp4_ = entity_info;
	if (dino_entity_info_has_feature_offline (_tmp4_, account, jid, "muc_membersonly")) {
		DinoEntityInfo* _tmp5_;
		_tmp5_ = entity_info;
		_tmp3_ = dino_entity_info_has_feature_offline (_tmp5_, account, jid, "muc_nonanonymous");
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (entity_info);
	return result;
}

gboolean
dino_muc_manager_is_moderated_room (DinoMucManager* self,
                                    DinoEntitiesAccount* account,
                                    XmppJid* jid)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	XmppXepMucFlag* flag = NULL;
	XmppXmppStream* _tmp3_;
	XmppFlagIdentity* _tmp4_;
	gpointer _tmp5_;
	XmppXepMucFlag* _tmp6_;
	XmppXepMucFlag* _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	g_return_val_if_fail (jid != NULL, FALSE);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ == NULL) {
		result = FALSE;
		_g_object_unref0 (stream);
		return result;
	}
	_tmp3_ = stream;
	_tmp4_ = xmpp_xep_muc_flag_IDENTITY;
	_tmp5_ = xmpp_xmpp_stream_get_flag (_tmp3_, XMPP_XEP_MUC_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
	flag = (XmppXepMucFlag*) _tmp5_;
	_tmp6_ = flag;
	if (_tmp6_ == NULL) {
		result = FALSE;
		_g_object_unref0 (flag);
		_g_object_unref0 (stream);
		return result;
	}
	_tmp7_ = flag;
	result = xmpp_xep_muc_flag_has_room_feature (_tmp7_, jid, XMPP_XEP_MUC_FEATURE_MODERATED);
	_g_object_unref0 (flag);
	_g_object_unref0 (stream);
	return result;
}

gboolean
dino_muc_manager_is_public_room (DinoMucManager* self,
                                 DinoEntitiesAccount* account,
                                 XmppJid* jid)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	g_return_val_if_fail (jid != NULL, FALSE);
	if (dino_muc_manager_is_groupchat (self, jid, account)) {
		_tmp0_ = !dino_muc_manager_is_private_room (self, account, jid);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

GeeList*
dino_muc_manager_get_occupants (DinoMucManager* self,
                                XmppJid* jid,
                                DinoEntitiesAccount* account)
{
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	if (dino_muc_manager_is_groupchat (self, jid, account)) {
		GeeList* ret = NULL;
		GeeArrayList* _tmp0_;
		GeeList* full_jids = NULL;
		DinoStreamInteractor* _tmp1_;
		DinoModuleIdentity* _tmp2_;
		gpointer _tmp3_;
		DinoPresenceManager* _tmp4_;
		GeeList* _tmp5_;
		GeeList* _tmp6_;
		GeeList* _tmp7_;
		_tmp0_ = gee_array_list_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL);
		ret = (GeeList*) _tmp0_;
		_tmp1_ = self->priv->stream_interactor;
		_tmp2_ = dino_presence_manager_IDENTITY;
		_tmp3_ = dino_stream_interactor_get_module (_tmp1_, DINO_TYPE_PRESENCE_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
		_tmp4_ = (DinoPresenceManager*) _tmp3_;
		_tmp5_ = dino_presence_manager_get_full_jids (_tmp4_, jid, account);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		full_jids = _tmp6_;
		_tmp7_ = full_jids;
		if (_tmp7_ != NULL) {
			GeeList* _tmp8_;
			GeeList* _tmp9_;
			GeeList* _tmp10_;
			_tmp8_ = ret;
			_tmp9_ = full_jids;
			gee_collection_add_all ((GeeCollection*) _tmp8_, (GeeCollection*) _tmp9_);
			_tmp10_ = ret;
			gee_collection_remove ((GeeCollection*) _tmp10_, jid);
		}
		result = ret;
		_g_object_unref0 (full_jids);
		return result;
	}
	result = NULL;
	return result;
}

GeeList*
dino_muc_manager_get_other_occupants (DinoMucManager* self,
                                      XmppJid* jid,
                                      DinoEntitiesAccount* account)
{
	GeeList* occupants = NULL;
	GeeList* _tmp0_;
	XmppJid* own_jid = NULL;
	XmppJid* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GeeList* _tmp3_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_occupants (self, jid, account);
	occupants = _tmp0_;
	_tmp1_ = dino_muc_manager_get_own_jid (self, jid, account);
	own_jid = _tmp1_;
	_tmp3_ = occupants;
	if (_tmp3_ != NULL) {
		XmppJid* _tmp4_;
		_tmp4_ = own_jid;
		_tmp2_ = _tmp4_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GeeList* _tmp5_;
		XmppJid* _tmp6_;
		_tmp5_ = occupants;
		_tmp6_ = own_jid;
		gee_collection_remove ((GeeCollection*) _tmp5_, _tmp6_);
	}
	result = occupants;
	_xmpp_jid_unref0 (own_jid);
	return result;
}

gboolean
dino_muc_manager_is_groupchat (DinoMucManager* self,
                               XmppJid* jid,
                               DinoEntitiesAccount* account)
{
	DinoEntitiesConversation* conversation = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	DinoEntitiesConversationType _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	gboolean _tmp7_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (jid != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_conversation_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoConversationManager*) _tmp2_;
	_tmp4_ = DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT;
	_tmp5_ = dino_conversation_manager_get_conversation (_tmp3_, jid, account, &_tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp3_);
	conversation = _tmp6_;
	if (!xmpp_jid_is_full (jid)) {
		DinoEntitiesConversation* _tmp8_;
		_tmp8_ = conversation;
		_tmp7_ = _tmp8_ != NULL;
	} else {
		_tmp7_ = FALSE;
	}
	result = _tmp7_;
	_g_object_unref0 (conversation);
	return result;
}

gboolean
dino_muc_manager_might_be_groupchat (DinoMucManager* self,
                                     XmppJid* jid,
                                     DinoEntitiesAccount* account)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (jid != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	_tmp1_ = self->priv->mucs_joining;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, account)) {
		GeeHashMap* _tmp2_;
		gpointer _tmp3_;
		GeeHashSet* _tmp4_;
		_tmp2_ = self->priv->mucs_joining;
		_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp2_, account);
		_tmp4_ = (GeeHashSet*) _tmp3_;
		_tmp0_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp4_, jid);
		_g_object_unref0 (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	result = dino_muc_manager_is_groupchat (self, jid, account);
	return result;
}

gboolean
dino_muc_manager_is_groupchat_occupant (DinoMucManager* self,
                                        XmppJid* jid,
                                        DinoEntitiesAccount* account)
{
	gboolean _tmp0_ = FALSE;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gboolean _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (jid != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	_tmp1_ = xmpp_jid_get_bare_jid (jid);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = dino_muc_manager_is_groupchat (self, _tmp3_, account);
	_xmpp_jid_unref0 (_tmp3_);
	if (_tmp4_) {
		const gchar* _tmp5_;
		_tmp5_ = jid->resourcepart;
		_tmp0_ = _tmp5_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static void
dino_muc_manager_get_bookmarks_data_free (gpointer _data)
{
	DinoMucManagerGetBookmarksData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerGetBookmarksData, _data_);
}

void
dino_muc_manager_get_bookmarks (DinoMucManager* self,
                                DinoEntitiesAccount* account,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DinoMucManagerGetBookmarksData* _data_;
	DinoMucManager* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_data_ = g_slice_new0 (DinoMucManagerGetBookmarksData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_get_bookmarks_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	dino_muc_manager_get_bookmarks_co (_data_);
}

GeeSet*
dino_muc_manager_get_bookmarks_finish (DinoMucManager* self,
                                       GAsyncResult* _res_)
{
	GeeSet* result;
	DinoMucManagerGetBookmarksData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dino_muc_manager_get_bookmarks_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DinoMucManagerGetBookmarksData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_muc_manager_get_bookmarks_co (_data_);
}

static gboolean
dino_muc_manager_get_bookmarks_co (DinoMucManagerGetBookmarksData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_stream_interactor_get_stream (_data_->_tmp0_, _data_->account);
	_data_->stream = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->stream;
	if (_data_->_tmp2_ == NULL) {
		_data_->result = NULL;
		_g_object_unref0 (_data_->stream);
		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_->_tmp3_ = _data_->self->priv->bookmarks_provider;
	_data_->_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp3_, _data_->account);
	_data_->_tmp5_ = (XmppBookmarksProvider*) _data_->_tmp4_;
	_data_->_tmp6_ = _data_->stream;
	_data_->_state_ = 1;
	xmpp_bookmarks_provider_get_conferences (_data_->_tmp5_, _data_->_tmp6_, dino_muc_manager_get_bookmarks_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp7_ = xmpp_bookmarks_provider_get_conferences_finish (_data_->_tmp5_, _data_->_res_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_object_unref0 (_data_->_tmp5_);
	_data_->result = _data_->_tmp8_;
	_g_object_unref0 (_data_->stream);
	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;
}

void
dino_muc_manager_add_bookmark (DinoMucManager* self,
                               DinoEntitiesAccount* account,
                               XmppConference* conference)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (conference != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		GeeHashMap* _tmp3_;
		gpointer _tmp4_;
		XmppBookmarksProvider* _tmp5_;
		XmppXmppStream* _tmp6_;
		_tmp3_ = self->priv->bookmarks_provider;
		_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, account);
		_tmp5_ = (XmppBookmarksProvider*) _tmp4_;
		_tmp6_ = stream;
		xmpp_bookmarks_provider_add_conference (_tmp5_, _tmp6_, conference, NULL, NULL);
		_g_object_unref0 (_tmp5_);
	}
	_g_object_unref0 (stream);
}

void
dino_muc_manager_remove_bookmark (DinoMucManager* self,
                                  DinoEntitiesAccount* account,
                                  XmppConference* conference)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (conference != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		GeeHashMap* _tmp3_;
		gpointer _tmp4_;
		XmppBookmarksProvider* _tmp5_;
		XmppXmppStream* _tmp6_;
		_tmp3_ = self->priv->bookmarks_provider;
		_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, account);
		_tmp5_ = (XmppBookmarksProvider*) _tmp4_;
		_tmp6_ = stream;
		xmpp_bookmarks_provider_remove_conference (_tmp5_, _tmp6_, conference, NULL, NULL);
		_g_object_unref0 (_tmp5_);
	}
	_g_object_unref0 (stream);
}

gchar*
dino_muc_manager_get_room_name (DinoMucManager* self,
                                DinoEntitiesAccount* account,
                                XmppJid* jid)
{
	XmppXepMucFlag* flag = NULL;
	XmppXepMucFlag* _tmp0_;
	XmppXepMucFlag* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_muc_flag (self, account);
	flag = _tmp0_;
	_tmp1_ = flag;
	if (_tmp1_ != NULL) {
		XmppXepMucFlag* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = flag;
		_tmp3_ = xmpp_xep_muc_flag_get_room_name (_tmp2_, jid);
		result = _tmp3_;
		_g_object_unref0 (flag);
		return result;
	}
	result = NULL;
	_g_object_unref0 (flag);
	return result;
}

gchar*
dino_muc_manager_get_groupchat_subject (DinoMucManager* self,
                                        XmppJid* jid,
                                        DinoEntitiesAccount* account)
{
	XmppXepMucFlag* flag = NULL;
	XmppXepMucFlag* _tmp0_;
	XmppXepMucFlag* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_muc_flag (self, account);
	flag = _tmp0_;
	_tmp1_ = flag;
	if (_tmp1_ != NULL) {
		XmppXepMucFlag* _tmp2_;
		XmppJid* _tmp3_;
		XmppJid* _tmp4_;
		XmppJid* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp2_ = flag;
		_tmp3_ = xmpp_jid_get_bare_jid (jid);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = xmpp_xep_muc_flag_get_muc_subject (_tmp2_, _tmp5_);
		_tmp7_ = _tmp6_;
		_xmpp_jid_unref0 (_tmp5_);
		result = _tmp7_;
		_g_object_unref0 (flag);
		return result;
	}
	result = NULL;
	_g_object_unref0 (flag);
	return result;
}

XmppJid*
dino_muc_manager_get_real_jid (DinoMucManager* self,
                               XmppJid* jid,
                               DinoEntitiesAccount* account)
{
	XmppXepMucFlag* flag = NULL;
	XmppXepMucFlag* _tmp0_;
	XmppXepMucFlag* _tmp1_;
	XmppJid* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_muc_flag (self, account);
	flag = _tmp0_;
	_tmp1_ = flag;
	if (_tmp1_ != NULL) {
		XmppXepMucFlag* _tmp2_;
		XmppJid* _tmp3_;
		_tmp2_ = flag;
		_tmp3_ = xmpp_xep_muc_flag_get_real_jid (_tmp2_, jid);
		result = _tmp3_;
		_g_object_unref0 (flag);
		return result;
	}
	result = NULL;
	_g_object_unref0 (flag);
	return result;
}

XmppJid*
dino_muc_manager_get_occupant_jid (DinoMucManager* self,
                                   DinoEntitiesAccount* account,
                                   XmppJid* room,
                                   XmppJid* occupant_real_jid)
{
	XmppXepMucFlag* flag = NULL;
	XmppXepMucFlag* _tmp0_;
	XmppXepMucFlag* _tmp1_;
	XmppJid* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	g_return_val_if_fail (room != NULL, NULL);
	g_return_val_if_fail (occupant_real_jid != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_muc_flag (self, account);
	flag = _tmp0_;
	_tmp1_ = flag;
	if (_tmp1_ != NULL) {
		XmppXepMucFlag* _tmp2_;
		XmppJid* _tmp3_;
		_tmp2_ = flag;
		_tmp3_ = xmpp_xep_muc_flag_get_occupant_jid (_tmp2_, occupant_real_jid, room);
		result = _tmp3_;
		_g_object_unref0 (flag);
		return result;
	}
	result = NULL;
	_g_object_unref0 (flag);
	return result;
}

XmppXepMucRole*
dino_muc_manager_get_role (DinoMucManager* self,
                           XmppJid* jid,
                           DinoEntitiesAccount* account)
{
	XmppXepMucFlag* flag = NULL;
	XmppXepMucFlag* _tmp0_;
	XmppXepMucFlag* _tmp1_;
	XmppXepMucRole* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_muc_flag (self, account);
	flag = _tmp0_;
	_tmp1_ = flag;
	if (_tmp1_ != NULL) {
		XmppXepMucFlag* _tmp2_;
		XmppXepMucRole* _tmp3_;
		_tmp2_ = flag;
		_tmp3_ = xmpp_xep_muc_flag_get_occupant_role (_tmp2_, jid);
		result = _tmp3_;
		_g_object_unref0 (flag);
		return result;
	}
	result = NULL;
	_g_object_unref0 (flag);
	return result;
}

static XmppXepMucAffiliation*
_xmpp_xep_muc_affiliation_dup (XmppXepMucAffiliation* self)
{
	XmppXepMucAffiliation* dup;
	dup = g_new0 (XmppXepMucAffiliation, 1);
	memcpy (dup, self, sizeof (XmppXepMucAffiliation));
	return dup;
}

static gpointer
__xmpp_xep_muc_affiliation_dup0 (gpointer self)
{
	return self ? _xmpp_xep_muc_affiliation_dup (self) : NULL;
}

XmppXepMucAffiliation*
dino_muc_manager_get_affiliation (DinoMucManager* self,
                                  XmppJid* muc_jid,
                                  XmppJid* jid,
                                  DinoEntitiesAccount* account)
{
	XmppXepMucFlag* flag = NULL;
	XmppXepMucFlag* _tmp0_;
	XmppXepMucFlag* _tmp1_;
	XmppXepMucAffiliation* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (muc_jid != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_muc_flag (self, account);
	flag = _tmp0_;
	_tmp1_ = flag;
	if (_tmp1_ != NULL) {
		XmppXepMucFlag* _tmp2_;
		XmppXepMucAffiliation _tmp3_;
		XmppXepMucAffiliation* _tmp4_;
		_tmp2_ = flag;
		_tmp3_ = xmpp_xep_muc_flag_get_affiliation (_tmp2_, muc_jid, jid);
		_tmp4_ = __xmpp_xep_muc_affiliation_dup0 (&_tmp3_);
		result = _tmp4_;
		_g_object_unref0 (flag);
		return result;
	}
	result = NULL;
	_g_object_unref0 (flag);
	return result;
}

GeeList*
dino_muc_manager_get_offline_members (DinoMucManager* self,
                                      XmppJid* jid,
                                      DinoEntitiesAccount* account)
{
	XmppXepMucFlag* flag = NULL;
	XmppXepMucFlag* _tmp0_;
	XmppXepMucFlag* _tmp1_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_muc_flag (self, account);
	flag = _tmp0_;
	_tmp1_ = flag;
	if (_tmp1_ != NULL) {
		XmppXepMucFlag* _tmp2_;
		GeeList* _tmp3_;
		_tmp2_ = flag;
		_tmp3_ = xmpp_xep_muc_flag_get_offline_members (_tmp2_, jid);
		result = _tmp3_;
		_g_object_unref0 (flag);
		return result;
	}
	result = NULL;
	_g_object_unref0 (flag);
	return result;
}

GeeList*
dino_muc_manager_get_other_offline_members (DinoMucManager* self,
                                            XmppJid* jid,
                                            DinoEntitiesAccount* account)
{
	GeeList* occupants = NULL;
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = dino_muc_manager_get_offline_members (self, jid, account);
	occupants = _tmp0_;
	_tmp1_ = occupants;
	if (_tmp1_ != NULL) {
		GeeList* _tmp2_;
		XmppJid* _tmp3_;
		XmppJid* _tmp4_;
		XmppJid* _tmp5_;
		_tmp2_ = occupants;
		_tmp3_ = dino_entities_account_get_bare_jid (account);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		gee_collection_remove ((GeeCollection*) _tmp2_, _tmp5_);
		_xmpp_jid_unref0 (_tmp5_);
	}
	result = occupants;
	return result;
}

XmppJid*
dino_muc_manager_get_own_jid (DinoMucManager* self,
                              XmppJid* muc_jid,
                              DinoEntitiesAccount* account)
{
	GError* _inner_error0_ = NULL;
	XmppJid* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (muc_jid != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	{
		XmppXepMucFlag* flag = NULL;
		XmppXepMucFlag* _tmp0_;
		XmppXepMucFlag* _tmp1_;
		_tmp0_ = dino_muc_manager_get_muc_flag (self, account);
		flag = _tmp0_;
		_tmp1_ = flag;
		if (_tmp1_ != NULL) {
			gchar* nick = NULL;
			XmppXepMucFlag* _tmp2_;
			gchar* _tmp3_;
			const gchar* _tmp4_;
			_tmp2_ = flag;
			_tmp3_ = xmpp_xep_muc_flag_get_muc_nick (_tmp2_, muc_jid);
			nick = _tmp3_;
			_tmp4_ = nick;
			if (_tmp4_ != NULL) {
				XmppJid* _tmp5_ = NULL;
				const gchar* _tmp6_;
				XmppJid* _tmp7_;
				XmppJid* _tmp8_;
				_tmp6_ = nick;
				_tmp7_ = xmpp_jid_with_resource (muc_jid, _tmp6_, &_inner_error0_);
				_tmp5_ = _tmp7_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_free0 (nick);
					_g_object_unref0 (flag);
					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 NULL;
				}
				_tmp8_ = _tmp5_;
				_tmp5_ = NULL;
				result = _tmp8_;
				_xmpp_jid_unref0 (_tmp5_);
				_g_free0 (nick);
				_g_object_unref0 (flag);
				return result;
			}
			_g_free0 (nick);
		}
		_g_object_unref0 (flag);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GError* e = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = e;
		_tmp10_ = _tmp9_->message;
		g_warning ("muc_manager.vala:388: Joined MUC with invalid Jid: %s", _tmp10_);
		_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 NULL;
	}
	result = NULL;
	return result;
}

gboolean
dino_muc_manager_is_own_muc_jid (DinoMucManager* self,
                                 XmppJid* full_jid,
                                 DinoEntitiesAccount* account)
{
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	gboolean _tmp3_;
	XmppJid* own_jid = NULL;
	XmppJid* _tmp4_;
	gboolean _tmp5_ = FALSE;
	XmppJid* _tmp6_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (full_jid != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	_tmp0_ = xmpp_jid_get_bare_jid (full_jid);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = !dino_muc_manager_is_groupchat (self, _tmp2_, account);
	_xmpp_jid_unref0 (_tmp2_);
	if (_tmp3_) {
		result = FALSE;
		return result;
	}
	_tmp4_ = dino_muc_manager_get_own_jid (self, full_jid, account);
	own_jid = _tmp4_;
	_tmp6_ = own_jid;
	if (_tmp6_ != NULL) {
		XmppJid* _tmp7_;
		_tmp7_ = own_jid;
		_tmp5_ = xmpp_jid_equals (_tmp7_, full_jid);
	} else {
		_tmp5_ = FALSE;
	}
	result = _tmp5_;
	_xmpp_jid_unref0 (own_jid);
	return result;
}

static XmppXepMucFlag*
dino_muc_manager_get_muc_flag (DinoMucManager* self,
                               DinoEntitiesAccount* account)
{
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXmppStream* _tmp2_;
	XmppXepMucFlag* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_stream_interactor_get_stream (_tmp0_, account);
	stream = _tmp1_;
	_tmp2_ = stream;
	if (_tmp2_ != NULL) {
		XmppXmppStream* _tmp3_;
		XmppFlagIdentity* _tmp4_;
		gpointer _tmp5_;
		_tmp3_ = stream;
		_tmp4_ = xmpp_xep_muc_flag_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_flag (_tmp3_, XMPP_XEP_MUC_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		result = (XmppXepMucFlag*) _tmp5_;
		_g_object_unref0 (stream);
		return result;
	}
	result = NULL;
	_g_object_unref0 (stream);
	return result;
}

gboolean
dino_muc_manager_is_joined (DinoMucManager* self,
                            XmppJid* jid,
                            DinoEntitiesAccount* account)
{
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (jid != NULL, FALSE);
	g_return_val_if_fail (account != NULL, FALSE);
	_tmp0_ = dino_muc_manager_get_own_jid (self, jid, account);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ != NULL;
	_xmpp_jid_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

gchar*
dino_muc_manager_get_own_occupant_id (DinoMucManager* self,
                                      DinoEntitiesAccount* account,
                                      XmppJid* muc_jid)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (account != NULL, NULL);
	g_return_val_if_fail (muc_jid != NULL, NULL);
	_tmp1_ = self->priv->own_occupant_ids;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, account)) {
		GeeHashMap* _tmp2_;
		gpointer _tmp3_;
		GeeHashMap* _tmp4_;
		_tmp2_ = self->priv->own_occupant_ids;
		_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp2_, account);
		_tmp4_ = (GeeHashMap*) _tmp3_;
		_tmp0_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp4_, muc_jid);
		_g_object_unref0 (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeHashMap* _tmp5_;
		gpointer _tmp6_;
		GeeHashMap* _tmp7_;
		gpointer _tmp8_;
		gchar* _tmp9_;
		_tmp5_ = self->priv->own_occupant_ids;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp5_, account);
		_tmp7_ = (GeeHashMap*) _tmp6_;
		_tmp8_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, muc_jid);
		_tmp9_ = (gchar*) _tmp8_;
		_g_object_unref0 (_tmp7_);
		result = _tmp9_;
		return result;
	}
	result = NULL;
	return result;
}

static Block26Data*
block26_data_ref (Block26Data* _data26_)
{
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}

static void
block26_data_unref (void * _userdata_)
{
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		DinoMucManager* self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->account);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}

static void
__lambda22_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             XmppJid* jid,
             XmppXepMucStatusCode code)
{
	DinoMucManager* self;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jid != NULL);
	dino_muc_manager_cancel_sync (self, _data26_->account, jid);
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_LEFT_SIGNAL], 0, _data26_->account, jid);
}

static void
___lambda22__xmpp_xep_muc_module_self_removed_from_room (XmppXepMucModule* _sender,
                                                         XmppXmppStream* stream,
                                                         XmppJid* jid,
                                                         XmppXepMucStatusCode code,
                                                         gpointer self)
{
	__lambda22_ (self, stream, jid, code);
}

static void
__lambda23_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             const gchar* subject,
             XmppJid* jid)
{
	DinoMucManager* self;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jid != NULL);
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_SUBJECT_SET_SIGNAL], 0, _data26_->account, jid, subject);
}

static void
___lambda23__xmpp_xep_muc_module_subject_set (XmppXepMucModule* _sender,
                                              XmppXmppStream* stream,
                                              const gchar* subject,
                                              XmppJid* jid,
                                              gpointer self)
{
	__lambda23_ (self, stream, subject, jid);
}

static void
__lambda24_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             XmppJid* room_jid,
             XmppJid* from_jid,
             const gchar* password,
             const gchar* reason)
{
	DinoMucManager* self;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (room_jid != NULL);
	g_return_if_fail (from_jid != NULL);
	dino_muc_manager_on_invite_received (self, _data26_->account, room_jid, from_jid, password, reason);
}

static void
___lambda24__xmpp_xep_muc_module_invite_received (XmppXepMucModule* _sender,
                                                  XmppXmppStream* stream,
                                                  XmppJid* room_jid,
                                                  XmppJid* from_jid,
                                                  const gchar* password,
                                                  const gchar* reason,
                                                  gpointer self)
{
	__lambda24_ (self, stream, room_jid, from_jid, password, reason);
}

static void
__lambda26_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             XmppJid* room_jid,
             XmppJid* from_jid,
             const gchar* password,
             const gchar* reason)
{
	DinoMucManager* self;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (room_jid != NULL);
	g_return_if_fail (from_jid != NULL);
	dino_muc_manager_on_invite_received (self, _data26_->account, room_jid, from_jid, password, reason);
}

static void
___lambda26__xmpp_xep_direct_muc_invitations_module_invite_received (XmppXepDirectMucInvitationsModule* _sender,
                                                                     XmppXmppStream* stream,
                                                                     XmppJid* room_jid,
                                                                     XmppJid* from_jid,
                                                                     const gchar* password,
                                                                     const gchar* reason,
                                                                     gpointer self)
{
	__lambda26_ (self, stream, room_jid, from_jid, password, reason);
}

static void
__lambda27_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             XmppJid* room_jid,
             XmppJid* from_jid,
             const gchar* nick)
{
	DinoMucManager* self;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (room_jid != NULL);
	g_return_if_fail (from_jid != NULL);
	g_return_if_fail (nick != NULL);
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_VOICE_REQUEST_RECEIVED_SIGNAL], 0, _data26_->account, room_jid, from_jid, nick);
}

static void
___lambda27__xmpp_xep_muc_module_voice_request_received (XmppXepMucModule* _sender,
                                                         XmppXmppStream* stream,
                                                         XmppJid* room_jid,
                                                         XmppJid* from_jid,
                                                         const gchar* nick,
                                                         gpointer self)
{
	__lambda27_ (self, stream, room_jid, from_jid, nick);
}

static void
__lambda28_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             XmppJid* from_jid,
             XmppXepMucRole* role)
{
	DinoMucManager* self;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (from_jid != NULL);
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_RECEIVED_OCCUPANT_ROLE_SIGNAL], 0, _data26_->account, from_jid, role);
}

static void
___lambda28__xmpp_xep_muc_module_received_occupant_role (XmppXepMucModule* _sender,
                                                         XmppXmppStream* stream,
                                                         XmppJid* jid,
                                                         XmppXepMucRole* role,
                                                         gpointer self)
{
	__lambda28_ (self, stream, jid, role);
}

static void
__lambda29_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             XmppJid* muc_jid)
{
	DinoMucManager* self;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (muc_jid != NULL);
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_ROOM_INFO_UPDATED_SIGNAL], 0, _data26_->account, muc_jid);
}

static void
___lambda29__xmpp_xep_muc_module_room_info_updated (XmppXepMucModule* _sender,
                                                    XmppXmppStream* stream,
                                                    XmppJid* muc_jid,
                                                    gpointer self)
{
	__lambda29_ (self, stream, muc_jid);
}

static void
__lambda30_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             XmppJid* room,
             XmppJid* occupant)
{
	DinoMucManager* self;
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	gboolean _tmp3_;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (room != NULL);
	_tmp0_ = xmpp_jid_get_bare_jid (room);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = dino_muc_manager_is_private_room (self, _data26_->account, _tmp2_);
	_xmpp_jid_unref0 (_tmp2_);
	if (_tmp3_) {
		g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_PRIVATE_ROOM_OCCUPANT_UPDATED_SIGNAL], 0, _data26_->account, room, occupant);
	}
}

static void
___lambda30__xmpp_xep_muc_module_received_occupant_jid (XmppXepMucModule* _sender,
                                                        XmppXmppStream* stream,
                                                        XmppJid* jid,
                                                        XmppJid* real_jid,
                                                        gpointer self)
{
	__lambda30_ (self, stream, jid, real_jid);
}

static void
__lambda91_ (Block26Data* _data26_,
             XmppXmppStream* stream,
             XmppJid* jid,
             const gchar* occupant_id)
{
	DinoMucManager* self;
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp4_;
	gpointer _tmp5_;
	GeeHashMap* _tmp6_;
	self = _data26_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (occupant_id != NULL);
	_tmp0_ = self->priv->own_occupant_ids;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _data26_->account)) {
		GeeHashMap* _tmp1_;
		GeeHashMap* _tmp2_;
		GeeHashMap* _tmp3_;
		_tmp1_ = self->priv->own_occupant_ids;
		_tmp2_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _xmpp_jid_hash_bare_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_bare_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
		_tmp3_ = _tmp2_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, _data26_->account, _tmp3_);
		_g_object_unref0 (_tmp3_);
	}
	_tmp4_ = self->priv->own_occupant_ids;
	_tmp5_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp4_, _data26_->account);
	_tmp6_ = (GeeHashMap*) _tmp5_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, jid, occupant_id);
	_g_object_unref0 (_tmp6_);
}

static void
___lambda91__xmpp_xep_occupant_ids_module_received_own_occupant_id (XmppXepOccupantIdsModule* _sender,
                                                                    XmppXmppStream* stream,
                                                                    XmppJid* jid,
                                                                    const gchar* occupant_id,
                                                                    gpointer self)
{
	__lambda91_ (self, stream, jid, occupant_id);
}

static void
dino_muc_manager_on_account_added (DinoMucManager* self,
                                   DinoEntitiesAccount* account)
{
	Block26Data* _data26_;
	DinoEntitiesAccount* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoModuleManager* _tmp2_;
	XmppModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppXepMucModule* _tmp5_;
	DinoStreamInteractor* _tmp6_;
	DinoModuleManager* _tmp7_;
	XmppModuleIdentity* _tmp8_;
	gpointer _tmp9_;
	XmppXepMucModule* _tmp10_;
	DinoStreamInteractor* _tmp11_;
	DinoModuleManager* _tmp12_;
	XmppModuleIdentity* _tmp13_;
	gpointer _tmp14_;
	XmppXepMucModule* _tmp15_;
	DinoStreamInteractor* _tmp16_;
	DinoModuleManager* _tmp17_;
	XmppModuleIdentity* _tmp18_;
	gpointer _tmp19_;
	XmppXepDirectMucInvitationsModule* _tmp20_;
	DinoStreamInteractor* _tmp21_;
	DinoModuleManager* _tmp22_;
	XmppModuleIdentity* _tmp23_;
	gpointer _tmp24_;
	XmppXepMucModule* _tmp25_;
	DinoStreamInteractor* _tmp26_;
	DinoModuleManager* _tmp27_;
	XmppModuleIdentity* _tmp28_;
	gpointer _tmp29_;
	XmppXepMucModule* _tmp30_;
	DinoStreamInteractor* _tmp31_;
	DinoModuleManager* _tmp32_;
	XmppModuleIdentity* _tmp33_;
	gpointer _tmp34_;
	XmppXepMucModule* _tmp35_;
	DinoStreamInteractor* _tmp36_;
	DinoModuleManager* _tmp37_;
	XmppModuleIdentity* _tmp38_;
	gpointer _tmp39_;
	XmppXepMucModule* _tmp40_;
	DinoStreamInteractor* _tmp41_;
	DinoModuleManager* _tmp42_;
	XmppModuleIdentity* _tmp43_;
	gpointer _tmp44_;
	XmppXepOccupantIdsModule* _tmp45_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_data26_ = g_slice_new0 (Block26Data);
	_data26_->_ref_count_ = 1;
	_data26_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data26_->account);
	_data26_->account = _tmp0_;
	_tmp1_ = self->priv->stream_interactor;
	_tmp2_ = _tmp1_->module_manager;
	_tmp3_ = xmpp_xep_muc_module_IDENTITY;
	_tmp4_ = dino_module_manager_get_module (_tmp2_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp3_);
	_tmp5_ = (XmppXepMucModule*) _tmp4_;
	g_signal_connect_data (_tmp5_, "self-removed-from-room", (GCallback) ___lambda22__xmpp_xep_muc_module_self_removed_from_room, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = self->priv->stream_interactor;
	_tmp7_ = _tmp6_->module_manager;
	_tmp8_ = xmpp_xep_muc_module_IDENTITY;
	_tmp9_ = dino_module_manager_get_module (_tmp7_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp8_);
	_tmp10_ = (XmppXepMucModule*) _tmp9_;
	g_signal_connect_data (_tmp10_, "subject-set", (GCallback) ___lambda23__xmpp_xep_muc_module_subject_set, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = self->priv->stream_interactor;
	_tmp12_ = _tmp11_->module_manager;
	_tmp13_ = xmpp_xep_muc_module_IDENTITY;
	_tmp14_ = dino_module_manager_get_module (_tmp12_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp13_);
	_tmp15_ = (XmppXepMucModule*) _tmp14_;
	g_signal_connect_data (_tmp15_, "invite-received", (GCallback) ___lambda24__xmpp_xep_muc_module_invite_received, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = self->priv->stream_interactor;
	_tmp17_ = _tmp16_->module_manager;
	_tmp18_ = xmpp_xep_direct_muc_invitations_module_IDENTITY;
	_tmp19_ = dino_module_manager_get_module (_tmp17_, XMPP_XEP_DIRECT_MUC_INVITATIONS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp18_);
	_tmp20_ = (XmppXepDirectMucInvitationsModule*) _tmp19_;
	g_signal_connect_data (_tmp20_, "invite-received", (GCallback) ___lambda26__xmpp_xep_direct_muc_invitations_module_invite_received, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp20_);
	_tmp21_ = self->priv->stream_interactor;
	_tmp22_ = _tmp21_->module_manager;
	_tmp23_ = xmpp_xep_muc_module_IDENTITY;
	_tmp24_ = dino_module_manager_get_module (_tmp22_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp23_);
	_tmp25_ = (XmppXepMucModule*) _tmp24_;
	g_signal_connect_data (_tmp25_, "voice-request-received", (GCallback) ___lambda27__xmpp_xep_muc_module_voice_request_received, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp25_);
	_tmp26_ = self->priv->stream_interactor;
	_tmp27_ = _tmp26_->module_manager;
	_tmp28_ = xmpp_xep_muc_module_IDENTITY;
	_tmp29_ = dino_module_manager_get_module (_tmp27_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp28_);
	_tmp30_ = (XmppXepMucModule*) _tmp29_;
	g_signal_connect_data (_tmp30_, "received-occupant-role", (GCallback) ___lambda28__xmpp_xep_muc_module_received_occupant_role, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp30_);
	_tmp31_ = self->priv->stream_interactor;
	_tmp32_ = _tmp31_->module_manager;
	_tmp33_ = xmpp_xep_muc_module_IDENTITY;
	_tmp34_ = dino_module_manager_get_module (_tmp32_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp33_);
	_tmp35_ = (XmppXepMucModule*) _tmp34_;
	g_signal_connect_data (_tmp35_, "room-info-updated", (GCallback) ___lambda29__xmpp_xep_muc_module_room_info_updated, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp35_);
	_tmp36_ = self->priv->stream_interactor;
	_tmp37_ = _tmp36_->module_manager;
	_tmp38_ = xmpp_xep_muc_module_IDENTITY;
	_tmp39_ = dino_module_manager_get_module (_tmp37_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp38_);
	_tmp40_ = (XmppXepMucModule*) _tmp39_;
	g_signal_connect_data (_tmp40_, "received-occupant-jid", (GCallback) ___lambda30__xmpp_xep_muc_module_received_occupant_jid, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp40_);
	_tmp41_ = self->priv->stream_interactor;
	_tmp42_ = _tmp41_->module_manager;
	_tmp43_ = xmpp_xep_occupant_ids_module_IDENTITY;
	_tmp44_ = dino_module_manager_get_module (_tmp42_, XMPP_XEP_OCCUPANT_IDS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data26_->account, _tmp43_);
	_tmp45_ = (XmppXepOccupantIdsModule*) _tmp44_;
	g_signal_connect_data (_tmp45_, "received-own-occupant-id", (GCallback) ___lambda91__xmpp_xep_occupant_ids_module_received_own_occupant_id, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_object_unref0 (_tmp45_);
	block26_data_unref (_data26_);
	_data26_ = NULL;
}

static void
dino_muc_manager_search_default_muc_server_data_free (gpointer _data)
{
	DinoMucManagerSearchDefaultMucServerData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerSearchDefaultMucServerData, _data_);
}

static void
dino_muc_manager_search_default_muc_server (DinoMucManager* self,
                                            DinoEntitiesAccount* account,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	DinoMucManagerSearchDefaultMucServerData* _data_;
	DinoMucManager* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_data_ = g_slice_new0 (DinoMucManagerSearchDefaultMucServerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_search_default_muc_server_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	dino_muc_manager_search_default_muc_server_co (_data_);
}

static void
dino_muc_manager_search_default_muc_server_finish (DinoMucManager* self,
                                                   GAsyncResult* _res_)
{
	DinoMucManagerSearchDefaultMucServerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_muc_manager_search_default_muc_server_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	DinoMucManagerSearchDefaultMucServerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_muc_manager_search_default_muc_server_co (_data_);
}

static gboolean
dino_muc_manager_search_default_muc_server_co (DinoMucManagerSearchDefaultMucServerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_stream_interactor_get_stream (_data_->_tmp0_, _data_->account);
	_data_->stream = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->stream;
	if (_data_->_tmp2_ == NULL) {
		_g_object_unref0 (_data_->stream);
		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_->_tmp3_ = _data_->stream;
	_data_->_tmp4_ = xmpp_xep_service_discovery_module_IDENTITY;
	_data_->_tmp5_ = xmpp_xmpp_stream_get_module (_data_->_tmp3_, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp4_);
	_data_->_tmp6_ = (XmppXepServiceDiscoveryModule*) _data_->_tmp5_;
	_data_->_tmp7_ = _data_->stream;
	_data_->_tmp8_ = _data_->stream;
	_data_->_tmp9_ = _data_->_tmp8_->remote_name;
	_data_->_state_ = 1;
	xmpp_xep_service_discovery_module_request_items (_data_->_tmp6_, _data_->_tmp7_, _data_->_tmp9_, dino_muc_manager_search_default_muc_server_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp10_ = xmpp_xep_service_discovery_module_request_items_finish (_data_->_tmp6_, _data_->_res_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_g_object_unref0 (_data_->_tmp6_);
	_data_->items_result = _data_->_tmp11_;
	_data_->_tmp12_ = _data_->items_result;
	if (_data_->_tmp12_ == NULL) {
		_xmpp_xep_service_discovery_items_result_unref0 (_data_->items_result);
		_g_object_unref0 (_data_->stream);
		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_->i = 0;
		{
			_data_->_tmp13_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp13_) {
					_data_->_tmp14_ = _data_->i;
					_data_->i = _data_->_tmp14_ + 1;
				}
				_data_->_tmp13_ = FALSE;
				if (!(_data_->i < 2)) {
					break;
				}
				{
					_data_->_tmp15_ = _data_->items_result;
					_data_->_tmp16_ = xmpp_xep_service_discovery_items_result_get_items (_data_->_tmp15_);
					_data_->_tmp17_ = _data_->_tmp16_;
					_data_->_item_list = _data_->_tmp17_;
					_data_->_tmp18_ = _data_->_item_list;
					_data_->_tmp19_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp18_);
					_data_->_tmp20_ = _data_->_tmp19_;
					_data_->_item_size = _data_->_tmp20_;
					_data_->_item_index = -1;
					while (TRUE) {
						_data_->_item_index = _data_->_item_index + 1;
						_data_->_tmp21_ = _data_->_item_index;
						_data_->_tmp22_ = _data_->_item_size;
						if (!(_data_->_tmp21_ < _data_->_tmp22_)) {
							break;
						}
						_data_->_tmp23_ = _data_->_item_list;
						_data_->_tmp24_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp23_, _data_->_item_index);
						_data_->item = (XmppXepServiceDiscoveryItem*) _data_->_tmp24_;
						_data_->_tmp27_ = _data_->item;
						_data_->_tmp28_ = _data_->_tmp27_->jid;
						_data_->_tmp29_ = xmpp_jid_to_string (_data_->_tmp28_);
						_data_->_tmp30_ = _data_->_tmp29_;
						_data_->_tmp31_ = g_str_has_prefix (_data_->_tmp30_, "conference");
						_g_free0 (_data_->_tmp30_);
						if (_data_->_tmp31_) {
							_data_->_tmp26_ = TRUE;
						} else {
							_data_->_tmp32_ = _data_->item;
							_data_->_tmp33_ = _data_->_tmp32_->jid;
							_data_->_tmp34_ = xmpp_jid_to_string (_data_->_tmp33_);
							_data_->_tmp35_ = _data_->_tmp34_;
							_data_->_tmp26_ = g_str_has_prefix (_data_->_tmp35_, "muc");
							_g_free0 (_data_->_tmp35_);
						}
						if (_data_->_tmp26_) {
							_data_->_tmp25_ = TRUE;
						} else {
							_data_->_tmp36_ = _data_->item;
							_data_->_tmp37_ = _data_->_tmp36_->jid;
							_data_->_tmp38_ = xmpp_jid_to_string (_data_->_tmp37_);
							_data_->_tmp39_ = _data_->_tmp38_;
							_data_->_tmp25_ = g_str_has_prefix (_data_->_tmp39_, "chat");
							_g_free0 (_data_->_tmp39_);
						}
						_data_->promising_upload_item = _data_->_tmp25_;
						if (_data_->i == 0) {
							_data_->_tmp41_ = !_data_->promising_upload_item;
						} else {
							_data_->_tmp41_ = FALSE;
						}
						if (_data_->_tmp41_) {
							_data_->_tmp40_ = TRUE;
						} else {
							if (_data_->i == 1) {
								_data_->_tmp42_ = _data_->promising_upload_item;
							} else {
								_data_->_tmp42_ = FALSE;
							}
							_data_->_tmp40_ = _data_->_tmp42_;
						}
						if (_data_->_tmp40_) {
							_xmpp_xep_service_discovery_item_unref0 (_data_->item);
							continue;
						}
						_data_->_tmp43_ = _data_->self->priv->stream_interactor;
						_data_->_tmp44_ = dino_entity_info_IDENTITY;
						_data_->_tmp45_ = dino_stream_interactor_get_module (_data_->_tmp43_, DINO_TYPE_ENTITY_INFO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp44_);
						_data_->_tmp46_ = (DinoEntityInfo*) _data_->_tmp45_;
						_data_->_tmp47_ = _data_->item;
						_data_->_tmp48_ = _data_->_tmp47_->jid;
						_data_->_state_ = 2;
						dino_entity_info_get_identities (_data_->_tmp46_, _data_->account, _data_->_tmp48_, dino_muc_manager_search_default_muc_server_ready, _data_);
						return FALSE;
						_state_2:
						_data_->_tmp49_ = dino_entity_info_get_identities_finish (_data_->_tmp46_, _data_->_res_);
						_data_->_tmp50_ = _data_->_tmp49_;
						_g_object_unref0 (_data_->_tmp46_);
						_data_->identities = _data_->_tmp50_;
						_data_->_tmp51_ = _data_->identities;
						if (_data_->_tmp51_ == NULL) {
							_g_object_unref0 (_data_->identities);
							_xmpp_xep_service_discovery_item_unref0 (_data_->item);
							_g_object_unref0 (_data_->_item_list);
							_xmpp_xep_service_discovery_items_result_unref0 (_data_->items_result);
							_g_object_unref0 (_data_->stream);
							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_->_tmp52_ = _data_->identities;
							_data_->_tmp53_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp52_);
							_data_->_identity_it = _data_->_tmp53_;
							while (TRUE) {
								_data_->_tmp54_ = _data_->_identity_it;
								if (!gee_iterator_next (_data_->_tmp54_)) {
									break;
								}
								_data_->_tmp55_ = _data_->_identity_it;
								_data_->_tmp56_ = gee_iterator_get (_data_->_tmp55_);
								_data_->identity = (XmppXepServiceDiscoveryIdentity*) _data_->_tmp56_;
								_data_->_tmp57_ = _data_->identity;
								_data_->_tmp58_ = xmpp_xep_service_discovery_identity_get_category (_data_->_tmp57_);
								_data_->_tmp59_ = _data_->_tmp58_;
								if (g_strcmp0 (_data_->_tmp59_, XMPP_XEP_SERVICE_DISCOVERY_IDENTITY_CATEGORY_CONFERENCE) == 0) {
									_data_->_tmp60_ = _data_->self->default_muc_server;
									_data_->_tmp61_ = _data_->item;
									_data_->_tmp62_ = _data_->_tmp61_->jid;
									gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp60_, _data_->account, _data_->_tmp62_);
									_data_->_tmp63_ = dino_entities_account_get_bare_jid (_data_->account);
									_data_->_tmp64_ = _data_->_tmp63_;
									_data_->_tmp65_ = _data_->_tmp64_;
									_data_->_tmp66_ = xmpp_jid_to_string (_data_->_tmp65_);
									_data_->_tmp67_ = _data_->_tmp66_;
									_data_->_tmp68_ = _data_->item;
									_data_->_tmp69_ = _data_->_tmp68_->jid;
									_data_->_tmp70_ = xmpp_jid_to_string (_data_->_tmp69_);
									_data_->_tmp71_ = _data_->_tmp70_;
									g_debug ("muc_manager.vala:476: [%s] Default MUC: %s", _data_->_tmp67_, _data_->_tmp71_);
									_g_free0 (_data_->_tmp71_);
									_g_free0 (_data_->_tmp67_);
									_xmpp_jid_unref0 (_data_->_tmp65_);
									_xmpp_xep_service_discovery_identity_unref0 (_data_->identity);
									_g_object_unref0 (_data_->_identity_it);
									_g_object_unref0 (_data_->identities);
									_xmpp_xep_service_discovery_item_unref0 (_data_->item);
									_g_object_unref0 (_data_->_item_list);
									_xmpp_xep_service_discovery_items_result_unref0 (_data_->items_result);
									_g_object_unref0 (_data_->stream);
									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;
								}
								_xmpp_xep_service_discovery_identity_unref0 (_data_->identity);
							}
							_g_object_unref0 (_data_->_identity_it);
						}
						_g_object_unref0 (_data_->identities);
						_xmpp_xep_service_discovery_item_unref0 (_data_->item);
					}
					_g_object_unref0 (_data_->_item_list);
				}
			}
		}
	}
	_xmpp_xep_service_discovery_items_result_unref0 (_data_->items_result);
	_g_object_unref0 (_data_->stream);
	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
dino_muc_manager_on_stream_negotiated_data_free (gpointer _data)
{
	DinoMucManagerOnStreamNegotiatedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerOnStreamNegotiatedData, _data_);
}

static void
dino_muc_manager_on_stream_negotiated (DinoMucManager* self,
                                       DinoEntitiesAccount* account,
                                       XmppXmppStream* stream,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DinoMucManagerOnStreamNegotiatedData* _data_;
	DinoMucManager* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (stream != NULL);
	_data_ = g_slice_new0 (DinoMucManagerOnStreamNegotiatedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_on_stream_negotiated_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp2_;
	dino_muc_manager_on_stream_negotiated_co (_data_);
}

static void
dino_muc_manager_on_stream_negotiated_finish (DinoMucManager* self,
                                              GAsyncResult* _res_)
{
	DinoMucManagerOnStreamNegotiatedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_muc_manager_on_stream_negotiated_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	DinoMucManagerOnStreamNegotiatedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_muc_manager_on_stream_negotiated_co (_data_);
}

static gboolean
dino_muc_manager_on_stream_negotiated_co (DinoMucManagerOnStreamNegotiatedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->mucs_sync_cancellables;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp0_, _data_->account)) {
		{
			_data_->_tmp1_ = _data_->self->priv->mucs_sync_cancellables;
			_data_->_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp1_, _data_->account);
			_data_->_tmp3_ = (GeeHashMap*) _data_->_tmp2_;
			_data_->_tmp4_ = gee_abstract_map_get_values ((GeeAbstractMap*) _data_->_tmp3_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_data_->_tmp6_ = _data_->_tmp5_;
			_data_->_tmp7_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp6_);
			_data_->_tmp8_ = _data_->_tmp7_;
			_g_object_unref0 (_data_->_tmp6_);
			_g_object_unref0 (_data_->_tmp3_);
			_data_->_cancellable_it = _data_->_tmp8_;
			while (TRUE) {
				_data_->_tmp9_ = _data_->_cancellable_it;
				if (!gee_iterator_next (_data_->_tmp9_)) {
					break;
				}
				_data_->_tmp10_ = _data_->_cancellable_it;
				_data_->_tmp11_ = gee_iterator_get (_data_->_tmp10_);
				_data_->cancellable = (GCancellable*) _data_->_tmp11_;
				_data_->_tmp12_ = _data_->cancellable;
				if (!g_cancellable_is_cancelled (_data_->_tmp12_)) {
					_data_->_tmp13_ = _data_->cancellable;
					g_cancellable_cancel (_data_->_tmp13_);
				}
				_g_object_unref0 (_data_->cancellable);
			}
			_g_object_unref0 (_data_->_cancellable_it);
		}
	}
	_data_->_state_ = 1;
	dino_muc_manager_initialize_bookmarks_provider (_data_->self, _data_->account, dino_muc_manager_on_stream_negotiated_ready, _data_);
	return FALSE;
	_state_1:
	dino_muc_manager_initialize_bookmarks_provider_finish (_data_->self, _data_->_res_);
	_data_->_tmp14_ = _data_->self->priv->bookmarks_provider;
	_data_->_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp14_, _data_->account);
	_data_->_tmp16_ = (XmppBookmarksProvider*) _data_->_tmp15_;
	_data_->_state_ = 2;
	xmpp_bookmarks_provider_get_conferences (_data_->_tmp16_, _data_->stream, dino_muc_manager_on_stream_negotiated_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp17_ = xmpp_bookmarks_provider_get_conferences_finish (_data_->_tmp16_, _data_->_res_);
	_data_->_tmp18_ = _data_->_tmp17_;
	_g_object_unref0 (_data_->_tmp16_);
	_data_->conferences = _data_->_tmp18_;
	_data_->_tmp19_ = _data_->conferences;
	if (_data_->_tmp19_ == NULL) {
		dino_muc_manager_join_all_active (_data_->self, _data_->account);
	} else {
		_data_->_tmp20_ = _data_->conferences;
		dino_muc_manager_sync_autojoin_active (_data_->self, _data_->account, _data_->_tmp20_);
	}
	_data_->_tmp21_ = _data_->self->default_muc_server;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp21_, _data_->account)) {
		dino_muc_manager_search_default_muc_server (_data_->self, _data_->account, NULL, NULL);
	}
	_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
dino_muc_manager_initialize_bookmarks_provider_data_free (gpointer _data)
{
	DinoMucManagerInitializeBookmarksProviderData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerInitializeBookmarksProviderData, _data_);
}

static void
dino_muc_manager_initialize_bookmarks_provider (DinoMucManager* self,
                                                DinoEntitiesAccount* account,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	DinoMucManagerInitializeBookmarksProviderData* _data_;
	DinoMucManager* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_data_ = g_slice_new0 (DinoMucManagerInitializeBookmarksProviderData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_initialize_bookmarks_provider_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	dino_muc_manager_initialize_bookmarks_provider_co (_data_);
}

static void
dino_muc_manager_initialize_bookmarks_provider_finish (DinoMucManager* self,
                                                       GAsyncResult* _res_)
{
	DinoMucManagerInitializeBookmarksProviderData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		DinoMucManager* self;
		self = _data27_->self;
		_g_object_unref0 (_data27_->account);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}

static void
dino_muc_manager_initialize_bookmarks_provider_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	DinoMucManagerInitializeBookmarksProviderData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_muc_manager_initialize_bookmarks_provider_co (_data_);
}

static void
__lambda92_ (Block27Data* _data27_,
             XmppXmppStream* stream,
             GeeSet* conferences)
{
	DinoMucManager* self;
	self = _data27_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (conferences != NULL);
	dino_muc_manager_sync_autojoin_active (self, _data27_->account, conferences);
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_BOOKMARKS_UPDATED_SIGNAL], 0, _data27_->account, conferences);
}

static void
___lambda92__xmpp_bookmarks_provider_received_conferences (XmppBookmarksProvider* _sender,
                                                           XmppXmppStream* stream,
                                                           GeeSet* conferences,
                                                           gpointer self)
{
	__lambda92_ (self, stream, conferences);
}

static void
__lambda96_ (Block27Data* _data27_,
             XmppXmppStream* stream,
             XmppConference* conference)
{
	DinoMucManager* self;
	self = _data27_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (conference != NULL);
	dino_muc_manager_on_conference_added (self, _data27_->account, conference);
}

static void
___lambda96__xmpp_bookmarks_provider_conference_added (XmppBookmarksProvider* _sender,
                                                       XmppXmppStream* stream,
                                                       XmppConference* conferences,
                                                       gpointer self)
{
	__lambda96_ (self, stream, conferences);
}

static void
__lambda97_ (Block27Data* _data27_,
             XmppXmppStream* stream,
             XmppJid* jid)
{
	DinoMucManager* self;
	self = _data27_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jid != NULL);
	dino_muc_manager_on_conference_removed (self, _data27_->account, jid);
}

static void
___lambda97__xmpp_bookmarks_provider_conference_removed (XmppBookmarksProvider* _sender,
                                                         XmppXmppStream* stream,
                                                         XmppJid* jid,
                                                         gpointer self)
{
	__lambda97_ (self, stream, jid);
}

static gboolean
dino_muc_manager_initialize_bookmarks_provider_co (DinoMucManagerInitializeBookmarksProviderData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data27_ = g_slice_new0 (Block27Data);
	_data_->_data27_->_ref_count_ = 1;
	_data_->_data27_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data27_->account);
	_data_->_data27_->account = _data_->account;
	_data_->_data27_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->bookmarks_provider;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp0_, _data_->_data27_->account)) {
		block27_data_unref (_data_->_data27_);
		_data_->_data27_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = _data_->self->priv->stream_interactor;
	_data_->_tmp2_ = dino_entity_info_IDENTITY;
	_data_->_tmp3_ = dino_stream_interactor_get_module (_data_->_tmp1_, DINO_TYPE_ENTITY_INFO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp2_);
	_data_->_tmp4_ = (DinoEntityInfo*) _data_->_tmp3_;
	_data_->_tmp5_ = dino_entities_account_get_bare_jid (_data_->_data27_->account);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dino_entity_info_has_feature (_data_->_tmp4_, _data_->_data27_->account, _data_->_tmp7_, XMPP_XEP_BOOKMARKS2_NS_URI_COMPAT, dino_muc_manager_initialize_bookmarks_provider_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dino_entity_info_has_feature_finish (_data_->_tmp4_, _data_->_res_);
	_xmpp_jid_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp4_);
	_data_->has_feature = _data_->_tmp8_;
	if (_data_->has_feature) {
		_data_->_tmp9_ = dino_entities_account_get_bare_jid (_data_->_data27_->account);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = xmpp_jid_to_string (_data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		g_debug ("muc_manager.vala:514: [%s] Using PEP native bookmarks (urn:xmpp:bookma" \
"rks:1)", _data_->_tmp13_);
		_g_free0 (_data_->_tmp13_);
		_xmpp_jid_unref0 (_data_->_tmp11_);
		_data_->_tmp14_ = _data_->self->priv->bookmarks_provider;
		_data_->_tmp15_ = _data_->self->priv->stream_interactor;
		_data_->_tmp16_ = _data_->_tmp15_->module_manager;
		_data_->_tmp17_ = xmpp_xep_bookmarks2_module_IDENTITY;
		_data_->_tmp18_ = dino_module_manager_get_module (_data_->_tmp16_, XMPP_XEP_BOOKMARKS2_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_data27_->account, _data_->_tmp17_);
		_data_->_tmp19_ = (XmppXepBookmarks2Module*) _data_->_tmp18_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp14_, _data_->_data27_->account, (XmppBookmarksProvider*) _data_->_tmp19_);
		_g_object_unref0 (_data_->_tmp19_);
	} else {
		_data_->_tmp20_ = dino_entities_account_get_bare_jid (_data_->_data27_->account);
		_data_->_tmp21_ = _data_->_tmp20_;
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp23_ = xmpp_jid_to_string (_data_->_tmp22_);
		_data_->_tmp24_ = _data_->_tmp23_;
		g_debug ("muc_manager.vala:517: [%s] Using legacy bookmarks (storage:bookmarks)", _data_->_tmp24_);
		_g_free0 (_data_->_tmp24_);
		_xmpp_jid_unref0 (_data_->_tmp22_);
		_data_->_tmp25_ = _data_->self->priv->bookmarks_provider;
		_data_->_tmp26_ = _data_->self->priv->stream_interactor;
		_data_->_tmp27_ = _data_->_tmp26_->module_manager;
		_data_->_tmp28_ = xmpp_xep_bookmarks_module_IDENTITY;
		_data_->_tmp29_ = dino_module_manager_get_module (_data_->_tmp27_, XMPP_XEP_BOOKMARKS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_data27_->account, _data_->_tmp28_);
		_data_->_tmp30_ = (XmppXepBookmarksModule*) _data_->_tmp29_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp25_, _data_->_data27_->account, (XmppBookmarksProvider*) _data_->_tmp30_);
		_g_object_unref0 (_data_->_tmp30_);
	}
	_data_->_tmp31_ = _data_->self->priv->bookmarks_provider;
	_data_->_tmp32_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp31_, _data_->_data27_->account);
	_data_->_tmp33_ = (XmppBookmarksProvider*) _data_->_tmp32_;
	g_signal_connect_data (_data_->_tmp33_, "received-conferences", (GCallback) ___lambda92__xmpp_bookmarks_provider_received_conferences, block27_data_ref (_data_->_data27_), (GClosureNotify) block27_data_unref, 0);
	_g_object_unref0 (_data_->_tmp33_);
	_data_->_tmp34_ = _data_->self->priv->bookmarks_provider;
	_data_->_tmp35_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp34_, _data_->_data27_->account);
	_data_->_tmp36_ = (XmppBookmarksProvider*) _data_->_tmp35_;
	g_signal_connect_data (_data_->_tmp36_, "conference-added", (GCallback) ___lambda96__xmpp_bookmarks_provider_conference_added, block27_data_ref (_data_->_data27_), (GClosureNotify) block27_data_unref, 0);
	_g_object_unref0 (_data_->_tmp36_);
	_data_->_tmp37_ = _data_->self->priv->bookmarks_provider;
	_data_->_tmp38_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp37_, _data_->_data27_->account);
	_data_->_tmp39_ = (XmppBookmarksProvider*) _data_->_tmp38_;
	g_signal_connect_data (_data_->_tmp39_, "conference-removed", (GCallback) ___lambda97__xmpp_bookmarks_provider_conference_removed, block27_data_ref (_data_->_data27_), (GClosureNotify) block27_data_unref, 0);
	_g_object_unref0 (_data_->_tmp39_);
	block27_data_unref (_data_->_data27_);
	_data_->_data27_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block28Data*
block28_data_ref (Block28Data* _data28_)
{
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}

static void
block28_data_unref (void * _userdata_)
{
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		DinoMucManager* self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->account);
		_xmpp_jid_unref0 (_data28_->room_jid);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}

static gboolean
__lambda25_ (Block28Data* _data28_)
{
	DinoMucManager* self;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	GeeList* _tmp2_;
	gboolean result;
	self = _data28_->self;
	_tmp0_ = self->priv->invites;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _data28_->account);
	_tmp2_ = (GeeList*) _tmp1_;
	gee_collection_remove ((GeeCollection*) _tmp2_, _data28_->room_jid);
	_g_object_unref0 (_tmp2_);
	result = FALSE;
	return result;
}

static gboolean
___lambda25__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda25_ (self);
	return result;
}

static void
dino_muc_manager_on_invite_received (DinoMucManager* self,
                                     DinoEntitiesAccount* account,
                                     XmppJid* room_jid,
                                     XmppJid* from_jid,
                                     const gchar* password,
                                     const gchar* reason)
{
	Block28Data* _data28_;
	DinoEntitiesAccount* _tmp0_;
	XmppJid* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp6_;
	gpointer _tmp7_;
	GeeList* _tmp8_;
	gboolean _tmp9_;
	GeeHashMap* _tmp10_;
	gpointer _tmp11_;
	GeeList* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (room_jid != NULL);
	g_return_if_fail (from_jid != NULL);
	_data28_ = g_slice_new0 (Block28Data);
	_data28_->_ref_count_ = 1;
	_data28_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data28_->account);
	_data28_->account = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (room_jid);
	_xmpp_jid_unref0 (_data28_->room_jid);
	_data28_->room_jid = _tmp1_;
	_tmp2_ = self->priv->invites;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp2_, _data28_->account)) {
		GeeHashMap* _tmp3_;
		GeeLinkedList* _tmp4_;
		GeeLinkedList* _tmp5_;
		_tmp3_ = self->priv->invites;
		_tmp4_ = gee_linked_list_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL);
		_tmp5_ = _tmp4_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _data28_->account, (GeeList*) _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_tmp6_ = self->priv->invites;
	_tmp7_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp6_, _data28_->account);
	_tmp8_ = (GeeList*) _tmp7_;
	_tmp9_ = gee_collection_contains ((GeeCollection*) _tmp8_, _data28_->room_jid);
	_g_object_unref0 (_tmp8_);
	if (_tmp9_) {
		block28_data_unref (_data28_);
		_data28_ = NULL;
		return;
	}
	_tmp10_ = self->priv->invites;
	_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp10_, _data28_->account);
	_tmp12_ = (GeeList*) _tmp11_;
	gee_collection_add ((GeeCollection*) _tmp12_, _data28_->room_jid);
	_g_object_unref0 (_tmp12_);
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_INVITE_RECEIVED_SIGNAL], 0, _data28_->account, _data28_->room_jid, from_jid, password, reason);
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, ___lambda25__gsource_func, block28_data_ref (_data28_), block28_data_unref);
	block28_data_unref (_data28_);
	_data28_ = NULL;
}

static void
dino_muc_manager_join_all_active (DinoMucManager* self,
                                  DinoEntitiesAccount* account)
{
	GeeList* conversations = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_conversation_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoConversationManager*) _tmp2_;
	_tmp4_ = dino_conversation_manager_get_active_conversations (_tmp3_, account);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp3_);
	conversations = _tmp5_;
	{
		GeeList* _conversation_list = NULL;
		GeeList* _tmp6_;
		gint _conversation_size = 0;
		GeeList* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		gint _conversation_index = 0;
		_tmp6_ = conversations;
		_conversation_list = _tmp6_;
		_tmp7_ = _conversation_list;
		_tmp8_ = gee_collection_get_size ((GeeCollection*) _tmp7_);
		_tmp9_ = _tmp8_;
		_conversation_size = _tmp9_;
		_conversation_index = -1;
		while (TRUE) {
			gint _tmp10_;
			gint _tmp11_;
			DinoEntitiesConversation* conversation = NULL;
			GeeList* _tmp12_;
			gpointer _tmp13_;
			gboolean _tmp14_ = FALSE;
			DinoEntitiesConversation* _tmp15_;
			DinoEntitiesConversationType _tmp16_;
			DinoEntitiesConversationType _tmp17_;
			_conversation_index = _conversation_index + 1;
			_tmp10_ = _conversation_index;
			_tmp11_ = _conversation_size;
			if (!(_tmp10_ < _tmp11_)) {
				break;
			}
			_tmp12_ = _conversation_list;
			_tmp13_ = gee_list_get (_tmp12_, _conversation_index);
			conversation = (DinoEntitiesConversation*) _tmp13_;
			_tmp15_ = conversation;
			_tmp16_ = dino_entities_conversation_get_type_ (_tmp15_);
			_tmp17_ = _tmp16_;
			if (_tmp17_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
				DinoEntitiesConversation* _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				_tmp18_ = conversation;
				_tmp19_ = dino_entities_conversation_get_nickname (_tmp18_);
				_tmp20_ = _tmp19_;
				_tmp14_ = _tmp20_ != NULL;
			} else {
				_tmp14_ = FALSE;
			}
			if (_tmp14_) {
				DinoEntitiesConversation* _tmp21_;
				XmppJid* _tmp22_;
				XmppJid* _tmp23_;
				DinoEntitiesConversation* _tmp24_;
				const gchar* _tmp25_;
				const gchar* _tmp26_;
				_tmp21_ = conversation;
				_tmp22_ = dino_entities_conversation_get_counterpart (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = conversation;
				_tmp25_ = dino_entities_conversation_get_nickname (_tmp24_);
				_tmp26_ = _tmp25_;
				dino_muc_manager_join (self, account, _tmp23_, _tmp26_, NULL, FALSE, NULL, NULL, NULL);
			}
			_g_object_unref0 (conversation);
		}
	}
	_g_object_unref0 (conversations);
}

static void
dino_muc_manager_sync_autojoin_active (DinoMucManager* self,
                                       DinoEntitiesAccount* account,
                                       GeeSet* conferences)
{
	GeeList* active_conversations = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (conferences != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_conversation_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoConversationManager*) _tmp2_;
	_tmp4_ = dino_conversation_manager_get_active_conversations (_tmp3_, account);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp3_);
	active_conversations = _tmp5_;
	{
		GeeIterator* _conference_it = NULL;
		GeeIterator* _tmp6_;
		_tmp6_ = gee_iterable_iterator ((GeeIterable*) conferences);
		_conference_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			XmppConference* conference = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			XmppConference* _tmp10_;
			gboolean _tmp11_;
			gboolean _tmp12_;
			gboolean is_active = FALSE;
			gboolean _tmp27_ = FALSE;
			_tmp7_ = _conference_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _conference_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			conference = (XmppConference*) _tmp9_;
			_tmp10_ = conference;
			_tmp11_ = xmpp_conference_get_autojoin (_tmp10_);
			_tmp12_ = _tmp11_;
			if (!_tmp12_) {
				_g_object_unref0 (conference);
				continue;
			}
			is_active = FALSE;
			{
				GeeList* _conversation_list = NULL;
				GeeList* _tmp13_;
				gint _conversation_size = 0;
				GeeList* _tmp14_;
				gint _tmp15_;
				gint _tmp16_;
				gint _conversation_index = 0;
				_tmp13_ = active_conversations;
				_conversation_list = _tmp13_;
				_tmp14_ = _conversation_list;
				_tmp15_ = gee_collection_get_size ((GeeCollection*) _tmp14_);
				_tmp16_ = _tmp15_;
				_conversation_size = _tmp16_;
				_conversation_index = -1;
				while (TRUE) {
					gint _tmp17_;
					gint _tmp18_;
					DinoEntitiesConversation* conversation = NULL;
					GeeList* _tmp19_;
					gpointer _tmp20_;
					XmppConference* _tmp21_;
					XmppJid* _tmp22_;
					XmppJid* _tmp23_;
					DinoEntitiesConversation* _tmp24_;
					XmppJid* _tmp25_;
					XmppJid* _tmp26_;
					_conversation_index = _conversation_index + 1;
					_tmp17_ = _conversation_index;
					_tmp18_ = _conversation_size;
					if (!(_tmp17_ < _tmp18_)) {
						break;
					}
					_tmp19_ = _conversation_list;
					_tmp20_ = gee_list_get (_tmp19_, _conversation_index);
					conversation = (DinoEntitiesConversation*) _tmp20_;
					_tmp21_ = conference;
					_tmp22_ = xmpp_conference_get_jid (_tmp21_);
					_tmp23_ = _tmp22_;
					_tmp24_ = conversation;
					_tmp25_ = dino_entities_conversation_get_counterpart (_tmp24_);
					_tmp26_ = _tmp25_;
					if (xmpp_jid_equals (_tmp23_, _tmp26_)) {
						is_active = TRUE;
					}
					_g_object_unref0 (conversation);
				}
			}
			if (!is_active) {
				_tmp27_ = TRUE;
			} else {
				XmppConference* _tmp28_;
				XmppJid* _tmp29_;
				XmppJid* _tmp30_;
				_tmp28_ = conference;
				_tmp29_ = xmpp_conference_get_jid (_tmp28_);
				_tmp30_ = _tmp29_;
				_tmp27_ = !dino_muc_manager_is_joined (self, _tmp30_, account);
			}
			if (_tmp27_) {
				XmppConference* _tmp31_;
				XmppJid* _tmp32_;
				XmppJid* _tmp33_;
				XmppConference* _tmp34_;
				const gchar* _tmp35_;
				const gchar* _tmp36_;
				XmppConference* _tmp37_;
				const gchar* _tmp38_;
				const gchar* _tmp39_;
				_tmp31_ = conference;
				_tmp32_ = xmpp_conference_get_jid (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = conference;
				_tmp35_ = xmpp_conference_get_nick (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = conference;
				_tmp38_ = xmpp_conference_get_password (_tmp37_);
				_tmp39_ = _tmp38_;
				dino_muc_manager_join (self, account, _tmp33_, _tmp36_, _tmp39_, TRUE, NULL, NULL, NULL);
			}
			_g_object_unref0 (conference);
		}
		_g_object_unref0 (_conference_it);
	}
	{
		GeeList* _conversation_list = NULL;
		GeeList* _tmp40_;
		gint _conversation_size = 0;
		GeeList* _tmp41_;
		gint _tmp42_;
		gint _tmp43_;
		gint _conversation_index = 0;
		_tmp40_ = active_conversations;
		_conversation_list = _tmp40_;
		_tmp41_ = _conversation_list;
		_tmp42_ = gee_collection_get_size ((GeeCollection*) _tmp41_);
		_tmp43_ = _tmp42_;
		_conversation_size = _tmp43_;
		_conversation_index = -1;
		while (TRUE) {
			gint _tmp44_;
			gint _tmp45_;
			DinoEntitiesConversation* conversation = NULL;
			GeeList* _tmp46_;
			gpointer _tmp47_;
			DinoEntitiesConversation* _tmp48_;
			DinoEntitiesConversationType _tmp49_;
			DinoEntitiesConversationType _tmp50_;
			gboolean should_be_active = FALSE;
			_conversation_index = _conversation_index + 1;
			_tmp44_ = _conversation_index;
			_tmp45_ = _conversation_size;
			if (!(_tmp44_ < _tmp45_)) {
				break;
			}
			_tmp46_ = _conversation_list;
			_tmp47_ = gee_list_get (_tmp46_, _conversation_index);
			conversation = (DinoEntitiesConversation*) _tmp47_;
			_tmp48_ = conversation;
			_tmp49_ = dino_entities_conversation_get_type_ (_tmp48_);
			_tmp50_ = _tmp49_;
			if (_tmp50_ != DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
				_g_object_unref0 (conversation);
				continue;
			}
			should_be_active = FALSE;
			{
				GeeIterator* _conference_it = NULL;
				GeeIterator* _tmp51_;
				_tmp51_ = gee_iterable_iterator ((GeeIterable*) conferences);
				_conference_it = _tmp51_;
				while (TRUE) {
					GeeIterator* _tmp52_;
					XmppConference* conference = NULL;
					GeeIterator* _tmp53_;
					gpointer _tmp54_;
					gboolean _tmp55_ = FALSE;
					XmppConference* _tmp56_;
					XmppJid* _tmp57_;
					XmppJid* _tmp58_;
					DinoEntitiesConversation* _tmp59_;
					XmppJid* _tmp60_;
					XmppJid* _tmp61_;
					_tmp52_ = _conference_it;
					if (!gee_iterator_next (_tmp52_)) {
						break;
					}
					_tmp53_ = _conference_it;
					_tmp54_ = gee_iterator_get (_tmp53_);
					conference = (XmppConference*) _tmp54_;
					_tmp56_ = conference;
					_tmp57_ = xmpp_conference_get_jid (_tmp56_);
					_tmp58_ = _tmp57_;
					_tmp59_ = conversation;
					_tmp60_ = dino_entities_conversation_get_counterpart (_tmp59_);
					_tmp61_ = _tmp60_;
					if (xmpp_jid_equals (_tmp58_, _tmp61_)) {
						XmppConference* _tmp62_;
						gboolean _tmp63_;
						gboolean _tmp64_;
						_tmp62_ = conference;
						_tmp63_ = xmpp_conference_get_autojoin (_tmp62_);
						_tmp64_ = _tmp63_;
						_tmp55_ = _tmp64_;
					} else {
						_tmp55_ = FALSE;
					}
					if (_tmp55_) {
						should_be_active = TRUE;
					}
					_g_object_unref0 (conference);
				}
				_g_object_unref0 (_conference_it);
			}
			if (!should_be_active) {
				DinoEntitiesConversation* _tmp65_;
				DinoEntitiesAccount* _tmp66_;
				DinoEntitiesAccount* _tmp67_;
				DinoEntitiesConversation* _tmp68_;
				XmppJid* _tmp69_;
				XmppJid* _tmp70_;
				_tmp65_ = conversation;
				_tmp66_ = dino_entities_conversation_get_account (_tmp65_);
				_tmp67_ = _tmp66_;
				_tmp68_ = conversation;
				_tmp69_ = dino_entities_conversation_get_counterpart (_tmp68_);
				_tmp70_ = _tmp69_;
				dino_muc_manager_part (self, _tmp67_, _tmp70_);
			}
			_g_object_unref0 (conversation);
		}
	}
	_g_object_unref0 (active_conversations);
}

static Block29Data*
block29_data_ref (Block29Data* _data29_)
{
	g_atomic_int_inc (&_data29_->_ref_count_);
	return _data29_;
}

static void
block29_data_unref (void * _userdata_)
{
	Block29Data* _data29_;
	_data29_ = (Block29Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data29_->_ref_count_)) {
		DinoMucManager* self;
		self = _data29_->self;
		_g_object_unref0 (_data29_->account);
		_g_object_unref0 (_data29_->stream);
		_xmpp_jid_unref0 (_data29_->jid);
		_g_free0 (_data29_->nick);
		_g_free0 (_data29_->password);
		_g_object_unref0 (self);
		g_slice_free (Block29Data, _data29_);
	}
}

static void
__lambda93_ (Block29Data* _data29_,
             GObject* _,
             GAsyncResult* res)
{
	DinoMucManager* self;
	GeeSet* conferences = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	XmppBookmarksProvider* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	XmppConference* changed = NULL;
	gchar* _tmp37_;
	gchar* _tmp38_;
	XmppXepBookmarksBookmarks1Conference* _tmp39_ = NULL;
	GeeHashMap* _tmp40_;
	gpointer _tmp41_;
	XmppBookmarksProvider* _tmp42_;
	XmppConference* _tmp43_;
	self = _data29_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = self->priv->bookmarks_provider;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _data29_->account);
	_tmp2_ = (XmppBookmarksProvider*) _tmp1_;
	_tmp3_ = xmpp_bookmarks_provider_get_conferences_finish (_tmp2_, res);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp2_);
	conferences = _tmp4_;
	_tmp5_ = conferences;
	if (_tmp5_ == NULL) {
		_g_object_unref0 (conferences);
		return;
	}
	{
		GeeIterator* _conference_it = NULL;
		GeeSet* _tmp6_;
		GeeIterator* _tmp7_;
		_tmp6_ = conferences;
		_tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_);
		_conference_it = _tmp7_;
		while (TRUE) {
			GeeIterator* _tmp8_;
			XmppConference* conference = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			XmppConference* _tmp11_;
			XmppJid* _tmp12_;
			XmppJid* _tmp13_;
			_tmp8_ = _conference_it;
			if (!gee_iterator_next (_tmp8_)) {
				break;
			}
			_tmp9_ = _conference_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			conference = (XmppConference*) _tmp10_;
			_tmp11_ = conference;
			_tmp12_ = xmpp_conference_get_jid (_tmp11_);
			_tmp13_ = _tmp12_;
			if (xmpp_jid_equals (_tmp13_, _data29_->jid)) {
				XmppConference* _tmp14_;
				gboolean _tmp15_;
				gboolean _tmp16_;
				_tmp14_ = conference;
				_tmp15_ = xmpp_conference_get_autojoin (_tmp14_);
				_tmp16_ = _tmp15_;
				if (!_tmp16_) {
					const gchar* _tmp17_ = NULL;
					const gchar* _tmp21_ = NULL;
					XmppConference* new_conference = NULL;
					XmppJid* _tmp25_;
					gchar* _tmp26_;
					XmppConference* _tmp27_;
					const gchar* _tmp28_;
					const gchar* _tmp29_;
					gchar* _tmp30_;
					gchar* _tmp31_;
					XmppConference* _tmp32_ = NULL;
					GeeHashMap* _tmp33_;
					gpointer _tmp34_;
					XmppBookmarksProvider* _tmp35_;
					XmppConference* _tmp36_;
					_tmp17_ = _data29_->nick;
					if (_tmp17_ == NULL) {
						XmppConference* _tmp18_;
						const gchar* _tmp19_;
						const gchar* _tmp20_;
						_tmp18_ = conference;
						_tmp19_ = xmpp_conference_get_nick (_tmp18_);
						_tmp20_ = _tmp19_;
						_tmp17_ = _tmp20_;
					}
					_tmp21_ = _data29_->password;
					if (_tmp21_ == NULL) {
						XmppConference* _tmp22_;
						const gchar* _tmp23_;
						const gchar* _tmp24_;
						_tmp22_ = conference;
						_tmp23_ = xmpp_conference_get_password (_tmp22_);
						_tmp24_ = _tmp23_;
						_tmp21_ = _tmp24_;
					}
					_tmp25_ = _xmpp_jid_ref0 (_data29_->jid);
					_tmp26_ = g_strdup (_tmp17_);
					_tmp27_ = conference;
					_tmp28_ = xmpp_conference_get_name (_tmp27_);
					_tmp29_ = _tmp28_;
					_tmp30_ = g_strdup (_tmp29_);
					_tmp31_ = g_strdup (_tmp21_);
					_tmp32_ = xmpp_conference_new ();
					xmpp_conference_set_jid (_tmp32_, _tmp25_);
					_xmpp_jid_unref0 (_tmp25_);
					xmpp_conference_set_nick (_tmp32_, _tmp26_);
					_g_free0 (_tmp26_);
					xmpp_conference_set_name (_tmp32_, _tmp30_);
					_g_free0 (_tmp30_);
					xmpp_conference_set_password (_tmp32_, _tmp31_);
					_g_free0 (_tmp31_);
					xmpp_conference_set_autojoin (_tmp32_, TRUE);
					new_conference = _tmp32_;
					_tmp33_ = self->priv->bookmarks_provider;
					_tmp34_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp33_, _data29_->account);
					_tmp35_ = (XmppBookmarksProvider*) _tmp34_;
					_tmp36_ = new_conference;
					xmpp_bookmarks_provider_replace_conference (_tmp35_, _data29_->stream, _data29_->jid, _tmp36_, NULL, NULL);
					_g_object_unref0 (_tmp35_);
					_g_object_unref0 (new_conference);
				}
				_g_object_unref0 (conference);
				_g_object_unref0 (_conference_it);
				_g_object_unref0 (conferences);
				return;
			}
			_g_object_unref0 (conference);
		}
		_g_object_unref0 (_conference_it);
	}
	_tmp37_ = g_strdup (_data29_->nick);
	_tmp38_ = g_strdup (_data29_->password);
	_tmp39_ = xmpp_xep_bookmarks_bookmarks1_conference_new (_data29_->jid);
	xmpp_conference_set_nick ((XmppConference*) _tmp39_, _tmp37_);
	_g_free0 (_tmp37_);
	xmpp_conference_set_password ((XmppConference*) _tmp39_, _tmp38_);
	_g_free0 (_tmp38_);
	xmpp_conference_set_autojoin ((XmppConference*) _tmp39_, TRUE);
	changed = (XmppConference*) _tmp39_;
	_tmp40_ = self->priv->bookmarks_provider;
	_tmp41_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp40_, _data29_->account);
	_tmp42_ = (XmppBookmarksProvider*) _tmp41_;
	_tmp43_ = changed;
	xmpp_bookmarks_provider_add_conference (_tmp42_, _data29_->stream, _tmp43_, NULL, NULL);
	_g_object_unref0 (_tmp42_);
	_g_object_unref0 (changed);
	_g_object_unref0 (conferences);
}

static void
___lambda93__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda93_ (self, source_object, res);
	block29_data_unref (self);
}

static void
dino_muc_manager_set_autojoin (DinoMucManager* self,
                               DinoEntitiesAccount* account,
                               XmppXmppStream* stream,
                               XmppJid* jid,
                               const gchar* nick,
                               const gchar* password)
{
	Block29Data* _data29_;
	DinoEntitiesAccount* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppJid* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GeeHashMap* _tmp5_;
	gpointer _tmp6_;
	XmppBookmarksProvider* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jid != NULL);
	_data29_ = g_slice_new0 (Block29Data);
	_data29_->_ref_count_ = 1;
	_data29_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data29_->account);
	_data29_->account = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data29_->stream);
	_data29_->stream = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (_data29_->jid);
	_data29_->jid = _tmp2_;
	_tmp3_ = g_strdup (nick);
	_g_free0 (_data29_->nick);
	_data29_->nick = _tmp3_;
	_tmp4_ = g_strdup (password);
	_g_free0 (_data29_->password);
	_data29_->password = _tmp4_;
	_tmp5_ = self->priv->bookmarks_provider;
	_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp5_, _data29_->account);
	_tmp7_ = (XmppBookmarksProvider*) _tmp6_;
	xmpp_bookmarks_provider_get_conferences (_tmp7_, _data29_->stream, ___lambda93__gasync_ready_callback, block29_data_ref (_data29_));
	_g_object_unref0 (_tmp7_);
	block29_data_unref (_data29_);
	_data29_ = NULL;
}

static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		DinoMucManager* self;
		self = _data30_->self;
		_g_object_unref0 (_data30_->account);
		_g_object_unref0 (_data30_->stream);
		_xmpp_jid_unref0 (_data30_->jid);
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}

static void
__lambda95_ (Block30Data* _data30_,
             GObject* _,
             GAsyncResult* res)
{
	DinoMucManager* self;
	GeeSet* conferences = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	XmppBookmarksProvider* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	self = _data30_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = self->priv->bookmarks_provider;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _data30_->account);
	_tmp2_ = (XmppBookmarksProvider*) _tmp1_;
	_tmp3_ = xmpp_bookmarks_provider_get_conferences_finish (_tmp2_, res);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp2_);
	conferences = _tmp4_;
	_tmp5_ = conferences;
	if (_tmp5_ == NULL) {
		_g_object_unref0 (conferences);
		return;
	}
	{
		GeeIterator* _conference_it = NULL;
		GeeSet* _tmp6_;
		GeeIterator* _tmp7_;
		_tmp6_ = conferences;
		_tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_);
		_conference_it = _tmp7_;
		while (TRUE) {
			GeeIterator* _tmp8_;
			XmppConference* conference = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			XmppConference* _tmp11_;
			XmppJid* _tmp12_;
			XmppJid* _tmp13_;
			_tmp8_ = _conference_it;
			if (!gee_iterator_next (_tmp8_)) {
				break;
			}
			_tmp9_ = _conference_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			conference = (XmppConference*) _tmp10_;
			_tmp11_ = conference;
			_tmp12_ = xmpp_conference_get_jid (_tmp11_);
			_tmp13_ = _tmp12_;
			if (xmpp_jid_equals (_tmp13_, _data30_->jid)) {
				XmppConference* _tmp14_;
				gboolean _tmp15_;
				gboolean _tmp16_;
				_tmp14_ = conference;
				_tmp15_ = xmpp_conference_get_autojoin (_tmp14_);
				_tmp16_ = _tmp15_;
				if (_tmp16_) {
					XmppConference* new_conference = NULL;
					XmppJid* _tmp17_;
					XmppConference* _tmp18_;
					const gchar* _tmp19_;
					const gchar* _tmp20_;
					gchar* _tmp21_;
					XmppConference* _tmp22_;
					const gchar* _tmp23_;
					const gchar* _tmp24_;
					gchar* _tmp25_;
					XmppConference* _tmp26_;
					const gchar* _tmp27_;
					const gchar* _tmp28_;
					gchar* _tmp29_;
					XmppConference* _tmp30_ = NULL;
					GeeHashMap* _tmp31_;
					gpointer _tmp32_;
					XmppBookmarksProvider* _tmp33_;
					XmppConference* _tmp34_;
					_tmp17_ = _xmpp_jid_ref0 (_data30_->jid);
					_tmp18_ = conference;
					_tmp19_ = xmpp_conference_get_nick (_tmp18_);
					_tmp20_ = _tmp19_;
					_tmp21_ = g_strdup (_tmp20_);
					_tmp22_ = conference;
					_tmp23_ = xmpp_conference_get_name (_tmp22_);
					_tmp24_ = _tmp23_;
					_tmp25_ = g_strdup (_tmp24_);
					_tmp26_ = conference;
					_tmp27_ = xmpp_conference_get_password (_tmp26_);
					_tmp28_ = _tmp27_;
					_tmp29_ = g_strdup (_tmp28_);
					_tmp30_ = xmpp_conference_new ();
					xmpp_conference_set_jid (_tmp30_, _tmp17_);
					_xmpp_jid_unref0 (_tmp17_);
					xmpp_conference_set_nick (_tmp30_, _tmp21_);
					_g_free0 (_tmp21_);
					xmpp_conference_set_name (_tmp30_, _tmp25_);
					_g_free0 (_tmp25_);
					xmpp_conference_set_password (_tmp30_, _tmp29_);
					_g_free0 (_tmp29_);
					xmpp_conference_set_autojoin (_tmp30_, FALSE);
					new_conference = _tmp30_;
					_tmp31_ = self->priv->bookmarks_provider;
					_tmp32_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp31_, _data30_->account);
					_tmp33_ = (XmppBookmarksProvider*) _tmp32_;
					_tmp34_ = new_conference;
					xmpp_bookmarks_provider_replace_conference (_tmp33_, _data30_->stream, _data30_->jid, _tmp34_, NULL, NULL);
					_g_object_unref0 (_tmp33_);
					_g_object_unref0 (new_conference);
					_g_object_unref0 (conference);
					_g_object_unref0 (_conference_it);
					_g_object_unref0 (conferences);
					return;
				}
			}
			_g_object_unref0 (conference);
		}
		_g_object_unref0 (_conference_it);
	}
	_g_object_unref0 (conferences);
}

static void
___lambda95__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda95_ (self, source_object, res);
	block30_data_unref (self);
}

static void
dino_muc_manager_unset_autojoin (DinoMucManager* self,
                                 DinoEntitiesAccount* account,
                                 XmppXmppStream* stream,
                                 XmppJid* jid)
{
	Block30Data* _data30_;
	DinoEntitiesAccount* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppJid* _tmp2_;
	GeeHashMap* _tmp3_;
	gpointer _tmp4_;
	XmppBookmarksProvider* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (jid != NULL);
	_data30_ = g_slice_new0 (Block30Data);
	_data30_->_ref_count_ = 1;
	_data30_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data30_->account);
	_data30_->account = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data30_->stream);
	_data30_->stream = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (_data30_->jid);
	_data30_->jid = _tmp2_;
	_tmp3_ = self->priv->bookmarks_provider;
	_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _data30_->account);
	_tmp5_ = (XmppBookmarksProvider*) _tmp4_;
	xmpp_bookmarks_provider_get_conferences (_tmp5_, _data30_->stream, ___lambda95__gasync_ready_callback, block30_data_ref (_data30_));
	_g_object_unref0 (_tmp5_);
	block30_data_unref (_data30_);
	_data30_ = NULL;
}

static void
dino_muc_manager_on_conference_added (DinoMucManager* self,
                                      DinoEntitiesAccount* account,
                                      XmppConference* conference)
{
	DinoEntitiesConversation* conversation = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	DinoEntitiesConversationType _tmp6_;
	DinoEntitiesConversation* _tmp7_;
	DinoEntitiesConversation* _tmp8_;
	DinoEntitiesConversation* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (conference != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_conversation_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoConversationManager*) _tmp2_;
	_tmp4_ = xmpp_conference_get_jid (conference);
	_tmp5_ = _tmp4_;
	_tmp6_ = DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT;
	_tmp7_ = dino_conversation_manager_get_conversation (_tmp3_, _tmp5_, account, &_tmp6_);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp3_);
	conversation = _tmp8_;
	_tmp9_ = conversation;
	if (_tmp9_ != NULL) {
		gboolean _tmp10_ = FALSE;
		DinoEntitiesConversation* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		_tmp11_ = conversation;
		_tmp12_ = dino_entities_conversation_get_active (_tmp11_);
		_tmp13_ = _tmp12_;
		if (!_tmp13_) {
			gboolean _tmp14_;
			gboolean _tmp15_;
			_tmp14_ = xmpp_conference_get_autojoin (conference);
			_tmp15_ = _tmp14_;
			_tmp10_ = _tmp15_;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			XmppJid* _tmp16_;
			XmppJid* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			_tmp16_ = xmpp_conference_get_jid (conference);
			_tmp17_ = _tmp16_;
			_tmp18_ = xmpp_conference_get_nick (conference);
			_tmp19_ = _tmp18_;
			_tmp20_ = xmpp_conference_get_password (conference);
			_tmp21_ = _tmp20_;
			dino_muc_manager_join (self, account, _tmp17_, _tmp19_, _tmp21_, FALSE, NULL, NULL, NULL);
		} else {
			gboolean _tmp22_ = FALSE;
			DinoEntitiesConversation* _tmp23_;
			gboolean _tmp24_;
			gboolean _tmp25_;
			_tmp23_ = conversation;
			_tmp24_ = dino_entities_conversation_get_active (_tmp23_);
			_tmp25_ = _tmp24_;
			if (_tmp25_) {
				gboolean _tmp26_;
				gboolean _tmp27_;
				_tmp26_ = xmpp_conference_get_autojoin (conference);
				_tmp27_ = _tmp26_;
				_tmp22_ = !_tmp27_;
			} else {
				_tmp22_ = FALSE;
			}
			if (_tmp22_) {
				XmppJid* _tmp28_;
				XmppJid* _tmp29_;
				_tmp28_ = xmpp_conference_get_jid (conference);
				_tmp29_ = _tmp28_;
				dino_muc_manager_part (self, account, _tmp29_);
			}
		}
	} else {
		gboolean _tmp30_;
		gboolean _tmp31_;
		_tmp30_ = xmpp_conference_get_autojoin (conference);
		_tmp31_ = _tmp30_;
		if (_tmp31_) {
			XmppJid* _tmp32_;
			XmppJid* _tmp33_;
			const gchar* _tmp34_;
			const gchar* _tmp35_;
			const gchar* _tmp36_;
			const gchar* _tmp37_;
			_tmp32_ = xmpp_conference_get_jid (conference);
			_tmp33_ = _tmp32_;
			_tmp34_ = xmpp_conference_get_nick (conference);
			_tmp35_ = _tmp34_;
			_tmp36_ = xmpp_conference_get_password (conference);
			_tmp37_ = _tmp36_;
			dino_muc_manager_join (self, account, _tmp33_, _tmp35_, _tmp37_, FALSE, NULL, NULL, NULL);
		}
	}
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_CONFERENCE_ADDED_SIGNAL], 0, account, conference);
	_g_object_unref0 (conversation);
}

static void
dino_muc_manager_on_conference_removed (DinoMucManager* self,
                                        DinoEntitiesAccount* account,
                                        XmppJid* jid)
{
	DinoEntitiesConversation* conversation = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	DinoEntitiesConversationType _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	gboolean _tmp7_ = FALSE;
	DinoEntitiesConversation* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_conversation_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoConversationManager*) _tmp2_;
	_tmp4_ = DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT;
	_tmp5_ = dino_conversation_manager_get_conversation (_tmp3_, jid, account, &_tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp3_);
	conversation = _tmp6_;
	_tmp8_ = conversation;
	if (_tmp8_ != NULL) {
		DinoEntitiesConversation* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = conversation;
		_tmp10_ = dino_entities_conversation_get_active (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp7_ = _tmp11_;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		dino_muc_manager_part (self, account, jid);
	}
	g_signal_emit (self, dino_muc_manager_signals[DINO_MUC_MANAGER_CONFERENCE_REMOVED_SIGNAL], 0, account, jid);
	_g_object_unref0 (conversation);
}

static void
dino_muc_manager_on_build_message_stanza (DinoMucManager* self,
                                          DinoEntitiesMessage* message,
                                          XmppMessageStanza* message_stanza,
                                          DinoEntitiesConversation* conversation)
{
	DinoEntitiesConversationType _tmp0_;
	DinoEntitiesConversationType _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	g_return_if_fail (message_stanza != NULL);
	g_return_if_fail (conversation != NULL);
	_tmp0_ = dino_entities_conversation_get_type_ (conversation);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT_PM) {
		xmpp_xep_muc_add_muc_pm_message_stanza_x_node (message_stanza);
	}
}

static Block31Data*
block31_data_ref (Block31Data* _data31_)
{
	g_atomic_int_inc (&_data31_->_ref_count_);
	return _data31_;
}

static void
block31_data_unref (void * _userdata_)
{
	Block31Data* _data31_;
	_data31_ = (Block31Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data31_->_ref_count_)) {
		DinoMucManager* self;
		self = _data31_->self;
		_g_object_unref0 (_data31_->stream);
		_g_object_unref0 (_data31_->account);
		_g_object_unref0 (self);
		g_slice_free (Block31Data, _data31_);
	}
}

static Block32Data*
block32_data_ref (Block32Data* _data32_)
{
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}

static void
block32_data_unref (void * _userdata_)
{
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		DinoMucManager* self;
		self = _data32_->_data31_->self;
		_xmpp_jid_unref0 (_data32_->jid);
		block31_data_unref (_data32_->_data31_);
		_data32_->_data31_ = NULL;
		g_slice_free (Block32Data, _data32_);
	}
}

static void
____lambda100_ (Block32Data* _data32_,
                GObject* _,
                GAsyncResult* res)
{
	Block31Data* _data31_;
	DinoMucManager* self;
	_data31_ = _data32_->_data31_;
	self = _data31_->self;
	g_return_if_fail (res != NULL);
	_data32_->joined = xmpp_xep_muc_self_ping_is_joined_finish (res);
}

static void
_____lambda100__gasync_ready_callback (GObject* source_object,
                                       GAsyncResult* res,
                                       gpointer self)
{
	____lambda100_ (self, source_object, res);
	block32_data_unref (self);
}

static gboolean
____lambda101_ (Block32Data* _data32_)
{
	Block31Data* _data31_;
	DinoMucManager* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	XmppJid* _tmp7_;
	XmppJid* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	const gchar* _tmp12_;
	gboolean result;
	_data31_ = _data32_->_data31_;
	self = _data31_->self;
	if (_data32_->joined) {
		_tmp1_ = TRUE;
	} else {
		GeeHashMap* _tmp2_;
		_tmp2_ = self->priv->mucs_joined;
		_tmp1_ = !gee_abstract_map_has_key ((GeeAbstractMap*) _tmp2_, _data31_->account);
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		DinoStreamInteractor* _tmp3_;
		XmppXmppStream* _tmp4_;
		XmppXmppStream* _tmp5_;
		XmppXmppStream* _tmp6_;
		_tmp3_ = self->priv->stream_interactor;
		_tmp4_ = dino_stream_interactor_get_stream (_tmp3_, _data31_->account);
		_tmp5_ = _tmp4_;
		_tmp6_ = _data31_->stream;
		_tmp0_ = _tmp5_ != _tmp6_;
		_g_object_unref0 (_tmp5_);
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	_tmp7_ = _data32_->jid;
	_tmp8_ = xmpp_jid_get_bare_jid (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_;
	_tmp11_ = _data32_->jid;
	_tmp12_ = _tmp11_->resourcepart;
	dino_muc_manager_join (self, _data31_->account, _tmp10_, _tmp12_, NULL, TRUE, NULL, NULL, NULL);
	_xmpp_jid_unref0 (_tmp10_);
	result = FALSE;
	return result;
}

static gboolean
_____lambda101__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda101_ (self);
	return result;
}

static void
dino_muc_manager_self_ping (DinoMucManager* self,
                            DinoEntitiesAccount* account)
{
	Block31Data* _data31_;
	DinoEntitiesAccount* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	XmppXmppStream* _tmp2_;
	XmppXmppStream* _tmp3_;
	GeeHashMap* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_data31_ = g_slice_new0 (Block31Data);
	_data31_->_ref_count_ = 1;
	_data31_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data31_->account);
	_data31_->account = _tmp0_;
	_tmp1_ = self->priv->stream_interactor;
	_tmp2_ = dino_stream_interactor_get_stream (_tmp1_, _data31_->account);
	_data31_->stream = _tmp2_;
	_tmp3_ = _data31_->stream;
	if (_tmp3_ == NULL) {
		block31_data_unref (_data31_);
		_data31_ = NULL;
		return;
	}
	_tmp4_ = self->priv->mucs_joined;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp4_, _data31_->account)) {
		block31_data_unref (_data31_);
		_data31_ = NULL;
		return;
	}
	{
		GeeIterator* _jid_it = NULL;
		GeeHashMap* _tmp5_;
		gpointer _tmp6_;
		GeeHashSet* _tmp7_;
		GeeIterator* _tmp8_;
		GeeIterator* _tmp9_;
		_tmp5_ = self->priv->mucs_joined;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp5_, _data31_->account);
		_tmp7_ = (GeeHashSet*) _tmp6_;
		_tmp8_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp7_);
		_tmp9_ = _tmp8_;
		_g_object_unref0 (_tmp7_);
		_jid_it = _tmp9_;
		while (TRUE) {
			Block32Data* _data32_;
			GeeIterator* _tmp10_;
			GeeIterator* _tmp11_;
			gpointer _tmp12_;
			XmppXmppStream* _tmp13_;
			XmppJid* _tmp14_;
			_data32_ = g_slice_new0 (Block32Data);
			_data32_->_ref_count_ = 1;
			_data32_->_data31_ = block31_data_ref (_data31_);
			_tmp10_ = _jid_it;
			if (!gee_iterator_next (_tmp10_)) {
				block32_data_unref (_data32_);
				_data32_ = NULL;
				break;
			}
			_tmp11_ = _jid_it;
			_tmp12_ = gee_iterator_get (_tmp11_);
			_data32_->jid = (XmppJid*) _tmp12_;
			_data32_->joined = FALSE;
			_tmp13_ = _data31_->stream;
			_tmp14_ = _data32_->jid;
			xmpp_xep_muc_self_ping_is_joined (_tmp13_, _tmp14_, _____lambda100__gasync_ready_callback, block32_data_ref (_data32_));
			g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 10, _____lambda101__gsource_func, block32_data_ref (_data32_), block32_data_unref);
			block32_data_unref (_data32_);
			_data32_ = NULL;
		}
		_g_object_unref0 (_jid_it);
	}
	block31_data_unref (_data31_);
	_data31_ = NULL;
}

static const gchar*
dino_muc_manager_real_get_id (DinoStreamInteractionModule* base)
{
	const gchar* result;
	DinoMucManager* self;
	DinoModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (DinoMucManager*) base;
	_tmp0_ = dino_muc_manager_IDENTITY;
	_tmp1_ = dino_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

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

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

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

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

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

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

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

static inline gpointer
dino_muc_manager_received_message_listener_get_instance_private (DinoMucManagerReceivedMessageListener* self)
{
	return G_STRUCT_MEMBER_P (self, DinoMucManagerReceivedMessageListener_private_offset);
}

static DinoMucManagerReceivedMessageListener*
dino_muc_manager_received_message_listener_construct (GType object_type,
                                                      DinoStreamInteractor* stream_interactor)
{
	DinoMucManagerReceivedMessageListener * self = NULL;
	DinoStreamInteractor* _tmp0_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	self = (DinoMucManagerReceivedMessageListener*) dino_message_listener_construct (object_type);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	return self;
}

static DinoMucManagerReceivedMessageListener*
dino_muc_manager_received_message_listener_new (DinoStreamInteractor* stream_interactor)
{
	return dino_muc_manager_received_message_listener_construct (DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER, stream_interactor);
}

static void
dino_muc_manager_received_message_listener_real_run_data_free (gpointer _data)
{
	DinoMucManagerReceivedMessageListenerRunData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->message);
	_g_object_unref0 (_data_->stanza);
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMucManagerReceivedMessageListenerRunData, _data_);
}

static void
dino_muc_manager_received_message_listener_real_run (DinoMessageListener* base,
                                                     DinoEntitiesMessage* message,
                                                     XmppMessageStanza* stanza,
                                                     DinoEntitiesConversation* conversation,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	DinoMucManagerReceivedMessageListener * self;
	DinoMucManagerReceivedMessageListenerRunData* _data_;
	DinoMucManagerReceivedMessageListener* _tmp0_;
	DinoEntitiesMessage* _tmp1_;
	XmppMessageStanza* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	g_return_if_fail (message != NULL);
	g_return_if_fail (stanza != NULL);
	g_return_if_fail (conversation != NULL);
	self = (DinoMucManagerReceivedMessageListener*) base;
	_data_ = g_slice_new0 (DinoMucManagerReceivedMessageListenerRunData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_muc_manager_received_message_listener_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (message);
	_g_object_unref0 (_data_->message);
	_data_->message = _tmp1_;
	_tmp2_ = _g_object_ref0 (stanza);
	_g_object_unref0 (_data_->stanza);
	_data_->stanza = _tmp2_;
	_tmp3_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp3_;
	dino_muc_manager_received_message_listener_real_run_co (_data_);
}

static gboolean
dino_muc_manager_received_message_listener_run_finish (DinoMessageListener* base,
                                                       GAsyncResult* _res_)
{
	gboolean result;
	DinoMucManagerReceivedMessageListenerRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static gboolean
dino_muc_manager_received_message_listener_real_run_co (DinoMucManagerReceivedMessageListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dino_entities_conversation_get_type_ (_data_->conversation);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_ != DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _data_->self->priv->stream_interactor;
	_data_->_tmp3_ = dino_entities_conversation_get_account (_data_->conversation);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dino_stream_interactor_get_stream (_data_->_tmp2_, _data_->_tmp4_);
	_data_->stream = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->stream;
	if (_data_->_tmp6_ == NULL) {
		_data_->result = FALSE;
		_g_object_unref0 (_data_->stream);
		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_->_tmp7_ = xmpp_xep_delayed_delivery_message_flag_get_flag (_data_->stanza);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->_tmp8_ == NULL;
	_g_object_unref0 (_data_->_tmp8_);
	if (_data_->_tmp9_) {
		_data_->_tmp10_ = _data_->stream;
		_data_->_tmp11_ = xmpp_xep_muc_flag_IDENTITY;
		_data_->_tmp12_ = xmpp_xmpp_stream_get_flag (_data_->_tmp10_, XMPP_XEP_MUC_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp11_);
		_data_->_tmp13_ = (XmppXepMucFlag*) _data_->_tmp12_;
		_data_->_tmp14_ = dino_entities_message_get_counterpart (_data_->message);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = xmpp_xep_muc_flag_get_real_jid (_data_->_tmp13_, _data_->_tmp15_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_g_object_unref0 (_data_->_tmp13_);
		_data_->real_jid = _data_->_tmp17_;
		_data_->_tmp19_ = _data_->real_jid;
		if (_data_->_tmp19_ != NULL) {
			_data_->_tmp20_ = _data_->real_jid;
			_data_->_tmp21_ = dino_entities_message_get_counterpart (_data_->message);
			_data_->_tmp22_ = _data_->_tmp21_;
			_data_->_tmp18_ = !xmpp_jid_equals (_data_->_tmp20_, _data_->_tmp22_);
		} else {
			_data_->_tmp18_ = FALSE;
		}
		if (_data_->_tmp18_) {
			_data_->_tmp23_ = _data_->real_jid;
			_data_->_tmp24_ = xmpp_jid_get_bare_jid (_data_->_tmp23_);
			_data_->_tmp25_ = _data_->_tmp24_;
			_data_->_tmp26_ = _data_->_tmp25_;
			dino_entities_message_set_real_jid (_data_->message, _data_->_tmp26_);
			_xmpp_jid_unref0 (_data_->_tmp26_);
		}
		_xmpp_jid_unref0 (_data_->real_jid);
	}
	_data_->_tmp27_ = _data_->self->priv->stream_interactor;
	_data_->_tmp28_ = dino_muc_manager_IDENTITY;
	_data_->_tmp29_ = dino_stream_interactor_get_module (_data_->_tmp27_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp28_);
	_data_->_tmp30_ = (DinoMucManager*) _data_->_tmp29_;
	_data_->_tmp31_ = dino_entities_message_get_counterpart (_data_->message);
	_data_->_tmp32_ = _data_->_tmp31_;
	_data_->_tmp33_ = xmpp_jid_get_bare_jid (_data_->_tmp32_);
	_data_->_tmp34_ = _data_->_tmp33_;
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_tmp36_ = dino_entities_conversation_get_account (_data_->conversation);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_tmp38_ = dino_muc_manager_get_own_jid (_data_->_tmp30_, _data_->_tmp35_, _data_->_tmp37_);
	_data_->_tmp39_ = _data_->_tmp38_;
	_xmpp_jid_unref0 (_data_->_tmp35_);
	_g_object_unref0 (_data_->_tmp30_);
	_data_->own_muc_jid = _data_->_tmp39_;
	_data_->_tmp42_ = xmpp_stanza_get_id ((XmppStanza*) _data_->stanza);
	_data_->_tmp43_ = _data_->_tmp42_;
	if (_data_->_tmp43_ != NULL) {
		_data_->_tmp44_ = _data_->own_muc_jid;
		_data_->_tmp41_ = _data_->_tmp44_ != NULL;
	} else {
		_data_->_tmp41_ = FALSE;
	}
	if (_data_->_tmp41_) {
		_data_->_tmp45_ = dino_entities_message_get_from (_data_->message);
		_data_->_tmp46_ = _data_->_tmp45_;
		_data_->_tmp47_ = _data_->own_muc_jid;
		_data_->_tmp40_ = xmpp_jid_equals (_data_->_tmp46_, _data_->_tmp47_);
	} else {
		_data_->_tmp40_ = FALSE;
	}
	if (_data_->_tmp40_) {
		_data_->_tmp48_ = _data_->self->priv->stream_interactor;
		_data_->_tmp49_ = dino_message_storage_IDENTITY;
		_data_->_tmp50_ = dino_stream_interactor_get_module (_data_->_tmp48_, DINO_TYPE_MESSAGE_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp49_);
		_data_->_tmp51_ = (DinoMessageStorage*) _data_->_tmp50_;
		_data_->_tmp52_ = xmpp_stanza_get_id ((XmppStanza*) _data_->stanza);
		_data_->_tmp53_ = _data_->_tmp52_;
		_data_->_tmp54_ = dino_message_storage_get_message_by_stanza_id (_data_->_tmp51_, _data_->_tmp53_, _data_->conversation);
		_data_->_tmp55_ = _data_->_tmp54_;
		_g_object_unref0 (_data_->_tmp51_);
		_data_->m = _data_->_tmp55_;
		_data_->_tmp56_ = _data_->m;
		if (_data_->_tmp56_ != NULL) {
			_data_->_tmp57_ = _data_->m;
			dino_entities_message_set_marked (_data_->_tmp57_, DINO_ENTITIES_MESSAGE_MARKED_RECEIVED);
			_data_->_tmp58_ = _data_->m;
			_data_->_tmp59_ = dino_entities_message_get_counterpart (_data_->_tmp58_);
			_data_->_tmp60_ = _data_->_tmp59_;
			_data_->_tmp61_ = xmpp_jid_get_bare_jid (_data_->_tmp60_);
			_data_->_tmp62_ = _data_->_tmp61_;
			_data_->_tmp63_ = _data_->_tmp62_;
			_data_->_tmp64_ = xmpp_xep_unique_stable_stanza_ids_get_stanza_id (_data_->stanza, _data_->_tmp63_);
			_data_->_tmp65_ = _data_->_tmp64_;
			_xmpp_jid_unref0 (_data_->_tmp63_);
			_data_->server_id = _data_->_tmp65_;
			_data_->_tmp66_ = _data_->server_id;
			if (_data_->_tmp66_ != NULL) {
				_data_->_tmp67_ = _data_->m;
				_data_->_tmp68_ = _data_->server_id;
				dino_entities_message_set_server_id (_data_->_tmp67_, _data_->_tmp68_);
			}
			_g_free0 (_data_->server_id);
		}
		dino_entities_message_set_marked (_data_->message, DINO_ENTITIES_MESSAGE_MARKED_RECEIVED);
		_g_object_unref0 (_data_->m);
	}
	_data_->result = FALSE;
	_xmpp_jid_unref0 (_data_->own_muc_jid);
	_g_object_unref0 (_data_->stream);
	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 const gchar*
dino_muc_manager_received_message_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	DinoMucManagerReceivedMessageListener* self;
	self = (DinoMucManagerReceivedMessageListener*) base;
	result = "MUC";
	return result;
}

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

static void
dino_muc_manager_received_message_listener_class_init (DinoMucManagerReceivedMessageListenerClass * klass,
                                                       gpointer klass_data)
{
	dino_muc_manager_received_message_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoMucManagerReceivedMessageListener_private_offset);
	((DinoMessageListenerClass *) klass)->run = (void (*) (DinoMessageListener*, DinoEntitiesMessage*, XmppMessageStanza*, DinoEntitiesConversation*, GAsyncReadyCallback, gpointer)) dino_muc_manager_received_message_listener_real_run;
	((DinoMessageListenerClass *) klass)->run_finish = (gboolean (*) (DinoMessageListener*, GAsyncResult*)) dino_muc_manager_received_message_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) dino_muc_manager_received_message_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) dino_muc_manager_received_message_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_muc_manager_received_message_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_muc_manager_received_message_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY, dino_muc_manager_received_message_listener_properties[DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY] = g_param_spec_string ("action-group", "action-group", "action-group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY, dino_muc_manager_received_message_listener_properties[DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY] = g_param_spec_boxed ("after-actions", "after-actions", "after-actions", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

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

static void
dino_muc_manager_received_message_listener_finalize (GObject * obj)
{
	DinoMucManagerReceivedMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoMucManagerReceivedMessageListener);
	self->after_actions_const = (_vala_array_free (self->after_actions_const, self->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->stream_interactor);
	G_OBJECT_CLASS (dino_muc_manager_received_message_listener_parent_class)->finalize (obj);
}

static GType
dino_muc_manager_received_message_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMucManagerReceivedMessageListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_muc_manager_received_message_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMucManagerReceivedMessageListener), 0, (GInstanceInitFunc) dino_muc_manager_received_message_listener_instance_init, NULL };
	GType dino_muc_manager_received_message_listener_type_id;
	dino_muc_manager_received_message_listener_type_id = g_type_register_static (DINO_TYPE_MESSAGE_LISTENER, "DinoMucManagerReceivedMessageListener", &g_define_type_info, 0);
	DinoMucManagerReceivedMessageListener_private_offset = g_type_add_instance_private (dino_muc_manager_received_message_listener_type_id, sizeof (DinoMucManagerReceivedMessageListenerPrivate));
	return dino_muc_manager_received_message_listener_type_id;
}

static GType
dino_muc_manager_received_message_listener_get_type (void)
{
	static volatile gsize dino_muc_manager_received_message_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_muc_manager_received_message_listener_type_id__once)) {
		GType dino_muc_manager_received_message_listener_type_id;
		dino_muc_manager_received_message_listener_type_id = dino_muc_manager_received_message_listener_get_type_once ();
		g_once_init_leave (&dino_muc_manager_received_message_listener_type_id__once, dino_muc_manager_received_message_listener_type_id);
	}
	return dino_muc_manager_received_message_listener_type_id__once;
}

static void
_vala_dino_muc_manager_received_message_listener_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec)
{
	DinoMucManagerReceivedMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_MUC_MANAGER_TYPE_RECEIVED_MESSAGE_LISTENER, DinoMucManagerReceivedMessageListener);
	switch (property_id) {
		case DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case DINO_MUC_MANAGER_RECEIVED_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, xmpp_ordered_listener_get_after_actions ((XmppOrderedListener*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
dino_muc_manager_class_init (DinoMucManagerClass * klass,
                             gpointer klass_data)
{
	DinoModuleIdentity* _tmp0_;
	dino_muc_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoMucManager_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_muc_manager_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_muc_manager_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MUC_MANAGER_ID_PROPERTY, dino_muc_manager_properties[DINO_MUC_MANAGER_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	dino_muc_manager_signals[DINO_MUC_MANAGER_LEFT_SIGNAL] = g_signal_new ("left", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID);
	dino_muc_manager_signals[DINO_MUC_MANAGER_SUBJECT_SET_SIGNAL] = g_signal_new ("subject-set", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_STRING, G_TYPE_NONE, 3, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID, G_TYPE_STRING);
	dino_muc_manager_signals[DINO_MUC_MANAGER_ROOM_INFO_UPDATED_SIGNAL] = g_signal_new ("room-info-updated", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID);
	dino_muc_manager_signals[DINO_MUC_MANAGER_PRIVATE_ROOM_OCCUPANT_UPDATED_SIGNAL] = g_signal_new ("private-room-occupant-updated", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_XMPP_JID, G_TYPE_NONE, 3, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID, XMPP_TYPE_JID);
	dino_muc_manager_signals[DINO_MUC_MANAGER_INVITE_RECEIVED_SIGNAL] = g_signal_new ("invite-received", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_XMPP_JID_STRING_STRING, G_TYPE_NONE, 5, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID, XMPP_TYPE_JID, G_TYPE_STRING, G_TYPE_STRING);
	dino_muc_manager_signals[DINO_MUC_MANAGER_VOICE_REQUEST_RECEIVED_SIGNAL] = g_signal_new ("voice-request-received", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_XMPP_JID_STRING, G_TYPE_NONE, 4, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID, XMPP_TYPE_JID, G_TYPE_STRING);
	dino_muc_manager_signals[DINO_MUC_MANAGER_RECEIVED_OCCUPANT_ROLE_SIGNAL] = g_signal_new ("received-occupant-role", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID_POINTER, G_TYPE_NONE, 3, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID, G_TYPE_POINTER);
	dino_muc_manager_signals[DINO_MUC_MANAGER_BOOKMARKS_UPDATED_SIGNAL] = g_signal_new ("bookmarks-updated", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_ACCOUNT, GEE_TYPE_SET);
	dino_muc_manager_signals[DINO_MUC_MANAGER_CONFERENCE_ADDED_SIGNAL] = g_signal_new ("conference-added", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_CONFERENCE);
	dino_muc_manager_signals[DINO_MUC_MANAGER_CONFERENCE_REMOVED_SIGNAL] = g_signal_new ("conference-removed", DINO_TYPE_MUC_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_XMPP_JID, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_ACCOUNT, XMPP_TYPE_JID);
	_tmp0_ = dino_module_identity_new (DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "muc_manager");
	dino_muc_manager_IDENTITY = _tmp0_;
}

static void
dino_muc_manager_dino_stream_interaction_module_interface_init (DinoStreamInteractionModuleIface * iface,
                                                                gpointer iface_data)
{
	dino_muc_manager_dino_stream_interaction_module_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_id = dino_muc_manager_real_get_id;
}

static void
dino_muc_manager_instance_init (DinoMucManager * self,
                                gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	GeeHashMap* _tmp4_;
	GeeHashMap* _tmp5_;
	GeeHashMap* _tmp6_;
	GeeHashMap* _tmp7_;
	self->priv = dino_muc_manager_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, GEE_TYPE_HASH_SET, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->mucs_joined = _tmp0_;
	_tmp1_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, GEE_TYPE_HASH_SET, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->mucs_joining = _tmp1_;
	_tmp2_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, GEE_TYPE_HASH_MAP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->mucs_sync_cancellables = _tmp2_;
	_tmp3_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, XMPP_XEP_MUC_TYPE_MUC_ENTER_ERROR, NULL, NULL, _xmpp_jid_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->enter_errors = _tmp3_;
	_tmp4_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_TYPE_BOOKMARKS_PROVIDER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->bookmarks_provider = _tmp4_;
	_tmp5_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, GEE_TYPE_LIST, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->invites = _tmp5_;
	_tmp6_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->default_muc_server = _tmp6_;
	_tmp7_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, GEE_TYPE_HASH_MAP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->own_occupant_ids = _tmp7_;
}

static void
dino_muc_manager_finalize (GObject * obj)
{
	DinoMucManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_MUC_MANAGER, DinoMucManager);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->mucs_joined);
	_g_object_unref0 (self->priv->mucs_joining);
	_g_object_unref0 (self->priv->mucs_sync_cancellables);
	_g_object_unref0 (self->priv->enter_errors);
	_g_object_unref0 (self->priv->received_message_listener);
	_g_object_unref0 (self->priv->bookmarks_provider);
	_g_object_unref0 (self->priv->invites);
	_g_object_unref0 (self->default_muc_server);
	_g_object_unref0 (self->priv->own_occupant_ids);
	G_OBJECT_CLASS (dino_muc_manager_parent_class)->finalize (obj);
}

static GType
dino_muc_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMucManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_muc_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMucManager), 0, (GInstanceInitFunc) dino_muc_manager_instance_init, NULL };
	static const GInterfaceInfo dino_stream_interaction_module_info = { (GInterfaceInitFunc) dino_muc_manager_dino_stream_interaction_module_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_muc_manager_type_id;
	dino_muc_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoMucManager", &g_define_type_info, 0);
	g_type_add_interface_static (dino_muc_manager_type_id, DINO_TYPE_STREAM_INTERACTION_MODULE, &dino_stream_interaction_module_info);
	DinoMucManager_private_offset = g_type_add_instance_private (dino_muc_manager_type_id, sizeof (DinoMucManagerPrivate));
	return dino_muc_manager_type_id;
}

GType
dino_muc_manager_get_type (void)
{
	static volatile gsize dino_muc_manager_type_id__once = 0;
	if (g_once_init_enter (&dino_muc_manager_type_id__once)) {
		GType dino_muc_manager_type_id;
		dino_muc_manager_type_id = dino_muc_manager_get_type_once ();
		g_once_init_leave (&dino_muc_manager_type_id__once, dino_muc_manager_type_id);
	}
	return dino_muc_manager_type_id__once;
}

static void
_vala_dino_muc_manager_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	DinoMucManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_TYPE_MUC_MANAGER, DinoMucManager);
	switch (property_id) {
		case DINO_MUC_MANAGER_ID_PROPERTY:
		g_value_set_string (value, dino_stream_interaction_module_get_id ((DinoStreamInteractionModule*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

