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

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

#define DINO_PLUGINS_OMEMO_NS_URI "eu.siacs.conversations.axolotl"
#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_DTLS_SRTP_VERIFICATION_DRAFT_STREAM_MODULE_0_PROPERTY,
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_STREAM_MODULE_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_STREAM_MODULE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block2Data Block2Data;
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#define _xmpp_xep_omemo_parsed_data_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_omemo_parsed_data_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _xmpp_xep_omemo_encryption_data_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_omemo_encryption_data_unref (var), NULL)))
enum  {
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_LISTENER_0_PROPERTY,
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_LISTENER_ACTION_GROUP_PROPERTY,
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_LISTENER_AFTER_ACTIONS_PROPERTY,
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_LISTENER_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_LISTENER_NUM_PROPERTIES];
typedef struct _DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData;
enum  {
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_0_PROPERTY,
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_JID_PROPERTY,
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_SID_PROPERTY,
	DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_NUM_PROPERTIES];

struct _DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModulePrivate {
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener* send_listener;
	GeeHashMap* device_id_by_jingle_sid;
	GeeHashMap* device_id_by_muji_member;
	GeeHashMap* content_names_by_jingle_sid;
};

struct _Block1Data {
	int _ref_count_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self;
	gchar* jingle_sid;
	XmppXmppStream* stream;
	XmppIqStanza* iq;
};

struct _Block2Data {
	int _ref_count_;
	Block1Data * _data1_;
	gchar* content_name;
};

struct _DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerPrivate {
	gchar** after_actions_const;
	gint after_actions_const_length1;
	gint _after_actions_const_size_;
};

struct _DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener* self;
	XmppXmppStream* stream;
	XmppMessageStanza* message;
	gboolean result;
	XmppStanzaNode* proceed_node;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* device_node;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppModuleIdentity* _tmp7_;
	gpointer _tmp8_;
	DinoPluginsOmemoStreamModule* _tmp9_;
	OmemoStore* _tmp10_;
	OmemoStore* _tmp11_;
	guint32 _tmp12_;
	guint32 _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	XmppStanzaNode* _tmp16_;
	XmppStanzaNode* _tmp17_;
	XmppStanzaNode* _tmp18_;
	XmppStanzaNode* _tmp19_;
	XmppStanzaNode* _tmp20_;
	XmppStanzaNode* _tmp21_;
};

struct _DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryptionPrivate {
	XmppJid* _jid;
	gint _sid;
};

static gint DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule_private_offset;
static gpointer dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_parent_class = NULL;
XmppModuleIdentity* dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_IDENTITY = NULL;
static gint DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener_private_offset;
static gpointer dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_parent_class = NULL;
static gint DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption_private_offset;
static gpointer dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_parent_class = NULL;

static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_incoming_iq_set_get (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                                      XmppXmppStream* stream,
                                                                                                      XmppIqStanza* iq);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static guchar* _vala_array_dup1 (guchar* self,
                          gssize length);
static void _______lambda42_ (Block2Data* _data2_,
                       GObject* _,
                       GAsyncResult* res);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_content_add_received (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                            XmppXmppStream* stream,
                                                                                            XmppXepJingleContent* content);
static void _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_content_add_received_xmpp_xep_jingle_session_additional_content_add_incoming (XmppXepJingleSession* _sender,
                                                                                                                                                     XmppXmppStream* stream,
                                                                                                                                                     XmppXepJingleContent* content,
                                                                                                                                                     gpointer self);
static void ________lambda42__gasync_ready_callback (GObject* source_object,
                                              GAsyncResult* res,
                                              gpointer self);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_outgoing_iq_set_get (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                                      XmppXmppStream* stream,
                                                                                                      XmppIqStanza* iq);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_message_received (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                        XmppXmppStream* stream,
                                                                                        XmppMessageStanza* message);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_session_initiate_received (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                                 XmppXmppStream* stream,
                                                                                                 XmppXepJingleSession* session);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_pre_send_presence_stanza (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                                XmppXmppStream* stream,
                                                                                                XmppPresenceStanza* presence);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_received_available (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                          XmppXmppStream* stream,
                                                                                          XmppPresenceStanza* presence);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_attach (XmppXmppStreamModule* base,
                                                                                XmppXmppStream* stream);
static void _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_message_received_xmpp_message_module_received_message (XmppMessageModule* _sender,
                                                                                                                              XmppXmppStream* stream,
                                                                                                                              XmppMessageStanza* message,
                                                                                                                              gpointer self);
static void _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_incoming_iq_set_get_xmpp_iq_module_preprocess_incoming_iq_set_get (XmppIqModule* _sender,
                                                                                                                                                     XmppXmppStream* stream,
                                                                                                                                                     XmppIqStanza* iq_stanza,
                                                                                                                                                     gpointer self);
static void _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_outgoing_iq_set_get_xmpp_iq_module_preprocess_outgoing_iq_set_get (XmppIqModule* _sender,
                                                                                                                                                     XmppXmppStream* stream,
                                                                                                                                                     XmppIqStanza* iq_stanza,
                                                                                                                                                     gpointer self);
static void _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_session_initiate_received_xmpp_xep_jingle_module_session_initiate_received (XmppXepJingleModule* _sender,
                                                                                                                                                   XmppXmppStream* stream,
                                                                                                                                                   XmppXepJingleSession* session,
                                                                                                                                                   gpointer self);
static void _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_pre_send_presence_stanza_xmpp_presence_module_pre_send_presence_stanza (XmppPresenceModule* _sender,
                                                                                                                                               XmppXmppStream* stream,
                                                                                                                                               XmppPresenceStanza* presence,
                                                                                                                                               gpointer self);
static void _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_received_available_xmpp_presence_module_received_available (XmppPresenceModule* _sender,
                                                                                                                                   XmppXmppStream* stream,
                                                                                                                                   XmppPresenceStanza* presence,
                                                                                                                                   gpointer self);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_detach (XmppXmppStreamModule* base,
                                                                                XmppXmppStream* stream);
static gchar* dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_get_id (XmppXmppStreamModule* base);
static void dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_finalize (GObject * obj);
static GType dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_get_type_once (void);
static void dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run_data_free (gpointer _data);
static void dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run (XmppStanzaListener* base,
                                                                                          XmppXmppStream* stream,
                                                                                          XmppMessageStanza* message,
                                                                                          GAsyncReadyCallback _callback_,
                                                                                          gpointer _user_data_);
static gboolean dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run_co (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData* _data_);
static void dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_finalize (GObject * obj);
static GType dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_type_once (void);
static void _vala_dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_property (GObject * object,
                                                                                                    guint property_id,
                                                                                                    GValue * value,
                                                                                                    GParamSpec * pspec);
static void dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_finalize (GObject * obj);
static GType dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_type_once (void);
static void _vala_dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_property (GObject * object,
                                                                                                  guint property_id,
                                                                                                  GValue * value,
                                                                                                  GParamSpec * pspec);
static void _vala_dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_property (GObject * object,
                                                                                                  guint property_id,
                                                                                                  const GValue * value,
                                                                                                  GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_get_instance_private (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule_private_offset);
}

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

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self;
		self = _data1_->self;
		_g_free0 (_data1_->jingle_sid);
		_g_object_unref0 (_data1_->stream);
		_g_object_unref0 (_data1_->iq);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self;
		self = _data2_->_data1_->self;
		_g_free0 (_data2_->content_name);
		block1_data_unref (_data2_->_data1_);
		_data2_->_data1_ = NULL;
		g_slice_free (Block2Data, _data2_);
	}
}

static guchar*
_vala_array_dup1 (guchar* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guchar));
	}
	return NULL;
}

static void
_dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_content_add_received_xmpp_xep_jingle_session_additional_content_add_incoming (XmppXepJingleSession* _sender,
                                                                                                                                                XmppXmppStream* stream,
                                                                                                                                                XmppXepJingleContent* content,
                                                                                                                                                gpointer self)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_content_add_received ((DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) self, stream, content);
}

static void
_______lambda42_ (Block2Data* _data2_,
                  GObject* _,
                  GAsyncResult* res)
{
	Block1Data* _data1_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self;
	XmppXepJingleSession* session = NULL;
	XmppFlagIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleFlag* _tmp2_;
	XmppXepJingleSession* _tmp3_;
	XmppXepJingleSession* _tmp4_;
	gboolean _tmp5_ = FALSE;
	XmppXepJingleSession* _tmp6_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* encryption = NULL;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_;
	XmppJid* _tmp14_;
	XmppJid* _tmp15_;
	GeeHashMap* _tmp16_;
	const gchar* _tmp17_;
	gpointer _tmp18_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* _tmp19_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* _tmp20_;
	XmppXepJingleSession* _tmp21_;
	GeeHashMap* _tmp22_;
	const gchar* _tmp23_;
	gpointer _tmp24_;
	XmppXepJingleContent* _tmp25_;
	GeeHashMap* _tmp26_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* _tmp27_;
	XmppStanzaNode* _tmp28_;
	const gchar* _tmp29_;
	_data1_ = _data2_->_data1_;
	self = _data1_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = xmpp_xep_jingle_flag_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_flag (_data1_->stream, XMPP_XEP_JINGLE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepJingleFlag*) _tmp1_;
	_tmp3_ = xmpp_xep_jingle_flag_get_session_finish (_tmp2_, res);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp2_);
	session = _tmp4_;
	_tmp6_ = session;
	if (_tmp6_ == NULL) {
		_tmp5_ = TRUE;
	} else {
		XmppXepJingleSession* _tmp7_;
		GeeHashMap* _tmp8_;
		const gchar* _tmp9_;
		_tmp7_ = session;
		_tmp8_ = _tmp7_->contents_map;
		_tmp9_ = _data2_->content_name;
		_tmp5_ = !gee_abstract_map_has_key ((GeeAbstractMap*) _tmp8_, _tmp9_);
	}
	if (_tmp5_) {
		_g_object_unref0 (session);
		return;
	}
	_tmp10_ = xmpp_stanza_get_from ((XmppStanza*) _data1_->iq);
	_tmp11_ = _tmp10_;
	_tmp12_ = _tmp11_;
	_tmp13_ = xmpp_jid_get_bare_jid (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp16_ = self->priv->device_id_by_jingle_sid;
	_tmp17_ = _data1_->jingle_sid;
	_tmp18_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp16_, _tmp17_);
	_tmp19_ = dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_new (DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, "OMEMO", _tmp15_, (gint) ((gintptr) _tmp18_));
	_tmp20_ = _tmp19_;
	_xmpp_jid_unref0 (_tmp15_);
	_xmpp_jid_unref0 (_tmp12_);
	encryption = _tmp20_;
	_tmp21_ = session;
	_tmp22_ = _tmp21_->contents_map;
	_tmp23_ = _data2_->content_name;
	_tmp24_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp22_, _tmp23_);
	_tmp25_ = (XmppXepJingleContent*) _tmp24_;
	_tmp26_ = _tmp25_->encryptions;
	_tmp27_ = encryption;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp26_, DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, (XmppXepJingleContentEncryption*) _tmp27_);
	_g_object_unref0 (_tmp25_);
	_tmp28_ = ((XmppStanza*) _data1_->iq)->stanza;
	_tmp29_ = xmpp_stanza_node_get_deep_attribute (_tmp28_, XMPP_XEP_JINGLE_NS_URI ":jingle", "action", NULL);
	if (g_strcmp0 (_tmp29_, "session-accept") == 0) {
		XmppXepJingleSession* _tmp30_;
		_tmp30_ = session;
		g_signal_connect_object (_tmp30_, "additional-content-add-incoming", (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_content_add_received_xmpp_xep_jingle_session_additional_content_add_incoming, self, 0);
	}
	_g_object_unref0 (encryption);
	_g_object_unref0 (session);
}

static void
________lambda42__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self)
{
	_______lambda42_ (self, source_object, res);
	block2_data_unref (self);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_incoming_iq_set_get (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                                 XmppXmppStream* stream,
                                                                                                 XmppIqStanza* iq)
{
	Block1Data* _data1_;
	XmppXmppStream* _tmp0_;
	XmppIqStanza* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GeeList* content_nodes = NULL;
	XmppStanzaNode* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	XmppStanzaNode* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	XmppXepOmemoOmemoDecryptor* decryptor = NULL;
	XmppModuleIdentity* _tmp13_;
	gpointer _tmp14_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (iq != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data1_->stream);
	_data1_->stream = _tmp0_;
	_tmp1_ = _g_object_ref0 (iq);
	_g_object_unref0 (_data1_->iq);
	_data1_->iq = _tmp1_;
	_tmp2_ = xmpp_stanza_get_type_ ((XmppStanza*) _data1_->iq);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp3_, XMPP_IQ_STANZA_TYPE_SET) != 0) {
		block1_data_unref (_data1_);
		_data1_ = NULL;
		return;
	}
	_tmp4_ = ((XmppStanza*) _data1_->iq)->stanza;
	_tmp5_ = xmpp_stanza_node_get_deep_subnodes (_tmp4_, XMPP_XEP_JINGLE_NS_URI ":jingle", XMPP_XEP_JINGLE_NS_URI ":content", NULL);
	content_nodes = _tmp5_;
	_tmp6_ = content_nodes;
	_tmp7_ = gee_collection_get_size ((GeeCollection*) _tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ == 0) {
		_g_object_unref0 (content_nodes);
		block1_data_unref (_data1_);
		_data1_ = NULL;
		return;
	}
	_tmp9_ = ((XmppStanza*) _data1_->iq)->stanza;
	_tmp10_ = xmpp_stanza_node_get_deep_attribute (_tmp9_, XMPP_XEP_JINGLE_NS_URI ":jingle", "sid", NULL);
	_tmp11_ = g_strdup (_tmp10_);
	_data1_->jingle_sid = _tmp11_;
	_tmp12_ = _data1_->jingle_sid;
	if (_tmp12_ == NULL) {
		_g_object_unref0 (content_nodes);
		block1_data_unref (_data1_);
		_data1_ = NULL;
		return;
	}
	_tmp13_ = xmpp_xep_omemo_omemo_decryptor_IDENTITY;
	_tmp14_ = xmpp_xmpp_stream_get_module (_data1_->stream, XMPP_XEP_OMEMO_TYPE_OMEMO_DECRYPTOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp13_);
	decryptor = (XmppXepOmemoOmemoDecryptor*) _tmp14_;
	{
		GeeList* _content_node_list = NULL;
		GeeList* _tmp15_;
		gint _content_node_size = 0;
		GeeList* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		gint _content_node_index = 0;
		_tmp15_ = content_nodes;
		_content_node_list = _tmp15_;
		_tmp16_ = _content_node_list;
		_tmp17_ = gee_collection_get_size ((GeeCollection*) _tmp16_);
		_tmp18_ = _tmp17_;
		_content_node_size = _tmp18_;
		_content_node_index = -1;
		while (TRUE) {
			Block2Data* _data2_;
			gint _tmp19_;
			gint _tmp20_;
			XmppStanzaNode* content_node = NULL;
			GeeList* _tmp21_;
			gpointer _tmp22_;
			XmppStanzaNode* _tmp23_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			const gchar* _tmp26_;
			XmppStanzaNode* transport_node = NULL;
			XmppStanzaNode* _tmp27_;
			XmppStanzaNode* _tmp28_;
			XmppStanzaNode* _tmp29_;
			XmppStanzaNode* fingerprint_node = NULL;
			XmppStanzaNode* _tmp30_;
			XmppStanzaNode* _tmp31_;
			XmppStanzaNode* _tmp32_;
			XmppStanzaNode* encrypted_node = NULL;
			XmppStanzaNode* _tmp33_;
			XmppStanzaNode* _tmp34_;
			XmppStanzaNode* _tmp35_;
			XmppXepOmemoParsedData* parsed_data = NULL;
			XmppXepOmemoOmemoDecryptor* _tmp36_;
			XmppStanzaNode* _tmp37_;
			XmppXepOmemoParsedData* _tmp38_;
			gboolean _tmp39_ = FALSE;
			XmppXepOmemoParsedData* _tmp40_;
			gboolean _tmp43_ = FALSE;
			GeeHashMap* _tmp44_;
			const gchar* _tmp45_;
			_data2_ = g_slice_new0 (Block2Data);
			_data2_->_ref_count_ = 1;
			_data2_->_data1_ = block1_data_ref (_data1_);
			_content_node_index = _content_node_index + 1;
			_tmp19_ = _content_node_index;
			_tmp20_ = _content_node_size;
			if (!(_tmp19_ < _tmp20_)) {
				block2_data_unref (_data2_);
				_data2_ = NULL;
				break;
			}
			_tmp21_ = _content_node_list;
			_tmp22_ = gee_list_get (_tmp21_, _content_node_index);
			content_node = (XmppStanzaNode*) _tmp22_;
			_tmp23_ = content_node;
			_tmp24_ = xmpp_stanza_node_get_attribute (_tmp23_, "name", NULL);
			_tmp25_ = g_strdup (_tmp24_);
			_data2_->content_name = _tmp25_;
			_tmp26_ = _data2_->content_name;
			if (_tmp26_ == NULL) {
				_xmpp_stanza_entry_unref0 (content_node);
				block2_data_unref (_data2_);
				_data2_ = NULL;
				continue;
			}
			_tmp27_ = content_node;
			_tmp28_ = xmpp_stanza_node_get_subnode (_tmp27_, "transport", XMPP_XEP_JINGLE_ICE_UDP_NS_URI, FALSE);
			transport_node = _tmp28_;
			_tmp29_ = transport_node;
			if (_tmp29_ == NULL) {
				_xmpp_stanza_entry_unref0 (transport_node);
				_xmpp_stanza_entry_unref0 (content_node);
				block2_data_unref (_data2_);
				_data2_ = NULL;
				continue;
			}
			_tmp30_ = transport_node;
			_tmp31_ = xmpp_stanza_node_get_subnode (_tmp30_, "fingerprint", DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, FALSE);
			fingerprint_node = _tmp31_;
			_tmp32_ = fingerprint_node;
			if (_tmp32_ == NULL) {
				_xmpp_stanza_entry_unref0 (fingerprint_node);
				_xmpp_stanza_entry_unref0 (transport_node);
				_xmpp_stanza_entry_unref0 (content_node);
				block2_data_unref (_data2_);
				_data2_ = NULL;
				continue;
			}
			_tmp33_ = fingerprint_node;
			_tmp34_ = xmpp_stanza_node_get_subnode (_tmp33_, "encrypted", DINO_PLUGINS_OMEMO_NS_URI, FALSE);
			encrypted_node = _tmp34_;
			_tmp35_ = encrypted_node;
			if (_tmp35_ == NULL) {
				_xmpp_stanza_entry_unref0 (encrypted_node);
				_xmpp_stanza_entry_unref0 (fingerprint_node);
				_xmpp_stanza_entry_unref0 (transport_node);
				_xmpp_stanza_entry_unref0 (content_node);
				block2_data_unref (_data2_);
				_data2_ = NULL;
				continue;
			}
			_tmp36_ = decryptor;
			_tmp37_ = encrypted_node;
			_tmp38_ = xmpp_xep_omemo_omemo_decryptor_parse_node (_tmp36_, _tmp37_);
			parsed_data = _tmp38_;
			_tmp40_ = parsed_data;
			if (_tmp40_ == NULL) {
				_tmp39_ = TRUE;
			} else {
				XmppXepOmemoParsedData* _tmp41_;
				guint8* _tmp42_;
				gint _tmp42__length1;
				_tmp41_ = parsed_data;
				_tmp42_ = _tmp41_->ciphertext;
				_tmp42__length1 = _tmp41_->ciphertext_length1;
				_tmp39_ = _tmp42_ == NULL;
			}
			if (_tmp39_) {
				_xmpp_xep_omemo_parsed_data_unref0 (parsed_data);
				_xmpp_stanza_entry_unref0 (encrypted_node);
				_xmpp_stanza_entry_unref0 (fingerprint_node);
				_xmpp_stanza_entry_unref0 (transport_node);
				_xmpp_stanza_entry_unref0 (content_node);
				block2_data_unref (_data2_);
				_data2_ = NULL;
				continue;
			}
			_tmp44_ = self->priv->device_id_by_jingle_sid;
			_tmp45_ = _data1_->jingle_sid;
			if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp44_, _tmp45_)) {
				GeeHashMap* _tmp46_;
				const gchar* _tmp47_;
				gpointer _tmp48_;
				XmppXepOmemoParsedData* _tmp49_;
				_tmp46_ = self->priv->device_id_by_jingle_sid;
				_tmp47_ = _data1_->jingle_sid;
				_tmp48_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp46_, _tmp47_);
				_tmp49_ = parsed_data;
				_tmp43_ = ((gint) ((gintptr) _tmp48_)) != _tmp49_->sid;
			} else {
				_tmp43_ = FALSE;
			}
			if (_tmp43_) {
				XmppJid* _tmp50_;
				XmppJid* _tmp51_;
				XmppJid* _tmp52_;
				gchar* _tmp53_;
				gchar* _tmp54_;
				GeeHashMap* _tmp55_;
				const gchar* _tmp56_;
				gpointer _tmp57_;
				XmppXepOmemoParsedData* _tmp58_;
				_tmp50_ = xmpp_stanza_get_from ((XmppStanza*) _data1_->iq);
				_tmp51_ = _tmp50_;
				_tmp52_ = _tmp51_;
				_tmp53_ = xmpp_jid_to_string (_tmp52_);
				_tmp54_ = _tmp53_;
				_tmp55_ = self->priv->device_id_by_jingle_sid;
				_tmp56_ = _data1_->jingle_sid;
				_tmp57_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp55_, _tmp56_);
				_tmp58_ = parsed_data;
				g_warning ("dtls_srtp_verification_draft.vala:42: Expected DTLS fingerprint to be " \
"OMEMO encrypted from %s %d, but it was from %d", _tmp54_, (gint) ((gintptr) _tmp57_), _tmp58_->sid);
				_g_free0 (_tmp54_);
				_xmpp_jid_unref0 (_tmp52_);
			}
			{
				GeeIterator* _encr_key_it = NULL;
				XmppXepOmemoParsedData* _tmp59_;
				GeeHashMap* _tmp60_;
				GeeSet* _tmp61_;
				GeeSet* _tmp62_;
				GeeSet* _tmp63_;
				GeeIterator* _tmp64_;
				GeeIterator* _tmp65_;
				_tmp59_ = parsed_data;
				_tmp60_ = _tmp59_->our_potential_encrypted_keys;
				_tmp61_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp60_);
				_tmp62_ = _tmp61_;
				_tmp63_ = _tmp62_;
				_tmp64_ = gee_iterable_iterator ((GeeIterable*) _tmp63_);
				_tmp65_ = _tmp64_;
				_g_object_unref0 (_tmp63_);
				_encr_key_it = _tmp65_;
				while (TRUE) {
					GeeIterator* _tmp66_;
					GBytes* encr_key = NULL;
					GeeIterator* _tmp67_;
					gpointer _tmp68_;
					XmppXepOmemoParsedData* _tmp69_;
					XmppXepOmemoParsedData* _tmp70_;
					GeeHashMap* _tmp71_;
					GBytes* _tmp72_;
					gpointer _tmp73_;
					XmppXepOmemoParsedData* _tmp74_;
					GBytes* _tmp75_;
					gsize _tmp76_ = 0;
					guint8* _tmp77_;
					guchar* _tmp78_;
					gint _tmp78__length1;
					_tmp66_ = _encr_key_it;
					if (!gee_iterator_next (_tmp66_)) {
						break;
					}
					_tmp67_ = _encr_key_it;
					_tmp68_ = gee_iterator_get (_tmp67_);
					encr_key = (GBytes*) _tmp68_;
					_tmp69_ = parsed_data;
					_tmp70_ = parsed_data;
					_tmp71_ = _tmp70_->our_potential_encrypted_keys;
					_tmp72_ = encr_key;
					_tmp73_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp71_, _tmp72_);
					_tmp69_->is_prekey = (gboolean) ((gintptr) _tmp73_);
					_tmp74_ = parsed_data;
					_tmp75_ = encr_key;
					_tmp77_ = g_bytes_get_data (_tmp75_, &_tmp76_);
					_tmp78_ = (_tmp77_ != NULL) ? _vala_array_dup1 (_tmp77_, _tmp76_) : _tmp77_;
					_tmp78__length1 = _tmp76_;
					_tmp74_->encrypted_key = (g_free (_tmp74_->encrypted_key), NULL);
					_tmp74_->encrypted_key = _tmp78_;
					_tmp74_->encrypted_key_length1 = _tmp78__length1;
					{
						guint8* key = NULL;
						XmppXepOmemoOmemoDecryptor* _tmp79_;
						XmppXepOmemoParsedData* _tmp80_;
						XmppJid* _tmp81_;
						XmppJid* _tmp82_;
						XmppJid* _tmp83_;
						XmppJid* _tmp84_;
						XmppJid* _tmp85_;
						XmppJid* _tmp86_;
						gint _tmp87_ = 0;
						guint8* _tmp88_;
						guint8* _tmp89_;
						gint _tmp89__length1;
						gint key_length1;
						gint _key_size_;
						gchar* cleartext = NULL;
						XmppXepOmemoOmemoDecryptor* _tmp90_;
						XmppXepOmemoParsedData* _tmp91_;
						guint8* _tmp92_;
						gint _tmp92__length1;
						guint8* _tmp93_;
						gint _tmp93__length1;
						XmppXepOmemoParsedData* _tmp94_;
						guint8* _tmp95_;
						gint _tmp95__length1;
						gchar* _tmp96_;
						XmppStanzaNode* new_fingerprint_node = NULL;
						XmppStanzaNode* _tmp97_;
						XmppStanzaNode* _tmp98_;
						XmppStanzaNode* _tmp99_;
						XmppStanzaNode* _tmp100_;
						const gchar* _tmp101_;
						XmppStanzaNode* _tmp102_;
						XmppStanzaNode* _tmp103_;
						XmppStanzaNode* _tmp104_;
						XmppStanzaNode* _tmp105_;
						gchar* hash_attr = NULL;
						XmppStanzaNode* _tmp106_;
						const gchar* _tmp107_;
						gchar* _tmp108_;
						gchar* setup_attr = NULL;
						XmppStanzaNode* _tmp109_;
						const gchar* _tmp110_;
						gchar* _tmp111_;
						const gchar* _tmp112_;
						const gchar* _tmp117_;
						XmppStanzaNode* _tmp122_;
						XmppStanzaNode* _tmp123_;
						XmppStanzaNode* _tmp124_;
						XmppStanzaNode* _tmp125_;
						GeeHashMap* _tmp126_;
						const gchar* _tmp127_;
						XmppXepOmemoParsedData* _tmp128_;
						GeeHashMap* _tmp129_;
						const gchar* _tmp130_;
						GeeHashMap* _tmp135_;
						const gchar* _tmp136_;
						gpointer _tmp137_;
						GeeList* _tmp138_;
						const gchar* _tmp139_;
						XmppFlagIdentity* _tmp140_;
						gpointer _tmp141_;
						XmppXepJingleFlag* _tmp142_;
						const gchar* _tmp143_;
						_tmp79_ = decryptor;
						_tmp80_ = parsed_data;
						_tmp81_ = xmpp_stanza_get_from ((XmppStanza*) _data1_->iq);
						_tmp82_ = _tmp81_;
						_tmp83_ = _tmp82_;
						_tmp84_ = xmpp_jid_get_bare_jid (_tmp83_);
						_tmp85_ = _tmp84_;
						_tmp86_ = _tmp85_;
						_tmp88_ = xmpp_xep_omemo_omemo_decryptor_decrypt_key (_tmp79_, _tmp80_, _tmp86_, &_tmp87_, &_inner_error0_);
						_tmp89_ = _tmp88_;
						_tmp89__length1 = _tmp87_;
						_xmpp_jid_unref0 (_tmp86_);
						_xmpp_jid_unref0 (_tmp83_);
						key = _tmp89_;
						key_length1 = _tmp89__length1;
						_key_size_ = key_length1;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
						_tmp90_ = decryptor;
						_tmp91_ = parsed_data;
						_tmp92_ = _tmp91_->ciphertext;
						_tmp92__length1 = _tmp91_->ciphertext_length1;
						_tmp93_ = key;
						_tmp93__length1 = key_length1;
						_tmp94_ = parsed_data;
						_tmp95_ = _tmp94_->iv;
						_tmp95__length1 = _tmp94_->iv_length1;
						_tmp96_ = xmpp_xep_omemo_omemo_decryptor_decrypt (_tmp90_, _tmp92_, (gint) _tmp92__length1, _tmp93_, (gint) _tmp93__length1, _tmp95_, (gint) _tmp95__length1, &_inner_error0_);
						cleartext = _tmp96_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							key = (g_free (key), NULL);
							goto __catch0_g_error;
						}
						_tmp97_ = xmpp_stanza_node_new_build ("fingerprint", XMPP_XEP_JINGLE_ICE_UDP_DTLS_NS_URI, NULL, NULL);
						_tmp98_ = _tmp97_;
						_tmp99_ = xmpp_stanza_node_add_self_xmlns (_tmp98_);
						_tmp100_ = _tmp99_;
						_tmp101_ = cleartext;
						_tmp102_ = xmpp_stanza_node_new_text (_tmp101_);
						_tmp103_ = _tmp102_;
						_tmp104_ = xmpp_stanza_node_put_node (_tmp100_, _tmp103_);
						_tmp105_ = _tmp104_;
						_xmpp_stanza_entry_unref0 (_tmp103_);
						_xmpp_stanza_entry_unref0 (_tmp100_);
						_xmpp_stanza_entry_unref0 (_tmp98_);
						new_fingerprint_node = _tmp105_;
						_tmp106_ = fingerprint_node;
						_tmp107_ = xmpp_stanza_node_get_attribute (_tmp106_, "hash", DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI);
						_tmp108_ = g_strdup (_tmp107_);
						hash_attr = _tmp108_;
						_tmp109_ = fingerprint_node;
						_tmp110_ = xmpp_stanza_node_get_attribute (_tmp109_, "setup", DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI);
						_tmp111_ = g_strdup (_tmp110_);
						setup_attr = _tmp111_;
						_tmp112_ = hash_attr;
						if (_tmp112_ != NULL) {
							XmppStanzaNode* _tmp113_;
							const gchar* _tmp114_;
							XmppStanzaNode* _tmp115_;
							XmppStanzaNode* _tmp116_;
							_tmp113_ = new_fingerprint_node;
							_tmp114_ = hash_attr;
							_tmp115_ = xmpp_stanza_node_put_attribute (_tmp113_, "hash", _tmp114_, NULL);
							_tmp116_ = _tmp115_;
							_xmpp_stanza_entry_unref0 (_tmp116_);
						}
						_tmp117_ = setup_attr;
						if (_tmp117_ != NULL) {
							XmppStanzaNode* _tmp118_;
							const gchar* _tmp119_;
							XmppStanzaNode* _tmp120_;
							XmppStanzaNode* _tmp121_;
							_tmp118_ = new_fingerprint_node;
							_tmp119_ = setup_attr;
							_tmp120_ = xmpp_stanza_node_put_attribute (_tmp118_, "setup", _tmp119_, NULL);
							_tmp121_ = _tmp120_;
							_xmpp_stanza_entry_unref0 (_tmp121_);
						}
						_tmp122_ = transport_node;
						_tmp123_ = new_fingerprint_node;
						_tmp124_ = xmpp_stanza_node_put_node (_tmp122_, _tmp123_);
						_tmp125_ = _tmp124_;
						_xmpp_stanza_entry_unref0 (_tmp125_);
						_tmp126_ = self->priv->device_id_by_jingle_sid;
						_tmp127_ = _data1_->jingle_sid;
						_tmp128_ = parsed_data;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp126_, _tmp127_, (gpointer) ((gintptr) _tmp128_->sid));
						_tmp129_ = self->priv->content_names_by_jingle_sid;
						_tmp130_ = _data2_->content_name;
						if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp129_, _tmp130_)) {
							GeeHashMap* _tmp131_;
							const gchar* _tmp132_;
							GeeArrayList* _tmp133_;
							GeeArrayList* _tmp134_;
							_tmp131_ = self->priv->content_names_by_jingle_sid;
							_tmp132_ = _data2_->content_name;
							_tmp133_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
							_tmp134_ = _tmp133_;
							gee_abstract_map_set ((GeeAbstractMap*) _tmp131_, _tmp132_, (GeeList*) _tmp134_);
							_g_object_unref0 (_tmp134_);
						}
						_tmp135_ = self->priv->content_names_by_jingle_sid;
						_tmp136_ = _data2_->content_name;
						_tmp137_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp135_, _tmp136_);
						_tmp138_ = (GeeList*) _tmp137_;
						_tmp139_ = _data2_->content_name;
						gee_collection_add ((GeeCollection*) _tmp138_, _tmp139_);
						_g_object_unref0 (_tmp138_);
						_tmp140_ = xmpp_xep_jingle_flag_IDENTITY;
						_tmp141_ = xmpp_xmpp_stream_get_flag (_data1_->stream, XMPP_XEP_JINGLE_TYPE_FLAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp140_);
						_tmp142_ = (XmppXepJingleFlag*) _tmp141_;
						_tmp143_ = _data1_->jingle_sid;
						xmpp_xep_jingle_flag_get_session (_tmp142_, _tmp143_, ________lambda42__gasync_ready_callback, block2_data_ref (_data2_));
						_g_object_unref0 (_tmp142_);
						_g_free0 (setup_attr);
						_g_free0 (hash_attr);
						_xmpp_stanza_entry_unref0 (new_fingerprint_node);
						_g_free0 (cleartext);
						key = (g_free (key), NULL);
						_g_bytes_unref0 (encr_key);
						break;
					}
					goto __finally0;
					__catch0_g_error:
					{
						GError* e = NULL;
						XmppJid* _tmp144_;
						XmppJid* _tmp145_;
						XmppJid* _tmp146_;
						XmppJid* _tmp147_;
						XmppJid* _tmp148_;
						XmppJid* _tmp149_;
						gchar* _tmp150_;
						gchar* _tmp151_;
						XmppXepOmemoParsedData* _tmp152_;
						GError* _tmp153_;
						const gchar* _tmp154_;
						e = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp144_ = xmpp_stanza_get_from ((XmppStanza*) _data1_->iq);
						_tmp145_ = _tmp144_;
						_tmp146_ = _tmp145_;
						_tmp147_ = xmpp_jid_get_bare_jid (_tmp146_);
						_tmp148_ = _tmp147_;
						_tmp149_ = _tmp148_;
						_tmp150_ = xmpp_jid_to_string (_tmp149_);
						_tmp151_ = _tmp150_;
						_tmp152_ = parsed_data;
						_tmp153_ = e;
						_tmp154_ = _tmp153_->message;
						g_debug ("dtls_srtp_verification_draft.vala:80: Decrypting message from %s/%d fa" \
"iled: %s", _tmp151_, _tmp152_->sid, _tmp154_);
						_g_free0 (_tmp151_);
						_xmpp_jid_unref0 (_tmp149_);
						_xmpp_jid_unref0 (_tmp146_);
						_g_error_free0 (e);
					}
					__finally0:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_bytes_unref0 (encr_key);
						_g_object_unref0 (_encr_key_it);
						_xmpp_xep_omemo_parsed_data_unref0 (parsed_data);
						_xmpp_stanza_entry_unref0 (encrypted_node);
						_xmpp_stanza_entry_unref0 (fingerprint_node);
						_xmpp_stanza_entry_unref0 (transport_node);
						_xmpp_stanza_entry_unref0 (content_node);
						block2_data_unref (_data2_);
						_data2_ = NULL;
						_g_object_unref0 (decryptor);
						_g_object_unref0 (content_nodes);
						block1_data_unref (_data1_);
						_data1_ = 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;
					}
					_g_bytes_unref0 (encr_key);
				}
				_g_object_unref0 (_encr_key_it);
			}
			_xmpp_xep_omemo_parsed_data_unref0 (parsed_data);
			_xmpp_stanza_entry_unref0 (encrypted_node);
			_xmpp_stanza_entry_unref0 (fingerprint_node);
			_xmpp_stanza_entry_unref0 (transport_node);
			_xmpp_stanza_entry_unref0 (content_node);
			block2_data_unref (_data2_);
			_data2_ = NULL;
		}
	}
	_g_object_unref0 (decryptor);
	_g_object_unref0 (content_nodes);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_outgoing_iq_set_get (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                                 XmppXmppStream* stream,
                                                                                                 XmppIqStanza* iq)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	XmppStanzaNode* jingle_node = NULL;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	gint device_id = 0;
	gchar* sid = NULL;
	XmppStanzaNode* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean _tmp8_ = FALSE;
	const gchar* _tmp9_;
	XmppStanzaNode* muji_node = NULL;
	XmppStanzaNode* _tmp15_;
	XmppStanzaNode* _tmp16_;
	XmppStanzaNode* _tmp17_;
	GeeList* content_nodes = NULL;
	XmppStanzaNode* _tmp53_;
	GeeList* _tmp54_;
	GeeList* _tmp55_;
	gint _tmp56_;
	gint _tmp57_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (iq != NULL);
	_tmp0_ = xmpp_stanza_get_type_ ((XmppStanza*) iq);
	_tmp1_ = _tmp0_;
	if (g_strcmp0 (_tmp1_, XMPP_IQ_STANZA_TYPE_SET) != 0) {
		return;
	}
	_tmp2_ = ((XmppStanza*) iq)->stanza;
	_tmp3_ = xmpp_stanza_node_get_subnode (_tmp2_, "jingle", XMPP_XEP_JINGLE_NS_URI, FALSE);
	jingle_node = _tmp3_;
	_tmp4_ = jingle_node;
	if (_tmp4_ == NULL) {
		_xmpp_stanza_entry_unref0 (jingle_node);
		return;
	}
	device_id = -1;
	_tmp5_ = jingle_node;
	_tmp6_ = xmpp_stanza_node_get_attribute (_tmp5_, "sid", XMPP_XEP_JINGLE_NS_URI);
	_tmp7_ = g_strdup (_tmp6_);
	sid = _tmp7_;
	_tmp9_ = sid;
	if (_tmp9_ != NULL) {
		GeeHashMap* _tmp10_;
		const gchar* _tmp11_;
		_tmp10_ = self->priv->device_id_by_jingle_sid;
		_tmp11_ = sid;
		_tmp8_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp10_, _tmp11_);
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		GeeHashMap* _tmp12_;
		const gchar* _tmp13_;
		gpointer _tmp14_;
		_tmp12_ = self->priv->device_id_by_jingle_sid;
		_tmp13_ = sid;
		_tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp12_, _tmp13_);
		device_id = (gint) ((gintptr) _tmp14_);
	}
	_tmp15_ = jingle_node;
	_tmp16_ = xmpp_stanza_node_get_subnode (_tmp15_, "muji", XMPP_XEP_MUJI_NS_URI, FALSE);
	muji_node = _tmp16_;
	_tmp17_ = muji_node;
	if (_tmp17_ != NULL) {
		gchar* muji_room = NULL;
		XmppStanzaNode* _tmp18_;
		const gchar* _tmp19_;
		gchar* _tmp20_;
		_tmp18_ = muji_node;
		_tmp19_ = xmpp_stanza_node_get_attribute (_tmp18_, "room", NULL);
		_tmp20_ = g_strdup (_tmp19_);
		muji_room = _tmp20_;
		{
			XmppJid* muji_jid = NULL;
			const gchar* _tmp21_;
			XmppJid* _tmp22_;
			GeeHashMap* _tmp23_;
			XmppJid* _tmp24_;
			XmppJid* _tmp25_;
			XmppJid* _tmp26_;
			XmppJid* _tmp27_;
			gchar* _tmp28_;
			gchar* _tmp29_;
			XmppJid* _tmp30_;
			XmppJid* _tmp31_;
			XmppJid* _tmp32_;
			gchar* _tmp33_;
			gchar* _tmp34_;
			gchar* _tmp35_;
			gchar* _tmp36_;
			gboolean _tmp37_;
			_tmp21_ = muji_room;
			_tmp22_ = xmpp_jid_new (_tmp21_, &_inner_error0_);
			muji_jid = _tmp22_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch0_xmpp_invalid_jid_error;
				}
				_g_free0 (muji_room);
				_xmpp_stanza_entry_unref0 (muji_node);
				_g_free0 (sid);
				_xmpp_stanza_entry_unref0 (jingle_node);
				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;
			}
			_tmp23_ = self->priv->device_id_by_muji_member;
			_tmp24_ = muji_jid;
			_tmp25_ = xmpp_jid_get_bare_jid (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = _tmp26_;
			_tmp28_ = xmpp_jid_to_string (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp30_ = xmpp_stanza_get_to ((XmppStanza*) iq);
			_tmp31_ = _tmp30_;
			_tmp32_ = _tmp31_;
			_tmp33_ = xmpp_jid_to_string (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = g_strconcat (_tmp29_, "/", _tmp34_, NULL);
			_tmp36_ = _tmp35_;
			_tmp37_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp23_, _tmp36_);
			_g_free0 (_tmp36_);
			_g_free0 (_tmp34_);
			_xmpp_jid_unref0 (_tmp32_);
			_g_free0 (_tmp29_);
			_xmpp_jid_unref0 (_tmp27_);
			if (_tmp37_) {
				GeeHashMap* _tmp38_;
				XmppJid* _tmp39_;
				XmppJid* _tmp40_;
				XmppJid* _tmp41_;
				XmppJid* _tmp42_;
				gchar* _tmp43_;
				gchar* _tmp44_;
				XmppJid* _tmp45_;
				XmppJid* _tmp46_;
				XmppJid* _tmp47_;
				gchar* _tmp48_;
				gchar* _tmp49_;
				gchar* _tmp50_;
				gchar* _tmp51_;
				gpointer _tmp52_;
				_tmp38_ = self->priv->device_id_by_muji_member;
				_tmp39_ = muji_jid;
				_tmp40_ = xmpp_jid_get_bare_jid (_tmp39_);
				_tmp41_ = _tmp40_;
				_tmp42_ = _tmp41_;
				_tmp43_ = xmpp_jid_to_string (_tmp42_);
				_tmp44_ = _tmp43_;
				_tmp45_ = xmpp_stanza_get_to ((XmppStanza*) iq);
				_tmp46_ = _tmp45_;
				_tmp47_ = _tmp46_;
				_tmp48_ = xmpp_jid_to_string (_tmp47_);
				_tmp49_ = _tmp48_;
				_tmp50_ = g_strconcat (_tmp44_, "/", _tmp49_, NULL);
				_tmp51_ = _tmp50_;
				_tmp52_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp38_, _tmp51_);
				device_id = (gint) ((gintptr) _tmp52_);
				_g_free0 (_tmp51_);
				_g_free0 (_tmp49_);
				_xmpp_jid_unref0 (_tmp47_);
				_g_free0 (_tmp44_);
				_xmpp_jid_unref0 (_tmp42_);
			}
			_xmpp_jid_unref0 (muji_jid);
		}
		goto __finally0;
		__catch0_xmpp_invalid_jid_error:
		{
			g_clear_error (&_inner_error0_);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (muji_room);
			_xmpp_stanza_entry_unref0 (muji_node);
			_g_free0 (sid);
			_xmpp_stanza_entry_unref0 (jingle_node);
			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;
		}
		_g_free0 (muji_room);
	}
	if (device_id == -1) {
		_xmpp_stanza_entry_unref0 (muji_node);
		_g_free0 (sid);
		_xmpp_stanza_entry_unref0 (jingle_node);
		return;
	}
	_tmp53_ = jingle_node;
	_tmp54_ = xmpp_stanza_node_get_subnodes (_tmp53_, "content", XMPP_XEP_JINGLE_NS_URI, FALSE);
	content_nodes = _tmp54_;
	_tmp55_ = content_nodes;
	_tmp56_ = gee_collection_get_size ((GeeCollection*) _tmp55_);
	_tmp57_ = _tmp56_;
	if (_tmp57_ == 0) {
		_g_object_unref0 (content_nodes);
		_xmpp_stanza_entry_unref0 (muji_node);
		_g_free0 (sid);
		_xmpp_stanza_entry_unref0 (jingle_node);
		return;
	}
	{
		GeeList* _content_node_list = NULL;
		GeeList* _tmp58_;
		gint _content_node_size = 0;
		GeeList* _tmp59_;
		gint _tmp60_;
		gint _tmp61_;
		gint _content_node_index = 0;
		_tmp58_ = content_nodes;
		_content_node_list = _tmp58_;
		_tmp59_ = _content_node_list;
		_tmp60_ = gee_collection_get_size ((GeeCollection*) _tmp59_);
		_tmp61_ = _tmp60_;
		_content_node_size = _tmp61_;
		_content_node_index = -1;
		while (TRUE) {
			gint _tmp62_;
			gint _tmp63_;
			XmppStanzaNode* content_node = NULL;
			GeeList* _tmp64_;
			gpointer _tmp65_;
			XmppStanzaNode* transport_node = NULL;
			XmppStanzaNode* _tmp66_;
			XmppStanzaNode* _tmp67_;
			XmppStanzaNode* _tmp68_;
			XmppStanzaNode* fingerprint_node = NULL;
			XmppStanzaNode* _tmp69_;
			XmppStanzaNode* _tmp70_;
			XmppStanzaNode* _tmp71_;
			gchar* fingerprint = NULL;
			XmppStanzaNode* _tmp72_;
			const gchar* _tmp73_;
			gchar* _tmp74_;
			XmppStanzaNode* encrypted_node = NULL;
			XmppStanzaNode* new_fingerprint_node = NULL;
			XmppStanzaNode* _tmp92_;
			XmppStanzaNode* _tmp93_;
			XmppStanzaNode* _tmp94_;
			XmppStanzaNode* _tmp95_;
			XmppStanzaNode* _tmp96_;
			XmppStanzaNode* _tmp97_;
			XmppStanzaNode* _tmp98_;
			gchar* hash_attr = NULL;
			XmppStanzaNode* _tmp99_;
			const gchar* _tmp100_;
			gchar* _tmp101_;
			gchar* setup_attr = NULL;
			XmppStanzaNode* _tmp102_;
			const gchar* _tmp103_;
			gchar* _tmp104_;
			const gchar* _tmp105_;
			const gchar* _tmp110_;
			XmppStanzaNode* _tmp115_;
			XmppStanzaNode* _tmp116_;
			XmppStanzaNode* _tmp117_;
			XmppStanzaNode* _tmp118_;
			XmppStanzaNode* _tmp119_;
			GeeList* _tmp120_;
			XmppStanzaNode* _tmp121_;
			_content_node_index = _content_node_index + 1;
			_tmp62_ = _content_node_index;
			_tmp63_ = _content_node_size;
			if (!(_tmp62_ < _tmp63_)) {
				break;
			}
			_tmp64_ = _content_node_list;
			_tmp65_ = gee_list_get (_tmp64_, _content_node_index);
			content_node = (XmppStanzaNode*) _tmp65_;
			_tmp66_ = content_node;
			_tmp67_ = xmpp_stanza_node_get_subnode (_tmp66_, "transport", XMPP_XEP_JINGLE_ICE_UDP_NS_URI, FALSE);
			transport_node = _tmp67_;
			_tmp68_ = transport_node;
			if (_tmp68_ == NULL) {
				_xmpp_stanza_entry_unref0 (transport_node);
				_xmpp_stanza_entry_unref0 (content_node);
				continue;
			}
			_tmp69_ = transport_node;
			_tmp70_ = xmpp_stanza_node_get_subnode (_tmp69_, "fingerprint", XMPP_XEP_JINGLE_ICE_UDP_DTLS_NS_URI, FALSE);
			fingerprint_node = _tmp70_;
			_tmp71_ = fingerprint_node;
			if (_tmp71_ == NULL) {
				_xmpp_stanza_entry_unref0 (fingerprint_node);
				_xmpp_stanza_entry_unref0 (transport_node);
				_xmpp_stanza_entry_unref0 (content_node);
				continue;
			}
			_tmp72_ = fingerprint_node;
			_tmp73_ = xmpp_stanza_node_get_deep_string_content (_tmp72_, NULL);
			_tmp74_ = g_strdup (_tmp73_);
			fingerprint = _tmp74_;
			encrypted_node = NULL;
			{
				XmppXepOmemoOmemoEncryptor* encryptor = NULL;
				XmppModuleIdentity* _tmp75_;
				gpointer _tmp76_;
				XmppXepOmemoEncryptionData* enc_data = NULL;
				XmppXepOmemoOmemoEncryptor* _tmp77_;
				const gchar* _tmp78_;
				XmppXepOmemoEncryptionData* _tmp79_;
				XmppXepOmemoOmemoEncryptor* _tmp80_;
				XmppXepOmemoEncryptionData* _tmp81_;
				XmppJid* _tmp82_;
				XmppJid* _tmp83_;
				XmppJid* _tmp84_;
				XmppJid* _tmp85_;
				XmppJid* _tmp86_;
				XmppJid* _tmp87_;
				XmppXepOmemoEncryptionData* _tmp88_;
				XmppStanzaNode* _tmp89_;
				_tmp75_ = xmpp_xep_omemo_omemo_encryptor_IDENTITY;
				_tmp76_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_OMEMO_TYPE_OMEMO_ENCRYPTOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp75_);
				encryptor = (XmppXepOmemoOmemoEncryptor*) _tmp76_;
				_tmp77_ = encryptor;
				_tmp78_ = fingerprint;
				_tmp79_ = xmpp_xep_omemo_omemo_encryptor_encrypt_plaintext (_tmp77_, _tmp78_, &_inner_error0_);
				enc_data = _tmp79_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (encryptor);
					goto __catch1_g_error;
				}
				_tmp80_ = encryptor;
				_tmp81_ = enc_data;
				_tmp82_ = xmpp_stanza_get_to ((XmppStanza*) iq);
				_tmp83_ = _tmp82_;
				_tmp84_ = _tmp83_;
				_tmp85_ = xmpp_jid_get_bare_jid (_tmp84_);
				_tmp86_ = _tmp85_;
				_tmp87_ = _tmp86_;
				xmpp_xep_omemo_omemo_encryptor_encrypt_key (_tmp80_, _tmp81_, _tmp87_, (gint32) device_id, &_inner_error0_);
				_xmpp_jid_unref0 (_tmp87_);
				_xmpp_jid_unref0 (_tmp84_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_xmpp_xep_omemo_encryption_data_unref0 (enc_data);
					_g_object_unref0 (encryptor);
					goto __catch1_g_error;
				}
				_tmp88_ = enc_data;
				_tmp89_ = xmpp_xep_omemo_encryption_data_get_encrypted_node (_tmp88_);
				_xmpp_stanza_entry_unref0 (encrypted_node);
				encrypted_node = _tmp89_;
				_xmpp_xep_omemo_encryption_data_unref0 (enc_data);
				_g_object_unref0 (encryptor);
			}
			goto __finally1;
			__catch1_g_error:
			{
				GError* e = NULL;
				GError* _tmp90_;
				const gchar* _tmp91_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp90_ = e;
				_tmp91_ = _tmp90_->message;
				g_warning ("dtls_srtp_verification_draft.vala:130: Error while OMEMO-encrypting ca" \
"ll keys: %s", _tmp91_);
				_g_error_free0 (e);
				_xmpp_stanza_entry_unref0 (encrypted_node);
				_g_free0 (fingerprint);
				_xmpp_stanza_entry_unref0 (fingerprint_node);
				_xmpp_stanza_entry_unref0 (transport_node);
				_xmpp_stanza_entry_unref0 (content_node);
				_g_object_unref0 (content_nodes);
				_xmpp_stanza_entry_unref0 (muji_node);
				_g_free0 (sid);
				_xmpp_stanza_entry_unref0 (jingle_node);
				return;
			}
			__finally1:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_xmpp_stanza_entry_unref0 (encrypted_node);
				_g_free0 (fingerprint);
				_xmpp_stanza_entry_unref0 (fingerprint_node);
				_xmpp_stanza_entry_unref0 (transport_node);
				_xmpp_stanza_entry_unref0 (content_node);
				_g_object_unref0 (content_nodes);
				_xmpp_stanza_entry_unref0 (muji_node);
				_g_free0 (sid);
				_xmpp_stanza_entry_unref0 (jingle_node);
				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;
			}
			_tmp92_ = xmpp_stanza_node_new_build ("fingerprint", DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, NULL, NULL);
			_tmp93_ = _tmp92_;
			_tmp94_ = xmpp_stanza_node_add_self_xmlns (_tmp93_);
			_tmp95_ = _tmp94_;
			_tmp96_ = encrypted_node;
			_tmp97_ = xmpp_stanza_node_put_node (_tmp95_, _tmp96_);
			_tmp98_ = _tmp97_;
			_xmpp_stanza_entry_unref0 (_tmp95_);
			_xmpp_stanza_entry_unref0 (_tmp93_);
			new_fingerprint_node = _tmp98_;
			_tmp99_ = fingerprint_node;
			_tmp100_ = xmpp_stanza_node_get_attribute (_tmp99_, "hash", XMPP_XEP_JINGLE_ICE_UDP_DTLS_NS_URI);
			_tmp101_ = g_strdup (_tmp100_);
			hash_attr = _tmp101_;
			_tmp102_ = fingerprint_node;
			_tmp103_ = xmpp_stanza_node_get_attribute (_tmp102_, "setup", XMPP_XEP_JINGLE_ICE_UDP_DTLS_NS_URI);
			_tmp104_ = g_strdup (_tmp103_);
			setup_attr = _tmp104_;
			_tmp105_ = hash_attr;
			if (_tmp105_ != NULL) {
				XmppStanzaNode* _tmp106_;
				const gchar* _tmp107_;
				XmppStanzaNode* _tmp108_;
				XmppStanzaNode* _tmp109_;
				_tmp106_ = new_fingerprint_node;
				_tmp107_ = hash_attr;
				_tmp108_ = xmpp_stanza_node_put_attribute (_tmp106_, "hash", _tmp107_, NULL);
				_tmp109_ = _tmp108_;
				_xmpp_stanza_entry_unref0 (_tmp109_);
			}
			_tmp110_ = setup_attr;
			if (_tmp110_ != NULL) {
				XmppStanzaNode* _tmp111_;
				const gchar* _tmp112_;
				XmppStanzaNode* _tmp113_;
				XmppStanzaNode* _tmp114_;
				_tmp111_ = new_fingerprint_node;
				_tmp112_ = setup_attr;
				_tmp113_ = xmpp_stanza_node_put_attribute (_tmp111_, "setup", _tmp112_, NULL);
				_tmp114_ = _tmp113_;
				_xmpp_stanza_entry_unref0 (_tmp114_);
			}
			_tmp115_ = transport_node;
			_tmp116_ = new_fingerprint_node;
			_tmp117_ = xmpp_stanza_node_put_node (_tmp115_, _tmp116_);
			_tmp118_ = _tmp117_;
			_xmpp_stanza_entry_unref0 (_tmp118_);
			_tmp119_ = transport_node;
			_tmp120_ = _tmp119_->sub_nodes;
			_tmp121_ = fingerprint_node;
			gee_collection_remove ((GeeCollection*) _tmp120_, _tmp121_);
			_g_free0 (setup_attr);
			_g_free0 (hash_attr);
			_xmpp_stanza_entry_unref0 (new_fingerprint_node);
			_xmpp_stanza_entry_unref0 (encrypted_node);
			_g_free0 (fingerprint);
			_xmpp_stanza_entry_unref0 (fingerprint_node);
			_xmpp_stanza_entry_unref0 (transport_node);
			_xmpp_stanza_entry_unref0 (content_node);
		}
	}
	_g_object_unref0 (content_nodes);
	_xmpp_stanza_entry_unref0 (muji_node);
	_g_free0 (sid);
	_xmpp_stanza_entry_unref0 (jingle_node);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_message_received (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                   XmppXmppStream* stream,
                                                                                   XmppMessageStanza* message)
{
	XmppStanzaNode* proceed_node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	gchar* jingle_sid = NULL;
	XmppStanzaNode* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	XmppStanzaNode* device_node = NULL;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	gint device_id = 0;
	XmppStanzaNode* _tmp10_;
	GeeHashMap* _tmp11_;
	const gchar* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (message != NULL);
	_tmp0_ = ((XmppStanza*) message)->stanza;
	_tmp1_ = xmpp_stanza_node_get_subnode (_tmp0_, "proceed", XMPP_XEP_JINGLE_MESSAGE_INITIATION_NS_URI, FALSE);
	proceed_node = _tmp1_;
	_tmp2_ = proceed_node;
	if (_tmp2_ == NULL) {
		_xmpp_stanza_entry_unref0 (proceed_node);
		return;
	}
	_tmp3_ = proceed_node;
	_tmp4_ = xmpp_stanza_node_get_attribute (_tmp3_, "id", NULL);
	_tmp5_ = g_strdup (_tmp4_);
	jingle_sid = _tmp5_;
	_tmp6_ = jingle_sid;
	if (_tmp6_ == NULL) {
		_g_free0 (jingle_sid);
		_xmpp_stanza_entry_unref0 (proceed_node);
		return;
	}
	_tmp7_ = proceed_node;
	_tmp8_ = xmpp_stanza_node_get_subnode (_tmp7_, "device", DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, FALSE);
	device_node = _tmp8_;
	_tmp9_ = device_node;
	if (_tmp9_ == NULL) {
		_xmpp_stanza_entry_unref0 (device_node);
		_g_free0 (jingle_sid);
		_xmpp_stanza_entry_unref0 (proceed_node);
		return;
	}
	_tmp10_ = device_node;
	device_id = xmpp_stanza_node_get_attribute_int (_tmp10_, "id", -1, NULL);
	if (device_id == -1) {
		_xmpp_stanza_entry_unref0 (device_node);
		_g_free0 (jingle_sid);
		_xmpp_stanza_entry_unref0 (proceed_node);
		return;
	}
	_tmp11_ = self->priv->device_id_by_jingle_sid;
	_tmp12_ = jingle_sid;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp11_, _tmp12_, (gpointer) ((gintptr) device_id));
	_xmpp_stanza_entry_unref0 (device_node);
	_g_free0 (jingle_sid);
	_xmpp_stanza_entry_unref0 (proceed_node);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_session_initiate_received (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                            XmppXmppStream* stream,
                                                                                            XmppXepJingleSession* session)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	_tmp0_ = self->priv->device_id_by_jingle_sid;
	_tmp1_ = xmpp_xep_jingle_session_get_sid (session);
	_tmp2_ = _tmp1_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		{
			GeeList* _content_list = NULL;
			GeeList* _tmp3_;
			gint _content_size = 0;
			GeeList* _tmp4_;
			gint _tmp5_;
			gint _tmp6_;
			gint _content_index = 0;
			_tmp3_ = session->contents;
			_content_list = _tmp3_;
			_tmp4_ = _content_list;
			_tmp5_ = gee_collection_get_size ((GeeCollection*) _tmp4_);
			_tmp6_ = _tmp5_;
			_content_size = _tmp6_;
			_content_index = -1;
			while (TRUE) {
				gint _tmp7_;
				gint _tmp8_;
				XmppXepJingleContent* content = NULL;
				GeeList* _tmp9_;
				gpointer _tmp10_;
				XmppXepJingleContent* _tmp11_;
				_content_index = _content_index + 1;
				_tmp7_ = _content_index;
				_tmp8_ = _content_size;
				if (!(_tmp7_ < _tmp8_)) {
					break;
				}
				_tmp9_ = _content_list;
				_tmp10_ = gee_list_get (_tmp9_, _content_index);
				content = (XmppXepJingleContent*) _tmp10_;
				_tmp11_ = content;
				dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_content_add_received (self, stream, _tmp11_);
				_g_object_unref0 (content);
			}
		}
	}
	g_signal_connect_object (session, "additional-content-add-incoming", (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_content_add_received_xmpp_xep_jingle_session_additional_content_add_incoming, self, 0);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_content_add_received (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                       XmppXmppStream* stream,
                                                                                       XmppXepJingleContent* content)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	XmppXepJingleSession* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (content != NULL);
	_tmp1_ = self->priv->content_names_by_jingle_sid;
	_tmp2_ = content->session;
	_tmp3_ = xmpp_xep_jingle_session_get_sid (_tmp2_);
	_tmp4_ = _tmp3_;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, _tmp4_)) {
		_tmp0_ = TRUE;
	} else {
		GeeHashMap* _tmp5_;
		XmppXepJingleSession* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gpointer _tmp9_;
		GeeList* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		_tmp5_ = self->priv->content_names_by_jingle_sid;
		_tmp6_ = content->session;
		_tmp7_ = xmpp_xep_jingle_session_get_sid (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp5_, _tmp8_);
		_tmp10_ = (GeeList*) _tmp9_;
		_tmp11_ = xmpp_xep_jingle_content_get_content_name (content);
		_tmp12_ = _tmp11_;
		_tmp0_ = gee_collection_contains ((GeeCollection*) _tmp10_, _tmp12_);
		_g_object_unref0 (_tmp10_);
	}
	if (_tmp0_) {
		DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* encryption = NULL;
		XmppJid* _tmp13_;
		XmppJid* _tmp14_;
		XmppJid* _tmp15_;
		XmppJid* _tmp16_;
		XmppJid* _tmp17_;
		GeeHashMap* _tmp18_;
		XmppXepJingleSession* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		gpointer _tmp22_;
		DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* _tmp23_;
		DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* _tmp24_;
		GeeHashMap* _tmp25_;
		DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* _tmp26_;
		const gchar* _tmp27_;
		DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* _tmp28_;
		_tmp13_ = xmpp_xep_jingle_content_get_peer_full_jid (content);
		_tmp14_ = _tmp13_;
		_tmp15_ = xmpp_jid_get_bare_jid (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = _tmp16_;
		_tmp18_ = self->priv->device_id_by_jingle_sid;
		_tmp19_ = content->session;
		_tmp20_ = xmpp_xep_jingle_session_get_sid (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp18_, _tmp21_);
		_tmp23_ = dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_new (DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, "OMEMO", _tmp17_, (gint) ((gintptr) _tmp22_));
		_tmp24_ = _tmp23_;
		_xmpp_jid_unref0 (_tmp17_);
		encryption = _tmp24_;
		_tmp25_ = content->encryptions;
		_tmp26_ = encryption;
		_tmp27_ = ((XmppXepJingleContentEncryption*) _tmp26_)->encryption_ns;
		_tmp28_ = encryption;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp25_, _tmp27_, (XmppXepJingleContentEncryption*) _tmp28_);
		_g_object_unref0 (encryption);
	}
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_pre_send_presence_stanza (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                           XmppXmppStream* stream,
                                                                                           XmppPresenceStanza* presence)
{
	XmppStanzaNode* muji_node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* device_node = NULL;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppModuleIdentity* _tmp7_;
	gpointer _tmp8_;
	DinoPluginsOmemoStreamModule* _tmp9_;
	OmemoStore* _tmp10_;
	OmemoStore* _tmp11_;
	guint32 _tmp12_;
	guint32 _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	XmppStanzaNode* _tmp16_;
	XmppStanzaNode* _tmp17_;
	XmppStanzaNode* _tmp18_;
	XmppStanzaNode* _tmp19_;
	XmppStanzaNode* _tmp20_;
	XmppStanzaNode* _tmp21_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (presence != NULL);
	_tmp0_ = ((XmppStanza*) presence)->stanza;
	_tmp1_ = xmpp_stanza_node_get_subnode (_tmp0_, "muji", XMPP_XEP_MUJI_NS_URI, FALSE);
	muji_node = _tmp1_;
	_tmp2_ = muji_node;
	if (_tmp2_ == NULL) {
		_xmpp_stanza_entry_unref0 (muji_node);
		return;
	}
	_tmp3_ = xmpp_stanza_node_new_build ("device", DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, NULL, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_stanza_node_add_self_xmlns (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = dino_plugins_omemo_stream_module_IDENTITY;
	_tmp8_ = xmpp_xmpp_stream_get_module (stream, DINO_PLUGINS_OMEMO_TYPE_STREAM_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp7_);
	_tmp9_ = (DinoPluginsOmemoStreamModule*) _tmp8_;
	_tmp10_ = dino_plugins_omemo_stream_module_get_store (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = omemo_store_get_local_registration_id (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = g_strdup_printf ("%u", _tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = xmpp_stanza_node_put_attribute (_tmp6_, "id", _tmp15_, NULL);
	_tmp17_ = _tmp16_;
	_g_free0 (_tmp15_);
	_g_object_unref0 (_tmp9_);
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	device_node = _tmp17_;
	_tmp18_ = muji_node;
	_tmp19_ = device_node;
	_tmp20_ = xmpp_stanza_node_put_node (_tmp18_, _tmp19_);
	_tmp21_ = _tmp20_;
	_xmpp_stanza_entry_unref0 (_tmp21_);
	_xmpp_stanza_entry_unref0 (device_node);
	_xmpp_stanza_entry_unref0 (muji_node);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_received_available (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule* self,
                                                                                     XmppXmppStream* stream,
                                                                                     XmppPresenceStanza* presence)
{
	XmppStanzaNode* muji_node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* device_node = NULL;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	gint device_id = 0;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* muc_x_node = NULL;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* item_node = NULL;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* _tmp11_;
	XmppStanzaNode* _tmp12_;
	XmppJid* real_jid = NULL;
	GeeHashMap* _tmp21_;
	XmppJid* _tmp22_;
	XmppJid* _tmp23_;
	XmppJid* _tmp24_;
	XmppJid* _tmp25_;
	XmppJid* _tmp26_;
	XmppJid* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	XmppJid* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (presence != NULL);
	_tmp0_ = ((XmppStanza*) presence)->stanza;
	_tmp1_ = xmpp_stanza_node_get_subnode (_tmp0_, "muji", XMPP_XEP_MUJI_NS_URI, FALSE);
	muji_node = _tmp1_;
	_tmp2_ = muji_node;
	if (_tmp2_ == NULL) {
		_xmpp_stanza_entry_unref0 (muji_node);
		return;
	}
	_tmp3_ = muji_node;
	_tmp4_ = xmpp_stanza_node_get_subnode (_tmp3_, "device", DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, FALSE);
	device_node = _tmp4_;
	_tmp5_ = device_node;
	if (_tmp5_ == NULL) {
		_xmpp_stanza_entry_unref0 (device_node);
		_xmpp_stanza_entry_unref0 (muji_node);
		return;
	}
	_tmp6_ = device_node;
	device_id = xmpp_stanza_node_get_attribute_int (_tmp6_, "id", -1, NULL);
	if (device_id == -1) {
		_xmpp_stanza_entry_unref0 (device_node);
		_xmpp_stanza_entry_unref0 (muji_node);
		return;
	}
	_tmp7_ = ((XmppStanza*) presence)->stanza;
	_tmp8_ = xmpp_stanza_node_get_subnode (_tmp7_, "x", "http://jabber.org/protocol/muc#user", FALSE);
	muc_x_node = _tmp8_;
	_tmp9_ = muc_x_node;
	if (_tmp9_ == NULL) {
		_xmpp_stanza_entry_unref0 (muc_x_node);
		_xmpp_stanza_entry_unref0 (device_node);
		_xmpp_stanza_entry_unref0 (muji_node);
		return;
	}
	_tmp10_ = muc_x_node;
	_tmp11_ = xmpp_stanza_node_get_subnode (_tmp10_, "item", NULL, FALSE);
	item_node = _tmp11_;
	_tmp12_ = item_node;
	if (_tmp12_ == NULL) {
		_xmpp_stanza_entry_unref0 (item_node);
		_xmpp_stanza_entry_unref0 (muc_x_node);
		_xmpp_stanza_entry_unref0 (device_node);
		_xmpp_stanza_entry_unref0 (muji_node);
		return;
	}
	real_jid = NULL;
	{
		gchar* jid_attribute = NULL;
		XmppStanzaNode* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		const gchar* _tmp16_;
		XmppJid* _tmp17_ = NULL;
		const gchar* _tmp18_;
		XmppJid* _tmp19_;
		XmppJid* _tmp20_;
		_tmp13_ = item_node;
		_tmp14_ = xmpp_stanza_node_get_attribute (_tmp13_, "jid", NULL);
		_tmp15_ = g_strdup (_tmp14_);
		jid_attribute = _tmp15_;
		_tmp16_ = jid_attribute;
		if (_tmp16_ == NULL) {
			_g_free0 (jid_attribute);
			_xmpp_jid_unref0 (real_jid);
			_xmpp_stanza_entry_unref0 (item_node);
			_xmpp_stanza_entry_unref0 (muc_x_node);
			_xmpp_stanza_entry_unref0 (device_node);
			_xmpp_stanza_entry_unref0 (muji_node);
			return;
		}
		_tmp18_ = jid_attribute;
		_tmp19_ = xmpp_jid_new (_tmp18_, &_inner_error0_);
		_tmp17_ = _tmp19_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (jid_attribute);
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_error;
			}
			_xmpp_jid_unref0 (real_jid);
			_xmpp_stanza_entry_unref0 (item_node);
			_xmpp_stanza_entry_unref0 (muc_x_node);
			_xmpp_stanza_entry_unref0 (device_node);
			_xmpp_stanza_entry_unref0 (muji_node);
			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;
		}
		_tmp20_ = _tmp17_;
		_tmp17_ = NULL;
		_xmpp_jid_unref0 (real_jid);
		real_jid = _tmp20_;
		_xmpp_jid_unref0 (_tmp17_);
		_g_free0 (jid_attribute);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		g_clear_error (&_inner_error0_);
		_xmpp_jid_unref0 (real_jid);
		_xmpp_stanza_entry_unref0 (item_node);
		_xmpp_stanza_entry_unref0 (muc_x_node);
		_xmpp_stanza_entry_unref0 (device_node);
		_xmpp_stanza_entry_unref0 (muji_node);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_xmpp_jid_unref0 (real_jid);
		_xmpp_stanza_entry_unref0 (item_node);
		_xmpp_stanza_entry_unref0 (muc_x_node);
		_xmpp_stanza_entry_unref0 (device_node);
		_xmpp_stanza_entry_unref0 (muji_node);
		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;
	}
	_tmp21_ = self->priv->device_id_by_muji_member;
	_tmp22_ = xmpp_stanza_get_from ((XmppStanza*) presence);
	_tmp23_ = _tmp22_;
	_tmp24_ = _tmp23_;
	_tmp25_ = xmpp_jid_get_bare_jid (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = _tmp26_;
	_tmp28_ = xmpp_jid_to_string (_tmp27_);
	_tmp29_ = _tmp28_;
	_tmp30_ = real_jid;
	_tmp31_ = xmpp_jid_to_string (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = g_strconcat (_tmp29_, "/", _tmp32_, NULL);
	_tmp34_ = _tmp33_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp21_, _tmp34_, (gpointer) ((gintptr) device_id));
	_g_free0 (_tmp34_);
	_g_free0 (_tmp32_);
	_g_free0 (_tmp29_);
	_xmpp_jid_unref0 (_tmp27_);
	_xmpp_jid_unref0 (_tmp24_);
	_xmpp_jid_unref0 (real_jid);
	_xmpp_stanza_entry_unref0 (item_node);
	_xmpp_stanza_entry_unref0 (muc_x_node);
	_xmpp_stanza_entry_unref0 (device_node);
	_xmpp_stanza_entry_unref0 (muji_node);
}

static void
_dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_message_received_xmpp_message_module_received_message (XmppMessageModule* _sender,
                                                                                                                         XmppXmppStream* stream,
                                                                                                                         XmppMessageStanza* message,
                                                                                                                         gpointer self)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_message_received ((DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) self, stream, message);
}

static void
_dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_incoming_iq_set_get_xmpp_iq_module_preprocess_incoming_iq_set_get (XmppIqModule* _sender,
                                                                                                                                                XmppXmppStream* stream,
                                                                                                                                                XmppIqStanza* iq_stanza,
                                                                                                                                                gpointer self)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_incoming_iq_set_get ((DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) self, stream, iq_stanza);
}

static void
_dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_outgoing_iq_set_get_xmpp_iq_module_preprocess_outgoing_iq_set_get (XmppIqModule* _sender,
                                                                                                                                                XmppXmppStream* stream,
                                                                                                                                                XmppIqStanza* iq_stanza,
                                                                                                                                                gpointer self)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_outgoing_iq_set_get ((DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) self, stream, iq_stanza);
}

static void
_dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_session_initiate_received_xmpp_xep_jingle_module_session_initiate_received (XmppXepJingleModule* _sender,
                                                                                                                                              XmppXmppStream* stream,
                                                                                                                                              XmppXepJingleSession* session,
                                                                                                                                              gpointer self)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_session_initiate_received ((DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) self, stream, session);
}

static void
_dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_pre_send_presence_stanza_xmpp_presence_module_pre_send_presence_stanza (XmppPresenceModule* _sender,
                                                                                                                                          XmppXmppStream* stream,
                                                                                                                                          XmppPresenceStanza* presence,
                                                                                                                                          gpointer self)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_pre_send_presence_stanza ((DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) self, stream, presence);
}

static void
_dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_received_available_xmpp_presence_module_received_available (XmppPresenceModule* _sender,
                                                                                                                              XmppXmppStream* stream,
                                                                                                                              XmppPresenceStanza* presence,
                                                                                                                              gpointer self)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_received_available ((DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) self, stream, presence);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_attach (XmppXmppStreamModule* base,
                                                                           XmppXmppStream* stream)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppMessageModule* _tmp2_;
	XmppModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppMessageModule* _tmp5_;
	XmppStanzaListenerHolder* _tmp6_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener* _tmp7_;
	XmppModuleIdentity* _tmp8_;
	gpointer _tmp9_;
	XmppIqModule* _tmp10_;
	XmppModuleIdentity* _tmp11_;
	gpointer _tmp12_;
	XmppIqModule* _tmp13_;
	XmppModuleIdentity* _tmp14_;
	gpointer _tmp15_;
	XmppXepJingleModule* _tmp16_;
	XmppModuleIdentity* _tmp17_;
	gpointer _tmp18_;
	XmppPresenceModule* _tmp19_;
	XmppModuleIdentity* _tmp20_;
	gpointer _tmp21_;
	XmppPresenceModule* _tmp22_;
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_message_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppMessageModule*) _tmp1_;
	g_signal_connect_object (_tmp2_, "received-message", (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_message_received_xmpp_message_module_received_message, self, 0);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = xmpp_message_module_IDENTITY;
	_tmp4_ = xmpp_xmpp_stream_get_module (stream, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
	_tmp5_ = (XmppMessageModule*) _tmp4_;
	_tmp6_ = _tmp5_->send_pipeline;
	_tmp7_ = self->priv->send_listener;
	xmpp_listener_holder_connect ((XmppListenerHolder*) _tmp6_, (XmppOrderedListener*) _tmp7_);
	_g_object_unref0 (_tmp5_);
	_tmp8_ = xmpp_iq_module_IDENTITY;
	_tmp9_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp8_);
	_tmp10_ = (XmppIqModule*) _tmp9_;
	g_signal_connect_object (_tmp10_, "preprocess-incoming-iq-set-get", (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_incoming_iq_set_get_xmpp_iq_module_preprocess_incoming_iq_set_get, self, 0);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = xmpp_iq_module_IDENTITY;
	_tmp12_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp11_);
	_tmp13_ = (XmppIqModule*) _tmp12_;
	g_signal_connect_object (_tmp13_, "preprocess-outgoing-iq-set-get", (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_outgoing_iq_set_get_xmpp_iq_module_preprocess_outgoing_iq_set_get, self, 0);
	_g_object_unref0 (_tmp13_);
	_tmp14_ = xmpp_xep_jingle_module_IDENTITY;
	_tmp15_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp14_);
	_tmp16_ = (XmppXepJingleModule*) _tmp15_;
	g_signal_connect_object (_tmp16_, "session-initiate-received", (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_session_initiate_received_xmpp_xep_jingle_module_session_initiate_received, self, 0);
	_g_object_unref0 (_tmp16_);
	_tmp17_ = xmpp_presence_module_IDENTITY;
	_tmp18_ = xmpp_xmpp_stream_get_module (stream, XMPP_PRESENCE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp17_);
	_tmp19_ = (XmppPresenceModule*) _tmp18_;
	g_signal_connect_object (_tmp19_, "pre-send-presence-stanza", (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_pre_send_presence_stanza_xmpp_presence_module_pre_send_presence_stanza, self, 0);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = xmpp_presence_module_IDENTITY;
	_tmp21_ = xmpp_xmpp_stream_get_module (stream, XMPP_PRESENCE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp20_);
	_tmp22_ = (XmppPresenceModule*) _tmp21_;
	g_signal_connect_object (_tmp22_, "received-available", (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_received_available_xmpp_presence_module_received_available, self, 0);
	_g_object_unref0 (_tmp22_);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_detach (XmppXmppStreamModule* base,
                                                                           XmppXmppStream* stream)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppMessageModule* _tmp2_;
	guint _tmp3_;
	XmppModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	XmppMessageModule* _tmp6_;
	XmppStanzaListenerHolder* _tmp7_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener* _tmp8_;
	XmppModuleIdentity* _tmp9_;
	gpointer _tmp10_;
	XmppIqModule* _tmp11_;
	guint _tmp12_;
	XmppModuleIdentity* _tmp13_;
	gpointer _tmp14_;
	XmppIqModule* _tmp15_;
	guint _tmp16_;
	XmppModuleIdentity* _tmp17_;
	gpointer _tmp18_;
	XmppXepJingleModule* _tmp19_;
	guint _tmp20_;
	XmppModuleIdentity* _tmp21_;
	gpointer _tmp22_;
	XmppPresenceModule* _tmp23_;
	guint _tmp24_;
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_message_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppMessageModule*) _tmp1_;
	g_signal_parse_name ("received-message", XMPP_TYPE_MESSAGE_MODULE, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_message_received_xmpp_message_module_received_message, self);
	_g_object_unref0 (_tmp2_);
	_tmp4_ = xmpp_message_module_IDENTITY;
	_tmp5_ = xmpp_xmpp_stream_get_module (stream, XMPP_TYPE_MESSAGE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
	_tmp6_ = (XmppMessageModule*) _tmp5_;
	_tmp7_ = _tmp6_->send_pipeline;
	_tmp8_ = self->priv->send_listener;
	xmpp_listener_holder_disconnect ((XmppListenerHolder*) _tmp7_, (XmppOrderedListener*) _tmp8_);
	_g_object_unref0 (_tmp6_);
	_tmp9_ = xmpp_iq_module_IDENTITY;
	_tmp10_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp9_);
	_tmp11_ = (XmppIqModule*) _tmp10_;
	g_signal_parse_name ("preprocess-incoming-iq-set-get", XMPP_IQ_TYPE_MODULE, &_tmp12_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp11_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp12_, 0, NULL, (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_incoming_iq_set_get_xmpp_iq_module_preprocess_incoming_iq_set_get, self);
	_g_object_unref0 (_tmp11_);
	_tmp13_ = xmpp_iq_module_IDENTITY;
	_tmp14_ = xmpp_xmpp_stream_get_module (stream, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp13_);
	_tmp15_ = (XmppIqModule*) _tmp14_;
	g_signal_parse_name ("preprocess-outgoing-iq-set-get", XMPP_IQ_TYPE_MODULE, &_tmp16_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp15_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp16_, 0, NULL, (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_preprocess_outgoing_iq_set_get_xmpp_iq_module_preprocess_outgoing_iq_set_get, self);
	_g_object_unref0 (_tmp15_);
	_tmp17_ = xmpp_xep_jingle_module_IDENTITY;
	_tmp18_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp17_);
	_tmp19_ = (XmppXepJingleModule*) _tmp18_;
	g_signal_parse_name ("session-initiate-received", XMPP_XEP_JINGLE_TYPE_MODULE, &_tmp20_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp19_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp20_, 0, NULL, (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_session_initiate_received_xmpp_xep_jingle_module_session_initiate_received, self);
	_g_object_unref0 (_tmp19_);
	_tmp21_ = xmpp_presence_module_IDENTITY;
	_tmp22_ = xmpp_xmpp_stream_get_module (stream, XMPP_PRESENCE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp21_);
	_tmp23_ = (XmppPresenceModule*) _tmp22_;
	g_signal_parse_name ("received-available", XMPP_PRESENCE_TYPE_MODULE, &_tmp24_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp23_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp24_, 0, NULL, (GCallback) _dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_on_received_available_xmpp_presence_module_received_available, self);
	_g_object_unref0 (_tmp23_);
}

static gchar*
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_get_ns (XmppXmppStreamModule* base)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) base;
	_tmp0_ = g_strdup (DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_get_id (XmppXmppStreamModule* base)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) base;
	_tmp0_ = dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_construct (GType object_type)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule * self = NULL;
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule*
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_new (void)
{
	return dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_construct (DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_STREAM_MODULE);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_class_init (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModuleClass * klass,
                                                                          gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule_private_offset);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_real_get_id;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_finalize;
	_tmp0_ = xmpp_module_identity_new (DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_STREAM_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, "dtls_srtp_omemo_verification_draft");
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_IDENTITY = _tmp0_;
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_instance_init (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule * self,
                                                                             gpointer klass)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	self->priv = dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_get_instance_private (self);
	_tmp0_ = dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_new ();
	self->priv->send_listener = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_INT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->device_id_by_jingle_sid = _tmp1_;
	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_INT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->device_id_by_muji_member = _tmp2_;
	_tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, GEE_TYPE_LIST, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->content_names_by_jingle_sid = _tmp3_;
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_finalize (GObject * obj)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_STREAM_MODULE, DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule);
	_g_object_unref0 (self->priv->send_listener);
	_g_object_unref0 (self->priv->device_id_by_jingle_sid);
	_g_object_unref0 (self->priv->device_id_by_muji_member);
	_g_object_unref0 (self->priv->content_names_by_jingle_sid);
	G_OBJECT_CLASS (dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule), 0, (GInstanceInitFunc) dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_instance_init, NULL };
	GType dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id;
	dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule", &g_define_type_info, 0);
	DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModule_private_offset = g_type_add_instance_private (dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id, sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftStreamModulePrivate));
	return dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id;
}

GType
dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_get_type (void)
{
	static volatile gsize dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id__once)) {
		GType dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id;
		dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id = dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id__once, dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id);
	}
	return dino_plugins_omemo_dtls_srtp_verification_draft_stream_module_type_id__once;
}

static inline gpointer
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_instance_private (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener_private_offset);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run_data_free (gpointer _data)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->message);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData, _data_);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run (XmppStanzaListener* base,
                                                                                     XmppXmppStream* stream,
                                                                                     XmppMessageStanza* message,
                                                                                     GAsyncReadyCallback _callback_,
                                                                                     gpointer _user_data_)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener * self;
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData* _data_;
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppMessageStanza* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (message != NULL);
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener*) base;
	_data_ = g_slice_new0 (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _g_object_ref0 (message);
	_g_object_unref0 (_data_->message);
	_data_->message = _tmp2_;
	dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run_co (_data_);
}

static gboolean
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_run_finish (XmppStanzaListener* base,
                                                                                       GAsyncResult* _res_)
{
	gboolean result;
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static gboolean
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run_co (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = ((XmppStanza*) _data_->message)->stanza;
	_data_->_tmp1_ = xmpp_stanza_node_get_subnode (_data_->_tmp0_, "proceed", XMPP_XEP_JINGLE_MESSAGE_INITIATION_NS_URI, FALSE);
	_data_->proceed_node = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->proceed_node;
	if (_data_->_tmp2_ == NULL) {
		_data_->result = FALSE;
		_xmpp_stanza_entry_unref0 (_data_->proceed_node);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = xmpp_stanza_node_new_build ("device", DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_NS_URI, NULL, NULL);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dino_plugins_omemo_stream_module_IDENTITY;
	_data_->_tmp8_ = xmpp_xmpp_stream_get_module (_data_->stream, DINO_PLUGINS_OMEMO_TYPE_STREAM_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp7_);
	_data_->_tmp9_ = (DinoPluginsOmemoStreamModule*) _data_->_tmp8_;
	_data_->_tmp10_ = dino_plugins_omemo_stream_module_get_store (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = omemo_store_get_local_registration_id (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = g_strdup_printf ("%u", _data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = xmpp_stanza_node_put_attribute (_data_->_tmp6_, "id", _data_->_tmp15_, NULL);
	_data_->_tmp17_ = _data_->_tmp16_;
	_g_free0 (_data_->_tmp15_);
	_g_object_unref0 (_data_->_tmp9_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp6_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp4_);
	_data_->device_node = _data_->_tmp17_;
	_data_->_tmp18_ = _data_->proceed_node;
	_data_->_tmp19_ = _data_->device_node;
	_data_->_tmp20_ = xmpp_stanza_node_put_node (_data_->_tmp18_, _data_->_tmp19_);
	_data_->_tmp21_ = _data_->_tmp20_;
	_xmpp_stanza_entry_unref0 (_data_->_tmp21_);
	_data_->result = FALSE;
	_xmpp_stanza_entry_unref0 (_data_->device_node);
	_xmpp_stanza_entry_unref0 (_data_->proceed_node);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener*
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_construct (GType object_type)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener * self = NULL;
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener*) xmpp_stanza_listener_construct (object_type, XMPP_TYPE_MESSAGE_STANZA, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	return self;
}

DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener*
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_new (void)
{
	return dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_construct (DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_VERIFICATION_SEND_LISTENER);
}

static const gchar*
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_get_action_group (XmppOrderedListener* base)
{
	const gchar* result;
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener* self;
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener*) base;
	result = "REWRITE_NODES";
	return result;
}

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

static void
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_class_init (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerClass * klass,
                                                                                       gpointer klass_data)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener_private_offset);
	((XmppStanzaListenerClass *) klass)->run = (void (*) (XmppStanzaListener*, XmppXmppStream*, gconstpointer, GAsyncReadyCallback, gpointer)) dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_run;
	((XmppStanzaListenerClass *) klass)->run_finish = (gboolean (*) (XmppStanzaListener*, GAsyncResult*)) dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_run_finish;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_action_group = (const gchar* (*) (XmppOrderedListener*)) dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_get_action_group;
	XMPP_ORDERED_LISTENER_CLASS (klass)->get_after_actions = (gchar** (*) (XmppOrderedListener*, gint*)) dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_real_get_after_actions;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_LISTENER_ACTION_GROUP_PROPERTY, dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_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_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_LISTENER_AFTER_ACTIONS_PROPERTY, dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_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_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_instance_init (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener * self,
                                                                                          gpointer klass)
{
	gchar** _tmp0_;
	self->priv = dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_instance_private (self);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	self->priv->after_actions_const = _tmp0_;
	self->priv->after_actions_const_length1 = 0;
	self->priv->_after_actions_const_size_ = self->priv->after_actions_const_length1;
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_finalize (GObject * obj)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_VERIFICATION_SEND_LISTENER, DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener);
	self->priv->after_actions_const = (_vala_array_free (self->priv->after_actions_const, self->priv->after_actions_const_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener), 0, (GInstanceInitFunc) dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_instance_init, NULL };
	GType dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id;
	dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id = g_type_register_static (XMPP_TYPE_STANZA_LISTENER, "DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener", &g_define_type_info, 0);
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener_private_offset = g_type_add_instance_private (dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id, sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListenerPrivate));
	return dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id;
}

GType
dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_type (void)
{
	static volatile gsize dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id__once)) {
		GType dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id;
		dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id = dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id__once, dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id);
	}
	return dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_type_id__once;
}

static void
_vala_dino_plugins_omemo_dtls_srtp_verification_draft_verification_send_listener_get_property (GObject * object,
                                                                                               guint property_id,
                                                                                               GValue * value,
                                                                                               GParamSpec * pspec)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_VERIFICATION_SEND_LISTENER, DinoPluginsOmemoDtlsSrtpVerificationDraftVerificationSendListener);
	switch (property_id) {
		case DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_LISTENER_ACTION_GROUP_PROPERTY:
		g_value_set_string (value, xmpp_ordered_listener_get_action_group ((XmppOrderedListener*) self));
		break;
		case DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_VERIFICATION_SEND_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_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_instance_private (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption_private_offset);
}

DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption*
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_construct (GType object_type,
                                                                                    const gchar* encryption_ns,
                                                                                    const gchar* encryption_name,
                                                                                    XmppJid* jid,
                                                                                    gint sid)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption * self = NULL;
	guint8* _tmp0_;
	guint8* _tmp1_;
	gint _tmp1__length1;
	guint8* _tmp2_;
	guint8* _tmp3_;
	gint _tmp3__length1;
	g_return_val_if_fail (encryption_ns != NULL, NULL);
	g_return_val_if_fail (encryption_name != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	_tmp0_ = g_new0 (guint8, 0);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 0;
	_tmp2_ = g_new0 (guint8, 0);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 0;
	self = (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption*) xmpp_xep_jingle_content_encryption_construct (object_type, encryption_ns, encryption_name, _tmp1_, (gint) 0, _tmp3_, (gint) 0);
	_tmp3_ = (g_free (_tmp3_), NULL);
	_tmp1_ = (g_free (_tmp1_), NULL);
	dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_jid (self, jid);
	dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_sid (self, sid);
	return self;
}

DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption*
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_new (const gchar* encryption_ns,
                                                                              const gchar* encryption_name,
                                                                              XmppJid* jid,
                                                                              gint sid)
{
	return dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_construct (DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_OMEMO_CONTENT_ENCRYPTION, encryption_ns, encryption_name, jid, sid);
}

XmppJid*
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_jid (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_jid;
	result = _tmp0_;
	return result;
}

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

void
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_jid (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* self,
                                                                                  XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_jid (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_jid);
		self->priv->_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_JID_PROPERTY]);
	}
}

gint
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_sid (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_sid;
	return result;
}

void
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_sid (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption* self,
                                                                                  gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_sid (self);
	if (old_value != value) {
		self->priv->_sid = value;
		g_object_notify_by_pspec ((GObject *) self, dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_SID_PROPERTY]);
	}
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_class_init (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryptionClass * klass,
                                                                                     gpointer klass_data)
{
	dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_JID_PROPERTY, dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_JID_PROPERTY] = xmpp_param_spec_jid ("jid", "jid", "jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_SID_PROPERTY, dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_properties[DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_SID_PROPERTY] = g_param_spec_int ("sid", "sid", "sid", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_instance_init (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption * self,
                                                                                        gpointer klass)
{
	self->priv = dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_instance_private (self);
}

static void
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_finalize (GObject * obj)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_OMEMO_CONTENT_ENCRYPTION, DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption);
	_xmpp_jid_unref0 (self->priv->_jid);
	G_OBJECT_CLASS (dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_parent_class)->finalize (obj);
}

static GType
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryptionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption), 0, (GInstanceInitFunc) dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_instance_init, NULL };
	GType dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id;
	dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id = g_type_register_static (XMPP_XEP_JINGLE_TYPE_CONTENT_ENCRYPTION, "DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption", &g_define_type_info, 0);
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption_private_offset = g_type_add_instance_private (dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id, sizeof (DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryptionPrivate));
	return dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id;
}

GType
dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_type (void)
{
	static volatile gsize dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id__once)) {
		GType dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id;
		dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id = dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_type_once ();
		g_once_init_leave (&dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id__once, dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id);
	}
	return dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_type_id__once;
}

static void
_vala_dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_property (GObject * object,
                                                                                             guint property_id,
                                                                                             GValue * value,
                                                                                             GParamSpec * pspec)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_OMEMO_CONTENT_ENCRYPTION, DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption);
	switch (property_id) {
		case DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_JID_PROPERTY:
		xmpp_value_set_jid (value, dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_jid (self));
		break;
		case DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_SID_PROPERTY:
		g_value_set_int (value, dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_get_sid (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_property (GObject * object,
                                                                                             guint property_id,
                                                                                             const GValue * value,
                                                                                             GParamSpec * pspec)
{
	DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_TYPE_OMEMO_CONTENT_ENCRYPTION, DinoPluginsOmemoDtlsSrtpVerificationDraftOmemoContentEncryption);
	switch (property_id) {
		case DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_JID_PROPERTY:
		dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_jid (self, xmpp_value_get_jid (value));
		break;
		case DINO_PLUGINS_OMEMO_DTLS_SRTP_VERIFICATION_DRAFT_OMEMO_CONTENT_ENCRYPTION_SID_PROPERTY:
		dino_plugins_omemo_dtls_srtp_verification_draft_omemo_content_encryption_set_sid (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

