/* hev-gabble-monitor.c generated by valac 0.17.6, the Vala compiler
 * generated from hev-gabble-monitor.vala, do not modify */

/* hev-gabble-monitor.vala
 * Heiher <admin@heiher.info>
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <telepathy-glib/telepathy-glib.h>
#include <glib-unix.h>
#include <signal.h>


#define HEV_GABBLE_TYPE_FUTURE (hev_gabble_future_get_type ())
#define HEV_GABBLE_FUTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HEV_GABBLE_TYPE_FUTURE, HevGabbleFuture))
#define HEV_GABBLE_IS_FUTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HEV_GABBLE_TYPE_FUTURE))
#define HEV_GABBLE_FUTURE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), HEV_GABBLE_TYPE_FUTURE, HevGabbleFutureIface))

typedef struct _HevGabbleFuture HevGabbleFuture;
typedef struct _HevGabbleFutureIface HevGabbleFutureIface;

#define HEV_GABBLE_TYPE_FUTURE_PROXY (hev_gabble_future_proxy_get_type ())
typedef GDBusProxy HevGabbleFutureProxy;
typedef GDBusProxyClass HevGabbleFutureProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

#define HEV_GABBLE_TYPE_CONSOLE (hev_gabble_console_get_type ())
#define HEV_GABBLE_CONSOLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HEV_GABBLE_TYPE_CONSOLE, HevGabbleConsole))
#define HEV_GABBLE_IS_CONSOLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HEV_GABBLE_TYPE_CONSOLE))
#define HEV_GABBLE_CONSOLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), HEV_GABBLE_TYPE_CONSOLE, HevGabbleConsoleIface))

typedef struct _HevGabbleConsole HevGabbleConsole;
typedef struct _HevGabbleConsoleIface HevGabbleConsoleIface;

#define HEV_GABBLE_TYPE_CONSOLE_PROXY (hev_gabble_console_proxy_get_type ())
typedef GDBusProxy HevGabbleConsoleProxy;
typedef GDBusProxyClass HevGabbleConsoleProxyClass;

#define HEV_GABBLE_TYPE_MONITOR (hev_gabble_monitor_get_type ())
#define HEV_GABBLE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HEV_GABBLE_TYPE_MONITOR, HevGabbleMonitor))
#define HEV_GABBLE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HEV_GABBLE_TYPE_MONITOR, HevGabbleMonitorClass))
#define HEV_GABBLE_IS_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HEV_GABBLE_TYPE_MONITOR))
#define HEV_GABBLE_IS_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HEV_GABBLE_TYPE_MONITOR))
#define HEV_GABBLE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HEV_GABBLE_TYPE_MONITOR, HevGabbleMonitorClass))

typedef struct _HevGabbleMonitor HevGabbleMonitor;
typedef struct _HevGabbleMonitorClass HevGabbleMonitorClass;
typedef struct _HevGabbleMonitorPrivate HevGabbleMonitorPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define HEV_GABBLE_TYPE_MANAGER (hev_gabble_manager_get_type ())
#define HEV_GABBLE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HEV_GABBLE_TYPE_MANAGER, HevGabbleManager))
#define HEV_GABBLE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HEV_GABBLE_TYPE_MANAGER, HevGabbleManagerClass))
#define HEV_GABBLE_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HEV_GABBLE_TYPE_MANAGER))
#define HEV_GABBLE_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HEV_GABBLE_TYPE_MANAGER))
#define HEV_GABBLE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HEV_GABBLE_TYPE_MANAGER, HevGabbleManagerClass))

typedef struct _HevGabbleManager HevGabbleManager;
typedef struct _HevGabbleManagerClass HevGabbleManagerClass;
typedef struct _HevGabbleManagerPrivate HevGabbleManagerPrivate;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
#define __g_slist_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_object_unref0_ (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _Block2Data Block2Data;

struct _HevGabbleFutureIface {
	GTypeInterface parent_iface;
	void (*ensure_sidecar) (HevGabbleFuture* self, const gchar* iface, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*ensure_sidecar_finish) (HevGabbleFuture* self, GAsyncResult* _res_, char** path, GHashTable** props, GError** error);
};

struct _HevGabbleConsoleIface {
	GTypeInterface parent_iface;
	void (*send_i_q) (HevGabbleConsole* self, const gchar* to, const gchar* body, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*send_i_q_finish) (HevGabbleConsole* self, GAsyncResult* _res_, gchar** reply_type, gchar** out_body, GError** error);
	void (*send_stanza) (HevGabbleConsole* self, const gchar* stanza, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*send_stanza_finish) (HevGabbleConsole* self, GAsyncResult* _res_, GError** error);
	gboolean (*get_spew_stanzas) (HevGabbleConsole* self);
	void (*set_spew_stanzas) (HevGabbleConsole* self, gboolean value);
};

struct _HevGabbleMonitor {
	GObject parent_instance;
	HevGabbleMonitorPrivate * priv;
};

struct _HevGabbleMonitorClass {
	GObjectClass parent_class;
};

struct _HevGabbleMonitorPrivate {
	HevGabbleConsole* console;
};

struct _Block1Data {
	int _ref_count_;
	HevGabbleMonitor * self;
	GAsyncReadyCallback ensure_sidecar_handler;
	gpointer ensure_sidecar_handler_target;
	GDestroyNotify ensure_sidecar_handler_target_destroy_notify;
	TpConnection* conn;
};

struct _HevGabbleManager {
	GObject parent_instance;
	HevGabbleManagerPrivate * priv;
};

struct _HevGabbleManagerClass {
	GObjectClass parent_class;
};

struct _HevGabbleManagerPrivate {
	GMainLoop* main_loop;
	TpAccountManager* am;
	GSList* monitors;
};

struct _Block2Data {
	int _ref_count_;
	HevGabbleManager* manager;
};


static gpointer hev_gabble_monitor_parent_class = NULL;
static gpointer hev_gabble_manager_parent_class = NULL;

#define HEV_GABBLE_CONSOLE_IFACE "org.freedesktop.Telepathy.Gabble.Plugin.Console"
GType hev_gabble_future_proxy_get_type (void) G_GNUC_CONST;
guint hev_gabble_future_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType hev_gabble_future_get_type (void) G_GNUC_CONST;
void hev_gabble_future_ensure_sidecar (HevGabbleFuture* self, const gchar* iface, GAsyncReadyCallback _callback_, gpointer _user_data_);
void hev_gabble_future_ensure_sidecar_finish (HevGabbleFuture* self, GAsyncResult* _res_, char** path, GHashTable** props, GError** error);
static void hev_gabble_future_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data);
static void hev_gabble_future_proxy_ensure_sidecar_async (HevGabbleFuture* self, const gchar* iface, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void hev_gabble_future_proxy_ensure_sidecar_finish (HevGabbleFuture* self, GAsyncResult* _res_, char** path, GHashTable** props, GError** error);
static void hev_gabble_future_proxy_hev_gabble_future_interface_init (HevGabbleFutureIface* iface);
static void _dbus_hev_gabble_future_ensure_sidecar (HevGabbleFuture* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_hev_gabble_future_ensure_sidecar_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void hev_gabble_future_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
static GVariant* hev_gabble_future_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
static gboolean hev_gabble_future_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
static void _hev_gabble_future_unregister_object (gpointer user_data);
GType hev_gabble_console_proxy_get_type (void) G_GNUC_CONST;
guint hev_gabble_console_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType hev_gabble_console_get_type (void) G_GNUC_CONST;
void hev_gabble_console_send_i_q (HevGabbleConsole* self, const gchar* to, const gchar* body, GAsyncReadyCallback _callback_, gpointer _user_data_);
void hev_gabble_console_send_i_q_finish (HevGabbleConsole* self, GAsyncResult* _res_, gchar** reply_type, gchar** out_body, GError** error);
void hev_gabble_console_send_stanza (HevGabbleConsole* self, const gchar* stanza, GAsyncReadyCallback _callback_, gpointer _user_data_);
void hev_gabble_console_send_stanza_finish (HevGabbleConsole* self, GAsyncResult* _res_, GError** error);
gboolean hev_gabble_console_get_spew_stanzas (HevGabbleConsole* self);
void hev_gabble_console_set_spew_stanzas (HevGabbleConsole* self, gboolean value);
static void hev_gabble_console_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters);
static void _dbus_handle_hev_gabble_console_stanza_sent (HevGabbleConsole* self, GVariant* parameters);
static void _dbus_handle_hev_gabble_console_stanza_received (HevGabbleConsole* self, GVariant* parameters);
static void hev_gabble_console_proxy_send_i_q_async (HevGabbleConsole* self, const gchar* to, const gchar* body, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void hev_gabble_console_proxy_send_i_q_finish (HevGabbleConsole* self, GAsyncResult* _res_, gchar** reply_type, gchar** out_body, GError** error);
static void hev_gabble_console_proxy_send_stanza_async (HevGabbleConsole* self, const gchar* stanza, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void hev_gabble_console_proxy_send_stanza_finish (HevGabbleConsole* self, GAsyncResult* _res_, GError** error);
static gboolean hev_gabble_console_dbus_proxy_get_spew_stanzas (HevGabbleConsole* self);
static void hev_gabble_console_dbus_proxy_set_spew_stanzas (HevGabbleConsole* self, gboolean value);
static void hev_gabble_console_proxy_hev_gabble_console_interface_init (HevGabbleConsoleIface* iface);
static void _dbus_hev_gabble_console_send_i_q (HevGabbleConsole* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_hev_gabble_console_send_i_q_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void _dbus_hev_gabble_console_send_stanza (HevGabbleConsole* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_hev_gabble_console_send_stanza_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
static void hev_gabble_console_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
static GVariant* hev_gabble_console_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
static GVariant* _dbus_hev_gabble_console_get_spew_stanzas (HevGabbleConsole* self);
static gboolean hev_gabble_console_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
static void _dbus_hev_gabble_console_set_spew_stanzas (HevGabbleConsole* self, GVariant* _value);
static void _dbus_hev_gabble_console_stanza_sent (GObject* _sender, const gchar* stanza, gpointer* _data);
static void _dbus_hev_gabble_console_stanza_received (GObject* _sender, const gchar* stanza, gpointer* _data);
static void _hev_gabble_console_unregister_object (gpointer user_data);
GType hev_gabble_monitor_get_type (void) G_GNUC_CONST;
#define HEV_GABBLE_MONITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HEV_GABBLE_TYPE_MONITOR, HevGabbleMonitorPrivate))
enum  {
	HEV_GABBLE_MONITOR_DUMMY_PROPERTY
};
HevGabbleMonitor* hev_gabble_monitor_new (TpConnection* conn);
HevGabbleMonitor* hev_gabble_monitor_construct (GType object_type, TpConnection* conn);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda2_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
static void ___lambda3_ (HevGabbleMonitor* self, GObject* obj, GAsyncResult* res);
static void ___lambda4_ (HevGabbleMonitor* self, const gchar* s);
static void ____lambda4__hev_gabble_console_stanza_sent (HevGabbleConsole* _sender, const gchar* stanza, gpointer self);
static void ___lambda5_ (HevGabbleMonitor* self, const gchar* s);
static void ____lambda5__hev_gabble_console_stanza_received (HevGabbleConsole* _sender, const gchar* stanza, gpointer self);
static void ____lambda3__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void ___lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void __lambda6_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
static void ___lambda6__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void hev_gabble_monitor_finalize (GObject* obj);
GType hev_gabble_manager_get_type (void) G_GNUC_CONST;
#define HEV_GABBLE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HEV_GABBLE_TYPE_MANAGER, HevGabbleManagerPrivate))
enum  {
	HEV_GABBLE_MANAGER_DUMMY_PROPERTY
};
static void _g_object_unref0_ (gpointer var);
static void _g_slist_free__g_object_unref0_ (GSList* self);
HevGabbleManager* hev_gabble_manager_new (void);
HevGabbleManager* hev_gabble_manager_construct (GType object_type);
static void __lambda7_ (HevGabbleManager* self, GObject* obj, GAsyncResult* res);
static void hev_gabble_manager_enumerate (HevGabbleManager* self);
static void ___lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
void hev_gabble_manager_run (HevGabbleManager* self);
void hev_gabble_manager_quit (HevGabbleManager* self);
gint hev_gabble_manager_main (gchar** args, int args_length1);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static gboolean __lambda8_ (Block2Data* _data2_);
static gboolean ___lambda8__gsource_func (gpointer self);
static void hev_gabble_manager_finalize (GObject* obj);

static const GDBusArgInfo _hev_gabble_future_dbus_arg_info_ensure_sidecar_iface = {-1, "iface", "s"};
static const GDBusArgInfo _hev_gabble_future_dbus_arg_info_ensure_sidecar_path = {-1, "path", "o"};
static const GDBusArgInfo _hev_gabble_future_dbus_arg_info_ensure_sidecar_props = {-1, "props", "a{sv}"};
static const GDBusArgInfo * const _hev_gabble_future_dbus_arg_info_ensure_sidecar_in[] = {&_hev_gabble_future_dbus_arg_info_ensure_sidecar_iface, NULL};
static const GDBusArgInfo * const _hev_gabble_future_dbus_arg_info_ensure_sidecar_out[] = {&_hev_gabble_future_dbus_arg_info_ensure_sidecar_path, &_hev_gabble_future_dbus_arg_info_ensure_sidecar_props, NULL};
static const GDBusMethodInfo _hev_gabble_future_dbus_method_info_ensure_sidecar = {-1, "EnsureSidecar", (GDBusArgInfo **) (&_hev_gabble_future_dbus_arg_info_ensure_sidecar_in), (GDBusArgInfo **) (&_hev_gabble_future_dbus_arg_info_ensure_sidecar_out)};
static const GDBusMethodInfo * const _hev_gabble_future_dbus_method_info[] = {&_hev_gabble_future_dbus_method_info_ensure_sidecar, NULL};
static const GDBusSignalInfo * const _hev_gabble_future_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _hev_gabble_future_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _hev_gabble_future_dbus_interface_info = {-1, "org.freedesktop.Telepathy.Connection.FUTURE", (GDBusMethodInfo **) (&_hev_gabble_future_dbus_method_info), (GDBusSignalInfo **) (&_hev_gabble_future_dbus_signal_info), (GDBusPropertyInfo **) (&_hev_gabble_future_dbus_property_info)};
static const GDBusInterfaceVTable _hev_gabble_future_dbus_interface_vtable = {hev_gabble_future_dbus_interface_method_call, hev_gabble_future_dbus_interface_get_property, hev_gabble_future_dbus_interface_set_property};
static const GDBusArgInfo _hev_gabble_console_dbus_arg_info_send_i_q_to = {-1, "to", "s"};
static const GDBusArgInfo _hev_gabble_console_dbus_arg_info_send_i_q_body = {-1, "body", "s"};
static const GDBusArgInfo _hev_gabble_console_dbus_arg_info_send_i_q_reply_type = {-1, "reply_type", "s"};
static const GDBusArgInfo _hev_gabble_console_dbus_arg_info_send_i_q_out_body = {-1, "out_body", "s"};
static const GDBusArgInfo * const _hev_gabble_console_dbus_arg_info_send_i_q_in[] = {&_hev_gabble_console_dbus_arg_info_send_i_q_to, &_hev_gabble_console_dbus_arg_info_send_i_q_body, NULL};
static const GDBusArgInfo * const _hev_gabble_console_dbus_arg_info_send_i_q_out[] = {&_hev_gabble_console_dbus_arg_info_send_i_q_reply_type, &_hev_gabble_console_dbus_arg_info_send_i_q_out_body, NULL};
static const GDBusMethodInfo _hev_gabble_console_dbus_method_info_send_i_q = {-1, "SendIQ", (GDBusArgInfo **) (&_hev_gabble_console_dbus_arg_info_send_i_q_in), (GDBusArgInfo **) (&_hev_gabble_console_dbus_arg_info_send_i_q_out)};
static const GDBusArgInfo _hev_gabble_console_dbus_arg_info_send_stanza_stanza = {-1, "stanza", "s"};
static const GDBusArgInfo * const _hev_gabble_console_dbus_arg_info_send_stanza_in[] = {&_hev_gabble_console_dbus_arg_info_send_stanza_stanza, NULL};
static const GDBusArgInfo * const _hev_gabble_console_dbus_arg_info_send_stanza_out[] = {NULL};
static const GDBusMethodInfo _hev_gabble_console_dbus_method_info_send_stanza = {-1, "SendStanza", (GDBusArgInfo **) (&_hev_gabble_console_dbus_arg_info_send_stanza_in), (GDBusArgInfo **) (&_hev_gabble_console_dbus_arg_info_send_stanza_out)};
static const GDBusMethodInfo * const _hev_gabble_console_dbus_method_info[] = {&_hev_gabble_console_dbus_method_info_send_i_q, &_hev_gabble_console_dbus_method_info_send_stanza, NULL};
static const GDBusArgInfo _hev_gabble_console_dbus_arg_info_stanza_sent_stanza = {-1, "stanza", "s"};
static const GDBusArgInfo * const _hev_gabble_console_dbus_arg_info_stanza_sent[] = {&_hev_gabble_console_dbus_arg_info_stanza_sent_stanza, NULL};
static const GDBusSignalInfo _hev_gabble_console_dbus_signal_info_stanza_sent = {-1, "StanzaSent", (GDBusArgInfo **) (&_hev_gabble_console_dbus_arg_info_stanza_sent)};
static const GDBusArgInfo _hev_gabble_console_dbus_arg_info_stanza_received_stanza = {-1, "stanza", "s"};
static const GDBusArgInfo * const _hev_gabble_console_dbus_arg_info_stanza_received[] = {&_hev_gabble_console_dbus_arg_info_stanza_received_stanza, NULL};
static const GDBusSignalInfo _hev_gabble_console_dbus_signal_info_stanza_received = {-1, "StanzaReceived", (GDBusArgInfo **) (&_hev_gabble_console_dbus_arg_info_stanza_received)};
static const GDBusSignalInfo * const _hev_gabble_console_dbus_signal_info[] = {&_hev_gabble_console_dbus_signal_info_stanza_sent, &_hev_gabble_console_dbus_signal_info_stanza_received, NULL};
static const GDBusPropertyInfo _hev_gabble_console_dbus_property_info_spew_stanzas = {-1, "SpewStanzas", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE};
static const GDBusPropertyInfo * const _hev_gabble_console_dbus_property_info[] = {&_hev_gabble_console_dbus_property_info_spew_stanzas, NULL};
static const GDBusInterfaceInfo _hev_gabble_console_dbus_interface_info = {-1, "org.freedesktop.Telepathy.Gabble.Plugin.Console", (GDBusMethodInfo **) (&_hev_gabble_console_dbus_method_info), (GDBusSignalInfo **) (&_hev_gabble_console_dbus_signal_info), (GDBusPropertyInfo **) (&_hev_gabble_console_dbus_property_info)};
static const GDBusInterfaceVTable _hev_gabble_console_dbus_interface_vtable = {hev_gabble_console_dbus_interface_method_call, hev_gabble_console_dbus_interface_get_property, hev_gabble_console_dbus_interface_set_property};

void hev_gabble_future_ensure_sidecar (HevGabbleFuture* self, const gchar* iface, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HEV_GABBLE_FUTURE_GET_INTERFACE (self)->ensure_sidecar (self, iface, _callback_, _user_data_);
}


void hev_gabble_future_ensure_sidecar_finish (HevGabbleFuture* self, GAsyncResult* _res_, char** path, GHashTable** props, GError** error) {
	HEV_GABBLE_FUTURE_GET_INTERFACE (self)->ensure_sidecar_finish (self, _res_, path, props, error);
}


static void hev_gabble_future_base_init (HevGabbleFutureIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
	}
}


GType hev_gabble_future_get_type (void) {
	static volatile gsize hev_gabble_future_type_id__volatile = 0;
	if (g_once_init_enter (&hev_gabble_future_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (HevGabbleFutureIface), (GBaseInitFunc) hev_gabble_future_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType hev_gabble_future_type_id;
		hev_gabble_future_type_id = g_type_register_static (G_TYPE_INTERFACE, "HevGabbleFuture", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (hev_gabble_future_type_id, G_TYPE_OBJECT);
		g_type_set_qdata (hev_gabble_future_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) hev_gabble_future_proxy_get_type);
		g_type_set_qdata (hev_gabble_future_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.Telepathy.Connection.FUTURE");
		g_type_set_qdata (hev_gabble_future_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) hev_gabble_future_register_object);
		g_once_init_leave (&hev_gabble_future_type_id__volatile, hev_gabble_future_type_id);
	}
	return hev_gabble_future_type_id__volatile;
}


G_DEFINE_TYPE_EXTENDED (HevGabbleFutureProxy, hev_gabble_future_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (HEV_GABBLE_TYPE_FUTURE, hev_gabble_future_proxy_hev_gabble_future_interface_init) )
static void hev_gabble_future_proxy_class_init (HevGabbleFutureProxyClass* klass) {
	G_DBUS_PROXY_CLASS (klass)->g_signal = hev_gabble_future_proxy_g_signal;
}


static void hev_gabble_future_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) {
}


static void hev_gabble_future_proxy_init (HevGabbleFutureProxy* self) {
}


static void _vala_g_async_ready_callback (GObject *source_object, GAsyncResult *res, void *user_data) {
	g_simple_async_result_set_op_res_gpointer (user_data, g_object_ref (res), g_object_unref);
	g_simple_async_result_complete (user_data);
	g_object_unref (user_data);
}


static void hev_gabble_future_proxy_ensure_sidecar_async (HevGabbleFuture* self, const gchar* iface, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.Telepathy.Connection.FUTURE", "EnsureSidecar");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (iface));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL));
	g_object_unref (_message);
}


static void hev_gabble_future_proxy_ensure_sidecar_finish (HevGabbleFuture* self, GAsyncResult* _res_, char** path, GHashTable** props, GError** error) {
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	char* _vala_path;
	GVariant* _tmp0_;
	GHashTable* _vala_props;
	GVariant* _tmp1_;
	GHashTable* _tmp2_;
	GVariantIter _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp0_ = g_variant_iter_next_value (&_reply_iter);
	_vala_path = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	*path = _vala_path;
	_tmp1_ = g_variant_iter_next_value (&_reply_iter);
	_tmp2_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
	g_variant_iter_init (&_tmp3_, _tmp1_);
	while (g_variant_iter_loop (&_tmp3_, "{?*}", &_tmp4_, &_tmp5_)) {
		g_hash_table_insert (_tmp2_, g_variant_dup_string (_tmp4_, NULL), g_variant_get_variant (_tmp5_));
	}
	_vala_props = _tmp2_;
	g_variant_unref (_tmp1_);
	*props = _vala_props;
	g_object_unref (_reply_message);
}


static void hev_gabble_future_proxy_hev_gabble_future_interface_init (HevGabbleFutureIface* iface) {
	iface->ensure_sidecar = hev_gabble_future_proxy_ensure_sidecar_async;
	iface->ensure_sidecar_finish = hev_gabble_future_proxy_ensure_sidecar_finish;
}


static void _dbus_hev_gabble_future_ensure_sidecar (HevGabbleFuture* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GVariantIter _arguments_iter;
	gchar* iface = NULL;
	GVariant* _tmp6_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
	iface = g_variant_dup_string (_tmp6_, NULL);
	g_variant_unref (_tmp6_);
	hev_gabble_future_ensure_sidecar (self, iface, (GAsyncReadyCallback) _dbus_hev_gabble_future_ensure_sidecar_ready, invocation);
	_g_free0 (iface);
}


static void _dbus_hev_gabble_future_ensure_sidecar_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
	GDBusMethodInvocation * invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	char* path = NULL;
	GHashTable* props = NULL;
	GVariantBuilder _tmp7_;
	GHashTableIter _tmp8_;
	gpointer _tmp9_;
	gpointer _tmp10_;
	invocation = _user_data_;
	hev_gabble_future_ensure_sidecar_finish ((HevGabbleFuture*) source_object, _res_, &path, &props, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_object_path (path));
	g_hash_table_iter_init (&_tmp8_, props);
	g_variant_builder_init (&_tmp7_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp8_, &_tmp9_, &_tmp10_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp9_;
		_value = (GVariant*) _tmp10_;
		g_variant_builder_add (&_tmp7_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp7_));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	_g_free0 (path);
	_g_hash_table_unref0 (props);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void hev_gabble_future_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "EnsureSidecar") == 0) {
		_dbus_hev_gabble_future_ensure_sidecar (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* hev_gabble_future_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}


static gboolean hev_gabble_future_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}


guint hev_gabble_future_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_hev_gabble_future_dbus_interface_info), &_hev_gabble_future_dbus_interface_vtable, data, _hev_gabble_future_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}


static void _hev_gabble_future_unregister_object (gpointer user_data) {
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}


void hev_gabble_console_send_i_q (HevGabbleConsole* self, const gchar* to, const gchar* body, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HEV_GABBLE_CONSOLE_GET_INTERFACE (self)->send_i_q (self, to, body, _callback_, _user_data_);
}


void hev_gabble_console_send_i_q_finish (HevGabbleConsole* self, GAsyncResult* _res_, gchar** reply_type, gchar** out_body, GError** error) {
	HEV_GABBLE_CONSOLE_GET_INTERFACE (self)->send_i_q_finish (self, _res_, reply_type, out_body, error);
}


void hev_gabble_console_send_stanza (HevGabbleConsole* self, const gchar* stanza, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	HEV_GABBLE_CONSOLE_GET_INTERFACE (self)->send_stanza (self, stanza, _callback_, _user_data_);
}


void hev_gabble_console_send_stanza_finish (HevGabbleConsole* self, GAsyncResult* _res_, GError** error) {
	HEV_GABBLE_CONSOLE_GET_INTERFACE (self)->send_stanza_finish (self, _res_, error);
}


gboolean hev_gabble_console_get_spew_stanzas (HevGabbleConsole* self) {
	g_return_val_if_fail (self != NULL, FALSE);
	return HEV_GABBLE_CONSOLE_GET_INTERFACE (self)->get_spew_stanzas (self);
}


void hev_gabble_console_set_spew_stanzas (HevGabbleConsole* self, gboolean value) {
	g_return_if_fail (self != NULL);
	HEV_GABBLE_CONSOLE_GET_INTERFACE (self)->set_spew_stanzas (self, value);
}


static void hev_gabble_console_base_init (HevGabbleConsoleIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		g_signal_new ("stanza_sent", HEV_GABBLE_TYPE_CONSOLE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
		g_signal_new ("stanza_received", HEV_GABBLE_TYPE_CONSOLE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	}
}


GType hev_gabble_console_get_type (void) {
	static volatile gsize hev_gabble_console_type_id__volatile = 0;
	if (g_once_init_enter (&hev_gabble_console_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (HevGabbleConsoleIface), (GBaseInitFunc) hev_gabble_console_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType hev_gabble_console_type_id;
		hev_gabble_console_type_id = g_type_register_static (G_TYPE_INTERFACE, "HevGabbleConsole", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (hev_gabble_console_type_id, G_TYPE_OBJECT);
		g_type_set_qdata (hev_gabble_console_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) hev_gabble_console_proxy_get_type);
		g_type_set_qdata (hev_gabble_console_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.Telepathy.Gabble.Plugin.Console");
		g_type_set_qdata (hev_gabble_console_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) hev_gabble_console_register_object);
		g_once_init_leave (&hev_gabble_console_type_id__volatile, hev_gabble_console_type_id);
	}
	return hev_gabble_console_type_id__volatile;
}


G_DEFINE_TYPE_EXTENDED (HevGabbleConsoleProxy, hev_gabble_console_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (HEV_GABBLE_TYPE_CONSOLE, hev_gabble_console_proxy_hev_gabble_console_interface_init) )
static void hev_gabble_console_proxy_class_init (HevGabbleConsoleProxyClass* klass) {
	G_DBUS_PROXY_CLASS (klass)->g_signal = hev_gabble_console_proxy_g_signal;
}


static void _dbus_handle_hev_gabble_console_stanza_sent (HevGabbleConsole* self, GVariant* parameters) {
	GVariantIter _arguments_iter;
	gchar* stanza = NULL;
	GVariant* _tmp11_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp11_ = g_variant_iter_next_value (&_arguments_iter);
	stanza = g_variant_dup_string (_tmp11_, NULL);
	g_variant_unref (_tmp11_);
	g_signal_emit_by_name (self, "stanza-sent", stanza);
	_g_free0 (stanza);
}


static void _dbus_handle_hev_gabble_console_stanza_received (HevGabbleConsole* self, GVariant* parameters) {
	GVariantIter _arguments_iter;
	gchar* stanza = NULL;
	GVariant* _tmp12_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp12_ = g_variant_iter_next_value (&_arguments_iter);
	stanza = g_variant_dup_string (_tmp12_, NULL);
	g_variant_unref (_tmp12_);
	g_signal_emit_by_name (self, "stanza-received", stanza);
	_g_free0 (stanza);
}


static void hev_gabble_console_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) {
	if (strcmp (signal_name, "StanzaSent") == 0) {
		_dbus_handle_hev_gabble_console_stanza_sent ((HevGabbleConsole*) proxy, parameters);
	} else if (strcmp (signal_name, "StanzaReceived") == 0) {
		_dbus_handle_hev_gabble_console_stanza_received ((HevGabbleConsole*) proxy, parameters);
	}
}


static void hev_gabble_console_proxy_init (HevGabbleConsoleProxy* self) {
}


static void hev_gabble_console_proxy_send_i_q_async (HevGabbleConsole* self, const gchar* to, const gchar* body, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.Telepathy.Gabble.Plugin.Console", "SendIQ");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (to));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (body));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL));
	g_object_unref (_message);
}


static void hev_gabble_console_proxy_send_i_q_finish (HevGabbleConsole* self, GAsyncResult* _res_, gchar** reply_type, gchar** out_body, GError** error) {
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gchar* _vala_reply_type;
	GVariant* _tmp13_;
	gchar* _vala_out_body;
	GVariant* _tmp14_;
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp13_ = g_variant_iter_next_value (&_reply_iter);
	_vala_reply_type = g_variant_dup_string (_tmp13_, NULL);
	g_variant_unref (_tmp13_);
	*reply_type = _vala_reply_type;
	_tmp14_ = g_variant_iter_next_value (&_reply_iter);
	_vala_out_body = g_variant_dup_string (_tmp14_, NULL);
	g_variant_unref (_tmp14_);
	*out_body = _vala_out_body;
	g_object_unref (_reply_message);
}


static void hev_gabble_console_proxy_send_stanza_async (HevGabbleConsole* self, const gchar* stanza, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.Telepathy.Gabble.Plugin.Console", "SendStanza");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (stanza));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_simple_async_result_new ((GObject *) self, _callback_, _user_data_, NULL));
	g_object_unref (_message);
}


static void hev_gabble_console_proxy_send_stanza_finish (HevGabbleConsole* self, GAsyncResult* _res_, GError** error) {
	GDBusMessage *_reply_message;
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), g_simple_async_result_get_op_res_gpointer ((GSimpleAsyncResult *) _res_), error);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}


static gboolean hev_gabble_console_dbus_proxy_get_spew_stanzas (HevGabbleConsole* self) {
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "SpewStanzas");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.Telepathy.Gabble.Plugin.Console"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("SpewStanzas"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return FALSE;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}


static void hev_gabble_console_dbus_proxy_set_spew_stanzas (HevGabbleConsole* self, gboolean value) {
	GVariant *_arguments;
	GVariant *_reply;
	GVariantBuilder _arguments_builder;
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.freedesktop.Telepathy.Gabble.Plugin.Console"));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("SpewStanzas"));
	g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value));
	g_variant_builder_close (&_arguments_builder);
	_arguments = g_variant_builder_end (&_arguments_builder);
	_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
	if (!_reply) {
		return;
	}
	g_variant_unref (_reply);
}


static void hev_gabble_console_proxy_hev_gabble_console_interface_init (HevGabbleConsoleIface* iface) {
	iface->send_i_q = hev_gabble_console_proxy_send_i_q_async;
	iface->send_i_q_finish = hev_gabble_console_proxy_send_i_q_finish;
	iface->send_stanza = hev_gabble_console_proxy_send_stanza_async;
	iface->send_stanza_finish = hev_gabble_console_proxy_send_stanza_finish;
	iface->get_spew_stanzas = hev_gabble_console_dbus_proxy_get_spew_stanzas;
	iface->set_spew_stanzas = hev_gabble_console_dbus_proxy_set_spew_stanzas;
}


static void _dbus_hev_gabble_console_send_i_q (HevGabbleConsole* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GVariantIter _arguments_iter;
	gchar* to = NULL;
	GVariant* _tmp15_;
	gchar* body = NULL;
	GVariant* _tmp16_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp15_ = g_variant_iter_next_value (&_arguments_iter);
	to = g_variant_dup_string (_tmp15_, NULL);
	g_variant_unref (_tmp15_);
	_tmp16_ = g_variant_iter_next_value (&_arguments_iter);
	body = g_variant_dup_string (_tmp16_, NULL);
	g_variant_unref (_tmp16_);
	hev_gabble_console_send_i_q (self, to, body, (GAsyncReadyCallback) _dbus_hev_gabble_console_send_i_q_ready, invocation);
	_g_free0 (to);
	_g_free0 (body);
}


static void _dbus_hev_gabble_console_send_i_q_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
	GDBusMethodInvocation * invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar* reply_type = NULL;
	gchar* out_body = NULL;
	invocation = _user_data_;
	hev_gabble_console_send_i_q_finish ((HevGabbleConsole*) source_object, _res_, &reply_type, &out_body, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (reply_type));
	g_variant_builder_add_value (&_reply_builder, g_variant_new_string (out_body));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	_g_free0 (reply_type);
	_g_free0 (out_body);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void _dbus_hev_gabble_console_send_stanza (HevGabbleConsole* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
	GVariantIter _arguments_iter;
	gchar* stanza = NULL;
	GVariant* _tmp17_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp17_ = g_variant_iter_next_value (&_arguments_iter);
	stanza = g_variant_dup_string (_tmp17_, NULL);
	g_variant_unref (_tmp17_);
	hev_gabble_console_send_stanza (self, stanza, (GAsyncReadyCallback) _dbus_hev_gabble_console_send_stanza_ready, invocation);
	_g_free0 (stanza);
}


static void _dbus_hev_gabble_console_send_stanza_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
	GDBusMethodInvocation * invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	invocation = _user_data_;
	hev_gabble_console_send_stanza_finish ((HevGabbleConsole*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_return_gerror (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}


static void hev_gabble_console_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "SendIQ") == 0) {
		_dbus_hev_gabble_console_send_i_q (object, parameters, invocation);
	} else if (strcmp (method_name, "SendStanza") == 0) {
		_dbus_hev_gabble_console_send_stanza (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}


static GVariant* _dbus_hev_gabble_console_get_spew_stanzas (HevGabbleConsole* self) {
	gboolean result;
	GVariant* _reply;
	result = hev_gabble_console_get_spew_stanzas (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}


static GVariant* hev_gabble_console_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "SpewStanzas") == 0) {
		return _dbus_hev_gabble_console_get_spew_stanzas (object);
	}
	return NULL;
}


static void _dbus_hev_gabble_console_set_spew_stanzas (HevGabbleConsole* self, GVariant* _value) {
	gboolean value = FALSE;
	value = g_variant_get_boolean (_value);
	hev_gabble_console_set_spew_stanzas (self, value);
}


static gboolean hev_gabble_console_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "SpewStanzas") == 0) {
		_dbus_hev_gabble_console_set_spew_stanzas (object, value);
		return TRUE;
	}
	return FALSE;
}


static void _dbus_hev_gabble_console_stanza_sent (GObject* _sender, const gchar* stanza, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (stanza));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.Telepathy.Gabble.Plugin.Console", "StanzaSent", _arguments, NULL);
}


static void _dbus_hev_gabble_console_stanza_received (GObject* _sender, const gchar* stanza, gpointer* _data) {
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (stanza));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.Telepathy.Gabble.Plugin.Console", "StanzaReceived", _arguments, NULL);
}


guint hev_gabble_console_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_hev_gabble_console_dbus_interface_info), &_hev_gabble_console_dbus_interface_vtable, data, _hev_gabble_console_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "stanza-sent", (GCallback) _dbus_hev_gabble_console_stanza_sent, data);
	g_signal_connect (object, "stanza-received", (GCallback) _dbus_hev_gabble_console_stanza_received, data);
	return result;
}


static void _hev_gabble_console_unregister_object (gpointer user_data) {
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_hev_gabble_console_stanza_sent, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_hev_gabble_console_stanza_received, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}


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


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


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		HevGabbleMonitor * self;
		self = _data1_->self;
		(_data1_->ensure_sidecar_handler_target_destroy_notify == NULL) ? NULL : (_data1_->ensure_sidecar_handler_target_destroy_notify (_data1_->ensure_sidecar_handler_target), NULL);
		_data1_->ensure_sidecar_handler = NULL;
		_data1_->ensure_sidecar_handler_target = NULL;
		_data1_->ensure_sidecar_handler_target_destroy_notify = NULL;
		_g_object_unref0 (_data1_->conn);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static void ___lambda4_ (HevGabbleMonitor* self, const gchar* s) {
	const gchar* _tmp0_;
	g_return_if_fail (s != NULL);
	_tmp0_ = s;
	g_print ("%s", _tmp0_);
}


static void ____lambda4__hev_gabble_console_stanza_sent (HevGabbleConsole* _sender, const gchar* stanza, gpointer self) {
	___lambda4_ (self, stanza);
}


static void ___lambda5_ (HevGabbleMonitor* self, const gchar* s) {
	const gchar* _tmp0_;
	g_return_if_fail (s != NULL);
	_tmp0_ = s;
	g_print ("%s", _tmp0_);
}


static void ____lambda5__hev_gabble_console_stanza_received (HevGabbleConsole* _sender, const gchar* stanza, gpointer self) {
	___lambda5_ (self, stanza);
}


static void ___lambda3_ (HevGabbleMonitor* self, GObject* obj, GAsyncResult* res) {
	HevGabbleConsole* _tmp6_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (res != NULL);
	{
		GAsyncResult* _tmp0_;
		HevGabbleConsole* _tmp1_ = NULL;
		HevGabbleConsole* _tmp2_ = NULL;
		HevGabbleConsole* _tmp3_;
		_tmp0_ = res;
		_tmp1_ = g_async_result_get_source_object (_tmp0_);
		_tmp2_ = g_async_initable_new_finish (_tmp1_, _tmp0_, &_inner_error_);
		g_object_unref (_tmp1_);
		_tmp3_ = (HevGabbleConsole*) _tmp2_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_IO_ERROR) {
				goto __catch1_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
		_g_object_unref0 (self->priv->console);
		self->priv->console = _tmp3_;
	}
	goto __finally1;
	__catch1_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("hev-gabble-monitor.vala:55: %s", _tmp5_);
		_g_error_free0 (e);
	}
	__finally1:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp6_ = self->priv->console;
	if (NULL != _tmp6_) {
		HevGabbleConsole* _tmp7_;
		HevGabbleConsole* _tmp8_;
		HevGabbleConsole* _tmp9_;
		_tmp7_ = self->priv->console;
		hev_gabble_console_set_spew_stanzas (_tmp7_, TRUE);
		_tmp8_ = self->priv->console;
		g_signal_connect_object (_tmp8_, "stanza-sent", (GCallback) ____lambda4__hev_gabble_console_stanza_sent, self, 0);
		_tmp9_ = self->priv->console;
		g_signal_connect_object (_tmp9_, "stanza-received", (GCallback) ____lambda5__hev_gabble_console_stanza_received, self, 0);
	}
}


static void ____lambda3__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	___lambda3_ (self, source_object, res);
	g_object_unref (self);
}


static void __lambda2_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) {
	HevGabbleMonitor * self;
	char* p;
	GHashTable* props;
	const char* _tmp6_;
	GError * _inner_error_ = NULL;
	self = _data1_->self;
	g_return_if_fail (res != NULL);
	p = NULL;
	props = NULL;
	{
		GObject* _tmp0_;
		GAsyncResult* _tmp1_;
		char* _tmp2_ = NULL;
		GHashTable* _tmp3_ = NULL;
		_tmp0_ = obj;
		_tmp1_ = res;
		hev_gabble_future_ensure_sidecar_finish (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, HEV_GABBLE_TYPE_FUTURE) ? ((HevGabbleFuture*) _tmp0_) : NULL, _tmp1_, &_tmp2_, &_tmp3_, &_inner_error_);
		_g_free0 (p);
		p = _tmp2_;
		_g_hash_table_unref0 (props);
		props = _tmp3_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			_g_hash_table_unref0 (props);
			_g_free0 (p);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("hev-gabble-monitor.vala:45: %s", _tmp5_);
		_g_error_free0 (e);
	}
	__finally0:
	if (_inner_error_ != NULL) {
		_g_hash_table_unref0 (props);
		_g_free0 (p);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp6_ = p;
	if (NULL != _tmp6_) {
		TpConnection* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		const char* _tmp10_;
		_tmp7_ = _data1_->conn;
		_tmp8_ = tp_proxy_get_bus_name ((TpProxy*) _tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = p;
		g_async_initable_new_async (HEV_GABBLE_TYPE_CONSOLE_PROXY, 0, NULL, ____lambda3__gasync_ready_callback, g_object_ref (self), "g-flags", G_DBUS_PROXY_FLAGS_NONE, "g-name", _tmp9_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", (const gchar*) _tmp10_, "g-interface-name", "org.freedesktop.Telepathy.Gabble.Plugin.Console", NULL);
	}
	_g_hash_table_unref0 (props);
	_g_free0 (p);
}


static void ___lambda2__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda2_ (self, source_object, res);
}


static void __lambda6_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) {
	HevGabbleMonitor * self;
	HevGabbleFuture* future;
	HevGabbleFuture* _tmp6_;
	GError * _inner_error_ = NULL;
	self = _data1_->self;
	g_return_if_fail (res != NULL);
	future = NULL;
	{
		GAsyncResult* _tmp0_;
		HevGabbleFuture* _tmp1_ = NULL;
		HevGabbleFuture* _tmp2_ = NULL;
		HevGabbleFuture* _tmp3_;
		_tmp0_ = res;
		_tmp1_ = g_async_result_get_source_object (_tmp0_);
		_tmp2_ = g_async_initable_new_finish (_tmp1_, _tmp0_, &_inner_error_);
		g_object_unref (_tmp1_);
		_tmp3_ = (HevGabbleFuture*) _tmp2_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_IO_ERROR) {
				goto __catch2_g_io_error;
			}
			_g_object_unref0 (future);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
		_g_object_unref0 (future);
		future = _tmp3_;
	}
	goto __finally2;
	__catch2_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("hev-gabble-monitor.vala:78: %s", _tmp5_);
		_g_error_free0 (e);
	}
	__finally2:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (future);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp6_ = future;
	if (NULL != _tmp6_) {
		HevGabbleFuture* _tmp7_;
		_tmp7_ = future;
		hev_gabble_future_ensure_sidecar (_tmp7_, HEV_GABBLE_CONSOLE_IFACE, _data1_->ensure_sidecar_handler, _data1_->ensure_sidecar_handler_target);
	}
	_g_object_unref0 (future);
}


static void ___lambda6__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda6_ (self, source_object, res);
	block1_data_unref (self);
}


HevGabbleMonitor* hev_gabble_monitor_construct (GType object_type, TpConnection* conn) {
	HevGabbleMonitor * self = NULL;
	Block1Data* _data1_;
	TpConnection* _tmp0_;
	TpConnection* _tmp1_;
	TpConnection* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	TpConnection* _tmp5_;
	const gchar* _tmp6_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (conn != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_tmp0_ = conn;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data1_->conn = _tmp1_;
	self = (HevGabbleMonitor*) g_object_new (object_type, NULL);
	_data1_->self = g_object_ref (self);
	g_debug ("hev-gabble-monitor.vala:36: Monitor");
	_data1_->ensure_sidecar_handler = ___lambda2__gasync_ready_callback;
	_data1_->ensure_sidecar_handler_target = block1_data_ref (_data1_);
	_data1_->ensure_sidecar_handler_target_destroy_notify = block1_data_unref;
	_tmp2_ = _data1_->conn;
	_tmp3_ = tp_proxy_get_bus_name ((TpProxy*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _data1_->conn;
	_tmp6_ = tp_proxy_get_object_path ((TpProxy*) _tmp5_);
	g_async_initable_new_async (HEV_GABBLE_TYPE_FUTURE_PROXY, 0, NULL, ___lambda6__gasync_ready_callback, block1_data_ref (_data1_), "g-flags", G_DBUS_PROXY_FLAGS_NONE, "g-name", _tmp4_, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", _tmp6_, "g-interface-name", "org.freedesktop.Telepathy.Connection.FUTURE", NULL);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}


HevGabbleMonitor* hev_gabble_monitor_new (TpConnection* conn) {
	return hev_gabble_monitor_construct (HEV_GABBLE_TYPE_MONITOR, conn);
}


static void hev_gabble_monitor_class_init (HevGabbleMonitorClass * klass) {
	hev_gabble_monitor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (HevGabbleMonitorPrivate));
	G_OBJECT_CLASS (klass)->finalize = hev_gabble_monitor_finalize;
}


static void hev_gabble_monitor_instance_init (HevGabbleMonitor * self) {
	self->priv = HEV_GABBLE_MONITOR_GET_PRIVATE (self);
	self->priv->console = NULL;
}


static void hev_gabble_monitor_finalize (GObject* obj) {
	HevGabbleMonitor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, HEV_GABBLE_TYPE_MONITOR, HevGabbleMonitor);
	g_debug ("hev-gabble-monitor.vala:89: ~Monitor");
	_g_object_unref0 (self->priv->console);
	G_OBJECT_CLASS (hev_gabble_monitor_parent_class)->finalize (obj);
}


GType hev_gabble_monitor_get_type (void) {
	static volatile gsize hev_gabble_monitor_type_id__volatile = 0;
	if (g_once_init_enter (&hev_gabble_monitor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (HevGabbleMonitorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) hev_gabble_monitor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HevGabbleMonitor), 0, (GInstanceInitFunc) hev_gabble_monitor_instance_init, NULL };
		GType hev_gabble_monitor_type_id;
		hev_gabble_monitor_type_id = g_type_register_static (G_TYPE_OBJECT, "HevGabbleMonitor", &g_define_type_info, 0);
		g_once_init_leave (&hev_gabble_monitor_type_id__volatile, hev_gabble_monitor_type_id);
	}
	return hev_gabble_monitor_type_id__volatile;
}


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static void _g_slist_free__g_object_unref0_ (GSList* self) {
	g_slist_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_slist_free (self);
}


static void __lambda7_ (HevGabbleManager* self, GObject* obj, GAsyncResult* res) {
	gboolean succ;
	gboolean _tmp6_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (res != NULL);
	succ = FALSE;
	{
		GObject* _tmp0_;
		GAsyncResult* _tmp1_;
		gboolean _tmp2_ = FALSE;
		gboolean _tmp3_;
		_tmp0_ = obj;
		_tmp1_ = res;
		_tmp2_ = tp_proxy_prepare_finish ((TpProxy*) (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, tp_account_manager_get_type ()) ? ((TpAccountManager*) _tmp0_) : NULL), _tmp1_, &_inner_error_);
		_tmp3_ = _tmp2_;
		if (_inner_error_ != NULL) {
			goto __catch3_g_error;
		}
		succ = _tmp3_;
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("hev-gabble-monitor.vala:113: %s", _tmp5_);
		_g_error_free0 (e);
	}
	__finally3:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp6_ = succ;
	if (_tmp6_) {
		hev_gabble_manager_enumerate (self);
	}
}


static void ___lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda7_ (self, source_object, res);
	g_object_unref (self);
}


HevGabbleManager* hev_gabble_manager_construct (GType object_type) {
	HevGabbleManager * self = NULL;
	GMainLoop* _tmp0_;
	TpAccountManager* _tmp1_ = NULL;
	GQuark _tmp2_ = 0U;
	GQuark* _tmp3_ = NULL;
	GQuark* features;
	gint features_length1;
	gint _features_size_;
	TpAccountManager* _tmp4_;
	self = (HevGabbleManager*) g_object_new (object_type, NULL);
	g_debug ("hev-gabble-monitor.vala:100: Manager");
	_tmp0_ = g_main_loop_new (NULL, FALSE);
	_g_main_loop_unref0 (self->priv->main_loop);
	self->priv->main_loop = _tmp0_;
	__g_slist_free__g_object_unref0_0 (self->priv->monitors);
	self->priv->monitors = NULL;
	_tmp1_ = tp_account_manager_dup ();
	_g_object_unref0 (self->priv->am);
	self->priv->am = _tmp1_;
	_tmp2_ = tp_account_manager_get_feature_quark_core ();
	_tmp3_ = g_new0 (GQuark, 1);
	_tmp3_[0] = _tmp2_;
	features = _tmp3_;
	features_length1 = 1;
	_features_size_ = features_length1;
	_tmp4_ = self->priv->am;
	tp_proxy_prepare_async ((TpProxy*) _tmp4_, features, ___lambda7__gasync_ready_callback, g_object_ref (self));
	features = (g_free (features), NULL);
	return self;
}


HevGabbleManager* hev_gabble_manager_new (void) {
	return hev_gabble_manager_construct (HEV_GABBLE_TYPE_MANAGER);
}


void hev_gabble_manager_run (HevGabbleManager* self) {
	GMainLoop* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_loop;
	g_main_loop_run (_tmp0_);
}


void hev_gabble_manager_quit (HevGabbleManager* self) {
	GMainLoop* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_loop;
	g_main_loop_quit (_tmp0_);
}


static void hev_gabble_manager_enumerate (HevGabbleManager* self) {
	TpAccountManager* _tmp0_;
	GList* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->am;
	_tmp1_ = tp_account_manager_get_valid_accounts (_tmp0_);
	{
		GList* a_collection = NULL;
		GList* a_it = NULL;
		a_collection = _tmp1_;
		for (a_it = a_collection; a_it != NULL; a_it = a_it->next) {
			TpAccount* a = NULL;
			a = (TpAccount*) a_it->data;
			{
				TpAccount* _tmp2_;
				const gchar* _tmp3_;
				const gchar* _tmp4_;
				_tmp2_ = a;
				_tmp3_ = tp_account_get_connection_manager (_tmp2_);
				_tmp4_ = _tmp3_;
				if (g_strcmp0 ("gabble", _tmp4_) == 0) {
					TpAccount* _tmp5_;
					TpConnection* _tmp6_;
					TpConnection* _tmp7_;
					_tmp5_ = a;
					_tmp6_ = tp_account_get_connection (_tmp5_);
					_tmp7_ = _tmp6_;
					if (NULL != _tmp7_) {
						TpAccount* _tmp8_;
						TpConnection* _tmp9_;
						TpConnection* _tmp10_;
						HevGabbleMonitor* _tmp11_;
						HevGabbleMonitor* monitor;
						HevGabbleMonitor* _tmp12_;
						HevGabbleMonitor* _tmp13_;
						_tmp8_ = a;
						_tmp9_ = tp_account_get_connection (_tmp8_);
						_tmp10_ = _tmp9_;
						_tmp11_ = hev_gabble_monitor_new (_tmp10_);
						monitor = _tmp11_;
						_tmp12_ = monitor;
						_tmp13_ = _g_object_ref0 (_tmp12_);
						self->priv->monitors = g_slist_append (self->priv->monitors, _tmp13_);
						_g_object_unref0 (monitor);
					}
				}
			}
		}
		_g_list_free0 (a_collection);
	}
}


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_)) {
		_g_object_unref0 (_data2_->manager);
		g_slice_free (Block2Data, _data2_);
	}
}


static gboolean __lambda8_ (Block2Data* _data2_) {
	gboolean result = FALSE;
	hev_gabble_manager_quit (_data2_->manager);
	result = TRUE;
	return result;
}


static gboolean ___lambda8__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda8_ (self);
	return result;
}


gint hev_gabble_manager_main (gchar** args, int args_length1) {
	gint result = 0;
	Block2Data* _data2_;
	guint sigint_id;
	guint sigterm_id;
	HevGabbleManager* _tmp0_;
	GSourceFunc signal_handler;
	void* signal_handler_target;
	GDestroyNotify signal_handler_target_destroy_notify;
	GSourceFunc _tmp1_;
	void* _tmp1__target;
	GDestroyNotify _tmp1__target_destroy_notify;
	guint _tmp2_ = 0U;
	GSourceFunc _tmp3_;
	void* _tmp3__target;
	GDestroyNotify _tmp3__target_destroy_notify;
	guint _tmp4_ = 0U;
	guint _tmp5_;
	guint _tmp6_;
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	sigint_id = (guint) 0;
	sigterm_id = (guint) 0;
	_tmp0_ = hev_gabble_manager_new ();
	_data2_->manager = _tmp0_;
	signal_handler = ___lambda8__gsource_func;
	signal_handler_target = block2_data_ref (_data2_);
	signal_handler_target_destroy_notify = block2_data_unref;
	_tmp1_ = signal_handler;
	_tmp1__target = signal_handler_target;
	_tmp1__target_destroy_notify = signal_handler_target_destroy_notify;
	signal_handler_target_destroy_notify = NULL;
	_tmp2_ = g_unix_signal_add_full (G_PRIORITY_DEFAULT, SIGINT, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify);
	sigint_id = _tmp2_;
	_tmp3_ = signal_handler;
	_tmp3__target = signal_handler_target;
	_tmp3__target_destroy_notify = signal_handler_target_destroy_notify;
	signal_handler_target_destroy_notify = NULL;
	_tmp4_ = g_unix_signal_add_full (G_PRIORITY_DEFAULT, SIGTERM, _tmp3_, _tmp3__target, _tmp3__target_destroy_notify);
	sigterm_id = _tmp4_;
	hev_gabble_manager_run (_data2_->manager);
	_tmp5_ = sigint_id;
	g_source_remove (_tmp5_);
	_tmp6_ = sigterm_id;
	g_source_remove (_tmp6_);
	result = 0;
	(signal_handler_target_destroy_notify == NULL) ? NULL : (signal_handler_target_destroy_notify (signal_handler_target), NULL);
	signal_handler = NULL;
	signal_handler_target = NULL;
	signal_handler_target_destroy_notify = NULL;
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return hev_gabble_manager_main (argv, argc);
}


static void hev_gabble_manager_class_init (HevGabbleManagerClass * klass) {
	hev_gabble_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (HevGabbleManagerPrivate));
	G_OBJECT_CLASS (klass)->finalize = hev_gabble_manager_finalize;
}


static void hev_gabble_manager_instance_init (HevGabbleManager * self) {
	self->priv = HEV_GABBLE_MANAGER_GET_PRIVATE (self);
	self->priv->main_loop = NULL;
	self->priv->am = NULL;
	self->priv->monitors = NULL;
}


static void hev_gabble_manager_finalize (GObject* obj) {
	HevGabbleManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, HEV_GABBLE_TYPE_MANAGER, HevGabbleManager);
	g_debug ("hev-gabble-monitor.vala:122: ~Manager");
	_g_main_loop_unref0 (self->priv->main_loop);
	_g_object_unref0 (self->priv->am);
	__g_slist_free__g_object_unref0_0 (self->priv->monitors);
	G_OBJECT_CLASS (hev_gabble_manager_parent_class)->finalize (obj);
}


GType hev_gabble_manager_get_type (void) {
	static volatile gsize hev_gabble_manager_type_id__volatile = 0;
	if (g_once_init_enter (&hev_gabble_manager_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (HevGabbleManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) hev_gabble_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HevGabbleManager), 0, (GInstanceInitFunc) hev_gabble_manager_instance_init, NULL };
		GType hev_gabble_manager_type_id;
		hev_gabble_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "HevGabbleManager", &g_define_type_info, 0);
		g_once_init_leave (&hev_gabble_manager_type_id__volatile, hev_gabble_manager_type_id);
	}
	return hev_gabble_manager_type_id__volatile;
}



