/* NotificationSettings.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from NotificationSettings.vala, do not modify */

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <json-glib/json-glib.h>
#include <glib/gi18n-lib.h>
#include <libsoup/soup.h>

#define TUBA_INSTANCE_ACCOUNT_KIND_MENTION "mention"
#define TUBA_INSTANCE_ACCOUNT_KIND_FAVOURITE "favourite"
#define TUBA_INSTANCE_ACCOUNT_KIND_REBLOG "reblog"
#define TUBA_INSTANCE_ACCOUNT_KIND_POLL "poll"
#define TUBA_INSTANCE_ACCOUNT_KIND_EDITED "update"
#define TUBA_INSTANCE_ACCOUNT_KIND_FOLLOW "follow"
#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 TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS (tuba_dialogs_notification_settings_get_type ())
#define TUBA_DIALOGS_NOTIFICATION_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS, TubaDialogsNotificationSettings))
#define TUBA_DIALOGS_NOTIFICATION_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS, TubaDialogsNotificationSettingsClass))
#define TUBA_DIALOGS_IS_NOTIFICATION_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS))
#define TUBA_DIALOGS_IS_NOTIFICATION_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS))
#define TUBA_DIALOGS_NOTIFICATION_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS, TubaDialogsNotificationSettingsClass))

typedef struct _TubaDialogsNotificationSettings TubaDialogsNotificationSettings;
typedef struct _TubaDialogsNotificationSettingsClass TubaDialogsNotificationSettingsClass;
typedef struct _TubaDialogsNotificationSettingsPrivate TubaDialogsNotificationSettingsPrivate;

#define TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW (tuba_dialogs_notification_settings_notification_row_get_type ())
#define TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW, TubaDialogsNotificationSettingsNotificationRow))
#define TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW, TubaDialogsNotificationSettingsNotificationRowClass))
#define TUBA_DIALOGS_NOTIFICATION_SETTINGS_IS_NOTIFICATION_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW))
#define TUBA_DIALOGS_NOTIFICATION_SETTINGS_IS_NOTIFICATION_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW))
#define TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW, TubaDialogsNotificationSettingsNotificationRowClass))

typedef struct _TubaDialogsNotificationSettingsNotificationRow TubaDialogsNotificationSettingsNotificationRow;
typedef struct _TubaDialogsNotificationSettingsNotificationRowClass TubaDialogsNotificationSettingsNotificationRowClass;
enum  {
	TUBA_DIALOGS_NOTIFICATION_SETTINGS_0_PROPERTY,
	TUBA_DIALOGS_NOTIFICATION_SETTINGS_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_notification_settings_properties[TUBA_DIALOGS_NOTIFICATION_SETTINGS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_TYPE_SETTINGS (tuba_settings_get_type ())
#define TUBA_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_SETTINGS, TubaSettings))
#define TUBA_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_SETTINGS, TubaSettingsClass))
#define TUBA_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_SETTINGS))
#define TUBA_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_SETTINGS))
#define TUBA_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_SETTINGS, TubaSettingsClass))

typedef struct _TubaSettings TubaSettings;
typedef struct _TubaSettingsClass TubaSettingsClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block25Data Block25Data;

#define TUBA_TYPE_REQUEST (tuba_request_get_type ())
#define TUBA_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST, TubaRequest))
#define TUBA_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST, TubaRequestClass))
#define TUBA_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST))
#define TUBA_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST))
#define TUBA_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST, TubaRequestClass))

typedef struct _TubaRequest TubaRequest;
typedef struct _TubaRequestClass TubaRequestClass;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;
typedef struct _Block26Data Block26Data;
typedef void (*TubaNetworkSuccessCallback) (GInputStream* in_stream, SoupMessageHeaders* response_headers, gpointer user_data, GError** error);

#define TUBA_TYPE_APPLICATION (tuba_application_get_type ())
#define TUBA_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_APPLICATION, TubaApplication))
#define TUBA_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_APPLICATION, TubaApplicationClass))
#define TUBA_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_APPLICATION))
#define TUBA_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_APPLICATION))
#define TUBA_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_APPLICATION, TubaApplicationClass))

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;
typedef void (*TubaNetworkErrorCallback) (gint32 code, const gchar* reason, gpointer user_data);

#define TUBA_TYPE_NETWORK (tuba_network_get_type ())
#define TUBA_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_NETWORK, TubaNetwork))
#define TUBA_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_NETWORK, TubaNetworkClass))
#define TUBA_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_NETWORK))
#define TUBA_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_NETWORK))
#define TUBA_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_NETWORK, TubaNetworkClass))

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))

#define TUBA_API_NOTIFICATION_FILTER_TYPE_POLICY (tuba_api_notification_filter_policy_get_type ())
#define TUBA_API_NOTIFICATION_FILTER_POLICY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_NOTIFICATION_FILTER_TYPE_POLICY, TubaAPINotificationFilterPolicy))
#define TUBA_API_NOTIFICATION_FILTER_POLICY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_NOTIFICATION_FILTER_TYPE_POLICY, TubaAPINotificationFilterPolicyClass))
#define TUBA_API_NOTIFICATION_FILTER_IS_POLICY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_NOTIFICATION_FILTER_TYPE_POLICY))
#define TUBA_API_NOTIFICATION_FILTER_IS_POLICY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_NOTIFICATION_FILTER_TYPE_POLICY))
#define TUBA_API_NOTIFICATION_FILTER_POLICY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_NOTIFICATION_FILTER_TYPE_POLICY, TubaAPINotificationFilterPolicyClass))

typedef struct _TubaAPINotificationFilterPolicy TubaAPINotificationFilterPolicy;
typedef struct _TubaAPINotificationFilterPolicyClass TubaAPINotificationFilterPolicyClass;
typedef struct _TubaDialogsNotificationSettingsNotificationRowPrivate TubaDialogsNotificationSettingsNotificationRowPrivate;
enum  {
	TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_0_PROPERTY,
	TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_ACTIVE_PROPERTY,
	TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_KIND_PROPERTY,
	TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_notification_settings_notification_row_properties[TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_NUM_PROPERTIES];
enum  {
	TUBA_DIALOGS_NOTIFICATION_SETTINGS_FILTERS_CHANGED_SIGNAL,
	TUBA_DIALOGS_NOTIFICATION_SETTINGS_NUM_SIGNALS
};
static guint tuba_dialogs_notification_settings_signals[TUBA_DIALOGS_NOTIFICATION_SETTINGS_NUM_SIGNALS] = {0};

struct _TubaDialogsNotificationSettings {
	AdwDialog parent_instance;
	TubaDialogsNotificationSettingsPrivate * priv;
	AdwToastOverlay* toast_overlay;
	GtkButton* clear_button;
	AdwPreferencesGroup* filters_group;
	AdwPreferencesGroup* filtered_notifications_group;
	AdwSwitchRow* filter_notifications_following_switch;
	AdwSwitchRow* filter_notifications_follower_switch;
	AdwSwitchRow* filter_notifications_new_account_switch;
	AdwSwitchRow* filter_notifications_dm_switch;
};

struct _TubaDialogsNotificationSettingsClass {
	AdwDialogClass parent_class;
};

struct _TubaDialogsNotificationSettingsPrivate {
	TubaDialogsNotificationSettingsNotificationRow** notification_rows;
	gint notification_rows_length1;
	gint _notification_rows_size_;
	GeeHashMap* notification_filter_policy_status;
};

struct _Block25Data {
	int _ref_count_;
	TubaDialogsNotificationSettings* self;
	gboolean nfp_changed;
};

struct _Block26Data {
	int _ref_count_;
	TubaDialogsNotificationSettings* self;
	AdwAlertDialog* dlg;
};

struct _TubaDialogsNotificationSettingsNotificationRow {
	AdwActionRow parent_instance;
	TubaDialogsNotificationSettingsNotificationRowPrivate * priv;
};

struct _TubaDialogsNotificationSettingsNotificationRowClass {
	AdwActionRowClass parent_class;
};

struct _TubaDialogsNotificationSettingsNotificationRowPrivate {
	gchar* _kind;
	GtkSwitch* row_switch;
};

static gint TubaDialogsNotificationSettings_private_offset;
static gpointer tuba_dialogs_notification_settings_parent_class = NULL;
VALA_EXTERN TubaSettings* tuba_settings;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaNetwork* tuba_network;
static gint TubaDialogsNotificationSettingsNotificationRow_private_offset;
static gpointer tuba_dialogs_notification_settings_notification_row_parent_class = NULL;

VALA_EXTERN GType tuba_dialogs_notification_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsNotificationSettings, g_object_unref)
static GType tuba_dialogs_notification_settings_notification_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsNotificationSettingsNotificationRow, g_object_unref)
static void tuba_dialogs_notification_settings_save (TubaDialogsNotificationSettings* self);
static gboolean tuba_dialogs_notification_settings_notification_row_get_active (TubaDialogsNotificationSettingsNotificationRow* self);
static const gchar* tuba_dialogs_notification_settings_notification_row_get_kind (TubaDialogsNotificationSettingsNotificationRow* self);
static void _vala_array_add11 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN GType tuba_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaSettings, g_object_unref)
VALA_EXTERN gchar** tuba_settings_get_notification_filters (TubaSettings* self,
                                                gint* result_length1);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
VALA_EXTERN void tuba_settings_set_notification_filters (TubaSettings* self,
                                             gchar** value,
                                             gint value_length1);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static gboolean ___lambda328_ (Block25Data* _data25_,
                        GeeMapEntry* entry);
static gboolean ____lambda328__gee_forall_func (gpointer g,
                                         gpointer self);
VALA_EXTERN TubaRequest* tuba_request_new_PUT (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_PUT (GType object_type,
                                         const gchar* url);
VALA_EXTERN GType tuba_request_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequest, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN TubaRequest* tuba_request_with_account (TubaRequest* self,
                                        TubaInstanceAccount* account);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN TubaRequest* tuba_request_body_json (TubaRequest* self,
                                     JsonBuilder* t_builder);
VALA_EXTERN TubaRequest* tuba_request_exec (TubaRequest* self);
static void tuba_dialogs_notification_settings_clear_all_notifications (TubaDialogsNotificationSettings* self);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static void __lambda329_ (Block26Data* _data26_,
                   GObject* obj,
                   GAsyncResult* res);
VALA_EXTERN TubaRequest* tuba_request_new_POST (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_POST (GType object_type,
                                          const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_then (TubaRequest* self,
                                TubaNetworkSuccessCallback cb,
                                gpointer cb_target,
                                GDestroyNotify cb_target_destroy_notify);
static void ___lambda330_ (TubaDialogsNotificationSettings* self,
                    GError** error);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
static void ____lambda330__tuba_network_success_callback (GInputStream* in_stream,
                                                   SoupMessageHeaders* response_headers,
                                                   gpointer self,
                                                   GError** error);
VALA_EXTERN TubaRequest* tuba_request_on_error (TubaRequest* self,
                                    TubaNetworkErrorCallback cb,
                                    gpointer cb_target,
                                    GDestroyNotify cb_target_destroy_notify);
static void ___lambda331_ (TubaDialogsNotificationSettings* self,
                    gint32 code,
                    const gchar* message);
static void ____lambda331__tuba_network_error_callback (gint32 code,
                                                 const gchar* reason,
                                                 gpointer self);
static void ___lambda329__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void _tuba_dialogs_notification_settings_clear_all_notifications_gtk_button_clicked (GtkButton* _sender,
                                                                                     gpointer self);
static void tuba_dialogs_notification_settings_setup_notification_filters (TubaDialogsNotificationSettings* self);
VALA_EXTERN gboolean tuba_instance_account_get_tuba_probably_has_notification_filters (TubaInstanceAccount* self);
VALA_EXTERN TubaRequest* tuba_request_new_GET (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_GET (GType object_type,
                                         const gchar* url);
static void __lambda332_ (TubaDialogsNotificationSettings* self,
                   GInputStream* in_stream,
                   GError** error);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream (GInputStream* in_stream,
                                                      GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN GType tuba_api_notification_filter_policy_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPINotificationFilterPolicy, g_object_unref)
VALA_EXTERN TubaAPINotificationFilterPolicy* tuba_api_notification_filter_policy_from (JsonNode* node,
                                                                           GError** error);
VALA_EXTERN gboolean tuba_api_notification_filter_policy_get_filter_not_following (TubaAPINotificationFilterPolicy* self);
VALA_EXTERN gboolean tuba_api_notification_filter_policy_get_filter_not_followers (TubaAPINotificationFilterPolicy* self);
VALA_EXTERN gboolean tuba_api_notification_filter_policy_get_filter_new_accounts (TubaAPINotificationFilterPolicy* self);
VALA_EXTERN gboolean tuba_api_notification_filter_policy_get_filter_private_mentions (TubaAPINotificationFilterPolicy* self);
static gboolean __lambda333_ (TubaDialogsNotificationSettings* self,
                       GeeMapEntry* entry);
static gboolean ___lambda333__gee_forall_func (gpointer g,
                                        gpointer self);
static void ___lambda332__tuba_network_success_callback (GInputStream* in_stream,
                                                  SoupMessageHeaders* response_headers,
                                                  gpointer self,
                                                  GError** error);
static void __lambda334_ (TubaDialogsNotificationSettings* self,
                   gint32 code,
                   const gchar* message);
VALA_EXTERN void tuba_instance_account_set_tuba_probably_has_notification_filters (TubaInstanceAccount* self,
                                                                       gboolean value);
static void ___lambda334__tuba_network_error_callback (gint32 code,
                                                const gchar* reason,
                                                gpointer self);
VALA_EXTERN TubaDialogsNotificationSettings* tuba_dialogs_notification_settings_new (void);
VALA_EXTERN TubaDialogsNotificationSettings* tuba_dialogs_notification_settings_construct (GType object_type);
static TubaDialogsNotificationSettingsNotificationRow* tuba_dialogs_notification_settings_notification_row_new (const gchar* kind,
                                                                                                         const gchar* title,
                                                                                                         const gchar* icon);
static TubaDialogsNotificationSettingsNotificationRow* tuba_dialogs_notification_settings_notification_row_construct (GType object_type,
                                                                                                               const gchar* kind,
                                                                                                               const gchar* title,
                                                                                                               const gchar* icon);
static void tuba_dialogs_notification_settings_notification_row_set_kind (TubaDialogsNotificationSettingsNotificationRow* self,
                                                                   const gchar* value);
static void tuba_dialogs_notification_settings_notification_row_set_active (TubaDialogsNotificationSettingsNotificationRow* self,
                                                                     gboolean value);
static void tuba_dialogs_notification_settings_notification_row_finalize (GObject * obj);
static GType tuba_dialogs_notification_settings_notification_row_get_type_once (void);
static void _vala_tuba_dialogs_notification_settings_notification_row_get_property (GObject * object,
                                                                             guint property_id,
                                                                             GValue * value,
                                                                             GParamSpec * pspec);
static void _vala_tuba_dialogs_notification_settings_notification_row_set_property (GObject * object,
                                                                             guint property_id,
                                                                             const GValue * value,
                                                                             GParamSpec * pspec);
static GObject * tuba_dialogs_notification_settings_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties);
static void _tuba_dialogs_notification_settings_save_adw_dialog_closed (AdwDialog* _sender,
                                                                 gpointer self);
static void tuba_dialogs_notification_settings_finalize (GObject * obj);
static GType tuba_dialogs_notification_settings_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_dialogs_notification_settings_get_instance_private (TubaDialogsNotificationSettings* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsNotificationSettings_private_offset);
}

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

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

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static Block25Data*
block25_data_ref (Block25Data* _data25_)
{
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}

static void
block25_data_unref (void * _userdata_)
{
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		TubaDialogsNotificationSettings* self;
		self = _data25_->self;
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}

static gboolean
___lambda328_ (Block25Data* _data25_,
               GeeMapEntry* entry)
{
	TubaDialogsNotificationSettings* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gconstpointer _tmp4_;
	gconstpointer _tmp5_;
	gboolean result;
	self = _data25_->self;
	g_return_val_if_fail (entry != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_key (entry);
	_tmp1_ = _tmp0_;
	_tmp2_ = adw_switch_row_get_active (G_TYPE_CHECK_INSTANCE_CAST ((AdwSwitchRow*) _tmp1_, adw_switch_row_get_type (), AdwSwitchRow));
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_map_entry_get_value (entry);
	_tmp5_ = _tmp4_;
	if (_tmp3_ != ((gboolean) ((gboolean) ((gintptr) _tmp5_)))) {
		_data25_->nfp_changed = TRUE;
		result = FALSE;
		_g_object_unref0 (entry);
		return result;
	}
	result = TRUE;
	_g_object_unref0 (entry);
	return result;
}

static gboolean
____lambda328__gee_forall_func (gpointer g,
                                gpointer self)
{
	gboolean result;
	result = ___lambda328_ (self, (GeeMapEntry*) g);
	return result;
}

static void
tuba_dialogs_notification_settings_save (TubaDialogsNotificationSettings* self)
{
	gboolean changed = FALSE;
	gchar** new_filters = NULL;
	gchar** _tmp0_;
	gint new_filters_length1;
	gint _new_filters_size_;
	TubaDialogsNotificationSettingsNotificationRow** _tmp1_;
	gint _tmp1__length1;
	gchar** _tmp10_;
	gint _tmp10__length1;
	TubaSettings* _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	gint _tmp13_ = 0;
	gchar** _tmp14_;
	gint _tmp14__length1;
	GeeHashMap* _tmp24_;
	g_return_if_fail (self != NULL);
	changed = FALSE;
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	new_filters = _tmp0_;
	new_filters_length1 = 0;
	_new_filters_size_ = new_filters_length1;
	_tmp1_ = self->priv->notification_rows;
	_tmp1__length1 = self->priv->notification_rows_length1;
	{
		TubaDialogsNotificationSettingsNotificationRow** row_collection = NULL;
		gint row_collection_length1 = 0;
		gint _row_collection_size_ = 0;
		gint row_it = 0;
		row_collection = _tmp1_;
		row_collection_length1 = _tmp1__length1;
		for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
			TubaDialogsNotificationSettingsNotificationRow* _tmp2_;
			TubaDialogsNotificationSettingsNotificationRow* row = NULL;
			_tmp2_ = _g_object_ref0 (row_collection[row_it]);
			row = _tmp2_;
			{
				TubaDialogsNotificationSettingsNotificationRow* _tmp3_;
				gboolean _tmp4_;
				gboolean _tmp5_;
				_tmp3_ = row;
				_tmp4_ = tuba_dialogs_notification_settings_notification_row_get_active (_tmp3_);
				_tmp5_ = _tmp4_;
				if (!_tmp5_) {
					TubaDialogsNotificationSettingsNotificationRow* _tmp6_;
					const gchar* _tmp7_;
					const gchar* _tmp8_;
					gchar* _tmp9_;
					_tmp6_ = row;
					_tmp7_ = tuba_dialogs_notification_settings_notification_row_get_kind (_tmp6_);
					_tmp8_ = _tmp7_;
					_tmp9_ = g_strdup (_tmp8_);
					_vala_array_add11 (&new_filters, &new_filters_length1, &_new_filters_size_, _tmp9_);
				}
				_g_object_unref0 (row);
			}
		}
	}
	_tmp10_ = new_filters;
	_tmp10__length1 = new_filters_length1;
	_tmp11_ = tuba_settings;
	_tmp12_ = tuba_settings_get_notification_filters (_tmp11_, &_tmp13_);
	_tmp12__length1 = _tmp13_;
	_tmp14_ = _tmp12_;
	_tmp14__length1 = _tmp12__length1;
	if (_tmp10__length1 != _tmp14__length1) {
		changed = TRUE;
	} else {
		gchar** _tmp15_;
		gint _tmp15__length1;
		_tmp15_ = new_filters;
		_tmp15__length1 = new_filters_length1;
		{
			gchar** filter_collection = NULL;
			gint filter_collection_length1 = 0;
			gint _filter_collection_size_ = 0;
			gint filter_it = 0;
			filter_collection = _tmp15_;
			filter_collection_length1 = _tmp15__length1;
			for (filter_it = 0; filter_it < filter_collection_length1; filter_it = filter_it + 1) {
				gchar* _tmp16_;
				gchar* filter = NULL;
				_tmp16_ = g_strdup (filter_collection[filter_it]);
				filter = _tmp16_;
				{
					const gchar* _tmp17_;
					TubaSettings* _tmp18_;
					gchar** _tmp19_;
					gint _tmp19__length1;
					gint _tmp20_ = 0;
					gchar** _tmp21_;
					gint _tmp21__length1;
					_tmp17_ = filter;
					_tmp18_ = tuba_settings;
					_tmp19_ = tuba_settings_get_notification_filters (_tmp18_, &_tmp20_);
					_tmp19__length1 = _tmp20_;
					_tmp21_ = _tmp19_;
					_tmp21__length1 = _tmp19__length1;
					if (!_vala_string_array_contains (_tmp21_, _tmp21__length1, _tmp17_)) {
						changed = TRUE;
						_g_free0 (filter);
						break;
					}
					_g_free0 (filter);
				}
			}
		}
	}
	if (changed) {
		TubaSettings* _tmp22_;
		gchar** _tmp23_;
		gint _tmp23__length1;
		_tmp22_ = tuba_settings;
		_tmp23_ = new_filters;
		_tmp23__length1 = new_filters_length1;
		tuba_settings_set_notification_filters (_tmp22_, _tmp23_, _tmp23__length1);
		g_signal_emit (self, tuba_dialogs_notification_settings_signals[TUBA_DIALOGS_NOTIFICATION_SETTINGS_FILTERS_CHANGED_SIGNAL], 0);
	}
	_tmp24_ = self->priv->notification_filter_policy_status;
	if (_tmp24_ != NULL) {
		Block25Data* _data25_;
		GeeHashMap* _tmp25_;
		GeeHashMap* _tmp61_;
		_data25_ = g_slice_new0 (Block25Data);
		_data25_->_ref_count_ = 1;
		_data25_->self = g_object_ref (self);
		_data25_->nfp_changed = FALSE;
		_tmp25_ = self->priv->notification_filter_policy_status;
		gee_abstract_map_foreach ((GeeAbstractMap*) _tmp25_, ____lambda328__gee_forall_func, _data25_);
		if (_data25_->nfp_changed) {
			JsonBuilder* builder = NULL;
			JsonBuilder* _tmp26_;
			JsonBuilder* _tmp27_;
			JsonBuilder* _tmp28_;
			JsonBuilder* _tmp29_;
			AdwSwitchRow* _tmp30_;
			gboolean _tmp31_;
			gboolean _tmp32_;
			JsonBuilder* _tmp33_;
			JsonBuilder* _tmp34_;
			AdwSwitchRow* _tmp35_;
			gboolean _tmp36_;
			gboolean _tmp37_;
			JsonBuilder* _tmp38_;
			JsonBuilder* _tmp39_;
			AdwSwitchRow* _tmp40_;
			gboolean _tmp41_;
			gboolean _tmp42_;
			JsonBuilder* _tmp43_;
			JsonBuilder* _tmp44_;
			AdwSwitchRow* _tmp45_;
			gboolean _tmp46_;
			gboolean _tmp47_;
			JsonBuilder* _tmp48_;
			TubaRequest* _tmp49_;
			TubaRequest* _tmp50_;
			TubaAccountStore* _tmp51_;
			TubaInstanceAccount* _tmp52_;
			TubaInstanceAccount* _tmp53_;
			TubaRequest* _tmp54_;
			TubaRequest* _tmp55_;
			JsonBuilder* _tmp56_;
			TubaRequest* _tmp57_;
			TubaRequest* _tmp58_;
			TubaRequest* _tmp59_;
			TubaRequest* _tmp60_;
			_tmp26_ = json_builder_new ();
			builder = _tmp26_;
			_tmp27_ = builder;
			json_builder_begin_object (_tmp27_);
			_tmp28_ = builder;
			json_builder_set_member_name (_tmp28_, "filter_not_following");
			_tmp29_ = builder;
			_tmp30_ = self->filter_notifications_following_switch;
			_tmp31_ = adw_switch_row_get_active (_tmp30_);
			_tmp32_ = _tmp31_;
			json_builder_add_boolean_value (_tmp29_, _tmp32_);
			_tmp33_ = builder;
			json_builder_set_member_name (_tmp33_, "filter_not_followers");
			_tmp34_ = builder;
			_tmp35_ = self->filter_notifications_follower_switch;
			_tmp36_ = adw_switch_row_get_active (_tmp35_);
			_tmp37_ = _tmp36_;
			json_builder_add_boolean_value (_tmp34_, _tmp37_);
			_tmp38_ = builder;
			json_builder_set_member_name (_tmp38_, "filter_new_accounts");
			_tmp39_ = builder;
			_tmp40_ = self->filter_notifications_new_account_switch;
			_tmp41_ = adw_switch_row_get_active (_tmp40_);
			_tmp42_ = _tmp41_;
			json_builder_add_boolean_value (_tmp39_, _tmp42_);
			_tmp43_ = builder;
			json_builder_set_member_name (_tmp43_, "filter_private_mentions");
			_tmp44_ = builder;
			_tmp45_ = self->filter_notifications_dm_switch;
			_tmp46_ = adw_switch_row_get_active (_tmp45_);
			_tmp47_ = _tmp46_;
			json_builder_add_boolean_value (_tmp44_, _tmp47_);
			_tmp48_ = builder;
			json_builder_end_object (_tmp48_);
			_tmp49_ = tuba_request_new_PUT ("/api/v1/notifications/policy");
			_tmp50_ = _tmp49_;
			_tmp51_ = tuba_accounts;
			_tmp52_ = tuba_account_store_get_active (_tmp51_);
			_tmp53_ = _tmp52_;
			_tmp54_ = tuba_request_with_account (_tmp50_, _tmp53_);
			_tmp55_ = _tmp54_;
			_tmp56_ = builder;
			_tmp57_ = tuba_request_body_json (_tmp55_, _tmp56_);
			_tmp58_ = _tmp57_;
			_tmp59_ = tuba_request_exec (_tmp58_);
			_tmp60_ = _tmp59_;
			_g_object_unref0 (_tmp60_);
			_g_object_unref0 (_tmp58_);
			_g_object_unref0 (_tmp55_);
			_g_object_unref0 (_tmp50_);
			_g_object_unref0 (builder);
		}
		_tmp61_ = self->priv->notification_filter_policy_status;
		gee_abstract_map_clear ((GeeAbstractMap*) _tmp61_);
		block25_data_unref (_data25_);
		_data25_ = NULL;
	}
	new_filters = (_vala_array_free (new_filters, new_filters_length1, (GDestroyNotify) g_free), NULL);
}

static Block26Data*
block26_data_ref (Block26Data* _data26_)
{
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}

static void
block26_data_unref (void * _userdata_)
{
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		TubaDialogsNotificationSettings* self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->dlg);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}

static void
___lambda330_ (TubaDialogsNotificationSettings* self,
               GError** error)
{
	GtkButton* _tmp0_;
	TubaApplication* _tmp1_;
	_tmp0_ = self->clear_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, TRUE);
	adw_dialog_force_close ((AdwDialog*) self);
	_tmp1_ = tuba_app;
	g_signal_emit_by_name (_tmp1_, "refresh");
}

static void
____lambda330__tuba_network_success_callback (GInputStream* in_stream,
                                              SoupMessageHeaders* response_headers,
                                              gpointer self,
                                              GError** error)
{
	___lambda330_ ((TubaDialogsNotificationSettings*) self, error);
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
___lambda331_ (TubaDialogsNotificationSettings* self,
               gint32 code,
               const gchar* message)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	AdwToastOverlay* _tmp5_;
	AdwToast* _tmp6_ = NULL;
	g_return_if_fail (message != NULL);
	_tmp0_ = g_strdup_printf ("%i", code);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_to_string (message);
	_tmp3_ = g_strconcat ("Error while trying to clear notifications: ", _tmp1_, " ", _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	g_warning ("NotificationSettings.vala:151: %s", _tmp4_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp1_);
	_tmp5_ = self->toast_overlay;
	_tmp6_ = adw_toast_new (message);
	adw_toast_set_timeout (_tmp6_, (guint) 5);
	adw_toast_overlay_add_toast (_tmp5_, _tmp6_);
}

static void
____lambda331__tuba_network_error_callback (gint32 code,
                                            const gchar* reason,
                                            gpointer self)
{
	___lambda331_ ((TubaDialogsNotificationSettings*) self, code, reason);
}

static void
__lambda329_ (Block26Data* _data26_,
              GObject* obj,
              GAsyncResult* res)
{
	TubaDialogsNotificationSettings* self;
	const gchar* _tmp0_;
	self = _data26_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = adw_alert_dialog_choose_finish (_data26_->dlg, res);
	if (g_strcmp0 (_tmp0_, "yes") == 0) {
		GtkButton* _tmp1_;
		TubaRequest* _tmp2_;
		TubaRequest* _tmp3_;
		TubaAccountStore* _tmp4_;
		TubaInstanceAccount* _tmp5_;
		TubaInstanceAccount* _tmp6_;
		TubaRequest* _tmp7_;
		TubaRequest* _tmp8_;
		TubaRequest* _tmp9_;
		TubaRequest* _tmp10_;
		TubaRequest* _tmp11_;
		TubaRequest* _tmp12_;
		TubaRequest* _tmp13_;
		TubaRequest* _tmp14_;
		_tmp1_ = self->clear_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, FALSE);
		_tmp2_ = tuba_request_new_POST ("/api/v1/notifications/clear");
		_tmp3_ = _tmp2_;
		_tmp4_ = tuba_accounts;
		_tmp5_ = tuba_account_store_get_active (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = tuba_request_with_account (_tmp3_, _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = tuba_request_then (_tmp8_, ____lambda330__tuba_network_success_callback, g_object_ref (self), g_object_unref);
		_tmp10_ = _tmp9_;
		_tmp11_ = tuba_request_on_error (_tmp10_, ____lambda331__tuba_network_error_callback, g_object_ref (self), g_object_unref);
		_tmp12_ = _tmp11_;
		_tmp13_ = tuba_request_exec (_tmp12_);
		_tmp14_ = _tmp13_;
		_g_object_unref0 (_tmp14_);
		_g_object_unref0 (_tmp12_);
		_g_object_unref0 (_tmp10_);
		_g_object_unref0 (_tmp8_);
		_g_object_unref0 (_tmp3_);
	}
}

static void
___lambda329__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda329_ (self, source_object, res);
	block26_data_unref (self);
}

static void
tuba_dialogs_notification_settings_clear_all_notifications (TubaDialogsNotificationSettings* self)
{
	Block26Data* _data26_;
	AdwAlertDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data26_ = g_slice_new0 (Block26Data);
	_data26_->_ref_count_ = 1;
	_data26_->self = g_object_ref (self);
	_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Clear All Notifications?"), NULL);
	g_object_ref_sink (_tmp0_);
	_data26_->dlg = _tmp0_;
	adw_alert_dialog_add_response (_data26_->dlg, "no", _ ("Cancel"));
	adw_alert_dialog_set_response_appearance (_data26_->dlg, "no", ADW_RESPONSE_DEFAULT);
	adw_alert_dialog_add_response (_data26_->dlg, "yes", _ ("Clear"));
	adw_alert_dialog_set_response_appearance (_data26_->dlg, "yes", ADW_RESPONSE_DESTRUCTIVE);
	adw_alert_dialog_choose (_data26_->dlg, (GtkWidget*) self, NULL, ___lambda329__gasync_ready_callback, block26_data_ref (_data26_));
	block26_data_unref (_data26_);
	_data26_ = NULL;
}

static void
_tuba_dialogs_notification_settings_clear_all_notifications_gtk_button_clicked (GtkButton* _sender,
                                                                                gpointer self)
{
	tuba_dialogs_notification_settings_clear_all_notifications ((TubaDialogsNotificationSettings*) self);
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gboolean
__lambda333_ (TubaDialogsNotificationSettings* self,
              GeeMapEntry* entry)
{
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	gconstpointer _tmp3_;
	gboolean result;
	g_return_val_if_fail (entry != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_key (entry);
	_tmp1_ = _tmp0_;
	_tmp2_ = gee_map_entry_get_value (entry);
	_tmp3_ = _tmp2_;
	adw_switch_row_set_active (G_TYPE_CHECK_INSTANCE_CAST ((AdwSwitchRow*) _tmp1_, adw_switch_row_get_type (), AdwSwitchRow), (gboolean) ((gboolean) ((gintptr) _tmp3_)));
	result = TRUE;
	_g_object_unref0 (entry);
	return result;
}

static gboolean
___lambda333__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda333_ ((TubaDialogsNotificationSettings*) self, (GeeMapEntry*) g);
	return result;
}

static void
__lambda332_ (TubaDialogsNotificationSettings* self,
              GInputStream* in_stream,
              GError** error)
{
	JsonParser* parser = NULL;
	JsonParser* _tmp0_;
	JsonNode* node = NULL;
	TubaNetwork* _tmp1_;
	JsonParser* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	AdwPreferencesGroup* _tmp5_;
	TubaAPINotificationFilterPolicy* policies = NULL;
	JsonNode* _tmp6_;
	TubaAPINotificationFilterPolicy* _tmp7_;
	GeeHashMap* _tmp8_;
	GeeHashMap* _tmp9_;
	AdwSwitchRow* _tmp10_;
	TubaAPINotificationFilterPolicy* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	GeeHashMap* _tmp14_;
	AdwSwitchRow* _tmp15_;
	TubaAPINotificationFilterPolicy* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	GeeHashMap* _tmp19_;
	AdwSwitchRow* _tmp20_;
	TubaAPINotificationFilterPolicy* _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp23_;
	GeeHashMap* _tmp24_;
	AdwSwitchRow* _tmp25_;
	TubaAPINotificationFilterPolicy* _tmp26_;
	gboolean _tmp27_;
	gboolean _tmp28_;
	GeeHashMap* _tmp29_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (in_stream != NULL);
	_tmp0_ = tuba_network_get_parser_from_inputstream (in_stream, &_inner_error0_);
	parser = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp1_ = tuba_network;
	_tmp2_ = parser;
	_tmp3_ = tuba_network_parse_node (_tmp1_, _tmp2_);
	node = _tmp3_;
	_tmp4_ = node;
	if (_tmp4_ == NULL) {
		__vala_JsonNode_free0 (node);
		_g_object_unref0 (parser);
		return;
	}
	_tmp5_ = self->filtered_notifications_group;
	gtk_widget_set_visible ((GtkWidget*) _tmp5_, TRUE);
	_tmp6_ = node;
	_tmp7_ = tuba_api_notification_filter_policy_from (_tmp6_, &_inner_error0_);
	policies = _tmp7_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		__vala_JsonNode_free0 (node);
		_g_object_unref0 (parser);
		return;
	}
	_tmp8_ = gee_hash_map_new (adw_switch_row_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_BOOLEAN, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->notification_filter_policy_status);
	self->priv->notification_filter_policy_status = _tmp8_;
	_tmp9_ = self->priv->notification_filter_policy_status;
	_tmp10_ = self->filter_notifications_following_switch;
	_tmp11_ = policies;
	_tmp12_ = tuba_api_notification_filter_policy_get_filter_not_following (_tmp11_);
	_tmp13_ = _tmp12_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, _tmp10_, (gpointer) ((gintptr) _tmp13_));
	_tmp14_ = self->priv->notification_filter_policy_status;
	_tmp15_ = self->filter_notifications_follower_switch;
	_tmp16_ = policies;
	_tmp17_ = tuba_api_notification_filter_policy_get_filter_not_followers (_tmp16_);
	_tmp18_ = _tmp17_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp14_, _tmp15_, (gpointer) ((gintptr) _tmp18_));
	_tmp19_ = self->priv->notification_filter_policy_status;
	_tmp20_ = self->filter_notifications_new_account_switch;
	_tmp21_ = policies;
	_tmp22_ = tuba_api_notification_filter_policy_get_filter_new_accounts (_tmp21_);
	_tmp23_ = _tmp22_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp19_, _tmp20_, (gpointer) ((gintptr) _tmp23_));
	_tmp24_ = self->priv->notification_filter_policy_status;
	_tmp25_ = self->filter_notifications_dm_switch;
	_tmp26_ = policies;
	_tmp27_ = tuba_api_notification_filter_policy_get_filter_private_mentions (_tmp26_);
	_tmp28_ = _tmp27_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp24_, _tmp25_, (gpointer) ((gintptr) _tmp28_));
	_tmp29_ = self->priv->notification_filter_policy_status;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp29_, ___lambda333__gee_forall_func, self);
	_g_object_unref0 (policies);
	__vala_JsonNode_free0 (node);
	_g_object_unref0 (parser);
}

static void
___lambda332__tuba_network_success_callback (GInputStream* in_stream,
                                             SoupMessageHeaders* response_headers,
                                             gpointer self,
                                             GError** error)
{
	__lambda332_ ((TubaDialogsNotificationSettings*) self, in_stream, error);
}

static void
__lambda334_ (TubaDialogsNotificationSettings* self,
              gint32 code,
              const gchar* message)
{
	g_return_if_fail (message != NULL);
	if (code == ((gint32) 404)) {
		TubaAccountStore* _tmp0_;
		TubaInstanceAccount* _tmp1_;
		TubaInstanceAccount* _tmp2_;
		_tmp0_ = tuba_accounts;
		_tmp1_ = tuba_account_store_get_active (_tmp0_);
		_tmp2_ = _tmp1_;
		tuba_instance_account_set_tuba_probably_has_notification_filters (_tmp2_, FALSE);
	} else {
		gchar* _tmp3_;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = g_strdup_printf ("%i", code);
		_tmp4_ = _tmp3_;
		_tmp5_ = string_to_string (message);
		_tmp6_ = g_strconcat ("Error while trying to get notification policy: ", _tmp4_, " ", _tmp5_, NULL);
		_tmp7_ = _tmp6_;
		g_warning ("NotificationSettings.vala:191: %s", _tmp7_);
		_g_free0 (_tmp7_);
		_g_free0 (_tmp4_);
	}
}

static void
___lambda334__tuba_network_error_callback (gint32 code,
                                           const gchar* reason,
                                           gpointer self)
{
	__lambda334_ ((TubaDialogsNotificationSettings*) self, code, reason);
}

static void
tuba_dialogs_notification_settings_setup_notification_filters (TubaDialogsNotificationSettings* self)
{
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	TubaRequest* _tmp5_;
	TubaRequest* _tmp6_;
	TubaAccountStore* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaRequest* _tmp10_;
	TubaRequest* _tmp11_;
	TubaRequest* _tmp12_;
	TubaRequest* _tmp13_;
	TubaRequest* _tmp14_;
	TubaRequest* _tmp15_;
	TubaRequest* _tmp16_;
	TubaRequest* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_accounts;
	_tmp1_ = tuba_account_store_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = tuba_instance_account_get_tuba_probably_has_notification_filters (_tmp2_);
	_tmp4_ = _tmp3_;
	if (!_tmp4_) {
		return;
	}
	_tmp5_ = tuba_request_new_GET ("/api/v1/notifications/policy");
	_tmp6_ = _tmp5_;
	_tmp7_ = tuba_accounts;
	_tmp8_ = tuba_account_store_get_active (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = tuba_request_with_account (_tmp6_, _tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = tuba_request_then (_tmp11_, ___lambda332__tuba_network_success_callback, g_object_ref (self), g_object_unref);
	_tmp13_ = _tmp12_;
	_tmp14_ = tuba_request_on_error (_tmp13_, ___lambda334__tuba_network_error_callback, g_object_ref (self), g_object_unref);
	_tmp15_ = _tmp14_;
	_tmp16_ = tuba_request_exec (_tmp15_);
	_tmp17_ = _tmp16_;
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (_tmp15_);
	_g_object_unref0 (_tmp13_);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (_tmp6_);
}

TubaDialogsNotificationSettings*
tuba_dialogs_notification_settings_construct (GType object_type)
{
	TubaDialogsNotificationSettings * self = NULL;
	self = (TubaDialogsNotificationSettings*) g_object_new (object_type, NULL);
	return self;
}

TubaDialogsNotificationSettings*
tuba_dialogs_notification_settings_new (void)
{
	return tuba_dialogs_notification_settings_construct (TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS);
}

static inline gpointer
tuba_dialogs_notification_settings_notification_row_get_instance_private (TubaDialogsNotificationSettingsNotificationRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsNotificationSettingsNotificationRow_private_offset);
}

static TubaDialogsNotificationSettingsNotificationRow*
tuba_dialogs_notification_settings_notification_row_construct (GType object_type,
                                                               const gchar* kind,
                                                               const gchar* title,
                                                               const gchar* icon)
{
	TubaDialogsNotificationSettingsNotificationRow * self = NULL;
	GtkSwitch* _tmp0_ = NULL;
	GtkSwitch* _tmp1_;
	TubaSettings* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gint _tmp4_ = 0;
	gchar** _tmp5_;
	gint _tmp5__length1;
	GtkImage* _tmp6_ = NULL;
	GtkImage* _tmp7_;
	GtkSwitch* _tmp8_;
	g_return_val_if_fail (kind != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (icon != NULL, NULL);
	self = (TubaDialogsNotificationSettingsNotificationRow*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->row_switch);
	self->priv->row_switch = _tmp0_;
	_tmp1_ = self->priv->row_switch;
	adw_action_row_set_activatable_widget ((AdwActionRow*) self, (GtkWidget*) _tmp1_);
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, title);
	tuba_dialogs_notification_settings_notification_row_set_kind (self, kind);
	_tmp2_ = tuba_settings;
	_tmp3_ = tuba_settings_get_notification_filters (_tmp2_, &_tmp4_);
	_tmp3__length1 = _tmp4_;
	_tmp5_ = _tmp3_;
	_tmp5__length1 = _tmp3__length1;
	tuba_dialogs_notification_settings_notification_row_set_active (self, !_vala_string_array_contains (_tmp5_, _tmp5__length1, kind));
	_tmp6_ = (GtkImage*) gtk_image_new_from_icon_name (icon);
	gtk_widget_set_valign ((GtkWidget*) _tmp6_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	adw_action_row_add_prefix ((AdwActionRow*) self, (GtkWidget*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = self->priv->row_switch;
	adw_action_row_add_suffix ((AdwActionRow*) self, (GtkWidget*) _tmp8_);
	return self;
}

static TubaDialogsNotificationSettingsNotificationRow*
tuba_dialogs_notification_settings_notification_row_new (const gchar* kind,
                                                         const gchar* title,
                                                         const gchar* icon)
{
	return tuba_dialogs_notification_settings_notification_row_construct (TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW, kind, title, icon);
}

static gboolean
tuba_dialogs_notification_settings_notification_row_get_active (TubaDialogsNotificationSettingsNotificationRow* self)
{
	gboolean result;
	GtkSwitch* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->row_switch;
	_tmp1_ = gtk_switch_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
tuba_dialogs_notification_settings_notification_row_set_active (TubaDialogsNotificationSettingsNotificationRow* self,
                                                                gboolean value)
{
	GtkSwitch* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->row_switch;
	gtk_switch_set_active (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_notification_settings_notification_row_properties[TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_ACTIVE_PROPERTY]);
}

static const gchar*
tuba_dialogs_notification_settings_notification_row_get_kind (TubaDialogsNotificationSettingsNotificationRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_kind;
	result = _tmp0_;
	return result;
}

static void
tuba_dialogs_notification_settings_notification_row_set_kind (TubaDialogsNotificationSettingsNotificationRow* self,
                                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_notification_settings_notification_row_get_kind (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_kind);
		self->priv->_kind = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_notification_settings_notification_row_properties[TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_KIND_PROPERTY]);
	}
}

static void
tuba_dialogs_notification_settings_notification_row_class_init (TubaDialogsNotificationSettingsNotificationRowClass * klass,
                                                                gpointer klass_data)
{
	tuba_dialogs_notification_settings_notification_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsNotificationSettingsNotificationRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_notification_settings_notification_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_dialogs_notification_settings_notification_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_notification_settings_notification_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_ACTIVE_PROPERTY, tuba_dialogs_notification_settings_notification_row_properties[TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_ACTIVE_PROPERTY] = g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_KIND_PROPERTY, tuba_dialogs_notification_settings_notification_row_properties[TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_KIND_PROPERTY] = g_param_spec_string ("kind", "kind", "kind", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_dialogs_notification_settings_notification_row_instance_init (TubaDialogsNotificationSettingsNotificationRow * self,
                                                                   gpointer klass)
{
	self->priv = tuba_dialogs_notification_settings_notification_row_get_instance_private (self);
}

static void
tuba_dialogs_notification_settings_notification_row_finalize (GObject * obj)
{
	TubaDialogsNotificationSettingsNotificationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW, TubaDialogsNotificationSettingsNotificationRow);
	_g_free0 (self->priv->_kind);
	_g_object_unref0 (self->priv->row_switch);
	G_OBJECT_CLASS (tuba_dialogs_notification_settings_notification_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_notification_settings_notification_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsNotificationSettingsNotificationRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_notification_settings_notification_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsNotificationSettingsNotificationRow), 0, (GInstanceInitFunc) tuba_dialogs_notification_settings_notification_row_instance_init, NULL };
	GType tuba_dialogs_notification_settings_notification_row_type_id;
	tuba_dialogs_notification_settings_notification_row_type_id = g_type_register_static (adw_action_row_get_type (), "TubaDialogsNotificationSettingsNotificationRow", &g_define_type_info, 0);
	TubaDialogsNotificationSettingsNotificationRow_private_offset = g_type_add_instance_private (tuba_dialogs_notification_settings_notification_row_type_id, sizeof (TubaDialogsNotificationSettingsNotificationRowPrivate));
	return tuba_dialogs_notification_settings_notification_row_type_id;
}

static GType
tuba_dialogs_notification_settings_notification_row_get_type (void)
{
	static gsize tuba_dialogs_notification_settings_notification_row_type_id__once = 0;
	if (g_once_init_enter (&tuba_dialogs_notification_settings_notification_row_type_id__once)) {
		GType tuba_dialogs_notification_settings_notification_row_type_id;
		tuba_dialogs_notification_settings_notification_row_type_id = tuba_dialogs_notification_settings_notification_row_get_type_once ();
		g_once_init_leave (&tuba_dialogs_notification_settings_notification_row_type_id__once, tuba_dialogs_notification_settings_notification_row_type_id);
	}
	return tuba_dialogs_notification_settings_notification_row_type_id__once;
}

static void
_vala_tuba_dialogs_notification_settings_notification_row_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec)
{
	TubaDialogsNotificationSettingsNotificationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW, TubaDialogsNotificationSettingsNotificationRow);
	switch (property_id) {
		case TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_ACTIVE_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_notification_settings_notification_row_get_active (self));
		break;
		case TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_KIND_PROPERTY:
		g_value_set_string (value, tuba_dialogs_notification_settings_notification_row_get_kind (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_dialogs_notification_settings_notification_row_set_property (GObject * object,
                                                                        guint property_id,
                                                                        const GValue * value,
                                                                        GParamSpec * pspec)
{
	TubaDialogsNotificationSettingsNotificationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_NOTIFICATION_SETTINGS_TYPE_NOTIFICATION_ROW, TubaDialogsNotificationSettingsNotificationRow);
	switch (property_id) {
		case TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_ACTIVE_PROPERTY:
		tuba_dialogs_notification_settings_notification_row_set_active (self, g_value_get_boolean (value));
		break;
		case TUBA_DIALOGS_NOTIFICATION_SETTINGS_NOTIFICATION_ROW_KIND_PROPERTY:
		tuba_dialogs_notification_settings_notification_row_set_kind (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_tuba_dialogs_notification_settings_save_adw_dialog_closed (AdwDialog* _sender,
                                                            gpointer self)
{
	tuba_dialogs_notification_settings_save ((TubaDialogsNotificationSettings*) self);
}

static GObject *
tuba_dialogs_notification_settings_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaDialogsNotificationSettings * self;
	TubaDialogsNotificationSettingsNotificationRow* _tmp0_;
	TubaDialogsNotificationSettingsNotificationRow* _tmp1_;
	TubaDialogsNotificationSettingsNotificationRow* _tmp2_;
	TubaDialogsNotificationSettingsNotificationRow* _tmp3_;
	TubaDialogsNotificationSettingsNotificationRow* _tmp4_;
	TubaDialogsNotificationSettingsNotificationRow* _tmp5_;
	TubaDialogsNotificationSettingsNotificationRow** _tmp6_;
	TubaDialogsNotificationSettingsNotificationRow** _tmp7_;
	gint _tmp7__length1;
	parent_class = G_OBJECT_CLASS (tuba_dialogs_notification_settings_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS, TubaDialogsNotificationSettings);
	_tmp0_ = tuba_dialogs_notification_settings_notification_row_new (TUBA_INSTANCE_ACCOUNT_KIND_MENTION, _ ("Mentions"), "tuba-chat-symbolic");
	g_object_ref_sink (_tmp0_);
	_tmp1_ = tuba_dialogs_notification_settings_notification_row_new (TUBA_INSTANCE_ACCOUNT_KIND_FAVOURITE, _ ("Favorites"), "tuba-starred-symbolic");
	g_object_ref_sink (_tmp1_);
	_tmp2_ = tuba_dialogs_notification_settings_notification_row_new (TUBA_INSTANCE_ACCOUNT_KIND_REBLOG, _ ("Boosts"), "tuba-media-playlist-repeat-symbolic");
	g_object_ref_sink (_tmp2_);
	_tmp3_ = tuba_dialogs_notification_settings_notification_row_new (TUBA_INSTANCE_ACCOUNT_KIND_POLL, _ ("Polls"), "tuba-check-round-outline-symbolic");
	g_object_ref_sink (_tmp3_);
	_tmp4_ = tuba_dialogs_notification_settings_notification_row_new (TUBA_INSTANCE_ACCOUNT_KIND_EDITED, _ ("Post Edits"), "document-edit-symbolic");
	g_object_ref_sink (_tmp4_);
	_tmp5_ = tuba_dialogs_notification_settings_notification_row_new (TUBA_INSTANCE_ACCOUNT_KIND_FOLLOW, _ ("Follows"), "contact-new-symbolic");
	g_object_ref_sink (_tmp5_);
	_tmp6_ = g_new0 (TubaDialogsNotificationSettingsNotificationRow*, 6 + 1);
	_tmp6_[0] = _tmp0_;
	_tmp6_[1] = _tmp1_;
	_tmp6_[2] = _tmp2_;
	_tmp6_[3] = _tmp3_;
	_tmp6_[4] = _tmp4_;
	_tmp6_[5] = _tmp5_;
	self->priv->notification_rows = (_vala_array_free (self->priv->notification_rows, self->priv->notification_rows_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->notification_rows = _tmp6_;
	self->priv->notification_rows_length1 = 6;
	self->priv->_notification_rows_size_ = self->priv->notification_rows_length1;
	_tmp7_ = self->priv->notification_rows;
	_tmp7__length1 = self->priv->notification_rows_length1;
	{
		TubaDialogsNotificationSettingsNotificationRow** row_collection = NULL;
		gint row_collection_length1 = 0;
		gint _row_collection_size_ = 0;
		gint row_it = 0;
		row_collection = _tmp7_;
		row_collection_length1 = _tmp7__length1;
		for (row_it = 0; row_it < row_collection_length1; row_it = row_it + 1) {
			TubaDialogsNotificationSettingsNotificationRow* _tmp8_;
			TubaDialogsNotificationSettingsNotificationRow* row = NULL;
			_tmp8_ = _g_object_ref0 (row_collection[row_it]);
			row = _tmp8_;
			{
				AdwPreferencesGroup* _tmp9_;
				TubaDialogsNotificationSettingsNotificationRow* _tmp10_;
				_tmp9_ = self->filters_group;
				_tmp10_ = row;
				adw_preferences_group_add (_tmp9_, (GtkWidget*) _tmp10_);
				_g_object_unref0 (row);
			}
		}
	}
	g_signal_connect_object ((AdwDialog*) self, "closed", (GCallback) _tuba_dialogs_notification_settings_save_adw_dialog_closed, self, 0);
	tuba_dialogs_notification_settings_setup_notification_filters (self);
	return obj;
}

static void
tuba_dialogs_notification_settings_class_init (TubaDialogsNotificationSettingsClass * klass,
                                               gpointer klass_data)
{
	tuba_dialogs_notification_settings_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsNotificationSettings_private_offset);
	G_OBJECT_CLASS (klass)->constructor = tuba_dialogs_notification_settings_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_notification_settings_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/dialogs/notification_settings.ui");
	tuba_dialogs_notification_settings_signals[TUBA_DIALOGS_NOTIFICATION_SETTINGS_FILTERS_CHANGED_SIGNAL] = g_signal_new ("filters-changed", TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "toast_overlay", FALSE, G_STRUCT_OFFSET (TubaDialogsNotificationSettings, toast_overlay));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "clear_button", FALSE, G_STRUCT_OFFSET (TubaDialogsNotificationSettings, clear_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filters_group", FALSE, G_STRUCT_OFFSET (TubaDialogsNotificationSettings, filters_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filtered_notifications_group", FALSE, G_STRUCT_OFFSET (TubaDialogsNotificationSettings, filtered_notifications_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filter_notifications_following_switch", FALSE, G_STRUCT_OFFSET (TubaDialogsNotificationSettings, filter_notifications_following_switch));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filter_notifications_follower_switch", FALSE, G_STRUCT_OFFSET (TubaDialogsNotificationSettings, filter_notifications_follower_switch));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filter_notifications_new_account_switch", FALSE, G_STRUCT_OFFSET (TubaDialogsNotificationSettings, filter_notifications_new_account_switch));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "filter_notifications_dm_switch", FALSE, G_STRUCT_OFFSET (TubaDialogsNotificationSettings, filter_notifications_dm_switch));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "clear_all_notifications", G_CALLBACK(_tuba_dialogs_notification_settings_clear_all_notifications_gtk_button_clicked));
}

static void
tuba_dialogs_notification_settings_instance_init (TubaDialogsNotificationSettings * self,
                                                  gpointer klass)
{
	self->priv = tuba_dialogs_notification_settings_get_instance_private (self);
	self->priv->notification_filter_policy_status = NULL;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_dialogs_notification_settings_finalize (GObject * obj)
{
	TubaDialogsNotificationSettings * self;
	TubaDialogsNotificationSettingsNotificationRow** _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_TYPE_NOTIFICATION_SETTINGS, TubaDialogsNotificationSettings);
	_tmp0_ = g_new0 (TubaDialogsNotificationSettingsNotificationRow*, 0 + 1);
	self->priv->notification_rows = (_vala_array_free (self->priv->notification_rows, self->priv->notification_rows_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->notification_rows = _tmp0_;
	self->priv->notification_rows_length1 = 0;
	self->priv->_notification_rows_size_ = self->priv->notification_rows_length1;
	g_debug ("NotificationSettings.vala:34: Destroying Dialog NotificationSettings");
	self->priv->notification_rows = (_vala_array_free (self->priv->notification_rows, self->priv->notification_rows_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->notification_filter_policy_status);
	G_OBJECT_CLASS (tuba_dialogs_notification_settings_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_notification_settings_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsNotificationSettingsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_notification_settings_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsNotificationSettings), 0, (GInstanceInitFunc) tuba_dialogs_notification_settings_instance_init, NULL };
	GType tuba_dialogs_notification_settings_type_id;
	tuba_dialogs_notification_settings_type_id = g_type_register_static (adw_dialog_get_type (), "TubaDialogsNotificationSettings", &g_define_type_info, 0);
	TubaDialogsNotificationSettings_private_offset = g_type_add_instance_private (tuba_dialogs_notification_settings_type_id, sizeof (TubaDialogsNotificationSettingsPrivate));
	return tuba_dialogs_notification_settings_type_id;
}

GType
tuba_dialogs_notification_settings_get_type (void)
{
	static gsize tuba_dialogs_notification_settings_type_id__once = 0;
	if (g_once_init_enter (&tuba_dialogs_notification_settings_type_id__once)) {
		GType tuba_dialogs_notification_settings_type_id;
		tuba_dialogs_notification_settings_type_id = tuba_dialogs_notification_settings_get_type_once ();
		g_once_init_leave (&tuba_dialogs_notification_settings_type_id__once, tuba_dialogs_notification_settings_type_id);
	}
	return tuba_dialogs_notification_settings_type_id__once;
}

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

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

