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

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TUBA_VIEWS_TYPE_BASE (tuba_views_base_get_type ())
#define TUBA_VIEWS_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBase))
#define TUBA_VIEWS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))
#define TUBA_VIEWS_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))

typedef struct _TubaViewsBase TubaViewsBase;
typedef struct _TubaViewsBaseClass TubaViewsBaseClass;
typedef struct _TubaViewsBasePrivate TubaViewsBasePrivate;

#define TUBA_VIEWS_TYPE_CONTENT_BASE (tuba_views_content_base_get_type ())
#define TUBA_VIEWS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase))
#define TUBA_VIEWS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))
#define TUBA_VIEWS_IS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_IS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_CONTENT_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))

typedef struct _TubaViewsContentBase TubaViewsContentBase;
typedef struct _TubaViewsContentBaseClass TubaViewsContentBaseClass;
typedef struct _TubaViewsContentBasePrivate TubaViewsContentBasePrivate;

#define TUBA_TYPE_ACCOUNT_HOLDER (tuba_account_holder_get_type ())
#define TUBA_ACCOUNT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_HOLDER, TubaAccountHolder))
#define TUBA_IS_ACCOUNT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_HOLDER))
#define TUBA_ACCOUNT_HOLDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_ACCOUNT_HOLDER, TubaAccountHolderIface))

typedef struct _TubaAccountHolder TubaAccountHolder;
typedef struct _TubaAccountHolderIface TubaAccountHolderIface;

#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_VIEWS_TYPE_THREAD (tuba_views_thread_get_type ())
#define TUBA_VIEWS_THREAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_THREAD, TubaViewsThread))
#define TUBA_VIEWS_THREAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_THREAD, TubaViewsThreadClass))
#define TUBA_VIEWS_IS_THREAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_THREAD))
#define TUBA_VIEWS_IS_THREAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_THREAD))
#define TUBA_VIEWS_THREAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_THREAD, TubaViewsThreadClass))

typedef struct _TubaViewsThread TubaViewsThread;
typedef struct _TubaViewsThreadClass TubaViewsThreadClass;
typedef struct _TubaViewsThreadPrivate TubaViewsThreadPrivate;

#define TUBA_API_TYPE_STATUS (tuba_api_status_get_type ())
#define TUBA_API_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatus))
#define TUBA_API_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))
#define TUBA_API_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_STATUS))
#define TUBA_API_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_STATUS))
#define TUBA_API_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))

typedef struct _TubaAPIStatus TubaAPIStatus;
typedef struct _TubaAPIStatusClass TubaAPIStatusClass;

#define TUBA_WIDGETS_TYPE_STATUS (tuba_widgets_status_get_type ())
#define TUBA_WIDGETS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatus))
#define TUBA_WIDGETS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatusClass))
#define TUBA_WIDGETS_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_STATUS))
#define TUBA_WIDGETS_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_STATUS))
#define TUBA_WIDGETS_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatusClass))

typedef struct _TubaWidgetsStatus TubaWidgetsStatus;
typedef struct _TubaWidgetsStatusClass TubaWidgetsStatusClass;
enum  {
	TUBA_VIEWS_THREAD_0_PROPERTY,
	TUBA_VIEWS_THREAD_ACCOUNT_PROPERTY,
	TUBA_VIEWS_THREAD_ROOT_STATUS_PROPERTY,
	TUBA_VIEWS_THREAD_NUM_PROPERTIES
};
static GParamSpec* tuba_views_thread_properties[TUBA_VIEWS_THREAD_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef enum  {
	TUBA_VIEWS_THREAD_THREAD_ROLE_NONE,
	TUBA_VIEWS_THREAD_THREAD_ROLE_START,
	TUBA_VIEWS_THREAD_THREAD_ROLE_MIDDLE,
	TUBA_VIEWS_THREAD_THREAD_ROLE_END
} TubaViewsThreadThreadRole;

#define TUBA_VIEWS_THREAD_TYPE_THREAD_ROLE (tuba_views_thread_thread_role_get_type ())

#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 TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE (tuba_views_base_status_message_get_type ())
#define TUBA_VIEWS_BASE_STATUS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE, TubaViewsBaseStatusMessage))
#define TUBA_VIEWS_BASE_STATUS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE, TubaViewsBaseStatusMessageClass))
#define TUBA_VIEWS_BASE_IS_STATUS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE))
#define TUBA_VIEWS_BASE_IS_STATUS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE))
#define TUBA_VIEWS_BASE_STATUS_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_BASE_TYPE_STATUS_MESSAGE, TubaViewsBaseStatusMessageClass))

typedef struct _TubaViewsBaseStatusMessage TubaViewsBaseStatusMessage;
typedef struct _TubaViewsBaseStatusMessageClass TubaViewsBaseStatusMessageClass;
typedef struct _TubaViewsBaseStatusMessagePrivate TubaViewsBaseStatusMessagePrivate;

#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_free0(var) (var = (g_free (var), NULL))

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

#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 _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaViewsThreadUpdateRootStatusData TubaViewsThreadUpdateRootStatusData;
typedef struct _Block81Data Block81Data;
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
typedef struct _TubaViewsThreadRequestData TubaViewsThreadRequestData;

#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_DIALOGS_TYPE_MAIN_WINDOW (tuba_dialogs_main_window_get_type ())
#define TUBA_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindow))
#define TUBA_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))
#define TUBA_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))

typedef struct _TubaDialogsMainWindow TubaDialogsMainWindow;
typedef struct _TubaDialogsMainWindowClass TubaDialogsMainWindowClass;
typedef struct _TubaViewsThreadOpenFromLinkAsyncData TubaViewsThreadOpenFromLinkAsyncData;
typedef void (*TubaDialogsComposerDialogSuccessCallback) (TubaAPIStatus* cb_status, gpointer user_data);
typedef struct _TubaWidgetsStatusPrivate TubaWidgetsStatusPrivate;

#define TUBA_WIDGETS_TYPE_RICH_LABEL (tuba_widgets_rich_label_get_type ())
#define TUBA_WIDGETS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabel))
#define TUBA_WIDGETS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))
#define TUBA_WIDGETS_IS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_IS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_RICH_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))

typedef struct _TubaWidgetsRichLabel TubaWidgetsRichLabel;
typedef struct _TubaWidgetsRichLabelClass TubaWidgetsRichLabelClass;

#define TUBA_WIDGETS_TYPE_AVATAR (tuba_widgets_avatar_get_type ())
#define TUBA_WIDGETS_AVATAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatar))
#define TUBA_WIDGETS_AVATAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatarClass))
#define TUBA_WIDGETS_IS_AVATAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_AVATAR))
#define TUBA_WIDGETS_IS_AVATAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_AVATAR))
#define TUBA_WIDGETS_AVATAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatarClass))

typedef struct _TubaWidgetsAvatar TubaWidgetsAvatar;
typedef struct _TubaWidgetsAvatarClass TubaWidgetsAvatarClass;

#define TUBA_WIDGETS_TYPE_MARKUP_VIEW (tuba_widgets_markup_view_get_type ())
#define TUBA_WIDGETS_MARKUP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupView))
#define TUBA_WIDGETS_MARKUP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupViewClass))
#define TUBA_WIDGETS_IS_MARKUP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW))
#define TUBA_WIDGETS_IS_MARKUP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_MARKUP_VIEW))
#define TUBA_WIDGETS_MARKUP_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupViewClass))

typedef struct _TubaWidgetsMarkupView TubaWidgetsMarkupView;
typedef struct _TubaWidgetsMarkupViewClass TubaWidgetsMarkupViewClass;

#define TUBA_WIDGETS_TYPE_FADE_BIN (tuba_widgets_fade_bin_get_type ())
#define TUBA_WIDGETS_FADE_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_FADE_BIN, TubaWidgetsFadeBin))
#define TUBA_WIDGETS_FADE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_FADE_BIN, TubaWidgetsFadeBinClass))
#define TUBA_WIDGETS_IS_FADE_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_FADE_BIN))
#define TUBA_WIDGETS_IS_FADE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_FADE_BIN))
#define TUBA_WIDGETS_FADE_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_FADE_BIN, TubaWidgetsFadeBinClass))

typedef struct _TubaWidgetsFadeBin TubaWidgetsFadeBin;
typedef struct _TubaWidgetsFadeBinClass TubaWidgetsFadeBinClass;

#define TUBA_WIDGETS_TYPE_PREVIEW_CARD (tuba_widgets_preview_card_get_type ())
#define TUBA_WIDGETS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCard))
#define TUBA_WIDGETS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCardClass))
#define TUBA_WIDGETS_IS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD))
#define TUBA_WIDGETS_IS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD))
#define TUBA_WIDGETS_PREVIEW_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCardClass))

typedef struct _TubaWidgetsPreviewCard TubaWidgetsPreviewCard;
typedef struct _TubaWidgetsPreviewCardClass TubaWidgetsPreviewCardClass;

#define TUBA_WIDGETS_TYPE_VOTE_BOX (tuba_widgets_vote_box_get_type ())
#define TUBA_WIDGETS_VOTE_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBox))
#define TUBA_WIDGETS_VOTE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBoxClass))
#define TUBA_WIDGETS_IS_VOTE_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX))
#define TUBA_WIDGETS_IS_VOTE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_VOTE_BOX))
#define TUBA_WIDGETS_VOTE_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBoxClass))

typedef struct _TubaWidgetsVoteBox TubaWidgetsVoteBox;
typedef struct _TubaWidgetsVoteBoxClass TubaWidgetsVoteBoxClass;
typedef struct _Block82Data Block82Data;
typedef struct _TubaViewsThreadRegularStatUpdatesData TubaViewsThreadRegularStatUpdatesData;

struct _TubaViewsBase {
	AdwBreakpointBin parent_instance;
	TubaViewsBasePrivate * priv;
	AdwHeaderBar* header;
	AdwToolbarView* toolbar_view;
	GtkScrolledWindow* scrolled;
	GtkOverlay* scrolled_overlay;
	GtkRevealer* scroll_to_top_rev;
	GtkButton* scroll_to_top;
	GtkStack* states;
	AdwClamp* content_box;
	GtkButton* status_button;
};

struct _TubaViewsBaseClass {
	AdwBreakpointBinClass parent_class;
	void (*scroll_page) (TubaViewsBase* self, gboolean up);
	void (*unbind_listboxes) (TubaViewsBase* self);
	void (*build_actions) (TubaViewsBase* self);
	void (*build_header) (TubaViewsBase* self);
	void (*clear) (TubaViewsBase* self);
	void (*on_shown) (TubaViewsBase* self);
	void (*on_hidden) (TubaViewsBase* self);
	void (*on_content_changed) (TubaViewsBase* self);
	void (*on_error) (TubaViewsBase* self, gint32 code, const gchar* reason);
};

struct _TubaViewsContentBase {
	TubaViewsBase parent_instance;
	TubaViewsContentBasePrivate * priv;
	GtkListBox* content;
	GListStore* model;
};

struct _TubaViewsContentBaseClass {
	TubaViewsBaseClass parent_class;
	void (*on_scrolled_vadjustment_value_change) (TubaViewsContentBase* self);
	void (*clear_all_but_first) (TubaViewsContentBase* self, gint i);
	void (*attempt_focus_grab) (TubaViewsContentBase* self);
	GtkWidget* (*on_create_model_widget) (TubaViewsContentBase* self, GObject* obj);
	void (*on_bottom_reached) (TubaViewsContentBase* self);
	void (*on_content_item_activated) (TubaViewsContentBase* self, GtkListBoxRow* row);
	gboolean (*get_empty) (TubaViewsContentBase* self);
};

struct _TubaAccountHolderIface {
	GTypeInterface parent_iface;
	void (*on_account_changed) (TubaAccountHolder* self, TubaInstanceAccount* acc);
	void (*on_accounts_changed) (TubaAccountHolder* self, GeeArrayList* accounts);
	TubaInstanceAccount* (*get_account) (TubaAccountHolder* self);
	void (*set_account) (TubaAccountHolder* self, TubaInstanceAccount* value);
};

struct _TubaViewsThread {
	TubaViewsContentBase parent_instance;
	TubaViewsThreadPrivate * priv;
};

struct _TubaViewsThreadClass {
	TubaViewsContentBaseClass parent_class;
};

struct _TubaViewsThreadPrivate {
	TubaInstanceAccount* _account;
	TubaAPIStatus* _root_status;
	TubaWidgetsStatus* _root_status_widget;
	AdwToast* refresh_toast;
	GCancellable* root_update_cancellable;
	gboolean _reveal_spoilers;
	GtkToggleButton* spoiler_toggle_button;
	gboolean grabbed_focus;
	guint grab_focus_timeout;
	GCancellable* regular_stat_updates_cancellable;
};

struct _TubaViewsBaseStatusMessage {
	GObject parent_instance;
	TubaViewsBaseStatusMessagePrivate * priv;
	gchar* title;
	gchar* message;
	gboolean loading;
};

struct _TubaViewsBaseStatusMessageClass {
	GObjectClass parent_class;
};

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 _TubaViewsThreadUpdateRootStatusData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaViewsThread* self;
	gchar* status_id;
	TubaAPIStatus* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	TubaWidgetsStatus* status_widget;
	TubaWidgetsStatus* _tmp4_;
	TubaWidgetsStatus* _tmp5_;
	TubaRequestV2* req;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaInstanceAccount* _tmp10_;
	TubaInstanceAccount* _tmp11_;
	GCancellable* _tmp12_;
	GCancellable* _tmp13_;
	TubaRequestV2* _tmp14_;
	TubaRequestV2* _tmp15_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp16_;
	GInputStream* _tmp17_;
	JsonParser* parser;
	GInputStream* _tmp18_;
	JsonParser* _tmp19_;
	JsonNode* node;
	TubaNetwork* _tmp20_;
	JsonParser* _tmp21_;
	JsonNode* _tmp22_;
	TubaAPIStatus* api_status;
	JsonNode* _tmp23_;
	TubaAPIStatus* _tmp24_;
	TubaAPIStatus* _tmp25_;
	TubaAPIStatus* _tmp26_;
	TubaAPIStatus* _tmp27_;
	TubaAPIStatus* _tmp28_;
	TubaWidgetsStatus* _tmp29_;
	TubaWidgetsStatus* _tmp30_;
	TubaAPIStatus* _tmp31_;
	GError* e;
	const gchar* _tmp32_;
	GError* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	GError* _inner_error0_;
};

struct _Block81Data {
	int _ref_count_;
	TubaViewsThread* self;
	GObject** to_add_ancestors;
	gint to_add_ancestors_length1;
	gint _to_add_ancestors_size_;
	GObject** to_add_descendants;
	gint to_add_descendants_length1;
	gint _to_add_descendants_size_;
};

struct _TubaViewsThreadRequestData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaViewsThread* self;
	TubaRequestV2* req;
	TubaAPIStatus* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaRequestV2* _tmp9_;
	TubaRequestV2* _tmp10_;
	Block81Data* _data81_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp11_;
	GInputStream* _tmp12_;
	JsonParser* parser;
	GInputStream* _tmp13_;
	JsonParser* _tmp14_;
	JsonObject* root;
	TubaNetwork* _tmp15_;
	JsonParser* _tmp16_;
	JsonObject* _tmp17_;
	GObject** _tmp18_;
	JsonArray* ancestors;
	JsonObject* _tmp19_;
	JsonArray* _tmp20_;
	JsonArray* _tmp21_;
	JsonArray* _tmp22_;
	TubaAPIStatus* _tmp23_;
	GObject* _tmp24_;
	GListStore* _tmp25_;
	GListStore* _tmp26_;
	GObject** _tmp27_;
	gint _tmp27__length1;
	GObject** _tmp28_;
	JsonArray* descendants;
	JsonObject* _tmp29_;
	JsonArray* _tmp30_;
	JsonArray* _tmp31_;
	JsonArray* _tmp32_;
	GListStore* _tmp33_;
	GListStore* _tmp34_;
	GObject** _tmp35_;
	gint _tmp35__length1;
	GError* e;
	GError* _tmp36_;
	GError* _tmp37_;
	const gchar* _tmp38_;
	GError* _inner_error0_;
};

struct _TubaViewsThreadOpenFromLinkAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gchar* q;
	TubaRequestV2* req;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaInstanceAccount* _tmp3_;
	TubaRequestV2* _tmp4_;
	TubaRequestV2* _tmp5_;
	TubaRequestV2* _tmp6_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp7_;
	GInputStream* _tmp8_;
	JsonParser* parser;
	GInputStream* _tmp9_;
	JsonParser* _tmp10_;
	JsonObject* root;
	TubaNetwork* _tmp11_;
	JsonParser* _tmp12_;
	JsonObject* _tmp13_;
	JsonArray* statuses;
	JsonObject* _tmp14_;
	JsonArray* _tmp15_;
	JsonArray* _tmp16_;
	JsonNode* node;
	JsonArray* _tmp17_;
	JsonNode* _tmp18_;
	JsonNode* _tmp19_;
	JsonNode* _tmp20_;
	TubaAPIStatus* status;
	JsonNode* _tmp21_;
	TubaAPIStatus* _tmp22_;
	TubaApplication* _tmp23_;
	TubaDialogsMainWindow* _tmp24_;
	TubaDialogsMainWindow* _tmp25_;
	TubaAPIStatus* _tmp26_;
	TubaViewsThread* _tmp27_;
	TubaViewsThread* _tmp28_;
	TubaViewsBase* _tmp29_;
	TubaViewsBase* _tmp30_;
	GError* e;
	const gchar* _tmp31_;
	GError* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	GError* _inner_error0_;
};

struct _TubaWidgetsStatus {
	GtkListBoxRow parent_instance;
	TubaWidgetsStatusPrivate * priv;
	TubaDialogsComposerDialogSuccessCallback reply_cb;
	gpointer reply_cb_target;
	GDestroyNotify reply_cb_target_destroy_notify;
	GtkBox* status_box;
	GtkBox* avatar_side;
	GtkBox* title_box;
	GtkBox* content_side;
	AdwWrapBox* name_wrapbox;
	GtkMenuButton* menu_button;
	GtkImage* header_icon;
	TubaWidgetsRichLabel* header_label;
	GtkButton* header_button;
	TubaWidgetsAvatar* avatar;
	GtkOverlay* avatar_overlay;
	GtkButton* name_button;
	TubaWidgetsRichLabel* name_label;
	GtkLabel* handle_label;
	GtkBox* indicators;
	GtkLabel* date_label;
	GtkImage* pin_indicator;
	GtkImage* edited_indicator;
	GtkImage* visibility_indicator;
	GtkBox* content_column;
	GtkStack* spoiler_stack;
	GtkBox* content_box;
	TubaWidgetsMarkupView* content;
	GtkButton* spoiler_button;
	GtkLabel* spoiler_label;
	GtkLabel* spoiler_label_rev;
	GtkBox* spoiler_status_con;
	TubaWidgetsFadeBin* fade_bin;
	GtkStack* filter_stack;
	GtkLabel* filter_label;
	GtkLabel* filter_author_label;
	TubaWidgetsPreviewCard* prev_card;
	TubaWidgetsVoteBox* poll;
};

struct _TubaWidgetsStatusClass {
	GtkListBoxRowClass parent_class;
	void (*on_open) (TubaWidgetsStatus* self);
	void (*change_kind) (TubaWidgetsStatus* self);
	void (*bind) (TubaWidgetsStatus* self);
};

struct _Block82Data {
	int _ref_count_;
	TubaViewsThread* self;
	TubaAPIStatus** context_statuses;
	gint context_statuses_length1;
	gint _context_statuses_size_;
};

struct _TubaViewsThreadRegularStatUpdatesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaViewsThread* self;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	TubaAPIStatus* _tmp3_;
	Block82Data* _data82_;
	TubaAPIStatus** _tmp4_;
	TubaRequestV2* req;
	TubaAPIStatus* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	TubaInstanceAccount* _tmp11_;
	TubaInstanceAccount* _tmp12_;
	TubaInstanceAccount* _tmp13_;
	GCancellable* _tmp14_;
	GCancellable* _tmp15_;
	TubaRequestV2* _tmp16_;
	TubaRequestV2* _tmp17_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp18_;
	GInputStream* _tmp19_;
	JsonParser* parser;
	GInputStream* _tmp20_;
	JsonParser* _tmp21_;
	JsonNode* node;
	TubaNetwork* _tmp22_;
	JsonParser* _tmp23_;
	JsonNode* _tmp24_;
	TubaAPIStatus* api_status;
	JsonNode* _tmp25_;
	TubaAPIStatus* _tmp26_;
	TubaAPIStatus* _tmp27_;
	TubaAPIStatus* _tmp28_;
	TubaRequestV2* _vala1_req;
	TubaAPIStatus* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	TubaInstanceAccount* _tmp35_;
	TubaInstanceAccount* _tmp36_;
	TubaInstanceAccount* _tmp37_;
	TubaRequestV2* _tmp38_;
	TubaRequestV2* _tmp39_;
	GInputStream* _vala1_in_stream;
	TubaRequestV2* _tmp40_;
	GInputStream* _tmp41_;
	JsonParser* _vala1_parser;
	GInputStream* _tmp42_;
	JsonParser* _tmp43_;
	JsonObject* root;
	TubaNetwork* _tmp44_;
	JsonParser* _tmp45_;
	JsonObject* _tmp46_;
	JsonArray* ancestors;
	JsonObject* _tmp47_;
	JsonArray* _tmp48_;
	JsonArray* _tmp49_;
	JsonArray* _tmp50_;
	JsonArray* descendants;
	JsonObject* _tmp51_;
	JsonArray* _tmp52_;
	JsonArray* _tmp53_;
	JsonArray* _tmp54_;
	TubaAPIStatus** _tmp55_;
	gint _tmp55__length1;
	TubaAPIStatus** c_status_collection;
	gint c_status_collection_length1;
	gint _c_status_collection_size_;
	gint c_status_it;
	TubaAPIStatus* _tmp56_;
	TubaAPIStatus* c_status;
	guint pos;
	GListStore* _tmp57_;
	TubaAPIStatus* _tmp58_;
	GEqualFunc _tmp59_;
	guint _tmp60_;
	gboolean _tmp61_;
	TubaWidgetsStatus* status_widget;
	GtkListBox* _tmp62_;
	GtkListBoxRow* _tmp63_;
	TubaWidgetsStatus* _tmp64_;
	TubaWidgetsStatus* _tmp65_;
	TubaWidgetsStatus* _tmp66_;
	TubaAPIStatus* _tmp67_;
	AdwToast* _tmp68_;
	gchar* _tmp69_;
	gchar* _tmp70_;
	AdwToast* _tmp71_;
	TubaApplication* _tmp72_;
	AdwToast* _tmp73_;
	GError* e;
	TubaAPIStatus* _tmp74_;
	const gchar* _tmp75_;
	const gchar* _tmp76_;
	const gchar* _tmp77_;
	GError* _tmp78_;
	const gchar* _tmp79_;
	const gchar* _tmp80_;
	gchar* _tmp81_;
	gchar* _tmp82_;
	GError* _inner_error0_;
};

static gint TubaViewsThread_private_offset;
static gpointer tuba_views_thread_parent_class = NULL;
VALA_EXTERN TubaSettings* tuba_settings;
static GEqualFunc tuba_views_thread_status_comp_func;
static GEqualFunc tuba_views_thread_status_comp_func = NULL;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaNetwork* tuba_network;
VALA_EXTERN TubaAccountStore* tuba_accounts;
static TubaAccountHolderIface * tuba_views_thread_tuba_account_holder_parent_iface = NULL;

VALA_EXTERN GType tuba_views_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsBase, g_object_unref)
VALA_EXTERN GType tuba_views_content_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsContentBase, 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 GType tuba_account_holder_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountHolder, g_object_unref)
VALA_EXTERN GType tuba_views_thread_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsThread, g_object_unref)
VALA_EXTERN GType tuba_api_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIStatus, g_object_unref)
VALA_EXTERN GType tuba_widgets_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsStatus, g_object_unref)
VALA_EXTERN void tuba_views_content_base_attempt_focus_grab (TubaViewsContentBase* self);
VALA_EXTERN void tuba_views_base_build_header (TubaViewsBase* self);
VALA_EXTERN void tuba_views_base_on_content_changed (TubaViewsBase* self);
VALA_EXTERN GtkWidget* tuba_views_content_base_on_create_model_widget (TubaViewsContentBase* self,
                                                           GObject* obj);
VALA_EXTERN void tuba_account_holder_destruct_account_holder (TubaAccountHolder* self);
VALA_EXTERN GType tuba_views_thread_thread_role_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void tuba_views_thread_thread_role_connect_posts (TubaAPIStatus* prev,
                                                  TubaAPIStatus* curr);
VALA_EXTERN TubaViewsThreadThreadRole tuba_api_status_get_tuba_thread_role (TubaAPIStatus* self);
VALA_EXTERN void tuba_api_status_set_tuba_thread_role (TubaAPIStatus* self,
                                           TubaViewsThreadThreadRole value);
VALA_EXTERN GType tuba_settings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaSettings, g_object_unref)
VALA_EXTERN gboolean tuba_settings_get_show_spoilers (TubaSettings* self);
static gboolean _tuba_views_thread_status_comp_func_lambda88_ (const gchar* s1,
                                                        const gchar* s2);
VALA_EXTERN const gchar* tuba_api_status_get_id (TubaAPIStatus* self);
static gboolean __tuba_views_thread_status_comp_func_lambda88__gequal_func (gconstpointer a,
                                                                     gconstpointer b);
static void tuba_views_thread_real_attempt_focus_grab (TubaViewsContentBase* base);
VALA_EXTERN TubaViewsThread* tuba_views_thread_new (TubaAPIStatus* status);
VALA_EXTERN TubaViewsThread* tuba_views_thread_construct (GType object_type,
                                              TubaAPIStatus* status);
VALA_EXTERN GType tuba_views_base_status_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsBaseStatusMessage, g_object_unref)
VALA_EXTERN TubaViewsBaseStatusMessage* tuba_views_base_status_message_new (void);
VALA_EXTERN TubaViewsBaseStatusMessage* tuba_views_base_status_message_construct (GType object_type);
VALA_EXTERN void tuba_account_holder_construct_account_holder (TubaAccountHolder* self);
static void tuba_views_thread_update_root_status (TubaViewsThread* self,
                                           const gchar* status_id,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static void tuba_views_thread_update_root_status_finish (TubaViewsThread* self,
                                                  GAsyncResult* _res_);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
static void tuba_views_thread_on_refresh (TubaViewsThread* self);
static void _tuba_views_thread_on_refresh_tuba_application_refresh (TubaApplication* _sender,
                                                             gpointer self);
static void tuba_views_thread_on_time_update (TubaViewsThread* self);
static void _tuba_views_thread_on_time_update_tuba_application_time_update (TubaApplication* _sender,
                                                                     gpointer self);
VALA_EXTERN void tuba_views_base_clear (TubaViewsBase* self);
VALA_EXTERN void tuba_views_base_set_base_status (TubaViewsBase* self,
                                      TubaViewsBaseStatusMessage* value);
VALA_EXTERN void tuba_views_thread_request (TubaViewsThread* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN void tuba_views_thread_request_finish (TubaViewsThread* self,
                                       GAsyncResult* _res_);
static void tuba_views_thread_update_root_status_data_free (gpointer _data);
static gboolean tuba_views_thread_update_root_status_co (TubaViewsThreadUpdateRootStatusData* _data_);
VALA_EXTERN TubaAPIStatus* tuba_views_thread_get_root_status (TubaViewsThread* self);
static TubaWidgetsStatus* tuba_views_thread_get_root_status_widget (TubaViewsThread* 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 TubaInstanceAccount* tuba_account_holder_get_account (TubaAccountHolder* 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_ctx (TubaRequestV2* self,
                              GtkWidget* value);
VALA_EXTERN void tuba_request_v2_set_cancellable (TubaRequestV2* self,
                                      GCancellable* value);
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_views_thread_update_root_status_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);
VALA_EXTERN TubaAPIStatus* tuba_api_status_from (JsonNode* node,
                                     GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN void tuba_entity_patch (TubaEntity* self,
                        GObject* with);
VALA_EXTERN void tuba_widgets_status_on_edit (TubaWidgetsStatus* self,
                                  TubaAPIStatus* x);
static void tuba_views_thread_real_on_account_changed (TubaAccountHolder* base,
                                                TubaInstanceAccount* acc);
VALA_EXTERN void tuba_account_holder_set_account (TubaAccountHolder* self,
                                      TubaInstanceAccount* value);
static void tuba_views_thread_connect_threads (TubaViewsThread* self);
VALA_EXTERN TubaAPIStatus* tuba_api_status_get_formal (TubaAPIStatus* self);
VALA_EXTERN const gchar* tuba_api_status_get_in_reply_to_id (TubaAPIStatus* self);
static void tuba_views_thread_on_replied (TubaViewsThread* self,
                                   TubaAPIStatus* t_status);
static void tuba_views_thread_real_build_header (TubaViewsBase* base);
static void tuba_views_thread_spoiler_toggle_button_toggled (TubaViewsThread* self);
static void _tuba_views_thread_spoiler_toggle_button_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                                 gpointer self);
static void tuba_views_thread_set_reveal_spoilers (TubaViewsThread* self,
                                            gboolean value);
static void tuba_views_thread_real_on_content_changed (TubaViewsBase* base);
VALA_EXTERN gboolean tuba_api_status_get_has_spoiler (TubaAPIStatus* self);
static gboolean tuba_views_thread_grab_focus_of_root (TubaViewsThread* self);
static gboolean _tuba_views_thread_grab_focus_of_root_gsource_func (gpointer self);
static void tuba_views_thread_request_data_free (gpointer _data);
static gboolean tuba_views_thread_request_co (TubaViewsThreadRequestData* _data_);
static Block81Data* block81_data_ref (Block81Data* _data81_);
static void block81_data_unref (void * _userdata_);
static void tuba_views_thread_request_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
VALA_EXTERN JsonObject* tuba_network_parse (TubaNetwork* self,
                                JsonParser* parser);
static void ___lambda89_ (Block81Data* _data81_,
                   JsonArray* array,
                   guint i,
                   JsonNode* node);
VALA_EXTERN TubaEntity* tuba_helper_entity_from_json (JsonNode* node,
                                          GType type,
                                          gboolean force);
static JsonNode* _vala_JsonNode_copy (JsonNode* self);
VALA_EXTERN gboolean tuba_api_status_get_tuba_filter_hidden (TubaAPIStatus* self);
static void _vala_array_add114 (GObject** * array,
                         gint* length,
                         gint* size,
                         GObject* value);
static void ____lambda89__json_array_foreach (JsonArray* array,
                                       guint index_,
                                       JsonNode* element_node,
                                       gpointer self);
static void _vala_array_add115 (GObject** * array,
                         gint* length,
                         gint* size,
                         GObject* value);
static void ___lambda91_ (Block81Data* _data81_,
                   JsonArray* array,
                   guint i,
                   JsonNode* node);
static void _vala_array_add116 (GObject** * array,
                         gint* length,
                         gint* size,
                         GObject* value);
static void ____lambda91__json_array_foreach (JsonArray* array,
                                       guint index_,
                                       JsonNode* element_node,
                                       gpointer self);
VALA_EXTERN void tuba_views_base_on_error (TubaViewsBase* self,
                               gint32 code,
                               const gchar* reason);
VALA_EXTERN void tuba_views_thread_open_from_link (const gchar* q);
VALA_EXTERN void tuba_views_thread_open_from_link_async (const gchar* q,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void tuba_views_thread_open_from_link_finish (GAsyncResult* _res_);
static void tuba_views_thread_open_from_link_async_data_free (gpointer _data);
static gboolean tuba_views_thread_open_from_link_async_co (TubaViewsThreadOpenFromLinkAsyncData* _data_);
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 void tuba_request_v2_add_parameter (TubaRequestV2* self,
                                    const gchar* key,
                                    const gchar* value);
static void tuba_views_thread_open_from_link_async_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
VALA_EXTERN GType tuba_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsMainWindow, g_object_unref)
VALA_EXTERN TubaDialogsMainWindow* tuba_application_get_main_window (TubaApplication* self);
VALA_EXTERN TubaViewsBase* tuba_dialogs_main_window_open_view (TubaDialogsMainWindow* self,
                                                   TubaViewsBase* view);
VALA_EXTERN void tuba_utils_host_open_url (const gchar* _uri,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gboolean tuba_utils_host_open_url_finish (GAsyncResult* _res_);
static GtkWidget* tuba_views_thread_real_on_create_model_widget (TubaViewsContentBase* base,
                                                          GObject* obj);
static void _tuba_views_thread_on_replied_tuba_dialogs_composer_dialog_success_callback (TubaAPIStatus* cb_status,
                                                                                  gpointer self);
VALA_EXTERN GType tuba_widgets_rich_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsRichLabel, g_object_unref)
VALA_EXTERN GType tuba_widgets_avatar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAvatar, g_object_unref)
VALA_EXTERN GType tuba_widgets_markup_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsMarkupView, g_object_unref)
VALA_EXTERN GType tuba_widgets_fade_bin_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsFadeBin, g_object_unref)
VALA_EXTERN GType tuba_widgets_preview_card_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsPreviewCard, g_object_unref)
VALA_EXTERN GType tuba_widgets_vote_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsVoteBox, g_object_unref)
VALA_EXTERN void tuba_widgets_status_set_enable_thread_lines (TubaWidgetsStatus* self,
                                                  gboolean value);
VALA_EXTERN void tuba_widgets_markup_view_set_selectable (TubaWidgetsMarkupView* self,
                                              gboolean value);
VALA_EXTERN void tuba_widgets_status_set_kind (TubaWidgetsStatus* self,
                                   const gchar* value);
VALA_EXTERN void tuba_widgets_status_expand_root (TubaWidgetsStatus* self);
static void tuba_views_thread_set_root_status_widget (TubaViewsThread* self,
                                               TubaWidgetsStatus* value);
VALA_EXTERN void tuba_widgets_status_update_time (TubaWidgetsStatus* self);
static void tuba_views_thread_regular_stat_updates (TubaViewsThread* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void tuba_views_thread_regular_stat_updates_finish (TubaViewsThread* self,
                                                    GAsyncResult* _res_);
static void tuba_views_thread_regular_stat_updates_data_free (gpointer _data);
static gboolean tuba_views_thread_regular_stat_updates_co (TubaViewsThreadRegularStatUpdatesData* _data_);
static Block82Data* block82_data_ref (Block82Data* _data82_);
static void block82_data_unref (void * _userdata_);
static void tuba_views_thread_regular_stat_updates_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void _vala_array_add117 (TubaAPIStatus** * array,
                         gint* length,
                         gint* size,
                         TubaAPIStatus* value);
static void ___lambda92_ (Block82Data* _data82_,
                   JsonArray* array,
                   guint i,
                   JsonNode* node);
static void _vala_array_add118 (TubaAPIStatus** * array,
                         gint* length,
                         gint* size,
                         TubaAPIStatus* value);
static void ____lambda92__json_array_foreach (JsonArray* array,
                                       guint index_,
                                       JsonNode* element_node,
                                       gpointer self);
static void ___lambda93_ (Block82Data* _data82_,
                   JsonArray* array,
                   guint i,
                   JsonNode* node);
static void _vala_array_add119 (TubaAPIStatus** * array,
                         gint* length,
                         gint* size,
                         TubaAPIStatus* value);
static void ____lambda93__json_array_foreach (JsonArray* array,
                                       guint index_,
                                       JsonNode* element_node,
                                       gpointer self);
VALA_EXTERN void tuba_widgets_status_patch_stats (TubaWidgetsStatus* self,
                                      TubaAPIStatus* x);
VALA_EXTERN void tuba_views_thread_set_root_status (TubaViewsThread* self,
                                        TubaAPIStatus* value);
static gboolean tuba_views_thread_get_reveal_spoilers (TubaViewsThread* self);
VALA_EXTERN void tuba_api_status_set_tuba_spoiler_revealed (TubaAPIStatus* self,
                                                gboolean value);
VALA_EXTERN void tuba_account_holder_on_account_changed (TubaAccountHolder* self,
                                             TubaInstanceAccount* acc);
static void tuba_views_thread_finalize (GObject * obj);
static GType tuba_views_thread_get_type_once (void);
static void _vala_tuba_views_thread_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec);
static void _vala_tuba_views_thread_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_views_thread_get_instance_private (TubaViewsThread* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsThread_private_offset);
}

void
tuba_views_thread_thread_role_connect_posts (TubaAPIStatus* prev,
                                             TubaAPIStatus* curr)
{
	TubaViewsThreadThreadRole _tmp0_;
	TubaViewsThreadThreadRole _tmp1_;
	g_return_if_fail (curr != NULL);
	if (prev == NULL) {
		return;
	}
	_tmp0_ = tuba_api_status_get_tuba_thread_role (prev);
	_tmp1_ = _tmp0_;
	switch (_tmp1_) {
		case TUBA_VIEWS_THREAD_THREAD_ROLE_NONE:
		{
			tuba_api_status_set_tuba_thread_role (prev, TUBA_VIEWS_THREAD_THREAD_ROLE_START);
			tuba_api_status_set_tuba_thread_role (curr, TUBA_VIEWS_THREAD_THREAD_ROLE_END);
			break;
		}
		default:
		{
			tuba_api_status_set_tuba_thread_role (prev, TUBA_VIEWS_THREAD_THREAD_ROLE_MIDDLE);
			tuba_api_status_set_tuba_thread_role (curr, TUBA_VIEWS_THREAD_THREAD_ROLE_END);
			break;
		}
	}
}

 G_GNUC_NO_INLINE static GType
tuba_views_thread_thread_role_get_type_once (void)
{
	static const GEnumValue values[] = {{TUBA_VIEWS_THREAD_THREAD_ROLE_NONE, "TUBA_VIEWS_THREAD_THREAD_ROLE_NONE", "none"}, {TUBA_VIEWS_THREAD_THREAD_ROLE_START, "TUBA_VIEWS_THREAD_THREAD_ROLE_START", "start"}, {TUBA_VIEWS_THREAD_THREAD_ROLE_MIDDLE, "TUBA_VIEWS_THREAD_THREAD_ROLE_MIDDLE", "middle"}, {TUBA_VIEWS_THREAD_THREAD_ROLE_END, "TUBA_VIEWS_THREAD_THREAD_ROLE_END", "end"}, {0, NULL, NULL}};
	GType tuba_views_thread_thread_role_type_id;
	tuba_views_thread_thread_role_type_id = g_enum_register_static ("TubaViewsThreadThreadRole", values);
	return tuba_views_thread_thread_role_type_id;
}

GType
tuba_views_thread_thread_role_get_type (void)
{
	static GType tuba_views_thread_thread_role_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_thread_thread_role_type_id__once)) {
		GType tuba_views_thread_thread_role_type_id;
		tuba_views_thread_thread_role_type_id = tuba_views_thread_thread_role_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_thread_thread_role_type_id__once, tuba_views_thread_thread_role_type_id);
	}
	return tuba_views_thread_thread_role_type_id__once;
}

static gboolean
_tuba_views_thread_status_comp_func_lambda88_ (const gchar* s1,
                                               const gchar* s2)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gboolean result;
	g_return_val_if_fail (s1 != NULL, FALSE);
	g_return_val_if_fail (s2 != NULL, FALSE);
	_tmp0_ = tuba_api_status_get_id (G_TYPE_CHECK_INSTANCE_CAST (s1, TUBA_API_TYPE_STATUS, TubaAPIStatus));
	_tmp1_ = _tmp0_;
	_tmp2_ = tuba_api_status_get_id (G_TYPE_CHECK_INSTANCE_CAST (s2, TUBA_API_TYPE_STATUS, TubaAPIStatus));
	_tmp3_ = _tmp2_;
	result = g_strcmp0 (_tmp1_, _tmp3_) == 0;
	return result;
}

static gboolean
__tuba_views_thread_status_comp_func_lambda88__gequal_func (gconstpointer a,
                                                            gconstpointer b)
{
	gboolean result;
	result = _tuba_views_thread_status_comp_func_lambda88_ ((const gchar*) a, (const gchar*) b);
	return result;
}

static void
tuba_views_thread_real_attempt_focus_grab (TubaViewsContentBase* base)
{
	TubaViewsThread * self;
	self = (TubaViewsThread*) base;
}

static void
_tuba_views_thread_on_refresh_tuba_application_refresh (TubaApplication* _sender,
                                                        gpointer self)
{
	tuba_views_thread_on_refresh ((TubaViewsThread*) self);
}

static void
_tuba_views_thread_on_time_update_tuba_application_time_update (TubaApplication* _sender,
                                                                gpointer self)
{
	tuba_views_thread_on_time_update ((TubaViewsThread*) self);
}

TubaViewsThread*
tuba_views_thread_construct (GType object_type,
                             TubaAPIStatus* status)
{
	TubaViewsThread * self = NULL;
	TubaViewsBaseStatusMessage* _tmp0_ = NULL;
	TubaViewsBaseStatusMessage* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	TubaApplication* _tmp4_;
	TubaApplication* _tmp5_;
	g_return_val_if_fail (status != NULL, NULL);
	_tmp0_ = tuba_views_base_status_message_new ();
	_tmp0_->loading = TRUE;
	_tmp1_ = _tmp0_;
	self = (TubaViewsThread*) g_object_new (object_type, "root-status", status, "base-status", _tmp1_, "label", _ ("Conversation"), "allow-nesting", TRUE, NULL);
	_g_object_unref0 (_tmp1_);
	tuba_account_holder_construct_account_holder ((TubaAccountHolder*) self);
	_tmp2_ = tuba_api_status_get_id (status);
	_tmp3_ = _tmp2_;
	tuba_views_thread_update_root_status (self, _tmp3_, NULL, NULL);
	_tmp4_ = tuba_app;
	g_signal_connect_object (_tmp4_, "refresh", (GCallback) _tuba_views_thread_on_refresh_tuba_application_refresh, self, 0);
	_tmp5_ = tuba_app;
	g_signal_connect_object (_tmp5_, "time-update", (GCallback) _tuba_views_thread_on_time_update_tuba_application_time_update, self, 0);
	return self;
}

TubaViewsThread*
tuba_views_thread_new (TubaAPIStatus* status)
{
	return tuba_views_thread_construct (TUBA_VIEWS_TYPE_THREAD, status);
}

static void
tuba_views_thread_on_refresh (TubaViewsThread* self)
{
	GtkScrolledWindow* _tmp0_;
	GtkAdjustment* _tmp1_;
	GtkAdjustment* _tmp2_;
	GtkButton* _tmp3_;
	TubaViewsBaseStatusMessage* _tmp4_ = NULL;
	TubaViewsBaseStatusMessage* _tmp5_;
	AdwToast* _tmp6_;
	g_return_if_fail (self != NULL);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		return;
	}
	_tmp0_ = ((TubaViewsBase*) self)->scrolled;
	_tmp1_ = gtk_scrolled_window_get_vadjustment (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_adjustment_set_value (_tmp2_, (gdouble) 0);
	_tmp3_ = ((TubaViewsBase*) self)->status_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, FALSE);
	tuba_views_base_clear ((TubaViewsBase*) self);
	_tmp4_ = tuba_views_base_status_message_new ();
	_tmp4_->loading = TRUE;
	_tmp5_ = _tmp4_;
	tuba_views_base_set_base_status ((TubaViewsBase*) self, _tmp5_);
	_g_object_unref0 (_tmp5_);
	tuba_views_thread_request (self, NULL, NULL);
	_tmp6_ = self->priv->refresh_toast;
	if (_tmp6_ != NULL) {
		AdwToast* _tmp7_;
		_tmp7_ = self->priv->refresh_toast;
		adw_toast_dismiss (_tmp7_);
		_g_object_unref0 (self->priv->refresh_toast);
		self->priv->refresh_toast = NULL;
	}
}

static void
tuba_views_thread_update_root_status_data_free (gpointer _data)
{
	TubaViewsThreadUpdateRootStatusData* _data_;
	_data_ = _data;
	_g_free0 (_data_->status_id);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaViewsThreadUpdateRootStatusData, _data_);
}

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

static void
tuba_views_thread_update_root_status (TubaViewsThread* self,
                                      const gchar* status_id,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	TubaViewsThreadUpdateRootStatusData* _data_;
	TubaViewsThread* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (status_id != NULL);
	_data_ = g_slice_new0 (TubaViewsThreadUpdateRootStatusData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_thread_update_root_status_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (status_id);
	_g_free0 (_data_->status_id);
	_data_->status_id = _tmp1_;
	tuba_views_thread_update_root_status_co (_data_);
}

static void
tuba_views_thread_update_root_status_finish (TubaViewsThread* self,
                                             GAsyncResult* _res_)
{
	TubaViewsThreadUpdateRootStatusData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

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
tuba_views_thread_update_root_status_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	TubaViewsThreadUpdateRootStatusData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_thread_update_root_status_co (_data_);
}

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

static gboolean
tuba_views_thread_update_root_status_co (TubaViewsThreadUpdateRootStatusData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_root_status;
	if (_data_->_tmp0_ == NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = _data_->self->priv->root_update_cancellable;
	if (_data_->_tmp1_ != NULL) {
		_data_->_tmp2_ = _data_->self->priv->root_update_cancellable;
		g_cancellable_cancel (_data_->_tmp2_);
	}
	_data_->_tmp3_ = g_cancellable_new ();
	_g_object_unref0 (_data_->self->priv->root_update_cancellable);
	_data_->self->priv->root_update_cancellable = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->self->priv->_root_status_widget;
	_data_->_tmp5_ = _g_object_ref0 (_data_->_tmp4_);
	_data_->status_widget = _data_->_tmp5_;
	_data_->_tmp6_ = string_to_string (_data_->status_id);
	_data_->_tmp7_ = g_strconcat ("/api/v1/statuses/", _data_->_tmp6_, NULL);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = tuba_account_holder_get_account ((TubaAccountHolder*) _data_->self);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _g_object_ref0 (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->self->priv->root_update_cancellable;
	_data_->_tmp13_ = _g_object_ref0 (_data_->_tmp12_);
	_data_->_tmp14_ = NULL;
	_data_->_tmp14_ = tuba_request_v2_new (_data_->_tmp8_, TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp14_, _data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp11_);
	tuba_request_v2_set_ctx (_data_->_tmp14_, (GtkWidget*) _data_->self);
	tuba_request_v2_set_cancellable (_data_->_tmp14_, _data_->_tmp13_);
	_g_object_unref0 (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_g_free0 (_data_->_tmp8_);
	_data_->req = _data_->_tmp15_;
	{
		_data_->_tmp16_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp16_, tuba_views_thread_update_root_status_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp17_ = tuba_request_v2_exec_finish (_data_->_tmp16_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp17_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp18_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp18_, NULL, tuba_views_thread_update_root_status_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp19_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp19_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp20_ = tuba_network;
		_data_->_tmp21_ = _data_->parser;
		_data_->_tmp22_ = tuba_network_parse_node (_data_->_tmp20_, _data_->_tmp21_);
		_data_->node = _data_->_tmp22_;
		_data_->_tmp23_ = _data_->node;
		_data_->_tmp24_ = tuba_api_status_from (_data_->_tmp23_, &_data_->_inner_error0_);
		_data_->api_status = _data_->_tmp24_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp25_ = _data_->api_status;
		if (_data_->_tmp25_ != NULL) {
			_data_->_tmp26_ = _data_->self->priv->_root_status;
			if (_data_->_tmp26_ != NULL) {
				_data_->_tmp27_ = _data_->self->priv->_root_status;
				_data_->_tmp28_ = _data_->api_status;
				tuba_entity_patch ((TubaEntity*) _data_->_tmp27_, (GObject*) _data_->_tmp28_);
			}
			_data_->_tmp29_ = _data_->status_widget;
			if (_data_->_tmp29_ != NULL) {
				_data_->_tmp30_ = _data_->status_widget;
				_data_->_tmp31_ = _data_->api_status;
				tuba_widgets_status_on_edit (_data_->_tmp30_, _data_->_tmp31_);
				_g_object_unref0 (_data_->status_widget);
				_data_->status_widget = NULL;
			}
		}
		_g_object_unref0 (_data_->api_status);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_data_->_inner_error0_);
		g_debug ("Thread.vala:97: Message is cancelled.");
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp32_ = string_to_string (_data_->status_id);
		_data_->_tmp33_ = _data_->e;
		_data_->_tmp34_ = _data_->_tmp33_->message;
		_data_->_tmp35_ = string_to_string (_data_->_tmp34_);
		_data_->_tmp36_ = g_strconcat ("Couldn't update root status ", _data_->_tmp32_, ": ", _data_->_tmp35_, NULL);
		_data_->_tmp37_ = _data_->_tmp36_;
		g_warning ("Thread.vala:99: %s", _data_->_tmp37_);
		_g_free0 (_data_->_tmp37_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		_g_object_unref0 (_data_->status_widget);
		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_->status_widget);
	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_views_thread_real_on_account_changed (TubaAccountHolder* base,
                                           TubaInstanceAccount* acc)
{
	TubaViewsThread * self;
	TubaInstanceAccount* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	self = (TubaViewsThread*) base;
	_tmp0_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		return;
	}
	tuba_account_holder_set_account ((TubaAccountHolder*) self, acc);
	tuba_views_thread_request (self, NULL, NULL);
}

static void
tuba_views_thread_connect_threads (TubaViewsThread* self)
{
	TubaAPIStatus* last_status = NULL;
	gchar* last_id = NULL;
	g_return_if_fail (self != NULL);
	last_status = NULL;
	last_id = NULL;
	{
		gint pos = 0;
		pos = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GListStore* _tmp2_;
				guint _tmp3_;
				guint _tmp4_;
				TubaAPIStatus* status = NULL;
				GListStore* _tmp5_;
				GObject* _tmp6_;
				TubaAPIStatus* _tmp7_;
				TubaAPIStatus* _tmp8_;
				gchar* id = NULL;
				TubaAPIStatus* _tmp9_;
				TubaAPIStatus* _tmp10_;
				TubaAPIStatus* _tmp11_;
				const gchar* _tmp12_;
				const gchar* _tmp13_;
				gchar* _tmp14_;
				const gchar* _tmp15_;
				const gchar* _tmp16_;
				TubaAPIStatus* _tmp19_;
				TubaAPIStatus* _tmp20_;
				TubaAPIStatus* _tmp21_;
				const gchar* _tmp22_;
				const gchar* _tmp23_;
				gchar* _tmp24_;
				TubaAPIStatus* _tmp25_;
				TubaAPIStatus* _tmp26_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = pos;
					pos = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = ((TubaViewsContentBase*) self)->model;
				g_object_get (_tmp2_, "n-items", &_tmp3_, NULL);
				_tmp4_ = _tmp3_;
				if (!(((guint) pos) < _tmp4_)) {
					break;
				}
				_tmp5_ = ((TubaViewsContentBase*) self)->model;
				_tmp6_ = g_list_model_get_item ((GListModel*) _tmp5_, (guint) pos);
				_tmp7_ = TUBA_API_IS_STATUS (_tmp6_) ? ((TubaAPIStatus*) _tmp6_) : NULL;
				if (_tmp7_ == NULL) {
					_g_object_unref0 (_tmp6_);
				}
				status = _tmp7_;
				_tmp8_ = status;
				tuba_api_status_set_tuba_thread_role (_tmp8_, TUBA_VIEWS_THREAD_THREAD_ROLE_NONE);
				_tmp9_ = status;
				_tmp10_ = tuba_api_status_get_formal (_tmp9_);
				_tmp11_ = _tmp10_;
				_tmp12_ = tuba_api_status_get_in_reply_to_id (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = g_strdup (_tmp13_);
				id = _tmp14_;
				_tmp15_ = id;
				_tmp16_ = last_id;
				if (g_strcmp0 (_tmp15_, _tmp16_) == 0) {
					TubaAPIStatus* _tmp17_;
					TubaAPIStatus* _tmp18_;
					_tmp17_ = last_status;
					_tmp18_ = status;
					tuba_views_thread_thread_role_connect_posts (_tmp17_, _tmp18_);
				}
				_tmp19_ = status;
				_tmp20_ = tuba_api_status_get_formal (_tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = tuba_api_status_get_id (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = g_strdup (_tmp23_);
				_g_free0 (last_id);
				last_id = _tmp24_;
				_tmp25_ = status;
				_tmp26_ = _g_object_ref0 (_tmp25_);
				_g_object_unref0 (last_status);
				last_status = _tmp26_;
				_g_free0 (id);
				_g_object_unref0 (status);
			}
		}
	}
	_g_free0 (last_id);
	_g_object_unref0 (last_status);
}

static void
tuba_views_thread_on_replied (TubaViewsThread* self,
                              TubaAPIStatus* t_status)
{
	gboolean found = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	if (t_status == NULL) {
		return;
	}
	found = FALSE;
	_tmp0_ = tuba_api_status_get_in_reply_to_id (t_status);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		{
			guint i = 0U;
			i = (guint) 0;
			{
				gboolean _tmp2_ = FALSE;
				_tmp2_ = TRUE;
				while (TRUE) {
					GListStore* _tmp4_;
					TubaAPIStatus* status_obj = NULL;
					GListStore* _tmp5_;
					GObject* _tmp6_;
					TubaAPIStatus* _tmp7_;
					const gchar* _tmp8_;
					const gchar* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					if (!_tmp2_) {
						guint _tmp3_;
						_tmp3_ = i;
						i = _tmp3_ + 1;
					}
					_tmp2_ = FALSE;
					_tmp4_ = ((TubaViewsContentBase*) self)->model;
					if (!(i < g_list_model_get_n_items ((GListModel*) _tmp4_))) {
						break;
					}
					_tmp5_ = ((TubaViewsContentBase*) self)->model;
					_tmp6_ = g_list_model_get_item ((GListModel*) _tmp5_, i);
					status_obj = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TUBA_API_TYPE_STATUS, TubaAPIStatus);
					_tmp7_ = status_obj;
					_tmp8_ = tuba_api_status_get_id (_tmp7_);
					_tmp9_ = _tmp8_;
					_tmp10_ = tuba_api_status_get_in_reply_to_id (t_status);
					_tmp11_ = _tmp10_;
					if (g_strcmp0 (_tmp9_, _tmp11_) == 0) {
						GListStore* _tmp12_;
						_tmp12_ = ((TubaViewsContentBase*) self)->model;
						g_list_store_insert (_tmp12_, i + 1, (GObject*) t_status);
						found = TRUE;
						_g_object_unref0 (status_obj);
						break;
					}
					_g_object_unref0 (status_obj);
				}
			}
		}
	}
	if (!found) {
		GListStore* _tmp13_;
		_tmp13_ = ((TubaViewsContentBase*) self)->model;
		g_list_store_append (_tmp13_, (GObject*) t_status);
	}
	tuba_views_thread_connect_threads (self);
}

static void
_tuba_views_thread_spoiler_toggle_button_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                            gpointer self)
{
	tuba_views_thread_spoiler_toggle_button_toggled ((TubaViewsThread*) self);
}

static void
tuba_views_thread_real_build_header (TubaViewsBase* base)
{
	TubaViewsThread * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GtkToggleButton* _tmp2_ = NULL;
	GtkToggleButton* _tmp3_;
	AdwHeaderBar* _tmp4_;
	GtkToggleButton* _tmp5_;
	self = (TubaViewsThread*) base;
	TUBA_VIEWS_BASE_CLASS (tuba_views_thread_parent_class)->build_header ((TubaViewsBase*) G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase));
	_tmp0_ = g_strdup ("tuba-eye-open-negative-filled-symbolic");
	_tmp1_ = g_strdup (_ ("Reveal Spoilers"));
	_tmp2_ = (GtkToggleButton*) gtk_toggle_button_new ();
	gtk_button_set_icon_name ((GtkButton*) _tmp2_, _tmp0_);
	_g_free0 (_tmp0_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	gtk_toggle_button_set_active (_tmp2_, self->priv->_reveal_spoilers);
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, FALSE);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->spoiler_toggle_button);
	self->priv->spoiler_toggle_button = _tmp2_;
	_tmp3_ = self->priv->spoiler_toggle_button;
	g_signal_connect_object (_tmp3_, "toggled", (GCallback) _tuba_views_thread_spoiler_toggle_button_toggled_gtk_toggle_button_toggled, self, 0);
	_tmp4_ = ((TubaViewsBase*) self)->header;
	_tmp5_ = self->priv->spoiler_toggle_button;
	adw_header_bar_pack_end (_tmp4_, (GtkWidget*) _tmp5_);
}

static void
tuba_views_thread_spoiler_toggle_button_toggled (TubaViewsThread* self)
{
	gboolean spoiler_toggle_button_active = FALSE;
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	const gchar* _tmp3_ = NULL;
	GtkToggleButton* _tmp4_;
	const gchar* _tmp5_ = NULL;
	GtkToggleButton* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->spoiler_toggle_button;
	_tmp1_ = gtk_toggle_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	spoiler_toggle_button_active = _tmp2_;
	if (spoiler_toggle_button_active) {
		_tmp3_ = "tuba-eye-not-looking-symbolic";
	} else {
		_tmp3_ = "tuba-eye-open-negative-filled-symbolic";
	}
	_tmp4_ = self->priv->spoiler_toggle_button;
	gtk_button_set_icon_name ((GtkButton*) _tmp4_, _tmp3_);
	if (spoiler_toggle_button_active) {
		_tmp5_ = _ ("Hide Spoilers");
	} else {
		_tmp5_ = _ ("Reveal Spoilers");
	}
	_tmp6_ = self->priv->spoiler_toggle_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp6_, _tmp5_);
	tuba_views_thread_set_reveal_spoilers (self, spoiler_toggle_button_active);
}

static gboolean
_tuba_views_thread_grab_focus_of_root_gsource_func (gpointer self)
{
	gboolean result;
	result = tuba_views_thread_grab_focus_of_root ((TubaViewsThread*) self);
	return result;
}

static void
tuba_views_thread_real_on_content_changed (TubaViewsBase* base)
{
	TubaViewsThread * self;
	gboolean _tmp11_ = FALSE;
	TubaWidgetsStatus* _tmp12_;
	self = (TubaViewsThread*) base;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GListStore* _tmp2_;
				guint _tmp3_;
				guint _tmp4_;
				TubaAPIStatus* status = NULL;
				GListStore* _tmp5_;
				GObject* _tmp6_;
				TubaAPIStatus* _tmp7_;
				gboolean _tmp8_;
				gboolean _tmp9_;
				if (!_tmp0_) {
					guint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = ((TubaViewsContentBase*) self)->model;
				g_object_get (_tmp2_, "n-items", &_tmp3_, NULL);
				_tmp4_ = _tmp3_;
				if (!(i < _tmp4_)) {
					break;
				}
				_tmp5_ = ((TubaViewsContentBase*) self)->model;
				_tmp6_ = g_list_model_get_item ((GListModel*) _tmp5_, i);
				status = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TUBA_API_TYPE_STATUS, TubaAPIStatus);
				_tmp7_ = status;
				_tmp8_ = tuba_api_status_get_has_spoiler (_tmp7_);
				_tmp9_ = _tmp8_;
				if (_tmp9_) {
					GtkToggleButton* _tmp10_;
					_tmp10_ = self->priv->spoiler_toggle_button;
					gtk_widget_set_visible ((GtkWidget*) _tmp10_, TRUE);
					_g_object_unref0 (status);
					break;
				}
				_g_object_unref0 (status);
			}
		}
	}
	TUBA_VIEWS_BASE_CLASS (tuba_views_thread_parent_class)->on_content_changed ((TubaViewsBase*) G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase));
	_tmp12_ = self->priv->_root_status_widget;
	if (_tmp12_ != NULL) {
		_tmp11_ = !self->priv->grabbed_focus;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		self->priv->grab_focus_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 100, _tuba_views_thread_grab_focus_of_root_gsource_func, g_object_ref (self), g_object_unref);
	}
}

static gboolean
tuba_views_thread_grab_focus_of_root (TubaViewsThread* self)
{
	TubaWidgetsStatus* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	self->priv->grab_focus_timeout = (guint) 0;
	_tmp0_ = self->priv->_root_status_widget;
	if (_tmp0_ != NULL) {
		TubaWidgetsStatus* _tmp1_;
		_tmp1_ = self->priv->_root_status_widget;
		self->priv->grabbed_focus = gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
	}
	result = G_SOURCE_REMOVE;
	return result;
}

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

void
tuba_views_thread_request (TubaViewsThread* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	TubaViewsThreadRequestData* _data_;
	TubaViewsThread* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaViewsThreadRequestData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_thread_request_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_views_thread_request_co (_data_);
}

void
tuba_views_thread_request_finish (TubaViewsThread* self,
                                  GAsyncResult* _res_)
{
	TubaViewsThreadRequestData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block81Data*
block81_data_ref (Block81Data* _data81_)
{
	g_atomic_int_inc (&_data81_->_ref_count_);
	return _data81_;
}

static void
block81_data_unref (void * _userdata_)
{
	Block81Data* _data81_;
	_data81_ = (Block81Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data81_->_ref_count_)) {
		TubaViewsThread* self;
		self = _data81_->self;
		_data81_->to_add_descendants = (_vala_array_free (_data81_->to_add_descendants, _data81_->to_add_descendants_length1, (GDestroyNotify) g_object_unref), NULL);
		_data81_->to_add_ancestors = (_vala_array_free (_data81_->to_add_ancestors, _data81_->to_add_ancestors_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block81Data, _data81_);
	}
}

static void
tuba_views_thread_request_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	TubaViewsThreadRequestData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_thread_request_co (_data_);
}

static gpointer
_json_array_ref0 (gpointer self)
{
	return self ? json_array_ref (self) : NULL;
}

static JsonNode*
_vala_JsonNode_copy (JsonNode* self)
{
	return g_boxed_copy (json_node_get_type (), self);
}

static gpointer
__vala_JsonNode_copy0 (gpointer self)
{
	return self ? _vala_JsonNode_copy (self) : NULL;
}

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

static void
___lambda89_ (Block81Data* _data81_,
              JsonArray* array,
              guint i,
              JsonNode* node)
{
	TubaViewsThread* self;
	TubaAPIStatus* e = NULL;
	JsonNode* _tmp0_;
	TubaEntity* _tmp1_;
	TubaAPIStatus* _tmp2_;
	TubaAPIStatus* _tmp3_;
	TubaAPIStatus* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	self = _data81_->self;
	g_return_if_fail (array != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = __vala_JsonNode_copy0 (node);
	_tmp1_ = tuba_helper_entity_from_json (_tmp0_, TUBA_API_TYPE_STATUS, FALSE);
	e = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TUBA_API_TYPE_STATUS, TubaAPIStatus);
	_tmp2_ = e;
	_tmp3_ = tuba_api_status_get_formal (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_api_status_get_tuba_filter_hidden (_tmp4_);
	_tmp6_ = _tmp5_;
	if (!_tmp6_) {
		TubaAPIStatus* _tmp7_;
		GObject* _tmp8_;
		_tmp7_ = e;
		_tmp8_ = _g_object_ref0 ((GObject*) _tmp7_);
		_vala_array_add114 (&_data81_->to_add_ancestors, &_data81_->to_add_ancestors_length1, &_data81_->_to_add_ancestors_size_, _tmp8_);
	}
	_g_object_unref0 (e);
}

static void
____lambda89__json_array_foreach (JsonArray* array,
                                  guint index_,
                                  JsonNode* element_node,
                                  gpointer self)
{
	___lambda89_ (self, array, index_, element_node);
}

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

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

static void
___lambda91_ (Block81Data* _data81_,
              JsonArray* array,
              guint i,
              JsonNode* node)
{
	TubaViewsThread* self;
	TubaAPIStatus* e = NULL;
	JsonNode* _tmp0_;
	TubaEntity* _tmp1_;
	TubaAPIStatus* _tmp2_;
	TubaAPIStatus* _tmp3_;
	TubaAPIStatus* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	self = _data81_->self;
	g_return_if_fail (array != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = __vala_JsonNode_copy0 (node);
	_tmp1_ = tuba_helper_entity_from_json (_tmp0_, TUBA_API_TYPE_STATUS, FALSE);
	e = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TUBA_API_TYPE_STATUS, TubaAPIStatus);
	_tmp2_ = e;
	_tmp3_ = tuba_api_status_get_formal (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_api_status_get_tuba_filter_hidden (_tmp4_);
	_tmp6_ = _tmp5_;
	if (!_tmp6_) {
		TubaAPIStatus* _tmp7_;
		GObject* _tmp8_;
		_tmp7_ = e;
		_tmp8_ = _g_object_ref0 ((GObject*) _tmp7_);
		_vala_array_add116 (&_data81_->to_add_descendants, &_data81_->to_add_descendants_length1, &_data81_->_to_add_descendants_size_, _tmp8_);
	}
	_g_object_unref0 (e);
}

static void
____lambda91__json_array_foreach (JsonArray* array,
                                  guint index_,
                                  JsonNode* element_node,
                                  gpointer self)
{
	___lambda91_ (self, array, index_, element_node);
}

static gboolean
tuba_views_thread_request_co (TubaViewsThreadRequestData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_root_status;
	_data_->_tmp1_ = tuba_api_status_get_id (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = string_to_string (_data_->_tmp2_);
	_data_->_tmp4_ = g_strconcat ("/api/v1/statuses/", _data_->_tmp3_, "/context", NULL);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = tuba_account_holder_get_account ((TubaAccountHolder*) _data_->self);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = tuba_request_v2_new (_data_->_tmp5_, TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp9_, _data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp8_);
	tuba_request_v2_set_ctx (_data_->_tmp9_, (GtkWidget*) _data_->self);
	_data_->_tmp10_ = _data_->_tmp9_;
	_g_free0 (_data_->_tmp5_);
	_data_->req = _data_->_tmp10_;
	{
		_data_->_data81_ = g_slice_new0 (Block81Data);
		_data_->_data81_->_ref_count_ = 1;
		_data_->_data81_->self = g_object_ref (_data_->self);
		_data_->_tmp11_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp11_, tuba_views_thread_request_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp12_ = tuba_request_v2_exec_finish (_data_->_tmp11_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp12_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block81_data_unref (_data_->_data81_);
			_data_->_data81_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp13_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp13_, NULL, tuba_views_thread_request_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp14_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp14_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			block81_data_unref (_data_->_data81_);
			_data_->_data81_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp15_ = tuba_network;
		_data_->_tmp16_ = _data_->parser;
		_data_->_tmp17_ = tuba_network_parse (_data_->_tmp15_, _data_->_tmp16_);
		_data_->root = _data_->_tmp17_;
		_data_->_tmp18_ = g_new0 (GObject*, 0 + 1);
		_data_->_data81_->to_add_ancestors = _data_->_tmp18_;
		_data_->_data81_->to_add_ancestors_length1 = 0;
		_data_->_data81_->_to_add_ancestors_size_ = _data_->_data81_->to_add_ancestors_length1;
		_data_->_tmp19_ = _data_->root;
		_data_->_tmp20_ = json_object_get_array_member (_data_->_tmp19_, "ancestors");
		_data_->_tmp21_ = _json_array_ref0 (_data_->_tmp20_);
		_data_->ancestors = _data_->_tmp21_;
		_data_->_tmp22_ = _data_->ancestors;
		json_array_foreach_element (_data_->_tmp22_, ____lambda89__json_array_foreach, _data_->_data81_);
		_data_->_tmp23_ = _data_->self->priv->_root_status;
		_data_->_tmp24_ = _g_object_ref0 ((GObject*) _data_->_tmp23_);
		_vala_array_add115 (&_data_->_data81_->to_add_ancestors, &_data_->_data81_->to_add_ancestors_length1, &_data_->_data81_->_to_add_ancestors_size_, _data_->_tmp24_);
		_data_->_tmp25_ = ((TubaViewsContentBase*) _data_->self)->model;
		_data_->_tmp26_ = ((TubaViewsContentBase*) _data_->self)->model;
		_data_->_tmp27_ = _data_->_data81_->to_add_ancestors;
		_data_->_tmp27__length1 = _data_->_data81_->to_add_ancestors_length1;
		g_list_store_splice (_data_->_tmp25_, g_list_model_get_n_items ((GListModel*) _data_->_tmp26_), (guint) 0, _data_->_tmp27_, (guint) _data_->_tmp27__length1);
		_data_->_tmp28_ = g_new0 (GObject*, 0 + 1);
		_data_->_data81_->to_add_descendants = _data_->_tmp28_;
		_data_->_data81_->to_add_descendants_length1 = 0;
		_data_->_data81_->_to_add_descendants_size_ = _data_->_data81_->to_add_descendants_length1;
		_data_->_tmp29_ = _data_->root;
		_data_->_tmp30_ = json_object_get_array_member (_data_->_tmp29_, "descendants");
		_data_->_tmp31_ = _json_array_ref0 (_data_->_tmp30_);
		_data_->descendants = _data_->_tmp31_;
		_data_->_tmp32_ = _data_->descendants;
		json_array_foreach_element (_data_->_tmp32_, ____lambda91__json_array_foreach, _data_->_data81_);
		_data_->_tmp33_ = ((TubaViewsContentBase*) _data_->self)->model;
		_data_->_tmp34_ = ((TubaViewsContentBase*) _data_->self)->model;
		_data_->_tmp35_ = _data_->_data81_->to_add_descendants;
		_data_->_tmp35__length1 = _data_->_data81_->to_add_descendants_length1;
		g_list_store_splice (_data_->_tmp33_, g_list_model_get_n_items ((GListModel*) _data_->_tmp34_), (guint) 0, _data_->_tmp35_, (guint) _data_->_tmp35__length1);
		tuba_views_thread_connect_threads (_data_->self);
		tuba_views_base_on_content_changed ((TubaViewsBase*) _data_->self);
		_json_array_unref0 (_data_->descendants);
		_json_array_unref0 (_data_->ancestors);
		_json_object_unref0 (_data_->root);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
		block81_data_unref (_data_->_data81_);
		_data_->_data81_ = NULL;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp36_ = _data_->e;
		_data_->_tmp37_ = _data_->e;
		_data_->_tmp38_ = _data_->_tmp37_->message;
		tuba_views_base_on_error ((TubaViewsBase*) _data_->self, (gint32) _data_->_tmp36_->code, _data_->_tmp38_);
		_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;
}

void
tuba_views_thread_open_from_link (const gchar* q)
{
	g_return_if_fail (q != NULL);
	tuba_views_thread_open_from_link_async (q, NULL, NULL);
}

static void
tuba_views_thread_open_from_link_async_data_free (gpointer _data)
{
	TubaViewsThreadOpenFromLinkAsyncData* _data_;
	_data_ = _data;
	_g_free0 (_data_->q);
	g_slice_free (TubaViewsThreadOpenFromLinkAsyncData, _data_);
}

void
tuba_views_thread_open_from_link_async (const gchar* q,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	TubaViewsThreadOpenFromLinkAsyncData* _data_;
	gchar* _tmp0_;
	g_return_if_fail (q != NULL);
	_data_ = g_slice_new0 (TubaViewsThreadOpenFromLinkAsyncData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_thread_open_from_link_async_data_free);
	_tmp0_ = g_strdup (q);
	_g_free0 (_data_->q);
	_data_->q = _tmp0_;
	tuba_views_thread_open_from_link_async_co (_data_);
}

void
tuba_views_thread_open_from_link_finish (GAsyncResult* _res_)
{
	TubaViewsThreadOpenFromLinkAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_views_thread_open_from_link_async_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	TubaViewsThreadOpenFromLinkAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_thread_open_from_link_async_co (_data_);
}

static gboolean
tuba_views_thread_open_from_link_async_co (TubaViewsThreadOpenFromLinkAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = tuba_request_v2_new ("/api/v1/search", TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp4_, _data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->req = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->req;
	tuba_request_v2_add_parameter (_data_->_tmp5_, "q", _data_->q);
	_data_->_tmp6_ = _data_->req;
	tuba_request_v2_add_parameter (_data_->_tmp6_, "resolve", "true");
	{
		_data_->_tmp7_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp7_, tuba_views_thread_open_from_link_async_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp8_ = tuba_request_v2_exec_finish (_data_->_tmp7_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp8_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp9_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp9_, NULL, tuba_views_thread_open_from_link_async_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp10_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp10_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp11_ = tuba_network;
		_data_->_tmp12_ = _data_->parser;
		_data_->_tmp13_ = tuba_network_parse (_data_->_tmp11_, _data_->_tmp12_);
		_data_->root = _data_->_tmp13_;
		_data_->_tmp14_ = _data_->root;
		_data_->_tmp15_ = json_object_get_array_member (_data_->_tmp14_, "statuses");
		_data_->_tmp16_ = _json_array_ref0 (_data_->_tmp15_);
		_data_->statuses = _data_->_tmp16_;
		_data_->_tmp17_ = _data_->statuses;
		_data_->_tmp18_ = json_array_get_element (_data_->_tmp17_, (guint) 0);
		_data_->_tmp19_ = __vala_JsonNode_copy0 (_data_->_tmp18_);
		_data_->node = _data_->_tmp19_;
		_data_->_tmp20_ = _data_->node;
		if (_data_->_tmp20_ != NULL) {
			_data_->_tmp21_ = _data_->node;
			_data_->_tmp22_ = tuba_api_status_from (_data_->_tmp21_, &_data_->_inner_error0_);
			_data_->status = _data_->_tmp22_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				__vala_JsonNode_free0 (_data_->node);
				_json_array_unref0 (_data_->statuses);
				_json_object_unref0 (_data_->root);
				_g_object_unref0 (_data_->parser);
				_g_object_unref0 (_data_->in_stream);
				goto __catch0_g_error;
			}
			_data_->_tmp23_ = tuba_app;
			_data_->_tmp24_ = tuba_application_get_main_window (_data_->_tmp23_);
			_data_->_tmp25_ = _data_->_tmp24_;
			_data_->_tmp26_ = _data_->status;
			_data_->_tmp27_ = tuba_views_thread_new (_data_->_tmp26_);
			g_object_ref_sink (_data_->_tmp27_);
			_data_->_tmp28_ = _data_->_tmp27_;
			_data_->_tmp29_ = tuba_dialogs_main_window_open_view (_data_->_tmp25_, (TubaViewsBase*) _data_->_tmp28_);
			_data_->_tmp30_ = _data_->_tmp29_;
			_g_object_unref0 (_data_->_tmp30_);
			_g_object_unref0 (_data_->_tmp28_);
			_g_object_unref0 (_data_->status);
		} else {
			_data_->_state_ = 3;
			tuba_utils_host_open_url (_data_->q, tuba_views_thread_open_from_link_async_ready, _data_);
			return FALSE;
			_state_3:
			tuba_utils_host_open_url_finish (_data_->_res_);
		}
		__vala_JsonNode_free0 (_data_->node);
		_json_array_unref0 (_data_->statuses);
		_json_object_unref0 (_data_->root);
		_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_->_tmp31_ = string_to_string (_data_->q);
		_data_->_tmp32_ = _data_->e;
		_data_->_tmp33_ = _data_->_tmp32_->message;
		_data_->_tmp34_ = string_to_string (_data_->_tmp33_);
		_data_->_tmp35_ = g_strconcat ("Couldn't resolve ", _data_->_tmp31_, ": ", _data_->_tmp34_, NULL);
		_data_->_tmp36_ = _data_->_tmp35_;
		g_warning ("Thread.vala:276: %s", _data_->_tmp36_);
		_g_free0 (_data_->_tmp36_);
		_data_->_state_ = 4;
		tuba_utils_host_open_url (_data_->q, tuba_views_thread_open_from_link_async_ready, _data_);
		return FALSE;
		_state_4:
		tuba_utils_host_open_url_finish (_data_->_res_);
		_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;
}

static void
_tuba_views_thread_on_replied_tuba_dialogs_composer_dialog_success_callback (TubaAPIStatus* cb_status,
                                                                             gpointer self)
{
	tuba_views_thread_on_replied ((TubaViewsThread*) self, cb_status);
}

static GtkWidget*
tuba_views_thread_real_on_create_model_widget (TubaViewsContentBase* base,
                                               GObject* obj)
{
	TubaViewsThread * self;
	GtkWidget* widget = NULL;
	GtkWidget* _tmp0_;
	TubaWidgetsStatus* widget_status = NULL;
	GtkWidget* _tmp1_;
	TubaWidgetsStatus* _tmp2_;
	TubaWidgetsStatus* _tmp3_;
	TubaWidgetsStatus* _tmp4_;
	TubaWidgetsStatus* _tmp5_;
	TubaWidgetsMarkupView* _tmp6_;
	TubaWidgetsStatus* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	TubaAPIStatus* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	GtkWidget* result;
	self = (TubaViewsThread*) base;
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = TUBA_VIEWS_CONTENT_BASE_CLASS (tuba_views_thread_parent_class)->on_create_model_widget (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase), obj);
	widget = _tmp0_;
	_tmp1_ = widget;
	_tmp2_ = _g_object_ref0 (TUBA_WIDGETS_IS_STATUS (_tmp1_) ? ((TubaWidgetsStatus*) _tmp1_) : NULL);
	widget_status = _tmp2_;
	_tmp3_ = widget_status;
	(_tmp3_->reply_cb_target_destroy_notify == NULL) ? NULL : (_tmp3_->reply_cb_target_destroy_notify (_tmp3_->reply_cb_target), NULL);
	_tmp3_->reply_cb = NULL;
	_tmp3_->reply_cb_target = NULL;
	_tmp3_->reply_cb_target_destroy_notify = NULL;
	_tmp3_->reply_cb = _tuba_views_thread_on_replied_tuba_dialogs_composer_dialog_success_callback;
	_tmp3_->reply_cb_target = g_object_ref (self);
	_tmp3_->reply_cb_target_destroy_notify = g_object_unref;
	_tmp4_ = widget_status;
	tuba_widgets_status_set_enable_thread_lines (_tmp4_, TRUE);
	_tmp5_ = widget_status;
	_tmp6_ = _tmp5_->content;
	tuba_widgets_markup_view_set_selectable (_tmp6_, TRUE);
	_tmp7_ = widget_status;
	tuba_widgets_status_set_kind (_tmp7_, NULL);
	_tmp8_ = tuba_api_status_get_id (G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_TYPE_STATUS, TubaAPIStatus));
	_tmp9_ = _tmp8_;
	_tmp10_ = self->priv->_root_status;
	_tmp11_ = tuba_api_status_get_id (_tmp10_);
	_tmp12_ = _tmp11_;
	if (g_strcmp0 (_tmp9_, _tmp12_) == 0) {
		TubaWidgetsStatus* _tmp13_;
		TubaWidgetsStatus* _tmp14_;
		TubaWidgetsStatus* _tmp15_;
		TubaAPIStatus* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		_tmp13_ = widget_status;
		gtk_list_box_row_set_activatable ((GtkListBoxRow*) _tmp13_, FALSE);
		_tmp14_ = widget_status;
		tuba_widgets_status_expand_root (_tmp14_);
		_tmp15_ = widget_status;
		tuba_views_thread_set_root_status_widget (self, _tmp15_);
		_tmp16_ = self->priv->_root_status;
		_tmp17_ = tuba_api_status_get_id (_tmp16_);
		_tmp18_ = _tmp17_;
		tuba_views_thread_update_root_status (self, _tmp18_, NULL, NULL);
	}
	result = (GtkWidget*) widget_status;
	_g_object_unref0 (widget);
	return result;
}

static void
tuba_views_thread_on_time_update (TubaViewsThread* self)
{
	g_return_if_fail (self != NULL);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		return;
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GListStore* _tmp2_;
				guint _tmp3_;
				guint _tmp4_;
				TubaWidgetsStatus* status_widget = NULL;
				GtkListBox* _tmp5_;
				GtkListBoxRow* _tmp6_;
				TubaWidgetsStatus* _tmp7_;
				TubaWidgetsStatus* _tmp8_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = ((TubaViewsContentBase*) self)->model;
				g_object_get (_tmp2_, "n-items", &_tmp3_, NULL);
				_tmp4_ = _tmp3_;
				if (!(((guint) i) < MIN (_tmp4_, (guint) 250))) {
					break;
				}
				_tmp5_ = ((TubaViewsContentBase*) self)->content;
				_tmp6_ = gtk_list_box_get_row_at_index (_tmp5_, i);
				_tmp7_ = _g_object_ref0 (TUBA_WIDGETS_IS_STATUS (_tmp6_) ? ((TubaWidgetsStatus*) _tmp6_) : NULL);
				status_widget = _tmp7_;
				_tmp8_ = status_widget;
				if (_tmp8_ != NULL) {
					TubaWidgetsStatus* _tmp9_;
					_tmp9_ = status_widget;
					tuba_widgets_status_update_time (_tmp9_);
				}
				_g_object_unref0 (status_widget);
			}
		}
	}
	tuba_views_thread_regular_stat_updates (self, NULL, NULL);
}

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

static void
tuba_views_thread_regular_stat_updates (TubaViewsThread* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	TubaViewsThreadRegularStatUpdatesData* _data_;
	TubaViewsThread* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaViewsThreadRegularStatUpdatesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_thread_regular_stat_updates_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_views_thread_regular_stat_updates_co (_data_);
}

static void
tuba_views_thread_regular_stat_updates_finish (TubaViewsThread* self,
                                               GAsyncResult* _res_)
{
	TubaViewsThreadRegularStatUpdatesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block82Data*
block82_data_ref (Block82Data* _data82_)
{
	g_atomic_int_inc (&_data82_->_ref_count_);
	return _data82_;
}

static void
block82_data_unref (void * _userdata_)
{
	Block82Data* _data82_;
	_data82_ = (Block82Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data82_->_ref_count_)) {
		TubaViewsThread* self;
		self = _data82_->self;
		_data82_->context_statuses = (_vala_array_free (_data82_->context_statuses, _data82_->context_statuses_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block82Data, _data82_);
	}
}

static void
tuba_views_thread_regular_stat_updates_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	TubaViewsThreadRegularStatUpdatesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_thread_regular_stat_updates_co (_data_);
}

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

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

static void
___lambda92_ (Block82Data* _data82_,
              JsonArray* array,
              guint i,
              JsonNode* node)
{
	TubaViewsThread* self;
	TubaAPIStatus* e = NULL;
	JsonNode* _tmp0_;
	TubaEntity* _tmp1_;
	TubaAPIStatus* _tmp2_;
	TubaAPIStatus* _tmp3_;
	TubaAPIStatus* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	self = _data82_->self;
	g_return_if_fail (array != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = __vala_JsonNode_copy0 (node);
	_tmp1_ = tuba_helper_entity_from_json (_tmp0_, TUBA_API_TYPE_STATUS, FALSE);
	e = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TUBA_API_TYPE_STATUS, TubaAPIStatus);
	_tmp2_ = e;
	_tmp3_ = tuba_api_status_get_formal (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_api_status_get_tuba_filter_hidden (_tmp4_);
	_tmp6_ = _tmp5_;
	if (!_tmp6_) {
		TubaAPIStatus* _tmp7_;
		TubaAPIStatus* _tmp8_;
		_tmp7_ = e;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_vala_array_add118 (&_data82_->context_statuses, &_data82_->context_statuses_length1, &_data82_->_context_statuses_size_, _tmp8_);
	}
	_g_object_unref0 (e);
}

static void
____lambda92__json_array_foreach (JsonArray* array,
                                  guint index_,
                                  JsonNode* element_node,
                                  gpointer self)
{
	___lambda92_ (self, array, index_, element_node);
}

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

static void
___lambda93_ (Block82Data* _data82_,
              JsonArray* array,
              guint i,
              JsonNode* node)
{
	TubaViewsThread* self;
	TubaAPIStatus* e = NULL;
	JsonNode* _tmp0_;
	TubaEntity* _tmp1_;
	TubaAPIStatus* _tmp2_;
	TubaAPIStatus* _tmp3_;
	TubaAPIStatus* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	self = _data82_->self;
	g_return_if_fail (array != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = __vala_JsonNode_copy0 (node);
	_tmp1_ = tuba_helper_entity_from_json (_tmp0_, TUBA_API_TYPE_STATUS, FALSE);
	e = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TUBA_API_TYPE_STATUS, TubaAPIStatus);
	_tmp2_ = e;
	_tmp3_ = tuba_api_status_get_formal (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_api_status_get_tuba_filter_hidden (_tmp4_);
	_tmp6_ = _tmp5_;
	if (!_tmp6_) {
		TubaAPIStatus* _tmp7_;
		TubaAPIStatus* _tmp8_;
		_tmp7_ = e;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_vala_array_add119 (&_data82_->context_statuses, &_data82_->context_statuses_length1, &_data82_->_context_statuses_size_, _tmp8_);
	}
	_g_object_unref0 (e);
}

static void
____lambda93__json_array_foreach (JsonArray* array,
                                  guint index_,
                                  JsonNode* element_node,
                                  gpointer self)
{
	___lambda93_ (self, array, index_, element_node);
}

static gboolean
tuba_views_thread_regular_stat_updates_co (TubaViewsThreadRegularStatUpdatesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->regular_stat_updates_cancellable;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->self->priv->regular_stat_updates_cancellable;
		g_cancellable_cancel (_data_->_tmp1_);
	}
	_data_->_tmp2_ = g_cancellable_new ();
	_g_object_unref0 (_data_->self->priv->regular_stat_updates_cancellable);
	_data_->self->priv->regular_stat_updates_cancellable = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->self->priv->_root_status;
	if (_data_->_tmp3_ == NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_data82_ = g_slice_new0 (Block82Data);
		_data_->_data82_->_ref_count_ = 1;
		_data_->_data82_->self = g_object_ref (_data_->self);
		_data_->_tmp4_ = g_new0 (TubaAPIStatus*, 0 + 1);
		_data_->_data82_->context_statuses = _data_->_tmp4_;
		_data_->_data82_->context_statuses_length1 = 0;
		_data_->_data82_->_context_statuses_size_ = _data_->_data82_->context_statuses_length1;
		{
			_data_->_tmp5_ = _data_->self->priv->_root_status;
			_data_->_tmp6_ = tuba_api_status_get_id (_data_->_tmp5_);
			_data_->_tmp7_ = _data_->_tmp6_;
			_data_->_tmp8_ = string_to_string (_data_->_tmp7_);
			_data_->_tmp9_ = g_strconcat ("/api/v1/statuses/", _data_->_tmp8_, NULL);
			_data_->_tmp10_ = _data_->_tmp9_;
			_data_->_tmp11_ = tuba_account_holder_get_account ((TubaAccountHolder*) _data_->self);
			_data_->_tmp12_ = _data_->_tmp11_;
			_data_->_tmp13_ = _g_object_ref0 (_data_->_tmp12_);
			_data_->_tmp14_ = _data_->self->priv->root_update_cancellable;
			_data_->_tmp15_ = _g_object_ref0 (_data_->_tmp14_);
			_data_->_tmp16_ = NULL;
			_data_->_tmp16_ = tuba_request_v2_new (_data_->_tmp10_, TUBA_REQUEST_V2_METHOD_GET);
			tuba_request_v2_set_account (_data_->_tmp16_, _data_->_tmp13_);
			_g_object_unref0 (_data_->_tmp13_);
			tuba_request_v2_set_ctx (_data_->_tmp16_, (GtkWidget*) _data_->self);
			tuba_request_v2_set_cancellable (_data_->_tmp16_, _data_->_tmp15_);
			_g_object_unref0 (_data_->_tmp15_);
			_data_->_tmp17_ = _data_->_tmp16_;
			_g_free0 (_data_->_tmp10_);
			_data_->req = _data_->_tmp17_;
			_data_->_tmp18_ = _data_->req;
			_data_->_state_ = 1;
			tuba_request_v2_exec (_data_->_tmp18_, tuba_views_thread_regular_stat_updates_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp19_ = tuba_request_v2_exec_finish (_data_->_tmp18_, _data_->_res_, NULL, &_data_->_inner_error0_);
			_data_->in_stream = _data_->_tmp19_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->req);
				block82_data_unref (_data_->_data82_);
				_data_->_data82_ = NULL;
				if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
					goto __catch0_g_io_error_cancelled;
				}
				goto __catch0_g_error;
			}
			_data_->_tmp20_ = _data_->in_stream;
			_data_->_state_ = 2;
			tuba_network_get_parser_from_inputstream_async (_data_->_tmp20_, NULL, tuba_views_thread_regular_stat_updates_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp21_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
			_data_->parser = _data_->_tmp21_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->in_stream);
				_g_object_unref0 (_data_->req);
				block82_data_unref (_data_->_data82_);
				_data_->_data82_ = NULL;
				if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
					goto __catch0_g_io_error_cancelled;
				}
				goto __catch0_g_error;
			}
			_data_->_tmp22_ = tuba_network;
			_data_->_tmp23_ = _data_->parser;
			_data_->_tmp24_ = tuba_network_parse_node (_data_->_tmp22_, _data_->_tmp23_);
			_data_->node = _data_->_tmp24_;
			_data_->_tmp25_ = _data_->node;
			_data_->_tmp26_ = tuba_api_status_from (_data_->_tmp25_, &_data_->_inner_error0_);
			_data_->api_status = _data_->_tmp26_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				__vala_JsonNode_free0 (_data_->node);
				_g_object_unref0 (_data_->parser);
				_g_object_unref0 (_data_->in_stream);
				_g_object_unref0 (_data_->req);
				block82_data_unref (_data_->_data82_);
				_data_->_data82_ = NULL;
				if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
					goto __catch0_g_io_error_cancelled;
				}
				goto __catch0_g_error;
			}
			_data_->_tmp27_ = _data_->api_status;
			_data_->_tmp28_ = _g_object_ref0 (_data_->_tmp27_);
			_vala_array_add117 (&_data_->_data82_->context_statuses, &_data_->_data82_->context_statuses_length1, &_data_->_data82_->_context_statuses_size_, _data_->_tmp28_);
			_g_object_unref0 (_data_->api_status);
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			_g_object_unref0 (_data_->req);
		}
		_data_->_tmp29_ = _data_->self->priv->_root_status;
		_data_->_tmp30_ = tuba_api_status_get_id (_data_->_tmp29_);
		_data_->_tmp31_ = _data_->_tmp30_;
		_data_->_tmp32_ = string_to_string (_data_->_tmp31_);
		_data_->_tmp33_ = g_strconcat ("/api/v1/statuses/", _data_->_tmp32_, "/context", NULL);
		_data_->_tmp34_ = _data_->_tmp33_;
		_data_->_tmp35_ = tuba_account_holder_get_account ((TubaAccountHolder*) _data_->self);
		_data_->_tmp36_ = _data_->_tmp35_;
		_data_->_tmp37_ = _g_object_ref0 (_data_->_tmp36_);
		_data_->_tmp38_ = NULL;
		_data_->_tmp38_ = tuba_request_v2_new (_data_->_tmp34_, TUBA_REQUEST_V2_METHOD_GET);
		tuba_request_v2_set_account (_data_->_tmp38_, _data_->_tmp37_);
		_g_object_unref0 (_data_->_tmp37_);
		tuba_request_v2_set_ctx (_data_->_tmp38_, (GtkWidget*) _data_->self);
		_data_->_tmp39_ = _data_->_tmp38_;
		_g_free0 (_data_->_tmp34_);
		_data_->_vala1_req = _data_->_tmp39_;
		_data_->_tmp40_ = _data_->_vala1_req;
		_data_->_state_ = 3;
		tuba_request_v2_exec (_data_->_tmp40_, tuba_views_thread_regular_stat_updates_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp41_ = tuba_request_v2_exec_finish (_data_->_tmp40_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_vala1_in_stream = _data_->_tmp41_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->_vala1_req);
			block82_data_unref (_data_->_data82_);
			_data_->_data82_ = NULL;
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp42_ = _data_->_vala1_in_stream;
		_data_->_state_ = 4;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp42_, NULL, tuba_views_thread_regular_stat_updates_ready, _data_);
		return FALSE;
		_state_4:
		_data_->_tmp43_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->_vala1_parser = _data_->_tmp43_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->_vala1_in_stream);
			_g_object_unref0 (_data_->_vala1_req);
			block82_data_unref (_data_->_data82_);
			_data_->_data82_ = NULL;
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		_data_->_tmp44_ = tuba_network;
		_data_->_tmp45_ = _data_->_vala1_parser;
		_data_->_tmp46_ = tuba_network_parse (_data_->_tmp44_, _data_->_tmp45_);
		_data_->root = _data_->_tmp46_;
		_data_->_tmp47_ = _data_->root;
		_data_->_tmp48_ = json_object_get_array_member (_data_->_tmp47_, "ancestors");
		_data_->_tmp49_ = _json_array_ref0 (_data_->_tmp48_);
		_data_->ancestors = _data_->_tmp49_;
		_data_->_tmp50_ = _data_->ancestors;
		json_array_foreach_element (_data_->_tmp50_, ____lambda92__json_array_foreach, _data_->_data82_);
		_data_->_tmp51_ = _data_->root;
		_data_->_tmp52_ = json_object_get_array_member (_data_->_tmp51_, "descendants");
		_data_->_tmp53_ = _json_array_ref0 (_data_->_tmp52_);
		_data_->descendants = _data_->_tmp53_;
		_data_->_tmp54_ = _data_->descendants;
		json_array_foreach_element (_data_->_tmp54_, ____lambda93__json_array_foreach, _data_->_data82_);
		_data_->_tmp55_ = _data_->_data82_->context_statuses;
		_data_->_tmp55__length1 = _data_->_data82_->context_statuses_length1;
		{
			_data_->c_status_collection_length1 = 0;
			_data_->_c_status_collection_size_ = 0;
			_data_->c_status_collection = _data_->_tmp55_;
			_data_->c_status_collection_length1 = _data_->_tmp55__length1;
			for (_data_->c_status_it = 0; _data_->c_status_it < _data_->c_status_collection_length1; _data_->c_status_it = _data_->c_status_it + 1) {
				_data_->_tmp56_ = _g_object_ref0 (_data_->c_status_collection[_data_->c_status_it]);
				_data_->c_status = _data_->_tmp56_;
				{
					_data_->_tmp57_ = ((TubaViewsContentBase*) _data_->self)->model;
					_data_->_tmp58_ = _data_->c_status;
					_data_->_tmp59_ = tuba_views_thread_status_comp_func;
					_data_->_tmp60_ = 0U;
					_data_->_tmp61_ = g_list_store_find_with_equal_func (_data_->_tmp57_, (GObject*) _data_->_tmp58_, _data_->_tmp59_, &_data_->_tmp60_);
					_data_->pos = _data_->_tmp60_;
					if (_data_->_tmp61_) {
						_data_->_tmp62_ = ((TubaViewsContentBase*) _data_->self)->content;
						_data_->_tmp63_ = gtk_list_box_get_row_at_index (_data_->_tmp62_, (gint) _data_->pos);
						_data_->_tmp64_ = _g_object_ref0 (TUBA_WIDGETS_IS_STATUS (_data_->_tmp63_) ? ((TubaWidgetsStatus*) _data_->_tmp63_) : NULL);
						_data_->status_widget = _data_->_tmp64_;
						_data_->_tmp65_ = _data_->status_widget;
						if (_data_->_tmp65_ != NULL) {
							_data_->_tmp66_ = _data_->status_widget;
							_data_->_tmp67_ = _data_->c_status;
							tuba_widgets_status_patch_stats (_data_->_tmp66_, _data_->_tmp67_);
						}
						_g_object_unref0 (_data_->status_widget);
					} else {
						_data_->_tmp68_ = _data_->self->priv->refresh_toast;
						if (_data_->_tmp68_ == NULL) {
							_data_->_tmp69_ = g_strdup (_ ("Refresh"));
							_data_->_tmp70_ = g_strdup ("app.refresh");
							_data_->_tmp71_ = NULL;
							_data_->_tmp71_ = adw_toast_new (_ ("New Replies Available"));
							adw_toast_set_timeout (_data_->_tmp71_, (guint) 0);
							adw_toast_set_button_label (_data_->_tmp71_, _data_->_tmp69_);
							_g_free0 (_data_->_tmp69_);
							adw_toast_set_action_name (_data_->_tmp71_, _data_->_tmp70_);
							_g_free0 (_data_->_tmp70_);
							_g_object_unref0 (_data_->self->priv->refresh_toast);
							_data_->self->priv->refresh_toast = _data_->_tmp71_;
							_data_->_tmp72_ = tuba_app;
							_data_->_tmp73_ = _data_->self->priv->refresh_toast;
							g_signal_emit_by_name (_data_->_tmp72_, "toast-object", _data_->_tmp73_);
						}
					}
					_g_object_unref0 (_data_->c_status);
				}
			}
		}
		_json_array_unref0 (_data_->descendants);
		_json_array_unref0 (_data_->ancestors);
		_json_object_unref0 (_data_->root);
		_g_object_unref0 (_data_->_vala1_parser);
		_g_object_unref0 (_data_->_vala1_in_stream);
		_g_object_unref0 (_data_->_vala1_req);
		block82_data_unref (_data_->_data82_);
		_data_->_data82_ = NULL;
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_data_->_inner_error0_);
		g_debug ("Thread.vala:378: Message is cancelled.");
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp74_ = _data_->self->priv->_root_status;
		_data_->_tmp75_ = tuba_api_status_get_id (_data_->_tmp74_);
		_data_->_tmp76_ = _data_->_tmp75_;
		_data_->_tmp77_ = string_to_string (_data_->_tmp76_);
		_data_->_tmp78_ = _data_->e;
		_data_->_tmp79_ = _data_->_tmp78_->message;
		_data_->_tmp80_ = string_to_string (_data_->_tmp79_);
		_data_->_tmp81_ = g_strconcat ("Couldn't regular update thread ", _data_->_tmp77_, ": ", _data_->_tmp80_, NULL);
		_data_->_tmp82_ = _data_->_tmp81_;
		g_warning ("Thread.vala:380: %s", _data_->_tmp82_);
		_g_free0 (_data_->_tmp82_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != 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_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 TubaInstanceAccount*
tuba_views_thread_real_get_account (TubaAccountHolder* base)
{
	TubaInstanceAccount* result;
	TubaViewsThread* self;
	TubaInstanceAccount* _tmp0_;
	self = (TubaViewsThread*) base;
	_tmp0_ = self->priv->_account;
	result = _tmp0_;
	return result;
}

static void
tuba_views_thread_real_set_account (TubaAccountHolder* base,
                                    TubaInstanceAccount* value)
{
	TubaViewsThread* self;
	TubaInstanceAccount* old_value;
	self = (TubaViewsThread*) base;
	old_value = tuba_views_thread_real_get_account (base);
	if (old_value != value) {
		TubaInstanceAccount* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_account);
		self->priv->_account = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_views_thread_properties[TUBA_VIEWS_THREAD_ACCOUNT_PROPERTY]);
	}
}

TubaAPIStatus*
tuba_views_thread_get_root_status (TubaViewsThread* self)
{
	TubaAPIStatus* result;
	TubaAPIStatus* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_root_status;
	result = _tmp0_;
	return result;
}

void
tuba_views_thread_set_root_status (TubaViewsThread* self,
                                   TubaAPIStatus* value)
{
	TubaAPIStatus* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_views_thread_get_root_status (self);
	if (old_value != value) {
		TubaAPIStatus* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_root_status);
		self->priv->_root_status = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_views_thread_properties[TUBA_VIEWS_THREAD_ROOT_STATUS_PROPERTY]);
	}
}

static TubaWidgetsStatus*
tuba_views_thread_get_root_status_widget (TubaViewsThread* self)
{
	TubaWidgetsStatus* result;
	TubaWidgetsStatus* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_root_status_widget;
	result = _tmp0_;
	return result;
}

static void
tuba_views_thread_set_root_status_widget (TubaViewsThread* self,
                                          TubaWidgetsStatus* value)
{
	g_return_if_fail (self != NULL);
	self->priv->_root_status_widget = value;
}

static gboolean
tuba_views_thread_get_reveal_spoilers (TubaViewsThread* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_reveal_spoilers;
	return result;
}

static void
tuba_views_thread_set_reveal_spoilers (TubaViewsThread* self,
                                       gboolean value)
{
	g_return_if_fail (self != NULL);
	{
		gint pos = 0;
		pos = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GListStore* _tmp2_;
				guint _tmp3_;
				guint _tmp4_;
				TubaAPIStatus* status = NULL;
				GListStore* _tmp5_;
				GObject* _tmp6_;
				TubaAPIStatus* _tmp7_;
				TubaAPIStatus* _tmp8_;
				gboolean _tmp9_;
				gboolean _tmp10_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = pos;
					pos = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = ((TubaViewsContentBase*) self)->model;
				g_object_get (_tmp2_, "n-items", &_tmp3_, NULL);
				_tmp4_ = _tmp3_;
				if (!(((guint) pos) < _tmp4_)) {
					break;
				}
				_tmp5_ = ((TubaViewsContentBase*) self)->model;
				_tmp6_ = g_list_model_get_item ((GListModel*) _tmp5_, (guint) pos);
				_tmp7_ = TUBA_API_IS_STATUS (_tmp6_) ? ((TubaAPIStatus*) _tmp6_) : NULL;
				if (_tmp7_ == NULL) {
					_g_object_unref0 (_tmp6_);
				}
				status = _tmp7_;
				_tmp8_ = status;
				_tmp9_ = tuba_api_status_get_has_spoiler (_tmp8_);
				_tmp10_ = _tmp9_;
				if (_tmp10_) {
					TubaAPIStatus* _tmp11_;
					_tmp11_ = status;
					tuba_api_status_set_tuba_spoiler_revealed (_tmp11_, value);
				}
				_g_object_unref0 (status);
			}
		}
	}
	self->priv->_reveal_spoilers = value;
}

static void
tuba_views_thread_class_init (TubaViewsThreadClass * klass,
                              gpointer klass_data)
{
	tuba_views_thread_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsThread_private_offset);
	((TubaViewsContentBaseClass *) klass)->attempt_focus_grab = (void (*) (TubaViewsContentBase*)) tuba_views_thread_real_attempt_focus_grab;
	((TubaViewsBaseClass *) klass)->build_header = (void (*) (TubaViewsBase*)) tuba_views_thread_real_build_header;
	((TubaViewsBaseClass *) klass)->on_content_changed = (void (*) (TubaViewsBase*)) tuba_views_thread_real_on_content_changed;
	((TubaViewsContentBaseClass *) klass)->on_create_model_widget = (GtkWidget* (*) (TubaViewsContentBase*, GObject*)) tuba_views_thread_real_on_create_model_widget;
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_views_thread_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_views_thread_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_views_thread_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_VIEWS_THREAD_ACCOUNT_PROPERTY, tuba_views_thread_properties[TUBA_VIEWS_THREAD_ACCOUNT_PROPERTY] = g_param_spec_object ("account", "account", "account", TUBA_TYPE_INSTANCE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_VIEWS_THREAD_ROOT_STATUS_PROPERTY, tuba_views_thread_properties[TUBA_VIEWS_THREAD_ROOT_STATUS_PROPERTY] = g_param_spec_object ("root-status", "root-status", "root-status", TUBA_API_TYPE_STATUS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	tuba_views_thread_status_comp_func = __tuba_views_thread_status_comp_func_lambda88__gequal_func;
}

static void
tuba_views_thread_tuba_account_holder_interface_init (TubaAccountHolderIface * iface,
                                                      gpointer iface_data)
{
	tuba_views_thread_tuba_account_holder_parent_iface = g_type_interface_peek_parent (iface);
	iface->on_account_changed = (void (*) (TubaAccountHolder*, TubaInstanceAccount*)) tuba_views_thread_real_on_account_changed;
	iface->get_account = tuba_views_thread_real_get_account;
	iface->set_account = tuba_views_thread_real_set_account;
}

static void
tuba_views_thread_instance_init (TubaViewsThread * self,
                                 gpointer klass)
{
	TubaSettings* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self->priv = tuba_views_thread_get_instance_private (self);
	self->priv->_root_status_widget = NULL;
	self->priv->refresh_toast = NULL;
	self->priv->root_update_cancellable = NULL;
	_tmp0_ = tuba_settings;
	_tmp1_ = tuba_settings_get_show_spoilers (_tmp0_);
	_tmp2_ = _tmp1_;
	self->priv->_reveal_spoilers = _tmp2_;
	self->priv->grabbed_focus = FALSE;
	self->priv->grab_focus_timeout = (guint) 0;
	self->priv->regular_stat_updates_cancellable = NULL;
}

static void
tuba_views_thread_finalize (GObject * obj)
{
	TubaViewsThread * self;
	AdwToast* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_THREAD, TubaViewsThread);
	g_debug ("Thread.vala:48: Destroying Thread");
	tuba_account_holder_destruct_account_holder ((TubaAccountHolder*) self);
	if (self->priv->grab_focus_timeout > ((guint) 0)) {
		g_source_remove (self->priv->grab_focus_timeout);
	}
	_tmp0_ = self->priv->refresh_toast;
	if (_tmp0_ != NULL) {
		AdwToast* _tmp1_;
		_tmp1_ = self->priv->refresh_toast;
		adw_toast_dismiss (_tmp1_);
		_g_object_unref0 (self->priv->refresh_toast);
		self->priv->refresh_toast = NULL;
	}
	_g_object_unref0 (self->priv->_account);
	_g_object_unref0 (self->priv->_root_status);
	_g_object_unref0 (self->priv->refresh_toast);
	_g_object_unref0 (self->priv->root_update_cancellable);
	_g_object_unref0 (self->priv->spoiler_toggle_button);
	_g_object_unref0 (self->priv->regular_stat_updates_cancellable);
	G_OBJECT_CLASS (tuba_views_thread_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_thread_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsThreadClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_thread_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsThread), 0, (GInstanceInitFunc) tuba_views_thread_instance_init, NULL };
	static const GInterfaceInfo tuba_account_holder_info = { (GInterfaceInitFunc) tuba_views_thread_tuba_account_holder_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_views_thread_type_id;
	tuba_views_thread_type_id = g_type_register_static (TUBA_VIEWS_TYPE_CONTENT_BASE, "TubaViewsThread", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_views_thread_type_id, TUBA_TYPE_ACCOUNT_HOLDER, &tuba_account_holder_info);
	TubaViewsThread_private_offset = g_type_add_instance_private (tuba_views_thread_type_id, sizeof (TubaViewsThreadPrivate));
	return tuba_views_thread_type_id;
}

GType
tuba_views_thread_get_type (void)
{
	static GType tuba_views_thread_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_thread_type_id__once)) {
		GType tuba_views_thread_type_id;
		tuba_views_thread_type_id = tuba_views_thread_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_thread_type_id__once, tuba_views_thread_type_id);
	}
	return tuba_views_thread_type_id__once;
}

static void
_vala_tuba_views_thread_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec)
{
	TubaViewsThread * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_VIEWS_TYPE_THREAD, TubaViewsThread);
	switch (property_id) {
		case TUBA_VIEWS_THREAD_ACCOUNT_PROPERTY:
		g_value_set_object (value, tuba_account_holder_get_account ((TubaAccountHolder*) self));
		break;
		case TUBA_VIEWS_THREAD_ROOT_STATUS_PROPERTY:
		g_value_set_object (value, tuba_views_thread_get_root_status (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_views_thread_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec)
{
	TubaViewsThread * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_VIEWS_TYPE_THREAD, TubaViewsThread);
	switch (property_id) {
		case TUBA_VIEWS_THREAD_ACCOUNT_PROPERTY:
		tuba_account_holder_set_account ((TubaAccountHolder*) self, g_value_get_object (value));
		break;
		case TUBA_VIEWS_THREAD_ROOT_STATUS_PROPERTY:
		tuba_views_thread_set_root_status (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

