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

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

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

enum  {
	DINO_CALL_STATE_0_PROPERTY,
	DINO_CALL_STATE_PARENT_MUC_PROPERTY,
	DINO_CALL_STATE_ACCEPTED_PROPERTY,
	DINO_CALL_STATE_CIM_MESSAGE_TYPE_PROPERTY,
	DINO_CALL_STATE_GROUP_CALL_PROPERTY,
	DINO_CALL_STATE_WE_SHOULD_SEND_AUDIO_PROPERTY,
	DINO_CALL_STATE_WE_SHOULD_SEND_VIDEO_PROPERTY,
	DINO_CALL_STATE_NUM_PROPERTIES
};
static GParamSpec* dino_call_state_properties[DINO_CALL_STATE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_xep_muji_group_call_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_muji_group_call_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
typedef struct _DinoCallStateInitiateGroupchatCallData DinoCallStateInitiateGroupchatCallData;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
typedef struct _DinoCallStateInviteToCallData DinoCallStateInviteToCallData;
typedef struct _Block4Data Block4Data;
typedef struct _DinoCallStateCanConvertIntoGroupcallData DinoCallStateCanConvertIntoGroupcallData;
#define _xmpp_xep_data_forms_data_form_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_data_forms_data_form_unref (var), NULL)))
typedef struct _DinoCallStateConvertIntoGroupCallData DinoCallStateConvertIntoGroupCallData;
typedef struct _DinoCallStateJoinGroupCallData DinoCallStateJoinGroupCallData;
enum  {
	DINO_CALL_STATE_TERMINATED_SIGNAL,
	DINO_CALL_STATE_PEER_JOINED_SIGNAL,
	DINO_CALL_STATE_PEER_LEFT_SIGNAL,
	DINO_CALL_STATE_NUM_SIGNALS
};
static guint dino_call_state_signals[DINO_CALL_STATE_NUM_SIGNALS] = {0};

struct _DinoCallStatePrivate {
	XmppJid* _parent_muc;
	gboolean _accepted;
	gchar* _cim_message_type;
	XmppXepMujiGroupCall* _group_call;
	gboolean _we_should_send_audio;
	gboolean _we_should_send_video;
	DinoPluginsMediaDevice* selected_microphone_device;
	DinoPluginsMediaDevice* selected_speaker_device;
	DinoPluginsMediaDevice* selected_video_device;
};

struct _Block2Data {
	int _ref_count_;
	DinoCallState* self;
	DinoEntitiesCall* call;
};

struct _DinoCallStateInitiateGroupchatCallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoCallState* self;
	XmppJid* muc;
	GeeArrayList* _tmp0_;
	XmppXepMujiGroupCall* _tmp1_;
	XmppXepMujiGroupCall* _tmp2_;
	DinoEntitiesCall* _tmp3_;
	DinoEntitiesCallState _tmp4_;
	DinoEntitiesCallState _tmp5_;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp6_;
	DinoEntitiesCall* _tmp7_;
	DinoEntitiesAccount* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	XmppXmppStream* _tmp10_;
	XmppXmppStream* _tmp11_;
	GeeList* occupants;
	DinoStreamInteractor* _tmp12_;
	DinoModuleIdentity* _tmp13_;
	gpointer _tmp14_;
	DinoMucManager* _tmp15_;
	DinoEntitiesCall* _tmp16_;
	DinoEntitiesAccount* _tmp17_;
	DinoEntitiesAccount* _tmp18_;
	GeeList* _tmp19_;
	GeeList* _tmp20_;
	GeeList* _occupant_list;
	GeeList* _tmp21_;
	gint _occupant_size;
	GeeList* _tmp22_;
	gint _tmp23_;
	gint _tmp24_;
	gint _occupant_index;
	gint _tmp25_;
	gint _tmp26_;
	XmppJid* occupant;
	GeeList* _tmp27_;
	gpointer _tmp28_;
	XmppJid* real_jid;
	DinoStreamInteractor* _tmp29_;
	DinoModuleIdentity* _tmp30_;
	gpointer _tmp31_;
	DinoMucManager* _tmp32_;
	XmppJid* _tmp33_;
	DinoEntitiesCall* _tmp34_;
	DinoEntitiesAccount* _tmp35_;
	DinoEntitiesAccount* _tmp36_;
	XmppJid* _tmp37_;
	XmppJid* _tmp38_;
	XmppJid* _tmp39_;
	XmppJid* _tmp40_;
	XmppJid* _tmp41_;
	XmppJid* _tmp42_;
	XmppJid* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	XmppXmppStream* _tmp46_;
	XmppModuleIdentity* _tmp47_;
	gpointer _tmp48_;
	XmppXepMucModule* _tmp49_;
	XmppXmppStream* _tmp50_;
	XmppXepMujiGroupCall* _tmp51_;
	XmppJid* _tmp52_;
	XmppJid* _tmp53_;
	XmppJid* _tmp54_;
	XmppJid* _tmp55_;
	XmppJid* _tmp56_;
	XmppXmppStream* _tmp57_;
	XmppModuleIdentity* _tmp58_;
	gpointer _tmp59_;
	XmppXepCallInvitesModule* _tmp60_;
	XmppXmppStream* _tmp61_;
	const gchar* _tmp62_;
	XmppXepMujiGroupCall* _tmp63_;
	XmppJid* _tmp64_;
	gboolean _tmp65_;
	const gchar* _tmp66_;
};

struct _Block3Data {
	int _ref_count_;
	DinoCallState* self;
	XmppJid* invitee;
	gpointer _async_data_;
};

struct _DinoCallStateInviteToCallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoCallState* self;
	XmppJid* invitee;
	Block3Data* _data3_;
	XmppXepMujiGroupCall* _tmp0_;
	XmppXepMujiGroupCall* _tmp1_;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp2_;
	DinoEntitiesCall* _tmp3_;
	DinoEntitiesAccount* _tmp4_;
	DinoEntitiesAccount* _tmp5_;
	XmppXmppStream* _tmp6_;
	XmppXmppStream* _tmp7_;
	DinoEntitiesCall* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	DinoEntitiesAccount* _tmp10_;
	XmppJid* _tmp11_;
	XmppJid* _tmp12_;
	XmppJid* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	XmppXmppStream* _tmp18_;
	XmppModuleIdentity* _tmp19_;
	gpointer _tmp20_;
	XmppXepMucModule* _tmp21_;
	XmppXmppStream* _tmp22_;
	XmppXepMujiGroupCall* _tmp23_;
	XmppJid* _tmp24_;
	XmppXmppStream* _tmp25_;
	XmppModuleIdentity* _tmp26_;
	gpointer _tmp27_;
	XmppXepCallInvitesModule* _tmp28_;
	XmppXmppStream* _tmp29_;
	const gchar* _tmp30_;
	XmppXepMujiGroupCall* _tmp31_;
	XmppJid* _tmp32_;
	gboolean _tmp33_;
};

struct _Block4Data {
	int _ref_count_;
	DinoCallState* self;
	DinoPeerState* peer_state;
};

struct _DinoCallStateCanConvertIntoGroupcallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoCallState* self;
	gboolean result;
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	XmppJid* peer;
	GeeHashMap* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	GeeSet* _tmp6_;
	gint _tmp7_;
	gpointer* _tmp8_;
	XmppJid** _tmp9_;
	gint _tmp9__length1;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	XmppJid* _tmp12_;
	gboolean peer_has_feature;
	DinoStreamInteractor* _tmp13_;
	DinoModuleIdentity* _tmp14_;
	gpointer _tmp15_;
	DinoEntityInfo* _tmp16_;
	DinoEntitiesCall* _tmp17_;
	DinoEntitiesAccount* _tmp18_;
	DinoEntitiesAccount* _tmp19_;
	XmppJid* _tmp20_;
	gboolean _tmp21_;
	gboolean can_initiate;
	DinoStreamInteractor* _tmp22_;
	DinoModuleIdentity* _tmp23_;
	gpointer _tmp24_;
	DinoCalls* _tmp25_;
	DinoEntitiesCall* _tmp26_;
	DinoEntitiesAccount* _tmp27_;
	DinoEntitiesAccount* _tmp28_;
	gboolean _tmp29_;
	gboolean _tmp30_;
};

struct _DinoCallStateConvertIntoGroupCallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoCallState* self;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp0_;
	DinoEntitiesCall* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	XmppXmppStream* _tmp4_;
	XmppXmppStream* _tmp5_;
	XmppJid* muc_jid;
	DinoStreamInteractor* _tmp6_;
	DinoModuleIdentity* _tmp7_;
	gpointer _tmp8_;
	DinoMucManager* _tmp9_;
	GeeHashMap* _tmp10_;
	DinoEntitiesCall* _tmp11_;
	DinoEntitiesAccount* _tmp12_;
	DinoEntitiesAccount* _tmp13_;
	gpointer _tmp14_;
	XmppJid* _tmp15_;
	XmppJid* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	XmppJid* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	XmppJid* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	XmppJid* _tmp27_;
	XmppJid* _tmp28_;
	XmppJid* _tmp29_;
	DinoEntitiesCall* _tmp30_;
	DinoEntitiesAccount* _tmp31_;
	DinoEntitiesAccount* _tmp32_;
	XmppJid* _tmp33_;
	XmppJid* _tmp34_;
	XmppJid* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	XmppJid* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	XmppJid* _tmp41_;
	XmppXepDataFormsDataForm* data_form;
	DinoStreamInteractor* _tmp42_;
	DinoModuleIdentity* _tmp43_;
	gpointer _tmp44_;
	DinoMucManager* _tmp45_;
	DinoEntitiesCall* _tmp46_;
	DinoEntitiesAccount* _tmp47_;
	DinoEntitiesAccount* _tmp48_;
	XmppJid* _tmp49_;
	XmppXepDataFormsDataForm* _tmp50_;
	XmppXepDataFormsDataForm* _tmp51_;
	XmppXepDataFormsDataForm* _tmp52_;
	GeeList* _field_list;
	XmppXepDataFormsDataForm* _tmp53_;
	GeeList* _tmp54_;
	gint _field_size;
	GeeList* _tmp55_;
	gint _tmp56_;
	gint _tmp57_;
	gint _field_index;
	gint _tmp58_;
	gint _tmp59_;
	XmppXepDataFormsDataFormField* field;
	GeeList* _tmp60_;
	gpointer _tmp61_;
	XmppXepDataFormsDataFormField* _tmp62_;
	const gchar* _tmp63_;
	const gchar* _tmp64_;
	const gchar* _tmp65_;
	GQuark _tmp67_;
	XmppXepDataFormsDataFormField* _tmp68_;
	XmppXepDataFormsDataFormType* _tmp69_;
	XmppXepDataFormsDataFormType* _tmp70_;
	XmppXepDataFormsDataFormType _tmp71_;
	XmppXepDataFormsDataFormField* _tmp72_;
	XmppXepDataFormsDataFormField* _tmp73_;
	XmppXepDataFormsDataFormType* _tmp74_;
	XmppXepDataFormsDataFormType* _tmp75_;
	XmppXepDataFormsDataFormType _tmp76_;
	XmppXepDataFormsDataFormField* _tmp77_;
	XmppXepDataFormsDataFormField* _tmp78_;
	XmppXepDataFormsDataFormType* _tmp79_;
	XmppXepDataFormsDataFormType* _tmp80_;
	XmppXepDataFormsDataFormType _tmp81_;
	XmppXepDataFormsDataFormField* _tmp82_;
	XmppXepDataFormsDataFormField* _tmp83_;
	XmppXepDataFormsDataFormType* _tmp84_;
	XmppXepDataFormsDataFormType* _tmp85_;
	XmppXepDataFormsDataFormType _tmp86_;
	XmppXepDataFormsDataFormField* _tmp87_;
	DinoStreamInteractor* _tmp88_;
	DinoModuleIdentity* _tmp89_;
	gpointer _tmp90_;
	DinoMucManager* _tmp91_;
	DinoEntitiesCall* _tmp92_;
	DinoEntitiesAccount* _tmp93_;
	DinoEntitiesAccount* _tmp94_;
	XmppJid* _tmp95_;
	XmppXepDataFormsDataForm* _tmp96_;
	GeeIterator* _peer_jid_it;
	GeeHashMap* _tmp97_;
	GeeSet* _tmp98_;
	GeeSet* _tmp99_;
	GeeSet* _tmp100_;
	GeeIterator* _tmp101_;
	GeeIterator* _tmp102_;
	GeeIterator* _tmp103_;
	XmppJid* peer_jid;
	GeeIterator* _tmp104_;
	gpointer _tmp105_;
	DinoEntitiesCall* _tmp106_;
	DinoEntitiesAccount* _tmp107_;
	DinoEntitiesAccount* _tmp108_;
	XmppJid* _tmp109_;
	XmppJid* _tmp110_;
	XmppJid* _tmp111_;
	gchar* _tmp112_;
	gchar* _tmp113_;
	XmppJid* _tmp114_;
	gchar* _tmp115_;
	gchar* _tmp116_;
	XmppJid* _tmp117_;
	GError* _inner_error0_;
};

struct _DinoCallStateJoinGroupCallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoCallState* self;
	XmppJid* muc_jid;
	DinoEntitiesCall* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	XmppXmppStream* stream;
	DinoStreamInteractor* _tmp10_;
	DinoEntitiesCall* _tmp11_;
	DinoEntitiesAccount* _tmp12_;
	DinoEntitiesAccount* _tmp13_;
	XmppXmppStream* _tmp14_;
	XmppXmppStream* _tmp15_;
	XmppXmppStream* _tmp16_;
	XmppModuleIdentity* _tmp17_;
	gpointer _tmp18_;
	XmppXepMujiModule* _tmp19_;
	XmppXmppStream* _tmp20_;
	gboolean _tmp21_;
	XmppXepMujiGroupCall* _tmp22_;
	XmppXepMujiGroupCall* _tmp23_;
	XmppXepMujiGroupCall* _tmp24_;
	DinoEntitiesCall* _tmp25_;
	DinoEntitiesAccount* _tmp26_;
	DinoEntitiesAccount* _tmp27_;
	XmppJid* _tmp28_;
	XmppJid* _tmp29_;
	XmppJid* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	XmppXepMujiGroupCall* _tmp33_;
	XmppXepMujiGroupCall* _tmp34_;
	XmppXepMujiGroupCall* _tmp35_;
	GeeArrayList* _tmp36_;
	gint _tmp37_;
	gint _tmp38_;
	GeeArrayList* _peer_jid_list;
	XmppXepMujiGroupCall* _tmp39_;
	GeeArrayList* _tmp40_;
	gint _peer_jid_size;
	GeeArrayList* _tmp41_;
	gint _tmp42_;
	gint _tmp43_;
	gint _peer_jid_index;
	gint _tmp44_;
	gint _tmp45_;
	XmppJid* peer_jid;
	GeeArrayList* _tmp46_;
	gpointer _tmp47_;
	GeeHashMap* _tmp48_;
	XmppJid* _tmp49_;
	DinoEntitiesCall* _tmp50_;
	DinoEntitiesAccount* _tmp51_;
	DinoEntitiesAccount* _tmp52_;
	XmppJid* _tmp53_;
	XmppJid* _tmp54_;
	XmppJid* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	XmppJid* _tmp58_;
	gchar* _tmp59_;
	gchar* _tmp60_;
	DinoPeerState* peer_state;
	XmppJid* _tmp61_;
	DinoEntitiesCall* _tmp62_;
	DinoStreamInteractor* _tmp63_;
	DinoPeerState* _tmp64_;
	DinoPeerState* _tmp65_;
	DinoPeerState* _tmp66_;
	XmppJid* _tmp67_;
	DinoEntitiesCall* _tmp68_;
	DinoEntitiesAccount* _tmp69_;
	DinoEntitiesAccount* _tmp70_;
	XmppJid* _tmp71_;
	XmppJid* _tmp72_;
	XmppJid* _tmp73_;
	gchar* _tmp74_;
	gchar* _tmp75_;
	gchar* _tmp76_;
	gchar* _tmp77_;
};

static gint DinoCallState_private_offset;
static gpointer dino_call_state_parent_class = NULL;

static guint _xmpp_jid_hash_func_gee_hash_data_func (gconstpointer v,
                                              gpointer self);
static gboolean _xmpp_jid_equals_func_gee_equal_data_func (gconstpointer a,
                                                    gconstpointer b,
                                                    gpointer self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void dino_call_state_set_accepted (DinoCallState* self,
                                   gboolean value);
static gboolean ___lambda50_ (Block2Data* _data2_);
static gboolean ____lambda50__gsource_func (gpointer self);
static void dino_call_state_initiate_groupchat_call_data_free (gpointer _data);
VALA_EXTERN void dino_call_state_initiate_groupchat_call (DinoCallState* self,
                                              XmppJid* muc,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN void dino_call_state_initiate_groupchat_call_finish (DinoCallState* self,
                                                     GAsyncResult* _res_);
static gboolean dino_call_state_initiate_groupchat_call_co (DinoCallStateInitiateGroupchatCallData* _data_);
static void dino_call_state_initiate_groupchat_call_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
VALA_EXTERN DinoPeerState* dino_call_state_set_first_peer (DinoCallState* self,
                                               XmppJid* peer);
VALA_EXTERN void dino_call_state_add_peer (DinoCallState* self,
                               DinoPeerState* peer);
static void dino_call_state_connect_peer_signals (DinoCallState* self,
                                           DinoPeerState* peer_state);
VALA_EXTERN void dino_call_state_on_peer_stream_created (DinoCallState* self,
                                             DinoPeerState* peer,
                                             const gchar* media);
VALA_EXTERN void dino_peer_state_mute_own_audio (DinoPeerState* self,
                                     gboolean mute);
VALA_EXTERN void dino_peer_state_mute_own_video (DinoPeerState* self,
                                     gboolean mute);
static void dino_call_state_invite_to_call_data_free (gpointer _data);
static gboolean dino_call_state_invite_to_call_co (DinoCallStateInviteToCallData* _data_);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void dino_call_state_invite_to_call_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static gboolean __lambda64_ (Block3Data* _data3_);
static gboolean ___lambda64__gsource_func (gpointer self);
VALA_EXTERN void dino_call_state_rename_peer (DinoCallState* self,
                                  XmppJid* from_jid,
                                  XmppJid* to_jid);
static void dino_call_state_on_call_terminated (DinoCallState* self,
                                         XmppJid* who_terminated,
                                         gboolean we_terminated,
                                         const gchar* reason_name,
                                         const gchar* reason_text);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void __lambda52_ (DinoCallState* self,
                  DinoPeerState* peer,
                  const gchar* media);
static void ___lambda52__dino_peer_state_stream_created (DinoPeerState* _sender,
                                                  const gchar* media,
                                                  gpointer self);
static void __lambda53_ (Block4Data* _data4_,
                  gboolean we_terminated,
                  const gchar* reason_name,
                  const gchar* reason_text);
static void dino_call_state_handle_peer_left (DinoCallState* self,
                                       DinoPeerState* peer_state,
                                       gboolean we_terminated,
                                       const gchar* reason_name,
                                       const gchar* reason_text);
static void ___lambda53__dino_peer_state_session_terminated (DinoPeerState* _sender,
                                                      gboolean we_terminated,
                                                      const gchar* reason_name,
                                                      const gchar* reason_text,
                                                      gpointer self);
static void dino_call_state_can_convert_into_groupcall_data_free (gpointer _data);
static gboolean dino_call_state_can_convert_into_groupcall_co (DinoCallStateCanConvertIntoGroupcallData* _data_);
static void dino_call_state_can_convert_into_groupcall_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static void dino_call_state_convert_into_group_call_data_free (gpointer _data);
static gboolean dino_call_state_convert_into_group_call_co (DinoCallStateConvertIntoGroupCallData* _data_);
static void dino_call_state_convert_into_group_call_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static gboolean _xmpp_xep_data_forms_data_form_type_equal (const XmppXepDataFormsDataFormType * s1,
                                                    const XmppXepDataFormsDataFormType * s2);
static void dino_call_state_join_group_call_data_free (gpointer _data);
static gboolean dino_call_state_join_group_call_co (DinoCallStateJoinGroupCallData* _data_);
static void dino_call_state_join_group_call_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void __lambda51_ (DinoCallState* self,
                  XmppJid* jid);
static void ___lambda51__xmpp_xep_muji_group_call_peer_joined (XmppXepMujiGroupCall* _sender,
                                                        XmppJid* real_jid,
                                                        gpointer self);
static void __lambda54_ (DinoCallState* self,
                  XmppJid* jid);
static void ___lambda54__xmpp_xep_muji_group_call_peer_left (XmppXepMujiGroupCall* _sender,
                                                      XmppJid* real_jid,
                                                      gpointer self);
static void g_cclosure_user_marshal_VOID__XMPP_JID_STRING_STRING (GClosure * closure,
                                                           GValue * return_value,
                                                           guint n_param_values,
                                                           const GValue * param_values,
                                                           gpointer invocation_hint,
                                                           gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__XMPP_JID_OBJECT (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__XMPP_JID_OBJECT_STRING_STRING (GClosure * closure,
                                                                  GValue * return_value,
                                                                  guint n_param_values,
                                                                  const GValue * param_values,
                                                                  gpointer invocation_hint,
                                                                  gpointer marshal_data);
static void dino_call_state_finalize (GObject * obj);
static GType dino_call_state_get_type_once (void);
static void _vala_dino_call_state_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
static void _vala_dino_call_state_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
dino_call_state_get_instance_private (DinoCallState* self)
{
	return G_STRUCT_MEMBER_P (self, DinoCallState_private_offset);
}

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

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

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

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_)) {
		DinoCallState* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->call);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static gboolean
___lambda50_ (Block2Data* _data2_)
{
	DinoCallState* self;
	DinoEntitiesCallState _tmp0_;
	DinoEntitiesCallState _tmp1_;
	gboolean result;
	self = _data2_->self;
	if (self == NULL) {
		result = FALSE;
		return result;
	}
	_tmp0_ = dino_entities_call_get_state (_data2_->call);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == DINO_ENTITIES_CALL_STATE_ESTABLISHING) {
		DinoEntitiesAccount* _tmp2_;
		DinoEntitiesAccount* _tmp3_;
		XmppJid* _tmp4_;
		XmppJid* _tmp5_;
		XmppJid* _tmp6_;
		dino_entities_call_set_state (_data2_->call, DINO_ENTITIES_CALL_STATE_MISSED);
		_tmp2_ = dino_entities_call_get_account (_data2_->call);
		_tmp3_ = _tmp2_;
		_tmp4_ = dino_entities_account_get_bare_jid (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		g_signal_emit (self, dino_call_state_signals[DINO_CALL_STATE_TERMINATED_SIGNAL], 0, _tmp6_, NULL, NULL);
		_xmpp_jid_unref0 (_tmp6_);
	}
	result = FALSE;
	return result;
}

static gboolean
____lambda50__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda50_ (self);
	return result;
}

DinoCallState*
dino_call_state_construct (GType object_type,
                           DinoEntitiesCall* call,
                           DinoStreamInteractor* stream_interactor)
{
	DinoCallState * self = NULL;
	Block2Data* _data2_;
	DinoEntitiesCall* _tmp0_;
	DinoEntitiesCall* _tmp1_;
	DinoStreamInteractor* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_val_if_fail (call != NULL, NULL);
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (call);
	_g_object_unref0 (_data2_->call);
	_data2_->call = _tmp0_;
	self = (DinoCallState*) g_object_new (object_type, NULL);
	_data2_->self = g_object_ref (self);
	_tmp1_ = _g_object_ref0 (_data2_->call);
	_g_object_unref0 (self->call);
	self->call = _tmp1_;
	_tmp2_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->stream_interactor);
	self->stream_interactor = _tmp2_;
	_tmp4_ = dino_entities_call_get_direction (_data2_->call);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == DINO_ENTITIES_CALL_DIRECTION_OUTGOING) {
		DinoEntitiesCallState _tmp6_;
		DinoEntitiesCallState _tmp7_;
		_tmp6_ = dino_entities_call_get_state (_data2_->call);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ != DINO_ENTITIES_CALL_STATE_OTHER_DEVICE;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		dino_call_state_set_accepted (self, TRUE);
		g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 30, ____lambda50__gsource_func, block2_data_ref (_data2_), block2_data_unref);
	}
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return self;
}

DinoCallState*
dino_call_state_new (DinoEntitiesCall* call,
                     DinoStreamInteractor* stream_interactor)
{
	return dino_call_state_construct (DINO_TYPE_CALL_STATE, call, stream_interactor);
}

static void
dino_call_state_initiate_groupchat_call_data_free (gpointer _data)
{
	DinoCallStateInitiateGroupchatCallData* _data_;
	_data_ = _data;
	_xmpp_jid_unref0 (_data_->muc);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoCallStateInitiateGroupchatCallData, _data_);
}

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

void
dino_call_state_initiate_groupchat_call (DinoCallState* self,
                                         XmppJid* muc,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	DinoCallStateInitiateGroupchatCallData* _data_;
	DinoCallState* _tmp0_;
	XmppJid* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (muc != NULL);
	_data_ = g_slice_new0 (DinoCallStateInitiateGroupchatCallData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_call_state_initiate_groupchat_call_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (muc);
	_xmpp_jid_unref0 (_data_->muc);
	_data_->muc = _tmp1_;
	dino_call_state_initiate_groupchat_call_co (_data_);
}

void
dino_call_state_initiate_groupchat_call_finish (DinoCallState* self,
                                                GAsyncResult* _res_)
{
	DinoCallStateInitiateGroupchatCallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_call_state_initiate_groupchat_call_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	DinoCallStateInitiateGroupchatCallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_call_state_initiate_groupchat_call_co (_data_);
}

static gboolean
dino_call_state_initiate_groupchat_call_co (DinoCallStateInitiateGroupchatCallData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->cim_jids_to_inform;
	gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp0_, _data_->muc);
	dino_call_state_set_cim_message_type (_data_->self, XMPP_MESSAGE_STANZA_TYPE_GROUPCHAT);
	_data_->_tmp1_ = _data_->self->priv->_group_call;
	if (_data_->_tmp1_ == NULL) {
		_data_->_state_ = 1;
		dino_call_state_convert_into_group_call (_data_->self, dino_call_state_initiate_groupchat_call_ready, _data_);
		return FALSE;
		_state_1:
		dino_call_state_convert_into_group_call_finish (_data_->self, _data_->_res_);
	}
	_data_->_tmp2_ = _data_->self->priv->_group_call;
	if (_data_->_tmp2_ == NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->self->call;
	_data_->_tmp4_ = dino_entities_call_get_state (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	if (_data_->_tmp5_ != DINO_ENTITIES_CALL_STATE_RINGING) {
		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_->_tmp6_ = _data_->self->stream_interactor;
	_data_->_tmp7_ = _data_->self->call;
	_data_->_tmp8_ = dino_entities_call_get_account (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = dino_stream_interactor_get_stream (_data_->_tmp6_, _data_->_tmp9_);
	_data_->stream = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->stream;
	if (_data_->_tmp11_ == NULL) {
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp12_ = _data_->self->stream_interactor;
	_data_->_tmp13_ = dino_muc_manager_IDENTITY;
	_data_->_tmp14_ = dino_stream_interactor_get_module (_data_->_tmp12_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp13_);
	_data_->_tmp15_ = (DinoMucManager*) _data_->_tmp14_;
	_data_->_tmp16_ = _data_->self->call;
	_data_->_tmp17_ = dino_entities_call_get_account (_data_->_tmp16_);
	_data_->_tmp18_ = _data_->_tmp17_;
	_data_->_tmp19_ = dino_muc_manager_get_other_occupants (_data_->_tmp15_, _data_->muc, _data_->_tmp18_);
	_data_->_tmp20_ = _data_->_tmp19_;
	_g_object_unref0 (_data_->_tmp15_);
	_data_->occupants = _data_->_tmp20_;
	{
		_data_->_tmp21_ = _data_->occupants;
		_data_->_occupant_list = _data_->_tmp21_;
		_data_->_tmp22_ = _data_->_occupant_list;
		_data_->_tmp23_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp22_);
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_occupant_size = _data_->_tmp24_;
		_data_->_occupant_index = -1;
		while (TRUE) {
			_data_->_occupant_index = _data_->_occupant_index + 1;
			_data_->_tmp25_ = _data_->_occupant_index;
			_data_->_tmp26_ = _data_->_occupant_size;
			if (!(_data_->_tmp25_ < _data_->_tmp26_)) {
				break;
			}
			_data_->_tmp27_ = _data_->_occupant_list;
			_data_->_tmp28_ = gee_list_get (_data_->_tmp27_, _data_->_occupant_index);
			_data_->occupant = (XmppJid*) _data_->_tmp28_;
			_data_->_tmp29_ = _data_->self->stream_interactor;
			_data_->_tmp30_ = dino_muc_manager_IDENTITY;
			_data_->_tmp31_ = dino_stream_interactor_get_module (_data_->_tmp29_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp30_);
			_data_->_tmp32_ = (DinoMucManager*) _data_->_tmp31_;
			_data_->_tmp33_ = _data_->occupant;
			_data_->_tmp34_ = _data_->self->call;
			_data_->_tmp35_ = dino_entities_call_get_account (_data_->_tmp34_);
			_data_->_tmp36_ = _data_->_tmp35_;
			_data_->_tmp37_ = dino_muc_manager_get_real_jid (_data_->_tmp32_, _data_->_tmp33_, _data_->_tmp36_);
			_data_->_tmp38_ = _data_->_tmp37_;
			_g_object_unref0 (_data_->_tmp32_);
			_data_->real_jid = _data_->_tmp38_;
			_data_->_tmp39_ = _data_->real_jid;
			if (_data_->_tmp39_ == NULL) {
				_xmpp_jid_unref0 (_data_->real_jid);
				_xmpp_jid_unref0 (_data_->occupant);
				continue;
			}
			_data_->_tmp40_ = _data_->real_jid;
			_data_->_tmp41_ = xmpp_jid_get_bare_jid (_data_->_tmp40_);
			_data_->_tmp42_ = _data_->_tmp41_;
			_data_->_tmp43_ = _data_->_tmp42_;
			_data_->_tmp44_ = xmpp_jid_to_string (_data_->_tmp43_);
			_data_->_tmp45_ = _data_->_tmp44_;
			g_debug ("call_state.vala:68: Adding MUC member as MUJI MUC owner %s", _data_->_tmp45_);
			_g_free0 (_data_->_tmp45_);
			_xmpp_jid_unref0 (_data_->_tmp43_);
			_data_->_tmp46_ = _data_->stream;
			_data_->_tmp47_ = xmpp_xep_muc_module_IDENTITY;
			_data_->_tmp48_ = xmpp_xmpp_stream_get_module (_data_->_tmp46_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp47_);
			_data_->_tmp49_ = (XmppXepMucModule*) _data_->_tmp48_;
			_data_->_tmp50_ = _data_->stream;
			_data_->_tmp51_ = _data_->self->priv->_group_call;
			_data_->_tmp52_ = _data_->_tmp51_->muc_jid;
			_data_->_tmp53_ = _data_->real_jid;
			_data_->_tmp54_ = xmpp_jid_get_bare_jid (_data_->_tmp53_);
			_data_->_tmp55_ = _data_->_tmp54_;
			_data_->_tmp56_ = _data_->_tmp55_;
			_data_->_state_ = 2;
			xmpp_xep_muc_module_change_affiliation (_data_->_tmp49_, _data_->_tmp50_, _data_->_tmp52_, _data_->_tmp56_, NULL, "owner", dino_call_state_initiate_groupchat_call_ready, _data_);
			return FALSE;
			_state_2:
			xmpp_xep_muc_module_change_affiliation_finish (_data_->_tmp49_, _data_->_res_);
			_xmpp_jid_unref0 (_data_->_tmp56_);
			_g_object_unref0 (_data_->_tmp49_);
			_xmpp_jid_unref0 (_data_->real_jid);
			_xmpp_jid_unref0 (_data_->occupant);
		}
	}
	_data_->_tmp57_ = _data_->stream;
	_data_->_tmp58_ = xmpp_xep_call_invites_module_IDENTITY;
	_data_->_tmp59_ = xmpp_xmpp_stream_get_module (_data_->_tmp57_, XMPP_XEP_CALL_INVITES_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp58_);
	_data_->_tmp60_ = (XmppXepCallInvitesModule*) _data_->_tmp59_;
	_data_->_tmp61_ = _data_->stream;
	_data_->_tmp62_ = _data_->self->cim_call_id;
	_data_->_tmp63_ = _data_->self->priv->_group_call;
	_data_->_tmp64_ = _data_->_tmp63_->muc_jid;
	_data_->_tmp65_ = _data_->self->priv->_we_should_send_video;
	_data_->_tmp66_ = _data_->self->priv->_cim_message_type;
	xmpp_xep_call_invites_module_send_muji_propose (_data_->_tmp60_, _data_->_tmp61_, _data_->_tmp62_, _data_->muc, _data_->_tmp64_, _data_->_tmp65_, _data_->_tmp66_);
	_g_object_unref0 (_data_->_tmp60_);
	_g_object_unref0 (_data_->occupants);
	_g_object_unref0 (_data_->stream);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

DinoPeerState*
dino_call_state_set_first_peer (DinoCallState* self,
                                XmppJid* peer)
{
	DinoPeerState* peer_state = NULL;
	DinoEntitiesCall* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoPeerState* _tmp2_;
	DinoPeerState* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (peer != NULL, NULL);
	_tmp0_ = self->call;
	_tmp1_ = self->stream_interactor;
	_tmp2_ = dino_peer_state_new (peer, _tmp0_, self, _tmp1_);
	peer_state = _tmp2_;
	peer_state->first_peer = TRUE;
	dino_call_state_add_peer (self, peer_state);
	result = peer_state;
	return result;
}

void
dino_call_state_add_peer (DinoCallState* self,
                          DinoPeerState* peer)
{
	DinoEntitiesCall* _tmp0_;
	XmppJid* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (peer != NULL);
	_tmp0_ = self->call;
	_tmp1_ = peer->jid;
	_tmp2_ = xmpp_jid_get_bare_jid (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	dino_entities_call_add_peer (_tmp0_, _tmp4_);
	_xmpp_jid_unref0 (_tmp4_);
	dino_call_state_connect_peer_signals (self, peer);
	_tmp5_ = peer->jid;
	g_signal_emit (self, dino_call_state_signals[DINO_CALL_STATE_PEER_JOINED_SIGNAL], 0, _tmp5_, peer);
}

void
dino_call_state_on_peer_stream_created (DinoCallState* self,
                                        DinoPeerState* peer,
                                        const gchar* media)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (peer != NULL);
	g_return_if_fail (media != NULL);
	if (g_strcmp0 (media, "audio") == 0) {
		DinoPluginsVideoCallPlugin* _tmp0_;
		XmppXepJingleRtpStream* _tmp1_;
		XmppXepJingleRtpStream* _tmp2_;
		DinoPluginsMediaDevice* _tmp3_;
		DinoPluginsMediaDevice* _tmp4_;
		DinoPluginsVideoCallPlugin* _tmp5_;
		XmppXepJingleRtpStream* _tmp6_;
		XmppXepJingleRtpStream* _tmp7_;
		DinoPluginsMediaDevice* _tmp8_;
		DinoPluginsMediaDevice* _tmp9_;
		_tmp0_ = self->call_plugin;
		_tmp1_ = dino_peer_state_get_audio_stream (peer);
		_tmp2_ = _tmp1_;
		_tmp3_ = dino_call_state_get_microphone_device (self);
		_tmp4_ = _tmp3_;
		dino_plugins_video_call_plugin_set_device (_tmp0_, _tmp2_, _tmp4_);
		_g_object_unref0 (_tmp4_);
		_g_object_unref0 (_tmp2_);
		_tmp5_ = self->call_plugin;
		_tmp6_ = dino_peer_state_get_audio_stream (peer);
		_tmp7_ = _tmp6_;
		_tmp8_ = dino_call_state_get_speaker_device (self);
		_tmp9_ = _tmp8_;
		dino_plugins_video_call_plugin_set_device (_tmp5_, _tmp7_, _tmp9_);
		_g_object_unref0 (_tmp9_);
		_g_object_unref0 (_tmp7_);
	} else {
		if (g_strcmp0 (media, "video") == 0) {
			DinoPluginsVideoCallPlugin* _tmp10_;
			XmppXepJingleRtpStream* _tmp11_;
			XmppXepJingleRtpStream* _tmp12_;
			DinoPluginsMediaDevice* _tmp13_;
			DinoPluginsMediaDevice* _tmp14_;
			_tmp10_ = self->call_plugin;
			_tmp11_ = dino_peer_state_get_video_stream (peer);
			_tmp12_ = _tmp11_;
			_tmp13_ = dino_call_state_get_video_device (self);
			_tmp14_ = _tmp13_;
			dino_plugins_video_call_plugin_set_device (_tmp10_, _tmp12_, _tmp14_);
			_g_object_unref0 (_tmp14_);
			_g_object_unref0 (_tmp12_);
		}
	}
}

void
dino_call_state_accept (DinoCallState* self)
{
	DinoEntitiesCall* _tmp0_;
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoEntitiesCall* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	DinoEntitiesAccount* _tmp4_;
	XmppXmppStream* _tmp5_;
	XmppXmppStream* _tmp6_;
	g_return_if_fail (self != NULL);
	dino_call_state_set_accepted (self, TRUE);
	_tmp0_ = self->call;
	dino_entities_call_set_state (_tmp0_, DINO_ENTITIES_CALL_STATE_ESTABLISHING);
	_tmp1_ = self->stream_interactor;
	_tmp2_ = self->call;
	_tmp3_ = dino_entities_call_get_account (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = dino_stream_interactor_get_stream (_tmp1_, _tmp4_);
	stream = _tmp5_;
	_tmp6_ = stream;
	if (_tmp6_ == NULL) {
		_g_object_unref0 (stream);
		return;
	}
	if (self->use_cim) {
		XmppJid* _tmp7_;
		_tmp7_ = self->invited_to_group_call;
		if (_tmp7_ != NULL) {
			XmppJid* _tmp8_;
			_tmp8_ = self->invited_to_group_call;
			dino_call_state_join_group_call (self, _tmp8_, NULL, NULL);
			{
				GeeArrayList* _jid_to_inform_list = NULL;
				GeeArrayList* _tmp9_;
				gint _jid_to_inform_size = 0;
				GeeArrayList* _tmp10_;
				gint _tmp11_;
				gint _tmp12_;
				gint _jid_to_inform_index = 0;
				_tmp9_ = self->cim_jids_to_inform;
				_jid_to_inform_list = _tmp9_;
				_tmp10_ = _jid_to_inform_list;
				_tmp11_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp10_);
				_tmp12_ = _tmp11_;
				_jid_to_inform_size = _tmp12_;
				_jid_to_inform_index = -1;
				while (TRUE) {
					gint _tmp13_;
					gint _tmp14_;
					XmppJid* jid_to_inform = NULL;
					GeeArrayList* _tmp15_;
					gpointer _tmp16_;
					XmppXmppStream* _tmp17_;
					XmppModuleIdentity* _tmp18_;
					gpointer _tmp19_;
					XmppXepCallInvitesModule* _tmp20_;
					XmppXmppStream* _tmp21_;
					XmppJid* _tmp22_;
					const gchar* _tmp23_;
					XmppJid* _tmp24_;
					const gchar* _tmp25_;
					_jid_to_inform_index = _jid_to_inform_index + 1;
					_tmp13_ = _jid_to_inform_index;
					_tmp14_ = _jid_to_inform_size;
					if (!(_tmp13_ < _tmp14_)) {
						break;
					}
					_tmp15_ = _jid_to_inform_list;
					_tmp16_ = gee_abstract_list_get ((GeeAbstractList*) _tmp15_, _jid_to_inform_index);
					jid_to_inform = (XmppJid*) _tmp16_;
					_tmp17_ = stream;
					_tmp18_ = xmpp_xep_call_invites_module_IDENTITY;
					_tmp19_ = xmpp_xmpp_stream_get_module (_tmp17_, XMPP_XEP_CALL_INVITES_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp18_);
					_tmp20_ = (XmppXepCallInvitesModule*) _tmp19_;
					_tmp21_ = stream;
					_tmp22_ = jid_to_inform;
					_tmp23_ = self->cim_call_id;
					_tmp24_ = self->invited_to_group_call;
					_tmp25_ = self->priv->_cim_message_type;
					xmpp_xep_call_invites_module_send_muji_accept (_tmp20_, _tmp21_, _tmp22_, _tmp23_, _tmp24_, _tmp25_);
					_g_object_unref0 (_tmp20_);
					_xmpp_jid_unref0 (jid_to_inform);
				}
			}
		} else {
			GeeHashMap* _tmp26_;
			gint _tmp27_;
			gint _tmp28_;
			_tmp26_ = self->peers;
			_tmp27_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp26_);
			_tmp28_ = _tmp27_;
			if (_tmp28_ == 1) {
				gchar* sid = NULL;
				GeeHashMap* _tmp29_;
				GeeCollection* _tmp30_;
				GeeCollection* _tmp31_;
				GeeCollection* _tmp32_;
				gint _tmp33_ = 0;
				gpointer* _tmp34_;
				DinoPeerState** _tmp35_;
				gint _tmp35__length1;
				DinoPeerState* _tmp36_;
				const gchar* _tmp37_;
				gchar* _tmp38_;
				gchar* _tmp39_;
				_tmp29_ = self->peers;
				_tmp30_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = _tmp31_;
				_tmp34_ = gee_collection_to_array (_tmp32_, &_tmp33_);
				_tmp35_ = _tmp34_;
				_tmp35__length1 = _tmp33_;
				_tmp36_ = _tmp35_[0];
				_tmp37_ = _tmp36_->sid;
				_tmp38_ = g_strdup (_tmp37_);
				_tmp39_ = _tmp38_;
				_tmp35_ = (_vala_array_free (_tmp35_, _tmp35__length1, (GDestroyNotify) g_object_unref), NULL);
				_g_object_unref0 (_tmp32_);
				sid = _tmp39_;
				{
					GeeArrayList* _jid_to_inform_list = NULL;
					GeeArrayList* _tmp40_;
					gint _jid_to_inform_size = 0;
					GeeArrayList* _tmp41_;
					gint _tmp42_;
					gint _tmp43_;
					gint _jid_to_inform_index = 0;
					_tmp40_ = self->cim_jids_to_inform;
					_jid_to_inform_list = _tmp40_;
					_tmp41_ = _jid_to_inform_list;
					_tmp42_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp41_);
					_tmp43_ = _tmp42_;
					_jid_to_inform_size = _tmp43_;
					_jid_to_inform_index = -1;
					while (TRUE) {
						gint _tmp44_;
						gint _tmp45_;
						XmppJid* jid_to_inform = NULL;
						GeeArrayList* _tmp46_;
						gpointer _tmp47_;
						XmppXmppStream* _tmp48_;
						XmppModuleIdentity* _tmp49_;
						gpointer _tmp50_;
						XmppXepCallInvitesModule* _tmp51_;
						XmppXmppStream* _tmp52_;
						XmppJid* _tmp53_;
						const gchar* _tmp54_;
						const gchar* _tmp55_;
						const gchar* _tmp56_;
						_jid_to_inform_index = _jid_to_inform_index + 1;
						_tmp44_ = _jid_to_inform_index;
						_tmp45_ = _jid_to_inform_size;
						if (!(_tmp44_ < _tmp45_)) {
							break;
						}
						_tmp46_ = _jid_to_inform_list;
						_tmp47_ = gee_abstract_list_get ((GeeAbstractList*) _tmp46_, _jid_to_inform_index);
						jid_to_inform = (XmppJid*) _tmp47_;
						_tmp48_ = stream;
						_tmp49_ = xmpp_xep_call_invites_module_IDENTITY;
						_tmp50_ = xmpp_xmpp_stream_get_module (_tmp48_, XMPP_XEP_CALL_INVITES_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp49_);
						_tmp51_ = (XmppXepCallInvitesModule*) _tmp50_;
						_tmp52_ = stream;
						_tmp53_ = jid_to_inform;
						_tmp54_ = self->cim_call_id;
						_tmp55_ = sid;
						_tmp56_ = self->priv->_cim_message_type;
						xmpp_xep_call_invites_module_send_jingle_accept (_tmp51_, _tmp52_, _tmp53_, _tmp54_, _tmp55_, _tmp56_);
						_g_object_unref0 (_tmp51_);
						_xmpp_jid_unref0 (jid_to_inform);
					}
				}
				_g_free0 (sid);
			}
		}
	} else {
		{
			GeeIterator* _peer_it = NULL;
			GeeHashMap* _tmp57_;
			GeeCollection* _tmp58_;
			GeeCollection* _tmp59_;
			GeeCollection* _tmp60_;
			GeeIterator* _tmp61_;
			GeeIterator* _tmp62_;
			_tmp57_ = self->peers;
			_tmp58_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp57_);
			_tmp59_ = _tmp58_;
			_tmp60_ = _tmp59_;
			_tmp61_ = gee_iterable_iterator ((GeeIterable*) _tmp60_);
			_tmp62_ = _tmp61_;
			_g_object_unref0 (_tmp60_);
			_peer_it = _tmp62_;
			while (TRUE) {
				GeeIterator* _tmp63_;
				DinoPeerState* peer = NULL;
				GeeIterator* _tmp64_;
				gpointer _tmp65_;
				DinoPeerState* _tmp66_;
				_tmp63_ = _peer_it;
				if (!gee_iterator_next (_tmp63_)) {
					break;
				}
				_tmp64_ = _peer_it;
				_tmp65_ = gee_iterator_get (_tmp64_);
				peer = (DinoPeerState*) _tmp65_;
				_tmp66_ = peer;
				dino_peer_state_accept (_tmp66_);
				_g_object_unref0 (peer);
			}
			_g_object_unref0 (_peer_it);
		}
	}
	_g_object_unref0 (stream);
}

void
dino_call_state_reject (DinoCallState* self)
{
	DinoEntitiesCall* _tmp0_;
	GeeArrayList* peers_cpy = NULL;
	GeeArrayList* _tmp23_;
	GeeArrayList* _tmp24_;
	GeeHashMap* _tmp25_;
	GeeCollection* _tmp26_;
	GeeCollection* _tmp27_;
	GeeCollection* _tmp28_;
	DinoEntitiesCall* _tmp38_;
	DinoEntitiesAccount* _tmp39_;
	DinoEntitiesAccount* _tmp40_;
	XmppJid* _tmp41_;
	XmppJid* _tmp42_;
	XmppJid* _tmp43_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->call;
	dino_entities_call_set_state (_tmp0_, DINO_ENTITIES_CALL_STATE_DECLINED);
	if (self->use_cim) {
		XmppXmppStream* stream = NULL;
		DinoStreamInteractor* _tmp1_;
		DinoEntitiesCall* _tmp2_;
		DinoEntitiesAccount* _tmp3_;
		DinoEntitiesAccount* _tmp4_;
		XmppXmppStream* _tmp5_;
		XmppXmppStream* _tmp6_;
		_tmp1_ = self->stream_interactor;
		_tmp2_ = self->call;
		_tmp3_ = dino_entities_call_get_account (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = dino_stream_interactor_get_stream (_tmp1_, _tmp4_);
		stream = _tmp5_;
		_tmp6_ = stream;
		if (_tmp6_ == NULL) {
			_g_object_unref0 (stream);
			return;
		}
		{
			GeeArrayList* _jid_to_inform_list = NULL;
			GeeArrayList* _tmp7_;
			gint _jid_to_inform_size = 0;
			GeeArrayList* _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			gint _jid_to_inform_index = 0;
			_tmp7_ = self->cim_jids_to_inform;
			_jid_to_inform_list = _tmp7_;
			_tmp8_ = _jid_to_inform_list;
			_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
			_tmp10_ = _tmp9_;
			_jid_to_inform_size = _tmp10_;
			_jid_to_inform_index = -1;
			while (TRUE) {
				gint _tmp11_;
				gint _tmp12_;
				XmppJid* jid_to_inform = NULL;
				GeeArrayList* _tmp13_;
				gpointer _tmp14_;
				XmppXmppStream* _tmp15_;
				XmppModuleIdentity* _tmp16_;
				gpointer _tmp17_;
				XmppXepCallInvitesModule* _tmp18_;
				XmppXmppStream* _tmp19_;
				XmppJid* _tmp20_;
				const gchar* _tmp21_;
				const gchar* _tmp22_;
				_jid_to_inform_index = _jid_to_inform_index + 1;
				_tmp11_ = _jid_to_inform_index;
				_tmp12_ = _jid_to_inform_size;
				if (!(_tmp11_ < _tmp12_)) {
					break;
				}
				_tmp13_ = _jid_to_inform_list;
				_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _tmp13_, _jid_to_inform_index);
				jid_to_inform = (XmppJid*) _tmp14_;
				_tmp15_ = stream;
				_tmp16_ = xmpp_xep_call_invites_module_IDENTITY;
				_tmp17_ = xmpp_xmpp_stream_get_module (_tmp15_, XMPP_XEP_CALL_INVITES_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp16_);
				_tmp18_ = (XmppXepCallInvitesModule*) _tmp17_;
				_tmp19_ = stream;
				_tmp20_ = jid_to_inform;
				_tmp21_ = self->cim_call_id;
				_tmp22_ = self->priv->_cim_message_type;
				xmpp_xep_call_invites_module_send_reject (_tmp18_, _tmp19_, _tmp20_, _tmp21_, _tmp22_);
				_g_object_unref0 (_tmp18_);
				_xmpp_jid_unref0 (jid_to_inform);
			}
		}
		_g_object_unref0 (stream);
	}
	_tmp23_ = gee_array_list_new (DINO_TYPE_PEER_STATE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	peers_cpy = _tmp23_;
	_tmp24_ = peers_cpy;
	_tmp25_ = self->peers;
	_tmp26_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = _tmp27_;
	gee_array_list_add_all (_tmp24_, _tmp28_);
	_g_object_unref0 (_tmp28_);
	{
		GeeArrayList* _peer_list = NULL;
		GeeArrayList* _tmp29_;
		gint _peer_size = 0;
		GeeArrayList* _tmp30_;
		gint _tmp31_;
		gint _tmp32_;
		gint _peer_index = 0;
		_tmp29_ = peers_cpy;
		_peer_list = _tmp29_;
		_tmp30_ = _peer_list;
		_tmp31_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp30_);
		_tmp32_ = _tmp31_;
		_peer_size = _tmp32_;
		_peer_index = -1;
		while (TRUE) {
			gint _tmp33_;
			gint _tmp34_;
			DinoPeerState* peer = NULL;
			GeeArrayList* _tmp35_;
			gpointer _tmp36_;
			DinoPeerState* _tmp37_;
			_peer_index = _peer_index + 1;
			_tmp33_ = _peer_index;
			_tmp34_ = _peer_size;
			if (!(_tmp33_ < _tmp34_)) {
				break;
			}
			_tmp35_ = _peer_list;
			_tmp36_ = gee_abstract_list_get ((GeeAbstractList*) _tmp35_, _peer_index);
			peer = (DinoPeerState*) _tmp36_;
			_tmp37_ = peer;
			dino_peer_state_reject (_tmp37_);
			_g_object_unref0 (peer);
		}
	}
	_tmp38_ = self->call;
	_tmp39_ = dino_entities_call_get_account (_tmp38_);
	_tmp40_ = _tmp39_;
	_tmp41_ = dino_entities_account_get_bare_jid (_tmp40_);
	_tmp42_ = _tmp41_;
	_tmp43_ = _tmp42_;
	g_signal_emit (self, dino_call_state_signals[DINO_CALL_STATE_TERMINATED_SIGNAL], 0, _tmp43_, NULL, NULL);
	_xmpp_jid_unref0 (_tmp43_);
	_g_object_unref0 (peers_cpy);
}

void
dino_call_state_end (DinoCallState* self,
                     const gchar* reason_text)
{
	GeeArrayList* peers_cpy = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeCollection* _tmp3_;
	GeeCollection* _tmp4_;
	GeeCollection* _tmp5_;
	XmppXmppStream* stream = NULL;
	DinoStreamInteractor* _tmp6_;
	DinoEntitiesCall* _tmp7_;
	DinoEntitiesAccount* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	XmppXmppStream* _tmp10_;
	XmppXmppStream* _tmp11_;
	gboolean _tmp84_ = FALSE;
	DinoEntitiesCall* _tmp85_;
	DinoEntitiesCallState _tmp86_;
	DinoEntitiesCallState _tmp87_;
	DinoEntitiesCall* _tmp96_;
	GDateTime* _tmp97_;
	GDateTime* _tmp98_;
	DinoEntitiesCall* _tmp99_;
	DinoEntitiesAccount* _tmp100_;
	DinoEntitiesAccount* _tmp101_;
	XmppJid* _tmp102_;
	XmppJid* _tmp103_;
	XmppJid* _tmp104_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_array_list_new (DINO_TYPE_PEER_STATE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	peers_cpy = _tmp0_;
	_tmp1_ = peers_cpy;
	_tmp2_ = self->peers;
	_tmp3_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	gee_array_list_add_all (_tmp1_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = self->stream_interactor;
	_tmp7_ = self->call;
	_tmp8_ = dino_entities_call_get_account (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = dino_stream_interactor_get_stream (_tmp6_, _tmp9_);
	stream = _tmp10_;
	_tmp11_ = stream;
	if (_tmp11_ != NULL) {
		XmppXepMujiGroupCall* _tmp12_;
		gboolean _tmp20_ = FALSE;
		DinoEntitiesCall* _tmp21_;
		DinoEntitiesCallState _tmp22_;
		DinoEntitiesCallState _tmp23_;
		_tmp12_ = self->priv->_group_call;
		if (_tmp12_ != NULL) {
			XmppXmppStream* _tmp13_;
			XmppModuleIdentity* _tmp14_;
			gpointer _tmp15_;
			XmppXepMucModule* _tmp16_;
			XmppXmppStream* _tmp17_;
			XmppXepMujiGroupCall* _tmp18_;
			XmppJid* _tmp19_;
			_tmp13_ = stream;
			_tmp14_ = xmpp_xep_muc_module_IDENTITY;
			_tmp15_ = xmpp_xmpp_stream_get_module (_tmp13_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp14_);
			_tmp16_ = (XmppXepMucModule*) _tmp15_;
			_tmp17_ = stream;
			_tmp18_ = self->priv->_group_call;
			_tmp19_ = _tmp18_->muc_jid;
			xmpp_xep_muc_module_exit (_tmp16_, _tmp17_, _tmp19_);
			_g_object_unref0 (_tmp16_);
		}
		_tmp21_ = self->call;
		_tmp22_ = dino_entities_call_get_state (_tmp21_);
		_tmp23_ = _tmp22_;
		if (_tmp23_ == DINO_ENTITIES_CALL_STATE_IN_PROGRESS) {
			_tmp20_ = TRUE;
		} else {
			DinoEntitiesCall* _tmp24_;
			DinoEntitiesCallState _tmp25_;
			DinoEntitiesCallState _tmp26_;
			_tmp24_ = self->call;
			_tmp25_ = dino_entities_call_get_state (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp20_ = _tmp26_ == DINO_ENTITIES_CALL_STATE_ESTABLISHING;
		}
		if (_tmp20_) {
			{
				GeeArrayList* _peer_list = NULL;
				GeeArrayList* _tmp27_;
				gint _peer_size = 0;
				GeeArrayList* _tmp28_;
				gint _tmp29_;
				gint _tmp30_;
				gint _peer_index = 0;
				_tmp27_ = peers_cpy;
				_peer_list = _tmp27_;
				_tmp28_ = _peer_list;
				_tmp29_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp28_);
				_tmp30_ = _tmp29_;
				_peer_size = _tmp30_;
				_peer_index = -1;
				while (TRUE) {
					gint _tmp31_;
					gint _tmp32_;
					DinoPeerState* peer = NULL;
					GeeArrayList* _tmp33_;
					gpointer _tmp34_;
					DinoPeerState* _tmp35_;
					_peer_index = _peer_index + 1;
					_tmp31_ = _peer_index;
					_tmp32_ = _peer_size;
					if (!(_tmp31_ < _tmp32_)) {
						break;
					}
					_tmp33_ = _peer_list;
					_tmp34_ = gee_abstract_list_get ((GeeAbstractList*) _tmp33_, _peer_index);
					peer = (DinoPeerState*) _tmp34_;
					_tmp35_ = peer;
					dino_peer_state_end (_tmp35_, XMPP_XEP_JINGLE_REASON_ELEMENT_SUCCESS, reason_text);
					_g_object_unref0 (peer);
				}
			}
			if (self->use_cim) {
				{
					GeeArrayList* _jid_to_inform_list = NULL;
					GeeArrayList* _tmp36_;
					gint _jid_to_inform_size = 0;
					GeeArrayList* _tmp37_;
					gint _tmp38_;
					gint _tmp39_;
					gint _jid_to_inform_index = 0;
					_tmp36_ = self->cim_jids_to_inform;
					_jid_to_inform_list = _tmp36_;
					_tmp37_ = _jid_to_inform_list;
					_tmp38_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp37_);
					_tmp39_ = _tmp38_;
					_jid_to_inform_size = _tmp39_;
					_jid_to_inform_index = -1;
					while (TRUE) {
						gint _tmp40_;
						gint _tmp41_;
						XmppJid* jid_to_inform = NULL;
						GeeArrayList* _tmp42_;
						gpointer _tmp43_;
						XmppXmppStream* _tmp44_;
						XmppModuleIdentity* _tmp45_;
						gpointer _tmp46_;
						XmppXepCallInvitesModule* _tmp47_;
						XmppXmppStream* _tmp48_;
						XmppJid* _tmp49_;
						const gchar* _tmp50_;
						const gchar* _tmp51_;
						_jid_to_inform_index = _jid_to_inform_index + 1;
						_tmp40_ = _jid_to_inform_index;
						_tmp41_ = _jid_to_inform_size;
						if (!(_tmp40_ < _tmp41_)) {
							break;
						}
						_tmp42_ = _jid_to_inform_list;
						_tmp43_ = gee_abstract_list_get ((GeeAbstractList*) _tmp42_, _jid_to_inform_index);
						jid_to_inform = (XmppJid*) _tmp43_;
						_tmp44_ = stream;
						_tmp45_ = xmpp_xep_call_invites_module_IDENTITY;
						_tmp46_ = xmpp_xmpp_stream_get_module (_tmp44_, XMPP_XEP_CALL_INVITES_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp45_);
						_tmp47_ = (XmppXepCallInvitesModule*) _tmp46_;
						_tmp48_ = stream;
						_tmp49_ = jid_to_inform;
						_tmp50_ = self->cim_call_id;
						_tmp51_ = self->priv->_cim_message_type;
						xmpp_xep_call_invites_module_send_left (_tmp47_, _tmp48_, _tmp49_, _tmp50_, _tmp51_);
						_g_object_unref0 (_tmp47_);
						_xmpp_jid_unref0 (jid_to_inform);
					}
				}
			}
		} else {
			DinoEntitiesCall* _tmp52_;
			DinoEntitiesCallState _tmp53_;
			DinoEntitiesCallState _tmp54_;
			_tmp52_ = self->call;
			_tmp53_ = dino_entities_call_get_state (_tmp52_);
			_tmp54_ = _tmp53_;
			if (_tmp54_ == DINO_ENTITIES_CALL_STATE_RINGING) {
				gboolean _tmp64_ = FALSE;
				DinoEntitiesCall* _tmp65_;
				gboolean _tmp66_;
				gboolean _tmp67_;
				{
					GeeArrayList* _peer_list = NULL;
					GeeArrayList* _tmp55_;
					gint _peer_size = 0;
					GeeArrayList* _tmp56_;
					gint _tmp57_;
					gint _tmp58_;
					gint _peer_index = 0;
					_tmp55_ = peers_cpy;
					_peer_list = _tmp55_;
					_tmp56_ = _peer_list;
					_tmp57_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp56_);
					_tmp58_ = _tmp57_;
					_peer_size = _tmp58_;
					_peer_index = -1;
					while (TRUE) {
						gint _tmp59_;
						gint _tmp60_;
						DinoPeerState* peer = NULL;
						GeeArrayList* _tmp61_;
						gpointer _tmp62_;
						DinoPeerState* _tmp63_;
						_peer_index = _peer_index + 1;
						_tmp59_ = _peer_index;
						_tmp60_ = _peer_size;
						if (!(_tmp59_ < _tmp60_)) {
							break;
						}
						_tmp61_ = _peer_list;
						_tmp62_ = gee_abstract_list_get ((GeeAbstractList*) _tmp61_, _peer_index);
						peer = (DinoPeerState*) _tmp62_;
						_tmp63_ = peer;
						dino_peer_state_end (_tmp63_, XMPP_XEP_JINGLE_REASON_ELEMENT_CANCEL, reason_text);
						_g_object_unref0 (peer);
					}
				}
				_tmp65_ = self->call;
				_tmp66_ = dino_entities_call_get_direction (_tmp65_);
				_tmp67_ = _tmp66_;
				if (_tmp67_ == DINO_ENTITIES_CALL_DIRECTION_OUTGOING) {
					_tmp64_ = self->use_cim;
				} else {
					_tmp64_ = FALSE;
				}
				if (_tmp64_) {
					{
						GeeArrayList* _jid_to_inform_list = NULL;
						GeeArrayList* _tmp68_;
						gint _jid_to_inform_size = 0;
						GeeArrayList* _tmp69_;
						gint _tmp70_;
						gint _tmp71_;
						gint _jid_to_inform_index = 0;
						_tmp68_ = self->cim_jids_to_inform;
						_jid_to_inform_list = _tmp68_;
						_tmp69_ = _jid_to_inform_list;
						_tmp70_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp69_);
						_tmp71_ = _tmp70_;
						_jid_to_inform_size = _tmp71_;
						_jid_to_inform_index = -1;
						while (TRUE) {
							gint _tmp72_;
							gint _tmp73_;
							XmppJid* jid_to_inform = NULL;
							GeeArrayList* _tmp74_;
							gpointer _tmp75_;
							XmppXmppStream* _tmp76_;
							XmppModuleIdentity* _tmp77_;
							gpointer _tmp78_;
							XmppXepCallInvitesModule* _tmp79_;
							XmppXmppStream* _tmp80_;
							XmppJid* _tmp81_;
							const gchar* _tmp82_;
							const gchar* _tmp83_;
							_jid_to_inform_index = _jid_to_inform_index + 1;
							_tmp72_ = _jid_to_inform_index;
							_tmp73_ = _jid_to_inform_size;
							if (!(_tmp72_ < _tmp73_)) {
								break;
							}
							_tmp74_ = _jid_to_inform_list;
							_tmp75_ = gee_abstract_list_get ((GeeAbstractList*) _tmp74_, _jid_to_inform_index);
							jid_to_inform = (XmppJid*) _tmp75_;
							_tmp76_ = stream;
							_tmp77_ = xmpp_xep_call_invites_module_IDENTITY;
							_tmp78_ = xmpp_xmpp_stream_get_module (_tmp76_, XMPP_XEP_CALL_INVITES_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp77_);
							_tmp79_ = (XmppXepCallInvitesModule*) _tmp78_;
							_tmp80_ = stream;
							_tmp81_ = jid_to_inform;
							_tmp82_ = self->cim_call_id;
							_tmp83_ = self->priv->_cim_message_type;
							xmpp_xep_call_invites_module_send_retract (_tmp79_, _tmp80_, _tmp81_, _tmp82_, _tmp83_);
							_g_object_unref0 (_tmp79_);
							_xmpp_jid_unref0 (jid_to_inform);
						}
					}
				}
			}
		}
	}
	_tmp85_ = self->call;
	_tmp86_ = dino_entities_call_get_state (_tmp85_);
	_tmp87_ = _tmp86_;
	if (_tmp87_ == DINO_ENTITIES_CALL_STATE_IN_PROGRESS) {
		_tmp84_ = TRUE;
	} else {
		DinoEntitiesCall* _tmp88_;
		DinoEntitiesCallState _tmp89_;
		DinoEntitiesCallState _tmp90_;
		_tmp88_ = self->call;
		_tmp89_ = dino_entities_call_get_state (_tmp88_);
		_tmp90_ = _tmp89_;
		_tmp84_ = _tmp90_ == DINO_ENTITIES_CALL_STATE_ESTABLISHING;
	}
	if (_tmp84_) {
		DinoEntitiesCall* _tmp91_;
		_tmp91_ = self->call;
		dino_entities_call_set_state (_tmp91_, DINO_ENTITIES_CALL_STATE_ENDED);
	} else {
		DinoEntitiesCall* _tmp92_;
		DinoEntitiesCallState _tmp93_;
		DinoEntitiesCallState _tmp94_;
		_tmp92_ = self->call;
		_tmp93_ = dino_entities_call_get_state (_tmp92_);
		_tmp94_ = _tmp93_;
		if (_tmp94_ == DINO_ENTITIES_CALL_STATE_RINGING) {
			DinoEntitiesCall* _tmp95_;
			_tmp95_ = self->call;
			dino_entities_call_set_state (_tmp95_, DINO_ENTITIES_CALL_STATE_MISSED);
		} else {
			_g_object_unref0 (stream);
			_g_object_unref0 (peers_cpy);
			return;
		}
	}
	_tmp96_ = self->call;
	_tmp97_ = g_date_time_new_now_utc ();
	_tmp98_ = _tmp97_;
	dino_entities_call_set_end_time (_tmp96_, _tmp98_);
	_g_date_time_unref0 (_tmp98_);
	_tmp99_ = self->call;
	_tmp100_ = dino_entities_call_get_account (_tmp99_);
	_tmp101_ = _tmp100_;
	_tmp102_ = dino_entities_account_get_bare_jid (_tmp101_);
	_tmp103_ = _tmp102_;
	_tmp104_ = _tmp103_;
	g_signal_emit (self, dino_call_state_signals[DINO_CALL_STATE_TERMINATED_SIGNAL], 0, _tmp104_, NULL, reason_text);
	_xmpp_jid_unref0 (_tmp104_);
	_g_object_unref0 (stream);
	_g_object_unref0 (peers_cpy);
}

void
dino_call_state_mute_own_audio (DinoCallState* self,
                                gboolean mute)
{
	g_return_if_fail (self != NULL);
	dino_call_state_set_we_should_send_audio (self, !mute);
	{
		GeeIterator* _peer_it = NULL;
		GeeHashMap* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->peers;
		_tmp1_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_peer_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			DinoPeerState* peer = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			DinoPeerState* _tmp9_;
			_tmp6_ = _peer_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _peer_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			peer = (DinoPeerState*) _tmp8_;
			_tmp9_ = peer;
			dino_peer_state_mute_own_audio (_tmp9_, mute);
			_g_object_unref0 (peer);
		}
		_g_object_unref0 (_peer_it);
	}
}

void
dino_call_state_mute_own_video (DinoCallState* self,
                                gboolean mute)
{
	g_return_if_fail (self != NULL);
	dino_call_state_set_we_should_send_video (self, !mute);
	{
		GeeIterator* _peer_it = NULL;
		GeeHashMap* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->peers;
		_tmp1_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_peer_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			DinoPeerState* peer = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			DinoPeerState* _tmp9_;
			_tmp6_ = _peer_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _peer_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			peer = (DinoPeerState*) _tmp8_;
			_tmp9_ = peer;
			dino_peer_state_mute_own_video (_tmp9_, mute);
			_g_object_unref0 (peer);
		}
		_g_object_unref0 (_peer_it);
	}
}

gboolean
dino_call_state_should_we_send_video (DinoCallState* self)
{
	gboolean _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_we_should_send_video;
	result = _tmp0_;
	return result;
}

static void
dino_call_state_invite_to_call_data_free (gpointer _data)
{
	DinoCallStateInviteToCallData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoCallStateInviteToCallData, _data_);
}

void
dino_call_state_invite_to_call (DinoCallState* self,
                                XmppJid* invitee,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DinoCallStateInviteToCallData* _data_;
	DinoCallState* _tmp0_;
	XmppJid* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (invitee != NULL);
	_data_ = g_slice_new0 (DinoCallStateInviteToCallData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_call_state_invite_to_call_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (invitee);
	_xmpp_jid_unref0 (_data_->invitee);
	_data_->invitee = _tmp1_;
	dino_call_state_invite_to_call_co (_data_);
}

void
dino_call_state_invite_to_call_finish (DinoCallState* self,
                                       GAsyncResult* _res_)
{
	DinoCallStateInviteToCallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		DinoCallState* self;
		self = _data3_->self;
		_xmpp_jid_unref0 (_data3_->invitee);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static void
dino_call_state_invite_to_call_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DinoCallStateInviteToCallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_call_state_invite_to_call_co (_data_);
}

static gboolean
__lambda64_ (Block3Data* _data3_)
{
	DinoCallState* self;
	gboolean contains_peer = FALSE;
	gboolean result;
	self = _data3_->self;
	if (self == NULL) {
		result = FALSE;
		return result;
	}
	contains_peer = FALSE;
	{
		GeeIterator* _peer_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->peers;
		_tmp1_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_peer_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			XmppJid* peer = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			XmppJid* _tmp9_;
			_tmp6_ = _peer_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _peer_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			peer = (XmppJid*) _tmp8_;
			_tmp9_ = peer;
			if (xmpp_jid_equals_bare (_tmp9_, _data3_->invitee)) {
				contains_peer = TRUE;
			}
			_xmpp_jid_unref0 (peer);
		}
		_g_object_unref0 (_peer_it);
	}
	if (!contains_peer) {
		DinoEntitiesCall* _tmp10_;
		DinoEntitiesAccount* _tmp11_;
		DinoEntitiesAccount* _tmp12_;
		XmppJid* _tmp13_;
		XmppJid* _tmp14_;
		XmppJid* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		XmppXepMujiGroupCall* _tmp18_;
		XmppJid* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		_tmp10_ = self->call;
		_tmp11_ = dino_entities_call_get_account (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = dino_entities_account_get_bare_jid (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = _tmp14_;
		_tmp16_ = xmpp_jid_to_string (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = self->priv->_group_call;
		_tmp19_ = _tmp18_->muc_jid;
		_tmp20_ = xmpp_jid_to_string (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = xmpp_jid_to_string (_data3_->invitee);
		_tmp23_ = _tmp22_;
		g_debug ("call_state.vala:231: [%s] Retracting invite to %s from %s", _tmp17_, _tmp21_, _tmp23_);
		_g_free0 (_tmp23_);
		_g_free0 (_tmp21_);
		_g_free0 (_tmp17_);
		_xmpp_jid_unref0 (_tmp15_);
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda64__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda64_ (self);
	return result;
}

static gboolean
dino_call_state_invite_to_call_co (DinoCallStateInviteToCallData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data3_ = g_slice_new0 (Block3Data);
	_data_->_data3_->_ref_count_ = 1;
	_data_->_data3_->self = g_object_ref (_data_->self);
	_xmpp_jid_unref0 (_data_->_data3_->invitee);
	_data_->_data3_->invitee = _data_->invitee;
	_data_->_data3_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->_group_call;
	if (_data_->_tmp0_ == NULL) {
		_data_->_state_ = 1;
		dino_call_state_convert_into_group_call (_data_->self, dino_call_state_invite_to_call_ready, _data_);
		return FALSE;
		_state_1:
		dino_call_state_convert_into_group_call_finish (_data_->self, _data_->_res_);
	}
	_data_->_tmp1_ = _data_->self->priv->_group_call;
	if (_data_->_tmp1_ == NULL) {
		block3_data_unref (_data_->_data3_);
		_data_->_data3_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _data_->self->stream_interactor;
	_data_->_tmp3_ = _data_->self->call;
	_data_->_tmp4_ = dino_entities_call_get_account (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dino_stream_interactor_get_stream (_data_->_tmp2_, _data_->_tmp5_);
	_data_->stream = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->stream;
	if (_data_->_tmp7_ == NULL) {
		_g_object_unref0 (_data_->stream);
		block3_data_unref (_data_->_data3_);
		_data_->_data3_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = _data_->self->call;
	_data_->_tmp9_ = dino_entities_call_get_account (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = dino_entities_account_get_bare_jid (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = xmpp_jid_to_string (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = xmpp_jid_to_string (_data_->_data3_->invitee);
	_data_->_tmp17_ = _data_->_tmp16_;
	g_debug ("call_state.vala:214: [%s] Inviting to muji call %s", _data_->_tmp15_, _data_->_tmp17_);
	_g_free0 (_data_->_tmp17_);
	_g_free0 (_data_->_tmp15_);
	_xmpp_jid_unref0 (_data_->_tmp13_);
	_data_->_tmp18_ = _data_->stream;
	_data_->_tmp19_ = xmpp_xep_muc_module_IDENTITY;
	_data_->_tmp20_ = xmpp_xmpp_stream_get_module (_data_->_tmp18_, XMPP_XEP_MUC_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp19_);
	_data_->_tmp21_ = (XmppXepMucModule*) _data_->_tmp20_;
	_data_->_tmp22_ = _data_->stream;
	_data_->_tmp23_ = _data_->self->priv->_group_call;
	_data_->_tmp24_ = _data_->_tmp23_->muc_jid;
	_data_->_state_ = 2;
	xmpp_xep_muc_module_change_affiliation (_data_->_tmp21_, _data_->_tmp22_, _data_->_tmp24_, _data_->_data3_->invitee, NULL, "owner", dino_call_state_invite_to_call_ready, _data_);
	return FALSE;
	_state_2:
	xmpp_xep_muc_module_change_affiliation_finish (_data_->_tmp21_, _data_->_res_);
	_g_object_unref0 (_data_->_tmp21_);
	_data_->_tmp25_ = _data_->stream;
	_data_->_tmp26_ = xmpp_xep_call_invites_module_IDENTITY;
	_data_->_tmp27_ = xmpp_xmpp_stream_get_module (_data_->_tmp25_, XMPP_XEP_CALL_INVITES_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp26_);
	_data_->_tmp28_ = (XmppXepCallInvitesModule*) _data_->_tmp27_;
	_data_->_tmp29_ = _data_->stream;
	_data_->_tmp30_ = _data_->self->cim_call_id;
	_data_->_tmp31_ = _data_->self->priv->_group_call;
	_data_->_tmp32_ = _data_->_tmp31_->muc_jid;
	_data_->_tmp33_ = _data_->self->priv->_we_should_send_video;
	xmpp_xep_call_invites_module_send_muji_propose (_data_->_tmp28_, _data_->_tmp29_, _data_->_tmp30_, _data_->_data3_->invitee, _data_->_tmp32_, _data_->_tmp33_, "chat");
	_g_object_unref0 (_data_->_tmp28_);
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 60, ___lambda64__gsource_func, block3_data_ref (_data_->_data3_), block3_data_unref);
	_g_object_unref0 (_data_->stream);
	block3_data_unref (_data_->_data3_);
	_data_->_data3_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

DinoPluginsMediaDevice*
dino_call_state_get_microphone_device (DinoCallState* self)
{
	DinoPluginsMediaDevice* _tmp0_;
	DinoPluginsMediaDevice* _tmp20_;
	DinoPluginsMediaDevice* _tmp21_;
	DinoPluginsMediaDevice* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->selected_microphone_device;
	if (_tmp0_ == NULL) {
		GeeHashMap* _tmp1_;
		gboolean _tmp2_;
		gboolean _tmp3_;
		DinoPluginsMediaDevice* _tmp17_;
		_tmp1_ = self->peers;
		_tmp2_ = gee_map_get_is_empty ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		if (!_tmp3_) {
			XmppXepJingleRtpStream* audio_stream = NULL;
			GeeHashMap* _tmp4_;
			GeeCollection* _tmp5_;
			GeeCollection* _tmp6_;
			GeeCollection* _tmp7_;
			gint _tmp8_ = 0;
			gpointer* _tmp9_;
			DinoPeerState** _tmp10_;
			gint _tmp10__length1;
			DinoPeerState* _tmp11_;
			XmppXepJingleRtpStream* _tmp12_;
			XmppXepJingleRtpStream* _tmp13_;
			DinoPluginsVideoCallPlugin* _tmp14_;
			XmppXepJingleRtpStream* _tmp15_;
			DinoPluginsMediaDevice* _tmp16_;
			_tmp4_ = self->peers;
			_tmp5_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = _tmp6_;
			_tmp9_ = gee_collection_to_array (_tmp7_, &_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp10__length1 = _tmp8_;
			_tmp11_ = _tmp10_[0];
			_tmp12_ = dino_peer_state_get_audio_stream (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_object_unref), NULL);
			_g_object_unref0 (_tmp7_);
			audio_stream = _tmp13_;
			_tmp14_ = self->call_plugin;
			_tmp15_ = audio_stream;
			_tmp16_ = dino_plugins_video_call_plugin_get_device (_tmp14_, _tmp15_, FALSE);
			_g_object_unref0 (self->priv->selected_microphone_device);
			self->priv->selected_microphone_device = _tmp16_;
			_g_object_unref0 (audio_stream);
		}
		_tmp17_ = self->priv->selected_microphone_device;
		if (_tmp17_ == NULL) {
			DinoPluginsVideoCallPlugin* _tmp18_;
			DinoPluginsMediaDevice* _tmp19_;
			_tmp18_ = self->call_plugin;
			_tmp19_ = dino_plugins_video_call_plugin_get_preferred_device (_tmp18_, "audio", FALSE);
			_g_object_unref0 (self->priv->selected_microphone_device);
			self->priv->selected_microphone_device = _tmp19_;
		}
	}
	_tmp20_ = self->priv->selected_microphone_device;
	_tmp21_ = _g_object_ref0 (_tmp20_);
	result = _tmp21_;
	return result;
}

DinoPluginsMediaDevice*
dino_call_state_get_speaker_device (DinoCallState* self)
{
	DinoPluginsMediaDevice* _tmp0_;
	DinoPluginsMediaDevice* _tmp20_;
	DinoPluginsMediaDevice* _tmp21_;
	DinoPluginsMediaDevice* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->selected_speaker_device;
	if (_tmp0_ == NULL) {
		GeeHashMap* _tmp1_;
		gboolean _tmp2_;
		gboolean _tmp3_;
		DinoPluginsMediaDevice* _tmp17_;
		_tmp1_ = self->peers;
		_tmp2_ = gee_map_get_is_empty ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		if (!_tmp3_) {
			XmppXepJingleRtpStream* audio_stream = NULL;
			GeeHashMap* _tmp4_;
			GeeCollection* _tmp5_;
			GeeCollection* _tmp6_;
			GeeCollection* _tmp7_;
			gint _tmp8_ = 0;
			gpointer* _tmp9_;
			DinoPeerState** _tmp10_;
			gint _tmp10__length1;
			DinoPeerState* _tmp11_;
			XmppXepJingleRtpStream* _tmp12_;
			XmppXepJingleRtpStream* _tmp13_;
			DinoPluginsVideoCallPlugin* _tmp14_;
			XmppXepJingleRtpStream* _tmp15_;
			DinoPluginsMediaDevice* _tmp16_;
			_tmp4_ = self->peers;
			_tmp5_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = _tmp6_;
			_tmp9_ = gee_collection_to_array (_tmp7_, &_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp10__length1 = _tmp8_;
			_tmp11_ = _tmp10_[0];
			_tmp12_ = dino_peer_state_get_audio_stream (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_object_unref), NULL);
			_g_object_unref0 (_tmp7_);
			audio_stream = _tmp13_;
			_tmp14_ = self->call_plugin;
			_tmp15_ = audio_stream;
			_tmp16_ = dino_plugins_video_call_plugin_get_device (_tmp14_, _tmp15_, TRUE);
			_g_object_unref0 (self->priv->selected_speaker_device);
			self->priv->selected_speaker_device = _tmp16_;
			_g_object_unref0 (audio_stream);
		}
		_tmp17_ = self->priv->selected_speaker_device;
		if (_tmp17_ == NULL) {
			DinoPluginsVideoCallPlugin* _tmp18_;
			DinoPluginsMediaDevice* _tmp19_;
			_tmp18_ = self->call_plugin;
			_tmp19_ = dino_plugins_video_call_plugin_get_preferred_device (_tmp18_, "audio", TRUE);
			_g_object_unref0 (self->priv->selected_speaker_device);
			self->priv->selected_speaker_device = _tmp19_;
		}
	}
	_tmp20_ = self->priv->selected_speaker_device;
	_tmp21_ = _g_object_ref0 (_tmp20_);
	result = _tmp21_;
	return result;
}

DinoPluginsMediaDevice*
dino_call_state_get_video_device (DinoCallState* self)
{
	DinoPluginsMediaDevice* _tmp0_;
	DinoPluginsMediaDevice* _tmp20_;
	DinoPluginsMediaDevice* _tmp21_;
	DinoPluginsMediaDevice* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->selected_video_device;
	if (_tmp0_ == NULL) {
		GeeHashMap* _tmp1_;
		gboolean _tmp2_;
		gboolean _tmp3_;
		DinoPluginsMediaDevice* _tmp17_;
		_tmp1_ = self->peers;
		_tmp2_ = gee_map_get_is_empty ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		if (!_tmp3_) {
			XmppXepJingleRtpStream* video_stream = NULL;
			GeeHashMap* _tmp4_;
			GeeCollection* _tmp5_;
			GeeCollection* _tmp6_;
			GeeCollection* _tmp7_;
			gint _tmp8_ = 0;
			gpointer* _tmp9_;
			DinoPeerState** _tmp10_;
			gint _tmp10__length1;
			DinoPeerState* _tmp11_;
			XmppXepJingleRtpStream* _tmp12_;
			XmppXepJingleRtpStream* _tmp13_;
			DinoPluginsVideoCallPlugin* _tmp14_;
			XmppXepJingleRtpStream* _tmp15_;
			DinoPluginsMediaDevice* _tmp16_;
			_tmp4_ = self->peers;
			_tmp5_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = _tmp6_;
			_tmp9_ = gee_collection_to_array (_tmp7_, &_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp10__length1 = _tmp8_;
			_tmp11_ = _tmp10_[0];
			_tmp12_ = dino_peer_state_get_video_stream (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_object_unref), NULL);
			_g_object_unref0 (_tmp7_);
			video_stream = _tmp13_;
			_tmp14_ = self->call_plugin;
			_tmp15_ = video_stream;
			_tmp16_ = dino_plugins_video_call_plugin_get_device (_tmp14_, _tmp15_, FALSE);
			_g_object_unref0 (self->priv->selected_video_device);
			self->priv->selected_video_device = _tmp16_;
			_g_object_unref0 (video_stream);
		}
		_tmp17_ = self->priv->selected_video_device;
		if (_tmp17_ == NULL) {
			DinoPluginsVideoCallPlugin* _tmp18_;
			DinoPluginsMediaDevice* _tmp19_;
			_tmp18_ = self->call_plugin;
			_tmp19_ = dino_plugins_video_call_plugin_get_preferred_device (_tmp18_, "video", FALSE);
			_g_object_unref0 (self->priv->selected_video_device);
			self->priv->selected_video_device = _tmp19_;
		}
	}
	_tmp20_ = self->priv->selected_video_device;
	_tmp21_ = _g_object_ref0 (_tmp20_);
	result = _tmp21_;
	return result;
}

void
dino_call_state_set_audio_device (DinoCallState* self,
                                  DinoPluginsMediaDevice* device)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dino_plugins_media_device_get_incoming (device);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		DinoPluginsMediaDevice* _tmp2_;
		_tmp2_ = _g_object_ref0 (device);
		_g_object_unref0 (self->priv->selected_speaker_device);
		self->priv->selected_speaker_device = _tmp2_;
	} else {
		DinoPluginsMediaDevice* _tmp3_;
		_tmp3_ = _g_object_ref0 (device);
		_g_object_unref0 (self->priv->selected_microphone_device);
		self->priv->selected_microphone_device = _tmp3_;
	}
	{
		GeeIterator* _peer_state_it = NULL;
		GeeHashMap* _tmp4_;
		GeeCollection* _tmp5_;
		GeeCollection* _tmp6_;
		GeeCollection* _tmp7_;
		GeeIterator* _tmp8_;
		GeeIterator* _tmp9_;
		_tmp4_ = self->peers;
		_tmp5_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp8_ = gee_iterable_iterator ((GeeIterable*) _tmp7_);
		_tmp9_ = _tmp8_;
		_g_object_unref0 (_tmp7_);
		_peer_state_it = _tmp9_;
		while (TRUE) {
			GeeIterator* _tmp10_;
			DinoPeerState* peer_state = NULL;
			GeeIterator* _tmp11_;
			gpointer _tmp12_;
			DinoPluginsVideoCallPlugin* _tmp13_;
			DinoPeerState* _tmp14_;
			XmppXepJingleRtpStream* _tmp15_;
			XmppXepJingleRtpStream* _tmp16_;
			_tmp10_ = _peer_state_it;
			if (!gee_iterator_next (_tmp10_)) {
				break;
			}
			_tmp11_ = _peer_state_it;
			_tmp12_ = gee_iterator_get (_tmp11_);
			peer_state = (DinoPeerState*) _tmp12_;
			_tmp13_ = self->call_plugin;
			_tmp14_ = peer_state;
			_tmp15_ = dino_peer_state_get_audio_stream (_tmp14_);
			_tmp16_ = _tmp15_;
			dino_plugins_video_call_plugin_set_device (_tmp13_, _tmp16_, device);
			_g_object_unref0 (_tmp16_);
			_g_object_unref0 (peer_state);
		}
		_g_object_unref0 (_peer_state_it);
	}
}

void
dino_call_state_set_video_device (DinoCallState* self,
                                  DinoPluginsMediaDevice* device)
{
	DinoPluginsMediaDevice* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (device);
	_g_object_unref0 (self->priv->selected_video_device);
	self->priv->selected_video_device = _tmp0_;
	{
		GeeIterator* _peer_state_it = NULL;
		GeeHashMap* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->peers;
		_tmp2_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_peer_state_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			DinoPeerState* peer_state = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			DinoPluginsVideoCallPlugin* _tmp10_;
			DinoPeerState* _tmp11_;
			XmppXepJingleRtpStream* _tmp12_;
			XmppXepJingleRtpStream* _tmp13_;
			_tmp7_ = _peer_state_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _peer_state_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			peer_state = (DinoPeerState*) _tmp9_;
			_tmp10_ = self->call_plugin;
			_tmp11_ = peer_state;
			_tmp12_ = dino_peer_state_get_video_stream (_tmp11_);
			_tmp13_ = _tmp12_;
			dino_plugins_video_call_plugin_set_device (_tmp10_, _tmp13_, device);
			_g_object_unref0 (_tmp13_);
			_g_object_unref0 (peer_state);
		}
		_g_object_unref0 (_peer_state_it);
	}
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

void
dino_call_state_rename_peer (DinoCallState* self,
                             XmppJid* from_jid,
                             XmppJid* to_jid)
{
	DinoEntitiesCall* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GeeHashMap* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	DinoPeerState* peer_state = NULL;
	GeeHashMap* _tmp15_;
	gpointer _tmp16_;
	DinoPeerState* _tmp17_;
	GeeHashMap* _tmp18_;
	GeeHashMap* _tmp19_;
	DinoPeerState* _tmp20_;
	DinoPeerState* _tmp21_;
	XmppJid* _tmp22_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (from_jid != NULL);
	g_return_if_fail (to_jid != NULL);
	_tmp0_ = self->call;
	_tmp1_ = dino_entities_call_get_account (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = dino_entities_account_get_bare_jid (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = xmpp_jid_to_string (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = xmpp_jid_to_string (from_jid);
	_tmp9_ = _tmp8_;
	_tmp10_ = xmpp_jid_to_string (to_jid);
	_tmp11_ = _tmp10_;
	_tmp12_ = self->peers;
	_tmp13_ = bool_to_string (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp12_, from_jid));
	_tmp14_ = _tmp13_;
	g_debug ("call_state.vala:297: [%s] Renaming %s to %s exists %s", _tmp7_, _tmp9_, _tmp11_, _tmp14_);
	_g_free0 (_tmp14_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
	_xmpp_jid_unref0 (_tmp5_);
	_tmp15_ = self->peers;
	_tmp16_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp15_, from_jid);
	peer_state = (DinoPeerState*) _tmp16_;
	_tmp17_ = peer_state;
	if (_tmp17_ == NULL) {
		_g_object_unref0 (peer_state);
		return;
	}
	_tmp18_ = self->peers;
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp18_, from_jid, NULL);
	_tmp19_ = self->peers;
	_tmp20_ = peer_state;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp19_, to_jid, _tmp20_);
	_tmp21_ = peer_state;
	_tmp22_ = _xmpp_jid_ref0 (to_jid);
	_xmpp_jid_unref0 (_tmp21_->jid);
	_tmp21_->jid = _tmp22_;
	_g_object_unref0 (peer_state);
}

static void
dino_call_state_on_call_terminated (DinoCallState* self,
                                    XmppJid* who_terminated,
                                    gboolean we_terminated,
                                    const gchar* reason_name,
                                    const gchar* reason_text)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	DinoEntitiesCall* _tmp2_;
	DinoEntitiesCallState _tmp3_;
	DinoEntitiesCallState _tmp4_;
	DinoEntitiesCall* _tmp14_;
	DinoEntitiesCallState _tmp15_;
	DinoEntitiesCallState _tmp16_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (who_terminated != NULL);
	_tmp2_ = self->call;
	_tmp3_ = dino_entities_call_get_state (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == DINO_ENTITIES_CALL_STATE_RINGING) {
		_tmp1_ = TRUE;
	} else {
		DinoEntitiesCall* _tmp5_;
		DinoEntitiesCallState _tmp6_;
		DinoEntitiesCallState _tmp7_;
		_tmp5_ = self->call;
		_tmp6_ = dino_entities_call_get_state (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_ == DINO_ENTITIES_CALL_STATE_IN_PROGRESS;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		DinoEntitiesCall* _tmp8_;
		DinoEntitiesCallState _tmp9_;
		DinoEntitiesCallState _tmp10_;
		_tmp8_ = self->call;
		_tmp9_ = dino_entities_call_get_state (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = _tmp10_ == DINO_ENTITIES_CALL_STATE_ESTABLISHING;
	}
	if (_tmp0_) {
		DinoEntitiesCall* _tmp11_;
		GDateTime* _tmp12_;
		GDateTime* _tmp13_;
		_tmp11_ = self->call;
		_tmp12_ = g_date_time_new_now_utc ();
		_tmp13_ = _tmp12_;
		dino_entities_call_set_end_time (_tmp11_, _tmp13_);
		_g_date_time_unref0 (_tmp13_);
	}
	_tmp14_ = self->call;
	_tmp15_ = dino_entities_call_get_state (_tmp14_);
	_tmp16_ = _tmp15_;
	if (_tmp16_ == DINO_ENTITIES_CALL_STATE_IN_PROGRESS) {
		DinoEntitiesCall* _tmp17_;
		_tmp17_ = self->call;
		dino_entities_call_set_state (_tmp17_, DINO_ENTITIES_CALL_STATE_ENDED);
	} else {
		gboolean _tmp18_ = FALSE;
		DinoEntitiesCall* _tmp19_;
		DinoEntitiesCallState _tmp20_;
		DinoEntitiesCallState _tmp21_;
		_tmp19_ = self->call;
		_tmp20_ = dino_entities_call_get_state (_tmp19_);
		_tmp21_ = _tmp20_;
		if (_tmp21_ == DINO_ENTITIES_CALL_STATE_RINGING) {
			_tmp18_ = TRUE;
		} else {
			DinoEntitiesCall* _tmp22_;
			DinoEntitiesCallState _tmp23_;
			DinoEntitiesCallState _tmp24_;
			_tmp22_ = self->call;
			_tmp23_ = dino_entities_call_get_state (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp18_ = _tmp24_ == DINO_ENTITIES_CALL_STATE_ESTABLISHING;
		}
		if (_tmp18_) {
			if (g_strcmp0 (reason_name, XMPP_XEP_JINGLE_REASON_ELEMENT_DECLINE) == 0) {
				DinoEntitiesCall* _tmp25_;
				_tmp25_ = self->call;
				dino_entities_call_set_state (_tmp25_, DINO_ENTITIES_CALL_STATE_DECLINED);
			} else {
				DinoEntitiesCall* _tmp26_;
				_tmp26_ = self->call;
				dino_entities_call_set_state (_tmp26_, DINO_ENTITIES_CALL_STATE_FAILED);
			}
		}
	}
	g_signal_emit (self, dino_call_state_signals[DINO_CALL_STATE_TERMINATED_SIGNAL], 0, who_terminated, reason_name, reason_text);
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		DinoCallState* self;
		self = _data4_->self;
		_g_object_unref0 (_data4_->peer_state);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}

static void
__lambda52_ (DinoCallState* self,
             DinoPeerState* peer,
             const gchar* media)
{
	g_return_if_fail (peer != NULL);
	g_return_if_fail (media != NULL);
	dino_call_state_on_peer_stream_created (self, peer, media);
}

static void
___lambda52__dino_peer_state_stream_created (DinoPeerState* _sender,
                                             const gchar* media,
                                             gpointer self)
{
	__lambda52_ ((DinoCallState*) self, _sender, media);
}

static void
__lambda53_ (Block4Data* _data4_,
             gboolean we_terminated,
             const gchar* reason_name,
             const gchar* reason_text)
{
	DinoCallState* self;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	DinoEntitiesCall* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	DinoEntitiesAccount* _tmp4_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	XmppJid* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	XmppJid* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	GeeHashMap* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	self = _data4_->self;
	_tmp0_ = reason_text;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp1_ = reason_name;
	if (_tmp1_ == NULL) {
		_tmp1_ = "";
	}
	_tmp2_ = self->call;
	_tmp3_ = dino_entities_call_get_account (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = dino_entities_account_get_bare_jid (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = xmpp_jid_to_string (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _data4_->peer_state->jid;
	_tmp11_ = xmpp_jid_to_string (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = self->peers;
	_tmp14_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp13_);
	_tmp15_ = _tmp14_;
	g_debug ("call_state.vala:333: [%s] Peer left %s: %s %s (%i peers remaining)", _tmp9_, _tmp0_, _tmp1_, _tmp12_, _tmp15_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp9_);
	_xmpp_jid_unref0 (_tmp7_);
	dino_call_state_handle_peer_left (self, _data4_->peer_state, we_terminated, reason_name, reason_text);
}

static void
___lambda53__dino_peer_state_session_terminated (DinoPeerState* _sender,
                                                 gboolean we_terminated,
                                                 const gchar* reason_name,
                                                 const gchar* reason_text,
                                                 gpointer self)
{
	__lambda53_ (self, we_terminated, reason_name, reason_text);
}

static void
dino_call_state_connect_peer_signals (DinoCallState* self,
                                      DinoPeerState* peer_state)
{
	Block4Data* _data4_;
	DinoPeerState* _tmp0_;
	GeeHashMap* _tmp1_;
	XmppJid* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (peer_state != NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (peer_state);
	_g_object_unref0 (_data4_->peer_state);
	_data4_->peer_state = _tmp0_;
	_tmp1_ = self->peers;
	_tmp2_ = _data4_->peer_state->jid;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, _tmp2_, _data4_->peer_state);
	g_object_bind_property_with_closures ((GObject*) self, "we-should-send-audio", (GObject*) _data4_->peer_state, "we-should-send-audio", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) self, "we-should-send-video", (GObject*) _data4_->peer_state, "we-should-send-video", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) self, "group-call", (GObject*) _data4_->peer_state, "group-call", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_signal_connect_object (_data4_->peer_state, "stream-created", (GCallback) ___lambda52__dino_peer_state_stream_created, self, 0);
	g_signal_connect_data (_data4_->peer_state, "session-terminated", (GCallback) ___lambda53__dino_peer_state_session_terminated, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
	block4_data_unref (_data4_);
	_data4_ = NULL;
}

static void
dino_call_state_can_convert_into_groupcall_data_free (gpointer _data)
{
	DinoCallStateCanConvertIntoGroupcallData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoCallStateCanConvertIntoGroupcallData, _data_);
}

void
dino_call_state_can_convert_into_groupcall (DinoCallState* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	DinoCallStateCanConvertIntoGroupcallData* _data_;
	DinoCallState* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DinoCallStateCanConvertIntoGroupcallData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_call_state_can_convert_into_groupcall_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dino_call_state_can_convert_into_groupcall_co (_data_);
}

gboolean
dino_call_state_can_convert_into_groupcall_finish (DinoCallState* self,
                                                   GAsyncResult* _res_)
{
	gboolean result;
	DinoCallStateCanConvertIntoGroupcallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
dino_call_state_can_convert_into_groupcall_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	DinoCallStateCanConvertIntoGroupcallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_call_state_can_convert_into_groupcall_co (_data_);
}

static gboolean
dino_call_state_can_convert_into_groupcall_co (DinoCallStateCanConvertIntoGroupcallData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->peers;
	_data_->_tmp1_ = gee_abstract_map_get_size ((GeeAbstractMap*) _data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_ == 0) {
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->self->peers;
	_data_->_tmp4_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = 0;
	_data_->_tmp8_ = gee_collection_to_array ((GeeCollection*) _data_->_tmp6_, &_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp9__length1 = _data_->_tmp7_;
	_data_->_tmp10_ = _data_->_tmp9_[0];
	_data_->_tmp11_ = _xmpp_jid_ref0 (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp9_ = (_vala_array_free (_data_->_tmp9_, _data_->_tmp9__length1, (GDestroyNotify) xmpp_jid_unref), NULL);
	_g_object_unref0 (_data_->_tmp6_);
	_data_->peer = _data_->_tmp12_;
	_data_->_tmp13_ = _data_->self->stream_interactor;
	_data_->_tmp14_ = dino_entity_info_IDENTITY;
	_data_->_tmp15_ = dino_stream_interactor_get_module (_data_->_tmp13_, DINO_TYPE_ENTITY_INFO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp14_);
	_data_->_tmp16_ = (DinoEntityInfo*) _data_->_tmp15_;
	_data_->_tmp17_ = _data_->self->call;
	_data_->_tmp18_ = dino_entities_call_get_account (_data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = _data_->peer;
	_data_->_state_ = 1;
	dino_entity_info_has_feature (_data_->_tmp16_, _data_->_tmp19_, _data_->_tmp20_, XMPP_XEP_MUJI_NS_URI, dino_call_state_can_convert_into_groupcall_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp21_ = dino_entity_info_has_feature_finish (_data_->_tmp16_, _data_->_res_);
	_g_object_unref0 (_data_->_tmp16_);
	_data_->peer_has_feature = _data_->_tmp21_;
	_data_->_tmp22_ = _data_->self->stream_interactor;
	_data_->_tmp23_ = dino_calls_IDENTITY;
	_data_->_tmp24_ = dino_stream_interactor_get_module (_data_->_tmp22_, DINO_TYPE_CALLS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp23_);
	_data_->_tmp25_ = (DinoCalls*) _data_->_tmp24_;
	_data_->_tmp26_ = _data_->self->call;
	_data_->_tmp27_ = dino_entities_call_get_account (_data_->_tmp26_);
	_data_->_tmp28_ = _data_->_tmp27_;
	_data_->_tmp29_ = dino_calls_can_initiate_groupcall (_data_->_tmp25_, _data_->_tmp28_);
	_g_object_unref0 (_data_->_tmp25_);
	_data_->can_initiate = _data_->_tmp29_;
	if (_data_->peer_has_feature) {
		_data_->_tmp30_ = _data_->can_initiate;
	} else {
		_data_->_tmp30_ = FALSE;
	}
	_data_->result = _data_->_tmp30_;
	_xmpp_jid_unref0 (_data_->peer);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dino_call_state_convert_into_group_call_data_free (gpointer _data)
{
	DinoCallStateConvertIntoGroupCallData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoCallStateConvertIntoGroupCallData, _data_);
}

void
dino_call_state_convert_into_group_call (DinoCallState* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	DinoCallStateConvertIntoGroupCallData* _data_;
	DinoCallState* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DinoCallStateConvertIntoGroupCallData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_call_state_convert_into_group_call_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dino_call_state_convert_into_group_call_co (_data_);
}

void
dino_call_state_convert_into_group_call_finish (DinoCallState* self,
                                                GAsyncResult* _res_)
{
	DinoCallStateConvertIntoGroupCallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_call_state_convert_into_group_call_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	DinoCallStateConvertIntoGroupCallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_call_state_convert_into_group_call_co (_data_);
}

static gboolean
_xmpp_xep_data_forms_data_form_type_equal (const XmppXepDataFormsDataFormType * s1,
                                           const XmppXepDataFormsDataFormType * s2)
{
	if (s1 == s2) {
		return TRUE;
	}
	if (s1 == NULL) {
		return FALSE;
	}
	if (s2 == NULL) {
		return FALSE;
	}
	return (*s1) == (*s2);
}

static gboolean
dino_call_state_convert_into_group_call_co (DinoCallStateConvertIntoGroupCallData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->stream_interactor;
	_data_->_tmp1_ = _data_->self->call;
	_data_->_tmp2_ = dino_entities_call_get_account (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dino_stream_interactor_get_stream (_data_->_tmp0_, _data_->_tmp3_);
	_data_->stream = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->stream;
	if (_data_->_tmp5_ == NULL) {
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _data_->self->stream_interactor;
	_data_->_tmp7_ = dino_muc_manager_IDENTITY;
	_data_->_tmp8_ = dino_stream_interactor_get_module (_data_->_tmp6_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp7_);
	_data_->_tmp9_ = (DinoMucManager*) _data_->_tmp8_;
	_data_->_tmp10_ = _data_->_tmp9_->default_muc_server;
	_data_->_tmp11_ = _data_->self->call;
	_data_->_tmp12_ = dino_entities_call_get_account (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp10_, _data_->_tmp13_);
	_data_->_tmp15_ = (XmppJid*) _data_->_tmp14_;
	_g_object_unref0 (_data_->_tmp9_);
	_data_->muc_jid = _data_->_tmp15_;
	_data_->_tmp16_ = _data_->muc_jid;
	if (_data_->_tmp16_ == NULL) {
		g_warning ("call_state.vala:352: Failed to initiate group call: MUC server not kno" \
"wn.");
		_xmpp_jid_unref0 (_data_->muc_jid);
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp17_ = _data_->self->cim_call_id;
	if (_data_->_tmp17_ == NULL) {
		_data_->_tmp18_ = xmpp_random_uuid ();
		_g_free0 (_data_->self->cim_call_id);
		_data_->self->cim_call_id = _data_->_tmp18_;
	}
	_data_->_tmp20_ = g_strdup_printf ("%08x@", (guint) g_random_int ());
	_data_->_tmp21_ = _data_->_tmp20_;
	_data_->_tmp22_ = _data_->muc_jid;
	_data_->_tmp23_ = xmpp_jid_to_string (_data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = g_strconcat (_data_->_tmp21_, _data_->_tmp24_, NULL);
	_data_->_tmp26_ = _data_->_tmp25_;
	_data_->_tmp27_ = xmpp_jid_new (_data_->_tmp26_, &_data_->_inner_error0_);
	_data_->_tmp28_ = _data_->_tmp27_;
	_g_free0 (_data_->_tmp26_);
	_g_free0 (_data_->_tmp24_);
	_g_free0 (_data_->_tmp21_);
	_data_->_tmp19_ = _data_->_tmp28_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_xmpp_jid_unref0 (_data_->muc_jid);
		_g_object_unref0 (_data_->stream);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp29_ = _data_->_tmp19_;
	_data_->_tmp19_ = NULL;
	_xmpp_jid_unref0 (_data_->muc_jid);
	_data_->muc_jid = _data_->_tmp29_;
	_data_->_tmp30_ = _data_->self->call;
	_data_->_tmp31_ = dino_entities_call_get_account (_data_->_tmp30_);
	_data_->_tmp32_ = _data_->_tmp31_;
	_data_->_tmp33_ = dino_entities_account_get_bare_jid (_data_->_tmp32_);
	_data_->_tmp34_ = _data_->_tmp33_;
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_tmp36_ = xmpp_jid_to_string (_data_->_tmp35_);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_tmp38_ = _data_->muc_jid;
	_data_->_tmp39_ = xmpp_jid_to_string (_data_->_tmp38_);
	_data_->_tmp40_ = _data_->_tmp39_;
	g_debug ("call_state.vala:359: [%s] Converting call to groupcall %s", _data_->_tmp37_, _data_->_tmp40_);
	_g_free0 (_data_->_tmp40_);
	_g_free0 (_data_->_tmp37_);
	_xmpp_jid_unref0 (_data_->_tmp35_);
	_data_->_tmp41_ = _data_->muc_jid;
	_data_->_state_ = 1;
	dino_call_state_join_group_call (_data_->self, _data_->_tmp41_, dino_call_state_convert_into_group_call_ready, _data_);
	return FALSE;
	_state_1:
	dino_call_state_join_group_call_finish (_data_->self, _data_->_res_);
	_data_->_tmp42_ = _data_->self->stream_interactor;
	_data_->_tmp43_ = dino_muc_manager_IDENTITY;
	_data_->_tmp44_ = dino_stream_interactor_get_module (_data_->_tmp42_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp43_);
	_data_->_tmp45_ = (DinoMucManager*) _data_->_tmp44_;
	_data_->_tmp46_ = _data_->self->call;
	_data_->_tmp47_ = dino_entities_call_get_account (_data_->_tmp46_);
	_data_->_tmp48_ = _data_->_tmp47_;
	_data_->_tmp49_ = _data_->muc_jid;
	_data_->_state_ = 2;
	dino_muc_manager_get_config_form (_data_->_tmp45_, _data_->_tmp48_, _data_->_tmp49_, dino_call_state_convert_into_group_call_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp50_ = dino_muc_manager_get_config_form_finish (_data_->_tmp45_, _data_->_res_);
	_data_->_tmp51_ = _data_->_tmp50_;
	_g_object_unref0 (_data_->_tmp45_);
	_data_->data_form = _data_->_tmp51_;
	_data_->_tmp52_ = _data_->data_form;
	if (_data_->_tmp52_ == NULL) {
		_xmpp_xep_data_forms_data_form_unref0 (_data_->data_form);
		_xmpp_jid_unref0 (_data_->_tmp19_);
		_xmpp_jid_unref0 (_data_->muc_jid);
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp53_ = _data_->data_form;
		_data_->_tmp54_ = _data_->_tmp53_->fields;
		_data_->_field_list = _data_->_tmp54_;
		_data_->_tmp55_ = _data_->_field_list;
		_data_->_tmp56_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp55_);
		_data_->_tmp57_ = _data_->_tmp56_;
		_data_->_field_size = _data_->_tmp57_;
		_data_->_field_index = -1;
		while (TRUE) {
			static GQuark _tmp66_label0 = 0;
			static GQuark _tmp66_label1 = 0;
			static GQuark _tmp66_label2 = 0;
			static GQuark _tmp66_label3 = 0;
			_data_->_field_index = _data_->_field_index + 1;
			_data_->_tmp58_ = _data_->_field_index;
			_data_->_tmp59_ = _data_->_field_size;
			if (!(_data_->_tmp58_ < _data_->_tmp59_)) {
				break;
			}
			_data_->_tmp60_ = _data_->_field_list;
			_data_->_tmp61_ = gee_list_get (_data_->_tmp60_, _data_->_field_index);
			_data_->field = (XmppXepDataFormsDataFormField*) _data_->_tmp61_;
			_data_->_tmp62_ = _data_->field;
			_data_->_tmp63_ = xmpp_xep_data_forms_data_form_field_get_var (_data_->_tmp62_);
			_data_->_tmp64_ = _data_->_tmp63_;
			_data_->_tmp67_ = 0U;
			_data_->_tmp65_ = _data_->_tmp64_;
			_data_->_tmp67_ = (NULL == _data_->_tmp65_) ? 0 : g_quark_from_string (_data_->_tmp65_);
			if (_data_->_tmp67_ == ((0 != _tmp66_label0) ? _tmp66_label0 : (_tmp66_label0 = g_quark_from_static_string ("muc#roomconfig_allowinvites")))) {
				switch (0) {
					default:
					{
						_data_->_tmp68_ = _data_->field;
						_data_->_tmp69_ = xmpp_xep_data_forms_data_form_field_get_type_ (_data_->_tmp68_);
						_data_->_tmp70_ = _data_->_tmp69_;
						_data_->_tmp71_ = XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_BOOLEAN;
						if (_xmpp_xep_data_forms_data_form_type_equal (_data_->_tmp70_, &_data_->_tmp71_) == TRUE) {
							_data_->_tmp72_ = _data_->field;
							xmpp_xep_data_forms_data_form_boolean_field_set_value (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp72_, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_BOOLEAN_FIELD, XmppXepDataFormsDataFormBooleanField), TRUE);
						}
						break;
					}
				}
			} else if (_data_->_tmp67_ == ((0 != _tmp66_label1) ? _tmp66_label1 : (_tmp66_label1 = g_quark_from_static_string ("muc#roomconfig_persistentroom")))) {
				switch (0) {
					default:
					{
						_data_->_tmp73_ = _data_->field;
						_data_->_tmp74_ = xmpp_xep_data_forms_data_form_field_get_type_ (_data_->_tmp73_);
						_data_->_tmp75_ = _data_->_tmp74_;
						_data_->_tmp76_ = XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_BOOLEAN;
						if (_xmpp_xep_data_forms_data_form_type_equal (_data_->_tmp75_, &_data_->_tmp76_) == TRUE) {
							_data_->_tmp77_ = _data_->field;
							xmpp_xep_data_forms_data_form_boolean_field_set_value (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp77_, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_BOOLEAN_FIELD, XmppXepDataFormsDataFormBooleanField), FALSE);
						}
						break;
					}
				}
			} else if (_data_->_tmp67_ == ((0 != _tmp66_label2) ? _tmp66_label2 : (_tmp66_label2 = g_quark_from_static_string ("muc#roomconfig_membersonly")))) {
				switch (0) {
					default:
					{
						_data_->_tmp78_ = _data_->field;
						_data_->_tmp79_ = xmpp_xep_data_forms_data_form_field_get_type_ (_data_->_tmp78_);
						_data_->_tmp80_ = _data_->_tmp79_;
						_data_->_tmp81_ = XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_BOOLEAN;
						if (_xmpp_xep_data_forms_data_form_type_equal (_data_->_tmp80_, &_data_->_tmp81_) == TRUE) {
							_data_->_tmp82_ = _data_->field;
							xmpp_xep_data_forms_data_form_boolean_field_set_value (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp82_, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_BOOLEAN_FIELD, XmppXepDataFormsDataFormBooleanField), TRUE);
						}
						break;
					}
				}
			} else if (_data_->_tmp67_ == ((0 != _tmp66_label3) ? _tmp66_label3 : (_tmp66_label3 = g_quark_from_static_string ("muc#roomconfig_whois")))) {
				switch (0) {
					default:
					{
						_data_->_tmp83_ = _data_->field;
						_data_->_tmp84_ = xmpp_xep_data_forms_data_form_field_get_type_ (_data_->_tmp83_);
						_data_->_tmp85_ = _data_->_tmp84_;
						_data_->_tmp86_ = XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_LIST_SINGLE;
						if (_xmpp_xep_data_forms_data_form_type_equal (_data_->_tmp85_, &_data_->_tmp86_) == TRUE) {
							_data_->_tmp87_ = _data_->field;
							xmpp_xep_data_forms_data_form_list_single_field_set_value (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp87_, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_LIST_SINGLE_FIELD, XmppXepDataFormsDataFormListSingleField), "anyone");
						}
						break;
					}
				}
			}
			_g_object_unref0 (_data_->field);
		}
	}
	_data_->_tmp88_ = _data_->self->stream_interactor;
	_data_->_tmp89_ = dino_muc_manager_IDENTITY;
	_data_->_tmp90_ = dino_stream_interactor_get_module (_data_->_tmp88_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp89_);
	_data_->_tmp91_ = (DinoMucManager*) _data_->_tmp90_;
	_data_->_tmp92_ = _data_->self->call;
	_data_->_tmp93_ = dino_entities_call_get_account (_data_->_tmp92_);
	_data_->_tmp94_ = _data_->_tmp93_;
	_data_->_tmp95_ = _data_->muc_jid;
	_data_->_tmp96_ = _data_->data_form;
	_data_->_state_ = 3;
	dino_muc_manager_set_config_form (_data_->_tmp91_, _data_->_tmp94_, _data_->_tmp95_, _data_->_tmp96_, dino_call_state_convert_into_group_call_ready, _data_);
	return FALSE;
	_state_3:
	dino_muc_manager_set_config_form_finish (_data_->_tmp91_, _data_->_res_);
	_g_object_unref0 (_data_->_tmp91_);
	{
		_data_->_tmp97_ = _data_->self->peers;
		_data_->_tmp98_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _data_->_tmp97_);
		_data_->_tmp99_ = _data_->_tmp98_;
		_data_->_tmp100_ = _data_->_tmp99_;
		_data_->_tmp101_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp100_);
		_data_->_tmp102_ = _data_->_tmp101_;
		_g_object_unref0 (_data_->_tmp100_);
		_data_->_peer_jid_it = _data_->_tmp102_;
		while (TRUE) {
			_data_->_tmp103_ = _data_->_peer_jid_it;
			if (!gee_iterator_next (_data_->_tmp103_)) {
				break;
			}
			_data_->_tmp104_ = _data_->_peer_jid_it;
			_data_->_tmp105_ = gee_iterator_get (_data_->_tmp104_);
			_data_->peer_jid = (XmppJid*) _data_->_tmp105_;
			_data_->_tmp106_ = _data_->self->call;
			_data_->_tmp107_ = dino_entities_call_get_account (_data_->_tmp106_);
			_data_->_tmp108_ = _data_->_tmp107_;
			_data_->_tmp109_ = dino_entities_account_get_bare_jid (_data_->_tmp108_);
			_data_->_tmp110_ = _data_->_tmp109_;
			_data_->_tmp111_ = _data_->_tmp110_;
			_data_->_tmp112_ = xmpp_jid_to_string (_data_->_tmp111_);
			_data_->_tmp113_ = _data_->_tmp112_;
			_data_->_tmp114_ = _data_->peer_jid;
			_data_->_tmp115_ = xmpp_jid_to_string (_data_->_tmp114_);
			_data_->_tmp116_ = _data_->_tmp115_;
			g_debug ("call_state.vala:392: [%s] Group call inviting %s", _data_->_tmp113_, _data_->_tmp116_);
			_g_free0 (_data_->_tmp116_);
			_g_free0 (_data_->_tmp113_);
			_xmpp_jid_unref0 (_data_->_tmp111_);
			_data_->_tmp117_ = _data_->peer_jid;
			_data_->_state_ = 4;
			dino_call_state_invite_to_call (_data_->self, _data_->_tmp117_, dino_call_state_convert_into_group_call_ready, _data_);
			return FALSE;
			_state_4:
			dino_call_state_invite_to_call_finish (_data_->self, _data_->_res_);
			_xmpp_jid_unref0 (_data_->peer_jid);
		}
		_g_object_unref0 (_data_->_peer_jid_it);
	}
	_xmpp_xep_data_forms_data_form_unref0 (_data_->data_form);
	_xmpp_jid_unref0 (_data_->_tmp19_);
	_xmpp_jid_unref0 (_data_->muc_jid);
	_g_object_unref0 (_data_->stream);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dino_call_state_join_group_call_data_free (gpointer _data)
{
	DinoCallStateJoinGroupCallData* _data_;
	_data_ = _data;
	_xmpp_jid_unref0 (_data_->muc_jid);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoCallStateJoinGroupCallData, _data_);
}

void
dino_call_state_join_group_call (DinoCallState* self,
                                 XmppJid* muc_jid,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DinoCallStateJoinGroupCallData* _data_;
	DinoCallState* _tmp0_;
	XmppJid* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (muc_jid != NULL);
	_data_ = g_slice_new0 (DinoCallStateJoinGroupCallData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_call_state_join_group_call_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (muc_jid);
	_xmpp_jid_unref0 (_data_->muc_jid);
	_data_->muc_jid = _tmp1_;
	dino_call_state_join_group_call_co (_data_);
}

void
dino_call_state_join_group_call_finish (DinoCallState* self,
                                        GAsyncResult* _res_)
{
	DinoCallStateJoinGroupCallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_call_state_join_group_call_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DinoCallStateJoinGroupCallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_call_state_join_group_call_co (_data_);
}

static void
__lambda51_ (DinoCallState* self,
             XmppJid* jid)
{
	DinoEntitiesCall* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GeeHashMap* _tmp10_;
	g_return_if_fail (jid != NULL);
	_tmp0_ = self->call;
	_tmp1_ = dino_entities_call_get_account (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = dino_entities_account_get_bare_jid (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = xmpp_jid_to_string (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = xmpp_jid_to_string (jid);
	_tmp9_ = _tmp8_;
	g_debug ("call_state.vala:409: [%s] Group call peer joined: %s", _tmp7_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
	_xmpp_jid_unref0 (_tmp5_);
	_tmp10_ = self->peers;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp10_, jid)) {
		GeeHashMap* _tmp11_;
		gpointer _tmp12_;
		DinoPeerState* _tmp13_;
		gboolean _tmp14_;
		_tmp11_ = self->peers;
		_tmp12_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp11_, jid);
		_tmp13_ = (DinoPeerState*) _tmp12_;
		_tmp14_ = !_tmp13_->first_peer;
		_g_object_unref0 (_tmp13_);
		if (_tmp14_) {
			GeeHashMap* _tmp15_;
			gpointer _tmp16_;
			DinoPeerState* _tmp17_;
			_tmp15_ = self->peers;
			_tmp16_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp15_, jid);
			_tmp17_ = (DinoPeerState*) _tmp16_;
			dino_peer_state_accept (_tmp17_);
			_g_object_unref0 (_tmp17_);
		}
	} else {
		DinoPeerState* peer_state = NULL;
		DinoEntitiesCall* _tmp18_;
		DinoStreamInteractor* _tmp19_;
		DinoPeerState* _tmp20_;
		DinoPeerState* _tmp21_;
		DinoEntitiesCall* _tmp22_;
		DinoEntitiesAccount* _tmp23_;
		DinoEntitiesAccount* _tmp24_;
		XmppJid* _tmp25_;
		XmppJid* _tmp26_;
		XmppJid* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		gchar* _tmp31_;
		DinoPeerState* _tmp32_;
		_tmp18_ = self->call;
		_tmp19_ = self->stream_interactor;
		_tmp20_ = dino_peer_state_new (jid, _tmp18_, self, _tmp19_);
		peer_state = _tmp20_;
		_tmp21_ = peer_state;
		_tmp21_->waiting_for_inbound_muji_connection = TRUE;
		_tmp22_ = self->call;
		_tmp23_ = dino_entities_call_get_account (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = dino_entities_account_get_bare_jid (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = _tmp26_;
		_tmp28_ = xmpp_jid_to_string (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp30_ = xmpp_jid_to_string (jid);
		_tmp31_ = _tmp30_;
		g_debug ("call_state.vala:422: [%s] Waiting for call from %s", _tmp29_, _tmp31_);
		_g_free0 (_tmp31_);
		_g_free0 (_tmp29_);
		_xmpp_jid_unref0 (_tmp27_);
		_tmp32_ = peer_state;
		dino_call_state_add_peer (self, _tmp32_);
		_g_object_unref0 (peer_state);
	}
}

static void
___lambda51__xmpp_xep_muji_group_call_peer_joined (XmppXepMujiGroupCall* _sender,
                                                   XmppJid* real_jid,
                                                   gpointer self)
{
	__lambda51_ ((DinoCallState*) self, real_jid);
}

static void
__lambda54_ (DinoCallState* self,
             XmppJid* jid)
{
	DinoEntitiesCall* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	XmppJid* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	DinoPeerState* peer_state = NULL;
	GeeHashMap* _tmp10_;
	gpointer _tmp11_;
	DinoPeerState* _tmp12_;
	DinoPeerState* _tmp13_;
	DinoPeerState* _tmp14_;
	g_return_if_fail (jid != NULL);
	_tmp0_ = self->call;
	_tmp1_ = dino_entities_call_get_account (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = dino_entities_account_get_bare_jid (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = xmpp_jid_to_string (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = xmpp_jid_to_string (jid);
	_tmp9_ = _tmp8_;
	g_debug ("call_state.vala:428: [%s] Group call peer left: %s", _tmp7_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
	_xmpp_jid_unref0 (_tmp5_);
	_tmp10_ = self->peers;
	_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp10_, jid);
	peer_state = (DinoPeerState*) _tmp11_;
	_tmp12_ = peer_state;
	if (_tmp12_ == NULL) {
		_g_object_unref0 (peer_state);
		return;
	}
	_tmp13_ = peer_state;
	dino_peer_state_end (_tmp13_, XMPP_XEP_JINGLE_REASON_ELEMENT_CANCEL, "Peer left the MUJI MUC");
	_tmp14_ = peer_state;
	dino_call_state_handle_peer_left (self, _tmp14_, FALSE, XMPP_XEP_JINGLE_REASON_ELEMENT_CANCEL, "Peer left the MUJI MUC");
	_g_object_unref0 (peer_state);
}

static void
___lambda54__xmpp_xep_muji_group_call_peer_left (XmppXepMujiGroupCall* _sender,
                                                 XmppJid* real_jid,
                                                 gpointer self)
{
	__lambda54_ ((DinoCallState*) self, real_jid);
}

static gboolean
dino_call_state_join_group_call_co (DinoCallStateJoinGroupCallData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->call;
	_data_->_tmp1_ = dino_entities_call_get_account (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = dino_entities_account_get_bare_jid (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = xmpp_jid_to_string (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = xmpp_jid_to_string (_data_->muc_jid);
	_data_->_tmp9_ = _data_->_tmp8_;
	g_debug ("call_state.vala:398: [%s] Joining group call %s", _data_->_tmp7_, _data_->_tmp9_);
	_g_free0 (_data_->_tmp9_);
	_g_free0 (_data_->_tmp7_);
	_xmpp_jid_unref0 (_data_->_tmp5_);
	_data_->_tmp10_ = _data_->self->stream_interactor;
	_data_->_tmp11_ = _data_->self->call;
	_data_->_tmp12_ = dino_entities_call_get_account (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = dino_stream_interactor_get_stream (_data_->_tmp10_, _data_->_tmp13_);
	_data_->stream = _data_->_tmp14_;
	_data_->_tmp15_ = _data_->stream;
	if (_data_->_tmp15_ == NULL) {
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp16_ = _data_->stream;
	_data_->_tmp17_ = xmpp_xep_muji_module_IDENTITY;
	_data_->_tmp18_ = xmpp_xmpp_stream_get_module (_data_->_tmp16_, XMPP_XEP_MUJI_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp17_);
	_data_->_tmp19_ = (XmppXepMujiModule*) _data_->_tmp18_;
	_data_->_tmp20_ = _data_->stream;
	_data_->_tmp21_ = _data_->self->priv->_we_should_send_video;
	_data_->_state_ = 1;
	xmpp_xep_muji_module_join_call (_data_->_tmp19_, _data_->_tmp20_, _data_->muc_jid, _data_->_tmp21_, dino_call_state_join_group_call_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp22_ = xmpp_xep_muji_module_join_call_finish (_data_->_tmp19_, _data_->_res_);
	_data_->_tmp23_ = _data_->_tmp22_;
	dino_call_state_set_group_call (_data_->self, _data_->_tmp23_);
	_xmpp_xep_muji_group_call_unref0 (_data_->_tmp23_);
	_g_object_unref0 (_data_->_tmp19_);
	_data_->_tmp24_ = _data_->self->priv->_group_call;
	if (_data_->_tmp24_ == NULL) {
		_data_->_tmp25_ = _data_->self->call;
		_data_->_tmp26_ = dino_entities_call_get_account (_data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp28_ = dino_entities_account_get_bare_jid (_data_->_tmp27_);
		_data_->_tmp29_ = _data_->_tmp28_;
		_data_->_tmp30_ = _data_->_tmp29_;
		_data_->_tmp31_ = xmpp_jid_to_string (_data_->_tmp30_);
		_data_->_tmp32_ = _data_->_tmp31_;
		g_warning ("call_state.vala:404: [%s] Couldn't join MUJI MUC", _data_->_tmp32_);
		_g_free0 (_data_->_tmp32_);
		_xmpp_jid_unref0 (_data_->_tmp30_);
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp33_ = _data_->self->priv->_group_call;
	g_signal_connect_object (_data_->_tmp33_, "peer-joined", (GCallback) ___lambda51__xmpp_xep_muji_group_call_peer_joined, _data_->self, 0);
	_data_->_tmp34_ = _data_->self->priv->_group_call;
	g_signal_connect_object (_data_->_tmp34_, "peer-left", (GCallback) ___lambda54__xmpp_xep_muji_group_call_peer_left, _data_->self, 0);
	_data_->_tmp35_ = _data_->self->priv->_group_call;
	_data_->_tmp36_ = _data_->_tmp35_->peers_to_connect_to;
	_data_->_tmp37_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp36_);
	_data_->_tmp38_ = _data_->_tmp37_;
	if (_data_->_tmp38_ > 4) {
		dino_call_state_end (_data_->self, "Call too full - P2p calls don't work well with many participants");
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp39_ = _data_->self->priv->_group_call;
		_data_->_tmp40_ = _data_->_tmp39_->peers_to_connect_to;
		_data_->_peer_jid_list = _data_->_tmp40_;
		_data_->_tmp41_ = _data_->_peer_jid_list;
		_data_->_tmp42_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp41_);
		_data_->_tmp43_ = _data_->_tmp42_;
		_data_->_peer_jid_size = _data_->_tmp43_;
		_data_->_peer_jid_index = -1;
		while (TRUE) {
			_data_->_peer_jid_index = _data_->_peer_jid_index + 1;
			_data_->_tmp44_ = _data_->_peer_jid_index;
			_data_->_tmp45_ = _data_->_peer_jid_size;
			if (!(_data_->_tmp44_ < _data_->_tmp45_)) {
				break;
			}
			_data_->_tmp46_ = _data_->_peer_jid_list;
			_data_->_tmp47_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp46_, _data_->_peer_jid_index);
			_data_->peer_jid = (XmppJid*) _data_->_tmp47_;
			_data_->_tmp48_ = _data_->self->peers;
			_data_->_tmp49_ = _data_->peer_jid;
			if (gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp48_, _data_->_tmp49_)) {
				_xmpp_jid_unref0 (_data_->peer_jid);
				continue;
			}
			_data_->_tmp50_ = _data_->self->call;
			_data_->_tmp51_ = dino_entities_call_get_account (_data_->_tmp50_);
			_data_->_tmp52_ = _data_->_tmp51_;
			_data_->_tmp53_ = dino_entities_account_get_bare_jid (_data_->_tmp52_);
			_data_->_tmp54_ = _data_->_tmp53_;
			_data_->_tmp55_ = _data_->_tmp54_;
			_data_->_tmp56_ = xmpp_jid_to_string (_data_->_tmp55_);
			_data_->_tmp57_ = _data_->_tmp56_;
			_data_->_tmp58_ = _data_->peer_jid;
			_data_->_tmp59_ = xmpp_jid_to_string (_data_->_tmp58_);
			_data_->_tmp60_ = _data_->_tmp59_;
			g_debug ("call_state.vala:445: [%s] Calling %s because they were in the MUC alre" \
"ady", _data_->_tmp57_, _data_->_tmp60_);
			_g_free0 (_data_->_tmp60_);
			_g_free0 (_data_->_tmp57_);
			_xmpp_jid_unref0 (_data_->_tmp55_);
			_data_->_tmp61_ = _data_->peer_jid;
			_data_->_tmp62_ = _data_->self->call;
			_data_->_tmp63_ = _data_->self->stream_interactor;
			_data_->_tmp64_ = dino_peer_state_new (_data_->_tmp61_, _data_->_tmp62_, _data_->self, _data_->_tmp63_);
			_data_->peer_state = _data_->_tmp64_;
			_data_->_tmp65_ = _data_->peer_state;
			dino_call_state_add_peer (_data_->self, _data_->_tmp65_);
			_data_->_tmp66_ = _data_->peer_state;
			_data_->_tmp67_ = _data_->peer_jid;
			dino_peer_state_call_resource (_data_->_tmp66_, _data_->_tmp67_, NULL, NULL);
			_g_object_unref0 (_data_->peer_state);
			_xmpp_jid_unref0 (_data_->peer_jid);
		}
	}
	_data_->_tmp68_ = _data_->self->call;
	_data_->_tmp69_ = dino_entities_call_get_account (_data_->_tmp68_);
	_data_->_tmp70_ = _data_->_tmp69_;
	_data_->_tmp71_ = dino_entities_account_get_bare_jid (_data_->_tmp70_);
	_data_->_tmp72_ = _data_->_tmp71_;
	_data_->_tmp73_ = _data_->_tmp72_;
	_data_->_tmp74_ = xmpp_jid_to_string (_data_->_tmp73_);
	_data_->_tmp75_ = _data_->_tmp74_;
	_data_->_tmp76_ = xmpp_jid_to_string (_data_->muc_jid);
	_data_->_tmp77_ = _data_->_tmp76_;
	g_debug ("call_state.vala:452: [%s] Finished joining MUJI muc %s", _data_->_tmp75_, _data_->_tmp77_);
	_g_free0 (_data_->_tmp77_);
	_g_free0 (_data_->_tmp75_);
	_xmpp_jid_unref0 (_data_->_tmp73_);
	_g_object_unref0 (_data_->stream);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dino_call_state_handle_peer_left (DinoCallState* self,
                                  DinoPeerState* peer_state,
                                  gboolean we_terminated,
                                  const gchar* reason_name,
                                  const gchar* reason_text)
{
	GeeHashMap* _tmp0_;
	XmppJid* _tmp1_;
	GeeHashMap* _tmp2_;
	XmppJid* _tmp3_;
	GeeHashMap* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (peer_state != NULL);
	_tmp0_ = self->peers;
	_tmp1_ = peer_state->jid;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp1_)) {
		return;
	}
	_tmp2_ = self->peers;
	_tmp3_ = peer_state->jid;
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp2_, _tmp3_, NULL);
	_tmp4_ = self->peers;
	_tmp5_ = gee_map_get_is_empty ((GeeMap*) _tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		XmppXepMujiGroupCall* _tmp7_;
		_tmp7_ = self->priv->_group_call;
		if (_tmp7_ != NULL) {
			XmppXepMujiGroupCall* _tmp8_;
			DinoStreamInteractor* _tmp9_;
			DinoEntitiesCall* _tmp10_;
			DinoEntitiesAccount* _tmp11_;
			DinoEntitiesAccount* _tmp12_;
			XmppXmppStream* _tmp13_;
			XmppXmppStream* _tmp14_;
			XmppJid* _tmp15_;
			_tmp8_ = self->priv->_group_call;
			_tmp9_ = self->stream_interactor;
			_tmp10_ = self->call;
			_tmp11_ = dino_entities_call_get_account (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = dino_stream_interactor_get_stream (_tmp9_, _tmp12_);
			_tmp14_ = _tmp13_;
			xmpp_xep_muji_group_call_leave (_tmp8_, _tmp14_);
			_g_object_unref0 (_tmp14_);
			_tmp15_ = peer_state->jid;
			dino_call_state_on_call_terminated (self, _tmp15_, we_terminated, NULL, "All participants have left the call");
		} else {
			XmppJid* _tmp16_;
			_tmp16_ = peer_state->jid;
			dino_call_state_on_call_terminated (self, _tmp16_, we_terminated, reason_name, reason_text);
		}
	} else {
		XmppJid* _tmp17_;
		_tmp17_ = peer_state->jid;
		g_signal_emit (self, dino_call_state_signals[DINO_CALL_STATE_PEER_LEFT_SIGNAL], 0, _tmp17_, peer_state, reason_name, reason_text);
	}
}

XmppJid*
dino_call_state_get_parent_muc (DinoCallState* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parent_muc;
	result = _tmp0_;
	return result;
}

void
dino_call_state_set_parent_muc (DinoCallState* self,
                                XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_call_state_get_parent_muc (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_parent_muc);
		self->priv->_parent_muc = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_call_state_properties[DINO_CALL_STATE_PARENT_MUC_PROPERTY]);
	}
}

gboolean
dino_call_state_get_accepted (DinoCallState* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_accepted;
	return result;
}

static void
dino_call_state_set_accepted (DinoCallState* self,
                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_call_state_get_accepted (self);
	if (old_value != value) {
		self->priv->_accepted = value;
		g_object_notify_by_pspec ((GObject *) self, dino_call_state_properties[DINO_CALL_STATE_ACCEPTED_PROPERTY]);
	}
}

const gchar*
dino_call_state_get_cim_message_type (DinoCallState* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_cim_message_type;
	result = _tmp0_;
	return result;
}

void
dino_call_state_set_cim_message_type (DinoCallState* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_call_state_get_cim_message_type (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_cim_message_type);
		self->priv->_cim_message_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_call_state_properties[DINO_CALL_STATE_CIM_MESSAGE_TYPE_PROPERTY]);
	}
}

XmppXepMujiGroupCall*
dino_call_state_get_group_call (DinoCallState* self)
{
	XmppXepMujiGroupCall* result;
	XmppXepMujiGroupCall* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group_call;
	result = _tmp0_;
	return result;
}

static gpointer
_xmpp_xep_muji_group_call_ref0 (gpointer self)
{
	return self ? xmpp_xep_muji_group_call_ref (self) : NULL;
}

void
dino_call_state_set_group_call (DinoCallState* self,
                                XmppXepMujiGroupCall* value)
{
	XmppXepMujiGroupCall* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_call_state_get_group_call (self);
	if (old_value != value) {
		XmppXepMujiGroupCall* _tmp0_;
		_tmp0_ = _xmpp_xep_muji_group_call_ref0 (value);
		_xmpp_xep_muji_group_call_unref0 (self->priv->_group_call);
		self->priv->_group_call = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_call_state_properties[DINO_CALL_STATE_GROUP_CALL_PROPERTY]);
	}
}

gboolean
dino_call_state_get_we_should_send_audio (DinoCallState* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_we_should_send_audio;
	return result;
}

void
dino_call_state_set_we_should_send_audio (DinoCallState* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_call_state_get_we_should_send_audio (self);
	if (old_value != value) {
		self->priv->_we_should_send_audio = value;
		g_object_notify_by_pspec ((GObject *) self, dino_call_state_properties[DINO_CALL_STATE_WE_SHOULD_SEND_AUDIO_PROPERTY]);
	}
}

gboolean
dino_call_state_get_we_should_send_video (DinoCallState* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_we_should_send_video;
	return result;
}

void
dino_call_state_set_we_should_send_video (DinoCallState* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_call_state_get_we_should_send_video (self);
	if (old_value != value) {
		self->priv->_we_should_send_video = value;
		g_object_notify_by_pspec ((GObject *) self, dino_call_state_properties[DINO_CALL_STATE_WE_SHOULD_SEND_VIDEO_PROPERTY]);
	}
}

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

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

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

static void
dino_call_state_class_init (DinoCallStateClass * klass,
                            gpointer klass_data)
{
	dino_call_state_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoCallState_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_call_state_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_call_state_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_call_state_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_CALL_STATE_PARENT_MUC_PROPERTY, dino_call_state_properties[DINO_CALL_STATE_PARENT_MUC_PROPERTY] = xmpp_param_spec_jid ("parent-muc", "parent-muc", "parent-muc", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_CALL_STATE_ACCEPTED_PROPERTY, dino_call_state_properties[DINO_CALL_STATE_ACCEPTED_PROPERTY] = g_param_spec_boolean ("accepted", "accepted", "accepted", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_CALL_STATE_CIM_MESSAGE_TYPE_PROPERTY, dino_call_state_properties[DINO_CALL_STATE_CIM_MESSAGE_TYPE_PROPERTY] = g_param_spec_string ("cim-message-type", "cim-message-type", "cim-message-type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_CALL_STATE_GROUP_CALL_PROPERTY, dino_call_state_properties[DINO_CALL_STATE_GROUP_CALL_PROPERTY] = xmpp_xep_muji_param_spec_group_call ("group-call", "group-call", "group-call", XMPP_XEP_MUJI_TYPE_GROUP_CALL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_CALL_STATE_WE_SHOULD_SEND_AUDIO_PROPERTY, dino_call_state_properties[DINO_CALL_STATE_WE_SHOULD_SEND_AUDIO_PROPERTY] = g_param_spec_boolean ("we-should-send-audio", "we-should-send-audio", "we-should-send-audio", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_CALL_STATE_WE_SHOULD_SEND_VIDEO_PROPERTY, dino_call_state_properties[DINO_CALL_STATE_WE_SHOULD_SEND_VIDEO_PROPERTY] = g_param_spec_boolean ("we-should-send-video", "we-should-send-video", "we-should-send-video", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	dino_call_state_signals[DINO_CALL_STATE_TERMINATED_SIGNAL] = g_signal_new ("terminated", DINO_TYPE_CALL_STATE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__XMPP_JID_STRING_STRING, G_TYPE_NONE, 3, XMPP_TYPE_JID, G_TYPE_STRING, G_TYPE_STRING);
	dino_call_state_signals[DINO_CALL_STATE_PEER_JOINED_SIGNAL] = g_signal_new ("peer-joined", DINO_TYPE_CALL_STATE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__XMPP_JID_OBJECT, G_TYPE_NONE, 2, XMPP_TYPE_JID, DINO_TYPE_PEER_STATE);
	dino_call_state_signals[DINO_CALL_STATE_PEER_LEFT_SIGNAL] = g_signal_new ("peer-left", DINO_TYPE_CALL_STATE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__XMPP_JID_OBJECT_STRING_STRING, G_TYPE_NONE, 4, XMPP_TYPE_JID, DINO_TYPE_PEER_STATE, G_TYPE_STRING, G_TYPE_STRING);
}

static void
dino_call_state_instance_init (DinoCallState * self,
                               gpointer klass)
{
	DinoApplication* _tmp0_;
	DinoPluginsRegistry* _tmp1_;
	DinoPluginsRegistry* _tmp2_;
	DinoPluginsVideoCallPlugin* _tmp3_;
	DinoPluginsVideoCallPlugin* _tmp4_;
	GeeArrayList* _tmp5_;
	gchar* _tmp6_;
	GeeHashMap* _tmp7_;
	self->priv = dino_call_state_get_instance_private (self);
	_tmp0_ = dino_application_get_default ();
	_tmp1_ = dino_application_get_plugin_registry (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->video_call_plugin;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	self->call_plugin = _tmp4_;
	self->invited_to_group_call = NULL;
	self->priv->_accepted = FALSE;
	self->use_cim = FALSE;
	self->cim_call_id = NULL;
	self->cim_counterpart = NULL;
	_tmp5_ = gee_array_list_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, NULL, NULL, NULL);
	self->cim_jids_to_inform = _tmp5_;
	_tmp6_ = g_strdup (XMPP_MESSAGE_STANZA_TYPE_CHAT);
	self->priv->_cim_message_type = _tmp6_;
	self->priv->_we_should_send_audio = FALSE;
	self->priv->_we_should_send_video = FALSE;
	_tmp7_ = gee_hash_map_new (XMPP_TYPE_JID, (GBoxedCopyFunc) xmpp_jid_ref, (GDestroyNotify) xmpp_jid_unref, DINO_TYPE_PEER_STATE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_jid_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_jid_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->peers = _tmp7_;
}

static void
dino_call_state_finalize (GObject * obj)
{
	DinoCallState * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_TYPE_CALL_STATE, DinoCallState);
	_g_object_unref0 (self->stream_interactor);
	_g_object_unref0 (self->call_plugin);
	_g_object_unref0 (self->call);
	_xmpp_jid_unref0 (self->priv->_parent_muc);
	_xmpp_jid_unref0 (self->invited_to_group_call);
	_g_free0 (self->cim_call_id);
	_xmpp_jid_unref0 (self->cim_counterpart);
	_g_object_unref0 (self->cim_jids_to_inform);
	_g_free0 (self->priv->_cim_message_type);
	_xmpp_xep_muji_group_call_unref0 (self->priv->_group_call);
	_g_object_unref0 (self->peers);
	_g_object_unref0 (self->priv->selected_microphone_device);
	_g_object_unref0 (self->priv->selected_speaker_device);
	_g_object_unref0 (self->priv->selected_video_device);
	G_OBJECT_CLASS (dino_call_state_parent_class)->finalize (obj);
}

static GType
dino_call_state_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoCallStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_call_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoCallState), 0, (GInstanceInitFunc) dino_call_state_instance_init, NULL };
	GType dino_call_state_type_id;
	dino_call_state_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoCallState", &g_define_type_info, 0);
	DinoCallState_private_offset = g_type_add_instance_private (dino_call_state_type_id, sizeof (DinoCallStatePrivate));
	return dino_call_state_type_id;
}

GType
dino_call_state_get_type (void)
{
	static volatile gsize dino_call_state_type_id__once = 0;
	if (g_once_init_enter (&dino_call_state_type_id__once)) {
		GType dino_call_state_type_id;
		dino_call_state_type_id = dino_call_state_get_type_once ();
		g_once_init_leave (&dino_call_state_type_id__once, dino_call_state_type_id);
	}
	return dino_call_state_type_id__once;
}

static void
_vala_dino_call_state_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	DinoCallState * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_TYPE_CALL_STATE, DinoCallState);
	switch (property_id) {
		case DINO_CALL_STATE_PARENT_MUC_PROPERTY:
		xmpp_value_set_jid (value, dino_call_state_get_parent_muc (self));
		break;
		case DINO_CALL_STATE_ACCEPTED_PROPERTY:
		g_value_set_boolean (value, dino_call_state_get_accepted (self));
		break;
		case DINO_CALL_STATE_CIM_MESSAGE_TYPE_PROPERTY:
		g_value_set_string (value, dino_call_state_get_cim_message_type (self));
		break;
		case DINO_CALL_STATE_GROUP_CALL_PROPERTY:
		xmpp_xep_muji_value_set_group_call (value, dino_call_state_get_group_call (self));
		break;
		case DINO_CALL_STATE_WE_SHOULD_SEND_AUDIO_PROPERTY:
		g_value_set_boolean (value, dino_call_state_get_we_should_send_audio (self));
		break;
		case DINO_CALL_STATE_WE_SHOULD_SEND_VIDEO_PROPERTY:
		g_value_set_boolean (value, dino_call_state_get_we_should_send_video (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_call_state_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	DinoCallState * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_TYPE_CALL_STATE, DinoCallState);
	switch (property_id) {
		case DINO_CALL_STATE_PARENT_MUC_PROPERTY:
		dino_call_state_set_parent_muc (self, xmpp_value_get_jid (value));
		break;
		case DINO_CALL_STATE_ACCEPTED_PROPERTY:
		dino_call_state_set_accepted (self, g_value_get_boolean (value));
		break;
		case DINO_CALL_STATE_CIM_MESSAGE_TYPE_PROPERTY:
		dino_call_state_set_cim_message_type (self, g_value_get_string (value));
		break;
		case DINO_CALL_STATE_GROUP_CALL_PROPERTY:
		dino_call_state_set_group_call (self, xmpp_xep_muji_value_get_group_call (value));
		break;
		case DINO_CALL_STATE_WE_SHOULD_SEND_AUDIO_PROPERTY:
		dino_call_state_set_we_should_send_audio (self, g_value_get_boolean (value));
		break;
		case DINO_CALL_STATE_WE_SHOULD_SEND_VIDEO_PROPERTY:
		dino_call_state_set_we_should_send_video (self, g_value_get_boolean (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);
}

