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

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

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

enum  {
	DINO_MESSAGE_PROCESSOR_0_PROPERTY,
	DINO_MESSAGE_PROCESSOR_ID_PROPERTY,
	DINO_MESSAGE_PROCESSOR_NUM_PROPERTIES
};
static GParamSpec* dino_message_processor_properties[DINO_MESSAGE_PROCESSOR_NUM_PROPERTIES];
#define _dino_history_sync_unref0(var) ((var == NULL) ? NULL : (var = (dino_history_sync_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _qlite_database_unref0(var) ((var == NULL) ? NULL : (var = (qlite_database_unref (var), NULL)))

#define DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER (dino_message_processor_deduplicate_message_listener_get_type ())
#define DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER, DinoMessageProcessorDeduplicateMessageListener))
#define DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER, DinoMessageProcessorDeduplicateMessageListenerClass))
#define DINO_MESSAGE_PROCESSOR_IS_DEDUPLICATE_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER))
#define DINO_MESSAGE_PROCESSOR_IS_DEDUPLICATE_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER))
#define DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER, DinoMessageProcessorDeduplicateMessageListenerClass))

typedef struct _DinoMessageProcessorDeduplicateMessageListener DinoMessageProcessorDeduplicateMessageListener;
typedef struct _DinoMessageProcessorDeduplicateMessageListenerClass DinoMessageProcessorDeduplicateMessageListenerClass;

#define DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER (dino_message_processor_filter_message_listener_get_type ())
#define DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER, DinoMessageProcessorFilterMessageListener))
#define DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER, DinoMessageProcessorFilterMessageListenerClass))
#define DINO_MESSAGE_PROCESSOR_IS_FILTER_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER))
#define DINO_MESSAGE_PROCESSOR_IS_FILTER_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER))
#define DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER, DinoMessageProcessorFilterMessageListenerClass))

typedef struct _DinoMessageProcessorFilterMessageListener DinoMessageProcessorFilterMessageListener;
typedef struct _DinoMessageProcessorFilterMessageListenerClass DinoMessageProcessorFilterMessageListenerClass;

#define DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER (dino_message_processor_store_message_listener_get_type ())
#define DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER, DinoMessageProcessorStoreMessageListener))
#define DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER, DinoMessageProcessorStoreMessageListenerClass))
#define DINO_MESSAGE_PROCESSOR_IS_STORE_MESSAGE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER))
#define DINO_MESSAGE_PROCESSOR_IS_STORE_MESSAGE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER))
#define DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER, DinoMessageProcessorStoreMessageListenerClass))

typedef struct _DinoMessageProcessorStoreMessageListener DinoMessageProcessorStoreMessageListener;
typedef struct _DinoMessageProcessorStoreMessageListenerClass DinoMessageProcessorStoreMessageListenerClass;

#define DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER (dino_message_processor_store_content_item_listener_get_type ())
#define DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER, DinoMessageProcessorStoreContentItemListener))
#define DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER, DinoMessageProcessorStoreContentItemListenerClass))
#define DINO_MESSAGE_PROCESSOR_IS_STORE_CONTENT_ITEM_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER))
#define DINO_MESSAGE_PROCESSOR_IS_STORE_CONTENT_ITEM_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER))
#define DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER, DinoMessageProcessorStoreContentItemListenerClass))

typedef struct _DinoMessageProcessorStoreContentItemListener DinoMessageProcessorStoreContentItemListener;
typedef struct _DinoMessageProcessorStoreContentItemListenerClass DinoMessageProcessorStoreContentItemListenerClass;

#define DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER (dino_message_processor_markup_listener_get_type ())
#define DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER, DinoMessageProcessorMarkupListener))
#define DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER, DinoMessageProcessorMarkupListenerClass))
#define DINO_MESSAGE_PROCESSOR_IS_MARKUP_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER))
#define DINO_MESSAGE_PROCESSOR_IS_MARKUP_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER))
#define DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER, DinoMessageProcessorMarkupListenerClass))

typedef struct _DinoMessageProcessorMarkupListener DinoMessageProcessorMarkupListener;
typedef struct _DinoMessageProcessorMarkupListenerClass DinoMessageProcessorMarkupListenerClass;
#define _qlite_statement_builder_unref0(var) ((var == NULL) ? NULL : (var = (qlite_statement_builder_unref (var), NULL)))
#define _qlite_row_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_unref (var), NULL)))
#define _qlite_row_iterator_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_iterator_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block20Data Block20Data;
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _DinoMessageProcessorOnMessageReceivedData DinoMessageProcessorOnMessageReceivedData;
typedef struct _DinoMessageProcessorRunPipelineAnnounceData DinoMessageProcessorRunPipelineAnnounceData;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _DinoMessageProcessorParseMessageStanzaData DinoMessageProcessorParseMessageStanzaData;
#define _xmpp_xep_service_discovery_identity_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_service_discovery_identity_unref (var), NULL)))
typedef struct _DinoMessageProcessorDetermineMessageTypeData DinoMessageProcessorDetermineMessageTypeData;
#define _qlite_row_option_unref0(var) ((var == NULL) ? NULL : (var = (qlite_row_option_unref (var), NULL)))
typedef struct _Block21Data Block21Data;
#define _xmpp_xep_replies_reply_to_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_replies_reply_to_unref (var), NULL)))
#define _xmpp_xep_fallback_indication_fallback_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_fallback_indication_fallback_unref (var), NULL)))
typedef struct _DinoMessageProcessorDeduplicateMessageListenerPrivate DinoMessageProcessorDeduplicateMessageListenerPrivate;
enum  {
	DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_0_PROPERTY,
	DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY,
	DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY,
	DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_message_processor_deduplicate_message_listener_properties[DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_NUM_PROPERTIES];
typedef struct _DinoMessageProcessorDeduplicateMessageListenerRunData DinoMessageProcessorDeduplicateMessageListenerRunData;
typedef struct _DinoMessageProcessorFilterMessageListenerPrivate DinoMessageProcessorFilterMessageListenerPrivate;
enum  {
	DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_0_PROPERTY,
	DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY,
	DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY,
	DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_message_processor_filter_message_listener_properties[DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_NUM_PROPERTIES];
typedef struct _DinoMessageProcessorFilterMessageListenerRunData DinoMessageProcessorFilterMessageListenerRunData;
typedef struct _DinoMessageProcessorStoreMessageListenerPrivate DinoMessageProcessorStoreMessageListenerPrivate;
enum  {
	DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_0_PROPERTY,
	DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY,
	DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY,
	DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_message_processor_store_message_listener_properties[DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_NUM_PROPERTIES];
typedef struct _DinoMessageProcessorStoreMessageListenerRunData DinoMessageProcessorStoreMessageListenerRunData;
typedef struct _DinoMessageProcessorMarkupListenerPrivate DinoMessageProcessorMarkupListenerPrivate;
enum  {
	DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_0_PROPERTY,
	DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_ACTION_GROUP_PROPERTY,
	DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_AFTER_ACTIONS_PROPERTY,
	DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_message_processor_markup_listener_properties[DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_NUM_PROPERTIES];
typedef struct _DinoMessageProcessorMarkupListenerRunData DinoMessageProcessorMarkupListenerRunData;
typedef struct _DinoMessageProcessorStoreContentItemListenerPrivate DinoMessageProcessorStoreContentItemListenerPrivate;
enum  {
	DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_0_PROPERTY,
	DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_ACTION_GROUP_PROPERTY,
	DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_AFTER_ACTIONS_PROPERTY,
	DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_message_processor_store_content_item_listener_properties[DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_NUM_PROPERTIES];
typedef struct _DinoMessageProcessorStoreContentItemListenerRunData DinoMessageProcessorStoreContentItemListenerRunData;
enum  {
	DINO_MESSAGE_PROCESSOR_MESSAGE_RECEIVED_SIGNAL,
	DINO_MESSAGE_PROCESSOR_BUILD_MESSAGE_STANZA_SIGNAL,
	DINO_MESSAGE_PROCESSOR_PRE_MESSAGE_SEND_SIGNAL,
	DINO_MESSAGE_PROCESSOR_MESSAGE_SENT_SIGNAL,
	DINO_MESSAGE_PROCESSOR_MESSAGE_SENT_OR_RECEIVED_SIGNAL,
	DINO_MESSAGE_PROCESSOR_HISTORY_SYNCED_SIGNAL,
	DINO_MESSAGE_PROCESSOR_NUM_SIGNALS
};
static guint dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_NUM_SIGNALS] = {0};
enum  {
	DINO_MESSAGE_LISTENER_0_PROPERTY,
	DINO_MESSAGE_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_message_listener_properties[DINO_MESSAGE_LISTENER_NUM_PROPERTIES];
enum  {
	DINO_MESSAGE_LISTENER_HOLDER_0_PROPERTY,
	DINO_MESSAGE_LISTENER_HOLDER_NUM_PROPERTIES
};
static GParamSpec* dino_message_listener_holder_properties[DINO_MESSAGE_LISTENER_HOLDER_NUM_PROPERTIES];
typedef struct _DinoMessageListenerHolderRunData DinoMessageListenerHolderRunData;

struct _DinoMessageProcessorPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoDatabase* db;
};

struct _Block20Data {
	int _ref_count_;
	DinoMessageProcessor* self;
	DinoEntitiesAccount* account;
};

struct _DinoMessageProcessorOnMessageReceivedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessor* self;
	DinoEntitiesAccount* account;
	XmppMessageStanza* message_stanza;
	DinoHistorySync* _tmp0_;
};

struct _DinoMessageProcessorRunPipelineAnnounceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessor* self;
	DinoEntitiesAccount* account;
	XmppMessageStanza* message_stanza;
	DinoEntitiesMessage* message;
	DinoEntitiesMessage* _tmp0_;
	DinoEntitiesConversation* conversation;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoConversationManager* _tmp4_;
	DinoEntitiesMessage* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	DinoEntitiesConversation* _tmp7_;
	DinoEntitiesConversation* _tmp8_;
	gboolean abort;
	DinoMessageListenerHolder* _tmp9_;
	DinoEntitiesMessage* _tmp10_;
	DinoEntitiesConversation* _tmp11_;
	DinoEntitiesMessage* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	DinoEntitiesMessage* _tmp15_;
	DinoEntitiesConversation* _tmp16_;
	DinoEntitiesMessage* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	DinoEntitiesMessage* _tmp20_;
	DinoEntitiesConversation* _tmp21_;
	DinoEntitiesMessage* _tmp22_;
	DinoEntitiesConversation* _tmp23_;
};

struct _DinoMessageProcessorParseMessageStanzaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessor* self;
	DinoEntitiesAccount* account;
	XmppMessageStanza* message;
	DinoEntitiesMessage* result;
	gchar* body;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	DinoEntitiesMessage* new_message;
	const gchar* _tmp6_;
	DinoEntitiesMessage* _tmp7_;
	DinoEntitiesMessage* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	DinoEntitiesMessage* _tmp14_;
	XmppJid* counterpart_override;
	XmppJid* _tmp15_;
	XmppJid* _tmp16_;
	XmppJid* _tmp17_;
	DinoStreamInteractor* _tmp18_;
	DinoModuleIdentity* _tmp19_;
	gpointer _tmp20_;
	DinoMucManager* _tmp21_;
	XmppJid* _tmp22_;
	XmppJid* _tmp23_;
	XmppJid* _tmp24_;
	XmppJid* _tmp25_;
	XmppJid* _tmp26_;
	XmppJid* _tmp27_;
	XmppJid* _tmp28_;
	XmppJid* _tmp29_;
	gboolean _tmp30_;
	DinoEntitiesMessage* _tmp31_;
	XmppJid* _tmp32_;
	XmppJid* _tmp33_;
	XmppJid* _tmp34_;
	XmppJid* _tmp35_;
	XmppJid* _tmp36_;
	XmppJid* _tmp37_;
	XmppJid* _tmp38_;
	XmppJid* _tmp39_;
	XmppJid* _tmp40_;
	XmppJid* _tmp41_;
	XmppJid* _tmp42_;
	gboolean _tmp43_;
	DinoEntitiesMessage* _tmp44_;
	DinoEntitiesMessage* _tmp45_;
	XmppJid* _tmp46_;
	XmppJid* _tmp47_;
	XmppJid* _tmp48_;
	XmppJid* _tmp49_;
	DinoEntitiesMessage* _tmp50_;
	gboolean _tmp51_;
	gboolean _tmp52_;
	XmppJid* _tmp53_;
	XmppJid* _tmp54_;
	XmppJid* _tmp55_;
	XmppJid* _tmp56_;
	XmppJid* _tmp57_;
	DinoEntitiesMessage* _tmp58_;
	XmppJid* _tmp59_;
	DinoEntitiesMessage* _tmp60_;
	gboolean _tmp61_;
	gboolean _tmp62_;
	XmppJid* _tmp63_;
	XmppJid* _tmp64_;
	XmppJid* _tmp65_;
	XmppJid* _tmp66_;
	DinoEntitiesMessage* _tmp67_;
	XmppMessageArchiveManagementMessageFlag* mam_message_flag;
	XmppMessageArchiveManagementMessageFlag* _tmp68_;
	DinoEntityInfo* entity_info;
	DinoStreamInteractor* _tmp69_;
	DinoModuleIdentity* _tmp70_;
	gpointer _tmp71_;
	gboolean _tmp72_;
	XmppMessageArchiveManagementMessageFlag* _tmp73_;
	XmppMessageArchiveManagementMessageFlag* _tmp74_;
	const gchar* _tmp75_;
	const gchar* _tmp76_;
	gboolean sender_supports_mam;
	DinoEntityInfo* _tmp77_;
	XmppMessageArchiveManagementMessageFlag* _tmp78_;
	XmppJid* _tmp79_;
	XmppJid* _tmp80_;
	DinoEntitiesMessage* _tmp81_;
	XmppMessageArchiveManagementMessageFlag* _tmp82_;
	const gchar* _tmp83_;
	const gchar* _tmp84_;
	const gchar* _tmp85_;
	const gchar* _tmp86_;
	gboolean server_supports_sid;
	DinoEntityInfo* _tmp87_;
	DinoEntitiesMessage* _tmp88_;
	XmppJid* _tmp89_;
	XmppJid* _tmp90_;
	XmppJid* _tmp91_;
	XmppJid* _tmp92_;
	XmppJid* _tmp93_;
	gboolean _tmp94_;
	DinoEntitiesMessage* _tmp95_;
	DinoEntitiesMessage* _tmp96_;
	XmppJid* _tmp97_;
	XmppJid* _tmp98_;
	XmppJid* _tmp99_;
	XmppJid* _tmp100_;
	XmppJid* _tmp101_;
	gchar* _tmp102_;
	gchar* _tmp103_;
	const gchar* _tmp104_;
	const gchar* _tmp105_;
	gboolean _vala1_server_supports_sid;
	DinoEntityInfo* _tmp106_;
	XmppJid* _tmp107_;
	XmppJid* _tmp108_;
	XmppJid* _tmp109_;
	gboolean _tmp110_;
	DinoEntitiesMessage* _tmp111_;
	XmppJid* _tmp112_;
	XmppJid* _tmp113_;
	XmppJid* _tmp114_;
	gchar* _tmp115_;
	gchar* _tmp116_;
	XmppMessageArchiveManagementMessageFlag* _tmp117_;
	DinoEntitiesMessage* _tmp118_;
	XmppMessageArchiveManagementMessageFlag* _tmp119_;
	GDateTime* _tmp120_;
	GDateTime* _tmp121_;
	GDateTime* now;
	GDateTime* _tmp122_;
	GDateTime* _tmp123_;
	GDateTime* _tmp124_;
	GDateTime* _tmp125_;
	gboolean _tmp126_;
	DinoEntitiesMessage* _tmp127_;
	GDateTime* _tmp128_;
	GDateTime* _tmp129_;
	DinoEntitiesMessage* _tmp130_;
	GDateTime* _tmp131_;
	GDateTime* _tmp132_;
	GDateTime* _tmp133_;
	DinoEntitiesMessage* _tmp134_;
	GDateTime* _tmp135_;
	XmppXepDelayedDeliveryMessageFlag* delayed_message_flag;
	XmppXepDelayedDeliveryMessageFlag* _tmp136_;
	XmppXepDelayedDeliveryMessageFlag* _tmp137_;
	DinoEntitiesMessage* _tmp138_;
	XmppXepDelayedDeliveryMessageFlag* _tmp139_;
	GDateTime* _tmp140_;
	GDateTime* _tmp141_;
	gboolean _tmp142_;
	DinoEntitiesMessage* _tmp143_;
	GDateTime* _tmp144_;
	GDateTime* _tmp145_;
	DinoEntitiesMessage* _tmp146_;
	GDateTime* _tmp147_;
	GDateTime* _tmp148_;
	DinoEntitiesMessage* _tmp149_;
	GDateTime* _tmp150_;
	GDateTime* _tmp151_;
	DinoEntitiesMessage* _tmp152_;
	DinoEntitiesMessage* _tmp153_;
	GDateTime* _tmp154_;
	GDateTime* _tmp155_;
	DinoEntitiesMessage* _tmp156_;
	DinoEntitiesMessage* _tmp157_;
};

struct _DinoMessageProcessorDetermineMessageTypeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessor* self;
	DinoEntitiesAccount* account;
	XmppMessageStanza* message_stanza;
	DinoEntitiesMessage* message;
	DinoEntitiesMessageType result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	DinoEntitiesConversation* conversation;
	DinoStreamInteractor* _tmp4_;
	DinoModuleIdentity* _tmp5_;
	gpointer _tmp6_;
	DinoConversationManager* _tmp7_;
	XmppJid* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	XmppJid* _tmp12_;
	DinoEntitiesConversation* _tmp13_;
	DinoEntitiesConversation* _tmp14_;
	DinoEntitiesConversation* _tmp15_;
	DinoEntitiesConversation* _tmp16_;
	DinoEntitiesConversationType _tmp17_;
	DinoEntitiesConversationType _tmp18_;
	DinoEntitiesConversation* _tmp19_;
	DinoEntitiesConversationType _tmp20_;
	DinoEntitiesConversationType _tmp21_;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp22_;
	XmppXmppStream* _tmp23_;
	XmppXmppStream* _tmp24_;
	GeeSet* identities;
	XmppXmppStream* _tmp25_;
	XmppModuleIdentity* _tmp26_;
	gpointer _tmp27_;
	XmppXepServiceDiscoveryModule* _tmp28_;
	XmppXmppStream* _tmp29_;
	XmppJid* _tmp30_;
	XmppJid* _tmp31_;
	XmppJid* _tmp32_;
	XmppJid* _tmp33_;
	XmppJid* _tmp34_;
	GeeSet* _tmp35_;
	GeeSet* _tmp36_;
	GeeSet* _tmp37_;
	GeeIterator* _identity_it;
	GeeSet* _tmp38_;
	GeeIterator* _tmp39_;
	GeeIterator* _tmp40_;
	XmppXepServiceDiscoveryIdentity* identity;
	GeeIterator* _tmp41_;
	gpointer _tmp42_;
	XmppXepServiceDiscoveryIdentity* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
};

struct _Block21Data {
	int _ref_count_;
	DinoMessageProcessor* self;
	XmppXmppStream* stream;
	DinoEntitiesMessage* message;
	DinoEntitiesConversation* conversation;
};

struct _DinoMessageProcessorDeduplicateMessageListener {
	DinoMessageListener parent_instance;
	DinoMessageProcessorDeduplicateMessageListenerPrivate * priv;
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _DinoMessageProcessorDeduplicateMessageListenerClass {
	DinoMessageListenerClass parent_class;
};

struct _DinoMessageProcessorDeduplicateMessageListenerPrivate {
	DinoMessageProcessor* outer;
};

struct _DinoMessageProcessorDeduplicateMessageListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessorDeduplicateMessageListener* self;
	DinoEntitiesMessage* message;
	XmppMessageStanza* stanza;
	DinoEntitiesConversation* conversation;
	gboolean result;
	DinoMessageProcessor* _tmp0_;
};

struct _DinoMessageProcessorFilterMessageListener {
	DinoMessageListener parent_instance;
	DinoMessageProcessorFilterMessageListenerPrivate * priv;
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _DinoMessageProcessorFilterMessageListenerClass {
	DinoMessageListenerClass parent_class;
};

struct _DinoMessageProcessorFilterMessageListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessorFilterMessageListener* self;
	DinoEntitiesMessage* message;
	XmppMessageStanza* stanza;
	DinoEntitiesConversation* conversation;
	gboolean result;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GeeList* _tmp3_;
	GeeList* _tmp4_;
};

struct _DinoMessageProcessorStoreMessageListener {
	DinoMessageListener parent_instance;
	DinoMessageProcessorStoreMessageListenerPrivate * priv;
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _DinoMessageProcessorStoreMessageListenerClass {
	DinoMessageListenerClass parent_class;
};

struct _DinoMessageProcessorStoreMessageListenerPrivate {
	DinoMessageProcessor* outer;
	DinoStreamInteractor* stream_interactor;
};

struct _DinoMessageProcessorStoreMessageListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessorStoreMessageListener* self;
	DinoEntitiesMessage* message;
	XmppMessageStanza* stanza;
	DinoEntitiesConversation* conversation;
	gboolean result;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoMessageStorage* _tmp3_;
};

struct _DinoMessageProcessorMarkupListener {
	DinoMessageListener parent_instance;
	DinoMessageProcessorMarkupListenerPrivate * priv;
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _DinoMessageProcessorMarkupListenerClass {
	DinoMessageListenerClass parent_class;
};

struct _DinoMessageProcessorMarkupListenerPrivate {
	DinoStreamInteractor* stream_interactor;
};

struct _DinoMessageProcessorMarkupListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessorMarkupListener* self;
	DinoEntitiesMessage* message;
	XmppMessageStanza* stanza;
	DinoEntitiesConversation* conversation;
	gboolean result;
	GeeList* markups;
	GeeList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
};

struct _DinoMessageProcessorStoreContentItemListener {
	DinoMessageListener parent_instance;
	DinoMessageProcessorStoreContentItemListenerPrivate * priv;
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _DinoMessageProcessorStoreContentItemListenerClass {
	DinoMessageListenerClass parent_class;
};

struct _DinoMessageProcessorStoreContentItemListenerPrivate {
	DinoStreamInteractor* stream_interactor;
};

struct _DinoMessageProcessorStoreContentItemListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageProcessorStoreContentItemListener* self;
	DinoEntitiesMessage* message;
	XmppMessageStanza* stanza;
	DinoEntitiesConversation* conversation;
	gboolean result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	DinoStreamInteractor* _tmp2_;
	DinoModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	DinoContentItemStore* _tmp5_;
};

struct _DinoMessageListenerHolderRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoMessageListenerHolder* self;
	DinoEntitiesMessage* message;
	XmppMessageStanza* stanza;
	DinoEntitiesConversation* conversation;
	gboolean result;
	GeeArrayList* _ol_list;
	GeeArrayList* _tmp0_;
	gint _ol_size;
	GeeArrayList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _ol_index;
	gint _tmp4_;
	gint _tmp5_;
	XmppOrderedListener* ol;
	GeeArrayList* _tmp6_;
	gpointer _tmp7_;
	DinoMessageListener* l;
	XmppOrderedListener* _tmp8_;
	DinoMessageListener* _tmp9_;
	gboolean stop;
	DinoMessageListener* _tmp10_;
};

static gint DinoMessageProcessor_private_offset;
static gpointer dino_message_processor_parent_class = NULL;
DinoModuleIdentity* dino_message_processor_IDENTITY = NULL;
static gint DinoMessageProcessorDeduplicateMessageListener_private_offset;
static gpointer dino_message_processor_deduplicate_message_listener_parent_class = NULL;
static gpointer dino_message_processor_filter_message_listener_parent_class = NULL;
static gint DinoMessageProcessorStoreMessageListener_private_offset;
static gpointer dino_message_processor_store_message_listener_parent_class = NULL;
static gint DinoMessageProcessorMarkupListener_private_offset;
static gpointer dino_message_processor_markup_listener_parent_class = NULL;
static gint DinoMessageProcessorStoreContentItemListener_private_offset;
static gpointer dino_message_processor_store_content_item_listener_parent_class = NULL;
static DinoStreamInteractionModuleIface * dino_message_processor_dino_stream_interaction_module_parent_iface = NULL;
static gpointer dino_message_listener_parent_class = NULL;
static gpointer dino_message_listener_holder_parent_class = NULL;

static DinoMessageProcessor* dino_message_processor_new (DinoStreamInteractor* stream_interactor,
                                                  DinoDatabase* db);
static DinoMessageProcessor* dino_message_processor_construct (GType object_type,
                                                        DinoStreamInteractor* stream_interactor,
                                                        DinoDatabase* db);
static DinoMessageProcessorDeduplicateMessageListener* dino_message_processor_deduplicate_message_listener_new (DinoMessageProcessor* outer);
static DinoMessageProcessorDeduplicateMessageListener* dino_message_processor_deduplicate_message_listener_construct (GType object_type,
                                                                                                               DinoMessageProcessor* outer);
static GType dino_message_processor_deduplicate_message_listener_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static DinoMessageProcessorFilterMessageListener* dino_message_processor_filter_message_listener_new (void);
static DinoMessageProcessorFilterMessageListener* dino_message_processor_filter_message_listener_construct (GType object_type);
static GType dino_message_processor_filter_message_listener_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static DinoMessageProcessorStoreMessageListener* dino_message_processor_store_message_listener_new (DinoMessageProcessor* outer,
                                                                                             DinoStreamInteractor* stream_interactor);
static DinoMessageProcessorStoreMessageListener* dino_message_processor_store_message_listener_construct (GType object_type,
                                                                                                   DinoMessageProcessor* outer,
                                                                                                   DinoStreamInteractor* stream_interactor);
static GType dino_message_processor_store_message_listener_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static DinoMessageProcessorStoreContentItemListener* dino_message_processor_store_content_item_listener_new (DinoStreamInteractor* stream_interactor);
static DinoMessageProcessorStoreContentItemListener* dino_message_processor_store_content_item_listener_construct (GType object_type,
                                                                                                            DinoStreamInteractor* stream_interactor);
static GType dino_message_processor_store_content_item_listener_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static DinoMessageProcessorMarkupListener* dino_message_processor_markup_listener_new (DinoStreamInteractor* stream_interactor);
static DinoMessageProcessorMarkupListener* dino_message_processor_markup_listener_construct (GType object_type,
                                                                                      DinoStreamInteractor* stream_interactor);
static GType dino_message_processor_markup_listener_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void dino_message_processor_on_account_added (DinoMessageProcessor* self,
                                              DinoEntitiesAccount* account);
static void _dino_message_processor_on_account_added_dino_stream_interactor_account_added (DinoStreamInteractor* _sender,
                                                                                    DinoEntitiesAccount* account,
                                                                                    gpointer self);
static void dino_message_processor_send_unsent_chat_messages (DinoMessageProcessor* self,
                                                       DinoEntitiesAccount* account);
static void _dino_message_processor_send_unsent_chat_messages_dino_stream_interactor_stream_negotiated (DinoStreamInteractor* _sender,
                                                                                                 DinoEntitiesAccount* account,
                                                                                                 XmppXmppStream* stream,
                                                                                                 gpointer self);
static void _dino_message_processor_send_unsent_chat_messages_dino_stream_interactor_stream_resumed (DinoStreamInteractor* _sender,
                                                                                              DinoEntitiesAccount* account,
                                                                                              XmppXmppStream* stream,
                                                                                              gpointer self);
static void dino_message_processor_convert_sending_to_unsent_msgs (DinoMessageProcessor* self,
                                                            DinoEntitiesAccount* account);
static void dino_message_processor_send_unsent_messages (DinoMessageProcessor* self,
                                                  DinoEntitiesAccount* account,
                                                  QliteQueryBuilder* select);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
static void __lambda84_ (Block20Data* _data20_,
                  XmppXmppStream* stream,
                  XmppMessageStanza* message);
static void dino_message_processor_on_message_received (DinoMessageProcessor* self,
                                                 DinoEntitiesAccount* account,
                                                 XmppMessageStanza* message_stanza,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void dino_message_processor_on_message_received_finish (DinoMessageProcessor* self,
                                                        GAsyncResult* _res_);
static void ___lambda84__xmpp_message_module_received_message (XmppMessageModule* _sender,
                                                        XmppXmppStream* stream,
                                                        XmppMessageStanza* message,
                                                        gpointer self);
static void __lambda85_ (Block20Data* _data20_,
                  XmppXmppStream* stream,
                  XmppMessageStanza* message_stanza,
                  XmppErrorStanza* error_stanza);
static gboolean _vala_dino_entities_message_marked_array_contains (DinoEntitiesMessageMarked * stack,
                                                            gssize stack_length,
                                                            const DinoEntitiesMessageMarked needle);
static void ___lambda85__xmpp_message_module_received_error (XmppMessageModule* _sender,
                                                      XmppXmppStream* stream,
                                                      XmppMessageStanza* message,
                                                      XmppErrorStanza* _error_,
                                                      gpointer self);
static void dino_message_processor_on_message_received_data_free (gpointer _data);
static gboolean dino_message_processor_on_message_received_co (DinoMessageProcessorOnMessageReceivedData* _data_);
static void dino_message_processor_run_pipeline_announce_data_free (gpointer _data);
static gboolean dino_message_processor_run_pipeline_announce_co (DinoMessageProcessorRunPipelineAnnounceData* _data_);
static void dino_message_processor_run_pipeline_announce_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void dino_message_processor_parse_message_stanza_data_free (gpointer _data);
static gboolean dino_message_processor_parse_message_stanza_co (DinoMessageProcessorParseMessageStanzaData* _data_);
static void dino_message_processor_parse_message_stanza_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void dino_message_processor_determine_message_type (DinoMessageProcessor* self,
                                                    DinoEntitiesAccount* account,
                                                    XmppMessageStanza* message_stanza,
                                                    DinoEntitiesMessage* message,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static DinoEntitiesMessageType dino_message_processor_determine_message_type_finish (DinoMessageProcessor* self,
                                                                              GAsyncResult* _res_);
static void dino_message_processor_determine_message_type_data_free (gpointer _data);
static gboolean dino_message_processor_determine_message_type_co (DinoMessageProcessorDetermineMessageTypeData* _data_);
static void dino_message_processor_determine_message_type_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static gboolean dino_message_processor_is_duplicate (DinoMessageProcessor* self,
                                              DinoEntitiesMessage* message,
                                              XmppMessageStanza* stanza,
                                              DinoEntitiesConversation* conversation);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
static void __lambda86_ (Block21Data* _data21_,
                  GObject* _,
                  GAsyncResult* res);
static gboolean ____lambda87_ (Block21Data* _data21_);
static gboolean _____lambda87__gsource_func (gpointer self);
static void ___lambda86__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
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 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_OBJECT (GClosure * closure,
                                                         GValue * return_value,
                                                         guint n_param_values,
                                                         const GValue * param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
static void dino_message_processor_deduplicate_message_listener_real_run_data_free (gpointer _data);
static void dino_message_processor_deduplicate_message_listener_real_run (DinoMessageListener* base,
                                                                   DinoEntitiesMessage* message,
                                                                   XmppMessageStanza* stanza,
                                                                   DinoEntitiesConversation* conversation,
                                                                   GAsyncReadyCallback _callback_,
                                                                   gpointer _user_data_);
static gboolean dino_message_processor_deduplicate_message_listener_real_run_co (DinoMessageProcessorDeduplicateMessageListenerRunData* _data_);
static void dino_message_processor_deduplicate_message_listener_finalize (GObject * obj);
static GType dino_message_processor_deduplicate_message_listener_get_type_once (void);
static void _vala_dino_message_processor_deduplicate_message_listener_get_property (GObject * object,
                                                                             guint property_id,
                                                                             GValue * value,
                                                                             GParamSpec * pspec);
static void dino_message_processor_filter_message_listener_real_run_data_free (gpointer _data);
static void dino_message_processor_filter_message_listener_real_run (DinoMessageListener* base,
                                                              DinoEntitiesMessage* message,
                                                              XmppMessageStanza* stanza,
                                                              DinoEntitiesConversation* conversation,
                                                              GAsyncReadyCallback _callback_,
                                                              gpointer _user_data_);
static gboolean dino_message_processor_filter_message_listener_real_run_co (DinoMessageProcessorFilterMessageListenerRunData* _data_);
static void dino_message_processor_filter_message_listener_finalize (GObject * obj);
static GType dino_message_processor_filter_message_listener_get_type_once (void);
static void _vala_dino_message_processor_filter_message_listener_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec);
static void dino_message_processor_store_message_listener_real_run_data_free (gpointer _data);
static void dino_message_processor_store_message_listener_real_run (DinoMessageListener* base,
                                                             DinoEntitiesMessage* message,
                                                             XmppMessageStanza* stanza,
                                                             DinoEntitiesConversation* conversation,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
static gboolean dino_message_processor_store_message_listener_real_run_co (DinoMessageProcessorStoreMessageListenerRunData* _data_);
static void dino_message_processor_store_message_listener_finalize (GObject * obj);
static GType dino_message_processor_store_message_listener_get_type_once (void);
static void _vala_dino_message_processor_store_message_listener_get_property (GObject * object,
                                                                       guint property_id,
                                                                       GValue * value,
                                                                       GParamSpec * pspec);
static void dino_message_processor_markup_listener_real_run_data_free (gpointer _data);
static void dino_message_processor_markup_listener_real_run (DinoMessageListener* base,
                                                      DinoEntitiesMessage* message,
                                                      XmppMessageStanza* stanza,
                                                      DinoEntitiesConversation* conversation,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static gboolean dino_message_processor_markup_listener_real_run_co (DinoMessageProcessorMarkupListenerRunData* _data_);
static void dino_message_processor_markup_listener_finalize (GObject * obj);
static GType dino_message_processor_markup_listener_get_type_once (void);
static void _vala_dino_message_processor_markup_listener_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
static void dino_message_processor_store_content_item_listener_real_run_data_free (gpointer _data);
static void dino_message_processor_store_content_item_listener_real_run (DinoMessageListener* base,
                                                                  DinoEntitiesMessage* message,
                                                                  XmppMessageStanza* stanza,
                                                                  DinoEntitiesConversation* conversation,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_);
static gboolean dino_message_processor_store_content_item_listener_real_run_co (DinoMessageProcessorStoreContentItemListenerRunData* _data_);
static void dino_message_processor_store_content_item_listener_finalize (GObject * obj);
static GType dino_message_processor_store_content_item_listener_get_type_once (void);
static void _vala_dino_message_processor_store_content_item_listener_get_property (GObject * object,
                                                                            guint property_id,
                                                                            GValue * value,
                                                                            GParamSpec * pspec);
static void dino_message_processor_finalize (GObject * obj);
static GType dino_message_processor_get_type_once (void);
static void _vala_dino_message_processor_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static GType dino_message_listener_get_type_once (void);
static void dino_message_listener_holder_run_data_free (gpointer _data);
static gboolean dino_message_listener_holder_run_co (DinoMessageListenerHolderRunData* _data_);
static void dino_message_listener_holder_run_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static GType dino_message_listener_holder_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_message_processor_get_instance_private (DinoMessageProcessor* self)
{
	return G_STRUCT_MEMBER_P (self, DinoMessageProcessor_private_offset);
}

void
dino_message_processor_start (DinoStreamInteractor* stream_interactor,
                              DinoDatabase* db)
{
	DinoMessageProcessor* m = NULL;
	DinoMessageProcessor* _tmp0_;
	g_return_if_fail (stream_interactor != NULL);
	g_return_if_fail (db != NULL);
	_tmp0_ = dino_message_processor_new (stream_interactor, db);
	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 gpointer
_qlite_database_ref0 (gpointer self)
{
	return self ? qlite_database_ref (self) : NULL;
}

static void
_dino_message_processor_on_account_added_dino_stream_interactor_account_added (DinoStreamInteractor* _sender,
                                                                               DinoEntitiesAccount* account,
                                                                               gpointer self)
{
	dino_message_processor_on_account_added ((DinoMessageProcessor*) self, account);
}

static void
_dino_message_processor_send_unsent_chat_messages_dino_stream_interactor_stream_negotiated (DinoStreamInteractor* _sender,
                                                                                            DinoEntitiesAccount* account,
                                                                                            XmppXmppStream* stream,
                                                                                            gpointer self)
{
	dino_message_processor_send_unsent_chat_messages ((DinoMessageProcessor*) self, account);
}

static void
_dino_message_processor_send_unsent_chat_messages_dino_stream_interactor_stream_resumed (DinoStreamInteractor* _sender,
                                                                                         DinoEntitiesAccount* account,
                                                                                         XmppXmppStream* stream,
                                                                                         gpointer self)
{
	dino_message_processor_send_unsent_chat_messages ((DinoMessageProcessor*) self, account);
}

static DinoMessageProcessor*
dino_message_processor_construct (GType object_type,
                                  DinoStreamInteractor* stream_interactor,
                                  DinoDatabase* db)
{
	DinoMessageProcessor * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoDatabase* _tmp1_;
	DinoHistorySync* _tmp2_;
	DinoMessageListenerHolder* _tmp3_;
	DinoMessageProcessorDeduplicateMessageListener* _tmp4_;
	DinoMessageProcessorDeduplicateMessageListener* _tmp5_;
	DinoMessageListenerHolder* _tmp6_;
	DinoMessageProcessorFilterMessageListener* _tmp7_;
	DinoMessageProcessorFilterMessageListener* _tmp8_;
	DinoMessageListenerHolder* _tmp9_;
	DinoMessageProcessorStoreMessageListener* _tmp10_;
	DinoMessageProcessorStoreMessageListener* _tmp11_;
	DinoMessageListenerHolder* _tmp12_;
	DinoMessageProcessorStoreContentItemListener* _tmp13_;
	DinoMessageProcessorStoreContentItemListener* _tmp14_;
	DinoMessageListenerHolder* _tmp15_;
	DinoMessageProcessorMarkupListener* _tmp16_;
	DinoMessageProcessorMarkupListener* _tmp17_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (db != NULL, NULL);
	self = (DinoMessageProcessor*) 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_ = _qlite_database_ref0 (db);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp1_;
	_tmp2_ = dino_history_sync_new (db, stream_interactor);
	_dino_history_sync_unref0 (self->history_sync);
	self->history_sync = _tmp2_;
	_tmp3_ = self->received_pipeline;
	_tmp4_ = dino_message_processor_deduplicate_message_listener_new (self);
	_tmp5_ = _tmp4_;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp3_, (XmppOrderedListener*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = self->received_pipeline;
	_tmp7_ = dino_message_processor_filter_message_listener_new ();
	_tmp8_ = _tmp7_;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp6_, (XmppOrderedListener*) _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = self->received_pipeline;
	_tmp10_ = dino_message_processor_store_message_listener_new (self, stream_interactor);
	_tmp11_ = _tmp10_;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp9_, (XmppOrderedListener*) _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = self->received_pipeline;
	_tmp13_ = dino_message_processor_store_content_item_listener_new (stream_interactor);
	_tmp14_ = _tmp13_;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp12_, (XmppOrderedListener*) _tmp14_);
	_g_object_unref0 (_tmp14_);
	_tmp15_ = self->received_pipeline;
	_tmp16_ = dino_message_processor_markup_listener_new (stream_interactor);
	_tmp17_ = _tmp16_;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp15_, (XmppOrderedListener*) _tmp17_);
	_g_object_unref0 (_tmp17_);
	g_signal_connect_object (stream_interactor, "account-added", (GCallback) _dino_message_processor_on_account_added_dino_stream_interactor_account_added, self, 0);
	g_signal_connect_object (stream_interactor, "stream-negotiated", (GCallback) _dino_message_processor_send_unsent_chat_messages_dino_stream_interactor_stream_negotiated, self, 0);
	g_signal_connect_object (stream_interactor, "stream-resumed", (GCallback) _dino_message_processor_send_unsent_chat_messages_dino_stream_interactor_stream_resumed, self, 0);
	return self;
}

static DinoMessageProcessor*
dino_message_processor_new (DinoStreamInteractor* stream_interactor,
                            DinoDatabase* db)
{
	return dino_message_processor_construct (DINO_TYPE_MESSAGE_PROCESSOR, stream_interactor, db);
}

static void
dino_message_processor_convert_sending_to_unsent_msgs (DinoMessageProcessor* self,
                                                       DinoEntitiesAccount* account)
{
	DinoDatabase* _tmp0_;
	DinoDatabaseMessageTable* _tmp1_;
	DinoDatabaseMessageTable* _tmp2_;
	QliteUpdateBuilder* _tmp3_;
	QliteUpdateBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseMessageTable* _tmp6_;
	DinoDatabaseMessageTable* _tmp7_;
	QliteColumn* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	QliteUpdateBuilder* _tmp11_;
	QliteUpdateBuilder* _tmp12_;
	DinoDatabase* _tmp13_;
	DinoDatabaseMessageTable* _tmp14_;
	DinoDatabaseMessageTable* _tmp15_;
	QliteColumn* _tmp16_;
	QliteUpdateBuilder* _tmp17_;
	QliteUpdateBuilder* _tmp18_;
	DinoDatabase* _tmp19_;
	DinoDatabaseMessageTable* _tmp20_;
	DinoDatabaseMessageTable* _tmp21_;
	QliteColumn* _tmp22_;
	QliteUpdateBuilder* _tmp23_;
	QliteUpdateBuilder* _tmp24_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_tmp0_ = self->priv->db;
	_tmp1_ = dino_database_get_message (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_update ((QliteTable*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->db;
	_tmp6_ = dino_database_get_message (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->account_id;
	_tmp9_ = dino_entities_account_get_id (account);
	_tmp10_ = _tmp9_;
	_tmp11_ = qlite_update_builder_with (_tmp4_, G_TYPE_INT, NULL, NULL, _tmp8_, "=", (gpointer) ((gintptr) _tmp10_));
	_tmp12_ = _tmp11_;
	_tmp13_ = self->priv->db;
	_tmp14_ = dino_database_get_message (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_->marked;
	_tmp17_ = qlite_update_builder_with (_tmp12_, G_TYPE_INT, NULL, NULL, _tmp16_, "=", (gpointer) ((gintptr) DINO_ENTITIES_MESSAGE_MARKED_SENDING));
	_tmp18_ = _tmp17_;
	_tmp19_ = self->priv->db;
	_tmp20_ = dino_database_get_message (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = _tmp21_->marked;
	_tmp23_ = qlite_update_builder_set (_tmp18_, G_TYPE_INT, NULL, NULL, _tmp22_, (gpointer) ((gintptr) DINO_ENTITIES_MESSAGE_MARKED_UNSENT));
	_tmp24_ = _tmp23_;
	qlite_update_builder_perform (_tmp24_);
	_qlite_statement_builder_unref0 (_tmp24_);
	_qlite_statement_builder_unref0 (_tmp18_);
	_qlite_statement_builder_unref0 (_tmp12_);
	_qlite_statement_builder_unref0 (_tmp4_);
}

static void
dino_message_processor_send_unsent_chat_messages (DinoMessageProcessor* self,
                                                  DinoEntitiesAccount* account)
{
	QliteQueryBuilder* select = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseMessageTable* _tmp1_;
	DinoDatabaseMessageTable* _tmp2_;
	QliteQueryBuilder* _tmp3_;
	QliteQueryBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseMessageTable* _tmp6_;
	DinoDatabaseMessageTable* _tmp7_;
	QliteColumn* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	QliteQueryBuilder* _tmp11_;
	QliteQueryBuilder* _tmp12_;
	DinoDatabase* _tmp13_;
	DinoDatabaseMessageTable* _tmp14_;
	DinoDatabaseMessageTable* _tmp15_;
	QliteColumn* _tmp16_;
	QliteQueryBuilder* _tmp17_;
	QliteQueryBuilder* _tmp18_;
	DinoDatabase* _tmp19_;
	DinoDatabaseMessageTable* _tmp20_;
	DinoDatabaseMessageTable* _tmp21_;
	QliteColumn* _tmp22_;
	QliteQueryBuilder* _tmp23_;
	QliteQueryBuilder* _tmp24_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_tmp0_ = self->priv->db;
	_tmp1_ = dino_database_get_message (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_select ((QliteTable*) _tmp2_, NULL, (gint) 0);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->db;
	_tmp6_ = dino_database_get_message (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->account_id;
	_tmp9_ = dino_entities_account_get_id (account);
	_tmp10_ = _tmp9_;
	_tmp11_ = qlite_query_builder_with (_tmp4_, G_TYPE_INT, NULL, NULL, _tmp8_, "=", (gpointer) ((gintptr) _tmp10_));
	_tmp12_ = _tmp11_;
	_tmp13_ = self->priv->db;
	_tmp14_ = dino_database_get_message (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_->marked;
	_tmp17_ = qlite_query_builder_with (_tmp12_, G_TYPE_INT, NULL, NULL, _tmp16_, "=", (gpointer) ((gintptr) DINO_ENTITIES_MESSAGE_MARKED_UNSENT));
	_tmp18_ = _tmp17_;
	_tmp19_ = self->priv->db;
	_tmp20_ = dino_database_get_message (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = _tmp21_->type_;
	_tmp23_ = qlite_query_builder_with (_tmp18_, G_TYPE_INT, NULL, NULL, _tmp22_, "=", (gpointer) ((gintptr) DINO_ENTITIES_MESSAGE_TYPE_CHAT));
	_tmp24_ = _tmp23_;
	_qlite_statement_builder_unref0 (_tmp18_);
	_qlite_statement_builder_unref0 (_tmp12_);
	_qlite_statement_builder_unref0 (_tmp4_);
	select = _tmp24_;
	dino_message_processor_send_unsent_messages (self, account, select);
	_qlite_statement_builder_unref0 (select);
}

void
dino_message_processor_send_unsent_muc_messages (DinoMessageProcessor* self,
                                                 DinoEntitiesAccount* account,
                                                 XmppJid* muc_jid)
{
	QliteQueryBuilder* select = NULL;
	DinoDatabase* _tmp0_;
	DinoDatabaseMessageTable* _tmp1_;
	DinoDatabaseMessageTable* _tmp2_;
	QliteQueryBuilder* _tmp3_;
	QliteQueryBuilder* _tmp4_;
	DinoDatabase* _tmp5_;
	DinoDatabaseMessageTable* _tmp6_;
	DinoDatabaseMessageTable* _tmp7_;
	QliteColumn* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	QliteQueryBuilder* _tmp11_;
	QliteQueryBuilder* _tmp12_;
	DinoDatabase* _tmp13_;
	DinoDatabaseMessageTable* _tmp14_;
	DinoDatabaseMessageTable* _tmp15_;
	QliteColumn* _tmp16_;
	QliteQueryBuilder* _tmp17_;
	QliteQueryBuilder* _tmp18_;
	DinoDatabase* _tmp19_;
	DinoDatabaseMessageTable* _tmp20_;
	DinoDatabaseMessageTable* _tmp21_;
	QliteColumn* _tmp22_;
	DinoDatabase* _tmp23_;
	QliteQueryBuilder* _tmp24_;
	QliteQueryBuilder* _tmp25_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (muc_jid != NULL);
	_tmp0_ = self->priv->db;
	_tmp1_ = dino_database_get_message (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = qlite_table_select ((QliteTable*) _tmp2_, NULL, (gint) 0);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->db;
	_tmp6_ = dino_database_get_message (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->account_id;
	_tmp9_ = dino_entities_account_get_id (account);
	_tmp10_ = _tmp9_;
	_tmp11_ = qlite_query_builder_with (_tmp4_, G_TYPE_INT, NULL, NULL, _tmp8_, "=", (gpointer) ((gintptr) _tmp10_));
	_tmp12_ = _tmp11_;
	_tmp13_ = self->priv->db;
	_tmp14_ = dino_database_get_message (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_->marked;
	_tmp17_ = qlite_query_builder_with (_tmp12_, G_TYPE_INT, NULL, NULL, _tmp16_, "=", (gpointer) ((gintptr) DINO_ENTITIES_MESSAGE_MARKED_UNSENT));
	_tmp18_ = _tmp17_;
	_tmp19_ = self->priv->db;
	_tmp20_ = dino_database_get_message (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = _tmp21_->counterpart_id;
	_tmp23_ = self->priv->db;
	_tmp24_ = qlite_query_builder_with (_tmp18_, G_TYPE_INT, NULL, NULL, _tmp22_, "=", (gpointer) ((gintptr) dino_database_get_jid_id (_tmp23_, muc_jid)));
	_tmp25_ = _tmp24_;
	_qlite_statement_builder_unref0 (_tmp18_);
	_qlite_statement_builder_unref0 (_tmp12_);
	_qlite_statement_builder_unref0 (_tmp4_);
	select = _tmp25_;
	dino_message_processor_send_unsent_messages (self, account, select);
	_qlite_statement_builder_unref0 (select);
}

static void
dino_message_processor_send_unsent_messages (DinoMessageProcessor* self,
                                             DinoEntitiesAccount* account,
                                             QliteQueryBuilder* select)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (select != NULL);
	{
		QliteRowIterator* _row_it = NULL;
		QliteRowIterator* _tmp0_;
		_tmp0_ = qlite_query_builder_iterator (select);
		_row_it = _tmp0_;
		while (TRUE) {
			QliteRowIterator* _tmp1_;
			QliteRow* row = NULL;
			QliteRowIterator* _tmp2_;
			QliteRow* _tmp3_;
			_tmp1_ = _row_it;
			if (!qlite_row_iterator_next (_tmp1_)) {
				break;
			}
			_tmp2_ = _row_it;
			_tmp3_ = qlite_row_iterator_get (_tmp2_);
			row = _tmp3_;
			{
				DinoEntitiesMessage* message = NULL;
				DinoDatabase* _tmp4_;
				QliteRow* _tmp5_;
				DinoEntitiesMessage* _tmp6_;
				DinoEntitiesConversation* msg_conv = NULL;
				DinoStreamInteractor* _tmp7_;
				DinoModuleIdentity* _tmp8_;
				gpointer _tmp9_;
				DinoConversationManager* _tmp10_;
				DinoEntitiesMessage* _tmp11_;
				XmppJid* _tmp12_;
				XmppJid* _tmp13_;
				DinoEntitiesMessage* _tmp14_;
				DinoEntitiesConversationType _tmp15_;
				DinoEntitiesConversation* _tmp16_;
				DinoEntitiesConversation* _tmp17_;
				DinoEntitiesConversation* _tmp18_;
				_tmp4_ = self->priv->db;
				_tmp5_ = row;
				_tmp6_ = dino_entities_message_new_from_row (_tmp4_, _tmp5_, &_inner_error0_);
				message = _tmp6_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
						goto __catch0_xmpp_invalid_jid_error;
					}
					_qlite_row_unref0 (row);
					_qlite_row_iterator_unref0 (_row_it);
					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
				_tmp7_ = self->priv->stream_interactor;
				_tmp8_ = dino_conversation_manager_IDENTITY;
				_tmp9_ = dino_stream_interactor_get_module (_tmp7_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp8_);
				_tmp10_ = (DinoConversationManager*) _tmp9_;
				_tmp11_ = message;
				_tmp12_ = dino_entities_message_get_counterpart (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = message;
				_tmp15_ = dino_util_get_conversation_type_for_message (_tmp14_);
				_tmp16_ = dino_conversation_manager_get_conversation (_tmp10_, _tmp13_, account, &_tmp15_);
				_tmp17_ = _tmp16_;
				_g_object_unref0 (_tmp10_);
				msg_conv = _tmp17_;
				_tmp18_ = msg_conv;
				if (_tmp18_ != NULL) {
					DinoEntitiesMessage* cached_msg = NULL;
					DinoStreamInteractor* _tmp19_;
					DinoModuleIdentity* _tmp20_;
					gpointer _tmp21_;
					DinoMessageStorage* _tmp22_;
					DinoEntitiesMessage* _tmp23_;
					gint _tmp24_;
					gint _tmp25_;
					DinoEntitiesConversation* _tmp26_;
					DinoEntitiesMessage* _tmp27_;
					DinoEntitiesMessage* _tmp28_;
					DinoEntitiesMessage* _tmp29_ = NULL;
					DinoEntitiesMessage* _tmp30_;
					DinoEntitiesConversation* _tmp32_;
					_tmp19_ = self->priv->stream_interactor;
					_tmp20_ = dino_message_storage_IDENTITY;
					_tmp21_ = dino_stream_interactor_get_module (_tmp19_, DINO_TYPE_MESSAGE_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp20_);
					_tmp22_ = (DinoMessageStorage*) _tmp21_;
					_tmp23_ = message;
					_tmp24_ = dino_entities_message_get_id (_tmp23_);
					_tmp25_ = _tmp24_;
					_tmp26_ = msg_conv;
					_tmp27_ = dino_message_storage_get_message_by_id (_tmp22_, _tmp25_, _tmp26_);
					_tmp28_ = _tmp27_;
					_g_object_unref0 (_tmp22_);
					cached_msg = _tmp28_;
					_tmp30_ = cached_msg;
					_tmp29_ = _tmp30_;
					if (_tmp29_ == NULL) {
						DinoEntitiesMessage* _tmp31_;
						_tmp31_ = message;
						_tmp29_ = _tmp31_;
					}
					_tmp32_ = msg_conv;
					dino_message_processor_send_xmpp_message (self, _tmp29_, _tmp32_, TRUE);
					_g_object_unref0 (cached_msg);
				}
				_g_object_unref0 (msg_conv);
				_g_object_unref0 (message);
			}
			goto __finally0;
			__catch0_xmpp_invalid_jid_error:
			{
				GError* e = NULL;
				GError* _tmp33_;
				const gchar* _tmp34_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp33_ = e;
				_tmp34_ = _tmp33_->message;
				g_warning ("message_processor.vala:83: Ignoring message with invalid Jid: %s", _tmp34_);
				_g_error_free0 (e);
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_qlite_row_unref0 (row);
				_qlite_row_iterator_unref0 (_row_it);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
			_qlite_row_unref0 (row);
		}
		_qlite_row_iterator_unref0 (_row_it);
	}
}

static Block20Data*
block20_data_ref (Block20Data* _data20_)
{
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}

static void
block20_data_unref (void * _userdata_)
{
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		DinoMessageProcessor* self;
		self = _data20_->self;
		_g_object_unref0 (_data20_->account);
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}

static void
__lambda84_ (Block20Data* _data20_,
             XmppXmppStream* stream,
             XmppMessageStanza* message)
{
	DinoMessageProcessor* self;
	self = _data20_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (message != NULL);
	dino_message_processor_on_message_received (self, _data20_->account, message, NULL, NULL);
}

static void
___lambda84__xmpp_message_module_received_message (XmppMessageModule* _sender,
                                                   XmppXmppStream* stream,
                                                   XmppMessageStanza* message,
                                                   gpointer self)
{
	__lambda84_ (self, stream, message);
}

static gboolean
_vala_dino_entities_message_marked_array_contains (DinoEntitiesMessageMarked * stack,
                                                   gssize stack_length,
                                                   const DinoEntitiesMessageMarked needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (needle == stack[i]) {
			return TRUE;
		}
	}
	return FALSE;
}

static void
__lambda85_ (Block20Data* _data20_,
             XmppXmppStream* stream,
             XmppMessageStanza* message_stanza,
             XmppErrorStanza* error_stanza)
{
	DinoMessageProcessor* self;
	DinoEntitiesMessage* message = NULL;
	GeeList* conversations = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoConversationManager* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	GeeList* _tmp7_;
	GeeList* _tmp8_;
	DinoEntitiesMessage* _tmp26_;
	DinoEntitiesMessage* _tmp27_;
	DinoEntitiesMessageMarked _tmp28_;
	DinoEntitiesMessageMarked _tmp29_;
	DinoEntitiesMessageMarked* _tmp30_;
	gint _tmp30__length1;
	const gchar* _tmp31_ = NULL;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_ = NULL;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	XmppJid* _tmp37_;
	XmppJid* _tmp38_;
	XmppJid* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	gboolean _tmp44_ = FALSE;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	DinoEntitiesMessage* _tmp49_;
	self = _data20_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (message_stanza != NULL);
	g_return_if_fail (error_stanza != NULL);
	message = NULL;
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_conversation_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoConversationManager*) _tmp2_;
	_tmp4_ = xmpp_stanza_get_from ((XmppStanza*) message_stanza);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = dino_conversation_manager_get_conversations (_tmp3_, _tmp6_, _data20_->account);
	_tmp8_ = _tmp7_;
	_xmpp_jid_unref0 (_tmp6_);
	_g_object_unref0 (_tmp3_);
	conversations = _tmp8_;
	{
		GeeList* _conversation_list = NULL;
		GeeList* _tmp9_;
		gint _conversation_size = 0;
		GeeList* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		gint _conversation_index = 0;
		_tmp9_ = conversations;
		_conversation_list = _tmp9_;
		_tmp10_ = _conversation_list;
		_tmp11_ = gee_collection_get_size ((GeeCollection*) _tmp10_);
		_tmp12_ = _tmp11_;
		_conversation_size = _tmp12_;
		_conversation_index = -1;
		while (TRUE) {
			gint _tmp13_;
			gint _tmp14_;
			DinoEntitiesConversation* conversation = NULL;
			GeeList* _tmp15_;
			gpointer _tmp16_;
			DinoStreamInteractor* _tmp17_;
			DinoModuleIdentity* _tmp18_;
			gpointer _tmp19_;
			DinoMessageStorage* _tmp20_;
			const gchar* _tmp21_;
			const gchar* _tmp22_;
			DinoEntitiesConversation* _tmp23_;
			DinoEntitiesMessage* _tmp24_;
			DinoEntitiesMessage* _tmp25_;
			_conversation_index = _conversation_index + 1;
			_tmp13_ = _conversation_index;
			_tmp14_ = _conversation_size;
			if (!(_tmp13_ < _tmp14_)) {
				break;
			}
			_tmp15_ = _conversation_list;
			_tmp16_ = gee_list_get (_tmp15_, _conversation_index);
			conversation = (DinoEntitiesConversation*) _tmp16_;
			_tmp17_ = self->priv->stream_interactor;
			_tmp18_ = dino_message_storage_IDENTITY;
			_tmp19_ = dino_stream_interactor_get_module (_tmp17_, DINO_TYPE_MESSAGE_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp18_);
			_tmp20_ = (DinoMessageStorage*) _tmp19_;
			_tmp21_ = xmpp_stanza_get_id ((XmppStanza*) message_stanza);
			_tmp22_ = _tmp21_;
			_tmp23_ = conversation;
			_tmp24_ = dino_message_storage_get_message_by_stanza_id (_tmp20_, _tmp22_, _tmp23_);
			_g_object_unref0 (message);
			message = _tmp24_;
			_g_object_unref0 (_tmp20_);
			_tmp25_ = message;
			if (_tmp25_ != NULL) {
				_g_object_unref0 (conversation);
				break;
			}
			_g_object_unref0 (conversation);
		}
	}
	_tmp26_ = message;
	if (_tmp26_ == NULL) {
		_g_object_unref0 (conversations);
		_g_object_unref0 (message);
		return;
	}
	_tmp27_ = message;
	_tmp28_ = dino_entities_message_get_marked (_tmp27_);
	_tmp29_ = _tmp28_;
	_tmp30_ = dino_entities_message_MARKED_RECEIVED;
	_tmp30__length1 = dino_entities_message_MARKED_RECEIVED_length1;
	if (_vala_dino_entities_message_marked_array_contains (_tmp30_, _tmp30__length1, _tmp29_)) {
		_g_object_unref0 (conversations);
		_g_object_unref0 (message);
		return;
	}
	_tmp32_ = xmpp_error_stanza_get_type_ (error_stanza);
	_tmp33_ = _tmp32_;
	_tmp31_ = _tmp33_;
	if (_tmp31_ == NULL) {
		_tmp31_ = "-";
	}
	_tmp35_ = xmpp_error_stanza_get_text (error_stanza);
	_tmp36_ = _tmp35_;
	_tmp34_ = _tmp36_;
	if (_tmp34_ == NULL) {
		_tmp34_ = "-";
	}
	_tmp37_ = xmpp_stanza_get_from ((XmppStanza*) message_stanza);
	_tmp38_ = _tmp37_;
	_tmp39_ = _tmp38_;
	_tmp40_ = xmpp_jid_to_string (_tmp39_);
	_tmp41_ = _tmp40_;
	_tmp42_ = xmpp_error_stanza_get_condition (error_stanza);
	_tmp43_ = _tmp42_;
	g_warning ("message_processor.vala:105: Message delivery error from %s. Type: %s, " \
"Condition: %s, Text: %s", _tmp41_, _tmp31_, _tmp43_, _tmp34_);
	_g_free0 (_tmp41_);
	_xmpp_jid_unref0 (_tmp39_);
	_tmp45_ = xmpp_error_stanza_get_condition (error_stanza);
	_tmp46_ = _tmp45_;
	if (g_strcmp0 (_tmp46_, XMPP_ERROR_STANZA_CONDITION_RECIPIENT_UNAVAILABLE) == 0) {
		const gchar* _tmp47_;
		const gchar* _tmp48_;
		_tmp47_ = xmpp_error_stanza_get_type_ (error_stanza);
		_tmp48_ = _tmp47_;
		_tmp44_ = g_strcmp0 (_tmp48_, XMPP_ERROR_STANZA_TYPE_CANCEL) == 0;
	} else {
		_tmp44_ = FALSE;
	}
	if (_tmp44_) {
		_g_object_unref0 (conversations);
		_g_object_unref0 (message);
		return;
	}
	_tmp49_ = message;
	dino_entities_message_set_marked (_tmp49_, DINO_ENTITIES_MESSAGE_MARKED_ERROR);
	_g_object_unref0 (conversations);
	_g_object_unref0 (message);
}

static void
___lambda85__xmpp_message_module_received_error (XmppMessageModule* _sender,
                                                 XmppXmppStream* stream,
                                                 XmppMessageStanza* message,
                                                 XmppErrorStanza* _error_,
                                                 gpointer self)
{
	__lambda85_ (self, stream, message, _error_);
}

static void
dino_message_processor_on_account_added (DinoMessageProcessor* self,
                                         DinoEntitiesAccount* account)
{
	Block20Data* _data20_;
	DinoEntitiesAccount* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoModuleManager* _tmp2_;
	XmppModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppMessageModule* _tmp5_;
	DinoStreamInteractor* _tmp6_;
	DinoModuleManager* _tmp7_;
	XmppModuleIdentity* _tmp8_;
	gpointer _tmp9_;
	XmppMessageModule* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	_data20_ = g_slice_new0 (Block20Data);
	_data20_->_ref_count_ = 1;
	_data20_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data20_->account);
	_data20_->account = _tmp0_;
	_tmp1_ = self->priv->stream_interactor;
	_tmp2_ = _tmp1_->module_manager;
	_tmp3_ = xmpp_message_module_IDENTITY;
	_tmp4_ = dino_module_manager_get_module (_tmp2_, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data20_->account, _tmp3_);
	_tmp5_ = (XmppMessageModule*) _tmp4_;
	g_signal_connect_data (_tmp5_, "received-message", (GCallback) ___lambda84__xmpp_message_module_received_message, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = self->priv->stream_interactor;
	_tmp7_ = _tmp6_->module_manager;
	_tmp8_ = xmpp_message_module_IDENTITY;
	_tmp9_ = dino_module_manager_get_module (_tmp7_, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data20_->account, _tmp8_);
	_tmp10_ = (XmppMessageModule*) _tmp9_;
	g_signal_connect_data (_tmp10_, "received-error", (GCallback) ___lambda85__xmpp_message_module_received_error, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
	_g_object_unref0 (_tmp10_);
	dino_message_processor_convert_sending_to_unsent_msgs (self, _data20_->account);
	block20_data_unref (_data20_);
	_data20_ = NULL;
}

static void
dino_message_processor_on_message_received_data_free (gpointer _data)
{
	DinoMessageProcessorOnMessageReceivedData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->message_stanza);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMessageProcessorOnMessageReceivedData, _data_);
}

static void
dino_message_processor_on_message_received (DinoMessageProcessor* self,
                                            DinoEntitiesAccount* account,
                                            XmppMessageStanza* message_stanza,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	DinoMessageProcessorOnMessageReceivedData* _data_;
	DinoMessageProcessor* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppMessageStanza* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (message_stanza != NULL);
	_data_ = g_slice_new0 (DinoMessageProcessorOnMessageReceivedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_message_processor_on_message_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_ = _g_object_ref0 (message_stanza);
	_g_object_unref0 (_data_->message_stanza);
	_data_->message_stanza = _tmp2_;
	dino_message_processor_on_message_received_co (_data_);
}

static void
dino_message_processor_on_message_received_finish (DinoMessageProcessor* self,
                                                   GAsyncResult* _res_)
{
	DinoMessageProcessorOnMessageReceivedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
dino_message_processor_on_message_received_co (DinoMessageProcessorOnMessageReceivedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->history_sync;
	if (dino_history_sync_process (_data_->_tmp0_, _data_->account, _data_->message_stanza)) {
		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;
	}
	dino_message_processor_run_pipeline_announce (_data_->self, _data_->account, _data_->message_stanza, NULL, 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_message_processor_run_pipeline_announce_data_free (gpointer _data)
{
	DinoMessageProcessorRunPipelineAnnounceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->message_stanza);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMessageProcessorRunPipelineAnnounceData, _data_);
}

void
dino_message_processor_run_pipeline_announce (DinoMessageProcessor* self,
                                              DinoEntitiesAccount* account,
                                              XmppMessageStanza* message_stanza,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	DinoMessageProcessorRunPipelineAnnounceData* _data_;
	DinoMessageProcessor* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppMessageStanza* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (message_stanza != NULL);
	_data_ = g_slice_new0 (DinoMessageProcessorRunPipelineAnnounceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_message_processor_run_pipeline_announce_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _g_object_ref0 (message_stanza);
	_g_object_unref0 (_data_->message_stanza);
	_data_->message_stanza = _tmp2_;
	dino_message_processor_run_pipeline_announce_co (_data_);
}

void
dino_message_processor_run_pipeline_announce_finish (DinoMessageProcessor* self,
                                                     GAsyncResult* _res_)
{
	DinoMessageProcessorRunPipelineAnnounceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_message_processor_run_pipeline_announce_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	DinoMessageProcessorRunPipelineAnnounceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_message_processor_run_pipeline_announce_co (_data_);
}

static gboolean
dino_message_processor_run_pipeline_announce_co (DinoMessageProcessorRunPipelineAnnounceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	dino_message_processor_parse_message_stanza (_data_->self, _data_->account, _data_->message_stanza, dino_message_processor_run_pipeline_announce_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = dino_message_processor_parse_message_stanza_finish (_data_->self, _data_->_res_);
	_data_->message = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->stream_interactor;
	_data_->_tmp2_ = dino_conversation_manager_IDENTITY;
	_data_->_tmp3_ = dino_stream_interactor_get_module (_data_->_tmp1_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp2_);
	_data_->_tmp4_ = (DinoConversationManager*) _data_->_tmp3_;
	_data_->_tmp5_ = _data_->message;
	_data_->_tmp6_ = dino_conversation_manager_get_conversation_for_message (_data_->_tmp4_, _data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_g_object_unref0 (_data_->_tmp4_);
	_data_->conversation = _data_->_tmp7_;
	_data_->_tmp8_ = _data_->conversation;
	if (_data_->_tmp8_ == NULL) {
		_g_object_unref0 (_data_->conversation);
		_g_object_unref0 (_data_->message);
		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_->_tmp9_ = _data_->self->received_pipeline;
	_data_->_tmp10_ = _data_->message;
	_data_->_tmp11_ = _data_->conversation;
	_data_->_state_ = 2;
	dino_message_listener_holder_run (_data_->_tmp9_, _data_->_tmp10_, _data_->message_stanza, _data_->_tmp11_, dino_message_processor_run_pipeline_announce_ready, _data_);
	return FALSE;
	_state_2:
	_data_->abort = dino_message_listener_holder_run_finish (_data_->_tmp9_, _data_->_res_);
	if (_data_->abort) {
		_g_object_unref0 (_data_->conversation);
		_g_object_unref0 (_data_->message);
		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_->_tmp12_ = _data_->message;
	_data_->_tmp13_ = dino_entities_message_get_direction (_data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	if (_data_->_tmp14_ == DINO_ENTITIES_MESSAGE_DIRECTION_RECEIVED) {
		_data_->_tmp15_ = _data_->message;
		_data_->_tmp16_ = _data_->conversation;
		g_signal_emit (_data_->self, dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_MESSAGE_RECEIVED_SIGNAL], 0, _data_->_tmp15_, _data_->_tmp16_);
	} else {
		_data_->_tmp17_ = _data_->message;
		_data_->_tmp18_ = dino_entities_message_get_direction (_data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		if (_data_->_tmp19_ == DINO_ENTITIES_MESSAGE_DIRECTION_SENT) {
			_data_->_tmp20_ = _data_->message;
			_data_->_tmp21_ = _data_->conversation;
			g_signal_emit (_data_->self, dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_MESSAGE_SENT_SIGNAL], 0, _data_->_tmp20_, _data_->_tmp21_);
		}
	}
	_data_->_tmp22_ = _data_->message;
	_data_->_tmp23_ = _data_->conversation;
	g_signal_emit (_data_->self, dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_MESSAGE_SENT_OR_RECEIVED_SIGNAL], 0, _data_->_tmp22_, _data_->_tmp23_);
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->message);
	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_message_processor_parse_message_stanza_data_free (gpointer _data)
{
	DinoMessageProcessorParseMessageStanzaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->message);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMessageProcessorParseMessageStanzaData, _data_);
}

void
dino_message_processor_parse_message_stanza (DinoMessageProcessor* self,
                                             DinoEntitiesAccount* account,
                                             XmppMessageStanza* message,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	DinoMessageProcessorParseMessageStanzaData* _data_;
	DinoMessageProcessor* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppMessageStanza* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (message != NULL);
	_data_ = g_slice_new0 (DinoMessageProcessorParseMessageStanzaData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_message_processor_parse_message_stanza_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _g_object_ref0 (message);
	_g_object_unref0 (_data_->message);
	_data_->message = _tmp2_;
	dino_message_processor_parse_message_stanza_co (_data_);
}

DinoEntitiesMessage*
dino_message_processor_parse_message_stanza_finish (DinoMessageProcessor* self,
                                                    GAsyncResult* _res_)
{
	DinoEntitiesMessage* result;
	DinoMessageProcessorParseMessageStanzaData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

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

static void
dino_message_processor_parse_message_stanza_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	DinoMessageProcessorParseMessageStanzaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_message_processor_parse_message_stanza_co (_data_);
}

static gboolean
dino_message_processor_parse_message_stanza_co (DinoMessageProcessorParseMessageStanzaData* _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_ = xmpp_message_stanza_get_body (_data_->message);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = g_strdup (_data_->_tmp1_);
	_data_->body = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->body;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = _data_->body;
		_data_->_tmp5_ = string_strip (_data_->_tmp4_);
		_g_free0 (_data_->body);
		_data_->body = _data_->_tmp5_;
	}
	_data_->_tmp6_ = _data_->body;
	_data_->_tmp7_ = dino_entities_message_new (_data_->_tmp6_);
	_data_->new_message = _data_->_tmp7_;
	_data_->_tmp8_ = _data_->new_message;
	dino_entities_message_set_account (_data_->_tmp8_, _data_->account);
	_data_->_tmp10_ = xmpp_xep_unique_stable_stanza_ids_get_origin_id (_data_->message);
	_data_->_tmp9_ = _data_->_tmp10_;
	if (_data_->_tmp9_ == NULL) {
		_data_->_tmp11_ = xmpp_stanza_get_id ((XmppStanza*) _data_->message);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = g_strdup (_data_->_tmp12_);
		_g_free0 (_data_->_tmp9_);
		_data_->_tmp9_ = _data_->_tmp13_;
	}
	_data_->_tmp14_ = _data_->new_message;
	dino_entities_message_set_stanza_id (_data_->_tmp14_, _data_->_tmp9_);
	_data_->counterpart_override = NULL;
	_data_->_tmp15_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
	_data_->_tmp16_ = _data_->_tmp15_;
	_data_->_tmp17_ = _data_->_tmp16_;
	_data_->_tmp18_ = _data_->self->priv->stream_interactor;
	_data_->_tmp19_ = dino_muc_manager_IDENTITY;
	_data_->_tmp20_ = dino_stream_interactor_get_module (_data_->_tmp18_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp19_);
	_data_->_tmp21_ = (DinoMucManager*) _data_->_tmp20_;
	_data_->_tmp22_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
	_data_->_tmp23_ = _data_->_tmp22_;
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = xmpp_jid_get_bare_jid (_data_->_tmp24_);
	_data_->_tmp26_ = _data_->_tmp25_;
	_data_->_tmp27_ = _data_->_tmp26_;
	_data_->_tmp28_ = dino_muc_manager_get_own_jid (_data_->_tmp21_, _data_->_tmp27_, _data_->account);
	_data_->_tmp29_ = _data_->_tmp28_;
	_data_->_tmp30_ = xmpp_jid_equals (_data_->_tmp17_, _data_->_tmp29_);
	_xmpp_jid_unref0 (_data_->_tmp29_);
	_xmpp_jid_unref0 (_data_->_tmp27_);
	_xmpp_jid_unref0 (_data_->_tmp24_);
	_g_object_unref0 (_data_->_tmp21_);
	_xmpp_jid_unref0 (_data_->_tmp17_);
	if (_data_->_tmp30_) {
		_data_->_tmp31_ = _data_->new_message;
		dino_entities_message_set_direction (_data_->_tmp31_, DINO_ENTITIES_MESSAGE_DIRECTION_SENT);
		_data_->_tmp32_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
		_data_->_tmp33_ = _data_->_tmp32_;
		_data_->_tmp34_ = _data_->_tmp33_;
		_data_->_tmp35_ = xmpp_jid_get_bare_jid (_data_->_tmp34_);
		_data_->_tmp36_ = _data_->_tmp35_;
		_xmpp_jid_unref0 (_data_->counterpart_override);
		_data_->counterpart_override = _data_->_tmp36_;
		_xmpp_jid_unref0 (_data_->_tmp34_);
	} else {
		_data_->_tmp37_ = dino_entities_account_get_bare_jid (_data_->account);
		_data_->_tmp38_ = _data_->_tmp37_;
		_data_->_tmp39_ = _data_->_tmp38_;
		_data_->_tmp40_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
		_data_->_tmp41_ = _data_->_tmp40_;
		_data_->_tmp42_ = _data_->_tmp41_;
		_data_->_tmp43_ = xmpp_jid_equals_bare (_data_->_tmp39_, _data_->_tmp42_);
		_xmpp_jid_unref0 (_data_->_tmp42_);
		_xmpp_jid_unref0 (_data_->_tmp39_);
		if (_data_->_tmp43_) {
			_data_->_tmp44_ = _data_->new_message;
			dino_entities_message_set_direction (_data_->_tmp44_, DINO_ENTITIES_MESSAGE_DIRECTION_SENT);
		} else {
			_data_->_tmp45_ = _data_->new_message;
			dino_entities_message_set_direction (_data_->_tmp45_, DINO_ENTITIES_MESSAGE_DIRECTION_RECEIVED);
		}
	}
	_data_->_tmp47_ = _data_->counterpart_override;
	_data_->_tmp48_ = _xmpp_jid_ref0 (_data_->_tmp47_);
	_data_->_tmp46_ = _data_->_tmp48_;
	if (_data_->_tmp46_ == NULL) {
		_data_->_tmp50_ = _data_->new_message;
		_data_->_tmp51_ = dino_entities_message_get_direction (_data_->_tmp50_);
		_data_->_tmp52_ = _data_->_tmp51_;
		if (_data_->_tmp52_ == DINO_ENTITIES_MESSAGE_DIRECTION_SENT) {
			_data_->_tmp53_ = xmpp_stanza_get_to ((XmppStanza*) _data_->message);
			_data_->_tmp54_ = _data_->_tmp53_;
			_xmpp_jid_unref0 (_data_->_tmp49_);
			_data_->_tmp49_ = _data_->_tmp54_;
		} else {
			_data_->_tmp55_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
			_data_->_tmp56_ = _data_->_tmp55_;
			_xmpp_jid_unref0 (_data_->_tmp49_);
			_data_->_tmp49_ = _data_->_tmp56_;
		}
		_data_->_tmp57_ = _data_->_tmp49_;
		_data_->_tmp49_ = NULL;
		_xmpp_jid_unref0 (_data_->_tmp46_);
		_data_->_tmp46_ = _data_->_tmp57_;
		_xmpp_jid_unref0 (_data_->_tmp49_);
	}
	_data_->_tmp58_ = _data_->new_message;
	dino_entities_message_set_counterpart (_data_->_tmp58_, _data_->_tmp46_);
	_data_->_tmp60_ = _data_->new_message;
	_data_->_tmp61_ = dino_entities_message_get_direction (_data_->_tmp60_);
	_data_->_tmp62_ = _data_->_tmp61_;
	if (_data_->_tmp62_ == DINO_ENTITIES_MESSAGE_DIRECTION_SENT) {
		_data_->_tmp63_ = xmpp_stanza_get_from ((XmppStanza*) _data_->message);
		_data_->_tmp64_ = _data_->_tmp63_;
		_xmpp_jid_unref0 (_data_->_tmp59_);
		_data_->_tmp59_ = _data_->_tmp64_;
	} else {
		_data_->_tmp65_ = xmpp_stanza_get_to ((XmppStanza*) _data_->message);
		_data_->_tmp66_ = _data_->_tmp65_;
		_xmpp_jid_unref0 (_data_->_tmp59_);
		_data_->_tmp59_ = _data_->_tmp66_;
	}
	_data_->_tmp67_ = _data_->new_message;
	dino_entities_message_set_ourpart (_data_->_tmp67_, _data_->_tmp59_);
	_data_->_tmp68_ = xmpp_message_archive_management_message_flag_get_flag (_data_->message);
	_data_->mam_message_flag = _data_->_tmp68_;
	_data_->_tmp69_ = _data_->self->priv->stream_interactor;
	_data_->_tmp70_ = dino_entity_info_IDENTITY;
	_data_->_tmp71_ = dino_stream_interactor_get_module (_data_->_tmp69_, DINO_TYPE_ENTITY_INFO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp70_);
	_data_->entity_info = (DinoEntityInfo*) _data_->_tmp71_;
	_data_->_tmp73_ = _data_->mam_message_flag;
	if (_data_->_tmp73_ != NULL) {
		_data_->_tmp74_ = _data_->mam_message_flag;
		_data_->_tmp75_ = xmpp_message_archive_management_message_flag_get_mam_id (_data_->_tmp74_);
		_data_->_tmp76_ = _data_->_tmp75_;
		_data_->_tmp72_ = _data_->_tmp76_ != NULL;
	} else {
		_data_->_tmp72_ = FALSE;
	}
	if (_data_->_tmp72_) {
		_data_->_tmp77_ = _data_->entity_info;
		_data_->_tmp78_ = _data_->mam_message_flag;
		_data_->_tmp79_ = xmpp_message_archive_management_message_flag_get_sender_jid (_data_->_tmp78_);
		_data_->_tmp80_ = _data_->_tmp79_;
		_data_->sender_supports_mam = dino_entity_info_has_feature_cached (_data_->_tmp77_, _data_->account, _data_->_tmp80_, XMPP_MESSAGE_ARCHIVE_MANAGEMENT_NS_URI);
		if (_data_->sender_supports_mam) {
			_data_->_tmp81_ = _data_->new_message;
			_data_->_tmp82_ = _data_->mam_message_flag;
			_data_->_tmp83_ = xmpp_message_archive_management_message_flag_get_mam_id (_data_->_tmp82_);
			_data_->_tmp84_ = _data_->_tmp83_;
			dino_entities_message_set_server_id (_data_->_tmp81_, _data_->_tmp84_);
		}
	} else {
		_data_->_tmp85_ = xmpp_stanza_get_type_ ((XmppStanza*) _data_->message);
		_data_->_tmp86_ = _data_->_tmp85_;
		if (g_strcmp0 (_data_->_tmp86_, XMPP_MESSAGE_STANZA_TYPE_GROUPCHAT) == 0) {
			_data_->_tmp87_ = _data_->entity_info;
			_data_->_tmp88_ = _data_->new_message;
			_data_->_tmp89_ = dino_entities_message_get_counterpart (_data_->_tmp88_);
			_data_->_tmp90_ = _data_->_tmp89_;
			_data_->_tmp91_ = xmpp_jid_get_bare_jid (_data_->_tmp90_);
			_data_->_tmp92_ = _data_->_tmp91_;
			_data_->_tmp93_ = _data_->_tmp92_;
			_data_->_state_ = 1;
			dino_entity_info_has_feature (_data_->_tmp87_, _data_->account, _data_->_tmp93_, XMPP_XEP_UNIQUE_STABLE_STANZA_IDS_NS_URI, dino_message_processor_parse_message_stanza_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp94_ = dino_entity_info_has_feature_finish (_data_->_tmp87_, _data_->_res_);
			_xmpp_jid_unref0 (_data_->_tmp93_);
			_data_->server_supports_sid = _data_->_tmp94_;
			if (_data_->server_supports_sid) {
				_data_->_tmp95_ = _data_->new_message;
				_data_->_tmp96_ = _data_->new_message;
				_data_->_tmp97_ = dino_entities_message_get_counterpart (_data_->_tmp96_);
				_data_->_tmp98_ = _data_->_tmp97_;
				_data_->_tmp99_ = xmpp_jid_get_bare_jid (_data_->_tmp98_);
				_data_->_tmp100_ = _data_->_tmp99_;
				_data_->_tmp101_ = _data_->_tmp100_;
				_data_->_tmp102_ = xmpp_xep_unique_stable_stanza_ids_get_stanza_id (_data_->message, _data_->_tmp101_);
				_data_->_tmp103_ = _data_->_tmp102_;
				dino_entities_message_set_server_id (_data_->_tmp95_, _data_->_tmp103_);
				_g_free0 (_data_->_tmp103_);
				_xmpp_jid_unref0 (_data_->_tmp101_);
			}
		} else {
			_data_->_tmp104_ = xmpp_stanza_get_type_ ((XmppStanza*) _data_->message);
			_data_->_tmp105_ = _data_->_tmp104_;
			if (g_strcmp0 (_data_->_tmp105_, XMPP_MESSAGE_STANZA_TYPE_CHAT) == 0) {
				_data_->_tmp106_ = _data_->entity_info;
				_data_->_tmp107_ = dino_entities_account_get_bare_jid (_data_->account);
				_data_->_tmp108_ = _data_->_tmp107_;
				_data_->_tmp109_ = _data_->_tmp108_;
				_data_->_state_ = 2;
				dino_entity_info_has_feature (_data_->_tmp106_, _data_->account, _data_->_tmp109_, XMPP_XEP_UNIQUE_STABLE_STANZA_IDS_NS_URI, dino_message_processor_parse_message_stanza_ready, _data_);
				return FALSE;
				_state_2:
				_data_->_tmp110_ = dino_entity_info_has_feature_finish (_data_->_tmp106_, _data_->_res_);
				_xmpp_jid_unref0 (_data_->_tmp109_);
				_data_->_vala1_server_supports_sid = _data_->_tmp110_;
				if (_data_->_vala1_server_supports_sid) {
					_data_->_tmp111_ = _data_->new_message;
					_data_->_tmp112_ = dino_entities_account_get_bare_jid (_data_->account);
					_data_->_tmp113_ = _data_->_tmp112_;
					_data_->_tmp114_ = _data_->_tmp113_;
					_data_->_tmp115_ = xmpp_xep_unique_stable_stanza_ids_get_stanza_id (_data_->message, _data_->_tmp114_);
					_data_->_tmp116_ = _data_->_tmp115_;
					dino_entities_message_set_server_id (_data_->_tmp111_, _data_->_tmp116_);
					_g_free0 (_data_->_tmp116_);
					_xmpp_jid_unref0 (_data_->_tmp114_);
				}
			}
		}
	}
	_data_->_tmp117_ = _data_->mam_message_flag;
	if (_data_->_tmp117_ != NULL) {
		_data_->_tmp118_ = _data_->new_message;
		_data_->_tmp119_ = _data_->mam_message_flag;
		_data_->_tmp120_ = xmpp_message_archive_management_message_flag_get_server_time (_data_->_tmp119_);
		_data_->_tmp121_ = _data_->_tmp120_;
		dino_entities_message_set_local_time (_data_->_tmp118_, _data_->_tmp121_);
	}
	_data_->_tmp122_ = g_date_time_new_now_utc ();
	_data_->_tmp123_ = _data_->_tmp122_;
	_data_->_tmp124_ = g_date_time_new_from_unix_utc (g_date_time_to_unix (_data_->_tmp123_));
	_data_->_tmp125_ = _data_->_tmp124_;
	_g_date_time_unref0 (_data_->_tmp123_);
	_data_->now = _data_->_tmp125_;
	_data_->_tmp127_ = _data_->new_message;
	_data_->_tmp128_ = dino_entities_message_get_local_time (_data_->_tmp127_);
	_data_->_tmp129_ = _data_->_tmp128_;
	if (_data_->_tmp129_ == NULL) {
		_data_->_tmp126_ = TRUE;
	} else {
		_data_->_tmp130_ = _data_->new_message;
		_data_->_tmp131_ = dino_entities_message_get_local_time (_data_->_tmp130_);
		_data_->_tmp132_ = _data_->_tmp131_;
		_data_->_tmp133_ = _data_->now;
		_data_->_tmp126_ = g_date_time_compare (_data_->_tmp132_, _data_->_tmp133_) > 0;
	}
	if (_data_->_tmp126_) {
		_data_->_tmp134_ = _data_->new_message;
		_data_->_tmp135_ = _data_->now;
		dino_entities_message_set_local_time (_data_->_tmp134_, _data_->_tmp135_);
	}
	_data_->_tmp136_ = xmpp_xep_delayed_delivery_message_flag_get_flag (_data_->message);
	_data_->delayed_message_flag = _data_->_tmp136_;
	_data_->_tmp137_ = _data_->delayed_message_flag;
	if (_data_->_tmp137_ != NULL) {
		_data_->_tmp138_ = _data_->new_message;
		_data_->_tmp139_ = _data_->delayed_message_flag;
		_data_->_tmp140_ = xmpp_xep_delayed_delivery_message_flag_get_datetime (_data_->_tmp139_);
		_data_->_tmp141_ = _data_->_tmp140_;
		dino_entities_message_set_time (_data_->_tmp138_, _data_->_tmp141_);
	}
	_data_->_tmp143_ = _data_->new_message;
	_data_->_tmp144_ = dino_entities_message_get_time (_data_->_tmp143_);
	_data_->_tmp145_ = _data_->_tmp144_;
	if (_data_->_tmp145_ == NULL) {
		_data_->_tmp142_ = TRUE;
	} else {
		_data_->_tmp146_ = _data_->new_message;
		_data_->_tmp147_ = dino_entities_message_get_time (_data_->_tmp146_);
		_data_->_tmp148_ = _data_->_tmp147_;
		_data_->_tmp149_ = _data_->new_message;
		_data_->_tmp150_ = dino_entities_message_get_local_time (_data_->_tmp149_);
		_data_->_tmp151_ = _data_->_tmp150_;
		_data_->_tmp142_ = g_date_time_compare (_data_->_tmp148_, _data_->_tmp151_) > 0;
	}
	if (_data_->_tmp142_) {
		_data_->_tmp152_ = _data_->new_message;
		_data_->_tmp153_ = _data_->new_message;
		_data_->_tmp154_ = dino_entities_message_get_local_time (_data_->_tmp153_);
		_data_->_tmp155_ = _data_->_tmp154_;
		dino_entities_message_set_time (_data_->_tmp152_, _data_->_tmp155_);
	}
	_data_->_tmp156_ = _data_->new_message;
	_data_->_tmp157_ = _data_->new_message;
	_data_->_state_ = 3;
	dino_message_processor_determine_message_type (_data_->self, _data_->account, _data_->message, _data_->_tmp157_, dino_message_processor_parse_message_stanza_ready, _data_);
	return FALSE;
	_state_3:
	dino_entities_message_set_type_ (_data_->_tmp156_, dino_message_processor_determine_message_type_finish (_data_->self, _data_->_res_));
	_data_->result = _data_->new_message;
	_g_object_unref0 (_data_->delayed_message_flag);
	_g_date_time_unref0 (_data_->now);
	_g_object_unref0 (_data_->entity_info);
	_g_object_unref0 (_data_->mam_message_flag);
	_xmpp_jid_unref0 (_data_->_tmp59_);
	_xmpp_jid_unref0 (_data_->_tmp46_);
	_xmpp_jid_unref0 (_data_->counterpart_override);
	_g_free0 (_data_->_tmp9_);
	_g_free0 (_data_->body);
	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_message_processor_determine_message_type_data_free (gpointer _data)
{
	DinoMessageProcessorDetermineMessageTypeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->message_stanza);
	_g_object_unref0 (_data_->message);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoMessageProcessorDetermineMessageTypeData, _data_);
}

static void
dino_message_processor_determine_message_type (DinoMessageProcessor* self,
                                               DinoEntitiesAccount* account,
                                               XmppMessageStanza* message_stanza,
                                               DinoEntitiesMessage* message,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	DinoMessageProcessorDetermineMessageTypeData* _data_;
	DinoMessageProcessor* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppMessageStanza* _tmp2_;
	DinoEntitiesMessage* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (message_stanza != NULL);
	g_return_if_fail (message != NULL);
	_data_ = g_slice_new0 (DinoMessageProcessorDetermineMessageTypeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_message_processor_determine_message_type_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _g_object_ref0 (message_stanza);
	_g_object_unref0 (_data_->message_stanza);
	_data_->message_stanza = _tmp2_;
	_tmp3_ = _g_object_ref0 (message);
	_g_object_unref0 (_data_->message);
	_data_->message = _tmp3_;
	dino_message_processor_determine_message_type_co (_data_);
}

static DinoEntitiesMessageType
dino_message_processor_determine_message_type_finish (DinoMessageProcessor* self,
                                                      GAsyncResult* _res_)
{
	DinoEntitiesMessageType result;
	DinoMessageProcessorDetermineMessageTypeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
dino_message_processor_determine_message_type_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	DinoMessageProcessorDetermineMessageTypeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_message_processor_determine_message_type_co (_data_);
}

static gboolean
dino_message_processor_determine_message_type_co (DinoMessageProcessorDetermineMessageTypeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_stanza_get_type_ ((XmppStanza*) _data_->message_stanza);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (g_strcmp0 (_data_->_tmp1_, XMPP_MESSAGE_STANZA_TYPE_GROUPCHAT) == 0) {
		_data_->result = DINO_ENTITIES_MESSAGE_TYPE_GROUPCHAT;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = xmpp_stanza_get_type_ ((XmppStanza*) _data_->message_stanza);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (g_strcmp0 (_data_->_tmp3_, XMPP_MESSAGE_STANZA_TYPE_CHAT) == 0) {
		_data_->_tmp4_ = _data_->self->priv->stream_interactor;
		_data_->_tmp5_ = dino_conversation_manager_IDENTITY;
		_data_->_tmp6_ = dino_stream_interactor_get_module (_data_->_tmp4_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp5_);
		_data_->_tmp7_ = (DinoConversationManager*) _data_->_tmp6_;
		_data_->_tmp8_ = dino_entities_message_get_counterpart (_data_->message);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = xmpp_jid_get_bare_jid (_data_->_tmp9_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = dino_conversation_manager_get_conversation (_data_->_tmp7_, _data_->_tmp12_, _data_->account, NULL);
		_data_->_tmp14_ = _data_->_tmp13_;
		_xmpp_jid_unref0 (_data_->_tmp12_);
		_g_object_unref0 (_data_->_tmp7_);
		_data_->conversation = _data_->_tmp14_;
		_data_->_tmp15_ = _data_->conversation;
		if (_data_->_tmp15_ != NULL) {
			_data_->_tmp16_ = _data_->conversation;
			_data_->_tmp17_ = dino_entities_conversation_get_type_ (_data_->_tmp16_);
			_data_->_tmp18_ = _data_->_tmp17_;
			if (_data_->_tmp18_ == DINO_ENTITIES_CONVERSATION_TYPE_CHAT) {
				_data_->result = DINO_ENTITIES_MESSAGE_TYPE_CHAT;
				_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;
			} else {
				_data_->_tmp19_ = _data_->conversation;
				_data_->_tmp20_ = dino_entities_conversation_get_type_ (_data_->_tmp19_);
				_data_->_tmp21_ = _data_->_tmp20_;
				if (_data_->_tmp21_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
					_data_->result = DINO_ENTITIES_MESSAGE_TYPE_GROUPCHAT_PM;
					_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;
				}
			}
		} else {
			_data_->_tmp22_ = _data_->self->priv->stream_interactor;
			_data_->_tmp23_ = dino_stream_interactor_get_stream (_data_->_tmp22_, _data_->account);
			_data_->stream = _data_->_tmp23_;
			_data_->_tmp24_ = _data_->stream;
			if (_data_->_tmp24_ != NULL) {
				_data_->_tmp25_ = _data_->stream;
				_data_->_tmp26_ = xmpp_xep_service_discovery_module_IDENTITY;
				_data_->_tmp27_ = xmpp_xmpp_stream_get_module (_data_->_tmp25_, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp26_);
				_data_->_tmp28_ = (XmppXepServiceDiscoveryModule*) _data_->_tmp27_;
				_data_->_tmp29_ = _data_->stream;
				_data_->_tmp30_ = dino_entities_message_get_counterpart (_data_->message);
				_data_->_tmp31_ = _data_->_tmp30_;
				_data_->_tmp32_ = xmpp_jid_get_bare_jid (_data_->_tmp31_);
				_data_->_tmp33_ = _data_->_tmp32_;
				_data_->_tmp34_ = _data_->_tmp33_;
				_data_->_state_ = 1;
				xmpp_xep_service_discovery_module_get_entity_identities (_data_->_tmp28_, _data_->_tmp29_, _data_->_tmp34_, dino_message_processor_determine_message_type_ready, _data_);
				return FALSE;
				_state_1:
				_data_->_tmp35_ = xmpp_xep_service_discovery_module_get_entity_identities_finish (_data_->_tmp28_, _data_->_res_);
				_data_->_tmp36_ = _data_->_tmp35_;
				_xmpp_jid_unref0 (_data_->_tmp34_);
				_g_object_unref0 (_data_->_tmp28_);
				_data_->identities = _data_->_tmp36_;
				_data_->_tmp37_ = _data_->identities;
				if (_data_->_tmp37_ == NULL) {
					_data_->result = DINO_ENTITIES_MESSAGE_TYPE_CHAT;
					_g_object_unref0 (_data_->identities);
					_g_object_unref0 (_data_->stream);
					_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_->_tmp38_ = _data_->identities;
					_data_->_tmp39_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp38_);
					_data_->_identity_it = _data_->_tmp39_;
					while (TRUE) {
						_data_->_tmp40_ = _data_->_identity_it;
						if (!gee_iterator_next (_data_->_tmp40_)) {
							break;
						}
						_data_->_tmp41_ = _data_->_identity_it;
						_data_->_tmp42_ = gee_iterator_get (_data_->_tmp41_);
						_data_->identity = (XmppXepServiceDiscoveryIdentity*) _data_->_tmp42_;
						_data_->_tmp43_ = _data_->identity;
						_data_->_tmp44_ = xmpp_xep_service_discovery_identity_get_category (_data_->_tmp43_);
						_data_->_tmp45_ = _data_->_tmp44_;
						if (g_strcmp0 (_data_->_tmp45_, XMPP_XEP_SERVICE_DISCOVERY_IDENTITY_CATEGORY_CONFERENCE) == 0) {
							_data_->result = DINO_ENTITIES_MESSAGE_TYPE_GROUPCHAT_PM;
							_xmpp_xep_service_discovery_identity_unref0 (_data_->identity);
							_g_object_unref0 (_data_->_identity_it);
							_g_object_unref0 (_data_->identities);
							_g_object_unref0 (_data_->stream);
							_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;
						} else {
							_data_->result = DINO_ENTITIES_MESSAGE_TYPE_CHAT;
							_xmpp_xep_service_discovery_identity_unref0 (_data_->identity);
							_g_object_unref0 (_data_->_identity_it);
							_g_object_unref0 (_data_->identities);
							_g_object_unref0 (_data_->stream);
							_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;
						}
						_xmpp_xep_service_discovery_identity_unref0 (_data_->identity);
					}
					_g_object_unref0 (_data_->_identity_it);
				}
				_g_object_unref0 (_data_->identities);
			}
			_g_object_unref0 (_data_->stream);
		}
		_g_object_unref0 (_data_->conversation);
	}
	_data_->result = DINO_ENTITIES_MESSAGE_TYPE_CHAT;
	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 gboolean
dino_message_processor_is_duplicate (DinoMessageProcessor* self,
                                     DinoEntitiesMessage* message,
                                     XmppMessageStanza* stanza,
                                     DinoEntitiesConversation* conversation)
{
	DinoEntitiesAccount* account = NULL;
	DinoEntitiesAccount* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp39_ = FALSE;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	gboolean is_uuid = FALSE;
	QliteQueryBuilder* builder = NULL;
	DinoDatabase* _tmp125_;
	DinoDatabaseMessageTable* _tmp126_;
	DinoDatabaseMessageTable* _tmp127_;
	QliteQueryBuilder* _tmp128_;
	QliteQueryBuilder* _tmp129_;
	DinoDatabase* _tmp130_;
	DinoDatabaseMessageTable* _tmp131_;
	DinoDatabaseMessageTable* _tmp132_;
	QliteColumn* _tmp133_;
	DinoEntitiesAccount* _tmp134_;
	gint _tmp135_;
	gint _tmp136_;
	QliteQueryBuilder* _tmp137_;
	QliteQueryBuilder* _tmp138_;
	DinoDatabase* _tmp139_;
	DinoDatabaseMessageTable* _tmp140_;
	DinoDatabaseMessageTable* _tmp141_;
	QliteColumn* _tmp142_;
	DinoDatabase* _tmp143_;
	XmppJid* _tmp144_;
	XmppJid* _tmp145_;
	QliteQueryBuilder* _tmp146_;
	QliteQueryBuilder* _tmp147_;
	DinoDatabase* _tmp148_;
	DinoDatabaseMessageTable* _tmp149_;
	DinoDatabaseMessageTable* _tmp150_;
	QliteColumn* _tmp151_;
	const gchar* _tmp152_;
	const gchar* _tmp153_;
	QliteQueryBuilder* _tmp154_;
	QliteQueryBuilder* _tmp155_;
	DinoDatabase* _tmp156_;
	DinoDatabaseMessageTable* _tmp157_;
	DinoDatabaseMessageTable* _tmp158_;
	QliteColumn* _tmp159_;
	GDateTime* _tmp160_;
	GDateTime* _tmp161_;
	GDateTime* _tmp162_;
	GDateTime* _tmp163_;
	QliteQueryBuilder* _tmp164_;
	QliteQueryBuilder* _tmp165_;
	DinoDatabase* _tmp166_;
	DinoDatabaseMessageTable* _tmp167_;
	DinoDatabaseMessageTable* _tmp168_;
	QliteColumn* _tmp169_;
	GDateTime* _tmp170_;
	GDateTime* _tmp171_;
	GDateTime* _tmp172_;
	GDateTime* _tmp173_;
	QliteQueryBuilder* _tmp174_;
	QliteQueryBuilder* _tmp175_;
	const gchar* _tmp176_;
	const gchar* _tmp177_;
	XmppJid* _tmp194_;
	XmppJid* _tmp195_;
	const gchar* _tmp196_;
	QliteQueryBuilder* _tmp214_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (message != NULL, FALSE);
	g_return_val_if_fail (stanza != NULL, FALSE);
	g_return_val_if_fail (conversation != NULL, FALSE);
	_tmp0_ = dino_entities_conversation_get_account (conversation);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	account = _tmp2_;
	_tmp3_ = dino_entities_message_get_server_id (message);
	_tmp4_ = _tmp3_;
	if (_tmp4_ != NULL) {
		QliteQueryBuilder* builder = NULL;
		DinoDatabase* _tmp5_;
		DinoDatabaseMessageTable* _tmp6_;
		DinoDatabaseMessageTable* _tmp7_;
		QliteQueryBuilder* _tmp8_;
		QliteQueryBuilder* _tmp9_;
		DinoDatabase* _tmp10_;
		DinoDatabaseMessageTable* _tmp11_;
		DinoDatabaseMessageTable* _tmp12_;
		QliteColumn* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		QliteQueryBuilder* _tmp16_;
		QliteQueryBuilder* _tmp17_;
		DinoDatabase* _tmp18_;
		DinoDatabaseMessageTable* _tmp19_;
		DinoDatabaseMessageTable* _tmp20_;
		QliteColumn* _tmp21_;
		DinoDatabase* _tmp22_;
		XmppJid* _tmp23_;
		XmppJid* _tmp24_;
		QliteQueryBuilder* _tmp25_;
		QliteQueryBuilder* _tmp26_;
		DinoDatabase* _tmp27_;
		DinoDatabaseMessageTable* _tmp28_;
		DinoDatabaseMessageTable* _tmp29_;
		QliteColumn* _tmp30_;
		DinoEntitiesAccount* _tmp31_;
		gint _tmp32_;
		gint _tmp33_;
		QliteQueryBuilder* _tmp34_;
		QliteQueryBuilder* _tmp35_;
		QliteQueryBuilder* _tmp36_;
		_tmp5_ = self->priv->db;
		_tmp6_ = dino_database_get_message (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = qlite_table_select ((QliteTable*) _tmp7_, NULL, (gint) 0);
		_tmp9_ = _tmp8_;
		_tmp10_ = self->priv->db;
		_tmp11_ = dino_database_get_message (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_->server_id;
		_tmp14_ = dino_entities_message_get_server_id (message);
		_tmp15_ = _tmp14_;
		_tmp16_ = qlite_query_builder_with (_tmp9_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp13_, "=", _tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = self->priv->db;
		_tmp19_ = dino_database_get_message (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = _tmp20_->counterpart_id;
		_tmp22_ = self->priv->db;
		_tmp23_ = dino_entities_message_get_counterpart (message);
		_tmp24_ = _tmp23_;
		_tmp25_ = qlite_query_builder_with (_tmp17_, G_TYPE_INT, NULL, NULL, _tmp21_, "=", (gpointer) ((gintptr) dino_database_get_jid_id (_tmp22_, _tmp24_)));
		_tmp26_ = _tmp25_;
		_tmp27_ = self->priv->db;
		_tmp28_ = dino_database_get_message (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp30_ = _tmp29_->account_id;
		_tmp31_ = account;
		_tmp32_ = dino_entities_account_get_id (_tmp31_);
		_tmp33_ = _tmp32_;
		_tmp34_ = qlite_query_builder_with (_tmp26_, G_TYPE_INT, NULL, NULL, _tmp30_, "=", (gpointer) ((gintptr) _tmp33_));
		_tmp35_ = _tmp34_;
		_qlite_statement_builder_unref0 (_tmp26_);
		_qlite_statement_builder_unref0 (_tmp17_);
		_qlite_statement_builder_unref0 (_tmp9_);
		builder = _tmp35_;
		_tmp36_ = builder;
		if (qlite_query_builder_count (_tmp36_) > ((gint64) 0)) {
			DinoHistorySync* _tmp37_;
			DinoEntitiesAccount* _tmp38_;
			_tmp37_ = self->history_sync;
			_tmp38_ = account;
			dino_history_sync_on_server_id_duplicate (_tmp37_, _tmp38_, stanza, message);
			result = TRUE;
			_qlite_statement_builder_unref0 (builder);
			_g_object_unref0 (account);
			return result;
		}
		_qlite_statement_builder_unref0 (builder);
	}
	_tmp40_ = dino_entities_message_get_stanza_id (message);
	_tmp41_ = _tmp40_;
	if (_tmp41_ != NULL) {
		const gchar* _tmp42_;
		const gchar* _tmp43_;
		_tmp42_ = dino_entities_message_get_stanza_id (message);
		_tmp43_ = _tmp42_;
		_tmp39_ = g_regex_match_simple ("[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f" \
"]{12}", _tmp43_, 0, 0);
	} else {
		_tmp39_ = FALSE;
	}
	is_uuid = _tmp39_;
	if (is_uuid) {
		QliteQueryBuilder* builder = NULL;
		DinoDatabase* _tmp44_;
		DinoDatabaseMessageTable* _tmp45_;
		DinoDatabaseMessageTable* _tmp46_;
		QliteQueryBuilder* _tmp47_;
		QliteQueryBuilder* _tmp48_;
		DinoDatabase* _tmp49_;
		DinoDatabaseMessageTable* _tmp50_;
		DinoDatabaseMessageTable* _tmp51_;
		QliteColumn* _tmp52_;
		const gchar* _tmp53_;
		const gchar* _tmp54_;
		QliteQueryBuilder* _tmp55_;
		QliteQueryBuilder* _tmp56_;
		DinoDatabase* _tmp57_;
		DinoDatabaseMessageTable* _tmp58_;
		DinoDatabaseMessageTable* _tmp59_;
		QliteColumn* _tmp60_;
		DinoDatabase* _tmp61_;
		XmppJid* _tmp62_;
		XmppJid* _tmp63_;
		QliteQueryBuilder* _tmp64_;
		QliteQueryBuilder* _tmp65_;
		DinoDatabase* _tmp66_;
		DinoDatabaseMessageTable* _tmp67_;
		DinoDatabaseMessageTable* _tmp68_;
		QliteColumn* _tmp69_;
		DinoEntitiesAccount* _tmp70_;
		gint _tmp71_;
		gint _tmp72_;
		QliteQueryBuilder* _tmp73_;
		QliteQueryBuilder* _tmp74_;
		gboolean _tmp75_;
		gboolean _tmp76_;
		gboolean duplicate = FALSE;
		QliteQueryBuilder* _tmp119_;
		QliteQueryBuilder* _tmp120_;
		QliteQueryBuilder* _tmp121_;
		QliteRowOption* _tmp122_;
		QliteRowOption* _tmp123_;
		gboolean _tmp124_;
		_tmp44_ = self->priv->db;
		_tmp45_ = dino_database_get_message (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = qlite_table_select ((QliteTable*) _tmp46_, NULL, (gint) 0);
		_tmp48_ = _tmp47_;
		_tmp49_ = self->priv->db;
		_tmp50_ = dino_database_get_message (_tmp49_);
		_tmp51_ = _tmp50_;
		_tmp52_ = _tmp51_->stanza_id;
		_tmp53_ = dino_entities_message_get_stanza_id (message);
		_tmp54_ = _tmp53_;
		_tmp55_ = qlite_query_builder_with (_tmp48_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp52_, "=", _tmp54_);
		_tmp56_ = _tmp55_;
		_tmp57_ = self->priv->db;
		_tmp58_ = dino_database_get_message (_tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = _tmp59_->counterpart_id;
		_tmp61_ = self->priv->db;
		_tmp62_ = dino_entities_message_get_counterpart (message);
		_tmp63_ = _tmp62_;
		_tmp64_ = qlite_query_builder_with (_tmp56_, G_TYPE_INT, NULL, NULL, _tmp60_, "=", (gpointer) ((gintptr) dino_database_get_jid_id (_tmp61_, _tmp63_)));
		_tmp65_ = _tmp64_;
		_tmp66_ = self->priv->db;
		_tmp67_ = dino_database_get_message (_tmp66_);
		_tmp68_ = _tmp67_;
		_tmp69_ = _tmp68_->account_id;
		_tmp70_ = account;
		_tmp71_ = dino_entities_account_get_id (_tmp70_);
		_tmp72_ = _tmp71_;
		_tmp73_ = qlite_query_builder_with (_tmp65_, G_TYPE_INT, NULL, NULL, _tmp69_, "=", (gpointer) ((gintptr) _tmp72_));
		_tmp74_ = _tmp73_;
		_qlite_statement_builder_unref0 (_tmp65_);
		_qlite_statement_builder_unref0 (_tmp56_);
		_qlite_statement_builder_unref0 (_tmp48_);
		builder = _tmp74_;
		_tmp75_ = dino_entities_message_get_direction (message);
		_tmp76_ = _tmp75_;
		if (_tmp76_ == DINO_ENTITIES_MESSAGE_DIRECTION_RECEIVED) {
			XmppJid* _tmp77_;
			XmppJid* _tmp78_;
			const gchar* _tmp79_;
			_tmp77_ = dino_entities_message_get_counterpart (message);
			_tmp78_ = _tmp77_;
			_tmp79_ = _tmp78_->resourcepart;
			if (_tmp79_ != NULL) {
				QliteQueryBuilder* _tmp80_;
				DinoDatabase* _tmp81_;
				DinoDatabaseMessageTable* _tmp82_;
				DinoDatabaseMessageTable* _tmp83_;
				QliteColumn* _tmp84_;
				XmppJid* _tmp85_;
				XmppJid* _tmp86_;
				const gchar* _tmp87_;
				QliteQueryBuilder* _tmp88_;
				QliteQueryBuilder* _tmp89_;
				_tmp80_ = builder;
				_tmp81_ = self->priv->db;
				_tmp82_ = dino_database_get_message (_tmp81_);
				_tmp83_ = _tmp82_;
				_tmp84_ = _tmp83_->counterpart_resource;
				_tmp85_ = dino_entities_message_get_counterpart (message);
				_tmp86_ = _tmp85_;
				_tmp87_ = _tmp86_->resourcepart;
				_tmp88_ = qlite_query_builder_with (_tmp80_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp84_, "=", _tmp87_);
				_tmp89_ = _tmp88_;
				_qlite_statement_builder_unref0 (_tmp89_);
			} else {
				QliteQueryBuilder* _tmp90_;
				DinoDatabase* _tmp91_;
				DinoDatabaseMessageTable* _tmp92_;
				DinoDatabaseMessageTable* _tmp93_;
				QliteColumn* _tmp94_;
				QliteQueryBuilder* _tmp95_;
				QliteQueryBuilder* _tmp96_;
				_tmp90_ = builder;
				_tmp91_ = self->priv->db;
				_tmp92_ = dino_database_get_message (_tmp91_);
				_tmp93_ = _tmp92_;
				_tmp94_ = _tmp93_->counterpart_resource;
				_tmp95_ = qlite_query_builder_with_null (_tmp90_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp94_);
				_tmp96_ = _tmp95_;
				_qlite_statement_builder_unref0 (_tmp96_);
			}
		} else {
			gboolean _tmp97_;
			gboolean _tmp98_;
			_tmp97_ = dino_entities_message_get_direction (message);
			_tmp98_ = _tmp97_;
			if (_tmp98_ == DINO_ENTITIES_MESSAGE_DIRECTION_SENT) {
				XmppJid* _tmp99_;
				XmppJid* _tmp100_;
				const gchar* _tmp101_;
				_tmp99_ = dino_entities_message_get_ourpart (message);
				_tmp100_ = _tmp99_;
				_tmp101_ = _tmp100_->resourcepart;
				if (_tmp101_ != NULL) {
					QliteQueryBuilder* _tmp102_;
					DinoDatabase* _tmp103_;
					DinoDatabaseMessageTable* _tmp104_;
					DinoDatabaseMessageTable* _tmp105_;
					QliteColumn* _tmp106_;
					XmppJid* _tmp107_;
					XmppJid* _tmp108_;
					const gchar* _tmp109_;
					QliteQueryBuilder* _tmp110_;
					QliteQueryBuilder* _tmp111_;
					_tmp102_ = builder;
					_tmp103_ = self->priv->db;
					_tmp104_ = dino_database_get_message (_tmp103_);
					_tmp105_ = _tmp104_;
					_tmp106_ = _tmp105_->our_resource;
					_tmp107_ = dino_entities_message_get_ourpart (message);
					_tmp108_ = _tmp107_;
					_tmp109_ = _tmp108_->resourcepart;
					_tmp110_ = qlite_query_builder_with (_tmp102_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp106_, "=", _tmp109_);
					_tmp111_ = _tmp110_;
					_qlite_statement_builder_unref0 (_tmp111_);
				} else {
					QliteQueryBuilder* _tmp112_;
					DinoDatabase* _tmp113_;
					DinoDatabaseMessageTable* _tmp114_;
					DinoDatabaseMessageTable* _tmp115_;
					QliteColumn* _tmp116_;
					QliteQueryBuilder* _tmp117_;
					QliteQueryBuilder* _tmp118_;
					_tmp112_ = builder;
					_tmp113_ = self->priv->db;
					_tmp114_ = dino_database_get_message (_tmp113_);
					_tmp115_ = _tmp114_;
					_tmp116_ = _tmp115_->our_resource;
					_tmp117_ = qlite_query_builder_with_null (_tmp112_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp116_);
					_tmp118_ = _tmp117_;
					_qlite_statement_builder_unref0 (_tmp118_);
				}
			}
		}
		_tmp119_ = builder;
		_tmp120_ = qlite_query_builder_single (_tmp119_);
		_tmp121_ = _tmp120_;
		_tmp122_ = qlite_query_builder_row (_tmp121_);
		_tmp123_ = _tmp122_;
		_tmp124_ = qlite_row_option_is_present (_tmp123_);
		_qlite_row_option_unref0 (_tmp123_);
		_qlite_statement_builder_unref0 (_tmp121_);
		duplicate = _tmp124_;
		result = duplicate;
		_qlite_statement_builder_unref0 (builder);
		_g_object_unref0 (account);
		return result;
	}
	_tmp125_ = self->priv->db;
	_tmp126_ = dino_database_get_message (_tmp125_);
	_tmp127_ = _tmp126_;
	_tmp128_ = qlite_table_select ((QliteTable*) _tmp127_, NULL, (gint) 0);
	_tmp129_ = _tmp128_;
	_tmp130_ = self->priv->db;
	_tmp131_ = dino_database_get_message (_tmp130_);
	_tmp132_ = _tmp131_;
	_tmp133_ = _tmp132_->account_id;
	_tmp134_ = account;
	_tmp135_ = dino_entities_account_get_id (_tmp134_);
	_tmp136_ = _tmp135_;
	_tmp137_ = qlite_query_builder_with (_tmp129_, G_TYPE_INT, NULL, NULL, _tmp133_, "=", (gpointer) ((gintptr) _tmp136_));
	_tmp138_ = _tmp137_;
	_tmp139_ = self->priv->db;
	_tmp140_ = dino_database_get_message (_tmp139_);
	_tmp141_ = _tmp140_;
	_tmp142_ = _tmp141_->counterpart_id;
	_tmp143_ = self->priv->db;
	_tmp144_ = dino_entities_message_get_counterpart (message);
	_tmp145_ = _tmp144_;
	_tmp146_ = qlite_query_builder_with (_tmp138_, G_TYPE_INT, NULL, NULL, _tmp142_, "=", (gpointer) ((gintptr) dino_database_get_jid_id (_tmp143_, _tmp145_)));
	_tmp147_ = _tmp146_;
	_tmp148_ = self->priv->db;
	_tmp149_ = dino_database_get_message (_tmp148_);
	_tmp150_ = _tmp149_;
	_tmp151_ = _tmp150_->body;
	_tmp152_ = dino_entities_message_get_body (message);
	_tmp153_ = _tmp152_;
	_tmp154_ = qlite_query_builder_with (_tmp147_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp151_, "=", _tmp153_);
	_tmp155_ = _tmp154_;
	_tmp156_ = self->priv->db;
	_tmp157_ = dino_database_get_message (_tmp156_);
	_tmp158_ = _tmp157_;
	_tmp159_ = _tmp158_->time;
	_tmp160_ = dino_entities_message_get_time (message);
	_tmp161_ = _tmp160_;
	_tmp162_ = g_date_time_add_minutes (_tmp161_, 1);
	_tmp163_ = _tmp162_;
	_tmp164_ = qlite_query_builder_with (_tmp155_, G_TYPE_LONG, NULL, NULL, _tmp159_, "<", (gpointer) ((gintptr) g_date_time_to_unix (_tmp163_)));
	_tmp165_ = _tmp164_;
	_tmp166_ = self->priv->db;
	_tmp167_ = dino_database_get_message (_tmp166_);
	_tmp168_ = _tmp167_;
	_tmp169_ = _tmp168_->time;
	_tmp170_ = dino_entities_message_get_time (message);
	_tmp171_ = _tmp170_;
	_tmp172_ = g_date_time_add_minutes (_tmp171_, -1);
	_tmp173_ = _tmp172_;
	_tmp174_ = qlite_query_builder_with (_tmp165_, G_TYPE_LONG, NULL, NULL, _tmp169_, ">", (gpointer) ((gintptr) g_date_time_to_unix (_tmp173_)));
	_tmp175_ = _tmp174_;
	_g_date_time_unref0 (_tmp173_);
	_qlite_statement_builder_unref0 (_tmp165_);
	_g_date_time_unref0 (_tmp163_);
	_qlite_statement_builder_unref0 (_tmp155_);
	_qlite_statement_builder_unref0 (_tmp147_);
	_qlite_statement_builder_unref0 (_tmp138_);
	_qlite_statement_builder_unref0 (_tmp129_);
	builder = _tmp175_;
	_tmp176_ = dino_entities_message_get_stanza_id (message);
	_tmp177_ = _tmp176_;
	if (_tmp177_ != NULL) {
		QliteQueryBuilder* _tmp178_;
		DinoDatabase* _tmp179_;
		DinoDatabaseMessageTable* _tmp180_;
		DinoDatabaseMessageTable* _tmp181_;
		QliteColumn* _tmp182_;
		const gchar* _tmp183_;
		const gchar* _tmp184_;
		QliteQueryBuilder* _tmp185_;
		QliteQueryBuilder* _tmp186_;
		_tmp178_ = builder;
		_tmp179_ = self->priv->db;
		_tmp180_ = dino_database_get_message (_tmp179_);
		_tmp181_ = _tmp180_;
		_tmp182_ = _tmp181_->stanza_id;
		_tmp183_ = dino_entities_message_get_stanza_id (message);
		_tmp184_ = _tmp183_;
		_tmp185_ = qlite_query_builder_with (_tmp178_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp182_, "=", _tmp184_);
		_tmp186_ = _tmp185_;
		_qlite_statement_builder_unref0 (_tmp186_);
	} else {
		QliteQueryBuilder* _tmp187_;
		DinoDatabase* _tmp188_;
		DinoDatabaseMessageTable* _tmp189_;
		DinoDatabaseMessageTable* _tmp190_;
		QliteColumn* _tmp191_;
		QliteQueryBuilder* _tmp192_;
		QliteQueryBuilder* _tmp193_;
		_tmp187_ = builder;
		_tmp188_ = self->priv->db;
		_tmp189_ = dino_database_get_message (_tmp188_);
		_tmp190_ = _tmp189_;
		_tmp191_ = _tmp190_->stanza_id;
		_tmp192_ = qlite_query_builder_with_null (_tmp187_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp191_);
		_tmp193_ = _tmp192_;
		_qlite_statement_builder_unref0 (_tmp193_);
	}
	_tmp194_ = dino_entities_message_get_counterpart (message);
	_tmp195_ = _tmp194_;
	_tmp196_ = _tmp195_->resourcepart;
	if (_tmp196_ != NULL) {
		QliteQueryBuilder* _tmp197_;
		DinoDatabase* _tmp198_;
		DinoDatabaseMessageTable* _tmp199_;
		DinoDatabaseMessageTable* _tmp200_;
		QliteColumn* _tmp201_;
		XmppJid* _tmp202_;
		XmppJid* _tmp203_;
		const gchar* _tmp204_;
		QliteQueryBuilder* _tmp205_;
		QliteQueryBuilder* _tmp206_;
		_tmp197_ = builder;
		_tmp198_ = self->priv->db;
		_tmp199_ = dino_database_get_message (_tmp198_);
		_tmp200_ = _tmp199_;
		_tmp201_ = _tmp200_->counterpart_resource;
		_tmp202_ = dino_entities_message_get_counterpart (message);
		_tmp203_ = _tmp202_;
		_tmp204_ = _tmp203_->resourcepart;
		_tmp205_ = qlite_query_builder_with (_tmp197_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp201_, "=", _tmp204_);
		_tmp206_ = _tmp205_;
		_qlite_statement_builder_unref0 (_tmp206_);
	} else {
		QliteQueryBuilder* _tmp207_;
		DinoDatabase* _tmp208_;
		DinoDatabaseMessageTable* _tmp209_;
		DinoDatabaseMessageTable* _tmp210_;
		QliteColumn* _tmp211_;
		QliteQueryBuilder* _tmp212_;
		QliteQueryBuilder* _tmp213_;
		_tmp207_ = builder;
		_tmp208_ = self->priv->db;
		_tmp209_ = dino_database_get_message (_tmp208_);
		_tmp210_ = _tmp209_;
		_tmp211_ = _tmp210_->counterpart_resource;
		_tmp212_ = qlite_query_builder_with_null (_tmp207_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp211_);
		_tmp213_ = _tmp212_;
		_qlite_statement_builder_unref0 (_tmp213_);
	}
	_tmp214_ = builder;
	result = qlite_query_builder_count (_tmp214_) > ((gint64) 0);
	_qlite_statement_builder_unref0 (builder);
	_g_object_unref0 (account);
	return result;
}

DinoEntitiesMessage*
dino_message_processor_create_out_message (DinoMessageProcessor* self,
                                           const gchar* text,
                                           DinoEntitiesConversation* conversation)
{
	DinoEntitiesMessage* message = NULL;
	DinoEntitiesMessage* _tmp0_;
	DinoEntitiesMessage* _tmp1_;
	DinoEntitiesMessage* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	DinoEntitiesMessage* _tmp5_;
	DinoEntitiesAccount* _tmp6_;
	DinoEntitiesAccount* _tmp7_;
	DinoEntitiesMessage* _tmp8_;
	GDateTime* now = NULL;
	GDateTime* _tmp9_;
	GDateTime* _tmp10_;
	GDateTime* _tmp11_;
	GDateTime* _tmp12_;
	DinoEntitiesMessage* _tmp13_;
	GDateTime* _tmp14_;
	DinoEntitiesMessage* _tmp15_;
	GDateTime* _tmp16_;
	DinoEntitiesMessage* _tmp17_;
	DinoEntitiesMessage* _tmp18_;
	XmppJid* _tmp19_;
	XmppJid* _tmp20_;
	DinoEntitiesConversationType _tmp21_;
	DinoEntitiesConversationType _tmp22_;
	DinoEntitiesMessage* _tmp50_;
	DinoEntitiesMessage* _tmp51_;
	DinoEntitiesEncryption _tmp52_;
	DinoEntitiesEncryption _tmp53_;
	DinoStreamInteractor* _tmp54_;
	DinoModuleIdentity* _tmp55_;
	gpointer _tmp56_;
	DinoMessageStorage* _tmp57_;
	DinoEntitiesMessage* _tmp58_;
	DinoEntitiesMessage* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	_tmp0_ = dino_entities_message_new (text);
	message = _tmp0_;
	_tmp1_ = message;
	dino_entities_message_set_type_ (_tmp1_, dino_util_get_message_type_for_conversation (conversation));
	_tmp2_ = message;
	_tmp3_ = xmpp_random_uuid ();
	_tmp4_ = _tmp3_;
	dino_entities_message_set_stanza_id (_tmp2_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = message;
	_tmp6_ = dino_entities_conversation_get_account (conversation);
	_tmp7_ = _tmp6_;
	dino_entities_message_set_account (_tmp5_, _tmp7_);
	_tmp8_ = message;
	dino_entities_message_set_body (_tmp8_, text);
	_tmp9_ = g_date_time_new_now_utc ();
	_tmp10_ = _tmp9_;
	_tmp11_ = g_date_time_new_from_unix_utc (g_date_time_to_unix (_tmp10_));
	_tmp12_ = _tmp11_;
	_g_date_time_unref0 (_tmp10_);
	now = _tmp12_;
	_tmp13_ = message;
	_tmp14_ = now;
	dino_entities_message_set_time (_tmp13_, _tmp14_);
	_tmp15_ = message;
	_tmp16_ = now;
	dino_entities_message_set_local_time (_tmp15_, _tmp16_);
	_tmp17_ = message;
	dino_entities_message_set_direction (_tmp17_, DINO_ENTITIES_MESSAGE_DIRECTION_SENT);
	_tmp18_ = message;
	_tmp19_ = dino_entities_conversation_get_counterpart (conversation);
	_tmp20_ = _tmp19_;
	dino_entities_message_set_counterpart (_tmp18_, _tmp20_);
	_tmp21_ = dino_entities_conversation_get_type_ (conversation);
	_tmp22_ = _tmp21_;
	if (_tmp22_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		XmppJid* _tmp23_ = NULL;
		DinoStreamInteractor* _tmp24_;
		DinoModuleIdentity* _tmp25_;
		gpointer _tmp26_;
		DinoMucManager* _tmp27_;
		XmppJid* _tmp28_;
		XmppJid* _tmp29_;
		DinoEntitiesAccount* _tmp30_;
		DinoEntitiesAccount* _tmp31_;
		XmppJid* _tmp32_;
		XmppJid* _tmp33_;
		DinoEntitiesMessage* _tmp38_;
		DinoEntitiesMessage* _tmp39_;
		DinoEntitiesAccount* _tmp40_;
		DinoEntitiesAccount* _tmp41_;
		XmppJid* _tmp42_;
		XmppJid* _tmp43_;
		XmppJid* _tmp44_;
		_tmp24_ = self->priv->stream_interactor;
		_tmp25_ = dino_muc_manager_IDENTITY;
		_tmp26_ = dino_stream_interactor_get_module (_tmp24_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp25_);
		_tmp27_ = (DinoMucManager*) _tmp26_;
		_tmp28_ = dino_entities_conversation_get_counterpart (conversation);
		_tmp29_ = _tmp28_;
		_tmp30_ = dino_entities_conversation_get_account (conversation);
		_tmp31_ = _tmp30_;
		_tmp32_ = dino_muc_manager_get_own_jid (_tmp27_, _tmp29_, _tmp31_);
		_tmp33_ = _tmp32_;
		_g_object_unref0 (_tmp27_);
		_tmp23_ = _tmp33_;
		if (_tmp23_ == NULL) {
			DinoEntitiesAccount* _tmp34_;
			DinoEntitiesAccount* _tmp35_;
			XmppJid* _tmp36_;
			XmppJid* _tmp37_;
			_tmp34_ = dino_entities_conversation_get_account (conversation);
			_tmp35_ = _tmp34_;
			_tmp36_ = dino_entities_account_get_bare_jid (_tmp35_);
			_tmp37_ = _tmp36_;
			_xmpp_jid_unref0 (_tmp23_);
			_tmp23_ = _tmp37_;
		}
		_tmp38_ = message;
		dino_entities_message_set_ourpart (_tmp38_, _tmp23_);
		_tmp39_ = message;
		_tmp40_ = dino_entities_conversation_get_account (conversation);
		_tmp41_ = _tmp40_;
		_tmp42_ = dino_entities_account_get_bare_jid (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = _tmp43_;
		dino_entities_message_set_real_jid (_tmp39_, _tmp44_);
		_xmpp_jid_unref0 (_tmp44_);
		_xmpp_jid_unref0 (_tmp23_);
	} else {
		DinoEntitiesMessage* _tmp45_;
		DinoEntitiesAccount* _tmp46_;
		DinoEntitiesAccount* _tmp47_;
		XmppJid* _tmp48_;
		XmppJid* _tmp49_;
		_tmp45_ = message;
		_tmp46_ = dino_entities_conversation_get_account (conversation);
		_tmp47_ = _tmp46_;
		_tmp48_ = dino_entities_account_get_full_jid (_tmp47_);
		_tmp49_ = _tmp48_;
		dino_entities_message_set_ourpart (_tmp45_, _tmp49_);
	}
	_tmp50_ = message;
	dino_entities_message_set_marked (_tmp50_, DINO_ENTITIES_MESSAGE_MARKED_UNSENT);
	_tmp51_ = message;
	_tmp52_ = dino_entities_conversation_get_encryption (conversation);
	_tmp53_ = _tmp52_;
	dino_entities_message_set_encryption (_tmp51_, _tmp53_);
	_tmp54_ = self->priv->stream_interactor;
	_tmp55_ = dino_message_storage_IDENTITY;
	_tmp56_ = dino_stream_interactor_get_module (_tmp54_, DINO_TYPE_MESSAGE_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp55_);
	_tmp57_ = (DinoMessageStorage*) _tmp56_;
	_tmp58_ = message;
	dino_message_storage_add_message (_tmp57_, _tmp58_, conversation);
	_g_object_unref0 (_tmp57_);
	result = message;
	_g_date_time_unref0 (now);
	return result;
}

static Block21Data*
block21_data_ref (Block21Data* _data21_)
{
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}

static void
block21_data_unref (void * _userdata_)
{
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		DinoMessageProcessor* self;
		self = _data21_->self;
		_g_object_unref0 (_data21_->stream);
		_g_object_unref0 (_data21_->message);
		_g_object_unref0 (_data21_->conversation);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}

static gboolean
____lambda87_ (Block21Data* _data21_)
{
	DinoMessageProcessor* self;
	DinoEntitiesAccount* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	gboolean result;
	self = _data21_->self;
	_tmp0_ = dino_entities_conversation_get_account (_data21_->conversation);
	_tmp1_ = _tmp0_;
	dino_message_processor_send_unsent_chat_messages (self, _tmp1_);
	result = FALSE;
	return result;
}

static gboolean
_____lambda87__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda87_ (self);
	return result;
}

static void
__lambda86_ (Block21Data* _data21_,
             GObject* _,
             GAsyncResult* res)
{
	DinoMessageProcessor* self;
	GError* _inner_error0_ = NULL;
	self = _data21_->self;
	g_return_if_fail (res != NULL);
	{
		XmppXmppStream* _tmp0_;
		XmppModuleIdentity* _tmp1_;
		gpointer _tmp2_;
		XmppMessageModule* _tmp3_;
		DinoEntitiesMessageMarked _tmp4_;
		DinoEntitiesMessageMarked _tmp5_;
		XmppJid* current_own_jid = NULL;
		XmppXmppStream* _tmp6_;
		XmppFlagIdentity* _tmp7_;
		gpointer _tmp8_;
		XmppBindFlag* _tmp9_;
		XmppJid* _tmp10_;
		XmppJid* _tmp11_;
		XmppJid* _tmp12_;
		gboolean _tmp13_ = FALSE;
		gboolean _tmp14_ = FALSE;
		DinoEntitiesConversationType _tmp15_;
		DinoEntitiesConversationType _tmp16_;
		_tmp0_ = _data21_->stream;
		_tmp1_ = xmpp_message_module_IDENTITY;
		_tmp2_ = xmpp_xmpp_stream_get_module (_tmp0_, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
		_tmp3_ = (XmppMessageModule*) _tmp2_;
		xmpp_message_module_send_message_finish (_tmp3_, res, &_inner_error0_);
		_g_object_unref0 (_tmp3_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp4_ = dino_entities_message_get_marked (_data21_->message);
		_tmp5_ = _tmp4_;
		if (_tmp5_ == DINO_ENTITIES_MESSAGE_MARKED_SENDING) {
			dino_entities_message_set_marked (_data21_->message, DINO_ENTITIES_MESSAGE_MARKED_SENT);
		}
		_tmp6_ = _data21_->stream;
		_tmp7_ = xmpp_bind_flag_IDENTITY;
		_tmp8_ = xmpp_xmpp_stream_get_flag (_tmp6_, XMPP_BIND_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp7_);
		_tmp9_ = (XmppBindFlag*) _tmp8_;
		_tmp10_ = _tmp9_->my_jid;
		_tmp11_ = _xmpp_jid_ref0 (_tmp10_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (_tmp9_);
		current_own_jid = _tmp12_;
		_tmp15_ = dino_entities_conversation_get_type_ (_data21_->conversation);
		_tmp16_ = _tmp15_;
		if (!dino_entities_conversation_type_is_muc_semantic (_tmp16_)) {
			XmppJid* _tmp17_;
			_tmp17_ = current_own_jid;
			_tmp14_ = _tmp17_ != NULL;
		} else {
			_tmp14_ = FALSE;
		}
		if (_tmp14_) {
			XmppJid* _tmp18_;
			XmppJid* _tmp19_;
			XmppJid* _tmp20_;
			_tmp18_ = current_own_jid;
			_tmp19_ = dino_entities_message_get_ourpart (_data21_->message);
			_tmp20_ = _tmp19_;
			_tmp13_ = !xmpp_jid_equals (_tmp18_, _tmp20_);
		} else {
			_tmp13_ = FALSE;
		}
		if (_tmp13_) {
			XmppJid* _tmp21_;
			_tmp21_ = current_own_jid;
			dino_entities_message_set_ourpart (_data21_->message, _tmp21_);
		}
		_xmpp_jid_unref0 (current_own_jid);
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		XmppXmppStream* _tmp22_;
		DinoStreamInteractor* _tmp23_;
		DinoEntitiesAccount* _tmp24_;
		DinoEntitiesAccount* _tmp25_;
		XmppXmppStream* _tmp26_;
		XmppXmppStream* _tmp27_;
		gboolean _tmp28_;
		g_clear_error (&_inner_error0_);
		dino_entities_message_set_marked (_data21_->message, DINO_ENTITIES_MESSAGE_MARKED_UNSENT);
		_tmp22_ = _data21_->stream;
		_tmp23_ = self->priv->stream_interactor;
		_tmp24_ = dino_entities_conversation_get_account (_data21_->conversation);
		_tmp25_ = _tmp24_;
		_tmp26_ = dino_stream_interactor_get_stream (_tmp23_, _tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = _tmp22_ != _tmp27_;
		_g_object_unref0 (_tmp27_);
		if (_tmp28_) {
			g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 3, _____lambda87__gsource_func, block21_data_ref (_data21_), block21_data_unref);
		}
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda86__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda86_ (self, source_object, res);
	block21_data_unref (self);
}

void
dino_message_processor_send_xmpp_message (DinoMessageProcessor* self,
                                          DinoEntitiesMessage* message,
                                          DinoEntitiesConversation* conversation,
                                          gboolean delayed)
{
	Block21Data* _data21_;
	DinoEntitiesMessage* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	DinoStreamInteractor* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	DinoEntitiesAccount* _tmp4_;
	XmppXmppStream* _tmp5_;
	XmppXmppStream* _tmp6_;
	XmppMessageStanza* new_message = NULL;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	XmppMessageStanza* _tmp9_;
	XmppMessageStanza* _tmp10_;
	XmppJid* _tmp11_;
	XmppJid* _tmp12_;
	XmppMessageStanza* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	DinoEntitiesConversationType _tmp16_;
	DinoEntitiesConversationType _tmp17_;
	gint _tmp20_;
	gint _tmp21_;
	XmppMessageStanza* _tmp59_;
	GeeList* _tmp60_;
	GeeList* _tmp61_;
	XmppMessageStanza* _tmp62_;
	XmppMessageStanza* _tmp63_;
	gboolean _tmp64_ = FALSE;
	DinoEntitiesMessageMarked _tmp65_;
	DinoEntitiesMessageMarked _tmp66_;
	DinoEntitiesConversationType _tmp72_;
	DinoEntitiesConversationType _tmp73_;
	DinoStreamInteractor* _tmp84_;
	XmppXmppStream* _tmp86_;
	XmppModuleIdentity* _tmp87_;
	gpointer _tmp88_;
	XmppMessageModule* _tmp89_;
	XmppXmppStream* _tmp90_;
	XmppMessageStanza* _tmp91_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	g_return_if_fail (conversation != NULL);
	_data21_ = g_slice_new0 (Block21Data);
	_data21_->_ref_count_ = 1;
	_data21_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (message);
	_g_object_unref0 (_data21_->message);
	_data21_->message = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data21_->conversation);
	_data21_->conversation = _tmp1_;
	_tmp2_ = self->priv->stream_interactor;
	_tmp3_ = dino_entities_conversation_get_account (_data21_->conversation);
	_tmp4_ = _tmp3_;
	_tmp5_ = dino_stream_interactor_get_stream (_tmp2_, _tmp4_);
	_data21_->stream = _tmp5_;
	dino_entities_message_set_marked (_data21_->message, DINO_ENTITIES_MESSAGE_MARKED_SENDING);
	_tmp6_ = _data21_->stream;
	if (_tmp6_ == NULL) {
		dino_entities_message_set_marked (_data21_->message, DINO_ENTITIES_MESSAGE_MARKED_UNSENT);
		block21_data_unref (_data21_);
		_data21_ = NULL;
		return;
	}
	_tmp7_ = dino_entities_message_get_stanza_id (_data21_->message);
	_tmp8_ = _tmp7_;
	_tmp9_ = xmpp_message_stanza_new (_tmp8_);
	new_message = _tmp9_;
	_tmp10_ = new_message;
	_tmp11_ = dino_entities_message_get_counterpart (_data21_->message);
	_tmp12_ = _tmp11_;
	xmpp_stanza_set_to ((XmppStanza*) _tmp10_, _tmp12_);
	_tmp13_ = new_message;
	_tmp14_ = dino_entities_message_get_body (_data21_->message);
	_tmp15_ = _tmp14_;
	xmpp_message_stanza_set_body (_tmp13_, _tmp15_);
	_tmp16_ = dino_entities_conversation_get_type_ (_data21_->conversation);
	_tmp17_ = _tmp16_;
	if (_tmp17_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		XmppMessageStanza* _tmp18_;
		_tmp18_ = new_message;
		xmpp_stanza_set_type_ ((XmppStanza*) _tmp18_, XMPP_MESSAGE_STANZA_TYPE_GROUPCHAT);
	} else {
		XmppMessageStanza* _tmp19_;
		_tmp19_ = new_message;
		xmpp_stanza_set_type_ ((XmppStanza*) _tmp19_, XMPP_MESSAGE_STANZA_TYPE_CHAT);
	}
	_tmp20_ = dino_entities_message_get_quoted_item_id (_data21_->message);
	_tmp21_ = _tmp20_;
	if (_tmp21_ != 0) {
		DinoContentItem* quoted_content_item = NULL;
		DinoStreamInteractor* _tmp22_;
		DinoModuleIdentity* _tmp23_;
		gpointer _tmp24_;
		DinoContentItemStore* _tmp25_;
		gint _tmp26_;
		gint _tmp27_;
		DinoContentItem* _tmp28_;
		DinoContentItem* _tmp29_;
		DinoContentItem* _tmp30_;
		_tmp22_ = self->priv->stream_interactor;
		_tmp23_ = dino_content_item_store_IDENTITY;
		_tmp24_ = dino_stream_interactor_get_module (_tmp22_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp23_);
		_tmp25_ = (DinoContentItemStore*) _tmp24_;
		_tmp26_ = dino_entities_message_get_quoted_item_id (_data21_->message);
		_tmp27_ = _tmp26_;
		_tmp28_ = dino_content_item_store_get_item_by_id (_tmp25_, _data21_->conversation, _tmp27_);
		_tmp29_ = _tmp28_;
		_g_object_unref0 (_tmp25_);
		quoted_content_item = _tmp29_;
		_tmp30_ = quoted_content_item;
		if (_tmp30_ != NULL) {
			XmppJid* quoted_sender = NULL;
			XmppJid* _tmp31_;
			XmppJid* _tmp32_;
			XmppJid* _tmp33_;
			gchar* quoted_stanza_id = NULL;
			DinoStreamInteractor* _tmp34_;
			DinoModuleIdentity* _tmp35_;
			gpointer _tmp36_;
			DinoContentItemStore* _tmp37_;
			DinoContentItem* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			gboolean _tmp41_ = FALSE;
			XmppJid* _tmp42_;
			_tmp31_ = dino_entities_message_get_from (_data21_->message);
			_tmp32_ = _tmp31_;
			_tmp33_ = _xmpp_jid_ref0 (_tmp32_);
			quoted_sender = _tmp33_;
			_tmp34_ = self->priv->stream_interactor;
			_tmp35_ = dino_content_item_store_IDENTITY;
			_tmp36_ = dino_stream_interactor_get_module (_tmp34_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp35_);
			_tmp37_ = (DinoContentItemStore*) _tmp36_;
			_tmp38_ = quoted_content_item;
			_tmp39_ = dino_content_item_store_get_message_id_for_content_item (_tmp37_, _data21_->conversation, _tmp38_);
			_tmp40_ = _tmp39_;
			_g_object_unref0 (_tmp37_);
			quoted_stanza_id = _tmp40_;
			_tmp42_ = quoted_sender;
			if (_tmp42_ != NULL) {
				const gchar* _tmp43_;
				_tmp43_ = quoted_stanza_id;
				_tmp41_ = _tmp43_ != NULL;
			} else {
				_tmp41_ = FALSE;
			}
			if (_tmp41_) {
				XmppMessageStanza* _tmp44_;
				XmppJid* _tmp45_;
				const gchar* _tmp46_;
				XmppXepRepliesReplyTo* _tmp47_;
				XmppXepRepliesReplyTo* _tmp48_;
				_tmp44_ = new_message;
				_tmp45_ = quoted_sender;
				_tmp46_ = quoted_stanza_id;
				_tmp47_ = xmpp_xep_replies_reply_to_new (_tmp45_, _tmp46_);
				_tmp48_ = _tmp47_;
				xmpp_xep_replies_set_reply_to (_tmp44_, _tmp48_);
				_xmpp_xep_replies_reply_to_unref0 (_tmp48_);
			}
			{
				GeeList* _fallback_list = NULL;
				GeeList* _tmp49_;
				gint _fallback_size = 0;
				GeeList* _tmp50_;
				gint _tmp51_;
				gint _tmp52_;
				gint _fallback_index = 0;
				_tmp49_ = dino_entities_message_get_fallbacks (_data21_->message);
				_fallback_list = _tmp49_;
				_tmp50_ = _fallback_list;
				_tmp51_ = gee_collection_get_size ((GeeCollection*) _tmp50_);
				_tmp52_ = _tmp51_;
				_fallback_size = _tmp52_;
				_fallback_index = -1;
				while (TRUE) {
					gint _tmp53_;
					gint _tmp54_;
					XmppXepFallbackIndicationFallback* fallback = NULL;
					GeeList* _tmp55_;
					gpointer _tmp56_;
					XmppMessageStanza* _tmp57_;
					XmppXepFallbackIndicationFallback* _tmp58_;
					_fallback_index = _fallback_index + 1;
					_tmp53_ = _fallback_index;
					_tmp54_ = _fallback_size;
					if (!(_tmp53_ < _tmp54_)) {
						break;
					}
					_tmp55_ = _fallback_list;
					_tmp56_ = gee_list_get (_tmp55_, _fallback_index);
					fallback = (XmppXepFallbackIndicationFallback*) _tmp56_;
					_tmp57_ = new_message;
					_tmp58_ = fallback;
					xmpp_xep_fallback_indication_set_fallback (_tmp57_, _tmp58_);
					_xmpp_xep_fallback_indication_fallback_unref0 (fallback);
				}
				_g_object_unref0 (_fallback_list);
			}
			_g_free0 (quoted_stanza_id);
			_xmpp_jid_unref0 (quoted_sender);
		}
		_g_object_unref0 (quoted_content_item);
	}
	_tmp59_ = new_message;
	_tmp60_ = dino_entities_message_get_markups (_data21_->message);
	_tmp61_ = _tmp60_;
	xmpp_xep_message_markup_add_spans (_tmp59_, _tmp61_);
	_g_object_unref0 (_tmp61_);
	_tmp62_ = new_message;
	g_signal_emit (self, dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_BUILD_MESSAGE_STANZA_SIGNAL], 0, _data21_->message, _tmp62_, _data21_->conversation);
	_tmp63_ = new_message;
	g_signal_emit (self, dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_PRE_MESSAGE_SEND_SIGNAL], 0, _data21_->message, _tmp63_, _data21_->conversation);
	_tmp65_ = dino_entities_message_get_marked (_data21_->message);
	_tmp66_ = _tmp65_;
	if (_tmp66_ == DINO_ENTITIES_MESSAGE_MARKED_UNSENT) {
		_tmp64_ = TRUE;
	} else {
		DinoEntitiesMessageMarked _tmp67_;
		DinoEntitiesMessageMarked _tmp68_;
		_tmp67_ = dino_entities_message_get_marked (_data21_->message);
		_tmp68_ = _tmp67_;
		_tmp64_ = _tmp68_ == DINO_ENTITIES_MESSAGE_MARKED_WONTSEND;
	}
	if (_tmp64_) {
		_g_object_unref0 (new_message);
		block21_data_unref (_data21_);
		_data21_ = NULL;
		return;
	}
	if (delayed) {
		XmppMessageStanza* _tmp69_;
		GDateTime* _tmp70_;
		GDateTime* _tmp71_;
		_tmp69_ = new_message;
		_tmp70_ = dino_entities_message_get_time (_data21_->message);
		_tmp71_ = _tmp70_;
		xmpp_xep_delayed_delivery_module_set_message_delay (_tmp69_, _tmp71_);
	}
	_tmp72_ = dino_entities_conversation_get_type_ (_data21_->conversation);
	_tmp73_ = _tmp72_;
	if (_tmp73_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		XmppXepMucFlag* flag = NULL;
		XmppXmppStream* _tmp74_;
		XmppFlagIdentity* _tmp75_;
		gpointer _tmp76_;
		XmppXepMucFlag* _tmp77_;
		XmppXepMucFlag* _tmp78_;
		XmppJid* _tmp79_;
		XmppJid* _tmp80_;
		_tmp74_ = _data21_->stream;
		_tmp75_ = xmpp_xep_muc_flag_IDENTITY;
		_tmp76_ = xmpp_xmpp_stream_get_flag (_tmp74_, XMPP_XEP_MUC_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp75_);
		flag = (XmppXepMucFlag*) _tmp76_;
		_tmp77_ = flag;
		if (_tmp77_ == NULL) {
			dino_entities_message_set_marked (_data21_->message, DINO_ENTITIES_MESSAGE_MARKED_UNSENT);
			_g_object_unref0 (flag);
			_g_object_unref0 (new_message);
			block21_data_unref (_data21_);
			_data21_ = NULL;
			return;
		}
		_tmp78_ = flag;
		_tmp79_ = dino_entities_conversation_get_counterpart (_data21_->conversation);
		_tmp80_ = _tmp79_;
		if (!xmpp_xep_muc_flag_has_room_feature (_tmp78_, _tmp80_, XMPP_XEP_MUC_FEATURE_STABLE_ID)) {
			XmppMessageStanza* _tmp81_;
			const gchar* _tmp82_;
			const gchar* _tmp83_;
			_tmp81_ = new_message;
			_tmp82_ = dino_entities_message_get_stanza_id (_data21_->message);
			_tmp83_ = _tmp82_;
			xmpp_xep_unique_stable_stanza_ids_set_origin_id (_tmp81_, _tmp83_);
		}
		_g_object_unref0 (flag);
	}
	_tmp84_ = self->priv->stream_interactor;
	if (dino_entities_conversation_get_send_typing_setting (_data21_->conversation, _tmp84_) == DINO_ENTITIES_CONVERSATION_SETTING_ON) {
		XmppMessageStanza* _tmp85_;
		_tmp85_ = new_message;
		xmpp_xep_chat_state_notifications_add_state_to_message (_tmp85_, XMPP_XEP_CHAT_STATE_NOTIFICATIONS_STATE_ACTIVE);
	}
	_tmp86_ = _data21_->stream;
	_tmp87_ = xmpp_message_module_IDENTITY;
	_tmp88_ = xmpp_xmpp_stream_get_module (_tmp86_, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp87_);
	_tmp89_ = (XmppMessageModule*) _tmp88_;
	_tmp90_ = _data21_->stream;
	_tmp91_ = new_message;
	xmpp_message_module_send_message (_tmp89_, _tmp90_, _tmp91_, ___lambda86__gasync_ready_callback, block21_data_ref (_data21_));
	_g_object_unref0 (_tmp89_);
	_g_object_unref0 (new_message);
	block21_data_unref (_data21_);
	_data21_ = NULL;
}

static const gchar*
dino_message_processor_real_get_id (DinoStreamInteractionModule* base)
{
	const gchar* result;
	DinoMessageProcessor* self;
	DinoModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = (DinoMessageProcessor*) base;
	_tmp0_ = dino_message_processor_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
g_cclosure_user_marshal_VOID__OBJECT_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_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), g_value_get_object (param_values + 3), data2);
}

static inline gpointer
dino_message_processor_deduplicate_message_listener_get_instance_private (DinoMessageProcessorDeduplicateMessageListener* self)
{
	return G_STRUCT_MEMBER_P (self, DinoMessageProcessorDeduplicateMessageListener_private_offset);
}

static DinoMessageProcessorDeduplicateMessageListener*
dino_message_processor_deduplicate_message_listener_construct (GType object_type,
                                                               DinoMessageProcessor* outer)
{
	DinoMessageProcessorDeduplicateMessageListener * self = NULL;
	DinoMessageProcessor* _tmp0_;
	g_return_val_if_fail (outer != NULL, NULL);
	self = (DinoMessageProcessorDeduplicateMessageListener*) dino_message_listener_construct (object_type);
	_tmp0_ = _g_object_ref0 (outer);
	_g_object_unref0 (self->priv->outer);
	self->priv->outer = _tmp0_;
	return self;
}

static DinoMessageProcessorDeduplicateMessageListener*
dino_message_processor_deduplicate_message_listener_new (DinoMessageProcessor* outer)
{
	return dino_message_processor_deduplicate_message_listener_construct (DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER, outer);
}

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

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

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

static gboolean
dino_message_processor_deduplicate_message_listener_real_run_co (DinoMessageProcessorDeduplicateMessageListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->outer;
	_data_->result = dino_message_processor_is_duplicate (_data_->_tmp0_, _data_->message, _data_->stanza, _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 const gchar*
dino_message_processor_deduplicate_message_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	DinoMessageProcessorDeduplicateMessageListener* self;
	self = (DinoMessageProcessorDeduplicateMessageListener*) base;
	result = "DEDUPLICATE";
	return result;
}

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

static void
dino_message_processor_deduplicate_message_listener_class_init (DinoMessageProcessorDeduplicateMessageListenerClass * klass,
                                                                gpointer klass_data)
{
	dino_message_processor_deduplicate_message_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoMessageProcessorDeduplicateMessageListener_private_offset);
	((DinoMessageListenerClass *) klass)->run = (void (*) (DinoMessageListener*, DinoEntitiesMessage*, XmppMessageStanza*, DinoEntitiesConversation*, GAsyncReadyCallback, gpointer)) dino_message_processor_deduplicate_message_listener_real_run;
	((DinoMessageListenerClass *) klass)->run_finish = (gboolean (*) (DinoMessageListener*, GAsyncResult*)) dino_message_processor_deduplicate_message_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) dino_message_processor_deduplicate_message_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) dino_message_processor_deduplicate_message_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_message_processor_deduplicate_message_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_message_processor_deduplicate_message_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY, dino_message_processor_deduplicate_message_listener_properties[DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY] = g_param_spec_string ("action-group", "action-group", "action-group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY, dino_message_processor_deduplicate_message_listener_properties[DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY] = g_param_spec_boxed ("after-actions", "after-actions", "after-actions", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_message_processor_deduplicate_message_listener_instance_init (DinoMessageProcessorDeduplicateMessageListener * self,
                                                                   gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	self->priv = dino_message_processor_deduplicate_message_listener_get_instance_private (self);
	_tmp0_ = g_strdup ("FILTER_EMPTY");
	_tmp1_ = g_strdup ("MUC");
	_tmp2_ = g_new0 (gchar*, 2 + 1);
	_tmp2_[0] = _tmp0_;
	_tmp2_[1] = _tmp1_;
	self->after_actions_const = _tmp2_;
	self->after_actions_const_length1 = 2;
	self->_after_actions_const_size_ = self->after_actions_const_length1;
}

static void
dino_message_processor_deduplicate_message_listener_finalize (GObject * obj)
{
	DinoMessageProcessorDeduplicateMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER, DinoMessageProcessorDeduplicateMessageListener);
	self->after_actions_const = (_vala_array_free (self->after_actions_const, self->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->outer);
	G_OBJECT_CLASS (dino_message_processor_deduplicate_message_listener_parent_class)->finalize (obj);
}

static GType
dino_message_processor_deduplicate_message_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMessageProcessorDeduplicateMessageListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_message_processor_deduplicate_message_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMessageProcessorDeduplicateMessageListener), 0, (GInstanceInitFunc) dino_message_processor_deduplicate_message_listener_instance_init, NULL };
	GType dino_message_processor_deduplicate_message_listener_type_id;
	dino_message_processor_deduplicate_message_listener_type_id = g_type_register_static (DINO_TYPE_MESSAGE_LISTENER, "DinoMessageProcessorDeduplicateMessageListener", &g_define_type_info, 0);
	DinoMessageProcessorDeduplicateMessageListener_private_offset = g_type_add_instance_private (dino_message_processor_deduplicate_message_listener_type_id, sizeof (DinoMessageProcessorDeduplicateMessageListenerPrivate));
	return dino_message_processor_deduplicate_message_listener_type_id;
}

static GType
dino_message_processor_deduplicate_message_listener_get_type (void)
{
	static volatile gsize dino_message_processor_deduplicate_message_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_message_processor_deduplicate_message_listener_type_id__once)) {
		GType dino_message_processor_deduplicate_message_listener_type_id;
		dino_message_processor_deduplicate_message_listener_type_id = dino_message_processor_deduplicate_message_listener_get_type_once ();
		g_once_init_leave (&dino_message_processor_deduplicate_message_listener_type_id__once, dino_message_processor_deduplicate_message_listener_type_id);
	}
	return dino_message_processor_deduplicate_message_listener_type_id__once;
}

static void
_vala_dino_message_processor_deduplicate_message_listener_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec)
{
	DinoMessageProcessorDeduplicateMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_MESSAGE_PROCESSOR_TYPE_DEDUPLICATE_MESSAGE_LISTENER, DinoMessageProcessorDeduplicateMessageListener);
	switch (property_id) {
		case DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case DINO_MESSAGE_PROCESSOR_DEDUPLICATE_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, xmpp_ordered_listener_get_after_actions ((XmppOrderedListener*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

static gboolean
dino_message_processor_filter_message_listener_real_run_co (DinoMessageProcessorFilterMessageListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = dino_entities_message_get_body (_data_->message);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_ == NULL) {
		_data_->_tmp3_ = xmpp_xep_stateless_file_sharing_get_file_shares (_data_->stanza);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp0_ = _data_->_tmp4_ == NULL;
		_g_object_unref0 (_data_->_tmp4_);
	} else {
		_data_->_tmp0_ = FALSE;
	}
	_data_->result = _data_->_tmp0_;
	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 DinoMessageProcessorFilterMessageListener*
dino_message_processor_filter_message_listener_construct (GType object_type)
{
	DinoMessageProcessorFilterMessageListener * self = NULL;
	self = (DinoMessageProcessorFilterMessageListener*) dino_message_listener_construct (object_type);
	return self;
}

static DinoMessageProcessorFilterMessageListener*
dino_message_processor_filter_message_listener_new (void)
{
	return dino_message_processor_filter_message_listener_construct (DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER);
}

static const gchar*
dino_message_processor_filter_message_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	DinoMessageProcessorFilterMessageListener* self;
	self = (DinoMessageProcessorFilterMessageListener*) base;
	result = "FILTER_EMPTY";
	return result;
}

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

static void
dino_message_processor_filter_message_listener_class_init (DinoMessageProcessorFilterMessageListenerClass * klass,
                                                           gpointer klass_data)
{
	dino_message_processor_filter_message_listener_parent_class = g_type_class_peek_parent (klass);
	((DinoMessageListenerClass *) klass)->run = (void (*) (DinoMessageListener*, DinoEntitiesMessage*, XmppMessageStanza*, DinoEntitiesConversation*, GAsyncReadyCallback, gpointer)) dino_message_processor_filter_message_listener_real_run;
	((DinoMessageListenerClass *) klass)->run_finish = (gboolean (*) (DinoMessageListener*, GAsyncResult*)) dino_message_processor_filter_message_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) dino_message_processor_filter_message_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) dino_message_processor_filter_message_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_message_processor_filter_message_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_message_processor_filter_message_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY, dino_message_processor_filter_message_listener_properties[DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY] = g_param_spec_string ("action-group", "action-group", "action-group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY, dino_message_processor_filter_message_listener_properties[DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY] = g_param_spec_boxed ("after-actions", "after-actions", "after-actions", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_message_processor_filter_message_listener_instance_init (DinoMessageProcessorFilterMessageListener * self,
                                                              gpointer klass)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	_tmp0_ = g_strdup ("DECRYPT");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	self->after_actions_const = _tmp1_;
	self->after_actions_const_length1 = 1;
	self->_after_actions_const_size_ = self->after_actions_const_length1;
}

static void
dino_message_processor_filter_message_listener_finalize (GObject * obj)
{
	DinoMessageProcessorFilterMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER, DinoMessageProcessorFilterMessageListener);
	self->after_actions_const = (_vala_array_free (self->after_actions_const, self->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (dino_message_processor_filter_message_listener_parent_class)->finalize (obj);
}

static GType
dino_message_processor_filter_message_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMessageProcessorFilterMessageListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_message_processor_filter_message_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMessageProcessorFilterMessageListener), 0, (GInstanceInitFunc) dino_message_processor_filter_message_listener_instance_init, NULL };
	GType dino_message_processor_filter_message_listener_type_id;
	dino_message_processor_filter_message_listener_type_id = g_type_register_static (DINO_TYPE_MESSAGE_LISTENER, "DinoMessageProcessorFilterMessageListener", &g_define_type_info, 0);
	return dino_message_processor_filter_message_listener_type_id;
}

static GType
dino_message_processor_filter_message_listener_get_type (void)
{
	static volatile gsize dino_message_processor_filter_message_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_message_processor_filter_message_listener_type_id__once)) {
		GType dino_message_processor_filter_message_listener_type_id;
		dino_message_processor_filter_message_listener_type_id = dino_message_processor_filter_message_listener_get_type_once ();
		g_once_init_leave (&dino_message_processor_filter_message_listener_type_id__once, dino_message_processor_filter_message_listener_type_id);
	}
	return dino_message_processor_filter_message_listener_type_id__once;
}

static void
_vala_dino_message_processor_filter_message_listener_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec)
{
	DinoMessageProcessorFilterMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_MESSAGE_PROCESSOR_TYPE_FILTER_MESSAGE_LISTENER, DinoMessageProcessorFilterMessageListener);
	switch (property_id) {
		case DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case DINO_MESSAGE_PROCESSOR_FILTER_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, xmpp_ordered_listener_get_after_actions ((XmppOrderedListener*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_message_processor_store_message_listener_get_instance_private (DinoMessageProcessorStoreMessageListener* self)
{
	return G_STRUCT_MEMBER_P (self, DinoMessageProcessorStoreMessageListener_private_offset);
}

static DinoMessageProcessorStoreMessageListener*
dino_message_processor_store_message_listener_construct (GType object_type,
                                                         DinoMessageProcessor* outer,
                                                         DinoStreamInteractor* stream_interactor)
{
	DinoMessageProcessorStoreMessageListener * self = NULL;
	DinoMessageProcessor* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	g_return_val_if_fail (outer != NULL, NULL);
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	self = (DinoMessageProcessorStoreMessageListener*) dino_message_listener_construct (object_type);
	_tmp0_ = _g_object_ref0 (outer);
	_g_object_unref0 (self->priv->outer);
	self->priv->outer = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp1_;
	return self;
}

static DinoMessageProcessorStoreMessageListener*
dino_message_processor_store_message_listener_new (DinoMessageProcessor* outer,
                                                   DinoStreamInteractor* stream_interactor)
{
	return dino_message_processor_store_message_listener_construct (DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER, outer, stream_interactor);
}

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

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

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

static gboolean
dino_message_processor_store_message_listener_real_run_co (DinoMessageProcessorStoreMessageListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->stream_interactor;
	_data_->_tmp1_ = dino_message_storage_IDENTITY;
	_data_->_tmp2_ = dino_stream_interactor_get_module (_data_->_tmp0_, DINO_TYPE_MESSAGE_STORAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
	_data_->_tmp3_ = (DinoMessageStorage*) _data_->_tmp2_;
	dino_message_storage_add_message (_data_->_tmp3_, _data_->message, _data_->conversation);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->result = FALSE;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static const gchar*
dino_message_processor_store_message_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	DinoMessageProcessorStoreMessageListener* self;
	self = (DinoMessageProcessorStoreMessageListener*) base;
	result = "STORE";
	return result;
}

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

static void
dino_message_processor_store_message_listener_class_init (DinoMessageProcessorStoreMessageListenerClass * klass,
                                                          gpointer klass_data)
{
	dino_message_processor_store_message_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoMessageProcessorStoreMessageListener_private_offset);
	((DinoMessageListenerClass *) klass)->run = (void (*) (DinoMessageListener*, DinoEntitiesMessage*, XmppMessageStanza*, DinoEntitiesConversation*, GAsyncReadyCallback, gpointer)) dino_message_processor_store_message_listener_real_run;
	((DinoMessageListenerClass *) klass)->run_finish = (gboolean (*) (DinoMessageListener*, GAsyncResult*)) dino_message_processor_store_message_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) dino_message_processor_store_message_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) dino_message_processor_store_message_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_message_processor_store_message_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_message_processor_store_message_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY, dino_message_processor_store_message_listener_properties[DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY] = g_param_spec_string ("action-group", "action-group", "action-group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY, dino_message_processor_store_message_listener_properties[DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY] = g_param_spec_boxed ("after-actions", "after-actions", "after-actions", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_message_processor_store_message_listener_instance_init (DinoMessageProcessorStoreMessageListener * self,
                                                             gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	self->priv = dino_message_processor_store_message_listener_get_instance_private (self);
	_tmp0_ = g_strdup ("DEDUPLICATE");
	_tmp1_ = g_strdup ("DECRYPT");
	_tmp2_ = g_strdup ("FILTER_EMPTY");
	_tmp3_ = g_new0 (gchar*, 3 + 1);
	_tmp3_[0] = _tmp0_;
	_tmp3_[1] = _tmp1_;
	_tmp3_[2] = _tmp2_;
	self->after_actions_const = _tmp3_;
	self->after_actions_const_length1 = 3;
	self->_after_actions_const_size_ = self->after_actions_const_length1;
}

static void
dino_message_processor_store_message_listener_finalize (GObject * obj)
{
	DinoMessageProcessorStoreMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER, DinoMessageProcessorStoreMessageListener);
	self->after_actions_const = (_vala_array_free (self->after_actions_const, self->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->outer);
	_g_object_unref0 (self->priv->stream_interactor);
	G_OBJECT_CLASS (dino_message_processor_store_message_listener_parent_class)->finalize (obj);
}

static GType
dino_message_processor_store_message_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMessageProcessorStoreMessageListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_message_processor_store_message_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMessageProcessorStoreMessageListener), 0, (GInstanceInitFunc) dino_message_processor_store_message_listener_instance_init, NULL };
	GType dino_message_processor_store_message_listener_type_id;
	dino_message_processor_store_message_listener_type_id = g_type_register_static (DINO_TYPE_MESSAGE_LISTENER, "DinoMessageProcessorStoreMessageListener", &g_define_type_info, 0);
	DinoMessageProcessorStoreMessageListener_private_offset = g_type_add_instance_private (dino_message_processor_store_message_listener_type_id, sizeof (DinoMessageProcessorStoreMessageListenerPrivate));
	return dino_message_processor_store_message_listener_type_id;
}

static GType
dino_message_processor_store_message_listener_get_type (void)
{
	static volatile gsize dino_message_processor_store_message_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_message_processor_store_message_listener_type_id__once)) {
		GType dino_message_processor_store_message_listener_type_id;
		dino_message_processor_store_message_listener_type_id = dino_message_processor_store_message_listener_get_type_once ();
		g_once_init_leave (&dino_message_processor_store_message_listener_type_id__once, dino_message_processor_store_message_listener_type_id);
	}
	return dino_message_processor_store_message_listener_type_id__once;
}

static void
_vala_dino_message_processor_store_message_listener_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec)
{
	DinoMessageProcessorStoreMessageListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_MESSAGE_PROCESSOR_TYPE_STORE_MESSAGE_LISTENER, DinoMessageProcessorStoreMessageListener);
	switch (property_id) {
		case DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case DINO_MESSAGE_PROCESSOR_STORE_MESSAGE_LISTENER_AFTER_ACTIONS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, xmpp_ordered_listener_get_after_actions ((XmppOrderedListener*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_message_processor_markup_listener_get_instance_private (DinoMessageProcessorMarkupListener* self)
{
	return G_STRUCT_MEMBER_P (self, DinoMessageProcessorMarkupListener_private_offset);
}

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

static DinoMessageProcessorMarkupListener*
dino_message_processor_markup_listener_new (DinoStreamInteractor* stream_interactor)
{
	return dino_message_processor_markup_listener_construct (DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER, stream_interactor);
}

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

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

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

static gboolean
dino_message_processor_markup_listener_real_run_co (DinoMessageProcessorMarkupListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_xep_message_markup_get_spans (_data_->stanza);
	_data_->markups = _data_->_tmp0_;
	_data_->_tmp1_ = dino_entities_message_get_id (_data_->message);
	_data_->_tmp2_ = _data_->_tmp1_;
	dino_entities_message_persist_markups (_data_->message, _data_->markups, _data_->_tmp2_);
	_data_->result = FALSE;
	_g_object_unref0 (_data_->markups);
	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_message_processor_markup_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	DinoMessageProcessorMarkupListener* self;
	self = (DinoMessageProcessorMarkupListener*) base;
	result = "Markup";
	return result;
}

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

static void
dino_message_processor_markup_listener_class_init (DinoMessageProcessorMarkupListenerClass * klass,
                                                   gpointer klass_data)
{
	dino_message_processor_markup_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoMessageProcessorMarkupListener_private_offset);
	((DinoMessageListenerClass *) klass)->run = (void (*) (DinoMessageListener*, DinoEntitiesMessage*, XmppMessageStanza*, DinoEntitiesConversation*, GAsyncReadyCallback, gpointer)) dino_message_processor_markup_listener_real_run;
	((DinoMessageListenerClass *) klass)->run_finish = (gboolean (*) (DinoMessageListener*, GAsyncResult*)) dino_message_processor_markup_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) dino_message_processor_markup_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) dino_message_processor_markup_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_message_processor_markup_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_message_processor_markup_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_ACTION_GROUP_PROPERTY, dino_message_processor_markup_listener_properties[DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_ACTION_GROUP_PROPERTY] = g_param_spec_string ("action-group", "action-group", "action-group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_AFTER_ACTIONS_PROPERTY, dino_message_processor_markup_listener_properties[DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_AFTER_ACTIONS_PROPERTY] = g_param_spec_boxed ("after-actions", "after-actions", "after-actions", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_message_processor_markup_listener_instance_init (DinoMessageProcessorMarkupListener * self,
                                                      gpointer klass)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	self->priv = dino_message_processor_markup_listener_get_instance_private (self);
	_tmp0_ = g_strdup ("STORE");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	self->after_actions_const = _tmp1_;
	self->after_actions_const_length1 = 1;
	self->_after_actions_const_size_ = self->after_actions_const_length1;
}

static void
dino_message_processor_markup_listener_finalize (GObject * obj)
{
	DinoMessageProcessorMarkupListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER, DinoMessageProcessorMarkupListener);
	self->after_actions_const = (_vala_array_free (self->after_actions_const, self->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->stream_interactor);
	G_OBJECT_CLASS (dino_message_processor_markup_listener_parent_class)->finalize (obj);
}

static GType
dino_message_processor_markup_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMessageProcessorMarkupListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_message_processor_markup_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMessageProcessorMarkupListener), 0, (GInstanceInitFunc) dino_message_processor_markup_listener_instance_init, NULL };
	GType dino_message_processor_markup_listener_type_id;
	dino_message_processor_markup_listener_type_id = g_type_register_static (DINO_TYPE_MESSAGE_LISTENER, "DinoMessageProcessorMarkupListener", &g_define_type_info, 0);
	DinoMessageProcessorMarkupListener_private_offset = g_type_add_instance_private (dino_message_processor_markup_listener_type_id, sizeof (DinoMessageProcessorMarkupListenerPrivate));
	return dino_message_processor_markup_listener_type_id;
}

static GType
dino_message_processor_markup_listener_get_type (void)
{
	static volatile gsize dino_message_processor_markup_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_message_processor_markup_listener_type_id__once)) {
		GType dino_message_processor_markup_listener_type_id;
		dino_message_processor_markup_listener_type_id = dino_message_processor_markup_listener_get_type_once ();
		g_once_init_leave (&dino_message_processor_markup_listener_type_id__once, dino_message_processor_markup_listener_type_id);
	}
	return dino_message_processor_markup_listener_type_id__once;
}

static void
_vala_dino_message_processor_markup_listener_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	DinoMessageProcessorMarkupListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_MESSAGE_PROCESSOR_TYPE_MARKUP_LISTENER, DinoMessageProcessorMarkupListener);
	switch (property_id) {
		case DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case DINO_MESSAGE_PROCESSOR_MARKUP_LISTENER_AFTER_ACTIONS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, xmpp_ordered_listener_get_after_actions ((XmppOrderedListener*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_message_processor_store_content_item_listener_get_instance_private (DinoMessageProcessorStoreContentItemListener* self)
{
	return G_STRUCT_MEMBER_P (self, DinoMessageProcessorStoreContentItemListener_private_offset);
}

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

static DinoMessageProcessorStoreContentItemListener*
dino_message_processor_store_content_item_listener_new (DinoStreamInteractor* stream_interactor)
{
	return dino_message_processor_store_content_item_listener_construct (DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER, stream_interactor);
}

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

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

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

static gboolean
dino_message_processor_store_content_item_listener_real_run_co (DinoMessageProcessorStoreContentItemListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dino_entities_message_get_body (_data_->message);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_ == NULL) {
		_data_->result = TRUE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _data_->self->priv->stream_interactor;
	_data_->_tmp3_ = dino_content_item_store_IDENTITY;
	_data_->_tmp4_ = dino_stream_interactor_get_module (_data_->_tmp2_, DINO_TYPE_CONTENT_ITEM_STORE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp3_);
	_data_->_tmp5_ = (DinoContentItemStore*) _data_->_tmp4_;
	dino_content_item_store_insert_message (_data_->_tmp5_, _data_->message, _data_->conversation, FALSE);
	_g_object_unref0 (_data_->_tmp5_);
	_data_->result = FALSE;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static const gchar*
dino_message_processor_store_content_item_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	DinoMessageProcessorStoreContentItemListener* self;
	self = (DinoMessageProcessorStoreContentItemListener*) base;
	result = "STORE_CONTENT_ITEM";
	return result;
}

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

static void
dino_message_processor_store_content_item_listener_class_init (DinoMessageProcessorStoreContentItemListenerClass * klass,
                                                               gpointer klass_data)
{
	dino_message_processor_store_content_item_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoMessageProcessorStoreContentItemListener_private_offset);
	((DinoMessageListenerClass *) klass)->run = (void (*) (DinoMessageListener*, DinoEntitiesMessage*, XmppMessageStanza*, DinoEntitiesConversation*, GAsyncReadyCallback, gpointer)) dino_message_processor_store_content_item_listener_real_run;
	((DinoMessageListenerClass *) klass)->run_finish = (gboolean (*) (DinoMessageListener*, GAsyncResult*)) dino_message_processor_store_content_item_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) dino_message_processor_store_content_item_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) dino_message_processor_store_content_item_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_message_processor_store_content_item_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_message_processor_store_content_item_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_ACTION_GROUP_PROPERTY, dino_message_processor_store_content_item_listener_properties[DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_ACTION_GROUP_PROPERTY] = g_param_spec_string ("action-group", "action-group", "action-group", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_AFTER_ACTIONS_PROPERTY, dino_message_processor_store_content_item_listener_properties[DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_AFTER_ACTIONS_PROPERTY] = g_param_spec_boxed ("after-actions", "after-actions", "after-actions", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_message_processor_store_content_item_listener_instance_init (DinoMessageProcessorStoreContentItemListener * self,
                                                                  gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar** _tmp6_;
	self->priv = dino_message_processor_store_content_item_listener_get_instance_private (self);
	_tmp0_ = g_strdup ("DEDUPLICATE");
	_tmp1_ = g_strdup ("DECRYPT");
	_tmp2_ = g_strdup ("FILTER_EMPTY");
	_tmp3_ = g_strdup ("STORE");
	_tmp4_ = g_strdup ("CORRECTION");
	_tmp5_ = g_strdup ("MESSAGE_REINTERPRETING");
	_tmp6_ = g_new0 (gchar*, 6 + 1);
	_tmp6_[0] = _tmp0_;
	_tmp6_[1] = _tmp1_;
	_tmp6_[2] = _tmp2_;
	_tmp6_[3] = _tmp3_;
	_tmp6_[4] = _tmp4_;
	_tmp6_[5] = _tmp5_;
	self->after_actions_const = _tmp6_;
	self->after_actions_const_length1 = 6;
	self->_after_actions_const_size_ = self->after_actions_const_length1;
}

static void
dino_message_processor_store_content_item_listener_finalize (GObject * obj)
{
	DinoMessageProcessorStoreContentItemListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER, DinoMessageProcessorStoreContentItemListener);
	self->after_actions_const = (_vala_array_free (self->after_actions_const, self->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->stream_interactor);
	G_OBJECT_CLASS (dino_message_processor_store_content_item_listener_parent_class)->finalize (obj);
}

static GType
dino_message_processor_store_content_item_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMessageProcessorStoreContentItemListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_message_processor_store_content_item_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMessageProcessorStoreContentItemListener), 0, (GInstanceInitFunc) dino_message_processor_store_content_item_listener_instance_init, NULL };
	GType dino_message_processor_store_content_item_listener_type_id;
	dino_message_processor_store_content_item_listener_type_id = g_type_register_static (DINO_TYPE_MESSAGE_LISTENER, "DinoMessageProcessorStoreContentItemListener", &g_define_type_info, 0);
	DinoMessageProcessorStoreContentItemListener_private_offset = g_type_add_instance_private (dino_message_processor_store_content_item_listener_type_id, sizeof (DinoMessageProcessorStoreContentItemListenerPrivate));
	return dino_message_processor_store_content_item_listener_type_id;
}

static GType
dino_message_processor_store_content_item_listener_get_type (void)
{
	static volatile gsize dino_message_processor_store_content_item_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_message_processor_store_content_item_listener_type_id__once)) {
		GType dino_message_processor_store_content_item_listener_type_id;
		dino_message_processor_store_content_item_listener_type_id = dino_message_processor_store_content_item_listener_get_type_once ();
		g_once_init_leave (&dino_message_processor_store_content_item_listener_type_id__once, dino_message_processor_store_content_item_listener_type_id);
	}
	return dino_message_processor_store_content_item_listener_type_id__once;
}

static void
_vala_dino_message_processor_store_content_item_listener_get_property (GObject * object,
                                                                       guint property_id,
                                                                       GValue * value,
                                                                       GParamSpec * pspec)
{
	DinoMessageProcessorStoreContentItemListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_MESSAGE_PROCESSOR_TYPE_STORE_CONTENT_ITEM_LISTENER, DinoMessageProcessorStoreContentItemListener);
	switch (property_id) {
		case DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case DINO_MESSAGE_PROCESSOR_STORE_CONTENT_ITEM_LISTENER_AFTER_ACTIONS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, xmpp_ordered_listener_get_after_actions ((XmppOrderedListener*) self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
dino_message_processor_class_init (DinoMessageProcessorClass * klass,
                                   gpointer klass_data)
{
	DinoModuleIdentity* _tmp0_;
	dino_message_processor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoMessageProcessor_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_message_processor_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_message_processor_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_MESSAGE_PROCESSOR_ID_PROPERTY, dino_message_processor_properties[DINO_MESSAGE_PROCESSOR_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_MESSAGE_RECEIVED_SIGNAL] = g_signal_new ("message-received", DINO_TYPE_MESSAGE_PROCESSOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_MESSAGE, DINO_ENTITIES_TYPE_CONVERSATION);
	dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_BUILD_MESSAGE_STANZA_SIGNAL] = g_signal_new ("build-message-stanza", DINO_TYPE_MESSAGE_PROCESSOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_OBJECT, G_TYPE_NONE, 3, DINO_ENTITIES_TYPE_MESSAGE, XMPP_TYPE_MESSAGE_STANZA, DINO_ENTITIES_TYPE_CONVERSATION);
	dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_PRE_MESSAGE_SEND_SIGNAL] = g_signal_new ("pre-message-send", DINO_TYPE_MESSAGE_PROCESSOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_OBJECT, G_TYPE_NONE, 3, DINO_ENTITIES_TYPE_MESSAGE, XMPP_TYPE_MESSAGE_STANZA, DINO_ENTITIES_TYPE_CONVERSATION);
	dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_MESSAGE_SENT_SIGNAL] = g_signal_new ("message-sent", DINO_TYPE_MESSAGE_PROCESSOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_MESSAGE, DINO_ENTITIES_TYPE_CONVERSATION);
	dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_MESSAGE_SENT_OR_RECEIVED_SIGNAL] = g_signal_new ("message-sent-or-received", DINO_TYPE_MESSAGE_PROCESSOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, DINO_ENTITIES_TYPE_MESSAGE, DINO_ENTITIES_TYPE_CONVERSATION);
	dino_message_processor_signals[DINO_MESSAGE_PROCESSOR_HISTORY_SYNCED_SIGNAL] = g_signal_new ("history-synced", DINO_TYPE_MESSAGE_PROCESSOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_ENTITIES_TYPE_ACCOUNT);
	_tmp0_ = dino_module_identity_new (DINO_TYPE_MESSAGE_PROCESSOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, "message_processor");
	dino_message_processor_IDENTITY = _tmp0_;
}

static void
dino_message_processor_dino_stream_interaction_module_interface_init (DinoStreamInteractionModuleIface * iface,
                                                                      gpointer iface_data)
{
	dino_message_processor_dino_stream_interaction_module_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_id = dino_message_processor_real_get_id;
}

static void
dino_message_processor_instance_init (DinoMessageProcessor * self,
                                      gpointer klass)
{
	DinoMessageListenerHolder* _tmp0_;
	self->priv = dino_message_processor_get_instance_private (self);
	_tmp0_ = dino_message_listener_holder_new ();
	self->received_pipeline = _tmp0_;
}

static void
dino_message_processor_finalize (GObject * obj)
{
	DinoMessageProcessor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_MESSAGE_PROCESSOR, DinoMessageProcessor);
	_dino_history_sync_unref0 (self->history_sync);
	_g_object_unref0 (self->received_pipeline);
	_g_object_unref0 (self->priv->stream_interactor);
	_qlite_database_unref0 (self->priv->db);
	G_OBJECT_CLASS (dino_message_processor_parent_class)->finalize (obj);
}

static GType
dino_message_processor_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMessageProcessorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_message_processor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMessageProcessor), 0, (GInstanceInitFunc) dino_message_processor_instance_init, NULL };
	static const GInterfaceInfo dino_stream_interaction_module_info = { (GInterfaceInitFunc) dino_message_processor_dino_stream_interaction_module_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_message_processor_type_id;
	dino_message_processor_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoMessageProcessor", &g_define_type_info, 0);
	g_type_add_interface_static (dino_message_processor_type_id, DINO_TYPE_STREAM_INTERACTION_MODULE, &dino_stream_interaction_module_info);
	DinoMessageProcessor_private_offset = g_type_add_instance_private (dino_message_processor_type_id, sizeof (DinoMessageProcessorPrivate));
	return dino_message_processor_type_id;
}

GType
dino_message_processor_get_type (void)
{
	static volatile gsize dino_message_processor_type_id__once = 0;
	if (g_once_init_enter (&dino_message_processor_type_id__once)) {
		GType dino_message_processor_type_id;
		dino_message_processor_type_id = dino_message_processor_get_type_once ();
		g_once_init_leave (&dino_message_processor_type_id__once, dino_message_processor_type_id);
	}
	return dino_message_processor_type_id__once;
}

static void
_vala_dino_message_processor_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	DinoMessageProcessor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_TYPE_MESSAGE_PROCESSOR, DinoMessageProcessor);
	switch (property_id) {
		case DINO_MESSAGE_PROCESSOR_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;
	}
}

void
dino_message_listener_run (DinoMessageListener* self,
                           DinoEntitiesMessage* message,
                           XmppMessageStanza* stanza,
                           DinoEntitiesConversation* conversation,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DinoMessageListenerClass* _klass_;
	_klass_ = DINO_MESSAGE_LISTENER_GET_CLASS (self);
	if (_klass_->run) {
		_klass_->run (self, message, stanza, conversation, _callback_, _user_data_);
	}
}

gboolean
dino_message_listener_run_finish (DinoMessageListener* self,
                                  GAsyncResult* _res_)
{
	DinoMessageListenerClass* _klass_;
	_klass_ = DINO_MESSAGE_LISTENER_GET_CLASS (self);
	if (_klass_->run_finish) {
		return _klass_->run_finish (self, _res_);
	}
	return FALSE;
}

DinoMessageListener*
dino_message_listener_construct (GType object_type)
{
	DinoMessageListener * self = NULL;
	self = (DinoMessageListener*) xmpp_ordered_listener_construct (object_type);
	return self;
}

static void
dino_message_listener_class_init (DinoMessageListenerClass * klass,
                                  gpointer klass_data)
{
	dino_message_listener_parent_class = g_type_class_peek_parent (klass);
}

static void
dino_message_listener_instance_init (DinoMessageListener * self,
                                     gpointer klass)
{
}

static GType
dino_message_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMessageListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_message_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMessageListener), 0, (GInstanceInitFunc) dino_message_listener_instance_init, NULL };
	GType dino_message_listener_type_id;
	dino_message_listener_type_id = g_type_register_static (XMPP_TYPE_ORDERED_LISTENER, "DinoMessageListener", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return dino_message_listener_type_id;
}

GType
dino_message_listener_get_type (void)
{
	static volatile gsize dino_message_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_message_listener_type_id__once)) {
		GType dino_message_listener_type_id;
		dino_message_listener_type_id = dino_message_listener_get_type_once ();
		g_once_init_leave (&dino_message_listener_type_id__once, dino_message_listener_type_id);
	}
	return dino_message_listener_type_id__once;
}

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

void
dino_message_listener_holder_run (DinoMessageListenerHolder* self,
                                  DinoEntitiesMessage* message,
                                  XmppMessageStanza* stanza,
                                  DinoEntitiesConversation* conversation,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	DinoMessageListenerHolderRunData* _data_;
	DinoMessageListenerHolder* _tmp0_;
	DinoEntitiesMessage* _tmp1_;
	XmppMessageStanza* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	g_return_if_fail (stanza != NULL);
	g_return_if_fail (conversation != NULL);
	_data_ = g_slice_new0 (DinoMessageListenerHolderRunData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_message_listener_holder_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (message);
	_g_object_unref0 (_data_->message);
	_data_->message = _tmp1_;
	_tmp2_ = _g_object_ref0 (stanza);
	_g_object_unref0 (_data_->stanza);
	_data_->stanza = _tmp2_;
	_tmp3_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp3_;
	dino_message_listener_holder_run_co (_data_);
}

gboolean
dino_message_listener_holder_run_finish (DinoMessageListenerHolder* self,
                                         GAsyncResult* _res_)
{
	gboolean result;
	DinoMessageListenerHolderRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
dino_message_listener_holder_run_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	DinoMessageListenerHolderRunData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_message_listener_holder_run_co (_data_);
}

static gboolean
dino_message_listener_holder_run_co (DinoMessageListenerHolderRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = ((XmppListenerHolder*) _data_->self)->listeners;
		_data_->_ol_list = _data_->_tmp0_;
		_data_->_tmp1_ = _data_->_ol_list;
		_data_->_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp1_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_ol_size = _data_->_tmp3_;
		_data_->_ol_index = -1;
		while (TRUE) {
			_data_->_ol_index = _data_->_ol_index + 1;
			_data_->_tmp4_ = _data_->_ol_index;
			_data_->_tmp5_ = _data_->_ol_size;
			if (!(_data_->_tmp4_ < _data_->_tmp5_)) {
				break;
			}
			_data_->_tmp6_ = _data_->_ol_list;
			_data_->_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp6_, _data_->_ol_index);
			_data_->ol = (XmppOrderedListener*) _data_->_tmp7_;
			_data_->_tmp8_ = _data_->ol;
			_data_->_tmp9_ = _g_object_ref0 (DINO_IS_MESSAGE_LISTENER (_data_->_tmp8_) ? ((DinoMessageListener*) _data_->_tmp8_) : NULL);
			_data_->l = _data_->_tmp9_;
			_data_->_tmp10_ = _data_->l;
			_data_->_state_ = 1;
			dino_message_listener_run (_data_->_tmp10_, _data_->message, _data_->stanza, _data_->conversation, dino_message_listener_holder_run_ready, _data_);
			return FALSE;
			_state_1:
			_data_->stop = dino_message_listener_run_finish (_data_->_tmp10_, _data_->_res_);
			if (_data_->stop) {
				_data_->result = TRUE;
				_g_object_unref0 (_data_->l);
				_g_object_unref0 (_data_->ol);
				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_object_unref0 (_data_->l);
			_g_object_unref0 (_data_->ol);
		}
	}
	_data_->result = FALSE;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

DinoMessageListenerHolder*
dino_message_listener_holder_construct (GType object_type)
{
	DinoMessageListenerHolder * self = NULL;
	self = (DinoMessageListenerHolder*) xmpp_listener_holder_construct (object_type);
	return self;
}

DinoMessageListenerHolder*
dino_message_listener_holder_new (void)
{
	return dino_message_listener_holder_construct (DINO_TYPE_MESSAGE_LISTENER_HOLDER);
}

static void
dino_message_listener_holder_class_init (DinoMessageListenerHolderClass * klass,
                                         gpointer klass_data)
{
	dino_message_listener_holder_parent_class = g_type_class_peek_parent (klass);
}

static void
dino_message_listener_holder_instance_init (DinoMessageListenerHolder * self,
                                            gpointer klass)
{
}

static GType
dino_message_listener_holder_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoMessageListenerHolderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_message_listener_holder_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoMessageListenerHolder), 0, (GInstanceInitFunc) dino_message_listener_holder_instance_init, NULL };
	GType dino_message_listener_holder_type_id;
	dino_message_listener_holder_type_id = g_type_register_static (XMPP_TYPE_LISTENER_HOLDER, "DinoMessageListenerHolder", &g_define_type_info, 0);
	return dino_message_listener_holder_type_id;
}

GType
dino_message_listener_holder_get_type (void)
{
	static volatile gsize dino_message_listener_holder_type_id__once = 0;
	if (g_once_init_enter (&dino_message_listener_holder_type_id__once)) {
		GType dino_message_listener_holder_type_id;
		dino_message_listener_holder_type_id = dino_message_listener_holder_get_type_once ();
		g_once_init_leave (&dino_message_listener_holder_type_id__once, dino_message_listener_holder_type_id);
	}
	return dino_message_listener_holder_type_id__once;
}

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

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

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

