/* NotificationSettings.c generated by valac 0.56.19, 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 <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <json-glib/json-glib.h>
#include <libsoup/soup.h>
#include <glib/gi18n-lib.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 _Block30Data Block30Data;

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#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;

#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_OOPSIE (tuba_oopsie_get_type ())

#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;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaDialogsNotificationSettingsSaveRealData TubaDialogsNotificationSettingsSaveRealData;
typedef struct _TubaDialogsNotificationSettingsClearAllNotificationsRealData TubaDialogsNotificationSettingsClearAllNotificationsRealData;

#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 _TubaDialogsNotificationSettingsSetupNotificationFiltersData TubaDialogsNotificationSettingsSetupNotificationFiltersData;
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 _Block30Data {
	int _ref_count_;
	TubaDialogsNotificationSettings* self;
	gboolean nfp_changed;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaDialogsNotificationSettingsSaveRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsNotificationSettings* self;
	gboolean changed;
	gchar** new_filters;
	gchar** _tmp0_;
	gint new_filters_length1;
	gint _new_filters_size_;
	TubaDialogsNotificationSettingsNotificationRow** _tmp1_;
	gint _tmp1__length1;
	TubaDialogsNotificationSettingsNotificationRow** row_collection;
	gint row_collection_length1;
	gint _row_collection_size_;
	gint row_it;
	TubaDialogsNotificationSettingsNotificationRow* _tmp2_;
	TubaDialogsNotificationSettingsNotificationRow* row;
	TubaDialogsNotificationSettingsNotificationRow* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	TubaDialogsNotificationSettingsNotificationRow* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	TubaSettings* _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	gint _tmp13_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	gchar** _tmp15_;
	gint _tmp15__length1;
	gchar** filter_collection;
	gint filter_collection_length1;
	gint _filter_collection_size_;
	gint filter_it;
	gchar* _tmp16_;
	gchar* filter;
	const gchar* _tmp17_;
	TubaSettings* _tmp18_;
	gchar** _tmp19_;
	gint _tmp19__length1;
	gint _tmp20_;
	gchar** _tmp21_;
	gint _tmp21__length1;
	TubaSettings* _tmp22_;
	gchar** _tmp23_;
	gint _tmp23__length1;
	GeeHashMap* _tmp24_;
	Block30Data* _data30_;
	GeeHashMap* _tmp25_;
	JsonBuilder* builder;
	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_;
	TubaRequestV2* req;
	TubaAccountStore* _tmp49_;
	TubaInstanceAccount* _tmp50_;
	TubaInstanceAccount* _tmp51_;
	TubaInstanceAccount* _tmp52_;
	TubaRequestV2* _tmp53_;
	TubaRequestV2* _tmp54_;
	JsonBuilder* _tmp55_;
	TubaRequestV2* _tmp56_;
	GInputStream* _tmp57_;
	GInputStream* _tmp58_;
	GError* e;
	GError* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
	GError* _tmp62_;
	const gchar* _tmp63_;
	const gchar* _tmp64_;
	gchar* _tmp65_;
	gchar* _tmp66_;
	TubaApplication* _tmp67_;
	GError* _tmp68_;
	const gchar* _tmp69_;
	gchar* _tmp70_;
	gchar* _tmp71_;
	GeeHashMap* _tmp72_;
	GError* _inner_error0_;
};

struct _TubaDialogsNotificationSettingsClearAllNotificationsRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsNotificationSettings* self;
	AdwAlertDialog* dlg;
	AdwAlertDialog* _tmp0_;
	AdwAlertDialog* _tmp1_;
	AdwAlertDialog* _tmp2_;
	AdwAlertDialog* _tmp3_;
	AdwAlertDialog* _tmp4_;
	AdwAlertDialog* _tmp5_;
	const gchar* _tmp6_;
	GtkButton* _tmp7_;
	TubaRequestV2* req;
	TubaAccountStore* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaInstanceAccount* _tmp10_;
	TubaInstanceAccount* _tmp11_;
	TubaRequestV2* _tmp12_;
	TubaRequestV2* _tmp13_;
	GInputStream* _tmp14_;
	GInputStream* _tmp15_;
	GtkButton* _tmp16_;
	TubaApplication* _tmp17_;
	GError* e;
	GError* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	GError* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	AdwToastOverlay* _tmp26_;
	GError* _tmp27_;
	const gchar* _tmp28_;
	AdwToast* _tmp29_;
	GError* _inner_error0_;
};

struct _TubaDialogsNotificationSettingsSetupNotificationFiltersData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsNotificationSettings* self;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	TubaRequestV2* req;
	TubaAccountStore* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaRequestV2* _tmp9_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp10_;
	GInputStream* _tmp11_;
	JsonParser* parser;
	GInputStream* _tmp12_;
	JsonParser* _tmp13_;
	JsonNode* node;
	TubaNetwork* _tmp14_;
	JsonParser* _tmp15_;
	JsonNode* _tmp16_;
	JsonNode* _tmp17_;
	AdwPreferencesGroup* _tmp18_;
	TubaAPINotificationFilterPolicy* policies;
	JsonNode* _tmp19_;
	TubaAPINotificationFilterPolicy* _tmp20_;
	GeeHashMap* _tmp21_;
	GeeHashMap* _tmp22_;
	AdwSwitchRow* _tmp23_;
	TubaAPINotificationFilterPolicy* _tmp24_;
	gboolean _tmp25_;
	gboolean _tmp26_;
	GeeHashMap* _tmp27_;
	AdwSwitchRow* _tmp28_;
	TubaAPINotificationFilterPolicy* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	GeeHashMap* _tmp32_;
	AdwSwitchRow* _tmp33_;
	TubaAPINotificationFilterPolicy* _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_;
	GeeHashMap* _tmp37_;
	AdwSwitchRow* _tmp38_;
	TubaAPINotificationFilterPolicy* _tmp39_;
	gboolean _tmp40_;
	gboolean _tmp41_;
	GeeHashMap* _tmp42_;
	GError* e;
	GError* _tmp43_;
	TubaAccountStore* _tmp44_;
	TubaInstanceAccount* _tmp45_;
	TubaInstanceAccount* _tmp46_;
	GError* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	GError* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	gchar* _tmp53_;
	gchar* _tmp54_;
	GError* _inner_error0_;
};

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 void tuba_dialogs_notification_settings_save_real (TubaDialogsNotificationSettings* self,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void tuba_dialogs_notification_settings_save_real_finish (TubaDialogsNotificationSettings* self,
                                                          GAsyncResult* _res_);
static void tuba_dialogs_notification_settings_save_real_data_free (gpointer _data);
static gboolean tuba_dialogs_notification_settings_save_real_co (TubaDialogsNotificationSettingsSaveRealData* _data_);
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_add33 (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 Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
static gboolean ___lambda207_ (Block30Data* _data30_,
                        GeeMapEntry* entry);
static gboolean ____lambda207__gee_forall_func (gpointer g,
                                         gpointer self);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, 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 TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_set_body_from_json (TubaRequestV2* self,
                                         JsonBuilder* json_builder);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_dialogs_notification_settings_save_real_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
static void tuba_dialogs_notification_settings_clear_all_notifications (TubaDialogsNotificationSettings* self);
static void tuba_dialogs_notification_settings_clear_all_notifications_real (TubaDialogsNotificationSettings* self,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_);
static void tuba_dialogs_notification_settings_clear_all_notifications_real_finish (TubaDialogsNotificationSettings* self,
                                                                             GAsyncResult* _res_);
static void _tuba_dialogs_notification_settings_clear_all_notifications_gtk_button_clicked (GtkButton* _sender,
                                                                                     gpointer self);
static void tuba_dialogs_notification_settings_clear_all_notifications_real_data_free (gpointer _data);
static gboolean tuba_dialogs_notification_settings_clear_all_notifications_real_co (TubaDialogsNotificationSettingsClearAllNotificationsRealData* _data_);
static void tuba_dialogs_notification_settings_clear_all_notifications_real_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_);
static void tuba_dialogs_notification_settings_setup_notification_filters_data_free (gpointer _data);
static void tuba_dialogs_notification_settings_setup_notification_filters (TubaDialogsNotificationSettings* self,
                                                                    GAsyncReadyCallback _callback_,
                                                                    gpointer _user_data_);
static void tuba_dialogs_notification_settings_setup_notification_filters_finish (TubaDialogsNotificationSettings* self,
                                                                           GAsyncResult* _res_);
static gboolean tuba_dialogs_notification_settings_setup_notification_filters_co (TubaDialogsNotificationSettingsSetupNotificationFiltersData* _data_);
VALA_EXTERN gboolean tuba_instance_account_get_tuba_probably_has_notification_filters (TubaInstanceAccount* self);
static void tuba_dialogs_notification_settings_setup_notification_filters_ready (GObject* source_object,
                                                                          GAsyncResult* _res_,
                                                                          gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             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 ___lambda208_ (TubaDialogsNotificationSettings* self,
                        GeeMapEntry* entry);
static gboolean ____lambda208__gee_forall_func (gpointer g,
                                         gpointer self);
VALA_EXTERN void tuba_instance_account_set_tuba_probably_has_notification_filters (TubaInstanceAccount* self,
                                                                       gboolean value);
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 void
tuba_dialogs_notification_settings_save (TubaDialogsNotificationSettings* self)
{
	g_return_if_fail (self != NULL);
	tuba_dialogs_notification_settings_save_real (self, NULL, NULL);
}

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

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

static void
tuba_dialogs_notification_settings_save_real (TubaDialogsNotificationSettings* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	TubaDialogsNotificationSettingsSaveRealData* _data_;
	TubaDialogsNotificationSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaDialogsNotificationSettingsSaveRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_notification_settings_save_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_dialogs_notification_settings_save_real_co (_data_);
}

static void
tuba_dialogs_notification_settings_save_real_finish (TubaDialogsNotificationSettings* self,
                                                     GAsyncResult* _res_)
{
	TubaDialogsNotificationSettingsSaveRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
_vala_array_add33 (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 Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		TubaDialogsNotificationSettings* self;
		self = _data30_->self;
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}

static gboolean
___lambda207_ (Block30Data* _data30_,
               GeeMapEntry* entry)
{
	TubaDialogsNotificationSettings* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gconstpointer _tmp4_;
	gconstpointer _tmp5_;
	gboolean result;
	self = _data30_->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_)))) {
		_data30_->nfp_changed = TRUE;
		result = FALSE;
		_g_object_unref0 (entry);
		return result;
	}
	result = TRUE;
	_g_object_unref0 (entry);
	return result;
}

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

static void
tuba_dialogs_notification_settings_save_real_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	TubaDialogsNotificationSettingsSaveRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_notification_settings_save_real_co (_data_);
}

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 gboolean
tuba_dialogs_notification_settings_save_real_co (TubaDialogsNotificationSettingsSaveRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->changed = FALSE;
	_data_->_tmp0_ = g_new0 (gchar*, 0 + 1);
	_data_->new_filters = _data_->_tmp0_;
	_data_->new_filters_length1 = 0;
	_data_->_new_filters_size_ = _data_->new_filters_length1;
	_data_->_tmp1_ = _data_->self->priv->notification_rows;
	_data_->_tmp1__length1 = _data_->self->priv->notification_rows_length1;
	{
		_data_->row_collection_length1 = 0;
		_data_->_row_collection_size_ = 0;
		_data_->row_collection = _data_->_tmp1_;
		_data_->row_collection_length1 = _data_->_tmp1__length1;
		for (_data_->row_it = 0; _data_->row_it < _data_->row_collection_length1; _data_->row_it = _data_->row_it + 1) {
			_data_->_tmp2_ = _g_object_ref0 (_data_->row_collection[_data_->row_it]);
			_data_->row = _data_->_tmp2_;
			{
				_data_->_tmp3_ = _data_->row;
				_data_->_tmp4_ = tuba_dialogs_notification_settings_notification_row_get_active (_data_->_tmp3_);
				_data_->_tmp5_ = _data_->_tmp4_;
				if (!_data_->_tmp5_) {
					_data_->_tmp6_ = _data_->row;
					_data_->_tmp7_ = tuba_dialogs_notification_settings_notification_row_get_kind (_data_->_tmp6_);
					_data_->_tmp8_ = _data_->_tmp7_;
					_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
					_vala_array_add33 (&_data_->new_filters, &_data_->new_filters_length1, &_data_->_new_filters_size_, _data_->_tmp9_);
				}
				_g_object_unref0 (_data_->row);
			}
		}
	}
	_data_->_tmp10_ = _data_->new_filters;
	_data_->_tmp10__length1 = _data_->new_filters_length1;
	_data_->_tmp11_ = tuba_settings;
	_data_->_tmp13_ = 0;
	_data_->_tmp12_ = tuba_settings_get_notification_filters (_data_->_tmp11_, &_data_->_tmp13_);
	_data_->_tmp12__length1 = _data_->_tmp13_;
	_data_->_tmp14_ = _data_->_tmp12_;
	_data_->_tmp14__length1 = _data_->_tmp12__length1;
	if (_data_->_tmp10__length1 != _data_->_tmp14__length1) {
		_data_->changed = TRUE;
	} else {
		_data_->_tmp15_ = _data_->new_filters;
		_data_->_tmp15__length1 = _data_->new_filters_length1;
		{
			_data_->filter_collection_length1 = 0;
			_data_->_filter_collection_size_ = 0;
			_data_->filter_collection = _data_->_tmp15_;
			_data_->filter_collection_length1 = _data_->_tmp15__length1;
			for (_data_->filter_it = 0; _data_->filter_it < _data_->filter_collection_length1; _data_->filter_it = _data_->filter_it + 1) {
				_data_->_tmp16_ = g_strdup (_data_->filter_collection[_data_->filter_it]);
				_data_->filter = _data_->_tmp16_;
				{
					_data_->_tmp17_ = _data_->filter;
					_data_->_tmp18_ = tuba_settings;
					_data_->_tmp20_ = 0;
					_data_->_tmp19_ = tuba_settings_get_notification_filters (_data_->_tmp18_, &_data_->_tmp20_);
					_data_->_tmp19__length1 = _data_->_tmp20_;
					_data_->_tmp21_ = _data_->_tmp19_;
					_data_->_tmp21__length1 = _data_->_tmp19__length1;
					if (!_vala_string_array_contains (_data_->_tmp21_, _data_->_tmp21__length1, _data_->_tmp17_)) {
						_data_->changed = TRUE;
						_g_free0 (_data_->filter);
						break;
					}
					_g_free0 (_data_->filter);
				}
			}
		}
	}
	if (_data_->changed) {
		_data_->_tmp22_ = tuba_settings;
		_data_->_tmp23_ = _data_->new_filters;
		_data_->_tmp23__length1 = _data_->new_filters_length1;
		tuba_settings_set_notification_filters (_data_->_tmp22_, _data_->_tmp23_, _data_->_tmp23__length1);
		g_signal_emit (_data_->self, tuba_dialogs_notification_settings_signals[TUBA_DIALOGS_NOTIFICATION_SETTINGS_FILTERS_CHANGED_SIGNAL], 0);
	}
	_data_->_tmp24_ = _data_->self->priv->notification_filter_policy_status;
	if (_data_->_tmp24_ != NULL) {
		_data_->_data30_ = g_slice_new0 (Block30Data);
		_data_->_data30_->_ref_count_ = 1;
		_data_->_data30_->self = g_object_ref (_data_->self);
		_data_->_data30_->nfp_changed = FALSE;
		_data_->_tmp25_ = _data_->self->priv->notification_filter_policy_status;
		gee_abstract_map_foreach ((GeeAbstractMap*) _data_->_tmp25_, ____lambda207__gee_forall_func, _data_->_data30_);
		if (_data_->_data30_->nfp_changed) {
			_data_->_tmp26_ = json_builder_new ();
			_data_->builder = _data_->_tmp26_;
			_data_->_tmp27_ = _data_->builder;
			json_builder_begin_object (_data_->_tmp27_);
			_data_->_tmp28_ = _data_->builder;
			json_builder_set_member_name (_data_->_tmp28_, "filter_not_following");
			_data_->_tmp29_ = _data_->builder;
			_data_->_tmp30_ = _data_->self->filter_notifications_following_switch;
			_data_->_tmp31_ = adw_switch_row_get_active (_data_->_tmp30_);
			_data_->_tmp32_ = _data_->_tmp31_;
			json_builder_add_boolean_value (_data_->_tmp29_, _data_->_tmp32_);
			_data_->_tmp33_ = _data_->builder;
			json_builder_set_member_name (_data_->_tmp33_, "filter_not_followers");
			_data_->_tmp34_ = _data_->builder;
			_data_->_tmp35_ = _data_->self->filter_notifications_follower_switch;
			_data_->_tmp36_ = adw_switch_row_get_active (_data_->_tmp35_);
			_data_->_tmp37_ = _data_->_tmp36_;
			json_builder_add_boolean_value (_data_->_tmp34_, _data_->_tmp37_);
			_data_->_tmp38_ = _data_->builder;
			json_builder_set_member_name (_data_->_tmp38_, "filter_new_accounts");
			_data_->_tmp39_ = _data_->builder;
			_data_->_tmp40_ = _data_->self->filter_notifications_new_account_switch;
			_data_->_tmp41_ = adw_switch_row_get_active (_data_->_tmp40_);
			_data_->_tmp42_ = _data_->_tmp41_;
			json_builder_add_boolean_value (_data_->_tmp39_, _data_->_tmp42_);
			_data_->_tmp43_ = _data_->builder;
			json_builder_set_member_name (_data_->_tmp43_, "filter_private_mentions");
			_data_->_tmp44_ = _data_->builder;
			_data_->_tmp45_ = _data_->self->filter_notifications_dm_switch;
			_data_->_tmp46_ = adw_switch_row_get_active (_data_->_tmp45_);
			_data_->_tmp47_ = _data_->_tmp46_;
			json_builder_add_boolean_value (_data_->_tmp44_, _data_->_tmp47_);
			_data_->_tmp48_ = _data_->builder;
			json_builder_end_object (_data_->_tmp48_);
			_data_->_tmp49_ = tuba_accounts;
			_data_->_tmp50_ = tuba_account_store_get_active (_data_->_tmp49_);
			_data_->_tmp51_ = _data_->_tmp50_;
			_data_->_tmp52_ = _g_object_ref0 (_data_->_tmp51_);
			_data_->_tmp53_ = NULL;
			_data_->_tmp53_ = tuba_request_v2_new ("/api/v1/notifications/policy", TUBA_REQUEST_V2_METHOD_PUT);
			tuba_request_v2_set_account (_data_->_tmp53_, _data_->_tmp52_);
			_g_object_unref0 (_data_->_tmp52_);
			_data_->req = _data_->_tmp53_;
			_data_->_tmp54_ = _data_->req;
			_data_->_tmp55_ = _data_->builder;
			tuba_request_v2_set_body_from_json (_data_->_tmp54_, _data_->_tmp55_);
			{
				_data_->_tmp56_ = _data_->req;
				_data_->_state_ = 1;
				tuba_request_v2_exec (_data_->_tmp56_, tuba_dialogs_notification_settings_save_real_ready, _data_);
				return FALSE;
				_state_1:
				_data_->_tmp57_ = tuba_request_v2_exec_finish (_data_->_tmp56_, _data_->_res_, NULL, &_data_->_inner_error0_);
				_data_->_tmp58_ = _data_->_tmp57_;
				_g_object_unref0 (_data_->_tmp58_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
			}
			goto __finally0;
			__catch0_g_error:
			{
				_data_->e = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				_data_->_tmp59_ = _data_->e;
				_data_->_tmp60_ = g_strdup_printf ("%i", _data_->_tmp59_->code);
				_data_->_tmp61_ = _data_->_tmp60_;
				_data_->_tmp62_ = _data_->e;
				_data_->_tmp63_ = _data_->_tmp62_->message;
				_data_->_tmp64_ = string_to_string (_data_->_tmp63_);
				_data_->_tmp65_ = g_strconcat ("Couldn't save notification settings: ", _data_->_tmp61_, " ", _data_->_tmp64_, NULL);
				_data_->_tmp66_ = _data_->_tmp65_;
				g_warning ("NotificationSettings.vala:128: %s", _data_->_tmp66_);
				_g_free0 (_data_->_tmp66_);
				_g_free0 (_data_->_tmp61_);
				_data_->_tmp67_ = tuba_app;
				_data_->_tmp68_ = _data_->e;
				_data_->_tmp69_ = _data_->_tmp68_->message;
				_data_->_tmp70_ = g_strdup_printf (_ ("Couldn't save notification settings: %s"), _data_->_tmp69_);
				_data_->_tmp71_ = _data_->_tmp70_;
				g_signal_emit_by_name (_data_->_tmp67_, "toast", _data_->_tmp71_, (guint) 5, NULL, NULL, NULL);
				_g_free0 (_data_->_tmp71_);
				_g_error_free0 (_data_->e);
			}
			__finally0:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->req);
				_g_object_unref0 (_data_->builder);
				block30_data_unref (_data_->_data30_);
				_data_->_data30_ = NULL;
				_data_->new_filters = (_vala_array_free (_data_->new_filters, _data_->new_filters_length1, (GDestroyNotify) g_free), NULL);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->req);
			_g_object_unref0 (_data_->builder);
		}
		_data_->_tmp72_ = _data_->self->priv->notification_filter_policy_status;
		gee_abstract_map_clear ((GeeAbstractMap*) _data_->_tmp72_);
		block30_data_unref (_data_->_data30_);
		_data_->_data30_ = NULL;
	}
	_data_->new_filters = (_vala_array_free (_data_->new_filters, _data_->new_filters_length1, (GDestroyNotify) g_free), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
tuba_dialogs_notification_settings_clear_all_notifications (TubaDialogsNotificationSettings* self)
{
	g_return_if_fail (self != NULL);
	tuba_dialogs_notification_settings_clear_all_notifications_real (self, NULL, 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
tuba_dialogs_notification_settings_clear_all_notifications_real_data_free (gpointer _data)
{
	TubaDialogsNotificationSettingsClearAllNotificationsRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsNotificationSettingsClearAllNotificationsRealData, _data_);
}

static void
tuba_dialogs_notification_settings_clear_all_notifications_real (TubaDialogsNotificationSettings* self,
                                                                 GAsyncReadyCallback _callback_,
                                                                 gpointer _user_data_)
{
	TubaDialogsNotificationSettingsClearAllNotificationsRealData* _data_;
	TubaDialogsNotificationSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaDialogsNotificationSettingsClearAllNotificationsRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_notification_settings_clear_all_notifications_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_dialogs_notification_settings_clear_all_notifications_real_co (_data_);
}

static void
tuba_dialogs_notification_settings_clear_all_notifications_real_finish (TubaDialogsNotificationSettings* self,
                                                                        GAsyncResult* _res_)
{
	TubaDialogsNotificationSettingsClearAllNotificationsRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_dialogs_notification_settings_clear_all_notifications_real_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_)
{
	TubaDialogsNotificationSettingsClearAllNotificationsRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_notification_settings_clear_all_notifications_real_co (_data_);
}

static gboolean
tuba_dialogs_notification_settings_clear_all_notifications_real_co (TubaDialogsNotificationSettingsClearAllNotificationsRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Clear All Notifications?"), NULL);
	g_object_ref_sink (_data_->_tmp0_);
	_data_->dlg = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->dlg;
	adw_alert_dialog_add_response (_data_->_tmp1_, "no", _ ("Cancel"));
	_data_->_tmp2_ = _data_->dlg;
	adw_alert_dialog_set_response_appearance (_data_->_tmp2_, "no", ADW_RESPONSE_DEFAULT);
	_data_->_tmp3_ = _data_->dlg;
	adw_alert_dialog_add_response (_data_->_tmp3_, "yes", _ ("Clear"));
	_data_->_tmp4_ = _data_->dlg;
	adw_alert_dialog_set_response_appearance (_data_->_tmp4_, "yes", ADW_RESPONSE_DESTRUCTIVE);
	_data_->_tmp5_ = _data_->dlg;
	_data_->_state_ = 1;
	adw_alert_dialog_choose (_data_->_tmp5_, (GtkWidget*) _data_->self, NULL, tuba_dialogs_notification_settings_clear_all_notifications_real_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = adw_alert_dialog_choose_finish (_data_->_tmp5_, _data_->_res_);
	if (g_strcmp0 (_data_->_tmp6_, "yes") == 0) {
		_data_->_tmp7_ = _data_->self->clear_button;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp7_, FALSE);
		_data_->_tmp8_ = tuba_accounts;
		_data_->_tmp9_ = tuba_account_store_get_active (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _g_object_ref0 (_data_->_tmp10_);
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = tuba_request_v2_new ("/api/v1/notifications/clear", TUBA_REQUEST_V2_METHOD_POST);
		tuba_request_v2_set_account (_data_->_tmp12_, _data_->_tmp11_);
		_g_object_unref0 (_data_->_tmp11_);
		_data_->req = _data_->_tmp12_;
		{
			_data_->_tmp13_ = _data_->req;
			_data_->_state_ = 2;
			tuba_request_v2_exec (_data_->_tmp13_, tuba_dialogs_notification_settings_clear_all_notifications_real_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp14_ = tuba_request_v2_exec_finish (_data_->_tmp13_, _data_->_res_, NULL, &_data_->_inner_error0_);
			_data_->_tmp15_ = _data_->_tmp14_;
			_g_object_unref0 (_data_->_tmp15_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_tmp16_ = _data_->self->clear_button;
			gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp16_, TRUE);
			adw_dialog_force_close ((AdwDialog*) _data_->self);
			_data_->_tmp17_ = tuba_app;
			g_signal_emit_by_name (_data_->_tmp17_, "refresh");
		}
		goto __finally0;
		__catch0_g_error:
		{
			_data_->e = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			_data_->_tmp18_ = _data_->e;
			_data_->_tmp19_ = g_strdup_printf ("%i", _data_->_tmp18_->code);
			_data_->_tmp20_ = _data_->_tmp19_;
			_data_->_tmp21_ = _data_->e;
			_data_->_tmp22_ = _data_->_tmp21_->message;
			_data_->_tmp23_ = string_to_string (_data_->_tmp22_);
			_data_->_tmp24_ = g_strconcat ("Error while trying to clear notifications: ", _data_->_tmp20_, " ", _data_->_tmp23_, NULL);
			_data_->_tmp25_ = _data_->_tmp24_;
			g_warning ("NotificationSettings.vala:165: %s", _data_->_tmp25_);
			_g_free0 (_data_->_tmp25_);
			_g_free0 (_data_->_tmp20_);
			_data_->_tmp26_ = _data_->self->toast_overlay;
			_data_->_tmp27_ = _data_->e;
			_data_->_tmp28_ = _data_->_tmp27_->message;
			_data_->_tmp29_ = NULL;
			_data_->_tmp29_ = adw_toast_new (_data_->_tmp28_);
			adw_toast_set_timeout (_data_->_tmp29_, (guint) 5);
			adw_toast_overlay_add_toast (_data_->_tmp26_, _data_->_tmp29_);
			_g_error_free0 (_data_->e);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->req);
			_g_object_unref0 (_data_->dlg);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->req);
	}
	_g_object_unref0 (_data_->dlg);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
tuba_dialogs_notification_settings_setup_notification_filters (TubaDialogsNotificationSettings* self,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	TubaDialogsNotificationSettingsSetupNotificationFiltersData* _data_;
	TubaDialogsNotificationSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaDialogsNotificationSettingsSetupNotificationFiltersData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_notification_settings_setup_notification_filters_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_dialogs_notification_settings_setup_notification_filters_co (_data_);
}

static void
tuba_dialogs_notification_settings_setup_notification_filters_finish (TubaDialogsNotificationSettings* self,
                                                                      GAsyncResult* _res_)
{
	TubaDialogsNotificationSettingsSetupNotificationFiltersData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_dialogs_notification_settings_setup_notification_filters_ready (GObject* source_object,
                                                                     GAsyncResult* _res_,
                                                                     gpointer _user_data_)
{
	TubaDialogsNotificationSettingsSetupNotificationFiltersData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_notification_settings_setup_notification_filters_co (_data_);
}

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

static gboolean
___lambda208_ (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
____lambda208__gee_forall_func (gpointer g,
                                gpointer self)
{
	gboolean result;
	result = ___lambda208_ ((TubaDialogsNotificationSettings*) self, (GeeMapEntry*) g);
	return result;
}

static gboolean
tuba_dialogs_notification_settings_setup_notification_filters_co (TubaDialogsNotificationSettingsSetupNotificationFiltersData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = tuba_instance_account_get_tuba_probably_has_notification_filters (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (!_data_->_tmp4_) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = tuba_accounts;
	_data_->_tmp6_ = tuba_account_store_get_active (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = tuba_request_v2_new ("/api/v1/notifications/policy", TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp9_, _data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp8_);
	_data_->req = _data_->_tmp9_;
	{
		_data_->_tmp10_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp10_, tuba_dialogs_notification_settings_setup_notification_filters_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp11_ = tuba_request_v2_exec_finish (_data_->_tmp10_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp11_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp12_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp12_, NULL, tuba_dialogs_notification_settings_setup_notification_filters_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp13_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp13_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp14_ = tuba_network;
		_data_->_tmp15_ = _data_->parser;
		_data_->_tmp16_ = tuba_network_parse_node (_data_->_tmp14_, _data_->_tmp15_);
		_data_->node = _data_->_tmp16_;
		_data_->_tmp17_ = _data_->node;
		if (_data_->_tmp17_ == NULL) {
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			_g_object_unref0 (_data_->req);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp18_ = _data_->self->filtered_notifications_group;
		gtk_widget_set_visible ((GtkWidget*) _data_->_tmp18_, TRUE);
		_data_->_tmp19_ = _data_->node;
		_data_->_tmp20_ = tuba_api_notification_filter_policy_from (_data_->_tmp19_, &_data_->_inner_error0_);
		_data_->policies = _data_->_tmp20_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp21_ = 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 (_data_->self->priv->notification_filter_policy_status);
		_data_->self->priv->notification_filter_policy_status = _data_->_tmp21_;
		_data_->_tmp22_ = _data_->self->priv->notification_filter_policy_status;
		_data_->_tmp23_ = _data_->self->filter_notifications_following_switch;
		_data_->_tmp24_ = _data_->policies;
		_data_->_tmp25_ = tuba_api_notification_filter_policy_get_filter_not_following (_data_->_tmp24_);
		_data_->_tmp26_ = _data_->_tmp25_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp22_, _data_->_tmp23_, (gpointer) ((gintptr) _data_->_tmp26_));
		_data_->_tmp27_ = _data_->self->priv->notification_filter_policy_status;
		_data_->_tmp28_ = _data_->self->filter_notifications_follower_switch;
		_data_->_tmp29_ = _data_->policies;
		_data_->_tmp30_ = tuba_api_notification_filter_policy_get_filter_not_followers (_data_->_tmp29_);
		_data_->_tmp31_ = _data_->_tmp30_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp27_, _data_->_tmp28_, (gpointer) ((gintptr) _data_->_tmp31_));
		_data_->_tmp32_ = _data_->self->priv->notification_filter_policy_status;
		_data_->_tmp33_ = _data_->self->filter_notifications_new_account_switch;
		_data_->_tmp34_ = _data_->policies;
		_data_->_tmp35_ = tuba_api_notification_filter_policy_get_filter_new_accounts (_data_->_tmp34_);
		_data_->_tmp36_ = _data_->_tmp35_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp32_, _data_->_tmp33_, (gpointer) ((gintptr) _data_->_tmp36_));
		_data_->_tmp37_ = _data_->self->priv->notification_filter_policy_status;
		_data_->_tmp38_ = _data_->self->filter_notifications_dm_switch;
		_data_->_tmp39_ = _data_->policies;
		_data_->_tmp40_ = tuba_api_notification_filter_policy_get_filter_private_mentions (_data_->_tmp39_);
		_data_->_tmp41_ = _data_->_tmp40_;
		gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp37_, _data_->_tmp38_, (gpointer) ((gintptr) _data_->_tmp41_));
		_data_->_tmp42_ = _data_->self->priv->notification_filter_policy_status;
		gee_abstract_map_foreach ((GeeAbstractMap*) _data_->_tmp42_, ____lambda208__gee_forall_func, _data_->self);
		_g_object_unref0 (_data_->policies);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp43_ = _data_->e;
		if (_data_->_tmp43_->code == 404) {
			_data_->_tmp44_ = tuba_accounts;
			_data_->_tmp45_ = tuba_account_store_get_active (_data_->_tmp44_);
			_data_->_tmp46_ = _data_->_tmp45_;
			tuba_instance_account_set_tuba_probably_has_notification_filters (_data_->_tmp46_, FALSE);
		} else {
			_data_->_tmp47_ = _data_->e;
			_data_->_tmp48_ = g_strdup_printf ("%i", _data_->_tmp47_->code);
			_data_->_tmp49_ = _data_->_tmp48_;
			_data_->_tmp50_ = _data_->e;
			_data_->_tmp51_ = _data_->_tmp50_->message;
			_data_->_tmp52_ = string_to_string (_data_->_tmp51_);
			_data_->_tmp53_ = g_strconcat ("Error while trying to get notification policy: ", _data_->_tmp49_, " ", _data_->_tmp52_, NULL);
			_data_->_tmp54_ = _data_->_tmp53_;
			g_warning ("NotificationSettings.vala:202: %s", _data_->_tmp54_);
			_g_free0 (_data_->_tmp54_);
			_g_free0 (_data_->_tmp49_);
		}
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->req);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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, G_TYPE_FLAG_NONE);
	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 GType tuba_dialogs_notification_settings_notification_row_type_id__once = 0;
	if (g_once_init_enter_pointer (&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_pointer (&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, NULL, NULL);
	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, G_TYPE_FLAG_NONE);
	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 GType tuba_dialogs_notification_settings_type_id__once = 0;
	if (g_once_init_enter_pointer (&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_pointer (&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);
}

