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

#include "omemo.h"
#include "libdino.h"
#include <gee.h>
#include <glib-object.h>
#include <glib.h>
#include "xmpp-vala.h"
#include "qlite.h"
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include "dino_i18n.h"
#include <pango/pango.h>
#include <gio/gio.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_PLUGINS_OMEMO_BAD_MESSAGES_POPULATOR_0_PROPERTY,
	DINO_PLUGINS_OMEMO_BAD_MESSAGES_POPULATOR_ID_PROPERTY,
	DINO_PLUGINS_OMEMO_BAD_MESSAGES_POPULATOR_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_bad_messages_populator_properties[DINO_PLUGINS_OMEMO_BAD_MESSAGES_POPULATOR_NUM_PROPERTIES];
#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 _qlite_statement_builder_unref0(var) ((var == NULL) ? NULL : (var = (qlite_statement_builder_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), 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_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
enum  {
	DINO_PLUGINS_OMEMO_BAD_MESSAGE_ITEM_0_PROPERTY,
	DINO_PLUGINS_OMEMO_BAD_MESSAGE_ITEM_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_bad_message_item_properties[DINO_PLUGINS_OMEMO_BAD_MESSAGE_ITEM_NUM_PROPERTIES];
enum  {
	DINO_PLUGINS_OMEMO_BAD_MESSAGES_WIDGET_0_PROPERTY,
	DINO_PLUGINS_OMEMO_BAD_MESSAGES_WIDGET_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_bad_messages_widget_properties[DINO_PLUGINS_OMEMO_BAD_MESSAGES_WIDGET_NUM_PROPERTIES];
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

struct _DinoPluginsOmemoBadMessagesPopulatorPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoPluginsOmemoPlugin* plugin;
	DinoPluginsOmemoDatabase* db;
	DinoEntitiesConversation* current_conversation;
	DinoPluginsConversationItemCollection* item_collection;
	GeeList* bad_items;
};

struct _DinoPluginsOmemoBadMessageItemPrivate {
	DinoPluginsOmemoPlugin* plugin;
	DinoEntitiesConversation* conversation;
	XmppJid* problem_jid;
	DinoPluginsOmemoBadnessType badness_type;
};

struct _DinoPluginsOmemoBadMessagesWidgetPrivate {
	DinoPluginsOmemoPlugin* plugin;
	DinoEntitiesConversation* conversation;
	XmppJid* jid;
	GtkLabel* label;
};

static gint DinoPluginsOmemoBadMessagesPopulator_private_offset;
static gpointer dino_plugins_omemo_bad_messages_populator_parent_class = NULL;
static DinoPluginsConversationItemPopulatorIface * dino_plugins_omemo_bad_messages_populator_dino_plugins_conversation_item_populator_parent_iface = NULL;
static DinoPluginsConversationAdditionPopulatorIface * dino_plugins_omemo_bad_messages_populator_dino_plugins_conversation_addition_populator_parent_iface = NULL;
static gint DinoPluginsOmemoBadMessageItem_private_offset;
static gpointer dino_plugins_omemo_bad_message_item_parent_class = NULL;
static gint DinoPluginsOmemoBadMessagesWidget_private_offset;
static gpointer dino_plugins_omemo_bad_messages_widget_parent_class = NULL;

static void __lambda40_ (DinoPluginsOmemoBadMessagesPopulator* self,
                  DinoEntitiesAccount* account,
                  XmppJid* jid,
                  gint device_id);
static void dino_plugins_omemo_bad_messages_populator_clear_state (DinoPluginsOmemoBadMessagesPopulator* self);
static void dino_plugins_omemo_bad_messages_populator_init_state (DinoPluginsOmemoBadMessagesPopulator* self);
static void ___lambda40__dino_plugins_omemo_trust_manager_bad_message_state_updated (DinoPluginsOmemoTrustManager* _sender,
                                                                              DinoEntitiesAccount* account,
                                                                              XmppJid* jid,
                                                                              gint device_id,
                                                                              gpointer self);
static void _vala_array_add2 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void dino_plugins_omemo_bad_messages_populator_real_init (DinoPluginsConversationItemPopulator* base,
                                                          DinoEntitiesConversation* conversation,
                                                          DinoPluginsConversationItemCollection* item_collection,
                                                          DinoPluginsWidgetType type);
static void dino_plugins_omemo_bad_messages_populator_real_close (DinoPluginsConversationItemPopulator* base,
                                                           DinoEntitiesConversation* conversation);
static void dino_plugins_omemo_bad_messages_populator_real_populate_timespan (DinoPluginsConversationAdditionPopulator* base,
                                                                       DinoEntitiesConversation* conversation,
                                                                       GDateTime* after,
                                                                       GDateTime* before);
static void dino_plugins_omemo_bad_messages_populator_finalize (GObject * obj);
static GType dino_plugins_omemo_bad_messages_populator_get_type_once (void);
static void _vala_dino_plugins_omemo_bad_messages_populator_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec);
static GObject* dino_plugins_omemo_bad_message_item_real_get_widget (DinoPluginsMetaConversationItem* base,
                                                              DinoPluginsConversationItemWidgetInterface* outer,
                                                              DinoPluginsWidgetType widget_type);
static GeeList* dino_plugins_omemo_bad_message_item_real_get_item_actions (DinoPluginsMetaConversationItem* base,
                                                                    DinoPluginsWidgetType type);
static void dino_plugins_omemo_bad_message_item_finalize (GObject * obj);
static GType dino_plugins_omemo_bad_message_item_get_type_once (void);
static gboolean dino_plugins_omemo_bad_messages_widget_on_label_activate_link (DinoPluginsOmemoBadMessagesWidget* self);
static gboolean _dino_plugins_omemo_bad_messages_widget_on_label_activate_link_gtk_label_activate_link (GtkLabel* _sender,
                                                                                                 const gchar* uri,
                                                                                                 gpointer self);
static void dino_plugins_omemo_bad_messages_widget_real_dispose (GObject* base);
static void dino_plugins_omemo_bad_messages_widget_finalize (GObject * obj);
static GType dino_plugins_omemo_bad_messages_widget_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 GType
dino_plugins_omemo_badness_type_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_PLUGINS_OMEMO_BADNESS_TYPE_UNTRUSTED, "DINO_PLUGINS_OMEMO_BADNESS_TYPE_UNTRUSTED", "untrusted"}, {DINO_PLUGINS_OMEMO_BADNESS_TYPE_UNDECRYPTABLE, "DINO_PLUGINS_OMEMO_BADNESS_TYPE_UNDECRYPTABLE", "undecryptable"}, {0, NULL, NULL}};
	GType dino_plugins_omemo_badness_type_type_id;
	dino_plugins_omemo_badness_type_type_id = g_enum_register_static ("DinoPluginsOmemoBadnessType", values);
	return dino_plugins_omemo_badness_type_type_id;
}

GType
dino_plugins_omemo_badness_type_get_type (void)
{
	static volatile gsize dino_plugins_omemo_badness_type_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_badness_type_type_id__once)) {
		GType dino_plugins_omemo_badness_type_type_id;
		dino_plugins_omemo_badness_type_type_id = dino_plugins_omemo_badness_type_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_badness_type_type_id__once, dino_plugins_omemo_badness_type_type_id);
	}
	return dino_plugins_omemo_badness_type_type_id__once;
}

static inline gpointer
dino_plugins_omemo_bad_messages_populator_get_instance_private (DinoPluginsOmemoBadMessagesPopulator* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsOmemoBadMessagesPopulator_private_offset);
}

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
__lambda40_ (DinoPluginsOmemoBadMessagesPopulator* self,
             DinoEntitiesAccount* account,
             XmppJid* jid,
             gint device_id)
{
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	dino_plugins_omemo_bad_messages_populator_clear_state (self);
	dino_plugins_omemo_bad_messages_populator_init_state (self);
}

static void
___lambda40__dino_plugins_omemo_trust_manager_bad_message_state_updated (DinoPluginsOmemoTrustManager* _sender,
                                                                         DinoEntitiesAccount* account,
                                                                         XmppJid* jid,
                                                                         gint device_id,
                                                                         gpointer self)
{
	__lambda40_ ((DinoPluginsOmemoBadMessagesPopulator*) self, account, jid, device_id);
}

DinoPluginsOmemoBadMessagesPopulator*
dino_plugins_omemo_bad_messages_populator_construct (GType object_type,
                                                     DinoStreamInteractor* stream_interactor,
                                                     DinoPluginsOmemoPlugin* plugin)
{
	DinoPluginsOmemoBadMessagesPopulator * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoPluginsOmemoPlugin* _tmp1_;
	DinoPluginsOmemoDatabase* _tmp2_;
	DinoPluginsOmemoDatabase* _tmp3_;
	DinoPluginsOmemoTrustManager* _tmp4_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (plugin != NULL, NULL);
	self = (DinoPluginsOmemoBadMessagesPopulator*) 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_ = _g_object_ref0 (plugin);
	_g_object_unref0 (self->priv->plugin);
	self->priv->plugin = _tmp1_;
	_tmp2_ = plugin->db;
	_tmp3_ = _qlite_database_ref0 (_tmp2_);
	_qlite_database_unref0 (self->priv->db);
	self->priv->db = _tmp3_;
	_tmp4_ = plugin->trust_manager;
	g_signal_connect_object (_tmp4_, "bad-message-state-updated", (GCallback) ___lambda40__dino_plugins_omemo_trust_manager_bad_message_state_updated, self, 0);
	return self;
}

DinoPluginsOmemoBadMessagesPopulator*
dino_plugins_omemo_bad_messages_populator_new (DinoStreamInteractor* stream_interactor,
                                               DinoPluginsOmemoPlugin* plugin)
{
	return dino_plugins_omemo_bad_messages_populator_construct (DINO_PLUGINS_OMEMO_TYPE_BAD_MESSAGES_POPULATOR, stream_interactor, plugin);
}

static void
_vala_array_add2 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
dino_plugins_omemo_bad_messages_populator_init_state (DinoPluginsOmemoBadMessagesPopulator* self)
{
	DinoEntitiesConversation* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	DinoEntitiesConversationType _tmp2_;
	DinoEntitiesConversationType _tmp3_;
	QliteQueryBuilder* qry = NULL;
	DinoPluginsOmemoDatabase* _tmp4_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp5_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp6_;
	QliteQueryBuilder* _tmp7_;
	QliteQueryBuilder* _tmp8_;
	DinoPluginsOmemoDatabase* _tmp9_;
	DinoPluginsOmemoDatabaseIdentityTable* _tmp10_;
	DinoPluginsOmemoDatabaseIdentityTable* _tmp11_;
	DinoPluginsOmemoDatabase* _tmp12_;
	DinoPluginsOmemoDatabaseIdentityTable* _tmp13_;
	DinoPluginsOmemoDatabaseIdentityTable* _tmp14_;
	QliteColumn* _tmp15_;
	DinoPluginsOmemoDatabase* _tmp16_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp17_;
	DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp18_;
	QliteColumn* _tmp19_;
	QliteQueryBuilder* _tmp20_;
	QliteQueryBuilder* _tmp21_;
	DinoPluginsOmemoDatabase* _tmp22_;
	DinoPluginsOmemoDatabaseIdentityTable* _tmp23_;
	DinoPluginsOmemoDatabaseIdentityTable* _tmp24_;
	QliteColumn* _tmp25_;
	DinoEntitiesConversation* _tmp26_;
	DinoEntitiesAccount* _tmp27_;
	DinoEntitiesAccount* _tmp28_;
	gint _tmp29_;
	gint _tmp30_;
	QliteQueryBuilder* _tmp31_;
	QliteQueryBuilder* _tmp32_;
	gchar** _tmp33_;
	gchar** _tmp34_;
	gint _tmp34__length1;
	QliteQueryBuilder* _tmp35_;
	QliteQueryBuilder* _tmp36_;
	DinoEntitiesConversation* _tmp37_;
	DinoEntitiesConversationType _tmp38_;
	DinoEntitiesConversationType _tmp39_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->current_conversation;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->current_conversation;
	_tmp2_ = dino_entities_conversation_get_type_ (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT_PM) {
		return;
	}
	_tmp4_ = self->priv->db;
	_tmp5_ = dino_plugins_omemo_database_get_identity_meta (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = qlite_table_select ((QliteTable*) _tmp6_, NULL, (gint) 0);
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->db;
	_tmp10_ = dino_plugins_omemo_database_get_identity (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = self->priv->db;
	_tmp13_ = dino_plugins_omemo_database_get_identity (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _tmp14_->id;
	_tmp16_ = self->priv->db;
	_tmp17_ = dino_plugins_omemo_database_get_identity_meta (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = _tmp18_->identity_id;
	_tmp20_ = qlite_query_builder_join_with (_tmp8_, G_TYPE_INT, NULL, NULL, (QliteTable*) _tmp11_, _tmp15_, _tmp19_, NULL);
	_tmp21_ = _tmp20_;
	_tmp22_ = self->priv->db;
	_tmp23_ = dino_plugins_omemo_database_get_identity (_tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = _tmp24_->account_id;
	_tmp26_ = self->priv->current_conversation;
	_tmp27_ = dino_entities_conversation_get_account (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = dino_entities_account_get_id (_tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = qlite_query_builder_with (_tmp21_, G_TYPE_INT, NULL, NULL, _tmp25_, "=", (gpointer) ((gintptr) _tmp30_));
	_tmp32_ = _tmp31_;
	_tmp33_ = g_new0 (gchar*, 0 + 1);
	_tmp34_ = _tmp33_;
	_tmp34__length1 = 0;
	_tmp35_ = qlite_query_builder_where (_tmp32_, "last_message_untrusted is not NULL OR last_message_undecryptable is no" \
"t NULL", _tmp34_, (gint) 0);
	_tmp36_ = _tmp35_;
	_tmp34_ = (_vala_array_free (_tmp34_, _tmp34__length1, (GDestroyNotify) g_free), NULL);
	_qlite_statement_builder_unref0 (_tmp32_);
	_qlite_statement_builder_unref0 (_tmp21_);
	_qlite_statement_builder_unref0 (_tmp8_);
	qry = _tmp36_;
	_tmp37_ = self->priv->current_conversation;
	_tmp38_ = dino_entities_conversation_get_type_ (_tmp37_);
	_tmp39_ = _tmp38_;
	switch (_tmp39_) {
		case DINO_ENTITIES_CONVERSATION_TYPE_CHAT:
		{
			QliteQueryBuilder* _tmp40_;
			DinoPluginsOmemoDatabase* _tmp41_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp42_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp43_;
			QliteColumn* _tmp44_;
			DinoEntitiesConversation* _tmp45_;
			XmppJid* _tmp46_;
			XmppJid* _tmp47_;
			gchar* _tmp48_;
			gchar* _tmp49_;
			QliteQueryBuilder* _tmp50_;
			QliteQueryBuilder* _tmp51_;
			_tmp40_ = qry;
			_tmp41_ = self->priv->db;
			_tmp42_ = dino_plugins_omemo_database_get_identity_meta (_tmp41_);
			_tmp43_ = _tmp42_;
			_tmp44_ = _tmp43_->address_name;
			_tmp45_ = self->priv->current_conversation;
			_tmp46_ = dino_entities_conversation_get_counterpart (_tmp45_);
			_tmp47_ = _tmp46_;
			_tmp48_ = xmpp_jid_to_string (_tmp47_);
			_tmp49_ = _tmp48_;
			_tmp50_ = qlite_query_builder_with (_tmp40_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp44_, "=", _tmp49_);
			_tmp51_ = _tmp50_;
			_qlite_statement_builder_unref0 (_tmp51_);
			_g_free0 (_tmp49_);
			break;
		}
		case DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT:
		{
			gboolean is_private = FALSE;
			DinoStreamInteractor* _tmp52_;
			DinoModuleIdentity* _tmp53_;
			gpointer _tmp54_;
			DinoMucManager* _tmp55_;
			DinoEntitiesConversation* _tmp56_;
			DinoEntitiesAccount* _tmp57_;
			DinoEntitiesAccount* _tmp58_;
			DinoEntitiesConversation* _tmp59_;
			XmppJid* _tmp60_;
			XmppJid* _tmp61_;
			gboolean _tmp62_;
			GeeList* list = NULL;
			DinoStreamInteractor* _tmp63_;
			DinoModuleIdentity* _tmp64_;
			gpointer _tmp65_;
			DinoMucManager* _tmp66_;
			DinoEntitiesConversation* _tmp67_;
			XmppJid* _tmp68_;
			XmppJid* _tmp69_;
			DinoEntitiesConversation* _tmp70_;
			DinoEntitiesAccount* _tmp71_;
			DinoEntitiesAccount* _tmp72_;
			GeeList* _tmp73_;
			GeeList* _tmp74_;
			gboolean _tmp75_ = FALSE;
			GeeList* _tmp76_;
			GString* selection = NULL;
			GString* _tmp80_;
			gchar** selection_args = NULL;
			gchar** _tmp81_;
			gint selection_args_length1;
			gint _selection_args_size_;
			GString* _tmp111_;
			QliteQueryBuilder* _tmp112_;
			GString* _tmp113_;
			const gchar* _tmp114_;
			gchar** _tmp115_;
			gint _tmp115__length1;
			QliteQueryBuilder* _tmp116_;
			QliteQueryBuilder* _tmp117_;
			_tmp52_ = self->priv->stream_interactor;
			_tmp53_ = dino_muc_manager_IDENTITY;
			_tmp54_ = dino_stream_interactor_get_module (_tmp52_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp53_);
			_tmp55_ = (DinoMucManager*) _tmp54_;
			_tmp56_ = self->priv->current_conversation;
			_tmp57_ = dino_entities_conversation_get_account (_tmp56_);
			_tmp58_ = _tmp57_;
			_tmp59_ = self->priv->current_conversation;
			_tmp60_ = dino_entities_conversation_get_counterpart (_tmp59_);
			_tmp61_ = _tmp60_;
			_tmp62_ = dino_muc_manager_is_private_room (_tmp55_, _tmp58_, _tmp61_);
			_g_object_unref0 (_tmp55_);
			is_private = _tmp62_;
			if (!is_private) {
				_qlite_statement_builder_unref0 (qry);
				return;
			}
			_tmp63_ = self->priv->stream_interactor;
			_tmp64_ = dino_muc_manager_IDENTITY;
			_tmp65_ = dino_stream_interactor_get_module (_tmp63_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp64_);
			_tmp66_ = (DinoMucManager*) _tmp65_;
			_tmp67_ = self->priv->current_conversation;
			_tmp68_ = dino_entities_conversation_get_counterpart (_tmp67_);
			_tmp69_ = _tmp68_;
			_tmp70_ = self->priv->current_conversation;
			_tmp71_ = dino_entities_conversation_get_account (_tmp70_);
			_tmp72_ = _tmp71_;
			_tmp73_ = dino_muc_manager_get_offline_members (_tmp66_, _tmp69_, _tmp72_);
			_tmp74_ = _tmp73_;
			_g_object_unref0 (_tmp66_);
			list = _tmp74_;
			_tmp76_ = list;
			if (_tmp76_ == NULL) {
				_tmp75_ = TRUE;
			} else {
				GeeList* _tmp77_;
				gboolean _tmp78_;
				gboolean _tmp79_;
				_tmp77_ = list;
				_tmp78_ = gee_collection_get_is_empty ((GeeCollection*) _tmp77_);
				_tmp79_ = _tmp78_;
				_tmp75_ = _tmp79_;
			}
			if (_tmp75_) {
				_g_object_unref0 (list);
				_qlite_statement_builder_unref0 (qry);
				return;
			}
			_tmp80_ = g_string_new ("");
			selection = _tmp80_;
			_tmp81_ = g_new0 (gchar*, 0 + 1);
			selection_args = _tmp81_;
			selection_args_length1 = 0;
			_selection_args_size_ = selection_args_length1;
			{
				GeeList* _jid_list = NULL;
				GeeList* _tmp82_;
				gint _jid_size = 0;
				GeeList* _tmp83_;
				gint _tmp84_;
				gint _tmp85_;
				gint _jid_index = 0;
				_tmp82_ = list;
				_jid_list = _tmp82_;
				_tmp83_ = _jid_list;
				_tmp84_ = gee_collection_get_size ((GeeCollection*) _tmp83_);
				_tmp85_ = _tmp84_;
				_jid_size = _tmp85_;
				_jid_index = -1;
				while (TRUE) {
					gint _tmp86_;
					gint _tmp87_;
					XmppJid* jid = NULL;
					GeeList* _tmp88_;
					gpointer _tmp89_;
					GString* _tmp90_;
					XmppJid* _tmp109_;
					gchar* _tmp110_;
					_jid_index = _jid_index + 1;
					_tmp86_ = _jid_index;
					_tmp87_ = _jid_size;
					if (!(_tmp86_ < _tmp87_)) {
						break;
					}
					_tmp88_ = _jid_list;
					_tmp89_ = gee_list_get (_tmp88_, _jid_index);
					jid = (XmppJid*) _tmp89_;
					_tmp90_ = selection;
					if (_tmp90_->len == ((gssize) 0)) {
						GString* _tmp91_;
						DinoPluginsOmemoDatabase* _tmp92_;
						DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp93_;
						DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp94_;
						QliteColumn* _tmp95_;
						gchar* _tmp96_;
						gchar* _tmp97_;
						gchar* _tmp98_;
						gchar* _tmp99_;
						_tmp91_ = selection;
						_tmp92_ = self->priv->db;
						_tmp93_ = dino_plugins_omemo_database_get_identity_meta (_tmp92_);
						_tmp94_ = _tmp93_;
						_tmp95_ = _tmp94_->address_name;
						_tmp96_ = qlite_column_to_string (_tmp95_);
						_tmp97_ = _tmp96_;
						_tmp98_ = g_strconcat (" (", _tmp97_, " = ?", NULL);
						_tmp99_ = _tmp98_;
						g_string_append (_tmp91_, _tmp99_);
						_g_free0 (_tmp99_);
						_g_free0 (_tmp97_);
					} else {
						GString* _tmp100_;
						DinoPluginsOmemoDatabase* _tmp101_;
						DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp102_;
						DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp103_;
						QliteColumn* _tmp104_;
						gchar* _tmp105_;
						gchar* _tmp106_;
						gchar* _tmp107_;
						gchar* _tmp108_;
						_tmp100_ = selection;
						_tmp101_ = self->priv->db;
						_tmp102_ = dino_plugins_omemo_database_get_identity_meta (_tmp101_);
						_tmp103_ = _tmp102_;
						_tmp104_ = _tmp103_->address_name;
						_tmp105_ = qlite_column_to_string (_tmp104_);
						_tmp106_ = _tmp105_;
						_tmp107_ = g_strconcat (" OR ", _tmp106_, " = ?", NULL);
						_tmp108_ = _tmp107_;
						g_string_append (_tmp100_, _tmp108_);
						_g_free0 (_tmp108_);
						_g_free0 (_tmp106_);
					}
					_tmp109_ = jid;
					_tmp110_ = xmpp_jid_to_string (_tmp109_);
					_vala_array_add2 (&selection_args, &selection_args_length1, &_selection_args_size_, _tmp110_);
					_xmpp_jid_unref0 (jid);
				}
			}
			_tmp111_ = selection;
			g_string_append (_tmp111_, ")");
			_tmp112_ = qry;
			_tmp113_ = selection;
			_tmp114_ = _tmp113_->str;
			_tmp115_ = selection_args;
			_tmp115__length1 = selection_args_length1;
			_tmp116_ = qlite_query_builder_where (_tmp112_, _tmp114_, _tmp115_, (gint) _tmp115__length1);
			_tmp117_ = _tmp116_;
			_qlite_statement_builder_unref0 (_tmp117_);
			selection_args = (_vala_array_free (selection_args, selection_args_length1, (GDestroyNotify) g_free), NULL);
			_g_string_free0 (selection);
			_g_object_unref0 (list);
			break;
		}
		case DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT_PM:
		{
			break;
		}
		default:
		break;
	}
	{
		QliteRowIterator* _row_it = NULL;
		QliteQueryBuilder* _tmp118_;
		QliteRowIterator* _tmp119_;
		_tmp118_ = qry;
		_tmp119_ = qlite_query_builder_iterator (_tmp118_);
		_row_it = _tmp119_;
		while (TRUE) {
			QliteRowIterator* _tmp120_;
			QliteRow* row = NULL;
			QliteRowIterator* _tmp121_;
			QliteRow* _tmp122_;
			XmppJid* jid = NULL;
			QliteRow* _tmp123_;
			DinoPluginsOmemoDatabase* _tmp124_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp125_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp126_;
			QliteColumn* _tmp127_;
			gpointer _tmp128_;
			gchar* _tmp129_;
			XmppJid* _tmp130_;
			XmppJid* _tmp131_;
			DinoPluginsOmemoDatabase* _tmp132_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp133_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp134_;
			QliteColumn* _tmp135_;
			QliteRow* _tmp136_;
			DinoPluginsOmemoDatabase* _tmp153_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp154_;
			DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp155_;
			QliteColumn* _tmp156_;
			QliteRow* _tmp157_;
			_tmp120_ = _row_it;
			if (!qlite_row_iterator_next (_tmp120_)) {
				break;
			}
			_tmp121_ = _row_it;
			_tmp122_ = qlite_row_iterator_get (_tmp121_);
			row = _tmp122_;
			_tmp123_ = row;
			_tmp124_ = self->priv->db;
			_tmp125_ = dino_plugins_omemo_database_get_identity_meta (_tmp124_);
			_tmp126_ = _tmp125_;
			_tmp127_ = _tmp126_->address_name;
			_tmp128_ = qlite_row_get (_tmp123_, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp127_);
			_tmp129_ = (gchar*) _tmp128_;
			_tmp130_ = xmpp_jid_new (_tmp129_, &_inner_error0_);
			_tmp131_ = _tmp130_;
			_g_free0 (_tmp129_);
			jid = _tmp131_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_qlite_row_unref0 (row);
				_qlite_row_iterator_unref0 (_row_it);
				_qlite_statement_builder_unref0 (qry);
				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;
			}
			_tmp132_ = self->priv->db;
			_tmp133_ = dino_plugins_omemo_database_get_identity_meta (_tmp132_);
			_tmp134_ = _tmp133_;
			_tmp135_ = _tmp134_->last_message_untrusted;
			_tmp136_ = row;
			if (!qlite_column_is_null (_tmp135_, _tmp136_, QLITE_COLUMN_DEFAULT_TABLE_NAME)) {
				GDateTime* time = NULL;
				QliteRow* _tmp137_;
				DinoPluginsOmemoDatabase* _tmp138_;
				DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp139_;
				DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp140_;
				QliteColumn* _tmp141_;
				gpointer _tmp142_;
				GDateTime* _tmp143_;
				DinoPluginsOmemoBadMessageItem* item = NULL;
				DinoPluginsOmemoPlugin* _tmp144_;
				DinoEntitiesConversation* _tmp145_;
				XmppJid* _tmp146_;
				GDateTime* _tmp147_;
				DinoPluginsOmemoBadMessageItem* _tmp148_;
				GeeList* _tmp149_;
				DinoPluginsOmemoBadMessageItem* _tmp150_;
				DinoPluginsConversationItemCollection* _tmp151_;
				DinoPluginsOmemoBadMessageItem* _tmp152_;
				_tmp137_ = row;
				_tmp138_ = self->priv->db;
				_tmp139_ = dino_plugins_omemo_database_get_identity_meta (_tmp138_);
				_tmp140_ = _tmp139_;
				_tmp141_ = _tmp140_->last_message_untrusted;
				_tmp142_ = qlite_row_get (_tmp137_, G_TYPE_LONG, NULL, NULL, _tmp141_);
				_tmp143_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp142_)));
				time = _tmp143_;
				_tmp144_ = self->priv->plugin;
				_tmp145_ = self->priv->current_conversation;
				_tmp146_ = jid;
				_tmp147_ = time;
				_tmp148_ = dino_plugins_omemo_bad_message_item_new (_tmp144_, _tmp145_, _tmp146_, _tmp147_, DINO_PLUGINS_OMEMO_BADNESS_TYPE_UNTRUSTED);
				item = _tmp148_;
				_tmp149_ = self->priv->bad_items;
				_tmp150_ = item;
				gee_collection_add ((GeeCollection*) _tmp149_, _tmp150_);
				_tmp151_ = self->priv->item_collection;
				_tmp152_ = item;
				dino_plugins_conversation_item_collection_insert_item (_tmp151_, (DinoPluginsMetaConversationItem*) _tmp152_);
				_g_object_unref0 (item);
				_g_date_time_unref0 (time);
			}
			_tmp153_ = self->priv->db;
			_tmp154_ = dino_plugins_omemo_database_get_identity_meta (_tmp153_);
			_tmp155_ = _tmp154_;
			_tmp156_ = _tmp155_->last_message_undecryptable;
			_tmp157_ = row;
			if (!qlite_column_is_null (_tmp156_, _tmp157_, QLITE_COLUMN_DEFAULT_TABLE_NAME)) {
				GDateTime* time = NULL;
				QliteRow* _tmp158_;
				DinoPluginsOmemoDatabase* _tmp159_;
				DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp160_;
				DinoPluginsOmemoDatabaseIdentityMetaTable* _tmp161_;
				QliteColumn* _tmp162_;
				gpointer _tmp163_;
				GDateTime* _tmp164_;
				DinoPluginsOmemoBadMessageItem* item = NULL;
				DinoPluginsOmemoPlugin* _tmp165_;
				DinoEntitiesConversation* _tmp166_;
				XmppJid* _tmp167_;
				GDateTime* _tmp168_;
				DinoPluginsOmemoBadMessageItem* _tmp169_;
				GeeList* _tmp170_;
				DinoPluginsOmemoBadMessageItem* _tmp171_;
				DinoPluginsConversationItemCollection* _tmp172_;
				DinoPluginsOmemoBadMessageItem* _tmp173_;
				_tmp158_ = row;
				_tmp159_ = self->priv->db;
				_tmp160_ = dino_plugins_omemo_database_get_identity_meta (_tmp159_);
				_tmp161_ = _tmp160_;
				_tmp162_ = _tmp161_->last_message_undecryptable;
				_tmp163_ = qlite_row_get (_tmp158_, G_TYPE_LONG, NULL, NULL, _tmp162_);
				_tmp164_ = g_date_time_new_from_unix_utc ((gint64) ((glong) ((gintptr) _tmp163_)));
				time = _tmp164_;
				_tmp165_ = self->priv->plugin;
				_tmp166_ = self->priv->current_conversation;
				_tmp167_ = jid;
				_tmp168_ = time;
				_tmp169_ = dino_plugins_omemo_bad_message_item_new (_tmp165_, _tmp166_, _tmp167_, _tmp168_, DINO_PLUGINS_OMEMO_BADNESS_TYPE_UNDECRYPTABLE);
				item = _tmp169_;
				_tmp170_ = self->priv->bad_items;
				_tmp171_ = item;
				gee_collection_add ((GeeCollection*) _tmp170_, _tmp171_);
				_tmp172_ = self->priv->item_collection;
				_tmp173_ = item;
				dino_plugins_conversation_item_collection_insert_item (_tmp172_, (DinoPluginsMetaConversationItem*) _tmp173_);
				_g_object_unref0 (item);
				_g_date_time_unref0 (time);
			}
			_xmpp_jid_unref0 (jid);
			_qlite_row_unref0 (row);
		}
		_qlite_row_iterator_unref0 (_row_it);
	}
	_qlite_statement_builder_unref0 (qry);
}

static void
dino_plugins_omemo_bad_messages_populator_clear_state (DinoPluginsOmemoBadMessagesPopulator* self)
{
	GeeList* _tmp10_;
	g_return_if_fail (self != NULL);
	{
		GeeList* _bad_item_list = NULL;
		GeeList* _tmp0_;
		gint _bad_item_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _bad_item_index = 0;
		_tmp0_ = self->priv->bad_items;
		_bad_item_list = _tmp0_;
		_tmp1_ = _bad_item_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_bad_item_size = _tmp3_;
		_bad_item_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			DinoPluginsOmemoBadMessageItem* bad_item = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			DinoPluginsConversationItemCollection* _tmp8_;
			DinoPluginsOmemoBadMessageItem* _tmp9_;
			_bad_item_index = _bad_item_index + 1;
			_tmp4_ = _bad_item_index;
			_tmp5_ = _bad_item_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _bad_item_list;
			_tmp7_ = gee_list_get (_tmp6_, _bad_item_index);
			bad_item = (DinoPluginsOmemoBadMessageItem*) _tmp7_;
			_tmp8_ = self->priv->item_collection;
			_tmp9_ = bad_item;
			dino_plugins_conversation_item_collection_remove_item (_tmp8_, (DinoPluginsMetaConversationItem*) _tmp9_);
			_g_object_unref0 (bad_item);
		}
	}
	_tmp10_ = self->priv->bad_items;
	gee_collection_clear ((GeeCollection*) _tmp10_);
}

static void
dino_plugins_omemo_bad_messages_populator_real_init (DinoPluginsConversationItemPopulator* base,
                                                     DinoEntitiesConversation* conversation,
                                                     DinoPluginsConversationItemCollection* item_collection,
                                                     DinoPluginsWidgetType type)
{
	DinoPluginsOmemoBadMessagesPopulator * self;
	DinoEntitiesConversation* _tmp0_;
	DinoPluginsConversationItemCollection* _tmp1_;
	self = (DinoPluginsOmemoBadMessagesPopulator*) base;
	g_return_if_fail (conversation != NULL);
	g_return_if_fail (item_collection != NULL);
	_tmp0_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->current_conversation);
	self->priv->current_conversation = _tmp0_;
	_tmp1_ = _g_object_ref0 (item_collection);
	_g_object_unref0 (self->priv->item_collection);
	self->priv->item_collection = _tmp1_;
	dino_plugins_omemo_bad_messages_populator_init_state (self);
}

static void
dino_plugins_omemo_bad_messages_populator_real_close (DinoPluginsConversationItemPopulator* base,
                                                      DinoEntitiesConversation* conversation)
{
	DinoPluginsOmemoBadMessagesPopulator * self;
	self = (DinoPluginsOmemoBadMessagesPopulator*) base;
	g_return_if_fail (conversation != NULL);
	dino_plugins_omemo_bad_messages_populator_clear_state (self);
}

static void
dino_plugins_omemo_bad_messages_populator_real_populate_timespan (DinoPluginsConversationAdditionPopulator* base,
                                                                  DinoEntitiesConversation* conversation,
                                                                  GDateTime* after,
                                                                  GDateTime* before)
{
	DinoPluginsOmemoBadMessagesPopulator * self;
	self = (DinoPluginsOmemoBadMessagesPopulator*) base;
	g_return_if_fail (conversation != NULL);
	g_return_if_fail (after != NULL);
	g_return_if_fail (before != NULL);
}

static const gchar*
dino_plugins_omemo_bad_messages_populator_real_get_id (DinoPluginsConversationItemPopulator* base)
{
	const gchar* result;
	DinoPluginsOmemoBadMessagesPopulator* self;
	self = (DinoPluginsOmemoBadMessagesPopulator*) base;
	result = "bad_omemo_messages";
	return result;
}

static void
dino_plugins_omemo_bad_messages_populator_class_init (DinoPluginsOmemoBadMessagesPopulatorClass * klass,
                                                      gpointer klass_data)
{
	dino_plugins_omemo_bad_messages_populator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsOmemoBadMessagesPopulator_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_plugins_omemo_bad_messages_populator_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_bad_messages_populator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_OMEMO_BAD_MESSAGES_POPULATOR_ID_PROPERTY, dino_plugins_omemo_bad_messages_populator_properties[DINO_PLUGINS_OMEMO_BAD_MESSAGES_POPULATOR_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_plugins_omemo_bad_messages_populator_dino_plugins_conversation_item_populator_interface_init (DinoPluginsConversationItemPopulatorIface * iface,
                                                                                                   gpointer iface_data)
{
	dino_plugins_omemo_bad_messages_populator_dino_plugins_conversation_item_populator_parent_iface = g_type_interface_peek_parent (iface);
	iface->init = (void (*) (DinoPluginsConversationItemPopulator*, DinoEntitiesConversation*, DinoPluginsConversationItemCollection*, DinoPluginsWidgetType)) dino_plugins_omemo_bad_messages_populator_real_init;
	iface->close = (void (*) (DinoPluginsConversationItemPopulator*, DinoEntitiesConversation*)) dino_plugins_omemo_bad_messages_populator_real_close;
	iface->get_id = dino_plugins_omemo_bad_messages_populator_real_get_id;
}

static void
dino_plugins_omemo_bad_messages_populator_dino_plugins_conversation_addition_populator_interface_init (DinoPluginsConversationAdditionPopulatorIface * iface,
                                                                                                       gpointer iface_data)
{
	dino_plugins_omemo_bad_messages_populator_dino_plugins_conversation_addition_populator_parent_iface = g_type_interface_peek_parent (iface);
	iface->populate_timespan = (void (*) (DinoPluginsConversationAdditionPopulator*, DinoEntitiesConversation*, GDateTime*, GDateTime*)) dino_plugins_omemo_bad_messages_populator_real_populate_timespan;
}

static void
dino_plugins_omemo_bad_messages_populator_instance_init (DinoPluginsOmemoBadMessagesPopulator * self,
                                                         gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->priv = dino_plugins_omemo_bad_messages_populator_get_instance_private (self);
	_tmp0_ = gee_array_list_new (DINO_PLUGINS_OMEMO_TYPE_BAD_MESSAGE_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->bad_items = (GeeList*) _tmp0_;
}

static void
dino_plugins_omemo_bad_messages_populator_finalize (GObject * obj)
{
	DinoPluginsOmemoBadMessagesPopulator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_TYPE_BAD_MESSAGES_POPULATOR, DinoPluginsOmemoBadMessagesPopulator);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->plugin);
	_qlite_database_unref0 (self->priv->db);
	_g_object_unref0 (self->priv->current_conversation);
	_g_object_unref0 (self->priv->item_collection);
	_g_object_unref0 (self->priv->bad_items);
	G_OBJECT_CLASS (dino_plugins_omemo_bad_messages_populator_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_bad_messages_populator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoBadMessagesPopulatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_bad_messages_populator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoBadMessagesPopulator), 0, (GInstanceInitFunc) dino_plugins_omemo_bad_messages_populator_instance_init, NULL };
	static const GInterfaceInfo dino_plugins_conversation_item_populator_info = { (GInterfaceInitFunc) dino_plugins_omemo_bad_messages_populator_dino_plugins_conversation_item_populator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo dino_plugins_conversation_addition_populator_info = { (GInterfaceInitFunc) dino_plugins_omemo_bad_messages_populator_dino_plugins_conversation_addition_populator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_plugins_omemo_bad_messages_populator_type_id;
	dino_plugins_omemo_bad_messages_populator_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoPluginsOmemoBadMessagesPopulator", &g_define_type_info, 0);
	g_type_add_interface_static (dino_plugins_omemo_bad_messages_populator_type_id, DINO_PLUGINS_TYPE_CONVERSATION_ITEM_POPULATOR, &dino_plugins_conversation_item_populator_info);
	g_type_add_interface_static (dino_plugins_omemo_bad_messages_populator_type_id, DINO_PLUGINS_TYPE_CONVERSATION_ADDITION_POPULATOR, &dino_plugins_conversation_addition_populator_info);
	DinoPluginsOmemoBadMessagesPopulator_private_offset = g_type_add_instance_private (dino_plugins_omemo_bad_messages_populator_type_id, sizeof (DinoPluginsOmemoBadMessagesPopulatorPrivate));
	return dino_plugins_omemo_bad_messages_populator_type_id;
}

GType
dino_plugins_omemo_bad_messages_populator_get_type (void)
{
	static volatile gsize dino_plugins_omemo_bad_messages_populator_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_bad_messages_populator_type_id__once)) {
		GType dino_plugins_omemo_bad_messages_populator_type_id;
		dino_plugins_omemo_bad_messages_populator_type_id = dino_plugins_omemo_bad_messages_populator_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_bad_messages_populator_type_id__once, dino_plugins_omemo_bad_messages_populator_type_id);
	}
	return dino_plugins_omemo_bad_messages_populator_type_id__once;
}

static void
_vala_dino_plugins_omemo_bad_messages_populator_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec)
{
	DinoPluginsOmemoBadMessagesPopulator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_OMEMO_TYPE_BAD_MESSAGES_POPULATOR, DinoPluginsOmemoBadMessagesPopulator);
	switch (property_id) {
		case DINO_PLUGINS_OMEMO_BAD_MESSAGES_POPULATOR_ID_PROPERTY:
		g_value_set_string (value, dino_plugins_conversation_item_populator_get_id ((DinoPluginsConversationItemPopulator*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_plugins_omemo_bad_message_item_get_instance_private (DinoPluginsOmemoBadMessageItem* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsOmemoBadMessageItem_private_offset);
}

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

DinoPluginsOmemoBadMessageItem*
dino_plugins_omemo_bad_message_item_construct (GType object_type,
                                               DinoPluginsOmemoPlugin* plugin,
                                               DinoEntitiesConversation* conversation,
                                               XmppJid* jid,
                                               GDateTime* date,
                                               DinoPluginsOmemoBadnessType badness_type)
{
	DinoPluginsOmemoBadMessageItem * self = NULL;
	DinoPluginsOmemoPlugin* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	XmppJid* _tmp2_;
	g_return_val_if_fail (plugin != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	g_return_val_if_fail (date != NULL, NULL);
	self = (DinoPluginsOmemoBadMessageItem*) dino_plugins_meta_conversation_item_construct (object_type);
	_tmp0_ = _g_object_ref0 (plugin);
	_g_object_unref0 (self->priv->plugin);
	self->priv->plugin = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->conversation);
	self->priv->conversation = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (self->priv->problem_jid);
	self->priv->problem_jid = _tmp2_;
	dino_plugins_meta_conversation_item_set_time ((DinoPluginsMetaConversationItem*) self, date);
	self->priv->badness_type = badness_type;
	return self;
}

DinoPluginsOmemoBadMessageItem*
dino_plugins_omemo_bad_message_item_new (DinoPluginsOmemoPlugin* plugin,
                                         DinoEntitiesConversation* conversation,
                                         XmppJid* jid,
                                         GDateTime* date,
                                         DinoPluginsOmemoBadnessType badness_type)
{
	return dino_plugins_omemo_bad_message_item_construct (DINO_PLUGINS_OMEMO_TYPE_BAD_MESSAGE_ITEM, plugin, conversation, jid, date, badness_type);
}

static GObject*
dino_plugins_omemo_bad_message_item_real_get_widget (DinoPluginsMetaConversationItem* base,
                                                     DinoPluginsConversationItemWidgetInterface* outer,
                                                     DinoPluginsWidgetType widget_type)
{
	DinoPluginsOmemoBadMessageItem * self;
	DinoPluginsOmemoPlugin* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	XmppJid* _tmp2_;
	DinoPluginsOmemoBadMessagesWidget* _tmp3_;
	GObject* result;
	self = (DinoPluginsOmemoBadMessageItem*) base;
	g_return_val_if_fail (outer != NULL, NULL);
	_tmp0_ = self->priv->plugin;
	_tmp1_ = self->priv->conversation;
	_tmp2_ = self->priv->problem_jid;
	_tmp3_ = dino_plugins_omemo_bad_messages_widget_new (_tmp0_, _tmp1_, _tmp2_, self->priv->badness_type);
	g_object_ref_sink (_tmp3_);
	result = (GObject*) _tmp3_;
	return result;
}

static GeeList*
dino_plugins_omemo_bad_message_item_real_get_item_actions (DinoPluginsMetaConversationItem* base,
                                                           DinoPluginsWidgetType type)
{
	DinoPluginsOmemoBadMessageItem * self;
	GeeList* result;
	self = (DinoPluginsOmemoBadMessageItem*) base;
	result = NULL;
	return result;
}

static void
dino_plugins_omemo_bad_message_item_class_init (DinoPluginsOmemoBadMessageItemClass * klass,
                                                gpointer klass_data)
{
	dino_plugins_omemo_bad_message_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsOmemoBadMessageItem_private_offset);
	((DinoPluginsMetaConversationItemClass *) klass)->get_widget = (GObject* (*) (DinoPluginsMetaConversationItem*, DinoPluginsConversationItemWidgetInterface*, DinoPluginsWidgetType)) dino_plugins_omemo_bad_message_item_real_get_widget;
	((DinoPluginsMetaConversationItemClass *) klass)->get_item_actions = (GeeList* (*) (DinoPluginsMetaConversationItem*, DinoPluginsWidgetType)) dino_plugins_omemo_bad_message_item_real_get_item_actions;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_bad_message_item_finalize;
}

static void
dino_plugins_omemo_bad_message_item_instance_init (DinoPluginsOmemoBadMessageItem * self,
                                                   gpointer klass)
{
	self->priv = dino_plugins_omemo_bad_message_item_get_instance_private (self);
}

static void
dino_plugins_omemo_bad_message_item_finalize (GObject * obj)
{
	DinoPluginsOmemoBadMessageItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_TYPE_BAD_MESSAGE_ITEM, DinoPluginsOmemoBadMessageItem);
	_g_object_unref0 (self->priv->plugin);
	_g_object_unref0 (self->priv->conversation);
	_xmpp_jid_unref0 (self->priv->problem_jid);
	G_OBJECT_CLASS (dino_plugins_omemo_bad_message_item_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_bad_message_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoBadMessageItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_bad_message_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoBadMessageItem), 0, (GInstanceInitFunc) dino_plugins_omemo_bad_message_item_instance_init, NULL };
	GType dino_plugins_omemo_bad_message_item_type_id;
	dino_plugins_omemo_bad_message_item_type_id = g_type_register_static (DINO_PLUGINS_TYPE_META_CONVERSATION_ITEM, "DinoPluginsOmemoBadMessageItem", &g_define_type_info, 0);
	DinoPluginsOmemoBadMessageItem_private_offset = g_type_add_instance_private (dino_plugins_omemo_bad_message_item_type_id, sizeof (DinoPluginsOmemoBadMessageItemPrivate));
	return dino_plugins_omemo_bad_message_item_type_id;
}

GType
dino_plugins_omemo_bad_message_item_get_type (void)
{
	static volatile gsize dino_plugins_omemo_bad_message_item_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_bad_message_item_type_id__once)) {
		GType dino_plugins_omemo_bad_message_item_type_id;
		dino_plugins_omemo_bad_message_item_type_id = dino_plugins_omemo_bad_message_item_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_bad_message_item_type_id__once, dino_plugins_omemo_bad_message_item_type_id);
	}
	return dino_plugins_omemo_bad_message_item_type_id__once;
}

static inline gpointer
dino_plugins_omemo_bad_messages_widget_get_instance_private (DinoPluginsOmemoBadMessagesWidget* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsOmemoBadMessagesWidget_private_offset);
}

static gboolean
_dino_plugins_omemo_bad_messages_widget_on_label_activate_link_gtk_label_activate_link (GtkLabel* _sender,
                                                                                        const gchar* uri,
                                                                                        gpointer self)
{
	gboolean result;
	result = dino_plugins_omemo_bad_messages_widget_on_label_activate_link ((DinoPluginsOmemoBadMessagesWidget*) self);
	return result;
}

DinoPluginsOmemoBadMessagesWidget*
dino_plugins_omemo_bad_messages_widget_construct (GType object_type,
                                                  DinoPluginsOmemoPlugin* plugin,
                                                  DinoEntitiesConversation* conversation,
                                                  XmppJid* jid,
                                                  DinoPluginsOmemoBadnessType badness_type)
{
	DinoPluginsOmemoBadMessagesWidget * self = NULL;
	DinoPluginsOmemoPlugin* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	XmppJid* _tmp2_;
	gchar* who = NULL;
	gchar* _tmp3_;
	DinoEntitiesConversationType _tmp4_;
	DinoEntitiesConversationType _tmp5_;
	gchar* warning_text = NULL;
	gchar* _tmp49_;
	const gchar* _tmp64_;
	GtkLabel* _tmp65_ = NULL;
	GtkLabel* _tmp66_;
	GtkLabel* _tmp67_;
	g_return_val_if_fail (plugin != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	self = (DinoPluginsOmemoBadMessagesWidget*) g_object_new (object_type, "orientation", GTK_ORIENTATION_HORIZONTAL, "spacing", 5, NULL);
	_tmp0_ = _g_object_ref0 (plugin);
	_g_object_unref0 (self->priv->plugin);
	self->priv->plugin = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->conversation);
	self->priv->conversation = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (self->priv->jid);
	self->priv->jid = _tmp2_;
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	gtk_widget_set_visible ((GtkWidget*) self, TRUE);
	_tmp3_ = g_strdup ("");
	who = _tmp3_;
	_tmp4_ = dino_entities_conversation_get_type_ (conversation);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == DINO_ENTITIES_CONVERSATION_TYPE_CHAT) {
		DinoApplication* _tmp6_;
		DinoStreamInteractor* _tmp7_;
		DinoStreamInteractor* _tmp8_;
		gchar* _tmp9_;
		_tmp6_ = plugin->app;
		_tmp7_ = dino_application_get_stream_interactor (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = dino_get_participant_display_name (_tmp8_, conversation, jid, NULL);
		_g_free0 (who);
		who = _tmp9_;
	} else {
		DinoEntitiesConversationType _tmp10_;
		DinoEntitiesConversationType _tmp11_;
		_tmp10_ = dino_entities_conversation_get_type_ (conversation);
		_tmp11_ = _tmp10_;
		if (_tmp11_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
			gchar* _tmp12_;
			GeeList* occupants = NULL;
			DinoApplication* _tmp13_;
			DinoStreamInteractor* _tmp14_;
			DinoStreamInteractor* _tmp15_;
			DinoModuleIdentity* _tmp16_;
			gpointer _tmp17_;
			DinoMucManager* _tmp18_;
			XmppJid* _tmp19_;
			XmppJid* _tmp20_;
			DinoEntitiesAccount* _tmp21_;
			DinoEntitiesAccount* _tmp22_;
			GeeList* _tmp23_;
			GeeList* _tmp24_;
			GeeList* _tmp25_;
			_tmp12_ = xmpp_jid_to_string (jid);
			_g_free0 (who);
			who = _tmp12_;
			_tmp13_ = plugin->app;
			_tmp14_ = dino_application_get_stream_interactor (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = dino_muc_manager_IDENTITY;
			_tmp17_ = dino_stream_interactor_get_module (_tmp15_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp16_);
			_tmp18_ = (DinoMucManager*) _tmp17_;
			_tmp19_ = dino_entities_conversation_get_counterpart (conversation);
			_tmp20_ = _tmp19_;
			_tmp21_ = dino_entities_conversation_get_account (conversation);
			_tmp22_ = _tmp21_;
			_tmp23_ = dino_muc_manager_get_occupants (_tmp18_, _tmp20_, _tmp22_);
			_tmp24_ = _tmp23_;
			_g_object_unref0 (_tmp18_);
			occupants = _tmp24_;
			_tmp25_ = occupants;
			if (_tmp25_ == NULL) {
				_g_object_unref0 (occupants);
				_g_free0 (who);
				return self;
			}
			{
				GeeList* _occupant_list = NULL;
				GeeList* _tmp26_;
				gint _occupant_size = 0;
				GeeList* _tmp27_;
				gint _tmp28_;
				gint _tmp29_;
				gint _occupant_index = 0;
				_tmp26_ = occupants;
				_occupant_list = _tmp26_;
				_tmp27_ = _occupant_list;
				_tmp28_ = gee_collection_get_size ((GeeCollection*) _tmp27_);
				_tmp29_ = _tmp28_;
				_occupant_size = _tmp29_;
				_occupant_index = -1;
				while (TRUE) {
					gint _tmp30_;
					gint _tmp31_;
					XmppJid* occupant = NULL;
					GeeList* _tmp32_;
					gpointer _tmp33_;
					DinoApplication* _tmp34_;
					DinoStreamInteractor* _tmp35_;
					DinoStreamInteractor* _tmp36_;
					DinoModuleIdentity* _tmp37_;
					gpointer _tmp38_;
					DinoMucManager* _tmp39_;
					XmppJid* _tmp40_;
					DinoEntitiesAccount* _tmp41_;
					DinoEntitiesAccount* _tmp42_;
					XmppJid* _tmp43_;
					XmppJid* _tmp44_;
					gboolean _tmp45_;
					_occupant_index = _occupant_index + 1;
					_tmp30_ = _occupant_index;
					_tmp31_ = _occupant_size;
					if (!(_tmp30_ < _tmp31_)) {
						break;
					}
					_tmp32_ = _occupant_list;
					_tmp33_ = gee_list_get (_tmp32_, _occupant_index);
					occupant = (XmppJid*) _tmp33_;
					_tmp34_ = plugin->app;
					_tmp35_ = dino_application_get_stream_interactor (_tmp34_);
					_tmp36_ = _tmp35_;
					_tmp37_ = dino_muc_manager_IDENTITY;
					_tmp38_ = dino_stream_interactor_get_module (_tmp36_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp37_);
					_tmp39_ = (DinoMucManager*) _tmp38_;
					_tmp40_ = occupant;
					_tmp41_ = dino_entities_conversation_get_account (conversation);
					_tmp42_ = _tmp41_;
					_tmp43_ = dino_muc_manager_get_real_jid (_tmp39_, _tmp40_, _tmp42_);
					_tmp44_ = _tmp43_;
					_tmp45_ = xmpp_jid_equals_bare (jid, _tmp44_);
					_xmpp_jid_unref0 (_tmp44_);
					_g_object_unref0 (_tmp39_);
					if (_tmp45_) {
						XmppJid* _tmp46_;
						const gchar* _tmp47_;
						gchar* _tmp48_;
						_tmp46_ = occupant;
						_tmp47_ = _tmp46_->resourcepart;
						_tmp48_ = g_strdup (_tmp47_);
						_g_free0 (who);
						who = _tmp48_;
					}
					_xmpp_jid_unref0 (occupant);
				}
			}
			_g_object_unref0 (occupants);
		}
	}
	_tmp49_ = g_strdup ("");
	warning_text = _tmp49_;
	if (badness_type == DINO_PLUGINS_OMEMO_BADNESS_TYPE_UNTRUSTED) {
		const gchar* _tmp50_;
		const gchar* _tmp51_;
		gchar* _tmp52_;
		gchar* _tmp53_;
		const gchar* _tmp54_;
		gchar* _tmp55_;
		gchar* _tmp56_;
		gchar* _tmp57_;
		_tmp50_ = dino_gettext ("%s has been using an untrusted device. You won't see messages from dev" \
"ices that you do not trust.");
		_tmp51_ = who;
		_tmp52_ = g_strdup_printf (_tmp50_, _tmp51_);
		_tmp53_ = _tmp52_;
		_tmp54_ = dino_gettext ("Manage devices");
		_tmp55_ = g_strdup_printf (" <a href=\"\">%s</a>", _tmp54_);
		_tmp56_ = _tmp55_;
		_tmp57_ = g_strconcat (_tmp53_, _tmp56_, NULL);
		_g_free0 (warning_text);
		warning_text = _tmp57_;
		_g_free0 (_tmp56_);
		_g_free0 (_tmp53_);
	} else {
		const gchar* _tmp58_;
		const gchar* _tmp59_;
		const gchar* _tmp60_;
		gchar* _tmp61_;
		gchar* _tmp62_;
		gchar* _tmp63_;
		_tmp58_ = warning_text;
		_tmp59_ = dino_gettext ("%s does not trust this device. That means, you might be missing messag" \
"es.");
		_tmp60_ = who;
		_tmp61_ = g_strdup_printf (_tmp59_, _tmp60_);
		_tmp62_ = _tmp61_;
		_tmp63_ = g_strconcat (_tmp58_, _tmp62_, NULL);
		_g_free0 (warning_text);
		warning_text = _tmp63_;
		_g_free0 (_tmp62_);
	}
	_tmp64_ = warning_text;
	_tmp65_ = (GtkLabel*) gtk_label_new (_tmp64_);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp65_, 70);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp65_, 70);
	gtk_label_set_justify (_tmp65_, GTK_JUSTIFY_CENTER);
	gtk_label_set_use_markup (_tmp65_, TRUE);
	gtk_label_set_selectable (_tmp65_, TRUE);
	gtk_label_set_wrap (_tmp65_, TRUE);
	gtk_label_set_wrap_mode (_tmp65_, PANGO_WRAP_WORD_CHAR);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp65_, TRUE);
	g_object_ref_sink (_tmp65_);
	_g_object_unref0 (self->priv->label);
	self->priv->label = _tmp65_;
	_tmp66_ = self->priv->label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp66_, "dim-label");
	_tmp67_ = self->priv->label;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp67_);
	if (badness_type == DINO_PLUGINS_OMEMO_BADNESS_TYPE_UNTRUSTED) {
		GtkLabel* _tmp68_;
		_tmp68_ = self->priv->label;
		g_signal_connect_object (_tmp68_, "activate-link", (GCallback) _dino_plugins_omemo_bad_messages_widget_on_label_activate_link_gtk_label_activate_link, self, 0);
	}
	_g_free0 (warning_text);
	_g_free0 (who);
	return self;
}

DinoPluginsOmemoBadMessagesWidget*
dino_plugins_omemo_bad_messages_widget_new (DinoPluginsOmemoPlugin* plugin,
                                            DinoEntitiesConversation* conversation,
                                            XmppJid* jid,
                                            DinoPluginsOmemoBadnessType badness_type)
{
	return dino_plugins_omemo_bad_messages_widget_construct (DINO_PLUGINS_OMEMO_TYPE_BAD_MESSAGES_WIDGET, plugin, conversation, jid, badness_type);
}

static gboolean
dino_plugins_omemo_bad_messages_widget_on_label_activate_link (DinoPluginsOmemoBadMessagesWidget* self)
{
	GVariant* variant = NULL;
	DinoEntitiesConversation* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	GVariant** _tmp5_;
	GVariant** _tmp6_;
	gint _tmp6__length1;
	GVariant* _tmp7_;
	GVariant* _tmp8_;
	GApplication* _tmp9_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->conversation;
	_tmp1_ = dino_entities_conversation_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_variant_new_int32 ((gint32) _tmp2_);
	g_variant_ref_sink (_tmp3_);
	_tmp4_ = g_variant_new_string ("encryption");
	g_variant_ref_sink (_tmp4_);
	_tmp5_ = g_new0 (GVariant*, 2 + 1);
	_tmp5_[0] = _tmp3_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp6__length1 = 2;
	_tmp7_ = g_variant_new_tuple (_tmp6_, 2);
	g_variant_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_variant_unref), NULL);
	variant = _tmp8_;
	_tmp9_ = g_application_get_default ();
	g_action_group_activate_action ((GActionGroup*) _tmp9_, "open-conversation-details", variant);
	result = FALSE;
	_g_variant_unref0 (variant);
	return result;
}

static void
dino_plugins_omemo_bad_messages_widget_real_dispose (GObject* base)
{
	DinoPluginsOmemoBadMessagesWidget * self;
	GtkLabel* _tmp0_;
	self = (DinoPluginsOmemoBadMessagesWidget*) base;
	_tmp0_ = self->priv->label;
	if (_tmp0_ != NULL) {
		GtkLabel* _tmp1_;
		GtkLabel* _tmp2_;
		_tmp1_ = self->priv->label;
		gtk_widget_unparent ((GtkWidget*) _tmp1_);
		_tmp2_ = self->priv->label;
		g_object_run_dispose ((GObject*) _tmp2_);
		_g_object_unref0 (self->priv->label);
		self->priv->label = NULL;
	}
	G_OBJECT_CLASS (dino_plugins_omemo_bad_messages_widget_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox));
}

static void
dino_plugins_omemo_bad_messages_widget_class_init (DinoPluginsOmemoBadMessagesWidgetClass * klass,
                                                   gpointer klass_data)
{
	dino_plugins_omemo_bad_messages_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsOmemoBadMessagesWidget_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) dino_plugins_omemo_bad_messages_widget_real_dispose;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_bad_messages_widget_finalize;
}

static void
dino_plugins_omemo_bad_messages_widget_instance_init (DinoPluginsOmemoBadMessagesWidget * self,
                                                      gpointer klass)
{
	self->priv = dino_plugins_omemo_bad_messages_widget_get_instance_private (self);
}

static void
dino_plugins_omemo_bad_messages_widget_finalize (GObject * obj)
{
	DinoPluginsOmemoBadMessagesWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_TYPE_BAD_MESSAGES_WIDGET, DinoPluginsOmemoBadMessagesWidget);
	_g_object_unref0 (self->priv->plugin);
	_g_object_unref0 (self->priv->conversation);
	_xmpp_jid_unref0 (self->priv->jid);
	_g_object_unref0 (self->priv->label);
	G_OBJECT_CLASS (dino_plugins_omemo_bad_messages_widget_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_bad_messages_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoBadMessagesWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_bad_messages_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoBadMessagesWidget), 0, (GInstanceInitFunc) dino_plugins_omemo_bad_messages_widget_instance_init, NULL };
	GType dino_plugins_omemo_bad_messages_widget_type_id;
	dino_plugins_omemo_bad_messages_widget_type_id = g_type_register_static (gtk_box_get_type (), "DinoPluginsOmemoBadMessagesWidget", &g_define_type_info, 0);
	DinoPluginsOmemoBadMessagesWidget_private_offset = g_type_add_instance_private (dino_plugins_omemo_bad_messages_widget_type_id, sizeof (DinoPluginsOmemoBadMessagesWidgetPrivate));
	return dino_plugins_omemo_bad_messages_widget_type_id;
}

GType
dino_plugins_omemo_bad_messages_widget_get_type (void)
{
	static volatile gsize dino_plugins_omemo_bad_messages_widget_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_bad_messages_widget_type_id__once)) {
		GType dino_plugins_omemo_bad_messages_widget_type_id;
		dino_plugins_omemo_bad_messages_widget_type_id = dino_plugins_omemo_bad_messages_widget_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_bad_messages_widget_type_id__once, dino_plugins_omemo_bad_messages_widget_type_id);
	}
	return dino_plugins_omemo_bad_messages_widget_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;
}

