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

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

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

enum  {
	DINO_NOTIFICATION_EVENTS_0_PROPERTY,
	DINO_NOTIFICATION_EVENTS_ID_PROPERTY,
	DINO_NOTIFICATION_EVENTS_NUM_PROPERTIES
};
static GParamSpec* dino_notification_events_properties[DINO_NOTIFICATION_EVENTS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _gee_promise_unref0(var) ((var == NULL) ? NULL : (var = (gee_promise_unref (var), NULL)))
typedef struct _DinoNotificationEventsRegisterNotificationProviderData DinoNotificationEventsRegisterNotificationProviderData;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
typedef struct _DinoNotificationEventsOnContentItemReceivedData DinoNotificationEventsOnContentItemReceivedData;
typedef struct _DinoNotificationEventsOnVoiceRequestReceivedData DinoNotificationEventsOnVoiceRequestReceivedData;
typedef struct _DinoNotificationEventsOnReceivedSubscriptionRequestData DinoNotificationEventsOnReceivedSubscriptionRequestData;
typedef struct _Block33Data Block33Data;
typedef struct _DinoNotificationEventsOnCallIncomingData DinoNotificationEventsOnCallIncomingData;
typedef struct _DinoNotificationEventsOnInviteReceivedData DinoNotificationEventsOnInviteReceivedData;
#define _dino_connection_manager_connection_error_unref0(var) ((var == NULL) ? NULL : (var = (dino_connection_manager_connection_error_unref (var), NULL)))
typedef struct _DinoNotificationEventsOnConnectionErrorData DinoNotificationEventsOnConnectionErrorData;
typedef struct _DinoNotificationEventsOnFocusedInData DinoNotificationEventsOnFocusedInData;
enum  {
	DINO_NOTIFICATION_EVENTS_NOTIFY_CONTENT_ITEM_SIGNAL,
	DINO_NOTIFICATION_EVENTS_NUM_SIGNALS
};
static guint dino_notification_events_signals[DINO_NOTIFICATION_EVENTS_NUM_SIGNALS] = {0};

struct _DinoNotificationEventsPrivate {
	DinoStreamInteractor* stream_interactor;
	GeeFuture* notifier;
	GeePromise* notifier_promise;
	gboolean notifier_outstanding;
};

struct _DinoNotificationEventsRegisterNotificationProviderData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoNotificationEvents* self;
	DinoNotificationProvider* notification_provider;
	gboolean _tmp0_;
	DinoNotificationProvider* _tmp1_;
	GeeFuture* _tmp2_;
	gconstpointer _tmp3_;
	GeePromise* _tmp4_;
	DinoNotificationProvider* _tmp5_;
	GError* _inner_error0_;
};

struct _DinoNotificationEventsOnContentItemReceivedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoNotificationEvents* self;
	DinoContentItem* item;
	DinoEntitiesConversation* conversation;
	DinoContentItem* last_item;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoContentItemStore* _tmp3_;
	DinoContentItem* _tmp4_;
	DinoContentItem* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	DinoContentItem* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	DinoStreamInteractor* _tmp15_;
	DinoModuleIdentity* _tmp16_;
	gpointer _tmp17_;
	DinoChatInteraction* _tmp18_;
	gboolean _tmp19_;
	DinoEntitiesConversationNotifySetting notify;
	DinoStreamInteractor* _tmp20_;
	gchar* conversation_display_name;
	DinoStreamInteractor* _tmp21_;
	gchar* _tmp22_;
	gchar* participant_display_name;
	DinoEntitiesConversationType _tmp23_;
	DinoEntitiesConversationType _tmp24_;
	DinoStreamInteractor* _tmp25_;
	XmppJid* _tmp26_;
	XmppJid* _tmp27_;
	gchar* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	GQuark _tmp33_;
	DinoEntitiesMessage* message;
	DinoEntitiesMessage* _tmp34_;
	DinoEntitiesMessage* _tmp35_;
	DinoEntitiesMessage* _tmp36_;
	gboolean _tmp37_;
	gboolean _tmp38_;
	XmppJid* nick;
	DinoStreamInteractor* _tmp39_;
	DinoModuleIdentity* _tmp40_;
	gpointer _tmp41_;
	DinoMucManager* _tmp42_;
	XmppJid* _tmp43_;
	XmppJid* _tmp44_;
	DinoEntitiesAccount* _tmp45_;
	DinoEntitiesAccount* _tmp46_;
	XmppJid* _tmp47_;
	XmppJid* _tmp48_;
	XmppJid* _tmp49_;
	gboolean highlight;
	XmppJid* _tmp50_;
	const gchar* _tmp51_;
	gchar* _tmp52_;
	gchar* _tmp53_;
	gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	DinoEntitiesMessage* _tmp58_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	gboolean _tmp61_;
	DinoNotificationProvider* notifier;
	GeeFuture* _tmp62_;
	gconstpointer _tmp63_;
	DinoNotificationProvider* _tmp64_;
	DinoNotificationProvider* _tmp65_;
	DinoEntitiesMessage* _tmp66_;
	const gchar* _tmp67_;
	const gchar* _tmp68_;
	DinoEntitiesFileTransfer* file_transfer;
	DinoEntitiesFileTransfer* _tmp69_;
	DinoEntitiesFileTransfer* _tmp70_;
	gboolean _tmp71_;
	DinoEntitiesFileTransfer* _tmp72_;
	const gchar* _tmp73_;
	const gchar* _tmp74_;
	DinoEntitiesFileTransfer* _tmp75_;
	const gchar* _tmp76_;
	const gchar* _tmp77_;
	gboolean is_image;
	DinoEntitiesFileTransfer* _tmp78_;
	gboolean _tmp79_;
	gboolean _tmp80_;
	DinoNotificationProvider* _vala1_notifier;
	GeeFuture* _tmp81_;
	gconstpointer _tmp82_;
	DinoNotificationProvider* _tmp83_;
	DinoNotificationProvider* _tmp84_;
	DinoEntitiesFileTransfer* _tmp85_;
	const gchar* _tmp86_;
	const gchar* _tmp87_;
	GError* _inner_error0_;
};

struct _DinoNotificationEventsOnVoiceRequestReceivedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoNotificationEvents* self;
	DinoEntitiesAccount* account;
	XmppJid* room_jid;
	XmppJid* from_jid;
	gchar* nick;
	DinoEntitiesConversation* conversation;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	DinoEntitiesConversationType _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	DinoEntitiesConversation* _tmp7_;
	DinoNotificationProvider* notifier;
	GeeFuture* _tmp8_;
	gconstpointer _tmp9_;
	DinoNotificationProvider* _tmp10_;
	DinoNotificationProvider* _tmp11_;
	DinoEntitiesConversation* _tmp12_;
	GError* _inner_error0_;
};

struct _DinoNotificationEventsOnReceivedSubscriptionRequestData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoNotificationEvents* self;
	XmppJid* jid;
	DinoEntitiesAccount* account;
	DinoEntitiesConversation* conversation;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	DinoEntitiesConversationType _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	DinoStreamInteractor* _tmp7_;
	DinoModuleIdentity* _tmp8_;
	gpointer _tmp9_;
	DinoChatInteraction* _tmp10_;
	DinoEntitiesConversation* _tmp11_;
	gboolean _tmp12_;
	DinoNotificationProvider* notifier;
	GeeFuture* _tmp13_;
	gconstpointer _tmp14_;
	DinoNotificationProvider* _tmp15_;
	DinoNotificationProvider* _tmp16_;
	DinoEntitiesConversation* _tmp17_;
	GError* _inner_error0_;
};

struct _Block33Data {
	int _ref_count_;
	DinoNotificationEvents* self;
	DinoNotificationProvider* notifier;
	DinoEntitiesCall* call;
	DinoEntitiesConversation* conversation;
	gpointer _async_data_;
};

struct _DinoNotificationEventsOnCallIncomingData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoNotificationEvents* self;
	DinoEntitiesCall* call;
	DinoCallState* call_state;
	DinoEntitiesConversation* conversation;
	gboolean video;
	gboolean multiparty;
	Block33Data* _data33_;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoCalls* _tmp3_;
	DinoEntitiesAccount* _tmp4_;
	DinoEntitiesAccount* _tmp5_;
	gboolean _tmp6_;
	gchar* conversation_display_name;
	DinoStreamInteractor* _tmp7_;
	gchar* _tmp8_;
	GeeFuture* _tmp9_;
	gconstpointer _tmp10_;
	DinoNotificationProvider* _tmp11_;
	DinoNotificationProvider* _tmp12_;
	const gchar* _tmp13_;
	GError* _inner_error0_;
};

struct _DinoNotificationEventsOnInviteReceivedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoNotificationEvents* self;
	DinoEntitiesAccount* account;
	XmppJid* room_jid;
	XmppJid* from_jid;
	gchar* password;
	gchar* reason;
	gchar* inviter_display_name;
	DinoEntitiesConversation* conversation;
	DinoEntitiesConversation* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoEntitiesConversation* _tmp2_;
	gchar* _tmp3_;
	DinoEntitiesConversation* direct_conversation;
	DinoEntitiesConversation* _tmp4_;
	DinoStreamInteractor* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	gchar* _tmp7_;
	DinoNotificationProvider* notifier;
	GeeFuture* _tmp8_;
	gconstpointer _tmp9_;
	DinoNotificationProvider* _tmp10_;
	const gchar* _tmp11_;
	GError* _inner_error0_;
};

struct _DinoNotificationEventsOnConnectionErrorData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoNotificationEvents* self;
	DinoEntitiesAccount* account;
	DinoConnectionManagerConnectionError* _error_;
	DinoNotificationProvider* notifier;
	GeeFuture* _tmp0_;
	gconstpointer _tmp1_;
	DinoNotificationProvider* _tmp2_;
	GError* _inner_error0_;
};

struct _DinoNotificationEventsOnFocusedInData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoNotificationEvents* self;
	DinoEntitiesConversation* conversation;
	DinoNotificationProvider* notifier;
	GeeFuture* _tmp0_;
	gconstpointer _tmp1_;
	DinoNotificationProvider* _tmp2_;
	GError* _inner_error0_;
};

static gint DinoNotificationEvents_private_offset;
static gpointer dino_notification_events_parent_class = NULL;
DinoModuleIdentity* dino_notification_events_IDENTITY = NULL;
static DinoStreamInteractionModuleIface * dino_notification_events_dino_stream_interaction_module_parent_iface = NULL;

static void __lambda114_ (DinoNotificationEvents* self,
                   DinoContentItem* item,
                   DinoEntitiesConversation* conversation);
static void dino_notification_events_on_content_item_received (DinoNotificationEvents* self,
                                                        DinoContentItem* item,
                                                        DinoEntitiesConversation* conversation,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_);
static void dino_notification_events_on_content_item_received_finish (DinoNotificationEvents* self,
                                                               GAsyncResult* _res_);
static void ___lambda114__dino_content_item_store_new_item (DinoContentItemStore* _sender,
                                                     DinoContentItem* item,
                                                     DinoEntitiesConversation* conversation,
                                                     gpointer self);
static void __lambda115_ (DinoNotificationEvents* self,
                   XmppJid* jid,
                   DinoEntitiesAccount* account);
static void dino_notification_events_on_received_subscription_request (DinoNotificationEvents* self,
                                                                XmppJid* jid,
                                                                DinoEntitiesAccount* account,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
static void dino_notification_events_on_received_subscription_request_finish (DinoNotificationEvents* self,
                                                                       GAsyncResult* _res_);
static void ___lambda115__dino_presence_manager_received_subscription_request (DinoPresenceManager* _sender,
                                                                        XmppJid* jid,
                                                                        DinoEntitiesAccount* account,
                                                                        gpointer self);
static void __lambda116_ (DinoNotificationEvents* self,
                   DinoEntitiesAccount* account,
                   XmppJid* room_jid,
                   XmppJid* from_jid,
                   const gchar* password,
                   const gchar* reason);
static void dino_notification_events_on_invite_received (DinoNotificationEvents* self,
                                                  DinoEntitiesAccount* account,
                                                  XmppJid* room_jid,
                                                  XmppJid* from_jid,
                                                  const gchar* password,
                                                  const gchar* reason,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static void dino_notification_events_on_invite_received_finish (DinoNotificationEvents* self,
                                                         GAsyncResult* _res_);
static void ___lambda116__dino_muc_manager_invite_received (DinoMucManager* _sender,
                                                     DinoEntitiesAccount* account,
                                                     XmppJid* room_jid,
                                                     XmppJid* from_jid,
                                                     const gchar* password,
                                                     const gchar* reason,
                                                     gpointer self);
static void __lambda117_ (DinoNotificationEvents* self,
                   DinoEntitiesAccount* account,
                   XmppJid* room_jid,
                   XmppJid* from_jid,
                   const gchar* nick);
static void dino_notification_events_on_voice_request_received (DinoNotificationEvents* self,
                                                         DinoEntitiesAccount* account,
                                                         XmppJid* room_jid,
                                                         XmppJid* from_jid,
                                                         const gchar* nick,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static void dino_notification_events_on_voice_request_received_finish (DinoNotificationEvents* self,
                                                                GAsyncResult* _res_);
static void ___lambda117__dino_muc_manager_voice_request_received (DinoMucManager* _sender,
                                                            DinoEntitiesAccount* account,
                                                            XmppJid* room_jid,
                                                            XmppJid* from_jid,
                                                            const gchar* nick,
                                                            gpointer self);
static void __lambda118_ (DinoNotificationEvents* self,
                   DinoEntitiesCall* call,
                   DinoCallState* state,
                   DinoEntitiesConversation* conversation,
                   gboolean video,
                   gboolean multiparty);
static void dino_notification_events_on_call_incoming (DinoNotificationEvents* self,
                                                DinoEntitiesCall* call,
                                                DinoCallState* call_state,
                                                DinoEntitiesConversation* conversation,
                                                gboolean video,
                                                gboolean multiparty,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
static void dino_notification_events_on_call_incoming_finish (DinoNotificationEvents* self,
                                                       GAsyncResult* _res_);
static void ___lambda118__dino_calls_call_incoming (DinoCalls* _sender,
                                             DinoEntitiesCall* call,
                                             DinoCallState* state,
                                             DinoEntitiesConversation* conversation,
                                             gboolean video,
                                             gboolean multiparty,
                                             gpointer self);
static void __lambda120_ (DinoNotificationEvents* self,
                   DinoEntitiesAccount* account,
                   DinoConnectionManagerConnectionError* _error_);
static void dino_notification_events_on_connection_error (DinoNotificationEvents* self,
                                                   DinoEntitiesAccount* account,
                                                   DinoConnectionManagerConnectionError* _error_,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void dino_notification_events_on_connection_error_finish (DinoNotificationEvents* self,
                                                          GAsyncResult* _res_);
static void ___lambda120__dino_connection_manager_connection_error (DinoConnectionManager* _sender,
                                                             DinoEntitiesAccount* account,
                                                             DinoConnectionManagerConnectionError* _error_,
                                                             gpointer self);
static void __lambda121_ (DinoNotificationEvents* self,
                   DinoEntitiesConversation* conversation);
static void dino_notification_events_on_focused_in (DinoNotificationEvents* self,
                                             DinoEntitiesConversation* conversation,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void dino_notification_events_on_focused_in_finish (DinoNotificationEvents* self,
                                                    GAsyncResult* _res_);
static void ___lambda121__dino_chat_interaction_focused_in (DinoChatInteraction* _sender,
                                                     DinoEntitiesConversation* conversation,
                                                     gpointer self);
static void dino_notification_events_register_notification_provider_data_free (gpointer _data);
static gboolean dino_notification_events_register_notification_provider_co (DinoNotificationEventsRegisterNotificationProviderData* _data_);
static void dino_notification_events_register_notification_provider_ready (GObject* source_object,
                                                                    GAsyncResult* _res_,
                                                                    gpointer _user_data_);
static void dino_notification_events_on_content_item_received_data_free (gpointer _data);
static gboolean dino_notification_events_on_content_item_received_co (DinoNotificationEventsOnContentItemReceivedData* _data_);
static void dino_notification_events_on_content_item_received_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_);
static void dino_notification_events_on_voice_request_received_data_free (gpointer _data);
static gboolean dino_notification_events_on_voice_request_received_co (DinoNotificationEventsOnVoiceRequestReceivedData* _data_);
static void dino_notification_events_on_voice_request_received_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_);
static void dino_notification_events_on_received_subscription_request_data_free (gpointer _data);
static gboolean dino_notification_events_on_received_subscription_request_co (DinoNotificationEventsOnReceivedSubscriptionRequestData* _data_);
static void dino_notification_events_on_received_subscription_request_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_);
static void dino_notification_events_on_call_incoming_data_free (gpointer _data);
static gboolean dino_notification_events_on_call_incoming_co (DinoNotificationEventsOnCallIncomingData* _data_);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void dino_notification_events_on_call_incoming_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void __lambda119_ (Block33Data* _data33_);
static void ___lambda119__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void dino_notification_events_on_invite_received_data_free (gpointer _data);
static gboolean dino_notification_events_on_invite_received_co (DinoNotificationEventsOnInviteReceivedData* _data_);
static void dino_notification_events_on_invite_received_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void dino_notification_events_on_connection_error_data_free (gpointer _data);
static gboolean dino_notification_events_on_connection_error_co (DinoNotificationEventsOnConnectionErrorData* _data_);
static void dino_notification_events_on_connection_error_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void dino_notification_events_on_focused_in_data_free (gpointer _data);
static gboolean dino_notification_events_on_focused_in_co (DinoNotificationEventsOnFocusedInData* _data_);
static void dino_notification_events_on_focused_in_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_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_notification_events_finalize (GObject * obj);
static GType dino_notification_events_get_type_once (void);
static void _vala_dino_notification_events_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static GType dino_notification_provider_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_notification_events_get_instance_private (DinoNotificationEvents* self)
{
	return G_STRUCT_MEMBER_P (self, DinoNotificationEvents_private_offset);
}

void
dino_notification_events_start (DinoStreamInteractor* stream_interactor)
{
	DinoNotificationEvents* m = NULL;
	DinoNotificationEvents* _tmp0_;
	g_return_if_fail (stream_interactor != NULL);
	_tmp0_ = dino_notification_events_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 void
__lambda114_ (DinoNotificationEvents* self,
              DinoContentItem* item,
              DinoEntitiesConversation* conversation)
{
	g_return_if_fail (item != NULL);
	g_return_if_fail (conversation != NULL);
	dino_notification_events_on_content_item_received (self, item, conversation, NULL, NULL);
}

static void
___lambda114__dino_content_item_store_new_item (DinoContentItemStore* _sender,
                                                DinoContentItem* item,
                                                DinoEntitiesConversation* conversation,
                                                gpointer self)
{
	__lambda114_ ((DinoNotificationEvents*) self, item, conversation);
}

static void
__lambda115_ (DinoNotificationEvents* self,
              XmppJid* jid,
              DinoEntitiesAccount* account)
{
	g_return_if_fail (jid != NULL);
	g_return_if_fail (account != NULL);
	dino_notification_events_on_received_subscription_request (self, jid, account, NULL, NULL);
}

static void
___lambda115__dino_presence_manager_received_subscription_request (DinoPresenceManager* _sender,
                                                                   XmppJid* jid,
                                                                   DinoEntitiesAccount* account,
                                                                   gpointer self)
{
	__lambda115_ ((DinoNotificationEvents*) self, jid, account);
}

static void
__lambda116_ (DinoNotificationEvents* self,
              DinoEntitiesAccount* account,
              XmppJid* room_jid,
              XmppJid* from_jid,
              const gchar* password,
              const gchar* reason)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (room_jid != NULL);
	g_return_if_fail (from_jid != NULL);
	dino_notification_events_on_invite_received (self, account, room_jid, from_jid, password, reason, NULL, NULL);
}

static void
___lambda116__dino_muc_manager_invite_received (DinoMucManager* _sender,
                                                DinoEntitiesAccount* account,
                                                XmppJid* room_jid,
                                                XmppJid* from_jid,
                                                const gchar* password,
                                                const gchar* reason,
                                                gpointer self)
{
	__lambda116_ ((DinoNotificationEvents*) self, account, room_jid, from_jid, password, reason);
}

static void
__lambda117_ (DinoNotificationEvents* self,
              DinoEntitiesAccount* account,
              XmppJid* room_jid,
              XmppJid* from_jid,
              const gchar* nick)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (room_jid != NULL);
	g_return_if_fail (from_jid != NULL);
	g_return_if_fail (nick != NULL);
	dino_notification_events_on_voice_request_received (self, account, room_jid, from_jid, nick, NULL, NULL);
}

static void
___lambda117__dino_muc_manager_voice_request_received (DinoMucManager* _sender,
                                                       DinoEntitiesAccount* account,
                                                       XmppJid* room_jid,
                                                       XmppJid* from_jid,
                                                       const gchar* nick,
                                                       gpointer self)
{
	__lambda117_ ((DinoNotificationEvents*) self, account, room_jid, from_jid, nick);
}

static void
__lambda118_ (DinoNotificationEvents* self,
              DinoEntitiesCall* call,
              DinoCallState* state,
              DinoEntitiesConversation* conversation,
              gboolean video,
              gboolean multiparty)
{
	g_return_if_fail (call != NULL);
	g_return_if_fail (state != NULL);
	g_return_if_fail (conversation != NULL);
	dino_notification_events_on_call_incoming (self, call, state, conversation, video, multiparty, NULL, NULL);
}

static void
___lambda118__dino_calls_call_incoming (DinoCalls* _sender,
                                        DinoEntitiesCall* call,
                                        DinoCallState* state,
                                        DinoEntitiesConversation* conversation,
                                        gboolean video,
                                        gboolean multiparty,
                                        gpointer self)
{
	__lambda118_ ((DinoNotificationEvents*) self, call, state, conversation, video, multiparty);
}

static void
__lambda120_ (DinoNotificationEvents* self,
              DinoEntitiesAccount* account,
              DinoConnectionManagerConnectionError* _error_)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (_error_ != NULL);
	dino_notification_events_on_connection_error (self, account, _error_, NULL, NULL);
}

static void
___lambda120__dino_connection_manager_connection_error (DinoConnectionManager* _sender,
                                                        DinoEntitiesAccount* account,
                                                        DinoConnectionManagerConnectionError* _error_,
                                                        gpointer self)
{
	__lambda120_ ((DinoNotificationEvents*) self, account, _error_);
}

static void
__lambda121_ (DinoNotificationEvents* self,
              DinoEntitiesConversation* conversation)
{
	g_return_if_fail (conversation != NULL);
	dino_notification_events_on_focused_in (self, conversation, NULL, NULL);
}

static void
___lambda121__dino_chat_interaction_focused_in (DinoChatInteraction* _sender,
                                                DinoEntitiesConversation* conversation,
                                                gpointer self)
{
	__lambda121_ ((DinoNotificationEvents*) self, conversation);
}

DinoNotificationEvents*
dino_notification_events_construct (GType object_type,
                                    DinoStreamInteractor* stream_interactor)
{
	DinoNotificationEvents * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoContentItemStore* _tmp3_;
	DinoModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	DinoPresenceManager* _tmp6_;
	DinoModuleIdentity* _tmp7_;
	gpointer _tmp8_;
	DinoMucManager* _tmp9_;
	DinoModuleIdentity* _tmp10_;
	gpointer _tmp11_;
	DinoMucManager* _tmp12_;
	DinoModuleIdentity* _tmp13_;
	gpointer _tmp14_;
	DinoCalls* _tmp15_;
	DinoConnectionManager* _tmp16_;
	DinoModuleIdentity* _tmp17_;
	gpointer _tmp18_;
	DinoChatInteraction* _tmp19_;
	GeePromise* _tmp20_;
	GeePromise* _tmp21_;
	GeeFuture* _tmp22_;
	GeeFuture* _tmp23_;
	GeeFuture* _tmp24_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	self = (DinoNotificationEvents*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	_tmp1_ = dino_content_item_store_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoContentItemStore*) _tmp2_;
	g_signal_connect_object (_tmp3_, "new-item", (GCallback) ___lambda114__dino_content_item_store_new_item, self, 0);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = dino_presence_manager_IDENTITY;
	_tmp5_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_PRESENCE_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
	_tmp6_ = (DinoPresenceManager*) _tmp5_;
	g_signal_connect_object (_tmp6_, "received-subscription-request", (GCallback) ___lambda115__dino_presence_manager_received_subscription_request, self, 0);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = dino_muc_manager_IDENTITY;
	_tmp8_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp7_);
	_tmp9_ = (DinoMucManager*) _tmp8_;
	g_signal_connect_object (_tmp9_, "invite-received", (GCallback) ___lambda116__dino_muc_manager_invite_received, self, 0);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = dino_muc_manager_IDENTITY;
	_tmp11_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp10_);
	_tmp12_ = (DinoMucManager*) _tmp11_;
	g_signal_connect_object (_tmp12_, "voice-request-received", (GCallback) ___lambda117__dino_muc_manager_voice_request_received, self, 0);
	_g_object_unref0 (_tmp12_);
	_tmp13_ = dino_calls_IDENTITY;
	_tmp14_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_CALLS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp13_);
	_tmp15_ = (DinoCalls*) _tmp14_;
	g_signal_connect_object (_tmp15_, "call-incoming", (GCallback) ___lambda118__dino_calls_call_incoming, self, 0);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = stream_interactor->connection_manager;
	g_signal_connect_object (_tmp16_, "connection-error", (GCallback) ___lambda120__dino_connection_manager_connection_error, self, 0);
	_tmp17_ = dino_chat_interaction_IDENTITY;
	_tmp18_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_CHAT_INTERACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp17_);
	_tmp19_ = (DinoChatInteraction*) _tmp18_;
	g_signal_connect_object (_tmp19_, "focused-in", (GCallback) ___lambda121__dino_chat_interaction_focused_in, self, 0);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = gee_promise_new (DINO_TYPE_NOTIFICATION_PROVIDER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	_gee_promise_unref0 (self->priv->notifier_promise);
	self->priv->notifier_promise = _tmp20_;
	_tmp21_ = self->priv->notifier_promise;
	_tmp22_ = gee_promise_get_future (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = _g_object_ref0 (_tmp23_);
	_g_object_unref0 (self->priv->notifier);
	self->priv->notifier = _tmp24_;
	return self;
}

DinoNotificationEvents*
dino_notification_events_new (DinoStreamInteractor* stream_interactor)
{
	return dino_notification_events_construct (DINO_TYPE_NOTIFICATION_EVENTS, stream_interactor);
}

static void
dino_notification_events_register_notification_provider_data_free (gpointer _data)
{
	DinoNotificationEventsRegisterNotificationProviderData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->notification_provider);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoNotificationEventsRegisterNotificationProviderData, _data_);
}

void
dino_notification_events_register_notification_provider (DinoNotificationEvents* self,
                                                         DinoNotificationProvider* notification_provider,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_)
{
	DinoNotificationEventsRegisterNotificationProviderData* _data_;
	DinoNotificationEvents* _tmp0_;
	DinoNotificationProvider* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (notification_provider != NULL);
	_data_ = g_slice_new0 (DinoNotificationEventsRegisterNotificationProviderData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_notification_events_register_notification_provider_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (notification_provider);
	_g_object_unref0 (_data_->notification_provider);
	_data_->notification_provider = _tmp1_;
	dino_notification_events_register_notification_provider_co (_data_);
}

void
dino_notification_events_register_notification_provider_finish (DinoNotificationEvents* self,
                                                                GAsyncResult* _res_)
{
	DinoNotificationEventsRegisterNotificationProviderData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_notification_events_register_notification_provider_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_)
{
	DinoNotificationEventsRegisterNotificationProviderData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_notification_events_register_notification_provider_co (_data_);
}

static gboolean
dino_notification_events_register_notification_provider_co (DinoNotificationEventsRegisterNotificationProviderData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->self->priv->notifier_outstanding) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp2_ = _data_->self->priv->notifier;
		_data_->_state_ = 1;
		gee_future_wait_async (_data_->_tmp2_, dino_notification_events_register_notification_provider_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = gee_future_wait_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp1_ = (DinoNotificationProvider*) _data_->_tmp3_;
		if (G_UNLIKELY (_data_->_inner_error0_ != 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_->_tmp0_ = dino_notification_provider_get_priority (_data_->_tmp1_) < dino_notification_provider_get_priority (_data_->notification_provider);
	}
	if (_data_->_tmp0_) {
		_data_->self->priv->notifier_outstanding = FALSE;
		_data_->_tmp4_ = _data_->self->priv->notifier_promise;
		_data_->_tmp5_ = _g_object_ref0 (_data_->notification_provider);
		gee_promise_set_value (_data_->_tmp4_, _data_->_tmp5_);
	}
	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_notification_events_on_content_item_received_data_free (gpointer _data)
{
	DinoNotificationEventsOnContentItemReceivedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->item);
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoNotificationEventsOnContentItemReceivedData, _data_);
}

static void
dino_notification_events_on_content_item_received (DinoNotificationEvents* self,
                                                   DinoContentItem* item,
                                                   DinoEntitiesConversation* conversation,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_)
{
	DinoNotificationEventsOnContentItemReceivedData* _data_;
	DinoNotificationEvents* _tmp0_;
	DinoContentItem* _tmp1_;
	DinoEntitiesConversation* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_return_if_fail (conversation != NULL);
	_data_ = g_slice_new0 (DinoNotificationEventsOnContentItemReceivedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_notification_events_on_content_item_received_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (item);
	_g_object_unref0 (_data_->item);
	_data_->item = _tmp1_;
	_tmp2_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp2_;
	dino_notification_events_on_content_item_received_co (_data_);
}

static void
dino_notification_events_on_content_item_received_finish (DinoNotificationEvents* self,
                                                          GAsyncResult* _res_)
{
	DinoNotificationEventsOnContentItemReceivedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_notification_events_on_content_item_received_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_)
{
	DinoNotificationEventsOnContentItemReceivedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_notification_events_on_content_item_received_co (_data_);
}

static gboolean
dino_notification_events_on_content_item_received_co (DinoNotificationEventsOnContentItemReceivedData* _data_)
{
	static GQuark _tmp32_label0 = 0;
	static GQuark _tmp32_label1 = 0;
	static GQuark _tmp32_label2 = 0;
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_content_item_store_IDENTITY;
	_data_->_tmp2_ = dino_stream_interactor_get_module (_data_->_tmp0_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
	_data_->_tmp3_ = (DinoContentItemStore*) _data_->_tmp2_;
	_data_->_tmp4_ = dino_content_item_store_get_latest (_data_->_tmp3_, _data_->conversation);
	_data_->_tmp5_ = _data_->_tmp4_;
	_g_object_unref0 (_data_->_tmp3_);
	_data_->last_item = _data_->_tmp5_;
	_data_->_tmp6_ = dino_content_item_get_id (_data_->item);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->last_item;
	_data_->_tmp9_ = dino_content_item_get_id (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	if (_data_->_tmp7_ != _data_->_tmp10_) {
		_g_object_unref0 (_data_->last_item);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = dino_content_item_get_id (_data_->item);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = dino_entities_conversation_get_read_up_to_item (_data_->conversation);
	_data_->_tmp14_ = _data_->_tmp13_;
	if (_data_->_tmp12_ == _data_->_tmp14_) {
		_g_object_unref0 (_data_->last_item);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = _data_->self->priv->stream_interactor;
	_data_->_tmp16_ = dino_chat_interaction_IDENTITY;
	_data_->_tmp17_ = dino_stream_interactor_get_module (_data_->_tmp15_, DINO_TYPE_CHAT_INTERACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp16_);
	_data_->_tmp18_ = (DinoChatInteraction*) _data_->_tmp17_;
	_data_->_tmp19_ = dino_chat_interaction_is_active_focus (_data_->_tmp18_, NULL);
	_g_object_unref0 (_data_->_tmp18_);
	if (_data_->_tmp19_) {
		_g_object_unref0 (_data_->last_item);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp20_ = _data_->self->priv->stream_interactor;
	_data_->notify = dino_entities_conversation_get_notification_setting (_data_->conversation, _data_->_tmp20_);
	if (_data_->notify == DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_OFF) {
		_g_object_unref0 (_data_->last_item);
		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_->_tmp21_ = _data_->self->priv->stream_interactor;
	_data_->_tmp22_ = dino_get_conversation_display_name (_data_->_tmp21_, _data_->conversation, NULL);
	_data_->conversation_display_name = _data_->_tmp22_;
	_data_->participant_display_name = NULL;
	_data_->_tmp23_ = dino_entities_conversation_get_type_ (_data_->conversation);
	_data_->_tmp24_ = _data_->_tmp23_;
	if (_data_->_tmp24_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		_data_->_tmp25_ = _data_->self->priv->stream_interactor;
		_data_->_tmp26_ = dino_content_item_get_jid (_data_->item);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp28_ = dino_get_participant_display_name (_data_->_tmp25_, _data_->conversation, _data_->_tmp27_, NULL);
		_g_free0 (_data_->participant_display_name);
		_data_->participant_display_name = _data_->_tmp28_;
	}
	_data_->_tmp29_ = dino_content_item_get_type_ (_data_->item);
	_data_->_tmp30_ = _data_->_tmp29_;
	_data_->_tmp33_ = 0U;
	_data_->_tmp31_ = _data_->_tmp30_;
	_data_->_tmp33_ = (NULL == _data_->_tmp31_) ? 0 : g_quark_from_string (_data_->_tmp31_);
	if (_data_->_tmp33_ == ((0 != _tmp32_label0) ? _tmp32_label0 : (_tmp32_label0 = g_quark_from_static_string (DINO_MESSAGE_ITEM_TYPE)))) {
		switch (0) {
			default:
			{
				_data_->_tmp34_ = G_TYPE_CHECK_INSTANCE_CAST (_data_->item, DINO_TYPE_MESSAGE_ITEM, DinoMessageItem)->message;
				_data_->_tmp35_ = _g_object_ref0 (_data_->_tmp34_);
				_data_->message = _data_->_tmp35_;
				_data_->_tmp36_ = _data_->message;
				_data_->_tmp37_ = dino_entities_message_get_direction (_data_->_tmp36_);
				_data_->_tmp38_ = _data_->_tmp37_;
				if (_data_->_tmp38_ == DINO_ENTITIES_MESSAGE_DIRECTION_SENT) {
					_g_object_unref0 (_data_->message);
					_g_free0 (_data_->participant_display_name);
					_g_free0 (_data_->conversation_display_name);
					_g_object_unref0 (_data_->last_item);
					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;
				}
				if (_data_->notify == DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_HIGHLIGHT) {
					_data_->_tmp39_ = _data_->self->priv->stream_interactor;
					_data_->_tmp40_ = dino_muc_manager_IDENTITY;
					_data_->_tmp41_ = dino_stream_interactor_get_module (_data_->_tmp39_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp40_);
					_data_->_tmp42_ = (DinoMucManager*) _data_->_tmp41_;
					_data_->_tmp43_ = dino_entities_conversation_get_counterpart (_data_->conversation);
					_data_->_tmp44_ = _data_->_tmp43_;
					_data_->_tmp45_ = dino_entities_conversation_get_account (_data_->conversation);
					_data_->_tmp46_ = _data_->_tmp45_;
					_data_->_tmp47_ = dino_muc_manager_get_own_jid (_data_->_tmp42_, _data_->_tmp44_, _data_->_tmp46_);
					_data_->_tmp48_ = _data_->_tmp47_;
					_g_object_unref0 (_data_->_tmp42_);
					_data_->nick = _data_->_tmp48_;
					_data_->_tmp49_ = _data_->nick;
					if (_data_->_tmp49_ == NULL) {
						_xmpp_jid_unref0 (_data_->nick);
						_g_object_unref0 (_data_->message);
						_g_free0 (_data_->participant_display_name);
						_g_free0 (_data_->conversation_display_name);
						_g_object_unref0 (_data_->last_item);
						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_->_tmp50_ = _data_->nick;
					_data_->_tmp51_ = _data_->_tmp50_->resourcepart;
					_data_->_tmp52_ = g_regex_escape_string (_data_->_tmp51_, -1);
					_data_->_tmp53_ = _data_->_tmp52_;
					_data_->_tmp54_ = g_strconcat ("\\b", _data_->_tmp53_, NULL);
					_data_->_tmp55_ = _data_->_tmp54_;
					_data_->_tmp56_ = g_strconcat (_data_->_tmp55_, "\\b", NULL);
					_data_->_tmp57_ = _data_->_tmp56_;
					_data_->_tmp58_ = _data_->message;
					_data_->_tmp59_ = dino_entities_message_get_body (_data_->_tmp58_);
					_data_->_tmp60_ = _data_->_tmp59_;
					_data_->_tmp61_ = g_regex_match_simple (_data_->_tmp57_, _data_->_tmp60_, G_REGEX_CASELESS, 0);
					_g_free0 (_data_->_tmp57_);
					_g_free0 (_data_->_tmp55_);
					_g_free0 (_data_->_tmp53_);
					_data_->highlight = _data_->_tmp61_;
					if (!_data_->highlight) {
						_xmpp_jid_unref0 (_data_->nick);
						_g_object_unref0 (_data_->message);
						_g_free0 (_data_->participant_display_name);
						_g_free0 (_data_->conversation_display_name);
						_g_object_unref0 (_data_->last_item);
						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_jid_unref0 (_data_->nick);
				}
				g_signal_emit (_data_->self, dino_notification_events_signals[DINO_NOTIFICATION_EVENTS_NOTIFY_CONTENT_ITEM_SIGNAL], 0, _data_->item, _data_->conversation);
				if (_data_->notify != DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_OFF) {
					_data_->_tmp62_ = _data_->self->priv->notifier;
					_data_->_state_ = 1;
					gee_future_wait_async (_data_->_tmp62_, dino_notification_events_on_content_item_received_ready, _data_);
					return FALSE;
					_state_1:
					_data_->_tmp63_ = gee_future_wait_finish (_data_->_tmp62_, _data_->_res_, &_data_->_inner_error0_);
					_data_->_tmp64_ = _g_object_ref0 ((DinoNotificationProvider*) _data_->_tmp63_);
					_data_->notifier = _data_->_tmp64_;
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						_g_object_unref0 (_data_->message);
						_g_free0 (_data_->participant_display_name);
						_g_free0 (_data_->conversation_display_name);
						_g_object_unref0 (_data_->last_item);
						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_->_tmp65_ = _data_->notifier;
					_data_->_tmp66_ = _data_->message;
					_data_->_tmp67_ = _data_->conversation_display_name;
					_data_->_tmp68_ = _data_->participant_display_name;
					_data_->_state_ = 2;
					dino_notification_provider_notify_message (_data_->_tmp65_, _data_->_tmp66_, _data_->conversation, _data_->_tmp67_, _data_->_tmp68_, dino_notification_events_on_content_item_received_ready, _data_);
					return FALSE;
					_state_2:
					dino_notification_provider_notify_message_finish (_data_->_tmp65_, _data_->_res_);
					_g_object_unref0 (_data_->notifier);
				}
				_g_object_unref0 (_data_->message);
				break;
			}
		}
	} else if (_data_->_tmp33_ == ((0 != _tmp32_label1) ? _tmp32_label1 : (_tmp32_label1 = g_quark_from_static_string (DINO_FILE_ITEM_TYPE)))) {
		switch (0) {
			default:
			{
				_data_->_tmp69_ = G_TYPE_CHECK_INSTANCE_CAST (_data_->item, DINO_TYPE_FILE_ITEM, DinoFileItem)->file_transfer;
				_data_->_tmp70_ = _g_object_ref0 (_data_->_tmp69_);
				_data_->file_transfer = _data_->_tmp70_;
				_data_->_tmp72_ = _data_->file_transfer;
				_data_->_tmp73_ = dino_entities_file_transfer_get_mime_type (_data_->_tmp72_);
				_data_->_tmp74_ = _data_->_tmp73_;
				if (_data_->_tmp74_ != NULL) {
					_data_->_tmp75_ = _data_->file_transfer;
					_data_->_tmp76_ = dino_entities_file_transfer_get_mime_type (_data_->_tmp75_);
					_data_->_tmp77_ = _data_->_tmp76_;
					_data_->_tmp71_ = g_str_has_prefix (_data_->_tmp77_, "image");
				} else {
					_data_->_tmp71_ = FALSE;
				}
				_data_->is_image = _data_->_tmp71_;
				if (_data_->notify == DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_HIGHLIGHT) {
					_g_object_unref0 (_data_->file_transfer);
					_g_free0 (_data_->participant_display_name);
					_g_free0 (_data_->conversation_display_name);
					_g_object_unref0 (_data_->last_item);
					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_->_tmp78_ = _data_->file_transfer;
				_data_->_tmp79_ = dino_entities_file_transfer_get_direction (_data_->_tmp78_);
				_data_->_tmp80_ = _data_->_tmp79_;
				if (_data_->_tmp80_ == DINO_ENTITIES_FILE_TRANSFER_DIRECTION_SENT) {
					_g_object_unref0 (_data_->file_transfer);
					_g_free0 (_data_->participant_display_name);
					_g_free0 (_data_->conversation_display_name);
					_g_object_unref0 (_data_->last_item);
					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;
				}
				g_signal_emit (_data_->self, dino_notification_events_signals[DINO_NOTIFICATION_EVENTS_NOTIFY_CONTENT_ITEM_SIGNAL], 0, _data_->item, _data_->conversation);
				if (_data_->notify != DINO_ENTITIES_CONVERSATION_NOTIFY_SETTING_OFF) {
					_data_->_tmp81_ = _data_->self->priv->notifier;
					_data_->_state_ = 3;
					gee_future_wait_async (_data_->_tmp81_, dino_notification_events_on_content_item_received_ready, _data_);
					return FALSE;
					_state_3:
					_data_->_tmp82_ = gee_future_wait_finish (_data_->_tmp81_, _data_->_res_, &_data_->_inner_error0_);
					_data_->_tmp83_ = _g_object_ref0 ((DinoNotificationProvider*) _data_->_tmp82_);
					_data_->_vala1_notifier = _data_->_tmp83_;
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						_g_object_unref0 (_data_->file_transfer);
						_g_free0 (_data_->participant_display_name);
						_g_free0 (_data_->conversation_display_name);
						_g_object_unref0 (_data_->last_item);
						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_->_tmp84_ = _data_->_vala1_notifier;
					_data_->_tmp85_ = _data_->file_transfer;
					_data_->_tmp86_ = _data_->conversation_display_name;
					_data_->_tmp87_ = _data_->participant_display_name;
					_data_->_state_ = 4;
					dino_notification_provider_notify_file (_data_->_tmp84_, _data_->_tmp85_, _data_->conversation, _data_->is_image, _data_->_tmp86_, _data_->_tmp87_, dino_notification_events_on_content_item_received_ready, _data_);
					return FALSE;
					_state_4:
					dino_notification_provider_notify_file_finish (_data_->_tmp84_, _data_->_res_);
					_g_object_unref0 (_data_->_vala1_notifier);
				}
				_g_object_unref0 (_data_->file_transfer);
				break;
			}
		}
	} else if (_data_->_tmp33_ == ((0 != _tmp32_label2) ? _tmp32_label2 : (_tmp32_label2 = g_quark_from_static_string (DINO_CALL_ITEM_TYPE)))) {
		switch (0) {
			default:
			{
				break;
			}
		}
	}
	_g_free0 (_data_->participant_display_name);
	_g_free0 (_data_->conversation_display_name);
	_g_object_unref0 (_data_->last_item);
	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_notification_events_on_voice_request_received_data_free (gpointer _data)
{
	DinoNotificationEventsOnVoiceRequestReceivedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_xmpp_jid_unref0 (_data_->room_jid);
	_xmpp_jid_unref0 (_data_->from_jid);
	_g_free0 (_data_->nick);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoNotificationEventsOnVoiceRequestReceivedData, _data_);
}

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

static void
dino_notification_events_on_voice_request_received (DinoNotificationEvents* self,
                                                    DinoEntitiesAccount* account,
                                                    XmppJid* room_jid,
                                                    XmppJid* from_jid,
                                                    const gchar* nick,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	DinoNotificationEventsOnVoiceRequestReceivedData* _data_;
	DinoNotificationEvents* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gchar* _tmp4_;
	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);
	g_return_if_fail (nick != NULL);
	_data_ = g_slice_new0 (DinoNotificationEventsOnVoiceRequestReceivedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_notification_events_on_voice_request_received_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 (room_jid);
	_xmpp_jid_unref0 (_data_->room_jid);
	_data_->room_jid = _tmp2_;
	_tmp3_ = _xmpp_jid_ref0 (from_jid);
	_xmpp_jid_unref0 (_data_->from_jid);
	_data_->from_jid = _tmp3_;
	_tmp4_ = g_strdup (nick);
	_g_free0 (_data_->nick);
	_data_->nick = _tmp4_;
	dino_notification_events_on_voice_request_received_co (_data_);
}

static void
dino_notification_events_on_voice_request_received_finish (DinoNotificationEvents* self,
                                                           GAsyncResult* _res_)
{
	DinoNotificationEventsOnVoiceRequestReceivedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_notification_events_on_voice_request_received_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_)
{
	DinoNotificationEventsOnVoiceRequestReceivedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_notification_events_on_voice_request_received_co (_data_);
}

static gboolean
dino_notification_events_on_voice_request_received_co (DinoNotificationEventsOnVoiceRequestReceivedData* _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_conversation_manager_IDENTITY;
	_data_->_tmp2_ = dino_stream_interactor_get_module (_data_->_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
	_data_->_tmp3_ = (DinoConversationManager*) _data_->_tmp2_;
	_data_->_tmp4_ = DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT;
	_data_->_tmp5_ = dino_conversation_manager_get_conversation (_data_->_tmp3_, _data_->room_jid, _data_->account, &_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_g_object_unref0 (_data_->_tmp3_);
	_data_->conversation = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->conversation;
	if (_data_->_tmp7_ == NULL) {
		_g_object_unref0 (_data_->conversation);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = _data_->self->priv->notifier;
	_data_->_state_ = 1;
	gee_future_wait_async (_data_->_tmp8_, dino_notification_events_on_voice_request_received_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = gee_future_wait_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _g_object_ref0 ((DinoNotificationProvider*) _data_->_tmp9_);
	_data_->notifier = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->conversation);
		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_->_tmp11_ = _data_->notifier;
	_data_->_tmp12_ = _data_->conversation;
	_data_->_state_ = 2;
	dino_notification_provider_notify_voice_request (_data_->_tmp11_, _data_->_tmp12_, _data_->from_jid, dino_notification_events_on_voice_request_received_ready, _data_);
	return FALSE;
	_state_2:
	dino_notification_provider_notify_voice_request_finish (_data_->_tmp11_, _data_->_res_);
	_g_object_unref0 (_data_->notifier);
	_g_object_unref0 (_data_->conversation);
	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_notification_events_on_received_subscription_request_data_free (gpointer _data)
{
	DinoNotificationEventsOnReceivedSubscriptionRequestData* _data_;
	_data_ = _data;
	_xmpp_jid_unref0 (_data_->jid);
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoNotificationEventsOnReceivedSubscriptionRequestData, _data_);
}

static void
dino_notification_events_on_received_subscription_request (DinoNotificationEvents* self,
                                                           XmppJid* jid,
                                                           DinoEntitiesAccount* account,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	DinoNotificationEventsOnReceivedSubscriptionRequestData* _data_;
	DinoNotificationEvents* _tmp0_;
	XmppJid* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (account != NULL);
	_data_ = g_slice_new0 (DinoNotificationEventsOnReceivedSubscriptionRequestData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_notification_events_on_received_subscription_request_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (_data_->jid);
	_data_->jid = _tmp1_;
	_tmp2_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp2_;
	dino_notification_events_on_received_subscription_request_co (_data_);
}

static void
dino_notification_events_on_received_subscription_request_finish (DinoNotificationEvents* self,
                                                                  GAsyncResult* _res_)
{
	DinoNotificationEventsOnReceivedSubscriptionRequestData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_notification_events_on_received_subscription_request_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_)
{
	DinoNotificationEventsOnReceivedSubscriptionRequestData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_notification_events_on_received_subscription_request_co (_data_);
}

static gboolean
dino_notification_events_on_received_subscription_request_co (DinoNotificationEventsOnReceivedSubscriptionRequestData* _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_conversation_manager_IDENTITY;
	_data_->_tmp2_ = dino_stream_interactor_get_module (_data_->_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
	_data_->_tmp3_ = (DinoConversationManager*) _data_->_tmp2_;
	_data_->_tmp4_ = DINO_ENTITIES_CONVERSATION_TYPE_CHAT;
	_data_->_tmp5_ = dino_conversation_manager_create_conversation (_data_->_tmp3_, _data_->jid, _data_->account, &_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_g_object_unref0 (_data_->_tmp3_);
	_data_->conversation = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->self->priv->stream_interactor;
	_data_->_tmp8_ = dino_chat_interaction_IDENTITY;
	_data_->_tmp9_ = dino_stream_interactor_get_module (_data_->_tmp7_, DINO_TYPE_CHAT_INTERACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp8_);
	_data_->_tmp10_ = (DinoChatInteraction*) _data_->_tmp9_;
	_data_->_tmp11_ = _data_->conversation;
	_data_->_tmp12_ = dino_chat_interaction_is_active_focus (_data_->_tmp10_, _data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp10_);
	if (_data_->_tmp12_) {
		_g_object_unref0 (_data_->conversation);
		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_->_tmp13_ = _data_->self->priv->notifier;
	_data_->_state_ = 1;
	gee_future_wait_async (_data_->_tmp13_, dino_notification_events_on_received_subscription_request_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp14_ = gee_future_wait_finish (_data_->_tmp13_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp15_ = _g_object_ref0 ((DinoNotificationProvider*) _data_->_tmp14_);
	_data_->notifier = _data_->_tmp15_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->conversation);
		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_->_tmp16_ = _data_->notifier;
	_data_->_tmp17_ = _data_->conversation;
	_data_->_state_ = 2;
	dino_notification_provider_notify_subscription_request (_data_->_tmp16_, _data_->_tmp17_, dino_notification_events_on_received_subscription_request_ready, _data_);
	return FALSE;
	_state_2:
	dino_notification_provider_notify_subscription_request_finish (_data_->_tmp16_, _data_->_res_);
	_g_object_unref0 (_data_->notifier);
	_g_object_unref0 (_data_->conversation);
	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_notification_events_on_call_incoming_data_free (gpointer _data)
{
	DinoNotificationEventsOnCallIncomingData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->call_state);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoNotificationEventsOnCallIncomingData, _data_);
}

static void
dino_notification_events_on_call_incoming (DinoNotificationEvents* self,
                                           DinoEntitiesCall* call,
                                           DinoCallState* call_state,
                                           DinoEntitiesConversation* conversation,
                                           gboolean video,
                                           gboolean multiparty,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DinoNotificationEventsOnCallIncomingData* _data_;
	DinoNotificationEvents* _tmp0_;
	DinoEntitiesCall* _tmp1_;
	DinoCallState* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (call != NULL);
	g_return_if_fail (call_state != NULL);
	g_return_if_fail (conversation != NULL);
	_data_ = g_slice_new0 (DinoNotificationEventsOnCallIncomingData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_notification_events_on_call_incoming_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (call);
	_g_object_unref0 (_data_->call);
	_data_->call = _tmp1_;
	_tmp2_ = _g_object_ref0 (call_state);
	_g_object_unref0 (_data_->call_state);
	_data_->call_state = _tmp2_;
	_tmp3_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp3_;
	_data_->video = video;
	_data_->multiparty = multiparty;
	dino_notification_events_on_call_incoming_co (_data_);
}

static void
dino_notification_events_on_call_incoming_finish (DinoNotificationEvents* self,
                                                  GAsyncResult* _res_)
{
	DinoNotificationEventsOnCallIncomingData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block33Data*
block33_data_ref (Block33Data* _data33_)
{
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		DinoNotificationEvents* self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->notifier);
		_g_object_unref0 (_data33_->call);
		_g_object_unref0 (_data33_->conversation);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static void
dino_notification_events_on_call_incoming_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	DinoNotificationEventsOnCallIncomingData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_notification_events_on_call_incoming_co (_data_);
}

static void
__lambda119_ (Block33Data* _data33_)
{
	DinoNotificationEvents* self;
	DinoEntitiesCallState _tmp0_;
	DinoEntitiesCallState _tmp1_;
	self = _data33_->self;
	_tmp0_ = dino_entities_call_get_state (_data33_->call);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != DINO_ENTITIES_CALL_STATE_RINGING) {
		DinoNotificationProvider* _tmp2_;
		_tmp2_ = _data33_->notifier;
		dino_notification_provider_retract_call_notification (_tmp2_, _data33_->call, _data33_->conversation, NULL, NULL);
	}
}

static void
___lambda119__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda119_ (self);
}

static gboolean
dino_notification_events_on_call_incoming_co (DinoNotificationEventsOnCallIncomingData* _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_->_data33_ = g_slice_new0 (Block33Data);
	_data_->_data33_->_ref_count_ = 1;
	_data_->_data33_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data33_->call);
	_data_->_data33_->call = _data_->call;
	_g_object_unref0 (_data_->_data33_->conversation);
	_data_->_data33_->conversation = _data_->conversation;
	_data_->_data33_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_calls_IDENTITY;
	_data_->_tmp2_ = dino_stream_interactor_get_module (_data_->_tmp0_, DINO_TYPE_CALLS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
	_data_->_tmp3_ = (DinoCalls*) _data_->_tmp2_;
	_data_->_tmp4_ = dino_entities_call_get_account (_data_->_data33_->call);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = !dino_calls_can_we_do_calls (_data_->_tmp3_, _data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	if (_data_->_tmp6_) {
		block33_data_unref (_data_->_data33_);
		_data_->_data33_ = 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_->_tmp7_ = _data_->self->priv->stream_interactor;
	_data_->_tmp8_ = dino_get_conversation_display_name (_data_->_tmp7_, _data_->_data33_->conversation, NULL);
	_data_->conversation_display_name = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->self->priv->notifier;
	_data_->_state_ = 1;
	gee_future_wait_async (_data_->_tmp9_, dino_notification_events_on_call_incoming_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp10_ = gee_future_wait_finish (_data_->_tmp9_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp11_ = _g_object_ref0 ((DinoNotificationProvider*) _data_->_tmp10_);
	_data_->_data33_->notifier = _data_->_tmp11_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->conversation_display_name);
		block33_data_unref (_data_->_data33_);
		_data_->_data33_ = 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_->_tmp12_ = _data_->_data33_->notifier;
	_data_->_tmp13_ = _data_->conversation_display_name;
	_data_->_state_ = 2;
	dino_notification_provider_notify_call (_data_->_tmp12_, _data_->_data33_->call, _data_->_data33_->conversation, _data_->video, _data_->multiparty, _data_->_tmp13_, dino_notification_events_on_call_incoming_ready, _data_);
	return FALSE;
	_state_2:
	dino_notification_provider_notify_call_finish (_data_->_tmp12_, _data_->_res_);
	g_signal_connect_data ((GObject*) _data_->_data33_->call, "notify::state", (GCallback) ___lambda119__g_object_notify, block33_data_ref (_data_->_data33_), (GClosureNotify) block33_data_unref, 0);
	_g_free0 (_data_->conversation_display_name);
	block33_data_unref (_data_->_data33_);
	_data_->_data33_ = 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 void
dino_notification_events_on_invite_received_data_free (gpointer _data)
{
	DinoNotificationEventsOnInviteReceivedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_xmpp_jid_unref0 (_data_->room_jid);
	_xmpp_jid_unref0 (_data_->from_jid);
	_g_free0 (_data_->password);
	_g_free0 (_data_->reason);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoNotificationEventsOnInviteReceivedData, _data_);
}

static void
dino_notification_events_on_invite_received (DinoNotificationEvents* self,
                                             DinoEntitiesAccount* account,
                                             XmppJid* room_jid,
                                             XmppJid* from_jid,
                                             const gchar* password,
                                             const gchar* reason,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	DinoNotificationEventsOnInviteReceivedData* _data_;
	DinoNotificationEvents* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	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);
	_data_ = g_slice_new0 (DinoNotificationEventsOnInviteReceivedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_notification_events_on_invite_received_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 (room_jid);
	_xmpp_jid_unref0 (_data_->room_jid);
	_data_->room_jid = _tmp2_;
	_tmp3_ = _xmpp_jid_ref0 (from_jid);
	_xmpp_jid_unref0 (_data_->from_jid);
	_data_->from_jid = _tmp3_;
	_tmp4_ = g_strdup (password);
	_g_free0 (_data_->password);
	_data_->password = _tmp4_;
	_tmp5_ = g_strdup (reason);
	_g_free0 (_data_->reason);
	_data_->reason = _tmp5_;
	dino_notification_events_on_invite_received_co (_data_);
}

static void
dino_notification_events_on_invite_received_finish (DinoNotificationEvents* self,
                                                    GAsyncResult* _res_)
{
	DinoNotificationEventsOnInviteReceivedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_notification_events_on_invite_received_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	DinoNotificationEventsOnInviteReceivedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_notification_events_on_invite_received_co (_data_);
}

static gboolean
dino_notification_events_on_invite_received_co (DinoNotificationEventsOnInviteReceivedData* _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:
	if (xmpp_jid_equals_bare (_data_->room_jid, _data_->from_jid)) {
		_data_->_tmp0_ = dino_entities_conversation_new (_data_->room_jid, _data_->account, DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT);
		_data_->conversation = _data_->_tmp0_;
		_data_->_tmp1_ = _data_->self->priv->stream_interactor;
		_data_->_tmp2_ = _data_->conversation;
		_data_->_tmp3_ = dino_get_participant_display_name (_data_->_tmp1_, _data_->_tmp2_, _data_->from_jid, NULL);
		_g_free0 (_data_->inviter_display_name);
		_data_->inviter_display_name = _data_->_tmp3_;
		_g_object_unref0 (_data_->conversation);
	} else {
		_data_->_tmp4_ = dino_entities_conversation_new (_data_->from_jid, _data_->account, DINO_ENTITIES_CONVERSATION_TYPE_CHAT);
		_data_->direct_conversation = _data_->_tmp4_;
		_data_->_tmp5_ = _data_->self->priv->stream_interactor;
		_data_->_tmp6_ = _data_->direct_conversation;
		_data_->_tmp7_ = dino_get_participant_display_name (_data_->_tmp5_, _data_->_tmp6_, _data_->from_jid, NULL);
		_g_free0 (_data_->inviter_display_name);
		_data_->inviter_display_name = _data_->_tmp7_;
		_g_object_unref0 (_data_->direct_conversation);
	}
	_data_->_tmp8_ = _data_->self->priv->notifier;
	_data_->_state_ = 1;
	gee_future_wait_async (_data_->_tmp8_, dino_notification_events_on_invite_received_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = gee_future_wait_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _g_object_ref0 ((DinoNotificationProvider*) _data_->_tmp9_);
	_data_->notifier = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->inviter_display_name);
		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_->_tmp11_ = _data_->inviter_display_name;
	_data_->_state_ = 2;
	dino_notification_provider_notify_muc_invite (_data_->notifier, _data_->account, _data_->room_jid, _data_->from_jid, _data_->_tmp11_, dino_notification_events_on_invite_received_ready, _data_);
	return FALSE;
	_state_2:
	dino_notification_provider_notify_muc_invite_finish (_data_->notifier, _data_->_res_);
	_g_object_unref0 (_data_->notifier);
	_g_free0 (_data_->inviter_display_name);
	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_notification_events_on_connection_error_data_free (gpointer _data)
{
	DinoNotificationEventsOnConnectionErrorData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_dino_connection_manager_connection_error_unref0 (_data_->_error_);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoNotificationEventsOnConnectionErrorData, _data_);
}

static gpointer
_dino_connection_manager_connection_error_ref0 (gpointer self)
{
	return self ? dino_connection_manager_connection_error_ref (self) : NULL;
}

static void
dino_notification_events_on_connection_error (DinoNotificationEvents* self,
                                              DinoEntitiesAccount* account,
                                              DinoConnectionManagerConnectionError* _error_,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	DinoNotificationEventsOnConnectionErrorData* _data_;
	DinoNotificationEvents* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	DinoConnectionManagerConnectionError* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (_error_ != NULL);
	_data_ = g_slice_new0 (DinoNotificationEventsOnConnectionErrorData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_notification_events_on_connection_error_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _dino_connection_manager_connection_error_ref0 (_error_);
	_dino_connection_manager_connection_error_unref0 (_data_->_error_);
	_data_->_error_ = _tmp2_;
	dino_notification_events_on_connection_error_co (_data_);
}

static void
dino_notification_events_on_connection_error_finish (DinoNotificationEvents* self,
                                                     GAsyncResult* _res_)
{
	DinoNotificationEventsOnConnectionErrorData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_notification_events_on_connection_error_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	DinoNotificationEventsOnConnectionErrorData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_notification_events_on_connection_error_co (_data_);
}

static gboolean
dino_notification_events_on_connection_error_co (DinoNotificationEventsOnConnectionErrorData* _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->notifier;
	_data_->_state_ = 1;
	gee_future_wait_async (_data_->_tmp0_, dino_notification_events_on_connection_error_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = gee_future_wait_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp2_ = _g_object_ref0 ((DinoNotificationProvider*) _data_->_tmp1_);
	_data_->notifier = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != 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_->_state_ = 2;
	dino_notification_provider_notify_connection_error (_data_->notifier, _data_->account, _data_->_error_, dino_notification_events_on_connection_error_ready, _data_);
	return FALSE;
	_state_2:
	dino_notification_provider_notify_connection_error_finish (_data_->notifier, _data_->_res_);
	_g_object_unref0 (_data_->notifier);
	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_notification_events_on_focused_in_data_free (gpointer _data)
{
	DinoNotificationEventsOnFocusedInData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoNotificationEventsOnFocusedInData, _data_);
}

static void
dino_notification_events_on_focused_in (DinoNotificationEvents* self,
                                        DinoEntitiesConversation* conversation,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DinoNotificationEventsOnFocusedInData* _data_;
	DinoNotificationEvents* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (conversation != NULL);
	_data_ = g_slice_new0 (DinoNotificationEventsOnFocusedInData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_notification_events_on_focused_in_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp1_;
	dino_notification_events_on_focused_in_co (_data_);
}

static void
dino_notification_events_on_focused_in_finish (DinoNotificationEvents* self,
                                               GAsyncResult* _res_)
{
	DinoNotificationEventsOnFocusedInData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_notification_events_on_focused_in_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DinoNotificationEventsOnFocusedInData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_notification_events_on_focused_in_co (_data_);
}

static gboolean
dino_notification_events_on_focused_in_co (DinoNotificationEventsOnFocusedInData* _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_->_tmp0_ = _data_->self->priv->notifier;
	_data_->_state_ = 1;
	gee_future_wait_async (_data_->_tmp0_, dino_notification_events_on_focused_in_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = gee_future_wait_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp2_ = _g_object_ref0 ((DinoNotificationProvider*) _data_->_tmp1_);
	_data_->notifier = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != 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_->_state_ = 2;
	dino_notification_provider_retract_content_item_notifications (_data_->notifier, dino_notification_events_on_focused_in_ready, _data_);
	return FALSE;
	_state_2:
	dino_notification_provider_retract_content_item_notifications_finish (_data_->notifier, _data_->_res_);
	_data_->_state_ = 3;
	dino_notification_provider_retract_conversation_notifications (_data_->notifier, _data_->conversation, dino_notification_events_on_focused_in_ready, _data_);
	return FALSE;
	_state_3:
	dino_notification_provider_retract_conversation_notifications_finish (_data_->notifier, _data_->_res_);
	_g_object_unref0 (_data_->notifier);
	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_notification_events_real_get_id (DinoStreamInteractionModule* base)
{
	const gchar* result;
	DinoNotificationEvents* self;
	DinoModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (DinoNotificationEvents*) base;
	_tmp0_ = dino_notification_events_IDENTITY;
	_tmp1_ = dino_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

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

static void
dino_notification_events_class_init (DinoNotificationEventsClass * klass,
                                     gpointer klass_data)
{
	DinoModuleIdentity* _tmp0_;
	dino_notification_events_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoNotificationEvents_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_notification_events_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_notification_events_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_NOTIFICATION_EVENTS_ID_PROPERTY, dino_notification_events_properties[DINO_NOTIFICATION_EVENTS_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	dino_notification_events_signals[DINO_NOTIFICATION_EVENTS_NOTIFY_CONTENT_ITEM_SIGNAL] = g_signal_new ("notify-content-item", DINO_TYPE_NOTIFICATION_EVENTS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, DINO_TYPE_CONTENT_ITEM, DINO_ENTITIES_TYPE_CONVERSATION);
	_tmp0_ = dino_module_identity_new (DINO_TYPE_NOTIFICATION_EVENTS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "notification_events");
	dino_notification_events_IDENTITY = _tmp0_;
}

static void
dino_notification_events_dino_stream_interaction_module_interface_init (DinoStreamInteractionModuleIface * iface,
                                                                        gpointer iface_data)
{
	dino_notification_events_dino_stream_interaction_module_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_id = dino_notification_events_real_get_id;
}

static void
dino_notification_events_instance_init (DinoNotificationEvents * self,
                                        gpointer klass)
{
	self->priv = dino_notification_events_get_instance_private (self);
	self->priv->notifier_outstanding = TRUE;
}

static void
dino_notification_events_finalize (GObject * obj)
{
	DinoNotificationEvents * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_NOTIFICATION_EVENTS, DinoNotificationEvents);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->notifier);
	_gee_promise_unref0 (self->priv->notifier_promise);
	G_OBJECT_CLASS (dino_notification_events_parent_class)->finalize (obj);
}

static GType
dino_notification_events_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoNotificationEventsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_notification_events_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoNotificationEvents), 0, (GInstanceInitFunc) dino_notification_events_instance_init, NULL };
	static const GInterfaceInfo dino_stream_interaction_module_info = { (GInterfaceInitFunc) dino_notification_events_dino_stream_interaction_module_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_notification_events_type_id;
	dino_notification_events_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoNotificationEvents", &g_define_type_info, 0);
	g_type_add_interface_static (dino_notification_events_type_id, DINO_TYPE_STREAM_INTERACTION_MODULE, &dino_stream_interaction_module_info);
	DinoNotificationEvents_private_offset = g_type_add_instance_private (dino_notification_events_type_id, sizeof (DinoNotificationEventsPrivate));
	return dino_notification_events_type_id;
}

GType
dino_notification_events_get_type (void)
{
	static volatile gsize dino_notification_events_type_id__once = 0;
	if (g_once_init_enter (&dino_notification_events_type_id__once)) {
		GType dino_notification_events_type_id;
		dino_notification_events_type_id = dino_notification_events_get_type_once ();
		g_once_init_leave (&dino_notification_events_type_id__once, dino_notification_events_type_id);
	}
	return dino_notification_events_type_id__once;
}

static void
_vala_dino_notification_events_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	DinoNotificationEvents * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_TYPE_NOTIFICATION_EVENTS, DinoNotificationEvents);
	switch (property_id) {
		case DINO_NOTIFICATION_EVENTS_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;
	}
}

gdouble
dino_notification_provider_get_priority (DinoNotificationProvider* self)
{
	DinoNotificationProviderIface* _iface_;
	g_return_val_if_fail (self != NULL, -1.0);
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->get_priority) {
		return _iface_->get_priority (self);
	}
	return -1.0;
}

void
dino_notification_provider_notify_message (DinoNotificationProvider* self,
                                           DinoEntitiesMessage* message,
                                           DinoEntitiesConversation* conversation,
                                           const gchar* conversation_display_name,
                                           const gchar* participant_display_name,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_message) {
		_iface_->notify_message (self, message, conversation, conversation_display_name, participant_display_name, _callback_, _user_data_);
	}
}

void
dino_notification_provider_notify_message_finish (DinoNotificationProvider* self,
                                                  GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_message_finish) {
		_iface_->notify_message_finish (self, _res_);
	}
}

void
dino_notification_provider_notify_file (DinoNotificationProvider* self,
                                        DinoEntitiesFileTransfer* file_transfer,
                                        DinoEntitiesConversation* conversation,
                                        gboolean is_image,
                                        const gchar* conversation_display_name,
                                        const gchar* participant_display_name,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_file) {
		_iface_->notify_file (self, file_transfer, conversation, is_image, conversation_display_name, participant_display_name, _callback_, _user_data_);
	}
}

void
dino_notification_provider_notify_file_finish (DinoNotificationProvider* self,
                                               GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_file_finish) {
		_iface_->notify_file_finish (self, _res_);
	}
}

void
dino_notification_provider_notify_call (DinoNotificationProvider* self,
                                        DinoEntitiesCall* call,
                                        DinoEntitiesConversation* conversation,
                                        gboolean video,
                                        gboolean multiparty,
                                        const gchar* conversation_display_name,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_call) {
		_iface_->notify_call (self, call, conversation, video, multiparty, conversation_display_name, _callback_, _user_data_);
	}
}

void
dino_notification_provider_notify_call_finish (DinoNotificationProvider* self,
                                               GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_call_finish) {
		_iface_->notify_call_finish (self, _res_);
	}
}

void
dino_notification_provider_retract_call_notification (DinoNotificationProvider* self,
                                                      DinoEntitiesCall* call,
                                                      DinoEntitiesConversation* conversation,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->retract_call_notification) {
		_iface_->retract_call_notification (self, call, conversation, _callback_, _user_data_);
	}
}

void
dino_notification_provider_retract_call_notification_finish (DinoNotificationProvider* self,
                                                             GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->retract_call_notification_finish) {
		_iface_->retract_call_notification_finish (self, _res_);
	}
}

void
dino_notification_provider_notify_subscription_request (DinoNotificationProvider* self,
                                                        DinoEntitiesConversation* conversation,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_subscription_request) {
		_iface_->notify_subscription_request (self, conversation, _callback_, _user_data_);
	}
}

void
dino_notification_provider_notify_subscription_request_finish (DinoNotificationProvider* self,
                                                               GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_subscription_request_finish) {
		_iface_->notify_subscription_request_finish (self, _res_);
	}
}

void
dino_notification_provider_notify_connection_error (DinoNotificationProvider* self,
                                                    DinoEntitiesAccount* account,
                                                    DinoConnectionManagerConnectionError* _error_,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_connection_error) {
		_iface_->notify_connection_error (self, account, _error_, _callback_, _user_data_);
	}
}

void
dino_notification_provider_notify_connection_error_finish (DinoNotificationProvider* self,
                                                           GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_connection_error_finish) {
		_iface_->notify_connection_error_finish (self, _res_);
	}
}

void
dino_notification_provider_notify_muc_invite (DinoNotificationProvider* self,
                                              DinoEntitiesAccount* account,
                                              XmppJid* room_jid,
                                              XmppJid* from_jid,
                                              const gchar* inviter_display_name,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_muc_invite) {
		_iface_->notify_muc_invite (self, account, room_jid, from_jid, inviter_display_name, _callback_, _user_data_);
	}
}

void
dino_notification_provider_notify_muc_invite_finish (DinoNotificationProvider* self,
                                                     GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_muc_invite_finish) {
		_iface_->notify_muc_invite_finish (self, _res_);
	}
}

void
dino_notification_provider_notify_voice_request (DinoNotificationProvider* self,
                                                 DinoEntitiesConversation* conversation,
                                                 XmppJid* from_jid,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_voice_request) {
		_iface_->notify_voice_request (self, conversation, from_jid, _callback_, _user_data_);
	}
}

void
dino_notification_provider_notify_voice_request_finish (DinoNotificationProvider* self,
                                                        GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->notify_voice_request_finish) {
		_iface_->notify_voice_request_finish (self, _res_);
	}
}

void
dino_notification_provider_retract_content_item_notifications (DinoNotificationProvider* self,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->retract_content_item_notifications) {
		_iface_->retract_content_item_notifications (self, _callback_, _user_data_);
	}
}

void
dino_notification_provider_retract_content_item_notifications_finish (DinoNotificationProvider* self,
                                                                      GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->retract_content_item_notifications_finish) {
		_iface_->retract_content_item_notifications_finish (self, _res_);
	}
}

void
dino_notification_provider_retract_conversation_notifications (DinoNotificationProvider* self,
                                                               DinoEntitiesConversation* conversation,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->retract_conversation_notifications) {
		_iface_->retract_conversation_notifications (self, conversation, _callback_, _user_data_);
	}
}

void
dino_notification_provider_retract_conversation_notifications_finish (DinoNotificationProvider* self,
                                                                      GAsyncResult* _res_)
{
	DinoNotificationProviderIface* _iface_;
	_iface_ = DINO_NOTIFICATION_PROVIDER_GET_INTERFACE (self);
	if (_iface_->retract_conversation_notifications_finish) {
		_iface_->retract_conversation_notifications_finish (self, _res_);
	}
}

static void
dino_notification_provider_default_init (DinoNotificationProviderIface * iface,
                                         gpointer iface_data)
{
}

static GType
dino_notification_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoNotificationProviderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_notification_provider_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType dino_notification_provider_type_id;
	dino_notification_provider_type_id = g_type_register_static (G_TYPE_INTERFACE, "DinoNotificationProvider", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (dino_notification_provider_type_id, G_TYPE_OBJECT);
	return dino_notification_provider_type_id;
}

GType
dino_notification_provider_get_type (void)
{
	static volatile gsize dino_notification_provider_type_id__once = 0;
	if (g_once_init_enter (&dino_notification_provider_type_id__once)) {
		GType dino_notification_provider_type_id;
		dino_notification_provider_type_id = dino_notification_provider_get_type_once ();
		g_once_init_leave (&dino_notification_provider_type_id__once, dino_notification_provider_type_id);
	}
	return dino_notification_provider_type_id__once;
}

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

