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

#include <gtk/gtk.h>
#include <glib-object.h>
#include "libdino.h"
#include "xmpp-vala.h"
#include <glib.h>
#include "dino_i18n.h"
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <float.h>
#include <math.h>
#include <adwaita.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DINO_UI_OCCUPANT_MENU_TYPE_VIEW (dino_ui_occupant_menu_view_get_type ())
#define DINO_UI_OCCUPANT_MENU_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_OCCUPANT_MENU_TYPE_VIEW, DinoUiOccupantMenuView))
#define DINO_UI_OCCUPANT_MENU_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_OCCUPANT_MENU_TYPE_VIEW, DinoUiOccupantMenuViewClass))
#define DINO_UI_OCCUPANT_MENU_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_OCCUPANT_MENU_TYPE_VIEW))
#define DINO_UI_OCCUPANT_MENU_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_OCCUPANT_MENU_TYPE_VIEW))
#define DINO_UI_OCCUPANT_MENU_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_OCCUPANT_MENU_TYPE_VIEW, DinoUiOccupantMenuViewClass))

typedef struct _DinoUiOccupantMenuView DinoUiOccupantMenuView;
typedef struct _DinoUiOccupantMenuViewClass DinoUiOccupantMenuViewClass;
typedef struct _DinoUiOccupantMenuViewPrivate DinoUiOccupantMenuViewPrivate;

#define DINO_UI_OCCUPANT_MENU_TYPE_LIST (dino_ui_occupant_menu_list_get_type ())
#define DINO_UI_OCCUPANT_MENU_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST, DinoUiOccupantMenuList))
#define DINO_UI_OCCUPANT_MENU_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_OCCUPANT_MENU_TYPE_LIST, DinoUiOccupantMenuListClass))
#define DINO_UI_OCCUPANT_MENU_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST))
#define DINO_UI_OCCUPANT_MENU_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_OCCUPANT_MENU_TYPE_LIST))
#define DINO_UI_OCCUPANT_MENU_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST, DinoUiOccupantMenuListClass))

typedef struct _DinoUiOccupantMenuList DinoUiOccupantMenuList;
typedef struct _DinoUiOccupantMenuListClass DinoUiOccupantMenuListClass;
enum  {
	DINO_UI_OCCUPANT_MENU_VIEW_0_PROPERTY,
	DINO_UI_OCCUPANT_MENU_VIEW_NUM_PROPERTIES
};
static GParamSpec* dino_ui_occupant_menu_view_properties[DINO_UI_OCCUPANT_MENU_VIEW_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 DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW (dino_ui_occupant_menu_list_row_get_type ())
#define DINO_UI_OCCUPANT_MENU_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, DinoUiOccupantMenuListRow))
#define DINO_UI_OCCUPANT_MENU_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, DinoUiOccupantMenuListRowClass))
#define DINO_UI_OCCUPANT_MENU_IS_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW))
#define DINO_UI_OCCUPANT_MENU_IS_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW))
#define DINO_UI_OCCUPANT_MENU_LIST_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, DinoUiOccupantMenuListRowClass))

typedef struct _DinoUiOccupantMenuListRow DinoUiOccupantMenuListRow;
typedef struct _DinoUiOccupantMenuListRowClass DinoUiOccupantMenuListRowClass;
typedef struct _DinoUiOccupantMenuListPrivate DinoUiOccupantMenuListPrivate;
typedef struct _DinoUiOccupantMenuListRowPrivate DinoUiOccupantMenuListRowPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define DINO_UI_TYPE_APPLICATION (dino_ui_application_get_type ())
#define DINO_UI_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_APPLICATION, DinoUiApplication))
#define DINO_UI_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_APPLICATION, DinoUiApplicationClass))
#define DINO_UI_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_APPLICATION))
#define DINO_UI_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_APPLICATION))
#define DINO_UI_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_APPLICATION, DinoUiApplicationClass))

typedef struct _DinoUiApplication DinoUiApplication;
typedef struct _DinoUiApplicationClass DinoUiApplicationClass;
typedef struct _DinoUiApplicationPrivate DinoUiApplicationPrivate;

#define DINO_UI_TYPE_MAIN_WINDOW (dino_ui_main_window_get_type ())
#define DINO_UI_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_MAIN_WINDOW, DinoUiMainWindow))
#define DINO_UI_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_MAIN_WINDOW, DinoUiMainWindowClass))
#define DINO_UI_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_MAIN_WINDOW))
#define DINO_UI_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_MAIN_WINDOW))
#define DINO_UI_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_MAIN_WINDOW, DinoUiMainWindowClass))

typedef struct _DinoUiMainWindow DinoUiMainWindow;
typedef struct _DinoUiMainWindowClass DinoUiMainWindowClass;

#define DINO_UI_TYPE_MAIN_WINDOW_CONTROLLER (dino_ui_main_window_controller_get_type ())
#define DINO_UI_MAIN_WINDOW_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_MAIN_WINDOW_CONTROLLER, DinoUiMainWindowController))
#define DINO_UI_MAIN_WINDOW_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_MAIN_WINDOW_CONTROLLER, DinoUiMainWindowControllerClass))
#define DINO_UI_IS_MAIN_WINDOW_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_MAIN_WINDOW_CONTROLLER))
#define DINO_UI_IS_MAIN_WINDOW_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_MAIN_WINDOW_CONTROLLER))
#define DINO_UI_MAIN_WINDOW_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_MAIN_WINDOW_CONTROLLER, DinoUiMainWindowControllerClass))

typedef struct _DinoUiMainWindowController DinoUiMainWindowController;
typedef struct _DinoUiMainWindowControllerClass DinoUiMainWindowControllerClass;

#define DINO_UI_TYPE_SELECT_CONTACT_DIALOG (dino_ui_select_contact_dialog_get_type ())
#define DINO_UI_SELECT_CONTACT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_SELECT_CONTACT_DIALOG, DinoUiSelectContactDialog))
#define DINO_UI_SELECT_CONTACT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_SELECT_CONTACT_DIALOG, DinoUiSelectContactDialogClass))
#define DINO_UI_IS_SELECT_CONTACT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_SELECT_CONTACT_DIALOG))
#define DINO_UI_IS_SELECT_CONTACT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_SELECT_CONTACT_DIALOG))
#define DINO_UI_SELECT_CONTACT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_SELECT_CONTACT_DIALOG, DinoUiSelectContactDialogClass))

typedef struct _DinoUiSelectContactDialog DinoUiSelectContactDialog;
typedef struct _DinoUiSelectContactDialogClass DinoUiSelectContactDialogClass;
typedef struct _DinoUiSelectContactDialogPrivate DinoUiSelectContactDialogPrivate;

struct _DinoUiOccupantMenuView {
	GtkPopover parent_instance;
	DinoUiOccupantMenuViewPrivate * priv;
};

struct _DinoUiOccupantMenuViewClass {
	GtkPopoverClass parent_class;
};

struct _DinoUiOccupantMenuViewPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoEntitiesConversation* conversation;
	GtkStack* stack;
	GtkBox* list_box;
	DinoUiOccupantMenuList* list;
	GtkListBox* invite_list;
	GtkBox* jid_menu;
	XmppJid* selected_jid;
};

struct _DinoUiOccupantMenuList {
	GtkBox parent_instance;
	DinoUiOccupantMenuListPrivate * priv;
	GtkListBox* list_box;
	GeeHashMap* row_wrappers;
};

struct _DinoUiOccupantMenuListClass {
	GtkBoxClass parent_class;
};

struct _DinoUiOccupantMenuListRow {
	GObject parent_instance;
	DinoUiOccupantMenuListRowPrivate * priv;
	GtkLabel* name_label;
	DinoEntitiesConversation* conversation;
	XmppJid* jid;
};

struct _DinoUiOccupantMenuListRowClass {
	GObjectClass parent_class;
};

struct _DinoUiApplication {
	AdwApplication parent_instance;
	DinoUiApplicationPrivate * priv;
	DinoUiMainWindow* window;
	DinoUiMainWindowController* controller;
};

struct _DinoUiApplicationClass {
	AdwApplicationClass parent_class;
};

struct _DinoUiSelectContactDialog {
	GtkDialog parent_instance;
	DinoUiSelectContactDialogPrivate * priv;
	GtkButton* ok_button;
};

struct _DinoUiSelectContactDialogClass {
	GtkDialogClass parent_class;
};

static gint DinoUiOccupantMenuView_private_offset;
static gpointer dino_ui_occupant_menu_view_parent_class = NULL;

VALA_EXTERN GType dino_ui_occupant_menu_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiOccupantMenuView, g_object_unref)
VALA_EXTERN GType dino_ui_occupant_menu_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiOccupantMenuList, g_object_unref)
VALA_EXTERN DinoUiOccupantMenuView* dino_ui_occupant_menu_view_new (DinoStreamInteractor* stream_interactor,
                                                        DinoEntitiesConversation* conversation);
VALA_EXTERN DinoUiOccupantMenuView* dino_ui_occupant_menu_view_construct (GType object_type,
                                                              DinoStreamInteractor* stream_interactor,
                                                              DinoEntitiesConversation* conversation);
static void dino_ui_occupant_menu_view_initialize_list (DinoUiOccupantMenuView* self);
static void _dino_ui_occupant_menu_view_initialize_list_gtk_widget_show (GtkWidget* _sender,
                                                                  gpointer self);
VALA_EXTERN DinoUiOccupantMenuListRow* dino_ui_occupant_menu_list_row_new_label (const gchar* c,
                                                                     const gchar* text);
VALA_EXTERN DinoUiOccupantMenuListRow* dino_ui_occupant_menu_list_row_construct_label (GType object_type,
                                                                           const gchar* c,
                                                                           const gchar* text);
VALA_EXTERN GType dino_ui_occupant_menu_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiOccupantMenuListRow, g_object_unref)
VALA_EXTERN GtkWidget* dino_ui_occupant_menu_list_row_get_widget (DinoUiOccupantMenuListRow* self);
static void dino_ui_occupant_menu_view_on_invite_clicked (DinoUiOccupantMenuView* self);
static void _dino_ui_occupant_menu_view_on_invite_clicked_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                               GtkListBoxRow* row,
                                                                               gpointer self);
VALA_EXTERN void dino_ui_occupant_menu_view_reset (DinoUiOccupantMenuView* self);
static void _dino_ui_occupant_menu_view_reset_gtk_widget_hide (GtkWidget* _sender,
                                                        gpointer self);
VALA_EXTERN DinoUiOccupantMenuList* dino_ui_occupant_menu_list_new (DinoStreamInteractor* stream_interactor,
                                                        DinoEntitiesConversation* conversation);
VALA_EXTERN DinoUiOccupantMenuList* dino_ui_occupant_menu_list_construct (GType object_type,
                                                              DinoStreamInteractor* stream_interactor,
                                                              DinoEntitiesConversation* conversation);
static void ___lambda215_ (DinoUiOccupantMenuView* self,
                    GtkListBoxRow* row);
static void dino_ui_occupant_menu_view_show_menu (DinoUiOccupantMenuView* self,
                                           XmppJid* jid,
                                           const gchar* name_);
static void ____lambda215__gtk_list_box_row_activated (GtkListBox* _sender,
                                                GtkListBoxRow* row,
                                                gpointer self);
static void dino_ui_occupant_menu_view_show_list (DinoUiOccupantMenuView* self);
static void _dino_ui_occupant_menu_view_show_list_gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self);
static void dino_ui_occupant_menu_view_private_conversation_button_clicked (DinoUiOccupantMenuView* self);
static void _dino_ui_occupant_menu_view_private_conversation_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                         gpointer self);
static gboolean _xmpp_xep_muc_role_equal (const XmppXepMucRole * s1,
                                   const XmppXepMucRole * s2);
static void dino_ui_occupant_menu_view_kick_button_clicked (DinoUiOccupantMenuView* self);
static void _dino_ui_occupant_menu_view_kick_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                         gpointer self);
static void ____lambda216_ (DinoUiOccupantMenuView* self);
static void dino_ui_occupant_menu_view_voice_button_clicked (DinoUiOccupantMenuView* self,
                                                      const gchar* role);
static void _____lambda216__gtk_button_clicked (GtkButton* _sender,
                                         gpointer self);
static void _____lambda217_ (DinoUiOccupantMenuView* self);
static void ______lambda217__gtk_button_clicked (GtkButton* _sender,
                                          gpointer self);
VALA_EXTERN GType dino_ui_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiApplication, g_object_unref)
VALA_EXTERN GType dino_ui_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiMainWindow, g_object_unref)
VALA_EXTERN GType dino_ui_main_window_controller_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiMainWindowController, g_object_unref)
VALA_EXTERN void dino_ui_main_window_controller_select_conversation (DinoUiMainWindowController* self,
                                                         DinoEntitiesConversation* conversation,
                                                         gboolean do_reset_search,
                                                         gboolean default_initialize_conversation);
static gboolean _dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                                 gconstpointer b,
                                                                 gpointer self);
VALA_EXTERN GType dino_ui_select_contact_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiSelectContactDialog, g_object_unref)
VALA_EXTERN DinoUiSelectContactDialog* dino_ui_select_contact_dialog_new (DinoStreamInteractor* stream_interactor,
                                                              GeeList* accounts);
VALA_EXTERN DinoUiSelectContactDialog* dino_ui_select_contact_dialog_construct (GType object_type,
                                                                    DinoStreamInteractor* stream_interactor,
                                                                    GeeList* accounts);
static void __lambda218_ (DinoUiOccupantMenuView* self,
                   DinoEntitiesAccount* account,
                   XmppJid* jid);
static void ___lambda218__dino_ui_select_contact_dialog_selected (DinoUiSelectContactDialog* _sender,
                                                           DinoEntitiesAccount* account,
                                                           XmppJid* jid,
                                                           gpointer self);
static void dino_ui_occupant_menu_view_finalize (GObject * obj);
static GType dino_ui_occupant_menu_view_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_occupant_menu_view_get_instance_private (DinoUiOccupantMenuView* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiOccupantMenuView_private_offset);
}

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

static void
_dino_ui_occupant_menu_view_initialize_list_gtk_widget_show (GtkWidget* _sender,
                                                             gpointer self)
{
	dino_ui_occupant_menu_view_initialize_list ((DinoUiOccupantMenuView*) self);
}

static void
_dino_ui_occupant_menu_view_on_invite_clicked_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                          GtkListBoxRow* row,
                                                                          gpointer self)
{
	dino_ui_occupant_menu_view_on_invite_clicked ((DinoUiOccupantMenuView*) self);
}

static void
_dino_ui_occupant_menu_view_reset_gtk_widget_hide (GtkWidget* _sender,
                                                   gpointer self)
{
	dino_ui_occupant_menu_view_reset ((DinoUiOccupantMenuView*) self);
}

DinoUiOccupantMenuView*
dino_ui_occupant_menu_view_construct (GType object_type,
                                      DinoStreamInteractor* stream_interactor,
                                      DinoEntitiesConversation* conversation)
{
	DinoUiOccupantMenuView * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	GtkListBox* _tmp2_;
	const gchar* _tmp3_;
	DinoUiOccupantMenuListRow* _tmp4_;
	DinoUiOccupantMenuListRow* _tmp5_;
	GtkWidget* _tmp6_;
	GtkWidget* _tmp7_;
	GtkListBox* _tmp8_;
	GtkBox* _tmp9_;
	GtkListBox* _tmp10_;
	GtkListBox* _tmp11_;
	GtkStack* _tmp12_;
	GtkBox* _tmp13_;
	GtkStack* _tmp14_;
	GtkStack* _tmp15_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	self = (DinoUiOccupantMenuView*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->conversation);
	self->priv->conversation = _tmp1_;
	g_signal_connect_object ((GtkWidget*) self, "show", (GCallback) _dino_ui_occupant_menu_view_initialize_list_gtk_widget_show, self, 0);
	_tmp2_ = self->priv->invite_list;
	_tmp3_ = dino_gettext ("Invite");
	_tmp4_ = dino_ui_occupant_menu_list_row_new_label ("+", _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = dino_ui_occupant_menu_list_row_get_widget (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_list_box_append (_tmp2_, _tmp7_);
	_g_object_unref0 (_tmp7_);
	_g_object_unref0 (_tmp5_);
	_tmp8_ = self->priv->invite_list;
	gtk_widget_set_can_focus ((GtkWidget*) _tmp8_, FALSE);
	_tmp9_ = self->priv->list_box;
	_tmp10_ = self->priv->invite_list;
	gtk_box_append (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = self->priv->invite_list;
	g_signal_connect_object (_tmp11_, "row-activated", (GCallback) _dino_ui_occupant_menu_view_on_invite_clicked_gtk_list_box_row_activated, self, 0);
	_tmp12_ = self->priv->stack;
	_tmp13_ = self->priv->list_box;
	gtk_stack_add_named (_tmp12_, (GtkWidget*) _tmp13_, "list");
	_tmp14_ = self->priv->stack;
	gtk_popover_set_child ((GtkPopover*) self, (GtkWidget*) _tmp14_);
	_tmp15_ = self->priv->stack;
	gtk_stack_set_visible_child_name (_tmp15_, "list");
	g_signal_connect_object ((GtkWidget*) self, "hide", (GCallback) _dino_ui_occupant_menu_view_reset_gtk_widget_hide, self, 0);
	return self;
}

DinoUiOccupantMenuView*
dino_ui_occupant_menu_view_new (DinoStreamInteractor* stream_interactor,
                                DinoEntitiesConversation* conversation)
{
	return dino_ui_occupant_menu_view_construct (DINO_UI_OCCUPANT_MENU_TYPE_VIEW, stream_interactor, conversation);
}

void
dino_ui_occupant_menu_view_reset (DinoUiOccupantMenuView* self)
{
	GtkStack* _tmp0_;
	GtkStack* _tmp1_;
	DinoUiOccupantMenuList* _tmp2_;
	GtkListBox* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->stack;
	gtk_stack_set_transition_type (_tmp0_, GTK_STACK_TRANSITION_TYPE_NONE);
	_tmp1_ = self->priv->stack;
	gtk_stack_set_visible_child_name (_tmp1_, "list");
	_tmp2_ = self->priv->list;
	if (_tmp2_ != NULL) {
		DinoUiOccupantMenuList* _tmp3_;
		GtkListBox* _tmp4_;
		_tmp3_ = self->priv->list;
		_tmp4_ = _tmp3_->list_box;
		gtk_list_box_unselect_all (_tmp4_);
	}
	_tmp5_ = self->priv->invite_list;
	gtk_list_box_unselect_all (_tmp5_);
}

static void
___lambda215_ (DinoUiOccupantMenuView* self,
               GtkListBoxRow* row)
{
	DinoUiOccupantMenuListRow* row_wrapper = NULL;
	DinoUiOccupantMenuList* _tmp0_;
	GeeHashMap* _tmp1_;
	GtkWidget* _tmp2_;
	gpointer _tmp3_;
	XmppJid* _tmp4_;
	GtkLabel* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	g_return_if_fail (row != NULL);
	_tmp0_ = self->priv->list;
	_tmp1_ = _tmp0_->row_wrappers;
	_tmp2_ = gtk_list_box_row_get_child (row);
	_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, _tmp2_);
	row_wrapper = (DinoUiOccupantMenuListRow*) _tmp3_;
	_tmp4_ = row_wrapper->jid;
	_tmp5_ = row_wrapper->name_label;
	_tmp6_ = gtk_label_get_label (_tmp5_);
	_tmp7_ = _tmp6_;
	dino_ui_occupant_menu_view_show_menu (self, _tmp4_, _tmp7_);
	_g_object_unref0 (row_wrapper);
}

static void
____lambda215__gtk_list_box_row_activated (GtkListBox* _sender,
                                           GtkListBoxRow* row,
                                           gpointer self)
{
	___lambda215_ ((DinoUiOccupantMenuView*) self, row);
}

static void
dino_ui_occupant_menu_view_initialize_list (DinoUiOccupantMenuView* self)
{
	DinoUiOccupantMenuList* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list;
	if (_tmp0_ == NULL) {
		DinoStreamInteractor* _tmp1_;
		DinoEntitiesConversation* _tmp2_;
		DinoUiOccupantMenuList* _tmp3_;
		GtkBox* _tmp4_;
		DinoUiOccupantMenuList* _tmp5_;
		DinoUiOccupantMenuList* _tmp6_;
		GtkListBox* _tmp7_;
		_tmp1_ = self->priv->stream_interactor;
		_tmp2_ = self->priv->conversation;
		_tmp3_ = dino_ui_occupant_menu_list_new (_tmp1_, _tmp2_);
		g_object_ref_sink (_tmp3_);
		_g_object_unref0 (self->priv->list);
		self->priv->list = _tmp3_;
		_tmp4_ = self->priv->list_box;
		_tmp5_ = self->priv->list;
		gtk_box_prepend (_tmp4_, (GtkWidget*) _tmp5_);
		_tmp6_ = self->priv->list;
		_tmp7_ = _tmp6_->list_box;
		g_signal_connect_object (_tmp7_, "row-activated", (GCallback) ____lambda215__gtk_list_box_row_activated, self, 0);
	}
}

static void
dino_ui_occupant_menu_view_show_list (DinoUiOccupantMenuView* self)
{
	DinoUiOccupantMenuList* _tmp0_;
	GtkStack* _tmp3_;
	GtkStack* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list;
	if (_tmp0_ != NULL) {
		DinoUiOccupantMenuList* _tmp1_;
		GtkListBox* _tmp2_;
		_tmp1_ = self->priv->list;
		_tmp2_ = _tmp1_->list_box;
		gtk_list_box_unselect_all (_tmp2_);
	}
	_tmp3_ = self->priv->stack;
	gtk_stack_set_transition_type (_tmp3_, GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT);
	_tmp4_ = self->priv->stack;
	gtk_stack_set_visible_child_name (_tmp4_, "list");
}

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

static void
_dino_ui_occupant_menu_view_show_list_gtk_button_clicked (GtkButton* _sender,
                                                          gpointer self)
{
	dino_ui_occupant_menu_view_show_list ((DinoUiOccupantMenuView*) self);
}

static void
_dino_ui_occupant_menu_view_private_conversation_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                    gpointer self)
{
	dino_ui_occupant_menu_view_private_conversation_button_clicked ((DinoUiOccupantMenuView*) self);
}

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

static void
_dino_ui_occupant_menu_view_kick_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                    gpointer self)
{
	dino_ui_occupant_menu_view_kick_button_clicked ((DinoUiOccupantMenuView*) self);
}

static void
____lambda216_ (DinoUiOccupantMenuView* self)
{
	dino_ui_occupant_menu_view_voice_button_clicked (self, "participant");
}

static void
_____lambda216__gtk_button_clicked (GtkButton* _sender,
                                    gpointer self)
{
	____lambda216_ ((DinoUiOccupantMenuView*) self);
}

static void
_____lambda217_ (DinoUiOccupantMenuView* self)
{
	dino_ui_occupant_menu_view_voice_button_clicked (self, "visitor");
}

static void
______lambda217__gtk_button_clicked (GtkButton* _sender,
                                     gpointer self)
{
	_____lambda217_ ((DinoUiOccupantMenuView*) self);
}

static void
dino_ui_occupant_menu_view_show_menu (DinoUiOccupantMenuView* self,
                                      XmppJid* jid,
                                      const gchar* name_)
{
	XmppJid* _tmp0_;
	GtkStack* _tmp1_;
	gchar* name = NULL;
	gchar* _tmp2_;
	XmppJid* real_jid = NULL;
	DinoStreamInteractor* _tmp3_;
	DinoModuleIdentity* _tmp4_;
	gpointer _tmp5_;
	DinoMucManager* _tmp6_;
	DinoEntitiesConversation* _tmp7_;
	DinoEntitiesAccount* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	XmppJid* _tmp12_;
	GtkBox* header_box = NULL;
	GtkBox* _tmp25_;
	GtkBox* _tmp26_;
	GtkImage* _tmp27_;
	GtkImage* _tmp28_;
	GtkBox* _tmp29_;
	const gchar* _tmp30_;
	GtkLabel* _tmp31_ = NULL;
	GtkLabel* _tmp32_;
	GtkButton* header_button = NULL;
	GtkButton* _tmp33_ = NULL;
	GtkButton* _tmp34_;
	GtkBox* _tmp35_;
	GtkBox* outer_box = NULL;
	GtkBox* _tmp36_;
	GtkBox* _tmp37_;
	GtkButton* _tmp38_;
	GtkButton* _tmp39_;
	GtkButton* private_button = NULL;
	const gchar* _tmp40_;
	GtkButton* _tmp41_;
	GtkBox* _tmp42_;
	GtkButton* _tmp43_;
	GtkButton* _tmp44_;
	XmppJid* own_jid = NULL;
	DinoStreamInteractor* _tmp45_;
	DinoModuleIdentity* _tmp46_;
	gpointer _tmp47_;
	DinoMucManager* _tmp48_;
	DinoEntitiesConversation* _tmp49_;
	XmppJid* _tmp50_;
	XmppJid* _tmp51_;
	DinoEntitiesConversation* _tmp52_;
	DinoEntitiesAccount* _tmp53_;
	DinoEntitiesAccount* _tmp54_;
	XmppJid* _tmp55_;
	XmppJid* _tmp56_;
	XmppXepMucRole* role = NULL;
	DinoStreamInteractor* _tmp57_;
	DinoModuleIdentity* _tmp58_;
	gpointer _tmp59_;
	DinoMucManager* _tmp60_;
	XmppJid* _tmp61_;
	DinoEntitiesConversation* _tmp62_;
	DinoEntitiesAccount* _tmp63_;
	DinoEntitiesAccount* _tmp64_;
	XmppXepMucRole* _tmp65_;
	XmppXepMucRole* _tmp66_;
	gboolean _tmp67_ = FALSE;
	XmppXepMucRole* _tmp68_;
	XmppXepMucRole _tmp69_;
	gboolean _tmp82_ = FALSE;
	DinoStreamInteractor* _tmp83_;
	DinoModuleIdentity* _tmp84_;
	gpointer _tmp85_;
	DinoMucManager* _tmp86_;
	DinoEntitiesConversation* _tmp87_;
	DinoEntitiesAccount* _tmp88_;
	DinoEntitiesAccount* _tmp89_;
	DinoEntitiesConversation* _tmp90_;
	XmppJid* _tmp91_;
	XmppJid* _tmp92_;
	gboolean _tmp93_;
	GtkBox* _tmp130_;
	GtkStack* _tmp133_;
	GtkBox* _tmp134_;
	GtkStack* _tmp135_;
	GtkBox* _tmp136_;
	GtkBox* _tmp137_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (name_ != NULL);
	_tmp0_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (self->priv->selected_jid);
	self->priv->selected_jid = _tmp0_;
	_tmp1_ = self->priv->stack;
	gtk_stack_set_transition_type (_tmp1_, GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT);
	_tmp2_ = g_markup_escape_text (name_, (gssize) -1);
	name = _tmp2_;
	_tmp3_ = self->priv->stream_interactor;
	_tmp4_ = dino_muc_manager_IDENTITY;
	_tmp5_ = dino_stream_interactor_get_module (_tmp3_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
	_tmp6_ = (DinoMucManager*) _tmp5_;
	_tmp7_ = self->priv->conversation;
	_tmp8_ = dino_entities_conversation_get_account (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = dino_muc_manager_get_real_jid (_tmp6_, jid, _tmp9_);
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp6_);
	real_jid = _tmp11_;
	_tmp12_ = real_jid;
	if (_tmp12_ != NULL) {
		const gchar* _tmp13_;
		XmppJid* _tmp14_;
		XmppJid* _tmp15_;
		XmppJid* _tmp16_;
		XmppJid* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		_tmp13_ = name;
		_tmp14_ = real_jid;
		_tmp15_ = xmpp_jid_get_bare_jid (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = _tmp16_;
		_tmp18_ = xmpp_jid_to_string (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = g_markup_escape_text (_tmp19_, (gssize) -1);
		_tmp21_ = _tmp20_;
		_tmp22_ = g_strdup_printf ("\n<span font=\'8\'>%s</span>", _tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = g_strconcat (_tmp13_, _tmp23_, NULL);
		_g_free0 (name);
		name = _tmp24_;
		_g_free0 (_tmp23_);
		_g_free0 (_tmp21_);
		_g_free0 (_tmp19_);
		_xmpp_jid_unref0 (_tmp17_);
	}
	_tmp25_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
	g_object_ref_sink (_tmp25_);
	header_box = _tmp25_;
	_tmp26_ = header_box;
	_tmp27_ = (GtkImage*) gtk_image_new_from_icon_name ("pan-start-symbolic");
	g_object_ref_sink (_tmp27_);
	_tmp28_ = _tmp27_;
	gtk_box_append (_tmp26_, (GtkWidget*) _tmp28_);
	_g_object_unref0 (_tmp28_);
	_tmp29_ = header_box;
	_tmp30_ = name;
	_tmp31_ = (GtkLabel*) gtk_label_new (_tmp30_);
	gtk_label_set_xalign (_tmp31_, (gfloat) 0);
	gtk_label_set_use_markup (_tmp31_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp31_, TRUE);
	g_object_ref_sink (_tmp31_);
	_tmp32_ = _tmp31_;
	gtk_box_append (_tmp29_, (GtkWidget*) _tmp32_);
	_g_object_unref0 (_tmp32_);
	_tmp33_ = (GtkButton*) gtk_button_new ();
	gtk_button_set_has_frame (_tmp33_, FALSE);
	g_object_ref_sink (_tmp33_);
	header_button = _tmp33_;
	_tmp34_ = header_button;
	_tmp35_ = header_box;
	gtk_button_set_child (_tmp34_, (GtkWidget*) _tmp35_);
	_tmp36_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
	g_object_ref_sink (_tmp36_);
	outer_box = _tmp36_;
	_tmp37_ = outer_box;
	_tmp38_ = header_button;
	gtk_box_append (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = header_button;
	g_signal_connect_object (_tmp39_, "clicked", (GCallback) _dino_ui_occupant_menu_view_show_list_gtk_button_clicked, self, 0);
	_tmp40_ = dino_gettext ("Start private conversation");
	_tmp41_ = (GtkButton*) gtk_button_new_with_label (_tmp40_);
	g_object_ref_sink (_tmp41_);
	private_button = _tmp41_;
	_tmp42_ = outer_box;
	_tmp43_ = private_button;
	gtk_box_append (_tmp42_, (GtkWidget*) _tmp43_);
	_tmp44_ = private_button;
	g_signal_connect_object (_tmp44_, "clicked", (GCallback) _dino_ui_occupant_menu_view_private_conversation_button_clicked_gtk_button_clicked, self, 0);
	_tmp45_ = self->priv->stream_interactor;
	_tmp46_ = dino_muc_manager_IDENTITY;
	_tmp47_ = dino_stream_interactor_get_module (_tmp45_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp46_);
	_tmp48_ = (DinoMucManager*) _tmp47_;
	_tmp49_ = self->priv->conversation;
	_tmp50_ = dino_entities_conversation_get_counterpart (_tmp49_);
	_tmp51_ = _tmp50_;
	_tmp52_ = self->priv->conversation;
	_tmp53_ = dino_entities_conversation_get_account (_tmp52_);
	_tmp54_ = _tmp53_;
	_tmp55_ = dino_muc_manager_get_own_jid (_tmp48_, _tmp51_, _tmp54_);
	_tmp56_ = _tmp55_;
	_g_object_unref0 (_tmp48_);
	own_jid = _tmp56_;
	_tmp57_ = self->priv->stream_interactor;
	_tmp58_ = dino_muc_manager_IDENTITY;
	_tmp59_ = dino_stream_interactor_get_module (_tmp57_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp58_);
	_tmp60_ = (DinoMucManager*) _tmp59_;
	_tmp61_ = own_jid;
	_tmp62_ = self->priv->conversation;
	_tmp63_ = dino_entities_conversation_get_account (_tmp62_);
	_tmp64_ = _tmp63_;
	_tmp65_ = dino_muc_manager_get_role (_tmp60_, _tmp61_, _tmp64_);
	_tmp66_ = _tmp65_;
	_g_object_unref0 (_tmp60_);
	role = _tmp66_;
	_tmp68_ = role;
	_tmp69_ = XMPP_XEP_MUC_ROLE_MODERATOR;
	if (_xmpp_xep_muc_role_equal (_tmp68_, &_tmp69_) == TRUE) {
		DinoStreamInteractor* _tmp70_;
		DinoModuleIdentity* _tmp71_;
		gpointer _tmp72_;
		DinoMucManager* _tmp73_;
		DinoEntitiesConversation* _tmp74_;
		DinoEntitiesAccount* _tmp75_;
		DinoEntitiesAccount* _tmp76_;
		_tmp70_ = self->priv->stream_interactor;
		_tmp71_ = dino_muc_manager_IDENTITY;
		_tmp72_ = dino_stream_interactor_get_module (_tmp70_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp71_);
		_tmp73_ = (DinoMucManager*) _tmp72_;
		_tmp74_ = self->priv->conversation;
		_tmp75_ = dino_entities_conversation_get_account (_tmp74_);
		_tmp76_ = _tmp75_;
		_tmp67_ = dino_muc_manager_kick_possible (_tmp73_, _tmp76_, jid);
		_g_object_unref0 (_tmp73_);
	} else {
		_tmp67_ = FALSE;
	}
	if (_tmp67_) {
		GtkButton* kick_button = NULL;
		const gchar* _tmp77_;
		GtkButton* _tmp78_;
		GtkBox* _tmp79_;
		GtkButton* _tmp80_;
		GtkButton* _tmp81_;
		_tmp77_ = dino_gettext ("Kick");
		_tmp78_ = (GtkButton*) gtk_button_new_with_label (_tmp77_);
		g_object_ref_sink (_tmp78_);
		kick_button = _tmp78_;
		_tmp79_ = outer_box;
		_tmp80_ = kick_button;
		gtk_box_append (_tmp79_, (GtkWidget*) _tmp80_);
		_tmp81_ = kick_button;
		g_signal_connect_object (_tmp81_, "clicked", (GCallback) _dino_ui_occupant_menu_view_kick_button_clicked_gtk_button_clicked, self, 0);
		_g_object_unref0 (kick_button);
	}
	_tmp83_ = self->priv->stream_interactor;
	_tmp84_ = dino_muc_manager_IDENTITY;
	_tmp85_ = dino_stream_interactor_get_module (_tmp83_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp84_);
	_tmp86_ = (DinoMucManager*) _tmp85_;
	_tmp87_ = self->priv->conversation;
	_tmp88_ = dino_entities_conversation_get_account (_tmp87_);
	_tmp89_ = _tmp88_;
	_tmp90_ = self->priv->conversation;
	_tmp91_ = dino_entities_conversation_get_counterpart (_tmp90_);
	_tmp92_ = _tmp91_;
	_tmp93_ = dino_muc_manager_is_moderated_room (_tmp86_, _tmp89_, _tmp92_);
	_g_object_unref0 (_tmp86_);
	if (_tmp93_) {
		XmppXepMucRole* _tmp94_;
		XmppXepMucRole _tmp95_;
		_tmp94_ = role;
		_tmp95_ = XMPP_XEP_MUC_ROLE_MODERATOR;
		_tmp82_ = _xmpp_xep_muc_role_equal (_tmp94_, &_tmp95_) == TRUE;
	} else {
		_tmp82_ = FALSE;
	}
	if (_tmp82_) {
		DinoStreamInteractor* _tmp96_;
		DinoModuleIdentity* _tmp97_;
		gpointer _tmp98_;
		DinoMucManager* _tmp99_;
		XmppJid* _tmp100_;
		DinoEntitiesConversation* _tmp101_;
		DinoEntitiesAccount* _tmp102_;
		DinoEntitiesAccount* _tmp103_;
		XmppXepMucRole* _tmp104_;
		XmppXepMucRole* _tmp105_;
		XmppXepMucRole _tmp106_;
		gboolean _tmp107_;
		_tmp96_ = self->priv->stream_interactor;
		_tmp97_ = dino_muc_manager_IDENTITY;
		_tmp98_ = dino_stream_interactor_get_module (_tmp96_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp97_);
		_tmp99_ = (DinoMucManager*) _tmp98_;
		_tmp100_ = self->priv->selected_jid;
		_tmp101_ = self->priv->conversation;
		_tmp102_ = dino_entities_conversation_get_account (_tmp101_);
		_tmp103_ = _tmp102_;
		_tmp104_ = dino_muc_manager_get_role (_tmp99_, _tmp100_, _tmp103_);
		_tmp105_ = _tmp104_;
		_tmp106_ = XMPP_XEP_MUC_ROLE_VISITOR;
		_tmp107_ = _xmpp_xep_muc_role_equal (_tmp105_, &_tmp106_) == TRUE;
		_g_free0 (_tmp105_);
		_g_object_unref0 (_tmp99_);
		if (_tmp107_) {
			GtkButton* voice_button = NULL;
			const gchar* _tmp108_;
			GtkButton* _tmp109_;
			GtkBox* _tmp110_;
			GtkButton* _tmp111_;
			GtkButton* _tmp112_;
			_tmp108_ = dino_gettext ("Grant write permission");
			_tmp109_ = (GtkButton*) gtk_button_new_with_label (_tmp108_);
			g_object_ref_sink (_tmp109_);
			voice_button = _tmp109_;
			_tmp110_ = outer_box;
			_tmp111_ = voice_button;
			gtk_box_append (_tmp110_, (GtkWidget*) _tmp111_);
			_tmp112_ = voice_button;
			g_signal_connect_object (_tmp112_, "clicked", (GCallback) _____lambda216__gtk_button_clicked, self, 0);
			_g_object_unref0 (voice_button);
		} else {
			DinoStreamInteractor* _tmp113_;
			DinoModuleIdentity* _tmp114_;
			gpointer _tmp115_;
			DinoMucManager* _tmp116_;
			XmppJid* _tmp117_;
			DinoEntitiesConversation* _tmp118_;
			DinoEntitiesAccount* _tmp119_;
			DinoEntitiesAccount* _tmp120_;
			XmppXepMucRole* _tmp121_;
			XmppXepMucRole* _tmp122_;
			XmppXepMucRole _tmp123_;
			gboolean _tmp124_;
			_tmp113_ = self->priv->stream_interactor;
			_tmp114_ = dino_muc_manager_IDENTITY;
			_tmp115_ = dino_stream_interactor_get_module (_tmp113_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp114_);
			_tmp116_ = (DinoMucManager*) _tmp115_;
			_tmp117_ = self->priv->selected_jid;
			_tmp118_ = self->priv->conversation;
			_tmp119_ = dino_entities_conversation_get_account (_tmp118_);
			_tmp120_ = _tmp119_;
			_tmp121_ = dino_muc_manager_get_role (_tmp116_, _tmp117_, _tmp120_);
			_tmp122_ = _tmp121_;
			_tmp123_ = XMPP_XEP_MUC_ROLE_PARTICIPANT;
			_tmp124_ = _xmpp_xep_muc_role_equal (_tmp122_, &_tmp123_) == TRUE;
			_g_free0 (_tmp122_);
			_g_object_unref0 (_tmp116_);
			if (_tmp124_) {
				GtkButton* voice_button = NULL;
				const gchar* _tmp125_;
				GtkButton* _tmp126_;
				GtkBox* _tmp127_;
				GtkButton* _tmp128_;
				GtkButton* _tmp129_;
				_tmp125_ = dino_gettext ("Revoke write permission");
				_tmp126_ = (GtkButton*) gtk_button_new_with_label (_tmp125_);
				g_object_ref_sink (_tmp126_);
				voice_button = _tmp126_;
				_tmp127_ = outer_box;
				_tmp128_ = voice_button;
				gtk_box_append (_tmp127_, (GtkWidget*) _tmp128_);
				_tmp129_ = voice_button;
				g_signal_connect_object (_tmp129_, "clicked", (GCallback) ______lambda217__gtk_button_clicked, self, 0);
				_g_object_unref0 (voice_button);
			}
		}
	}
	_tmp130_ = self->priv->jid_menu;
	if (_tmp130_ != NULL) {
		GtkStack* _tmp131_;
		GtkBox* _tmp132_;
		_tmp131_ = self->priv->stack;
		_tmp132_ = self->priv->jid_menu;
		gtk_stack_remove (_tmp131_, (GtkWidget*) _tmp132_);
	}
	_tmp133_ = self->priv->stack;
	_tmp134_ = outer_box;
	gtk_stack_add_named (_tmp133_, (GtkWidget*) _tmp134_, "menu");
	_tmp135_ = self->priv->stack;
	gtk_stack_set_visible_child_name (_tmp135_, "menu");
	_tmp136_ = outer_box;
	_tmp137_ = _g_object_ref0 (_tmp136_);
	_g_object_unref0 (self->priv->jid_menu);
	self->priv->jid_menu = _tmp137_;
	_g_free0 (role);
	_xmpp_jid_unref0 (own_jid);
	_g_object_unref0 (private_button);
	_g_object_unref0 (outer_box);
	_g_object_unref0 (header_button);
	_g_object_unref0 (header_box);
	_xmpp_jid_unref0 (real_jid);
	_g_free0 (name);
}

static void
dino_ui_occupant_menu_view_private_conversation_button_clicked (DinoUiOccupantMenuView* self)
{
	XmppJid* _tmp0_;
	DinoEntitiesConversation* conversation = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoConversationManager* _tmp4_;
	XmppJid* _tmp5_;
	DinoEntitiesConversation* _tmp6_;
	DinoEntitiesAccount* _tmp7_;
	DinoEntitiesAccount* _tmp8_;
	DinoEntitiesConversationType _tmp9_;
	DinoEntitiesConversation* _tmp10_;
	DinoEntitiesConversation* _tmp11_;
	DinoStreamInteractor* _tmp12_;
	DinoModuleIdentity* _tmp13_;
	gpointer _tmp14_;
	DinoConversationManager* _tmp15_;
	DinoEntitiesConversation* _tmp16_;
	DinoUiApplication* app = NULL;
	GApplication* _tmp17_;
	DinoUiApplication* _tmp18_;
	DinoUiApplication* _tmp19_;
	DinoUiMainWindowController* _tmp20_;
	DinoEntitiesConversation* _tmp21_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->selected_jid;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->stream_interactor;
	_tmp2_ = dino_conversation_manager_IDENTITY;
	_tmp3_ = dino_stream_interactor_get_module (_tmp1_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (DinoConversationManager*) _tmp3_;
	_tmp5_ = self->priv->selected_jid;
	_tmp6_ = self->priv->conversation;
	_tmp7_ = dino_entities_conversation_get_account (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT_PM;
	_tmp10_ = dino_conversation_manager_create_conversation (_tmp4_, _tmp5_, _tmp8_, &_tmp9_);
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp4_);
	conversation = _tmp11_;
	_tmp12_ = self->priv->stream_interactor;
	_tmp13_ = dino_conversation_manager_IDENTITY;
	_tmp14_ = dino_stream_interactor_get_module (_tmp12_, DINO_TYPE_CONVERSATION_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp13_);
	_tmp15_ = (DinoConversationManager*) _tmp14_;
	_tmp16_ = conversation;
	dino_conversation_manager_start_conversation (_tmp15_, _tmp16_);
	_g_object_unref0 (_tmp15_);
	_tmp17_ = g_application_get_default ();
	_tmp18_ = _g_object_ref0 (DINO_UI_IS_APPLICATION (_tmp17_) ? ((DinoUiApplication*) _tmp17_) : NULL);
	app = _tmp18_;
	_tmp19_ = app;
	_tmp20_ = _tmp19_->controller;
	_tmp21_ = conversation;
	dino_ui_main_window_controller_select_conversation (_tmp20_, _tmp21_, TRUE, TRUE);
	_g_object_unref0 (app);
	_g_object_unref0 (conversation);
}

static void
dino_ui_occupant_menu_view_kick_button_clicked (DinoUiOccupantMenuView* self)
{
	XmppJid* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoMucManager* _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	DinoEntitiesAccount* _tmp6_;
	DinoEntitiesAccount* _tmp7_;
	DinoEntitiesConversation* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	const gchar* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->selected_jid;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->stream_interactor;
	_tmp2_ = dino_muc_manager_IDENTITY;
	_tmp3_ = dino_stream_interactor_get_module (_tmp1_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (DinoMucManager*) _tmp3_;
	_tmp5_ = self->priv->conversation;
	_tmp6_ = dino_entities_conversation_get_account (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = self->priv->conversation;
	_tmp9_ = dino_entities_conversation_get_counterpart (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = self->priv->selected_jid;
	_tmp12_ = _tmp11_->resourcepart;
	dino_muc_manager_kick (_tmp4_, _tmp7_, _tmp10_, _tmp12_);
	_g_object_unref0 (_tmp4_);
}

static void
dino_ui_occupant_menu_view_voice_button_clicked (DinoUiOccupantMenuView* self,
                                                 const gchar* role)
{
	XmppJid* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoModuleIdentity* _tmp2_;
	gpointer _tmp3_;
	DinoMucManager* _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	DinoEntitiesAccount* _tmp6_;
	DinoEntitiesAccount* _tmp7_;
	DinoEntitiesConversation* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	XmppJid* _tmp11_;
	const gchar* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (role != NULL);
	_tmp0_ = self->priv->selected_jid;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->stream_interactor;
	_tmp2_ = dino_muc_manager_IDENTITY;
	_tmp3_ = dino_stream_interactor_get_module (_tmp1_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
	_tmp4_ = (DinoMucManager*) _tmp3_;
	_tmp5_ = self->priv->conversation;
	_tmp6_ = dino_entities_conversation_get_account (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = self->priv->conversation;
	_tmp9_ = dino_entities_conversation_get_counterpart (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = self->priv->selected_jid;
	_tmp12_ = _tmp11_->resourcepart;
	dino_muc_manager_change_role (_tmp4_, _tmp7_, _tmp10_, _tmp12_, role);
	_g_object_unref0 (_tmp4_);
}

static gboolean
_dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                        gconstpointer b,
                                                        gpointer self)
{
	gboolean result;
	result = dino_entities_account_equals_func ((DinoEntitiesAccount*) a, (DinoEntitiesAccount*) b);
	return result;
}

static void
__lambda218_ (DinoUiOccupantMenuView* self,
              DinoEntitiesAccount* account,
              XmppJid* jid)
{
	DinoStreamInteractor* _tmp0_;
	DinoModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	DinoMucManager* _tmp3_;
	DinoEntitiesConversation* _tmp4_;
	DinoEntitiesAccount* _tmp5_;
	DinoEntitiesAccount* _tmp6_;
	DinoEntitiesConversation* _tmp7_;
	XmppJid* _tmp8_;
	XmppJid* _tmp9_;
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp0_ = self->priv->stream_interactor;
	_tmp1_ = dino_muc_manager_IDENTITY;
	_tmp2_ = dino_stream_interactor_get_module (_tmp0_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
	_tmp3_ = (DinoMucManager*) _tmp2_;
	_tmp4_ = self->priv->conversation;
	_tmp5_ = dino_entities_conversation_get_account (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->conversation;
	_tmp8_ = dino_entities_conversation_get_counterpart (_tmp7_);
	_tmp9_ = _tmp8_;
	dino_muc_manager_invite (_tmp3_, _tmp6_, _tmp9_, jid);
	_g_object_unref0 (_tmp3_);
}

static void
___lambda218__dino_ui_select_contact_dialog_selected (DinoUiSelectContactDialog* _sender,
                                                      DinoEntitiesAccount* account,
                                                      XmppJid* jid,
                                                      gpointer self)
{
	__lambda218_ ((DinoUiOccupantMenuView*) self, account, jid);
}

static void
dino_ui_occupant_menu_view_on_invite_clicked (DinoUiOccupantMenuView* self)
{
	GeeList* acc_list = NULL;
	GeeArrayList* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	DinoUiSelectContactDialog* add_chat_dialog = NULL;
	DinoStreamInteractor* _tmp4_;
	DinoUiSelectContactDialog* _tmp5_;
	GtkRoot* _tmp6_;
	const gchar* _tmp7_;
	GtkButton* _tmp8_;
	const gchar* _tmp9_;
	g_return_if_fail (self != NULL);
	gtk_widget_hide ((GtkWidget*) self);
	_tmp0_ = gee_array_list_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL);
	acc_list = (GeeList*) _tmp0_;
	_tmp1_ = self->priv->conversation;
	_tmp2_ = dino_entities_conversation_get_account (_tmp1_);
	_tmp3_ = _tmp2_;
	gee_collection_add ((GeeCollection*) acc_list, _tmp3_);
	_tmp4_ = self->priv->stream_interactor;
	_tmp5_ = dino_ui_select_contact_dialog_new (_tmp4_, acc_list);
	g_object_ref_sink (_tmp5_);
	add_chat_dialog = _tmp5_;
	_tmp6_ = gtk_widget_get_root ((GtkWidget*) self);
	gtk_window_set_transient_for ((GtkWindow*) add_chat_dialog, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_window_get_type (), GtkWindow));
	_tmp7_ = dino_gettext ("Invite to Conference");
	gtk_window_set_title ((GtkWindow*) add_chat_dialog, _tmp7_);
	_tmp8_ = add_chat_dialog->ok_button;
	_tmp9_ = dino_gettext ("Invite");
	gtk_button_set_label (_tmp8_, _tmp9_);
	g_signal_connect_object (add_chat_dialog, "selected", (GCallback) ___lambda218__dino_ui_select_contact_dialog_selected, self, 0);
	gtk_window_present ((GtkWindow*) add_chat_dialog);
	_g_object_unref0 (add_chat_dialog);
	_g_object_unref0 (acc_list);
}

static void
dino_ui_occupant_menu_view_class_init (DinoUiOccupantMenuViewClass * klass,
                                       gpointer klass_data)
{
	dino_ui_occupant_menu_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiOccupantMenuView_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_occupant_menu_view_finalize;
}

static void
dino_ui_occupant_menu_view_instance_init (DinoUiOccupantMenuView * self,
                                          gpointer klass)
{
	GtkStack* _tmp0_ = NULL;
	GtkBox* _tmp1_;
	GtkListBox* _tmp2_;
	self->priv = dino_ui_occupant_menu_view_get_instance_private (self);
	_tmp0_ = (GtkStack*) gtk_stack_new ();
	gtk_stack_set_vhomogeneous (_tmp0_, FALSE);
	g_object_ref_sink (_tmp0_);
	self->priv->stack = _tmp0_;
	_tmp1_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
	g_object_ref_sink (_tmp1_);
	self->priv->list_box = _tmp1_;
	self->priv->list = NULL;
	_tmp2_ = (GtkListBox*) gtk_list_box_new ();
	g_object_ref_sink (_tmp2_);
	self->priv->invite_list = _tmp2_;
	self->priv->jid_menu = NULL;
}

static void
dino_ui_occupant_menu_view_finalize (GObject * obj)
{
	DinoUiOccupantMenuView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_OCCUPANT_MENU_TYPE_VIEW, DinoUiOccupantMenuView);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->conversation);
	_g_object_unref0 (self->priv->stack);
	_g_object_unref0 (self->priv->list_box);
	_g_object_unref0 (self->priv->list);
	_g_object_unref0 (self->priv->invite_list);
	_g_object_unref0 (self->priv->jid_menu);
	_xmpp_jid_unref0 (self->priv->selected_jid);
	G_OBJECT_CLASS (dino_ui_occupant_menu_view_parent_class)->finalize (obj);
}

static GType
dino_ui_occupant_menu_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiOccupantMenuViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_occupant_menu_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiOccupantMenuView), 0, (GInstanceInitFunc) dino_ui_occupant_menu_view_instance_init, NULL };
	GType dino_ui_occupant_menu_view_type_id;
	dino_ui_occupant_menu_view_type_id = g_type_register_static (gtk_popover_get_type (), "DinoUiOccupantMenuView", &g_define_type_info, 0);
	DinoUiOccupantMenuView_private_offset = g_type_add_instance_private (dino_ui_occupant_menu_view_type_id, sizeof (DinoUiOccupantMenuViewPrivate));
	return dino_ui_occupant_menu_view_type_id;
}

GType
dino_ui_occupant_menu_view_get_type (void)
{
	static volatile gsize dino_ui_occupant_menu_view_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_occupant_menu_view_type_id__once)) {
		GType dino_ui_occupant_menu_view_type_id;
		dino_ui_occupant_menu_view_type_id = dino_ui_occupant_menu_view_get_type_once ();
		g_once_init_leave (&dino_ui_occupant_menu_view_type_id__once, dino_ui_occupant_menu_view_type_id);
	}
	return dino_ui_occupant_menu_view_type_id__once;
}

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

