/* conversation-list-box.c generated by valac 0.56.3, the Vala compiler
 * generated from conversation-list-box.vala, do not modify */

/*
 * Copyright 2016 Software Freedom Conservancy Inc.
 * Copyright 2016,2019 Michael Gratton <mike@vee.net>
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later). See the COPYING file in this distribution.
 */

#include "geary-client-43.0.h"
#include "geary-engine.h"
#include <gio/gio.h>
#include <gee.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>

#define CONVERSATION_LIST_BOX_EMAIL_ACTION_GROUP_NAME "eml"
#define CONVERSATION_LIST_BOX_ACTION_DELETE "delete"
#define CONVERSATION_LIST_BOX_ACTION_FORWARD "forward"
#define CONVERSATION_LIST_BOX_ACTION_MARK_LOAD_REMOTE "mark-load-remote"
#define CONVERSATION_LIST_BOX_ACTION_MARK_READ "mark-read"
#define CONVERSATION_LIST_BOX_ACTION_MARK_STARRED "mark-starred"
#define CONVERSATION_LIST_BOX_ACTION_MARK_UNREAD "mark-unread"
#define CONVERSATION_LIST_BOX_ACTION_MARK_UNREAD_DOWN "mark-unread-down"
#define CONVERSATION_LIST_BOX_ACTION_MARK_UNSTARRED "mark-unstarred"
#define CONVERSATION_LIST_BOX_ACTION_PRINT "print"
#define CONVERSATION_LIST_BOX_ACTION_REPLY_ALL "reply-all"
#define CONVERSATION_LIST_BOX_ACTION_REPLY_SENDER "reply-sender"
#define CONVERSATION_LIST_BOX_ACTION_SAVE_ALL_ATTACHMENTS "save-all-attachments"
#define CONVERSATION_LIST_BOX_ACTION_TRASH "trash"
#define CONVERSATION_LIST_BOX_ACTION_VIEW_SOURCE "view-source"
#define CONVERSATION_LIST_BOX_EMAIL_TOP_OFFSET 32
#define CONVERSATION_LIST_BOX_MARK_READ_TIMEOUT_MSEC 250
#define CONVERSATION_LIST_BOX_MARK_READ_PADDING 50
#define CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE GEARY_EMAIL_IDENTIFIER_BASE_VARIANT_TYPE
#define CONVERSATION_EMAIL_REQUIRED_FOR_CONSTRUCT ((GEARY_EMAIL_FIELD_ENVELOPE | GEARY_EMAIL_FIELD_PREVIEW) | GEARY_EMAIL_FIELD_FLAGS)
#define CONVERSATION_LIST_BOX_CONVERSATION_ROW_EXPANDED_CLASS "geary-expanded"
#define CONVERSATION_LIST_BOX_EMAIL_ROW_MATCH_CLASS "geary-matched"
#define CONVERSATION_LIST_BOX_LOADING_ROW_LOADING_CLASS "geary-loading"

#define CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW (conversation_list_box_conversation_row_get_type ())
#define CONVERSATION_LIST_BOX_CONVERSATION_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow))
#define CONVERSATION_LIST_BOX_CONVERSATION_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRowClass))
#define CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW))
#define CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW))
#define CONVERSATION_LIST_BOX_CONVERSATION_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRowClass))

typedef struct _ConversationListBoxConversationRow ConversationListBoxConversationRow;
typedef struct _ConversationListBoxConversationRowClass ConversationListBoxConversationRowClass;

#define CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW (conversation_list_box_email_row_get_type ())
#define CONVERSATION_LIST_BOX_EMAIL_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRow))
#define CONVERSATION_LIST_BOX_EMAIL_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRowClass))
#define CONVERSATION_LIST_BOX_IS_EMAIL_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW))
#define CONVERSATION_LIST_BOX_IS_EMAIL_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW))
#define CONVERSATION_LIST_BOX_EMAIL_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRowClass))

typedef struct _ConversationListBoxEmailRow ConversationListBoxEmailRow;
typedef struct _ConversationListBoxEmailRowClass ConversationListBoxEmailRowClass;

#define CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW (conversation_list_box_composer_row_get_type ())
#define CONVERSATION_LIST_BOX_COMPOSER_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW, ConversationListBoxComposerRow))
#define CONVERSATION_LIST_BOX_COMPOSER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW, ConversationListBoxComposerRowClass))
#define CONVERSATION_LIST_BOX_IS_COMPOSER_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW))
#define CONVERSATION_LIST_BOX_IS_COMPOSER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW))
#define CONVERSATION_LIST_BOX_COMPOSER_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW, ConversationListBoxComposerRowClass))

typedef struct _ConversationListBoxComposerRow ConversationListBoxComposerRow;
typedef struct _ConversationListBoxComposerRowClass ConversationListBoxComposerRowClass;
enum  {
	CONVERSATION_LIST_BOX_0_PROPERTY,
	CONVERSATION_LIST_BOX_CONVERSATION_PROPERTY,
	CONVERSATION_LIST_BOX_SEARCH_PROPERTY,
	CONVERSATION_LIST_BOX_HAS_COMPOSER_PROPERTY,
	CONVERSATION_LIST_BOX_NUM_PROPERTIES
};
static GParamSpec* conversation_list_box_properties[CONVERSATION_LIST_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define CONVERSATION_LIST_BOX_TYPE_LOADING_ROW (conversation_list_box_loading_row_get_type ())
#define CONVERSATION_LIST_BOX_LOADING_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONVERSATION_LIST_BOX_TYPE_LOADING_ROW, ConversationListBoxLoadingRow))
#define CONVERSATION_LIST_BOX_LOADING_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONVERSATION_LIST_BOX_TYPE_LOADING_ROW, ConversationListBoxLoadingRowClass))
#define CONVERSATION_LIST_BOX_IS_LOADING_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONVERSATION_LIST_BOX_TYPE_LOADING_ROW))
#define CONVERSATION_LIST_BOX_IS_LOADING_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONVERSATION_LIST_BOX_TYPE_LOADING_ROW))
#define CONVERSATION_LIST_BOX_LOADING_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONVERSATION_LIST_BOX_TYPE_LOADING_ROW, ConversationListBoxLoadingRowClass))

typedef struct _ConversationListBoxLoadingRow ConversationListBoxLoadingRow;
typedef struct _ConversationListBoxLoadingRowClass ConversationListBoxLoadingRowClass;
typedef struct _ConversationListBoxLoadConversationData ConversationListBoxLoadConversationData;
typedef struct _Block83Data Block83Data;
typedef struct _Block84Data Block84Data;
typedef struct _Block85Data Block85Data;
typedef struct _Block86Data Block86Data;
typedef struct _ConversationListBoxFinishLoadingData ConversationListBoxFinishLoadingData;
typedef struct _ConversationListBoxThrottleLoadingData ConversationListBoxThrottleLoadingData;
typedef struct _ConversationListBoxLoadFullEmailData ConversationListBoxLoadFullEmailData;
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
typedef struct _Block87Data Block87Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ConversationListBoxOnConversationAppendedAsyncData ConversationListBoxOnConversationAppendedAsyncData;
typedef struct _Block88Data Block88Data;
typedef struct _Block89Data Block89Data;
typedef struct _Block90Data Block90Data;
typedef struct _Block91Data Block91Data;
enum  {
	CONVERSATION_LIST_BOX_SEARCH_MANAGER_0_PROPERTY,
	CONVERSATION_LIST_BOX_SEARCH_MANAGER_NUM_PROPERTIES
};
static GParamSpec* conversation_list_box_search_manager_properties[CONVERSATION_LIST_BOX_SEARCH_MANAGER_NUM_PROPERTIES];
typedef struct _ConversationListBoxSearchManagerHighlightMatchingEmailData ConversationListBoxSearchManagerHighlightMatchingEmailData;
typedef struct _Block92Data Block92Data;
typedef struct _ConversationListBoxSearchManagerApplyTermsImplData ConversationListBoxSearchManagerApplyTermsImplData;
enum  {
	CONVERSATION_LIST_BOX_SEARCH_MANAGER_MATCHES_UPDATED_SIGNAL,
	CONVERSATION_LIST_BOX_SEARCH_MANAGER_NUM_SIGNALS
};
static guint conversation_list_box_search_manager_signals[CONVERSATION_LIST_BOX_SEARCH_MANAGER_NUM_SIGNALS] = {0};
typedef struct _ConversationListBoxConversationRowPrivate ConversationListBoxConversationRowPrivate;
enum  {
	CONVERSATION_LIST_BOX_CONVERSATION_ROW_0_PROPERTY,
	CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_PROPERTY,
	CONVERSATION_LIST_BOX_CONVERSATION_ROW_IS_EXPANDED_PROPERTY,
	CONVERSATION_LIST_BOX_CONVERSATION_ROW_NUM_PROPERTIES
};
static GParamSpec* conversation_list_box_conversation_row_properties[CONVERSATION_LIST_BOX_CONVERSATION_ROW_NUM_PROPERTIES];
typedef struct _ConversationListBoxConversationRowExpandData ConversationListBoxConversationRowExpandData;
enum  {
	CONVERSATION_LIST_BOX_CONVERSATION_ROW_SHOULD_SCROLL_SIGNAL,
	CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_LOADED_SIGNAL,
	CONVERSATION_LIST_BOX_CONVERSATION_ROW_NUM_SIGNALS
};
static guint conversation_list_box_conversation_row_signals[CONVERSATION_LIST_BOX_CONVERSATION_ROW_NUM_SIGNALS] = {0};
typedef struct _ConversationListBoxEmailRowPrivate ConversationListBoxEmailRowPrivate;
enum  {
	CONVERSATION_LIST_BOX_EMAIL_ROW_0_PROPERTY,
	CONVERSATION_LIST_BOX_EMAIL_ROW_IS_PINNED_PROPERTY,
	CONVERSATION_LIST_BOX_EMAIL_ROW_IS_SEARCH_MATCH_PROPERTY,
	CONVERSATION_LIST_BOX_EMAIL_ROW_VIEW_PROPERTY,
	CONVERSATION_LIST_BOX_EMAIL_ROW_NUM_PROPERTIES
};
static GParamSpec* conversation_list_box_email_row_properties[CONVERSATION_LIST_BOX_EMAIL_ROW_NUM_PROPERTIES];
typedef struct _ConversationListBoxEmailRowExpandData ConversationListBoxEmailRowExpandData;
typedef struct _ConversationListBoxLoadingRowPrivate ConversationListBoxLoadingRowPrivate;
enum  {
	CONVERSATION_LIST_BOX_LOADING_ROW_0_PROPERTY,
	CONVERSATION_LIST_BOX_LOADING_ROW_NUM_PROPERTIES
};
static GParamSpec* conversation_list_box_loading_row_properties[CONVERSATION_LIST_BOX_LOADING_ROW_NUM_PROPERTIES];
typedef struct _ConversationListBoxComposerRowPrivate ConversationListBoxComposerRowPrivate;
enum  {
	CONVERSATION_LIST_BOX_COMPOSER_ROW_0_PROPERTY,
	CONVERSATION_LIST_BOX_COMPOSER_ROW_VIEW_PROPERTY,
	CONVERSATION_LIST_BOX_COMPOSER_ROW_NUM_PROPERTIES
};
static GParamSpec* conversation_list_box_composer_row_properties[CONVERSATION_LIST_BOX_COMPOSER_ROW_NUM_PROPERTIES];
#define _g_type_class_unref0(var) ((var == NULL) ? NULL : (var = (g_type_class_unref (var), NULL)))
enum  {
	CONVERSATION_LIST_BOX_SCROLL_SIGNAL,
	CONVERSATION_LIST_BOX_FOCUS_NEXT_SIGNAL,
	CONVERSATION_LIST_BOX_FOCUS_PREV_SIGNAL,
	CONVERSATION_LIST_BOX_EMAIL_LOADED_SIGNAL,
	CONVERSATION_LIST_BOX_REPLY_TO_SENDER_EMAIL_SIGNAL,
	CONVERSATION_LIST_BOX_REPLY_TO_ALL_EMAIL_SIGNAL,
	CONVERSATION_LIST_BOX_FORWARD_EMAIL_SIGNAL,
	CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL,
	CONVERSATION_LIST_BOX_TRASH_EMAIL_SIGNAL,
	CONVERSATION_LIST_BOX_DELETE_EMAIL_SIGNAL,
	CONVERSATION_LIST_BOX_NUM_SIGNALS
};
static guint conversation_list_box_signals[CONVERSATION_LIST_BOX_NUM_SIGNALS] = {0};

struct _ConversationListBoxPrivate {
	GearyAppConversation* _conversation;
	ConversationListBoxSearchManager* _search;
	GearyAppEmailStore* email_store;
	ApplicationContactStore* contacts;
	ApplicationConfiguration* config;
	GCancellable* cancellable;
	ConversationEmail* body_selected_view;
	GeeMap* email_rows;
	ConversationListBoxComposerRow* current_composer;
	GearyEmailIdentifier* draft_id;
	gboolean suppress_mark_timer;
	GearyTimeoutManager* mark_read_timer;
	GSimpleActionGroup* email_actions;
};

struct _ConversationListBoxLoadConversationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBox* self;
	GeeCollection* scroll_to;
	GearySearchQuery* query;
	GeeCollection* all_email;
	GearyAppConversation* _tmp0_;
	GeeList* _tmp1_;
	GeeLinkedList* uninteresting;
	GeeLinkedList* _tmp2_;
	GearyEmail* first_interesting;
	GeeLinkedList* post_interesting;
	GeeLinkedList* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GeeArrayList* valid_scroll_to;
	GearyIterable* _tmp6_;
	GearyIterable* _tmp7_;
	GearyIterable* _tmp8_;
	GearyIterable* _tmp9_;
	GeeArrayList* _tmp10_;
	GeeArrayList* _tmp11_;
	GeeArrayList* _tmp12_;
	GearyEmailIdentifier* first_scroll;
	GeeArrayList* _tmp13_;
	gpointer _tmp14_;
	GearyEmailIdentifier* _tmp15_;
	GeeIterator* _email_it;
	GeeCollection* _tmp16_;
	GeeIterator* _tmp17_;
	GeeIterator* _tmp18_;
	GearyEmail* email;
	GeeIterator* _tmp19_;
	gpointer _tmp20_;
	GearyEmail* _tmp21_;
	GearyEmail* _tmp22_;
	GearyEmailIdentifier* _tmp23_;
	GearyEmailIdentifier* _tmp24_;
	GearyEmailIdentifier* _tmp25_;
	GearyEmail* _tmp26_;
	GearyEmail* _tmp27_;
	GeeLinkedList* _tmp28_;
	GearyEmail* _tmp29_;
	GeeLinkedList* _tmp30_;
	GearyEmail* _tmp31_;
	GearyEmail* _tmp32_;
	GeeIterator* _vala1__email_it;
	GeeCollection* _tmp33_;
	GeeIterator* _tmp34_;
	GeeIterator* _tmp35_;
	GearyEmail* _vala1_email;
	GeeIterator* _tmp36_;
	gpointer _tmp37_;
	GearyEmail* _tmp38_;
	GearyEmail* _tmp39_;
	GearyEmail* _tmp40_;
	GearyEmail* _tmp41_;
	GeeLinkedList* _tmp42_;
	GearyEmail* _tmp43_;
	GeeLinkedList* _tmp44_;
	GearyEmail* _tmp45_;
	GearyEmail* _tmp46_;
	GeeLinkedList* _tmp47_;
	gpointer _tmp48_;
	ConversationListBoxEmailRow* interesting_row;
	GearyEmail* _tmp49_;
	ConversationListBoxEmailRow* _tmp50_;
	gboolean _tmp51_;
	GeeLinkedList* _tmp52_;
	gboolean _tmp53_;
	gboolean _tmp54_;
	GeeLinkedList* _tmp55_;
	gboolean _tmp56_;
	gboolean _tmp57_;
	ConversationListBoxLoadingRow* _tmp58_;
	ConversationListBoxLoadingRow* _tmp59_;
	ConversationListBoxEmailRow* _tmp60_;
	ConversationEmail* _tmp61_;
	ConversationEmail* _tmp62_;
	ConversationListBoxEmailRow* _tmp63_;
	gboolean _tmp64_;
	gboolean _tmp65_;
	GeeLinkedList* _tmp66_;
	GeeLinkedList* _tmp67_;
	GError* _inner_error0_;
};

struct _Block83Data {
	int _ref_count_;
	ConversationListBox* self;
	ConversationListBoxEmailRow* last;
};

struct _Block84Data {
	int _ref_count_;
	ConversationListBox* self;
	ConversationListBoxComposerRow* row;
	ComposerEmbed* embed;
	gboolean is_draft;
};

struct _Block85Data {
	int _ref_count_;
	ConversationListBox* self;
	gint loading_height;
	GtkAdjustment* listbox_adj;
	gpointer _async_data_;
};

struct _Block86Data {
	int _ref_count_;
	Block85Data * _data85_;
	ConversationListBoxEmailRow* row;
};

struct _ConversationListBoxFinishLoadingData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBox* self;
	GearySearchQuery* query;
	gboolean enable_query_scroll;
	GeeLinkedList* to_insert;
	GeeLinkedList* to_append;
	Block85Data* _data85_;
	GeeLinkedList* _email_list;
	gint _email_size;
	GeeLinkedList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _email_index;
	gint _tmp3_;
	gint _tmp4_;
	GearyEmail* email;
	GeeLinkedList* _tmp5_;
	gpointer _tmp6_;
	ConversationListBoxEmailRow* row;
	GearyEmail* _tmp7_;
	ConversationListBoxEmailRow* _tmp8_;
	ConversationListBoxEmailRow* _tmp9_;
	ConversationEmail* _tmp10_;
	ConversationEmail* _tmp11_;
	GearyEmail* _tmp12_;
	ConversationListBoxEmailRow* _tmp13_;
	GtkListBoxRow* initial_row;
	GtkListBoxRow* _tmp14_;
	GtkListBoxRow* _tmp15_;
	GtkListBoxRow* _tmp16_;
	GtkListBoxRow* _tmp17_;
	GtkListBoxRow* _tmp18_;
	GtkListBoxRow* first_row;
	GtkListBoxRow* _tmp19_;
	GtkListBoxRow* _tmp20_;
	GtkStyleContext* style;
	GtkListBoxRow* _tmp21_;
	GtkStyleContext* _tmp22_;
	GtkStyleContext* _tmp23_;
	GtkBorder margin;
	GtkStyleContext* _tmp24_;
	GtkStyleContext* _tmp25_;
	GtkBorder _tmp26_;
	GtkBorder _tmp27_;
	GtkAdjustment* _tmp28_;
	GtkAdjustment* _tmp29_;
	gint i_mail_loaded;
	GeeLinkedList* _vala1__email_list;
	gint _vala1__email_size;
	GeeLinkedList* _tmp30_;
	gint _tmp31_;
	gint _tmp32_;
	gint _vala1__email_index;
	Block86Data* _data86_;
	gint _tmp33_;
	gint _tmp34_;
	GearyEmail* _vala1_email;
	GeeLinkedList* _tmp35_;
	gpointer _tmp36_;
	GearyEmail* _tmp37_;
	ConversationListBoxEmailRow* _tmp38_;
	ConversationListBoxEmailRow* _tmp39_;
	ConversationListBoxEmailRow* _tmp40_;
	ConversationListBoxEmailRow* _tmp41_;
	ConversationEmail* _tmp42_;
	ConversationEmail* _tmp43_;
	gint _tmp44_;
	ConversationListBoxSearchManager* _tmp45_;
	GError* _inner_error0_;
};

struct _ConversationListBoxThrottleLoadingData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBox* self;
	GCancellable* _tmp0_;
	GError* _tmp1_;
	GError* _inner_error0_;
};

struct _ConversationListBoxLoadFullEmailData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBox* self;
	GearyEmailIdentifier* id;
	GearyEmail* full_email;
	GearyAppEmailStore* _tmp0_;
	GCancellable* _tmp1_;
	GearyEmail* _tmp2_;
	GCancellable* _tmp3_;
	ConversationListBoxEmailRow* row;
	GearyEmail* _tmp4_;
	ConversationListBoxEmailRow* _tmp5_;
	ConversationListBoxEmailRow* _tmp6_;
	ConversationEmail* _tmp7_;
	ConversationEmail* _tmp8_;
	GearyEmail* _tmp9_;
	ConversationListBoxEmailRow* _tmp10_;
	ConversationListBoxSearchManager* _tmp11_;
	ConversationListBoxEmailRow* _tmp12_;
	GError* _inner_error0_;
};

struct _Block87Data {
	int _ref_count_;
	ConversationListBox* self;
	GeeList* email_ids;
	gint top_bound;
	gint bottom_bound;
};

struct _ConversationListBoxOnConversationAppendedAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBox* self;
	GearyAppConversation* conversation;
	GearyEmail* part_email;
	gboolean _tmp0_;
	GeeMap* _tmp1_;
	GearyEmailIdentifier* _tmp2_;
	GearyEmailIdentifier* _tmp3_;
	GearyEmailIdentifier* _tmp4_;
	GearyEmailIdentifier* _tmp5_;
	GearyEmailIdentifier* _tmp6_;
	GearyEmailIdentifier* _tmp7_;
	GearyEmailIdentifier* _tmp8_;
};

struct _Block88Data {
	int _ref_count_;
	ConversationListBox* self;
	ConversationEmail* view;
};

struct _Block89Data {
	int _ref_count_;
	ConversationListBox* self;
	ConversationEmail* view;
};

struct _Block90Data {
	int _ref_count_;
	ConversationListBox* self;
	ConversationEmail* view;
};

struct _Block91Data {
	int _ref_count_;
	ConversationListBox* self;
	GearyEmail* email;
	GeeLinkedList* ids;
};

struct _ConversationListBoxSearchManagerPrivate {
	ConversationListBox* list;
	GearyAppConversation* conversation;
	GeeSet* terms;
	guint matches_found;
	GCancellable* highlight_cancellable;
};

struct _ConversationListBoxSearchManagerHighlightMatchingEmailData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBoxSearchManager* self;
	GearySearchQuery* query;
	gboolean enable_scroll;
	GCancellable* cancellable;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GearyAccount* account;
	GearyAppConversation* _tmp2_;
	GearyFolder* _tmp3_;
	GearyFolder* _tmp4_;
	GearyAccount* _tmp5_;
	GearyAccount* _tmp6_;
	GearyAccount* _tmp7_;
	GeeCollection* matching;
	GearyAccount* _tmp8_;
	GearyAppConversation* _tmp9_;
	GearyAppConversation* _tmp10_;
	GeeCollection* _tmp11_;
	GeeCollection* _tmp12_;
	GCancellable* _tmp13_;
	GeeCollection* _tmp14_;
	GeeCollection* _tmp15_;
	GeeCollection* _tmp16_;
	GeeSet* terms;
	GearyAccount* _tmp17_;
	GeeCollection* _tmp18_;
	GCancellable* _tmp19_;
	GeeSet* _tmp20_;
	GCancellable* _tmp21_;
	GError* _tmp22_;
	gboolean _tmp23_;
	GeeSet* _tmp24_;
	GeeSet* _tmp25_;
	gboolean _tmp26_;
	gboolean _tmp27_;
	GeeSet* _tmp28_;
	GeeSet* _tmp29_;
	ConversationListBoxEmailRow* first;
	GeeIterator* _id_it;
	GeeCollection* _tmp30_;
	GeeIterator* _tmp31_;
	GeeIterator* _tmp32_;
	GearyEmailIdentifier* id;
	GeeIterator* _tmp33_;
	gpointer _tmp34_;
	ConversationListBoxEmailRow* row;
	ConversationListBox* _tmp35_;
	GearyEmailIdentifier* _tmp36_;
	ConversationListBoxEmailRow* _tmp37_;
	gboolean _tmp38_;
	ConversationListBoxEmailRow* _tmp39_;
	gboolean _tmp40_;
	ConversationListBoxEmailRow* _tmp41_;
	ConversationListBoxEmailRow* _tmp42_;
	ConversationListBoxEmailRow* _tmp43_;
	ConversationListBoxEmailRow* _tmp44_;
	ConversationListBoxEmailRow* _tmp45_;
	gboolean _tmp46_;
	ConversationListBoxEmailRow* _tmp47_;
	ConversationListBox* _tmp48_;
	ConversationListBoxEmailRow* _tmp49_;
	GeeIterator* _vala1__id_it;
	GeeCollection* _tmp50_;
	GeeIterator* _tmp51_;
	GeeIterator* _tmp52_;
	GearyEmailIdentifier* _vala1_id;
	GeeIterator* _tmp53_;
	gpointer _tmp54_;
	ConversationListBoxEmailRow* _vala1_row;
	ConversationListBox* _tmp55_;
	GearyEmailIdentifier* _tmp56_;
	ConversationListBoxEmailRow* _tmp57_;
	ConversationListBoxEmailRow* _tmp58_;
	ConversationListBoxEmailRow* _tmp59_;
	GeeSet* _tmp60_;
	GCancellable* _tmp61_;
	ConversationListBoxEmailRow* _tmp62_;
	GError* _inner_error0_;
};

struct _Block92Data {
	int _ref_count_;
	ConversationListBoxSearchManager* self;
	ConversationListBoxEmailRow* row;
	GeeSet* terms;
	GCancellable* cancellable;
};

struct _ConversationListBoxSearchManagerApplyTermsImplData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBoxSearchManager* self;
	ConversationListBoxEmailRow* row;
	GeeSet* terms;
	GCancellable* cancellable;
	guint result;
	guint count;
	GeeIterator* _view_it;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	GeeIterator* _tmp2_;
	GeeIterator* _tmp3_;
	ConversationMessage* view;
	GeeIterator* _tmp4_;
	gpointer _tmp5_;
	GError* _tmp6_;
	guint _tmp7_;
	ConversationMessage* _tmp8_;
	GError* _inner_error0_;
};

struct _ConversationListBoxConversationRow {
	GtkListBoxRow parent_instance;
	ConversationListBoxConversationRowPrivate * priv;
};

struct _ConversationListBoxConversationRowClass {
	GtkListBoxRowClass parent_class;
	void (*expand) (ConversationListBoxConversationRow* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*expand_finish) (ConversationListBoxConversationRow* self, GAsyncResult* _res_, GError** error);
	void (*collapse) (ConversationListBoxConversationRow* self);
};

struct _ConversationListBoxConversationRowPrivate {
	GearyEmail* _email;
	gboolean _is_expanded;
};

struct _ConversationListBoxConversationRowExpandData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBoxConversationRow* self;
};

struct _ConversationListBoxEmailRow {
	ConversationListBoxConversationRow parent_instance;
	ConversationListBoxEmailRowPrivate * priv;
};

struct _ConversationListBoxEmailRowClass {
	ConversationListBoxConversationRowClass parent_class;
};

struct _ConversationListBoxEmailRowPrivate {
	gboolean _is_pinned;
	ConversationEmail* _view;
};

struct _ConversationListBoxEmailRowExpandData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationListBoxEmailRow* self;
	ConversationEmail* _tmp0_;
	ConversationEmailLoadState _tmp1_;
	ConversationEmailLoadState _tmp2_;
	ConversationEmail* _tmp3_;
	ConversationEmail* _tmp4_;
	GearyEmail* _tmp5_;
	GearyEmail* _tmp6_;
	GError* _inner_error0_;
};

struct _ConversationListBoxLoadingRow {
	ConversationListBoxConversationRow parent_instance;
	ConversationListBoxLoadingRowPrivate * priv;
};

struct _ConversationListBoxLoadingRowClass {
	ConversationListBoxConversationRowClass parent_class;
};

struct _ConversationListBoxComposerRow {
	ConversationListBoxConversationRow parent_instance;
	ConversationListBoxComposerRowPrivate * priv;
};

struct _ConversationListBoxComposerRowClass {
	ConversationListBoxConversationRowClass parent_class;
};

struct _ConversationListBoxComposerRowPrivate {
	ComposerEmbed* _view;
};

static gint ConversationListBox_private_offset;
static gpointer conversation_list_box_parent_class = NULL;
static gint ConversationListBoxSearchManager_private_offset;
static gpointer conversation_list_box_search_manager_parent_class = NULL;
static gint ConversationListBoxConversationRow_private_offset;
static gpointer conversation_list_box_conversation_row_parent_class = NULL;
static GearyBaseInterfaceIface * conversation_list_box_conversation_row_geary_base_interface_parent_iface = NULL;
static gint ConversationListBoxEmailRow_private_offset;
static gpointer conversation_list_box_email_row_parent_class = NULL;
static gpointer conversation_list_box_loading_row_parent_class = NULL;
static gint ConversationListBoxComposerRow_private_offset;
static gpointer conversation_list_box_composer_row_parent_class = NULL;
static GearyBaseInterfaceIface * conversation_list_box_geary_base_interface_parent_iface = NULL;

VALA_EXTERN GType conversation_list_box_conversation_row_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType conversation_list_box_email_row_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType conversation_list_box_composer_row_get_type (void) G_GNUC_CONST ;
static void conversation_list_box_on_email_delete (ConversationListBox* self,
                                            GSimpleAction* action,
                                            GVariant* param);
static void _conversation_list_box_on_email_delete_gsimple_action_activate_callback (GSimpleAction* action,
                                                                              GVariant* parameter,
                                                                              gpointer self);
static void conversation_list_box_on_email_forward (ConversationListBox* self,
                                             GSimpleAction* action,
                                             GVariant* param);
static void _conversation_list_box_on_email_forward_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self);
static void conversation_list_box_on_email_load_remote (ConversationListBox* self,
                                                 GSimpleAction* action,
                                                 GVariant* param);
static void _conversation_list_box_on_email_load_remote_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                   GVariant* parameter,
                                                                                   gpointer self);
static void conversation_list_box_on_email_mark_read (ConversationListBox* self,
                                               GSimpleAction* action,
                                               GVariant* param);
static void _conversation_list_box_on_email_mark_read_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                 GVariant* parameter,
                                                                                 gpointer self);
static void conversation_list_box_on_email_mark_starred (ConversationListBox* self,
                                                  GSimpleAction* action,
                                                  GVariant* param);
static void _conversation_list_box_on_email_mark_starred_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                    GVariant* parameter,
                                                                                    gpointer self);
static void conversation_list_box_on_email_mark_unread (ConversationListBox* self,
                                                 GSimpleAction* action,
                                                 GVariant* param);
static void _conversation_list_box_on_email_mark_unread_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                   GVariant* parameter,
                                                                                   gpointer self);
static void conversation_list_box_on_email_mark_unread_down (ConversationListBox* self,
                                                      GSimpleAction* action,
                                                      GVariant* param);
static void _conversation_list_box_on_email_mark_unread_down_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                        GVariant* parameter,
                                                                                        gpointer self);
static void conversation_list_box_on_email_mark_unstarred (ConversationListBox* self,
                                                    GSimpleAction* action,
                                                    GVariant* param);
static void _conversation_list_box_on_email_mark_unstarred_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                      GVariant* parameter,
                                                                                      gpointer self);
static void conversation_list_box_on_email_print (ConversationListBox* self,
                                           GSimpleAction* action,
                                           GVariant* param);
static void _conversation_list_box_on_email_print_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self);
static void conversation_list_box_on_email_reply_all (ConversationListBox* self,
                                               GSimpleAction* action,
                                               GVariant* param);
static void _conversation_list_box_on_email_reply_all_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                 GVariant* parameter,
                                                                                 gpointer self);
static void conversation_list_box_on_email_reply_sender (ConversationListBox* self,
                                                  GSimpleAction* action,
                                                  GVariant* param);
static void _conversation_list_box_on_email_reply_sender_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                    GVariant* parameter,
                                                                                    gpointer self);
static void conversation_list_box_on_email_save_all_attachments (ConversationListBox* self,
                                                          GSimpleAction* action,
                                                          GVariant* param);
static void _conversation_list_box_on_email_save_all_attachments_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                            GVariant* parameter,
                                                                                            gpointer self);
static void conversation_list_box_on_email_trash (ConversationListBox* self,
                                           GSimpleAction* action,
                                           GVariant* param);
static void _conversation_list_box_on_email_trash_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self);
static void conversation_list_box_on_email_view_source (ConversationListBox* self,
                                                 GSimpleAction* action,
                                                 GVariant* param);
static void _conversation_list_box_on_email_view_source_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                   GVariant* parameter,
                                                                                   gpointer self);
static gint conversation_list_box_on_sort (GtkListBoxRow* row1,
                                    GtkListBoxRow* row2);
VALA_EXTERN GearyEmail* conversation_list_box_conversation_row_get_email (ConversationListBoxConversationRow* self);
static void conversation_list_box_set_conversation (ConversationListBox* self,
                                             GearyAppConversation* value);
static void conversation_list_box_set_search (ConversationListBox* self,
                                       ConversationListBoxSearchManager* value);
static void conversation_list_box_real_scroll (ConversationListBox* self,
                                        GtkScrollType type);
static void conversation_list_box_real_focus_next (ConversationListBox* self);
static void conversation_list_box_real_focus_prev (ConversationListBox* self);
static void g_cclosure_user_marshal_VOID__OBJECT_STRING (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_OBJECT (GClosure * closure,
                                                         GValue * return_value,
                                                         guint n_param_values,
                                                         const GValue * param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
VALA_EXTERN ConversationListBoxSearchManager* conversation_list_box_search_manager_new (ConversationListBox* list,
                                                                            GearyAppConversation* conversation);
VALA_EXTERN ConversationListBoxSearchManager* conversation_list_box_search_manager_construct (GType object_type,
                                                                                  ConversationListBox* list,
                                                                                  GearyAppConversation* conversation);
static void conversation_list_box_check_mark_read (ConversationListBox* self);
static void _conversation_list_box_check_mark_read_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                                gpointer self);
static void conversation_list_box_update_previous_sibling_css_class (ConversationListBox* self);
static void _conversation_list_box_update_previous_sibling_css_class_gtk_container_add (GtkContainer* _sender,
                                                                                 GtkWidget* widget,
                                                                                 gpointer self);
static void _conversation_list_box_update_previous_sibling_css_class_gtk_container_remove (GtkContainer* _sender,
                                                                                    GtkWidget* widget,
                                                                                    gpointer self);
static gint _conversation_list_box_on_sort_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                            GtkListBoxRow* row2,
                                                            gpointer self);
static void conversation_list_box_on_row_activated (ConversationListBox* self,
                                             GtkListBoxRow* widget);
static void _conversation_list_box_on_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                         GtkListBoxRow* row,
                                                                         gpointer self);
static void conversation_list_box_on_conversation_appended (ConversationListBox* self,
                                                     GearyAppConversation* conversation,
                                                     GearyEmail* email);
static void _conversation_list_box_on_conversation_appended_geary_app_conversation_appended (GearyAppConversation* _sender,
                                                                                      GearyEmail* email,
                                                                                      gpointer self);
static void conversation_list_box_on_conversation_trimmed (ConversationListBox* self,
                                                    GearyEmail* email);
static void _conversation_list_box_on_conversation_trimmed_geary_app_conversation_trimmed (GearyAppConversation* _sender,
                                                                                    GearyEmail* email,
                                                                                    gpointer self);
static void conversation_list_box_on_update_flags (ConversationListBox* self,
                                            GearyEmail* email);
static void _conversation_list_box_on_update_flags_geary_app_conversation_email_flags_changed (GearyAppConversation* _sender,
                                                                                        GearyEmail* email,
                                                                                        gpointer self);
static void conversation_list_box_real_destroy (GtkWidget* base);
VALA_EXTERN gboolean conversation_list_box_conversation_row_get_is_expanded (ConversationListBoxConversationRow* self);
static void conversation_list_box_load_conversation_data_free (gpointer _data);
static gboolean conversation_list_box_load_conversation_co (ConversationListBoxLoadConversationData* _data_);
static gboolean ___lambda138_ (ConversationListBox* self,
                        GearyEmailIdentifier* id);
static gboolean ____lambda138__gee_predicate (gconstpointer g,
                                       gpointer self);
static gint ___lambda139_ (ConversationListBox* self,
                    GearyEmailIdentifier* a,
                    GearyEmailIdentifier* b);
static gint ____lambda139__gcompare_data_func (gconstpointer a,
                                        gconstpointer b,
                                        gpointer self);
static inline gboolean conversation_list_box_is_interesting (ConversationListBox* self,
                                               GearyEmail* email);
static ConversationListBoxEmailRow* conversation_list_box_add_email (ConversationListBox* self,
                                                              GearyEmail* email,
                                                              gboolean append_row);
VALA_EXTERN ConversationListBoxLoadingRow* conversation_list_box_loading_row_new (void);
VALA_EXTERN ConversationListBoxLoadingRow* conversation_list_box_loading_row_construct (GType object_type);
VALA_EXTERN GType conversation_list_box_loading_row_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ConversationEmail* conversation_list_box_email_row_get_view (ConversationListBoxEmailRow* self);
static void conversation_list_box_load_conversation_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
VALA_EXTERN void conversation_list_box_conversation_row_expand (ConversationListBoxConversationRow* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
VALA_EXTERN void conversation_list_box_conversation_row_expand_finish (ConversationListBoxConversationRow* self,
                                                           GAsyncResult* _res_,
                                                           GError** error);
static void conversation_list_box_finish_loading (ConversationListBox* self,
                                           GearySearchQuery* query,
                                           gboolean enable_query_scroll,
                                           GeeLinkedList* to_insert,
                                           GeeLinkedList* to_append,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static void conversation_list_box_finish_loading_finish (ConversationListBox* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static void conversation_list_box_scroll_to_row (ConversationListBox* self,
                                          ConversationListBoxConversationRow* row);
static Block83Data* block83_data_ref (Block83Data* _data83_);
static void block83_data_unref (void * _userdata_);
static void ___lambda141_ (Block83Data* _data83_,
                    GtkWidget* child);
static void ____lambda141__gtk_callback (GtkWidget* widget,
                                  gpointer self);
static Block84Data* block84_data_ref (Block84Data* _data84_);
static void block84_data_unref (void * _userdata_);
static void conversation_list_box_remove_email (ConversationListBox* self,
                                         GearyEmail* email);
VALA_EXTERN ConversationListBoxComposerRow* conversation_list_box_composer_row_new (ComposerEmbed* view);
VALA_EXTERN ConversationListBoxComposerRow* conversation_list_box_composer_row_construct (GType object_type,
                                                                              ComposerEmbed* view);
VALA_EXTERN void conversation_list_box_conversation_row_enable_should_scroll (ConversationListBoxConversationRow* self);
static void __lambda142_ (ConversationListBox* self,
                   ConversationListBoxConversationRow* row);
static void ___lambda142__conversation_list_box_conversation_row_should_scroll (ConversationListBoxConversationRow* _sender,
                                                                         gpointer self);
VALA_EXTERN ComposerWidget* composer_container_get_composer (ComposerContainer* self);
static void __lambda143_ (Block84Data* _data84_,
                   GParamSpec* id);
static void ___lambda143__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda144_ (Block84Data* _data84_);
static void conversation_list_box_load_full_email (ConversationListBox* self,
                                            GearyEmailIdentifier* id,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
static void conversation_list_box_load_full_email_finish (ConversationListBox* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static void ___lambda144__composer_embed_vanished (ComposerEmbed* _sender,
                                            gpointer self);
VALA_EXTERN ComponentsInfoBarStack* conversation_message_get_info_bars (ConversationMessage* self);
static GeeIterator* conversation_list_box_message_view_iterator (ConversationListBox* self);
static gboolean __lambda147_ (ConversationListBox* self,
                       ConversationMessage* msg_view);
static gboolean ___lambda147__gee_forall_func (gpointer g,
                                        gpointer self);
static gboolean __lambda148_ (ConversationListBox* self,
                       ConversationMessage* msg_view);
static gboolean ___lambda148__gee_forall_func (gpointer g,
                                        gpointer self);
static gboolean __lambda149_ (ConversationListBox* self,
                       ConversationMessage* msg_view);
static gboolean ___lambda149__gee_forall_func (gpointer g,
                                        gpointer self);
static gboolean __lambda150_ (ConversationListBox* self,
                       ConversationMessage* msg_view);
static gboolean ___lambda150__gee_forall_func (gpointer g,
                                        gpointer self);
VALA_EXTERN ConversationListBoxEmailRow* conversation_list_box_get_email_row_by_id (ConversationListBox* self,
                                                                        GearyEmailIdentifier* id);
static void conversation_list_box_finish_loading_data_free (gpointer _data);
static gboolean conversation_list_box_finish_loading_co (ConversationListBoxFinishLoadingData* _data_);
static Block85Data* block85_data_ref (Block85Data* _data85_);
static void block85_data_unref (void * _userdata_);
static void conversation_list_box_finish_loading_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void conversation_list_box_throttle_loading (ConversationListBox* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void conversation_list_box_throttle_loading_finish (ConversationListBox* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static Block86Data* block86_data_ref (Block86Data* _data86_);
static void block86_data_unref (void * _userdata_);
static void ____lambda140_ (Block86Data* _data86_);
static void _____lambda140__conversation_list_box_conversation_row_should_scroll (ConversationListBoxConversationRow* _sender,
                                                                           gpointer self);
static void conversation_list_box_throttle_loading_data_free (gpointer _data);
static gboolean conversation_list_box_throttle_loading_co (ConversationListBoxThrottleLoadingData* _data_);
static gboolean _conversation_list_box_throttle_loading_co_gsource_func (gpointer self);
static void conversation_list_box_load_full_email_data_free (gpointer _data);
static gboolean conversation_list_box_load_full_email_co (ConversationListBoxLoadFullEmailData* _data_);
static void conversation_list_box_load_full_email_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
VALA_EXTERN void conversation_list_box_search_manager_highlight_row_if_matching (ConversationListBoxSearchManager* self,
                                                                     ConversationListBoxEmailRow* row);
static inline gboolean conversation_list_box_is_draft (ConversationListBox* self,
                                         GearyEmail* email);
static void conversation_list_box_on_internal_link_activated (ConversationListBox* self,
                                                       ConversationEmail* email,
                                                       gint y);
static void _conversation_list_box_on_internal_link_activated_conversation_email_internal_link_activated (ConversationEmail* _sender,
                                                                                                   gint y,
                                                                                                   gpointer self);
static void __lambda134_ (ConversationListBox* self,
                   ConversationEmail* email,
                   gboolean has_selection);
static void ___lambda134__conversation_email_body_selection_changed (ConversationEmail* _sender,
                                                              gboolean has_selection,
                                                              gpointer self);
static void conversation_list_box_on_message_body_state_notify (ConversationListBox* self,
                                                         GObject* obj,
                                                         GParamSpec* param);
static void _conversation_list_box_on_message_body_state_notify_g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self);
VALA_EXTERN GtkGrid* conversation_message_get_body_container (ConversationMessage* self);
static gboolean __lambda135_ (ConversationListBox* self,
                       GdkEventButton* event);
static gboolean ___lambda135__gtk_widget_button_release_event (GtkWidget* _sender,
                                                        GdkEventButton* event,
                                                        gpointer self);
VALA_EXTERN ConversationListBoxEmailRow* conversation_list_box_email_row_new (ConversationEmail* view);
VALA_EXTERN ConversationListBoxEmailRow* conversation_list_box_email_row_construct (GType object_type,
                                                                        ConversationEmail* view);
static void __lambda136_ (ConversationListBox* self,
                   GearyEmail* e);
static void ___lambda136__conversation_list_box_conversation_row_email_loaded (ConversationListBoxConversationRow* _sender,
                                                                        GearyEmail* email,
                                                                        gpointer self);
static GtkAllocation* _gtk_allocation_dup (GtkAllocation* self);
static void conversation_list_box_scroll_to_anchor (ConversationListBox* self,
                                             ConversationListBoxEmailRow* row,
                                             gint anchor_y);
static Block87Data* block87_data_ref (Block87Data* _data87_);
static void block87_data_unref (void * _userdata_);
static void __lambda133_ (Block87Data* _data87_,
                   GtkWidget* child);
static void ___lambda133__gtk_callback (GtkWidget* widget,
                                 gpointer self);
static GeeIterator* conversation_list_box_email_view_iterator (ConversationListBox* self);
static ConversationEmail* __lambda145_ (ConversationListBox* self,
                                 ConversationListBoxEmailRow* row);
static gpointer ___lambda145__gee_map_func (gpointer g,
                                     gpointer self);
static GeeIterator* __lambda146_ (ConversationListBox* self,
                           ConversationEmail* email_view);
VALA_EXTERN GeeIterator* conversation_email_iterator (ConversationEmail* self);
static gpointer ___lambda146__gee_map_func (gpointer g,
                                     gpointer self);
static ConversationEmail* conversation_list_box_action_target_to_view (ConversationListBox* self,
                                                                GVariant* target);
static void conversation_list_box_on_conversation_appended_async (ConversationListBox* self,
                                                           GearyAppConversation* conversation,
                                                           GearyEmail* part_email,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
static void conversation_list_box_on_conversation_appended_finish (ConversationListBox* self,
                                                            GAsyncResult* _res_);
static void conversation_list_box_on_conversation_appended_async_data_free (gpointer _data);
static gboolean conversation_list_box_on_conversation_appended_async_co (ConversationListBoxOnConversationAppendedAsyncData* _data_);
static void ___lambda137_ (ConversationListBox* self,
                    GObject* obj,
                    GAsyncResult* ret);
static void ____lambda137__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
VALA_EXTERN void conversation_list_box_conversation_row_collapse (ConversationListBoxConversationRow* self);
static Block88Data* block88_data_ref (Block88Data* _data88_);
static void block88_data_unref (void * _userdata_);
static void ___lambda132_ (Block88Data* _data88_,
                    GObject* obj,
                    GAsyncResult* res);
static void ____lambda132__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static Block89Data* block89_data_ref (Block89Data* _data89_);
static void block89_data_unref (void * _userdata_);
static void ___lambda131_ (Block89Data* _data89_,
                    GObject* obj,
                    GAsyncResult* res);
static void ____lambda131__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static Block90Data* block90_data_ref (Block90Data* _data90_);
static void block90_data_unref (void * _userdata_);
static void ___lambda129_ (Block90Data* _data90_,
                    GObject* obj,
                    GAsyncResult* res);
static void ____lambda129__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static Block91Data* block91_data_ref (Block91Data* _data91_);
static void block91_data_unref (void * _userdata_);
static void ___lambda130_ (Block91Data* _data91_,
                    GtkWidget* row);
static void ____lambda130__gtk_callback (GtkWidget* widget,
                                  gpointer self);
static void conversation_list_box_search_manager_highlight_matching_email_data_free (gpointer _data);
static gboolean conversation_list_box_search_manager_highlight_matching_email_co (ConversationListBoxSearchManagerHighlightMatchingEmailData* _data_);
static void conversation_list_box_search_manager_highlight_matching_email_ready (GObject* source_object,
                                                                          GAsyncResult* _res_,
                                                                          gpointer _user_data_);
static void conversation_list_box_search_manager_apply_terms (ConversationListBoxSearchManager* self,
                                                       ConversationListBoxEmailRow* row,
                                                       GeeSet* terms,
                                                       GCancellable* cancellable);
static void __lambda128_ (ConversationListBoxSearchManager* self,
                   GtkWidget* child);
VALA_EXTERN gboolean conversation_list_box_email_row_get_is_search_match (ConversationListBoxEmailRow* self);
VALA_EXTERN void conversation_list_box_email_row_set_is_search_match (ConversationListBoxEmailRow* self,
                                                          gboolean value);
static void ___lambda128__gtk_callback (GtkWidget* widget,
                                 gpointer self);
static inline void conversation_list_box_search_manager_notify_matches_updated (ConversationListBoxSearchManager* self);
static Block92Data* block92_data_ref (Block92Data* _data92_);
static void block92_data_unref (void * _userdata_);
static void conversation_list_box_search_manager_apply_terms_impl (ConversationListBoxSearchManager* self,
                                                            ConversationListBoxEmailRow* row,
                                                            GeeSet* terms,
                                                            GCancellable* cancellable,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static guint conversation_list_box_search_manager_apply_terms_impl_finish (ConversationListBoxSearchManager* self,
                                                                    GAsyncResult* _res_,
                                                                    GError** error);
static void conversation_list_box_search_manager_apply_terms_impl_finished (ConversationListBoxSearchManager* self,
                                                                     GObject* obj,
                                                                     GAsyncResult* res);
static void _conversation_list_box_search_manager_apply_terms_impl_finished_gasync_ready_callback (GObject* source_object,
                                                                                            GAsyncResult* res,
                                                                                            gpointer self);
static void ___lambda127_ (Block92Data* _data92_);
static void ____lambda127__g_object_notify (GObject* _sender,
                                     GParamSpec* pspec,
                                     gpointer self);
static void conversation_list_box_search_manager_apply_terms_impl_data_free (gpointer _data);
static gboolean conversation_list_box_search_manager_apply_terms_impl_co (ConversationListBoxSearchManagerApplyTermsImplData* _data_);
static void conversation_list_box_search_manager_apply_terms_impl_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_);
static void conversation_list_box_search_manager_finalize (GObject * obj);
static GType conversation_list_box_search_manager_get_type_once (void);
static void conversation_list_box_conversation_row_set_email (ConversationListBoxConversationRow* self,
                                                       GearyEmail* value);
VALA_EXTERN void conversation_list_box_conversation_row_set_is_expanded (ConversationListBoxConversationRow* self,
                                                             gboolean value);
VALA_EXTERN ConversationListBoxConversationRow* conversation_list_box_conversation_row_construct (GType object_type,
                                                                                      GearyEmail* email);
static void conversation_list_box_conversation_row_update_css_class (ConversationListBoxConversationRow* self);
static void _conversation_list_box_conversation_row_update_css_class_g_object_notify (GObject* _sender,
                                                                               GParamSpec* pspec,
                                                                               gpointer self);
static void conversation_list_box_conversation_row_real_expand_data_free (gpointer _data);
static void conversation_list_box_conversation_row_real_expand (ConversationListBoxConversationRow* self,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static gboolean conversation_list_box_conversation_row_real_expand_co (ConversationListBoxConversationRowExpandData* _data_);
static void conversation_list_box_conversation_row_real_collapse (ConversationListBoxConversationRow* self);
VALA_EXTERN void conversation_list_box_conversation_row_on_size_allocate (ConversationListBoxConversationRow* self);
static void _conversation_list_box_conversation_row_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender,
                                                                                        GtkAllocation* allocation,
                                                                                        gpointer self);
static void conversation_list_box_conversation_row_update_previous_sibling_css_class (ConversationListBoxConversationRow* self);
static GtkWidget* conversation_list_box_conversation_row_get_previous_sibling (ConversationListBoxConversationRow* self);
VALA_EXTERN void conversation_list_box_conversation_row_set_style_context_class (ConversationListBoxConversationRow* self,
                                                                     const gchar* class_name,
                                                                     gboolean value);
static void conversation_list_box_conversation_row_finalize (GObject * obj);
static GType conversation_list_box_conversation_row_get_type_once (void);
static void _vala_conversation_list_box_conversation_row_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
static void _vala_conversation_list_box_conversation_row_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec);
VALA_EXTERN gboolean conversation_list_box_email_row_get_is_pinned (ConversationListBoxEmailRow* self);
static void conversation_list_box_email_row_set_is_pinned (ConversationListBoxEmailRow* self,
                                                    gboolean value);
static inline void conversation_list_box_email_row_update_row_expansion (ConversationListBoxEmailRow* self);
static void conversation_list_box_email_row_set_view (ConversationListBoxEmailRow* self,
                                               ConversationEmail* value);
static void conversation_list_box_email_row_real_expand_data_free (gpointer _data);
static void conversation_list_box_email_row_real_expand (ConversationListBoxConversationRow* base,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static gboolean conversation_list_box_email_row_real_expand_co (ConversationListBoxEmailRowExpandData* _data_);
static void conversation_list_box_email_row_expand_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void conversation_list_box_email_row_real_collapse (ConversationListBoxConversationRow* base);
static void conversation_list_box_email_row_finalize (GObject * obj);
static GType conversation_list_box_email_row_get_type_once (void);
static void _vala_conversation_list_box_email_row_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_conversation_list_box_email_row_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);
static GType conversation_list_box_loading_row_get_type_once (void);
VALA_EXTERN ComposerEmbed* conversation_list_box_composer_row_get_view (ConversationListBoxComposerRow* self);
static void conversation_list_box_composer_row_set_view (ConversationListBoxComposerRow* self,
                                                  ComposerEmbed* value);
static void conversation_list_box_composer_row_finalize (GObject * obj);
static GType conversation_list_box_composer_row_get_type_once (void);
static void _vala_conversation_list_box_composer_row_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_conversation_list_box_composer_row_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);
static void conversation_list_box_finalize (GObject * obj);
static GType conversation_list_box_get_type_once (void);
static void _vala_conversation_list_box_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_conversation_list_box_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static const GActionEntry CONVERSATION_LIST_BOX_email_action_entries[14] = {{CONVERSATION_LIST_BOX_ACTION_DELETE, _conversation_list_box_on_email_delete_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_FORWARD, _conversation_list_box_on_email_forward_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_MARK_LOAD_REMOTE, _conversation_list_box_on_email_load_remote_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_MARK_READ, _conversation_list_box_on_email_mark_read_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_MARK_STARRED, _conversation_list_box_on_email_mark_starred_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_MARK_UNREAD, _conversation_list_box_on_email_mark_unread_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_MARK_UNREAD_DOWN, _conversation_list_box_on_email_mark_unread_down_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_MARK_UNSTARRED, _conversation_list_box_on_email_mark_unstarred_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_PRINT, _conversation_list_box_on_email_print_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_REPLY_ALL, _conversation_list_box_on_email_reply_all_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_REPLY_SENDER, _conversation_list_box_on_email_reply_sender_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_SAVE_ALL_ATTACHMENTS, _conversation_list_box_on_email_save_all_attachments_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_TRASH, _conversation_list_box_on_email_trash_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}, {CONVERSATION_LIST_BOX_ACTION_VIEW_SOURCE, _conversation_list_box_on_email_view_source_gsimple_action_activate_callback, CONVERSATION_LIST_BOX_ACTION_TARGET_TYPE}};

static inline gpointer
conversation_list_box_get_instance_private (ConversationListBox* self)
{
	return G_STRUCT_MEMBER_P (self, ConversationListBox_private_offset);
}

static void
_conversation_list_box_on_email_delete_gsimple_action_activate_callback (GSimpleAction* action,
                                                                         GVariant* parameter,
                                                                         gpointer self)
{
	conversation_list_box_on_email_delete ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_forward_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self)
{
	conversation_list_box_on_email_forward ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_load_remote_gsimple_action_activate_callback (GSimpleAction* action,
                                                                              GVariant* parameter,
                                                                              gpointer self)
{
	conversation_list_box_on_email_load_remote ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_mark_read_gsimple_action_activate_callback (GSimpleAction* action,
                                                                            GVariant* parameter,
                                                                            gpointer self)
{
	conversation_list_box_on_email_mark_read ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_mark_starred_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self)
{
	conversation_list_box_on_email_mark_starred ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_mark_unread_gsimple_action_activate_callback (GSimpleAction* action,
                                                                              GVariant* parameter,
                                                                              gpointer self)
{
	conversation_list_box_on_email_mark_unread ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_mark_unread_down_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                   GVariant* parameter,
                                                                                   gpointer self)
{
	conversation_list_box_on_email_mark_unread_down ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_mark_unstarred_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                 GVariant* parameter,
                                                                                 gpointer self)
{
	conversation_list_box_on_email_mark_unstarred ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_print_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self)
{
	conversation_list_box_on_email_print ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_reply_all_gsimple_action_activate_callback (GSimpleAction* action,
                                                                            GVariant* parameter,
                                                                            gpointer self)
{
	conversation_list_box_on_email_reply_all ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_reply_sender_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self)
{
	conversation_list_box_on_email_reply_sender ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_save_all_attachments_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                       GVariant* parameter,
                                                                                       gpointer self)
{
	conversation_list_box_on_email_save_all_attachments ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_trash_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self)
{
	conversation_list_box_on_email_trash ((ConversationListBox*) self, action, parameter);
}

static void
_conversation_list_box_on_email_view_source_gsimple_action_activate_callback (GSimpleAction* action,
                                                                              GVariant* parameter,
                                                                              gpointer self)
{
	conversation_list_box_on_email_view_source ((ConversationListBox*) self, action, parameter);
}

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

static gint
conversation_list_box_on_sort (GtkListBoxRow* row1,
                               GtkListBoxRow* row2)
{
	GearyEmail* email1 = NULL;
	GearyEmail* _tmp0_;
	GearyEmail* _tmp1_;
	GearyEmail* _tmp2_;
	GearyEmail* email2 = NULL;
	GearyEmail* _tmp3_;
	GearyEmail* _tmp4_;
	GearyEmail* _tmp5_;
	GearyEmail* _tmp6_;
	GearyEmail* _tmp7_;
	GearyEmail* _tmp8_;
	GearyEmail* _tmp9_;
	gint result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (row1, gtk_list_box_row_get_type ()), 0);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (row2, gtk_list_box_row_get_type ()), 0);
	_tmp0_ = conversation_list_box_conversation_row_get_email (G_TYPE_CHECK_INSTANCE_CAST (row1, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	email1 = _tmp2_;
	_tmp3_ = conversation_list_box_conversation_row_get_email (G_TYPE_CHECK_INSTANCE_CAST (row2, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	email2 = _tmp5_;
	_tmp6_ = email1;
	if (_tmp6_ == NULL) {
		result = 1;
		_g_object_unref0 (email2);
		_g_object_unref0 (email1);
		return result;
	}
	_tmp7_ = email2;
	if (_tmp7_ == NULL) {
		result = -1;
		_g_object_unref0 (email2);
		_g_object_unref0 (email1);
		return result;
	}
	_tmp8_ = email1;
	_tmp9_ = email2;
	result = geary_email_compare_sent_date_ascending (_tmp8_, _tmp9_);
	_g_object_unref0 (email2);
	_g_object_unref0 (email1);
	return result;
}

GearyAppConversation*
conversation_list_box_get_conversation (ConversationListBox* self)
{
	GearyAppConversation* result;
	GearyAppConversation* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	_tmp0_ = self->priv->_conversation;
	result = _tmp0_;
	return result;
}

static void
conversation_list_box_set_conversation (ConversationListBox* self,
                                        GearyAppConversation* value)
{
	GearyAppConversation* old_value;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	old_value = conversation_list_box_get_conversation (self);
	if (old_value != value) {
		GearyAppConversation* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_conversation);
		self->priv->_conversation = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_list_box_properties[CONVERSATION_LIST_BOX_CONVERSATION_PROPERTY]);
	}
}

ConversationListBoxSearchManager*
conversation_list_box_get_search (ConversationListBox* self)
{
	ConversationListBoxSearchManager* result;
	ConversationListBoxSearchManager* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	_tmp0_ = self->priv->_search;
	result = _tmp0_;
	return result;
}

static void
conversation_list_box_set_search (ConversationListBox* self,
                                  ConversationListBoxSearchManager* value)
{
	ConversationListBoxSearchManager* old_value;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	old_value = conversation_list_box_get_search (self);
	if (old_value != value) {
		ConversationListBoxSearchManager* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_search);
		self->priv->_search = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_list_box_properties[CONVERSATION_LIST_BOX_SEARCH_PROPERTY]);
	}
}

gboolean
conversation_list_box_get_has_composer (ConversationListBox* self)
{
	gboolean result;
	ConversationListBoxComposerRow* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), FALSE);
	_tmp0_ = self->priv->current_composer;
	result = _tmp0_ != NULL;
	return result;
}

static void
conversation_list_box_real_scroll (ConversationListBox* self,
                                   GtkScrollType type)
{
	gboolean handled = FALSE;
	ConversationListBoxComposerRow* composer = NULL;
	ConversationListBoxComposerRow* _tmp0_;
	ConversationListBoxComposerRow* _tmp1_;
	ConversationListBoxComposerRow* _tmp2_;
	handled = FALSE;
	_tmp0_ = self->priv->current_composer;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	composer = _tmp1_;
	_tmp2_ = composer;
	if (_tmp2_ != NULL) {
		GtkWindow* window = NULL;
		GtkWidget* _tmp3_;
		GtkWindow* _tmp4_;
		GtkWindow* _tmp5_;
		_tmp3_ = gtk_widget_get_toplevel (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp3_) : NULL);
		window = _tmp4_;
		_tmp5_ = window;
		if (_tmp5_ != NULL) {
			GtkWidget* focused = NULL;
			GtkWindow* _tmp6_;
			GtkWidget* _tmp7_;
			GtkWidget* _tmp8_;
			gboolean _tmp9_ = FALSE;
			gboolean _tmp10_ = FALSE;
			GtkWidget* _tmp11_;
			_tmp6_ = window;
			_tmp7_ = gtk_window_get_focus (_tmp6_);
			_tmp8_ = _g_object_ref0 (_tmp7_);
			focused = _tmp8_;
			_tmp11_ = focused;
			if (_tmp11_ != NULL) {
				GtkWidget* _tmp12_;
				ConversationListBoxComposerRow* _tmp13_;
				_tmp12_ = focused;
				_tmp13_ = composer;
				_tmp10_ = gtk_widget_is_ancestor (_tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget));
			} else {
				_tmp10_ = FALSE;
			}
			if (_tmp10_) {
				GtkWidget* _tmp14_;
				_tmp14_ = focused;
				_tmp9_ = !COMPOSER_IS_WEB_VIEW (_tmp14_);
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				switch (type) {
					case GTK_SCROLL_STEP_UP:
					{
						ConversationListBoxComposerRow* _tmp15_;
						gboolean _tmp16_ = FALSE;
						_tmp15_ = composer;
						g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), "focus", GTK_DIR_UP, &_tmp16_);
						handled = TRUE;
						break;
					}
					case GTK_SCROLL_STEP_DOWN:
					{
						ConversationListBoxComposerRow* _tmp17_;
						gboolean _tmp18_ = FALSE;
						_tmp17_ = composer;
						g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget), "focus", GTK_DIR_DOWN, &_tmp18_);
						handled = TRUE;
						break;
					}
					default:
					{
						break;
					}
				}
			}
			_g_object_unref0 (focused);
		}
		_g_object_unref0 (window);
	}
	if (!handled) {
		GtkAdjustment* adj = NULL;
		GtkAdjustment* _tmp19_;
		GtkAdjustment* _tmp20_;
		gdouble value = 0.0;
		GtkAdjustment* _tmp21_;
		GtkAdjustment* _tmp27_;
		GearyTimeoutManager* _tmp28_;
		_tmp19_ = gtk_list_box_get_adjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox));
		_tmp20_ = _g_object_ref0 (_tmp19_);
		adj = _tmp20_;
		_tmp21_ = adj;
		value = gtk_adjustment_get_value (_tmp21_);
		switch (type) {
			case GTK_SCROLL_STEP_UP:
			{
				GtkAdjustment* _tmp22_;
				_tmp22_ = adj;
				value -= gtk_adjustment_get_step_increment (_tmp22_);
				break;
			}
			case GTK_SCROLL_STEP_DOWN:
			{
				GtkAdjustment* _tmp23_;
				_tmp23_ = adj;
				value += gtk_adjustment_get_step_increment (_tmp23_);
				break;
			}
			case GTK_SCROLL_PAGE_UP:
			{
				GtkAdjustment* _tmp24_;
				_tmp24_ = adj;
				value -= gtk_adjustment_get_page_increment (_tmp24_);
				break;
			}
			case GTK_SCROLL_PAGE_DOWN:
			{
				GtkAdjustment* _tmp25_;
				_tmp25_ = adj;
				value += gtk_adjustment_get_page_increment (_tmp25_);
				break;
			}
			case GTK_SCROLL_START:
			{
				value = 0.0;
				break;
			}
			case GTK_SCROLL_END:
			{
				GtkAdjustment* _tmp26_;
				_tmp26_ = adj;
				value = gtk_adjustment_get_upper (_tmp26_);
				break;
			}
			default:
			{
				break;
			}
		}
		_tmp27_ = adj;
		gtk_adjustment_set_value (_tmp27_, value);
		_tmp28_ = self->priv->mark_read_timer;
		geary_timeout_manager_start (_tmp28_);
		_g_object_unref0 (adj);
	}
	_g_object_unref0 (composer);
}

static void
conversation_list_box_real_focus_next (ConversationListBox* self)
{
	GearyTimeoutManager* _tmp0_;
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), "move-cursor", GTK_MOVEMENT_DISPLAY_LINES, 1);
	_tmp0_ = self->priv->mark_read_timer;
	geary_timeout_manager_start (_tmp0_);
}

static void
conversation_list_box_real_focus_prev (ConversationListBox* self)
{
	GearyTimeoutManager* _tmp0_;
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), "move-cursor", GTK_MOVEMENT_DISPLAY_LINES, -1);
	_tmp0_ = self->priv->mark_read_timer;
	geary_timeout_manager_start (_tmp0_);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_STRING (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_string (param_values + 2), data2);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_OBJECT_OBJECT (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), g_value_get_object (param_values + 3), data2);
}

/**
     * Constructs a new conversation list box instance.
     */
static void
_conversation_list_box_check_mark_read_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                           gpointer self)
{
	conversation_list_box_check_mark_read ((ConversationListBox*) self);
}

static void
_conversation_list_box_update_previous_sibling_css_class_gtk_container_add (GtkContainer* _sender,
                                                                            GtkWidget* widget,
                                                                            gpointer self)
{
	conversation_list_box_update_previous_sibling_css_class ((ConversationListBox*) self);
}

static void
_conversation_list_box_update_previous_sibling_css_class_gtk_container_remove (GtkContainer* _sender,
                                                                               GtkWidget* widget,
                                                                               gpointer self)
{
	conversation_list_box_update_previous_sibling_css_class ((ConversationListBox*) self);
}

static gint
_conversation_list_box_on_sort_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                       GtkListBoxRow* row2,
                                                       gpointer self)
{
	gint result;
	result = conversation_list_box_on_sort (row1, row2);
	return result;
}

static void
_conversation_list_box_on_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                    GtkListBoxRow* row,
                                                                    gpointer self)
{
	conversation_list_box_on_row_activated ((ConversationListBox*) self, row);
}

static void
_conversation_list_box_on_conversation_appended_geary_app_conversation_appended (GearyAppConversation* _sender,
                                                                                 GearyEmail* email,
                                                                                 gpointer self)
{
	conversation_list_box_on_conversation_appended ((ConversationListBox*) self, _sender, email);
}

static void
_conversation_list_box_on_conversation_trimmed_geary_app_conversation_trimmed (GearyAppConversation* _sender,
                                                                               GearyEmail* email,
                                                                               gpointer self)
{
	conversation_list_box_on_conversation_trimmed ((ConversationListBox*) self, email);
}

static void
_conversation_list_box_on_update_flags_geary_app_conversation_email_flags_changed (GearyAppConversation* _sender,
                                                                                   GearyEmail* email,
                                                                                   gpointer self)
{
	conversation_list_box_on_update_flags ((ConversationListBox*) self, email);
}

ConversationListBox*
conversation_list_box_construct (GType object_type,
                                 GearyAppConversation* conversation,
                                 gboolean suppress_mark_timer,
                                 GearyAppEmailStore* email_store,
                                 ApplicationContactStore* contacts,
                                 ApplicationConfiguration* config,
                                 GtkAdjustment* adjustment)
{
	ConversationListBox * self = NULL;
	GearyAppEmailStore* _tmp0_;
	ApplicationContactStore* _tmp1_;
	ApplicationConfiguration* _tmp2_;
	ConversationListBoxSearchManager* _tmp3_;
	ConversationListBoxSearchManager* _tmp4_;
	GearyTimeoutManager* _tmp5_;
	GtkStyleContext* _tmp6_;
	GtkStyleContext* _tmp7_;
	GtkStyleContext* _tmp8_;
	GSimpleActionGroup* _tmp9_;
	GSimpleActionGroup* _tmp10_;
	GearyAppConversation* _tmp11_;
	GearyAppConversation* _tmp12_;
	GearyAppConversation* _tmp13_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (conversation, GEARY_APP_TYPE_CONVERSATION), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email_store, GEARY_APP_TYPE_EMAIL_STORE), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONTACT_STORE (contacts), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONFIGURATION (config), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (adjustment, gtk_adjustment_get_type ()), NULL);
	self = (ConversationListBox*) g_object_new (object_type, NULL);
	geary_base_interface_base_ref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	conversation_list_box_set_conversation (self, conversation);
	_tmp0_ = _g_object_ref0 (email_store);
	_g_object_unref0 (self->priv->email_store);
	self->priv->email_store = _tmp0_;
	_tmp1_ = _g_object_ref0 (contacts);
	_g_object_unref0 (self->priv->contacts);
	self->priv->contacts = _tmp1_;
	_tmp2_ = _g_object_ref0 (config);
	_g_object_unref0 (self->priv->config);
	self->priv->config = _tmp2_;
	_tmp3_ = conversation_list_box_search_manager_new (self, conversation);
	_tmp4_ = _tmp3_;
	conversation_list_box_set_search (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
	self->priv->suppress_mark_timer = suppress_mark_timer;
	_tmp5_ = geary_timeout_manager_new_milliseconds ((guint) CONVERSATION_LIST_BOX_MARK_READ_TIMEOUT_MSEC, _conversation_list_box_check_mark_read_geary_timeout_manager_timeout_func, self);
	_g_object_unref0 (self->priv->mark_read_timer);
	self->priv->mark_read_timer = _tmp5_;
	gtk_list_box_set_selection_mode (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), GTK_SELECTION_NONE);
	_tmp6_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp6_, "content");
	_tmp7_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp7_, "background");
	_tmp8_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp8_, "conversation-listbox");
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), "add", (GCallback) _conversation_list_box_update_previous_sibling_css_class_gtk_container_add, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), "remove", (GCallback) _conversation_list_box_update_previous_sibling_css_class_gtk_container_remove, self, 0);
	gtk_list_box_set_adjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), adjustment);
	gtk_list_box_set_sort_func (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), _conversation_list_box_on_sort_gtk_list_box_sort_func, NULL, NULL);
	_tmp9_ = self->priv->email_actions;
	g_action_map_add_action_entries (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, g_action_map_get_type (), GActionMap), CONVERSATION_LIST_BOX_email_action_entries, (gint) G_N_ELEMENTS (CONVERSATION_LIST_BOX_email_action_entries), self);
	_tmp10_ = self->priv->email_actions;
	gtk_widget_insert_action_group (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), CONVERSATION_LIST_BOX_EMAIL_ACTION_GROUP_NAME, G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, g_action_group_get_type (), GActionGroup));
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), "row-activated", (GCallback) _conversation_list_box_on_row_activated_gtk_list_box_row_activated, self, 0);
	_tmp11_ = self->priv->_conversation;
	g_signal_connect_object (_tmp11_, "appended", (GCallback) _conversation_list_box_on_conversation_appended_geary_app_conversation_appended, self, 0);
	_tmp12_ = self->priv->_conversation;
	g_signal_connect_object (_tmp12_, "trimmed", (GCallback) _conversation_list_box_on_conversation_trimmed_geary_app_conversation_trimmed, self, 0);
	_tmp13_ = self->priv->_conversation;
	g_signal_connect_object (_tmp13_, "email-flags-changed", (GCallback) _conversation_list_box_on_update_flags_geary_app_conversation_email_flags_changed, self, 0);
	return self;
}

ConversationListBox*
conversation_list_box_new (GearyAppConversation* conversation,
                           gboolean suppress_mark_timer,
                           GearyAppEmailStore* email_store,
                           ApplicationContactStore* contacts,
                           ApplicationConfiguration* config,
                           GtkAdjustment* adjustment)
{
	return conversation_list_box_construct (TYPE_CONVERSATION_LIST_BOX, conversation, suppress_mark_timer, email_store, contacts, config, adjustment);
}

static void
conversation_list_box_real_destroy (GtkWidget* base)
{
	ConversationListBox * self;
	ConversationListBoxSearchManager* _tmp0_;
	GCancellable* _tmp1_;
	GeeMap* _tmp2_;
	GearyTimeoutManager* _tmp3_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CONVERSATION_LIST_BOX, ConversationListBox);
	_tmp0_ = self->priv->_search;
	conversation_list_box_search_manager_cancel (_tmp0_);
	_tmp1_ = self->priv->cancellable;
	g_cancellable_cancel (_tmp1_);
	_tmp2_ = self->priv->email_rows;
	gee_map_clear (_tmp2_);
	_tmp3_ = self->priv->mark_read_timer;
	geary_timeout_manager_reset (_tmp3_);
	GTK_WIDGET_CLASS (conversation_list_box_parent_class)->destroy (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), gtk_widget_get_type (), GtkWidget));
}

void
conversation_list_box_insert (ConversationListBox* self,
                              GtkWidget* child,
                              gint position)
{
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_widget_get_type ()));
	gtk_list_box_insert (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), child, position);
	conversation_list_box_update_previous_sibling_css_class (self);
}

static void
conversation_list_box_update_previous_sibling_css_class (ConversationListBox* self)
{
	GList* siblings = NULL;
	GList* _tmp0_;
	GList* l = NULL;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_tmp0_ = gtk_container_get_children (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer));
	siblings = _tmp0_;
	{
		GList* _tmp1_;
		gboolean _tmp2_ = FALSE;
		_tmp1_ = siblings;
		l = _tmp1_;
		_tmp2_ = TRUE;
		while (TRUE) {
			gboolean _tmp5_ = FALSE;
			gboolean _tmp6_ = FALSE;
			GList* _tmp7_;
			gboolean _tmp13_ = FALSE;
			GList* _tmp14_;
			if (!_tmp2_) {
				GList* _tmp3_;
				GList* _tmp4_;
				_tmp3_ = l;
				_tmp4_ = _tmp3_->next;
				l = _tmp4_;
			}
			_tmp2_ = FALSE;
			_tmp7_ = l;
			if (_tmp7_ != NULL) {
				GList* _tmp8_;
				GList* _tmp9_;
				_tmp8_ = l;
				_tmp9_ = _tmp8_->next;
				_tmp6_ = _tmp9_ != NULL;
			} else {
				_tmp6_ = FALSE;
			}
			if (_tmp6_) {
				GList* _tmp10_;
				GList* _tmp11_;
				gconstpointer _tmp12_;
				_tmp10_ = l;
				_tmp11_ = _tmp10_->next;
				_tmp12_ = _tmp11_->data;
				_tmp5_ = ((GtkWidget*) _tmp12_) != G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget);
			} else {
				_tmp5_ = FALSE;
			}
			if (!_tmp5_) {
				break;
			}
			_tmp14_ = l;
			if (_tmp14_ != NULL) {
				GList* _tmp15_;
				GList* _tmp16_;
				_tmp15_ = l;
				_tmp16_ = _tmp15_->next;
				_tmp13_ = _tmp16_ != NULL;
			} else {
				_tmp13_ = FALSE;
			}
			if (_tmp13_) {
				ConversationListBoxConversationRow* row = NULL;
				GList* _tmp17_;
				GList* _tmp18_;
				gconstpointer _tmp19_;
				GtkWidget* _tmp20_;
				ConversationListBoxConversationRow* _tmp21_;
				ConversationListBoxConversationRow* _tmp22_;
				_tmp17_ = l;
				_tmp18_ = _tmp17_->next;
				_tmp19_ = _tmp18_->data;
				_tmp20_ = (GtkWidget*) _tmp19_;
				_tmp21_ = _g_object_ref0 (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (_tmp20_) ? ((ConversationListBoxConversationRow*) _tmp20_) : NULL);
				row = _tmp21_;
				_tmp22_ = row;
				if (_tmp22_ != NULL) {
					ConversationListBoxConversationRow* _tmp23_;
					gboolean _tmp24_;
					gboolean _tmp25_;
					_tmp23_ = row;
					_tmp24_ = conversation_list_box_conversation_row_get_is_expanded (_tmp23_);
					_tmp25_ = _tmp24_;
					if (_tmp25_) {
						GList* _tmp26_;
						gconstpointer _tmp27_;
						GtkStyleContext* _tmp28_;
						_tmp26_ = l;
						_tmp27_ = _tmp26_->data;
						_tmp28_ = gtk_widget_get_style_context ((GtkWidget*) _tmp27_);
						gtk_style_context_add_class (_tmp28_, "geary-expanded-previous-sibling");
					} else {
						GList* _tmp29_;
						gconstpointer _tmp30_;
						GtkStyleContext* _tmp31_;
						_tmp29_ = l;
						_tmp30_ = _tmp29_->data;
						_tmp31_ = gtk_widget_get_style_context ((GtkWidget*) _tmp30_);
						gtk_style_context_remove_class (_tmp31_, "geary-expanded-previous-sibling");
					}
				}
				_g_object_unref0 (row);
			}
		}
	}
	(siblings == NULL) ? NULL : (siblings = (g_list_free (siblings), NULL));
}

static void
conversation_list_box_load_conversation_data_free (gpointer _data)
{
	ConversationListBoxLoadConversationData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->scroll_to);
	_g_object_unref0 (_data_->query);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationListBoxLoadConversationData, _data_);
}

void
conversation_list_box_load_conversation (ConversationListBox* self,
                                         GeeCollection* scroll_to,
                                         GearySearchQuery* query,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	ConversationListBoxLoadConversationData* _data_;
	ConversationListBox* _tmp0_;
	GeeCollection* _tmp1_;
	GearySearchQuery* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (scroll_to, GEE_TYPE_COLLECTION));
	g_return_if_fail ((query == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (query, GEARY_TYPE_SEARCH_QUERY));
	_data_ = g_slice_new0 (ConversationListBoxLoadConversationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_load_conversation_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (scroll_to);
	_g_object_unref0 (_data_->scroll_to);
	_data_->scroll_to = _tmp1_;
	_tmp2_ = _g_object_ref0 (query);
	_g_object_unref0 (_data_->query);
	_data_->query = _tmp2_;
	conversation_list_box_load_conversation_co (_data_);
}

void
conversation_list_box_load_conversation_finish (ConversationListBox* self,
                                                GAsyncResult* _res_,
                                                GError** error)
{
	ConversationListBoxLoadConversationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
___lambda138_ (ConversationListBox* self,
               GearyEmailIdentifier* id)
{
	GearyAppConversation* _tmp0_;
	gboolean result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (id, GEARY_TYPE_EMAIL_IDENTIFIER), FALSE);
	_tmp0_ = self->priv->_conversation;
	result = geary_app_conversation_contains_email_by_id (_tmp0_, id);
	return result;
}

static gboolean
____lambda138__gee_predicate (gconstpointer g,
                              gpointer self)
{
	gboolean result;
	result = ___lambda138_ ((ConversationListBox*) self, (GearyEmailIdentifier*) g);
	return result;
}

static gint
___lambda139_ (ConversationListBox* self,
               GearyEmailIdentifier* a,
               GearyEmailIdentifier* b)
{
	gint result;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (a, GEARY_TYPE_EMAIL_IDENTIFIER), 0);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (b, GEARY_TYPE_EMAIL_IDENTIFIER), 0);
	result = geary_email_identifier_natural_sort_comparator (a, b);
	return result;
}

static gint
____lambda139__gcompare_data_func (gconstpointer a,
                                   gconstpointer b,
                                   gpointer self)
{
	gint result;
	result = ___lambda139_ ((ConversationListBox*) self, (GearyEmailIdentifier*) a, (GearyEmailIdentifier*) b);
	return result;
}

static void
conversation_list_box_load_conversation_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	ConversationListBoxLoadConversationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_list_box_load_conversation_co (_data_);
}

static gboolean
conversation_list_box_load_conversation_co (ConversationListBoxLoadConversationData* _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:
	gtk_list_box_set_sort_func (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, gtk_list_box_get_type (), GtkListBox), NULL, NULL, NULL);
	_data_->_tmp0_ = _data_->self->priv->_conversation;
	_data_->_tmp1_ = geary_app_conversation_get_emails (_data_->_tmp0_, GEARY_APP_CONVERSATION_ORDERING_SENT_DATE_ASCENDING, GEARY_APP_CONVERSATION_LOCATION_ANYWHERE, NULL, TRUE);
	_data_->all_email = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, GEE_TYPE_COLLECTION, GeeCollection);
	_data_->_tmp2_ = gee_linked_list_new (GEARY_TYPE_EMAIL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data_->uninteresting = _data_->_tmp2_;
	_data_->first_interesting = NULL;
	_data_->_tmp3_ = gee_linked_list_new (GEARY_TYPE_EMAIL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data_->post_interesting = _data_->_tmp3_;
	_data_->_tmp4_ = gee_collection_get_is_empty (_data_->scroll_to);
	_data_->_tmp5_ = _data_->_tmp4_;
	if (!_data_->_tmp5_) {
		_data_->_tmp6_ = geary_traverse (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_CHECK_INSTANCE_CAST (_data_->scroll_to, GEE_TYPE_ITERABLE, GeeIterable));
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = geary_iterable_filter (_data_->_tmp7_, ____lambda138__gee_predicate, g_object_ref (_data_->self), g_object_unref);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = geary_iterable_to_array_list (_data_->_tmp9_, NULL, NULL, NULL);
		_data_->_tmp11_ = _data_->_tmp10_;
		_g_object_unref0 (_data_->_tmp9_);
		_g_object_unref0 (_data_->_tmp7_);
		_data_->valid_scroll_to = _data_->_tmp11_;
		_data_->_tmp12_ = _data_->valid_scroll_to;
		gee_list_sort (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp12_, GEE_TYPE_LIST, GeeList), ____lambda139__gcompare_data_func, g_object_ref (_data_->self), g_object_unref);
		_data_->_tmp13_ = _data_->valid_scroll_to;
		_data_->_tmp14_ = geary_collection_first (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp13_, GEE_TYPE_COLLECTION, GeeCollection));
		_data_->first_scroll = (GearyEmailIdentifier*) _data_->_tmp14_;
		_data_->_tmp15_ = _data_->first_scroll;
		if (_data_->_tmp15_ != NULL) {
			{
				_data_->_tmp16_ = _data_->all_email;
				_data_->_tmp17_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, GEE_TYPE_ITERABLE, GeeIterable));
				_data_->_email_it = _data_->_tmp17_;
				while (TRUE) {
					_data_->_tmp18_ = _data_->_email_it;
					if (!gee_iterator_next (_data_->_tmp18_)) {
						break;
					}
					_data_->_tmp19_ = _data_->_email_it;
					_data_->_tmp20_ = gee_iterator_get (_data_->_tmp19_);
					_data_->email = (GearyEmail*) _data_->_tmp20_;
					_data_->_tmp21_ = _data_->first_interesting;
					if (_data_->_tmp21_ == NULL) {
						_data_->_tmp22_ = _data_->email;
						_data_->_tmp23_ = geary_email_get_id (_data_->_tmp22_);
						_data_->_tmp24_ = _data_->_tmp23_;
						_data_->_tmp25_ = _data_->first_scroll;
						if (_data_->_tmp24_ == _data_->_tmp25_) {
							_data_->_tmp26_ = _data_->email;
							_data_->_tmp27_ = _g_object_ref0 (_data_->_tmp26_);
							_g_object_unref0 (_data_->first_interesting);
							_data_->first_interesting = _data_->_tmp27_;
						} else {
							_data_->_tmp28_ = _data_->uninteresting;
							_data_->_tmp29_ = _data_->email;
							gee_abstract_list_insert (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp28_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), 0, _data_->_tmp29_);
						}
					} else {
						_data_->_tmp30_ = _data_->post_interesting;
						_data_->_tmp31_ = _data_->email;
						gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp30_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _data_->_tmp31_);
					}
					_g_object_unref0 (_data_->email);
				}
				_g_object_unref0 (_data_->_email_it);
			}
		}
		_g_object_unref0 (_data_->first_scroll);
		_g_object_unref0 (_data_->valid_scroll_to);
	}
	_data_->_tmp32_ = _data_->first_interesting;
	if (_data_->_tmp32_ == NULL) {
		{
			_data_->_tmp33_ = _data_->all_email;
			_data_->_tmp34_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp33_, GEE_TYPE_ITERABLE, GeeIterable));
			_data_->_vala1__email_it = _data_->_tmp34_;
			while (TRUE) {
				_data_->_tmp35_ = _data_->_vala1__email_it;
				if (!gee_iterator_next (_data_->_tmp35_)) {
					break;
				}
				_data_->_tmp36_ = _data_->_vala1__email_it;
				_data_->_tmp37_ = gee_iterator_get (_data_->_tmp36_);
				_data_->_vala1_email = (GearyEmail*) _data_->_tmp37_;
				_data_->_tmp38_ = _data_->first_interesting;
				if (_data_->_tmp38_ == NULL) {
					_data_->_tmp39_ = _data_->_vala1_email;
					if (conversation_list_box_is_interesting (_data_->self, _data_->_tmp39_)) {
						_data_->_tmp40_ = _data_->_vala1_email;
						_data_->_tmp41_ = _g_object_ref0 (_data_->_tmp40_);
						_g_object_unref0 (_data_->first_interesting);
						_data_->first_interesting = _data_->_tmp41_;
					} else {
						_data_->_tmp42_ = _data_->uninteresting;
						_data_->_tmp43_ = _data_->_vala1_email;
						gee_abstract_list_insert (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp42_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), 0, _data_->_tmp43_);
					}
				} else {
					_data_->_tmp44_ = _data_->post_interesting;
					_data_->_tmp45_ = _data_->_vala1_email;
					gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp44_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _data_->_tmp45_);
				}
				_g_object_unref0 (_data_->_vala1_email);
			}
			_g_object_unref0 (_data_->_vala1__email_it);
		}
	}
	_data_->_tmp46_ = _data_->first_interesting;
	if (_data_->_tmp46_ == NULL) {
		_data_->_tmp47_ = _data_->uninteresting;
		_data_->_tmp48_ = gee_abstract_list_remove_at (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp47_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), 0);
		_g_object_unref0 (_data_->first_interesting);
		_data_->first_interesting = (GearyEmail*) _data_->_tmp48_;
	}
	_data_->_tmp49_ = _data_->first_interesting;
	_data_->_tmp50_ = conversation_list_box_add_email (_data_->self, _data_->_tmp49_, TRUE);
	_data_->interesting_row = _data_->_tmp50_;
	_data_->_tmp52_ = _data_->uninteresting;
	_data_->_tmp53_ = gee_collection_get_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp52_, GEE_TYPE_COLLECTION, GeeCollection));
	_data_->_tmp54_ = _data_->_tmp53_;
	if (!_data_->_tmp54_) {
		_data_->_tmp55_ = _data_->post_interesting;
		_data_->_tmp56_ = gee_collection_get_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp55_, GEE_TYPE_COLLECTION, GeeCollection));
		_data_->_tmp57_ = _data_->_tmp56_;
		_data_->_tmp51_ = !_data_->_tmp57_;
	} else {
		_data_->_tmp51_ = FALSE;
	}
	if (_data_->_tmp51_) {
		_data_->_tmp58_ = conversation_list_box_loading_row_new ();
		g_object_ref_sink (_data_->_tmp58_);
		_data_->_tmp59_ = _data_->_tmp58_;
		conversation_list_box_insert (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp59_, gtk_widget_get_type (), GtkWidget), 0);
		_g_object_unref0 (_data_->_tmp59_);
	}
	_data_->_tmp60_ = _data_->interesting_row;
	_data_->_tmp61_ = conversation_list_box_email_row_get_view (_data_->_tmp60_);
	_data_->_tmp62_ = _data_->_tmp61_;
	_data_->_state_ = 1;
	conversation_email_load_contacts (_data_->_tmp62_, conversation_list_box_load_conversation_ready, _data_);
	return FALSE;
	_state_1:
	conversation_email_load_contacts_finish (_data_->_tmp62_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->interesting_row);
		_g_object_unref0 (_data_->post_interesting);
		_g_object_unref0 (_data_->first_interesting);
		_g_object_unref0 (_data_->uninteresting);
		_g_object_unref0 (_data_->all_email);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp63_ = _data_->interesting_row;
	_data_->_state_ = 2;
	conversation_list_box_conversation_row_expand (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp63_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), conversation_list_box_load_conversation_ready, _data_);
	return FALSE;
	_state_2:
	conversation_list_box_conversation_row_expand_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp63_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->interesting_row);
		_g_object_unref0 (_data_->post_interesting);
		_g_object_unref0 (_data_->first_interesting);
		_g_object_unref0 (_data_->uninteresting);
		_g_object_unref0 (_data_->all_email);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp64_ = gee_collection_get_is_empty (_data_->scroll_to);
	_data_->_tmp65_ = _data_->_tmp64_;
	_data_->_tmp66_ = _data_->uninteresting;
	_data_->_tmp67_ = _data_->post_interesting;
	conversation_list_box_finish_loading (_data_->self, _data_->query, _data_->_tmp65_, _data_->_tmp66_, _data_->_tmp67_, NULL, NULL);
	_g_object_unref0 (_data_->interesting_row);
	_g_object_unref0 (_data_->post_interesting);
	_g_object_unref0 (_data_->first_interesting);
	_g_object_unref0 (_data_->uninteresting);
	_g_object_unref0 (_data_->all_email);
	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;
}

/** Cancels loading the current conversation, if still in progress */
void
conversation_list_box_cancel_conversation_load (ConversationListBox* self)
{
	GCancellable* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_tmp0_ = self->priv->cancellable;
	g_cancellable_cancel (_tmp0_);
}

/** Scrolls to the closest message in the current conversation. */
void
conversation_list_box_scroll_to_messages (ConversationListBox* self,
                                          GeeCollection* targets)
{
	GtkListBoxRow* current_child = NULL;
	GtkListBoxRow* _tmp0_;
	GtkListBoxRow* _tmp1_;
	ConversationListBoxEmailRow* current = NULL;
	GtkListBoxRow* _tmp2_;
	ConversationListBoxEmailRow* best = NULL;
	ConversationListBoxEmailRow* _tmp12_;
	ConversationListBoxEmailRow* _tmp33_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (targets, GEE_TYPE_COLLECTION));
	_tmp0_ = gtk_list_box_get_row_at_y (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), 32);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	current_child = _tmp1_;
	current = NULL;
	_tmp2_ = current_child;
	if (_tmp2_ != NULL) {
		gint pos = 0;
		GtkListBoxRow* _tmp3_;
		_tmp3_ = current_child;
		pos = gtk_list_box_row_get_index (_tmp3_);
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				GtkListBoxRow* _tmp7_;
				ConversationListBoxEmailRow* _tmp8_;
				gint _tmp9_;
				GtkListBoxRow* _tmp10_;
				GtkListBoxRow* _tmp11_;
				if (!_tmp4_) {
					gboolean _tmp5_ = FALSE;
					ConversationListBoxEmailRow* _tmp6_;
					_tmp6_ = current;
					if (_tmp6_ == NULL) {
						_tmp5_ = pos > 0;
					} else {
						_tmp5_ = FALSE;
					}
					if (!_tmp5_) {
						break;
					}
				}
				_tmp4_ = FALSE;
				_tmp7_ = current_child;
				_tmp8_ = _g_object_ref0 (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (_tmp7_) ? ((ConversationListBoxEmailRow*) _tmp7_) : NULL);
				_g_object_unref0 (current);
				current = _tmp8_;
				pos = pos - 1;
				_tmp9_ = pos;
				_tmp10_ = gtk_list_box_get_row_at_index (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), _tmp9_);
				_tmp11_ = _g_object_ref0 (_tmp10_);
				_g_object_unref0 (current_child);
				current_child = _tmp11_;
			}
		}
	}
	best = NULL;
	_tmp12_ = current;
	if (_tmp12_ != NULL) {
		guint closest_distance = 0U;
		closest_distance = G_MAXUINT;
		{
			GeeIterator* _id_it = NULL;
			GeeIterator* _tmp13_;
			_tmp13_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (targets, GEE_TYPE_ITERABLE, GeeIterable));
			_id_it = _tmp13_;
			while (TRUE) {
				GeeIterator* _tmp14_;
				GearyEmailIdentifier* id = NULL;
				GeeIterator* _tmp15_;
				gpointer _tmp16_;
				ConversationListBoxEmailRow* target = NULL;
				GeeMap* _tmp17_;
				GearyEmailIdentifier* _tmp18_;
				gpointer _tmp19_;
				ConversationListBoxEmailRow* _tmp20_;
				_tmp14_ = _id_it;
				if (!gee_iterator_next (_tmp14_)) {
					break;
				}
				_tmp15_ = _id_it;
				_tmp16_ = gee_iterator_get (_tmp15_);
				id = (GearyEmailIdentifier*) _tmp16_;
				_tmp17_ = self->priv->email_rows;
				_tmp18_ = id;
				_tmp19_ = gee_map_get (_tmp17_, _tmp18_);
				target = (ConversationListBoxEmailRow*) _tmp19_;
				_tmp20_ = target;
				if (_tmp20_ != NULL) {
					guint distance = 0U;
					ConversationListBoxEmailRow* _tmp21_;
					ConversationListBoxEmailRow* _tmp22_;
					gboolean _tmp23_ = FALSE;
					_tmp21_ = current;
					_tmp22_ = target;
					distance = (guint) abs (gtk_list_box_row_get_index (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_list_box_row_get_type (), GtkListBoxRow)) - gtk_list_box_row_get_index (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_list_box_row_get_type (), GtkListBoxRow)));
					if (distance < closest_distance) {
						_tmp23_ = TRUE;
					} else {
						gboolean _tmp24_ = FALSE;
						if (distance == closest_distance) {
							ConversationListBoxEmailRow* _tmp25_;
							GearyEmail* _tmp26_;
							GearyEmail* _tmp27_;
							ConversationListBoxEmailRow* _tmp28_;
							GearyEmail* _tmp29_;
							GearyEmail* _tmp30_;
							_tmp25_ = target;
							_tmp26_ = conversation_list_box_conversation_row_get_email (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
							_tmp27_ = _tmp26_;
							_tmp28_ = best;
							_tmp29_ = conversation_list_box_conversation_row_get_email (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
							_tmp30_ = _tmp29_;
							_tmp24_ = geary_email_compare_sent_date_ascending (_tmp27_, _tmp30_) < 0;
						} else {
							_tmp24_ = FALSE;
						}
						_tmp23_ = _tmp24_;
					}
					if (_tmp23_) {
						ConversationListBoxEmailRow* _tmp31_;
						ConversationListBoxEmailRow* _tmp32_;
						closest_distance = distance;
						_tmp31_ = target;
						_tmp32_ = _g_object_ref0 (_tmp31_);
						_g_object_unref0 (best);
						best = _tmp32_;
					}
				}
				_g_object_unref0 (target);
				_g_object_unref0 (id);
			}
			_g_object_unref0 (_id_it);
		}
	}
	_tmp33_ = best;
	if (_tmp33_ != NULL) {
		ConversationListBoxEmailRow* _tmp34_;
		ConversationListBoxEmailRow* _tmp35_;
		_tmp34_ = best;
		conversation_list_box_scroll_to_row (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
		_tmp35_ = best;
		conversation_list_box_conversation_row_expand (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), NULL, NULL);
	}
	_g_object_unref0 (best);
	_g_object_unref0 (current);
	_g_object_unref0 (current_child);
}

/**
     * Returns the email view to be replied to, if any.
     *
     * If an email view has a visible body and selected text, that
     * view will be returned. Else the last message by sort order will
     * be returned, if any.
     */
static Block83Data*
block83_data_ref (Block83Data* _data83_)
{
	g_atomic_int_inc (&_data83_->_ref_count_);
	return _data83_;
}

static void
block83_data_unref (void * _userdata_)
{
	Block83Data* _data83_;
	_data83_ = (Block83Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data83_->_ref_count_)) {
		ConversationListBox* self;
		self = _data83_->self;
		_g_object_unref0 (_data83_->last);
		_g_object_unref0 (self);
		g_slice_free (Block83Data, _data83_);
	}
}

static void
___lambda141_ (Block83Data* _data83_,
               GtkWidget* child)
{
	ConversationListBox* self;
	ConversationListBoxEmailRow* row = NULL;
	ConversationListBoxEmailRow* _tmp0_;
	ConversationListBoxEmailRow* _tmp1_;
	self = _data83_->self;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_widget_get_type ()));
	_tmp0_ = _g_object_ref0 (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (child) ? ((ConversationListBoxEmailRow*) child) : NULL);
	row = _tmp0_;
	_tmp1_ = row;
	if (_tmp1_ != NULL) {
		ConversationListBoxEmailRow* _tmp2_;
		ConversationListBoxEmailRow* _tmp3_;
		_tmp2_ = row;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		_g_object_unref0 (_data83_->last);
		_data83_->last = _tmp3_;
	}
	_g_object_unref0 (row);
}

static void
____lambda141__gtk_callback (GtkWidget* widget,
                             gpointer self)
{
	___lambda141_ (self, widget);
}

ConversationEmail*
conversation_list_box_get_reply_target (ConversationListBox* self)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	ConversationEmail* result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	_tmp0_ = conversation_list_box_get_selection_view (self);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ == NULL) {
		Block83Data* _data83_;
		ConversationListBoxEmailRow* _tmp2_;
		_data83_ = g_slice_new0 (Block83Data);
		_data83_->_ref_count_ = 1;
		_data83_->self = g_object_ref (self);
		_data83_->last = NULL;
		gtk_container_foreach (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), ____lambda141__gtk_callback, _data83_);
		_tmp2_ = _data83_->last;
		if (_tmp2_ != NULL) {
			ConversationListBoxEmailRow* _tmp3_;
			ConversationEmail* _tmp4_;
			ConversationEmail* _tmp5_;
			ConversationEmail* _tmp6_;
			_tmp3_ = _data83_->last;
			_tmp4_ = conversation_list_box_email_row_get_view (_tmp3_);
			_tmp5_ = _tmp4_;
			_tmp6_ = _g_object_ref0 (_tmp5_);
			_g_object_unref0 (view);
			view = _tmp6_;
		}
		block83_data_unref (_data83_);
		_data83_ = NULL;
	}
	result = view;
	return result;
}

/**
     * Returns the email view with a visible user selection, if any.
     *
     * If an email view has selected body text.
     */
ConversationEmail*
conversation_list_box_get_selection_view (ConversationListBox* self)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	ConversationEmail* _tmp2_;
	ConversationEmail* result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	_tmp0_ = self->priv->body_selected_view;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	view = _tmp1_;
	_tmp2_ = view;
	if (_tmp2_ != NULL) {
		ConversationEmail* _tmp3_;
		_tmp3_ = view;
		if (_tmp3_->is_collapsed) {
			_g_object_unref0 (view);
			view = NULL;
		} else {
		}
	}
	result = view;
	return result;
}

/**
     * Adds an an embedded composer to the view.
     */
static Block84Data*
block84_data_ref (Block84Data* _data84_)
{
	g_atomic_int_inc (&_data84_->_ref_count_);
	return _data84_;
}

static void
block84_data_unref (void * _userdata_)
{
	Block84Data* _data84_;
	_data84_ = (Block84Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data84_->_ref_count_)) {
		ConversationListBox* self;
		self = _data84_->self;
		_g_object_unref0 (_data84_->row);
		_g_object_unref0 (_data84_->embed);
		_g_object_unref0 (self);
		g_slice_free (Block84Data, _data84_);
	}
}

static void
__lambda142_ (ConversationListBox* self,
              ConversationListBoxConversationRow* row)
{
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (row));
	conversation_list_box_scroll_to_row (self, row);
}

static void
___lambda142__conversation_list_box_conversation_row_should_scroll (ConversationListBoxConversationRow* _sender,
                                                                    gpointer self)
{
	__lambda142_ ((ConversationListBox*) self, _sender);
}

static void
__lambda143_ (Block84Data* _data84_,
              GParamSpec* id)
{
	ConversationListBox* self;
	ComposerWidget* _tmp0_;
	ComposerWidget* _tmp1_;
	GearyEmailIdentifier* _tmp2_;
	GearyEmailIdentifier* _tmp3_;
	GearyEmailIdentifier* _tmp4_;
	self = _data84_->self;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (id, G_TYPE_PARAM));
	_tmp0_ = composer_container_get_composer (G_TYPE_CHECK_INSTANCE_CAST (_data84_->embed, COMPOSER_TYPE_CONTAINER, ComposerContainer));
	_tmp1_ = _tmp0_;
	_tmp2_ = composer_widget_get_saved_id (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (self->priv->draft_id);
	self->priv->draft_id = _tmp4_;
}

static void
___lambda143__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda143_ (self, pspec);
}

static void
__lambda144_ (Block84Data* _data84_)
{
	ConversationListBox* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	self = _data84_->self;
	_g_object_unref0 (self->priv->current_composer);
	self->priv->current_composer = NULL;
	_g_object_unref0 (self->priv->draft_id);
	self->priv->draft_id = NULL;
	gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data84_->row, gtk_widget_get_type (), GtkWidget));
	if (_data84_->is_draft) {
		GearyEmail* _tmp2_;
		GearyEmail* _tmp3_;
		_tmp2_ = conversation_list_box_conversation_row_get_email (G_TYPE_CHECK_INSTANCE_CAST (_data84_->row, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
		_tmp3_ = _tmp2_;
		_tmp1_ = _tmp3_ != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GCancellable* _tmp4_;
		_tmp4_ = self->priv->cancellable;
		_tmp0_ = !g_cancellable_is_cancelled (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GearyEmail* _tmp5_;
		GearyEmail* _tmp6_;
		GearyEmailIdentifier* _tmp7_;
		GearyEmailIdentifier* _tmp8_;
		_tmp5_ = conversation_list_box_conversation_row_get_email (G_TYPE_CHECK_INSTANCE_CAST (_data84_->row, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
		_tmp6_ = _tmp5_;
		_tmp7_ = geary_email_get_id (_tmp6_);
		_tmp8_ = _tmp7_;
		conversation_list_box_load_full_email (self, _tmp8_, NULL, NULL);
	}
}

static void
___lambda144__composer_embed_vanished (ComposerEmbed* _sender,
                                       gpointer self)
{
	__lambda144_ (self);
}

void
conversation_list_box_add_embedded_composer (ConversationListBox* self,
                                             ComposerEmbed* embed,
                                             gboolean is_draft)
{
	Block84Data* _data84_;
	ComposerEmbed* _tmp0_;
	ConversationListBoxComposerRow* _tmp16_;
	ConversationListBoxComposerRow* _tmp17_;
	ComposerWidget* _tmp18_;
	ComposerWidget* _tmp19_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (COMPOSER_IS_EMBED (embed));
	_data84_ = g_slice_new0 (Block84Data);
	_data84_->_ref_count_ = 1;
	_data84_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (embed);
	_g_object_unref0 (_data84_->embed);
	_data84_->embed = _tmp0_;
	_data84_->is_draft = is_draft;
	if (_data84_->is_draft) {
		GearyEmail* _tmp1_;
		GearyEmail* _tmp2_;
		GearyEmailIdentifier* _tmp3_;
		GearyEmailIdentifier* _tmp4_;
		GearyEmailIdentifier* _tmp5_;
		ConversationListBoxEmailRow* draft = NULL;
		GeeMap* _tmp6_;
		GearyEmail* _tmp7_;
		GearyEmail* _tmp8_;
		GearyEmailIdentifier* _tmp9_;
		GearyEmailIdentifier* _tmp10_;
		gpointer _tmp11_;
		ConversationListBoxEmailRow* _tmp12_;
		_tmp1_ = composer_embed_get_referred (_data84_->embed);
		_tmp2_ = _tmp1_;
		_tmp3_ = geary_email_get_id (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_g_object_unref0 (self->priv->draft_id);
		self->priv->draft_id = _tmp5_;
		_tmp6_ = self->priv->email_rows;
		_tmp7_ = composer_embed_get_referred (_data84_->embed);
		_tmp8_ = _tmp7_;
		_tmp9_ = geary_email_get_id (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = gee_map_get (_tmp6_, _tmp10_);
		draft = (ConversationListBoxEmailRow*) _tmp11_;
		_tmp12_ = draft;
		if (_tmp12_ != NULL) {
			ConversationListBoxEmailRow* _tmp13_;
			GearyEmail* _tmp14_;
			GearyEmail* _tmp15_;
			_tmp13_ = draft;
			_tmp14_ = conversation_list_box_conversation_row_get_email (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
			_tmp15_ = _tmp14_;
			conversation_list_box_remove_email (self, _tmp15_);
		}
		_g_object_unref0 (draft);
	}
	_tmp16_ = conversation_list_box_composer_row_new (_data84_->embed);
	g_object_ref_sink (_tmp16_);
	_data84_->row = _tmp16_;
	conversation_list_box_conversation_row_enable_should_scroll (G_TYPE_CHECK_INSTANCE_CAST (_data84_->row, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_data84_->row, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), "should-scroll", (GCallback) ___lambda142__conversation_list_box_conversation_row_should_scroll, self, 0);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data84_->row, gtk_widget_get_type (), GtkWidget));
	_tmp17_ = _g_object_ref0 (_data84_->row);
	_g_object_unref0 (self->priv->current_composer);
	self->priv->current_composer = _tmp17_;
	_tmp18_ = composer_container_get_composer (G_TYPE_CHECK_INSTANCE_CAST (_data84_->embed, COMPOSER_TYPE_CONTAINER, ComposerContainer));
	_tmp19_ = _tmp18_;
	g_signal_connect_data (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, G_TYPE_OBJECT, GObject), "notify::saved-id", (GCallback) ___lambda143__g_object_notify, block84_data_ref (_data84_), (GClosureNotify) block84_data_unref, 0);
	g_signal_connect_data (_data84_->embed, "vanished", (GCallback) ___lambda144__composer_embed_vanished, block84_data_ref (_data84_), (GClosureNotify) block84_data_unref, 0);
	block84_data_unref (_data84_);
	_data84_ = NULL;
}

/**
     * Marks all email with a visible body read.
     */
void
conversation_list_box_mark_visible_read (ConversationListBox* self)
{
	GearyTimeoutManager* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_tmp0_ = self->priv->mark_read_timer;
	geary_timeout_manager_start (_tmp0_);
}

/** Adds an info bar to the given email, if any. */
void
conversation_list_box_add_email_info_bar (ConversationListBox* self,
                                          GearyEmailIdentifier* id,
                                          ComponentsInfoBar* info_bar)
{
	ConversationListBoxEmailRow* row = NULL;
	GeeMap* _tmp0_;
	gpointer _tmp1_;
	ConversationListBoxEmailRow* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (id, GEARY_TYPE_EMAIL_IDENTIFIER));
	g_return_if_fail (COMPONENTS_IS_INFO_BAR (info_bar));
	_tmp0_ = self->priv->email_rows;
	_tmp1_ = gee_map_get (_tmp0_, id);
	row = (ConversationListBoxEmailRow*) _tmp1_;
	_tmp2_ = row;
	if (_tmp2_ != NULL) {
		ConversationListBoxEmailRow* _tmp3_;
		ConversationEmail* _tmp4_;
		ConversationEmail* _tmp5_;
		ConversationMessage* _tmp6_;
		ConversationMessage* _tmp7_;
		ComponentsInfoBarStack* _tmp8_;
		ComponentsInfoBarStack* _tmp9_;
		_tmp3_ = row;
		_tmp4_ = conversation_list_box_email_row_get_view (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = conversation_email_get_primary_message (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = conversation_message_get_info_bars (_tmp7_);
		_tmp9_ = _tmp8_;
		components_info_bar_stack_add (_tmp9_, info_bar);
	}
	_g_object_unref0 (row);
}

/** Adds an info bar to the given email, if any. */
void
conversation_list_box_remove_email_info_bar (ConversationListBox* self,
                                             GearyEmailIdentifier* id,
                                             ComponentsInfoBar* info_bar)
{
	ConversationListBoxEmailRow* row = NULL;
	GeeMap* _tmp0_;
	gpointer _tmp1_;
	ConversationListBoxEmailRow* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (id, GEARY_TYPE_EMAIL_IDENTIFIER));
	g_return_if_fail (COMPONENTS_IS_INFO_BAR (info_bar));
	_tmp0_ = self->priv->email_rows;
	_tmp1_ = gee_map_get (_tmp0_, id);
	row = (ConversationListBoxEmailRow*) _tmp1_;
	_tmp2_ = row;
	if (_tmp2_ != NULL) {
		ConversationListBoxEmailRow* _tmp3_;
		ConversationEmail* _tmp4_;
		ConversationEmail* _tmp5_;
		ConversationMessage* _tmp6_;
		ConversationMessage* _tmp7_;
		ComponentsInfoBarStack* _tmp8_;
		ComponentsInfoBarStack* _tmp9_;
		_tmp3_ = row;
		_tmp4_ = conversation_list_box_email_row_get_view (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = conversation_email_get_primary_message (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = conversation_message_get_info_bars (_tmp7_);
		_tmp9_ = _tmp8_;
		components_info_bar_stack_remove (_tmp9_, info_bar);
	}
	_g_object_unref0 (row);
}

/**
     * Increases the magnification level used for displaying messages.
     */
static gboolean
__lambda147_ (ConversationListBox* self,
              ConversationMessage* msg_view)
{
	gboolean result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (msg_view), FALSE);
	conversation_message_zoom_in (msg_view);
	result = TRUE;
	_g_object_unref0 (msg_view);
	return result;
}

static gboolean
___lambda147__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda147_ ((ConversationListBox*) self, (ConversationMessage*) g);
	return result;
}

void
conversation_list_box_zoom_in (ConversationListBox* self)
{
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_tmp0_ = conversation_list_box_message_view_iterator (self);
	_tmp1_ = _tmp0_;
	gee_traversable_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_TRAVERSABLE, GeeTraversable), ___lambda147__gee_forall_func, self);
	_g_object_unref0 (_tmp1_);
}

/**
     * Decreases the magnification level used for displaying messages.
     */
static gboolean
__lambda148_ (ConversationListBox* self,
              ConversationMessage* msg_view)
{
	gboolean result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (msg_view), FALSE);
	conversation_message_zoom_out (msg_view);
	result = TRUE;
	_g_object_unref0 (msg_view);
	return result;
}

static gboolean
___lambda148__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda148_ ((ConversationListBox*) self, (ConversationMessage*) g);
	return result;
}

void
conversation_list_box_zoom_out (ConversationListBox* self)
{
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_tmp0_ = conversation_list_box_message_view_iterator (self);
	_tmp1_ = _tmp0_;
	gee_traversable_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_TRAVERSABLE, GeeTraversable), ___lambda148__gee_forall_func, self);
	_g_object_unref0 (_tmp1_);
}

/**
     * Resets magnification level used for displaying messages to the default.
     */
static gboolean
__lambda149_ (ConversationListBox* self,
              ConversationMessage* msg_view)
{
	gboolean result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (msg_view), FALSE);
	conversation_message_zoom_reset (msg_view);
	result = TRUE;
	_g_object_unref0 (msg_view);
	return result;
}

static gboolean
___lambda149__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda149_ ((ConversationListBox*) self, (ConversationMessage*) g);
	return result;
}

void
conversation_list_box_zoom_reset (ConversationListBox* self)
{
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_tmp0_ = conversation_list_box_message_view_iterator (self);
	_tmp1_ = _tmp0_;
	gee_traversable_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_TRAVERSABLE, GeeTraversable), ___lambda149__gee_forall_func, self);
	_g_object_unref0 (_tmp1_);
}

/**
     * Updates the displayed date for each conversation row.
     */
static gboolean
__lambda150_ (ConversationListBox* self,
              ConversationMessage* msg_view)
{
	gboolean result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (msg_view), FALSE);
	conversation_message_update_display (msg_view);
	result = TRUE;
	_g_object_unref0 (msg_view);
	return result;
}

static gboolean
___lambda150__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda150_ ((ConversationListBox*) self, (ConversationMessage*) g);
	return result;
}

void
conversation_list_box_update_display (ConversationListBox* self)
{
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_tmp0_ = conversation_list_box_message_view_iterator (self);
	_tmp1_ = _tmp0_;
	gee_traversable_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_TRAVERSABLE, GeeTraversable), ___lambda150__gee_forall_func, self);
	_g_object_unref0 (_tmp1_);
}

/** Returns the email row for the given id, if any. */
ConversationListBoxEmailRow*
conversation_list_box_get_email_row_by_id (ConversationListBox* self,
                                           GearyEmailIdentifier* id)
{
	GeeMap* _tmp0_;
	gpointer _tmp1_;
	ConversationListBoxEmailRow* result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (id, GEARY_TYPE_EMAIL_IDENTIFIER), NULL);
	_tmp0_ = self->priv->email_rows;
	_tmp1_ = gee_map_get (_tmp0_, id);
	result = (ConversationListBoxEmailRow*) _tmp1_;
	return result;
}

static void
conversation_list_box_finish_loading_data_free (gpointer _data)
{
	ConversationListBoxFinishLoadingData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->query);
	_g_object_unref0 (_data_->to_insert);
	_g_object_unref0 (_data_->to_append);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationListBoxFinishLoadingData, _data_);
}

static void
conversation_list_box_finish_loading (ConversationListBox* self,
                                      GearySearchQuery* query,
                                      gboolean enable_query_scroll,
                                      GeeLinkedList* to_insert,
                                      GeeLinkedList* to_append,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	ConversationListBoxFinishLoadingData* _data_;
	ConversationListBox* _tmp0_;
	GearySearchQuery* _tmp1_;
	GeeLinkedList* _tmp2_;
	GeeLinkedList* _tmp3_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail ((query == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (query, GEARY_TYPE_SEARCH_QUERY));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (to_insert, GEE_TYPE_LINKED_LIST));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (to_append, GEE_TYPE_LINKED_LIST));
	_data_ = g_slice_new0 (ConversationListBoxFinishLoadingData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_finish_loading_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (query);
	_g_object_unref0 (_data_->query);
	_data_->query = _tmp1_;
	_data_->enable_query_scroll = enable_query_scroll;
	_tmp2_ = _g_object_ref0 (to_insert);
	_g_object_unref0 (_data_->to_insert);
	_data_->to_insert = _tmp2_;
	_tmp3_ = _g_object_ref0 (to_append);
	_g_object_unref0 (_data_->to_append);
	_data_->to_append = _tmp3_;
	conversation_list_box_finish_loading_co (_data_);
}

static void
conversation_list_box_finish_loading_finish (ConversationListBox* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	ConversationListBoxFinishLoadingData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static Block85Data*
block85_data_ref (Block85Data* _data85_)
{
	g_atomic_int_inc (&_data85_->_ref_count_);
	return _data85_;
}

static void
block85_data_unref (void * _userdata_)
{
	Block85Data* _data85_;
	_data85_ = (Block85Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data85_->_ref_count_)) {
		ConversationListBox* self;
		self = _data85_->self;
		_g_object_unref0 (_data85_->listbox_adj);
		_g_object_unref0 (self);
		g_slice_free (Block85Data, _data85_);
	}
}

static void
conversation_list_box_finish_loading_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	ConversationListBoxFinishLoadingData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_list_box_finish_loading_co (_data_);
}

static Block86Data*
block86_data_ref (Block86Data* _data86_)
{
	g_atomic_int_inc (&_data86_->_ref_count_);
	return _data86_;
}

static void
block86_data_unref (void * _userdata_)
{
	Block86Data* _data86_;
	_data86_ = (Block86Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data86_->_ref_count_)) {
		ConversationListBox* self;
		self = _data86_->_data85_->self;
		_g_object_unref0 (_data86_->row);
		block85_data_unref (_data86_->_data85_);
		_data86_->_data85_ = NULL;
		g_slice_free (Block86Data, _data86_);
	}
}

static void
____lambda140_ (Block86Data* _data86_)
{
	Block85Data* _data85_;
	ConversationListBox* self;
	GtkAdjustment* _tmp0_;
	GtkAdjustment* _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	ConversationListBoxEmailRow* _tmp4_;
	_data85_ = _data86_->_data85_;
	self = _data85_->self;
	_tmp0_ = _data85_->listbox_adj;
	_tmp1_ = _data85_->listbox_adj;
	_tmp2_ = gtk_adjustment_get_value (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _data86_->row;
	gtk_adjustment_set_value (_tmp1_, _tmp3_ + (util_gtk_get_border_box_height (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget)) - _data85_->loading_height));
	_data85_->loading_height = 0;
}

static void
_____lambda140__conversation_list_box_conversation_row_should_scroll (ConversationListBoxConversationRow* _sender,
                                                                      gpointer self)
{
	____lambda140_ (self);
}

static gboolean
conversation_list_box_finish_loading_co (ConversationListBoxFinishLoadingData* _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;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data85_ = g_slice_new0 (Block85Data);
	_data_->_data85_->_ref_count_ = 1;
	_data_->_data85_->self = g_object_ref (_data_->self);
	_data_->_data85_->_async_data_ = _data_;
	{
		_data_->_email_list = _data_->to_append;
		_data_->_tmp0_ = _data_->_email_list;
		_data_->_tmp1_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_email_size = _data_->_tmp2_;
		_data_->_email_index = -1;
		while (TRUE) {
			_data_->_email_index = _data_->_email_index + 1;
			_data_->_tmp3_ = _data_->_email_index;
			_data_->_tmp4_ = _data_->_email_size;
			if (!(_data_->_tmp3_ < _data_->_tmp4_)) {
				break;
			}
			_data_->_tmp5_ = _data_->_email_list;
			_data_->_tmp6_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _data_->_email_index);
			_data_->email = (GearyEmail*) _data_->_tmp6_;
			_data_->_tmp7_ = _data_->email;
			_data_->_tmp8_ = conversation_list_box_add_email (_data_->self, _data_->_tmp7_, TRUE);
			_data_->row = _data_->_tmp8_;
			_data_->_tmp9_ = _data_->row;
			_data_->_tmp10_ = conversation_list_box_email_row_get_view (_data_->_tmp9_);
			_data_->_tmp11_ = _data_->_tmp10_;
			_data_->_state_ = 1;
			conversation_email_load_contacts (_data_->_tmp11_, conversation_list_box_finish_loading_ready, _data_);
			return FALSE;
			_state_1:
			conversation_email_load_contacts_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->row);
				_g_object_unref0 (_data_->email);
				block85_data_unref (_data_->_data85_);
				_data_->_data85_ = NULL;
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp12_ = _data_->email;
			if (conversation_list_box_is_interesting (_data_->self, _data_->_tmp12_)) {
				_data_->_tmp13_ = _data_->row;
				_data_->_state_ = 2;
				conversation_list_box_conversation_row_expand (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp13_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), conversation_list_box_finish_loading_ready, _data_);
				return FALSE;
				_state_2:
				conversation_list_box_conversation_row_expand_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp13_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), _data_->_res_, &_data_->_inner_error0_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->row);
					_g_object_unref0 (_data_->email);
					block85_data_unref (_data_->_data85_);
					_data_->_data85_ = NULL;
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
			_data_->_state_ = 3;
			conversation_list_box_throttle_loading (_data_->self, conversation_list_box_finish_loading_ready, _data_);
			return FALSE;
			_state_3:
			conversation_list_box_throttle_loading_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->row);
				_g_object_unref0 (_data_->email);
				block85_data_unref (_data_->_data85_);
				_data_->_data85_ = NULL;
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->row);
			_g_object_unref0 (_data_->email);
		}
	}
	_data_->_tmp14_ = gtk_list_box_get_row_at_index (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, gtk_list_box_get_type (), GtkListBox), 0);
	_data_->_tmp15_ = _g_object_ref0 (_data_->_tmp14_);
	_data_->initial_row = _data_->_tmp15_;
	_data_->_data85_->loading_height = 0;
	_data_->_tmp16_ = _data_->initial_row;
	if (CONVERSATION_LIST_BOX_IS_LOADING_ROW (_data_->_tmp16_)) {
		_data_->_tmp17_ = _data_->initial_row;
		_data_->_data85_->loading_height = util_gtk_get_border_box_height (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp17_, gtk_widget_get_type (), GtkWidget));
		_data_->_tmp18_ = _data_->initial_row;
		gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp18_, gtk_widget_get_type (), GtkWidget));
		_data_->_tmp19_ = gtk_list_box_get_row_at_index (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, gtk_list_box_get_type (), GtkListBox), 0);
		_data_->_tmp20_ = _g_object_ref0 (_data_->_tmp19_);
		_data_->first_row = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->first_row;
		_data_->_tmp22_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp21_, gtk_widget_get_type (), GtkWidget));
		_data_->_tmp23_ = _g_object_ref0 (_data_->_tmp22_);
		_data_->style = _data_->_tmp23_;
		_data_->_tmp24_ = _data_->style;
		_data_->_tmp25_ = _data_->style;
		memset (&_data_->_tmp26_, 0, sizeof (GtkBorder));
		gtk_style_context_get_margin (_data_->_tmp24_, gtk_style_context_get_state (_data_->_tmp25_), &_data_->_tmp26_);
		_data_->margin = _data_->_tmp26_;
		_data_->_tmp27_ = _data_->margin;
		_data_->_data85_->loading_height -= (gint) _data_->_tmp27_.top;
		_g_object_unref0 (_data_->style);
		_g_object_unref0 (_data_->first_row);
	}
	_data_->_tmp28_ = gtk_list_box_get_adjustment (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, gtk_list_box_get_type (), GtkListBox));
	_data_->_tmp29_ = _g_object_ref0 (_data_->_tmp28_);
	_data_->_data85_->listbox_adj = _data_->_tmp29_;
	_data_->i_mail_loaded = 0;
	{
		_data_->_vala1__email_list = _data_->to_insert;
		_data_->_tmp30_ = _data_->_vala1__email_list;
		_data_->_tmp31_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp30_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
		_data_->_tmp32_ = _data_->_tmp31_;
		_data_->_vala1__email_size = _data_->_tmp32_;
		_data_->_vala1__email_index = -1;
		while (TRUE) {
			_data_->_data86_ = g_slice_new0 (Block86Data);
			_data_->_data86_->_ref_count_ = 1;
			_data_->_data86_->_data85_ = block85_data_ref (_data_->_data85_);
			_data_->_vala1__email_index = _data_->_vala1__email_index + 1;
			_data_->_tmp33_ = _data_->_vala1__email_index;
			_data_->_tmp34_ = _data_->_vala1__email_size;
			if (!(_data_->_tmp33_ < _data_->_tmp34_)) {
				block86_data_unref (_data_->_data86_);
				_data_->_data86_ = NULL;
				break;
			}
			_data_->_tmp35_ = _data_->_vala1__email_list;
			_data_->_tmp36_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp35_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _data_->_vala1__email_index);
			_data_->_vala1_email = (GearyEmail*) _data_->_tmp36_;
			_data_->_tmp37_ = _data_->_vala1_email;
			_data_->_tmp38_ = conversation_list_box_add_email (_data_->self, _data_->_tmp37_, FALSE);
			_data_->_data86_->row = _data_->_tmp38_;
			_data_->_tmp39_ = _data_->_data86_->row;
			conversation_list_box_conversation_row_enable_should_scroll (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp39_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
			_data_->_tmp40_ = _data_->_data86_->row;
			g_signal_connect_data (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp40_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), "should-scroll", (GCallback) _____lambda140__conversation_list_box_conversation_row_should_scroll, block86_data_ref (_data_->_data86_), (GClosureNotify) block86_data_unref, 0);
			_data_->_tmp41_ = _data_->_data86_->row;
			_data_->_tmp42_ = conversation_list_box_email_row_get_view (_data_->_tmp41_);
			_data_->_tmp43_ = _data_->_tmp42_;
			_data_->_state_ = 4;
			conversation_email_load_contacts (_data_->_tmp43_, conversation_list_box_finish_loading_ready, _data_);
			return FALSE;
			_state_4:
			conversation_email_load_contacts_finish (_data_->_tmp43_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->_vala1_email);
				block86_data_unref (_data_->_data86_);
				_data_->_data86_ = NULL;
				_g_object_unref0 (_data_->initial_row);
				block85_data_unref (_data_->_data85_);
				_data_->_data85_ = NULL;
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			if ((_data_->i_mail_loaded % 10) == 0) {
				_data_->_state_ = 5;
				conversation_list_box_throttle_loading (_data_->self, conversation_list_box_finish_loading_ready, _data_);
				return FALSE;
				_state_5:
				conversation_list_box_throttle_loading_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->_vala1_email);
					block86_data_unref (_data_->_data86_);
					_data_->_data86_ = NULL;
					_g_object_unref0 (_data_->initial_row);
					block85_data_unref (_data_->_data85_);
					_data_->_data85_ = NULL;
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
			_data_->i_mail_loaded = _data_->i_mail_loaded + 1;
			_data_->_tmp44_ = _data_->i_mail_loaded;
			_g_object_unref0 (_data_->_vala1_email);
			block86_data_unref (_data_->_data86_);
			_data_->_data86_ = NULL;
		}
	}
	gtk_list_box_set_sort_func (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, gtk_list_box_get_type (), GtkListBox), _conversation_list_box_on_sort_gtk_list_box_sort_func, NULL, NULL);
	if (_data_->query != NULL) {
		_data_->_tmp45_ = _data_->self->priv->_search;
		_data_->_state_ = 6;
		conversation_list_box_search_manager_highlight_matching_email (_data_->_tmp45_, _data_->query, _data_->enable_query_scroll, conversation_list_box_finish_loading_ready, _data_);
		return FALSE;
		_state_6:
		conversation_list_box_search_manager_highlight_matching_email_finish (_data_->_tmp45_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->initial_row);
			block85_data_unref (_data_->_data85_);
			_data_->_data85_ = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_g_object_unref0 (_data_->initial_row);
	block85_data_unref (_data_->_data85_);
	_data_->_data85_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
conversation_list_box_throttle_loading (ConversationListBox* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ConversationListBoxThrottleLoadingData* _data_;
	ConversationListBox* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_data_ = g_slice_new0 (ConversationListBoxThrottleLoadingData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_throttle_loading_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	conversation_list_box_throttle_loading_co (_data_);
}

static void
conversation_list_box_throttle_loading_finish (ConversationListBox* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	ConversationListBoxThrottleLoadingData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
_conversation_list_box_throttle_loading_co_gsource_func (gpointer self)
{
	gboolean result;
	result = conversation_list_box_throttle_loading_co (self);
	return result;
}

static gboolean
conversation_list_box_throttle_loading_co (ConversationListBoxThrottleLoadingData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_idle_add_full (G_PRIORITY_LOW, _conversation_list_box_throttle_loading_co_gsource_func, _data_, NULL);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp0_ = _data_->self->priv->cancellable;
	if (g_cancellable_is_cancelled (_data_->_tmp0_)) {
		_data_->_tmp1_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Conversation load cancelled");
		_data_->_inner_error0_ = _data_->_tmp1_;
		if (_data_->_inner_error0_->domain == G_IO_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			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 void
conversation_list_box_load_full_email_data_free (gpointer _data)
{
	ConversationListBoxLoadFullEmailData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->id);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationListBoxLoadFullEmailData, _data_);
}

static void
conversation_list_box_load_full_email (ConversationListBox* self,
                                       GearyEmailIdentifier* id,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	ConversationListBoxLoadFullEmailData* _data_;
	ConversationListBox* _tmp0_;
	GearyEmailIdentifier* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (id, GEARY_TYPE_EMAIL_IDENTIFIER));
	_data_ = g_slice_new0 (ConversationListBoxLoadFullEmailData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_load_full_email_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (id);
	_g_object_unref0 (_data_->id);
	_data_->id = _tmp1_;
	conversation_list_box_load_full_email_co (_data_);
}

static void
conversation_list_box_load_full_email_finish (ConversationListBox* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	ConversationListBoxLoadFullEmailData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
conversation_list_box_load_full_email_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	ConversationListBoxLoadFullEmailData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_list_box_load_full_email_co (_data_);
}

static gboolean
conversation_list_box_load_full_email_co (ConversationListBoxLoadFullEmailData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->email_store;
	_data_->_tmp1_ = _data_->self->priv->cancellable;
	_data_->_state_ = 1;
	geary_app_email_store_fetch_email_async (_data_->_tmp0_, _data_->id, CONVERSATION_LIST_BOX_REQUIRED_FIELDS | CONVERSATION_EMAIL_REQUIRED_FOR_CONSTRUCT, GEARY_FOLDER_LIST_FLAGS_NONE, _data_->_tmp1_, conversation_list_box_load_full_email_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = geary_app_email_store_fetch_email_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
	_data_->full_email = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->self->priv->cancellable;
	if (!g_cancellable_is_cancelled (_data_->_tmp3_)) {
		_data_->_tmp4_ = _data_->full_email;
		_data_->_tmp5_ = conversation_list_box_add_email (_data_->self, _data_->_tmp4_, TRUE);
		_data_->row = _data_->_tmp5_;
		_data_->_tmp6_ = _data_->row;
		_data_->_tmp7_ = conversation_list_box_email_row_get_view (_data_->_tmp6_);
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_state_ = 2;
		conversation_email_load_contacts (_data_->_tmp8_, conversation_list_box_load_full_email_ready, _data_);
		return FALSE;
		_state_2:
		conversation_email_load_contacts_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->row);
			_g_object_unref0 (_data_->full_email);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp9_ = _data_->full_email;
		if (conversation_list_box_is_interesting (_data_->self, _data_->_tmp9_)) {
			_data_->_tmp10_ = _data_->row;
			_data_->_state_ = 3;
			conversation_list_box_conversation_row_expand (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), conversation_list_box_load_full_email_ready, _data_);
			return FALSE;
			_state_3:
			conversation_list_box_conversation_row_expand_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->row);
				_g_object_unref0 (_data_->full_email);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp11_ = _data_->self->priv->_search;
		_data_->_tmp12_ = _data_->row;
		conversation_list_box_search_manager_highlight_row_if_matching (_data_->_tmp11_, _data_->_tmp12_);
		_g_object_unref0 (_data_->row);
	}
	_g_object_unref0 (_data_->full_email);
	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
_conversation_list_box_on_internal_link_activated_conversation_email_internal_link_activated (ConversationEmail* _sender,
                                                                                              gint y,
                                                                                              gpointer self)
{
	conversation_list_box_on_internal_link_activated ((ConversationListBox*) self, _sender, y);
}

static void
__lambda134_ (ConversationListBox* self,
              ConversationEmail* email,
              gboolean has_selection)
{
	ConversationEmail* _tmp0_ = NULL;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_EMAIL (email));
	if (has_selection) {
		_tmp0_ = email;
	} else {
		_tmp0_ = NULL;
	}
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->body_selected_view);
	self->priv->body_selected_view = _tmp1_;
}

static void
___lambda134__conversation_email_body_selection_changed (ConversationEmail* _sender,
                                                         gboolean has_selection,
                                                         gpointer self)
{
	__lambda134_ ((ConversationListBox*) self, _sender, has_selection);
}

static void
_conversation_list_box_on_message_body_state_notify_g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self)
{
	conversation_list_box_on_message_body_state_notify ((ConversationListBox*) self, _sender, pspec);
}

static gboolean
__lambda135_ (ConversationListBox* self,
              GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = TRUE;
	return result;
}

static gboolean
___lambda135__gtk_widget_button_release_event (GtkWidget* _sender,
                                               GdkEventButton* event,
                                               gpointer self)
{
	gboolean result;
	result = __lambda135_ ((ConversationListBox*) self, event);
	return result;
}

static void
__lambda136_ (ConversationListBox* self,
              GearyEmail* e)
{
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (e, GEARY_TYPE_EMAIL));
	g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_EMAIL_LOADED_SIGNAL], 0, e);
}

static void
___lambda136__conversation_list_box_conversation_row_email_loaded (ConversationListBoxConversationRow* _sender,
                                                                   GearyEmail* email,
                                                                   gpointer self)
{
	__lambda136_ ((ConversationListBox*) self, email);
}

static ConversationListBoxEmailRow*
conversation_list_box_add_email (ConversationListBox* self,
                                 GearyEmail* email,
                                 gboolean append_row)
{
	gboolean is_sent = FALSE;
	GearyAccount* account = NULL;
	GearyAppConversation* _tmp0_;
	GearyFolder* _tmp1_;
	GearyFolder* _tmp2_;
	GearyAccount* _tmp3_;
	GearyAccount* _tmp4_;
	GearyAccount* _tmp5_;
	GearyRFC822MailboxAddresses* _tmp6_;
	GearyRFC822MailboxAddresses* _tmp7_;
	ConversationEmail* view = NULL;
	GearyAppConversation* _tmp21_;
	GearyAppEmailStore* _tmp22_;
	ApplicationContactStore* _tmp23_;
	ApplicationConfiguration* _tmp24_;
	GCancellable* _tmp25_;
	ConversationEmail* _tmp26_;
	ConversationEmail* _tmp27_;
	ConversationEmail* _tmp28_;
	ConversationEmail* _tmp29_;
	ConversationMessage* conversation_message = NULL;
	ConversationEmail* _tmp30_;
	ConversationMessage* _tmp31_;
	ConversationMessage* _tmp32_;
	ConversationMessage* _tmp33_;
	ConversationMessage* _tmp34_;
	GtkGrid* _tmp35_;
	GtkGrid* _tmp36_;
	ConversationListBoxEmailRow* row = NULL;
	ConversationEmail* _tmp37_;
	ConversationListBoxEmailRow* _tmp38_;
	ConversationListBoxEmailRow* _tmp39_;
	GeeMap* _tmp40_;
	GearyEmailIdentifier* _tmp41_;
	GearyEmailIdentifier* _tmp42_;
	ConversationListBoxEmailRow* _tmp43_;
	ConversationListBoxEmailRow* result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL), NULL);
	is_sent = FALSE;
	_tmp0_ = self->priv->_conversation;
	_tmp1_ = geary_app_conversation_get_base_folder (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = geary_folder_get_account (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	account = _tmp5_;
	_tmp6_ = geary_email_header_set_get_from (G_TYPE_CHECK_INSTANCE_CAST (email, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
	_tmp7_ = _tmp6_;
	if (_tmp7_ != NULL) {
		{
			GearyRFC822MailboxAddresses* _from_list = NULL;
			GearyRFC822MailboxAddresses* _tmp8_;
			GearyRFC822MailboxAddresses* _tmp9_;
			gint _from_size = 0;
			GearyRFC822MailboxAddresses* _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			gint _from_index = 0;
			_tmp8_ = geary_email_header_set_get_from (G_TYPE_CHECK_INSTANCE_CAST (email, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet));
			_tmp9_ = _tmp8_;
			_from_list = _tmp9_;
			_tmp10_ = _from_list;
			_tmp11_ = geary_rf_c822_mailbox_addresses_get_size (_tmp10_);
			_tmp12_ = _tmp11_;
			_from_size = _tmp12_;
			_from_index = -1;
			while (TRUE) {
				gint _tmp13_;
				gint _tmp14_;
				GearyRFC822MailboxAddress* from = NULL;
				GearyRFC822MailboxAddresses* _tmp15_;
				GearyRFC822MailboxAddress* _tmp16_;
				GearyAccount* _tmp17_;
				GearyAccountInformation* _tmp18_;
				GearyAccountInformation* _tmp19_;
				GearyRFC822MailboxAddress* _tmp20_;
				_from_index = _from_index + 1;
				_tmp13_ = _from_index;
				_tmp14_ = _from_size;
				if (!(_tmp13_ < _tmp14_)) {
					break;
				}
				_tmp15_ = _from_list;
				_tmp16_ = geary_rf_c822_mailbox_addresses_get (_tmp15_, _from_index);
				from = _tmp16_;
				_tmp17_ = account;
				_tmp18_ = geary_account_get_information (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = from;
				if (geary_account_information_has_sender_mailbox (_tmp19_, _tmp20_)) {
					is_sent = TRUE;
					_g_object_unref0 (from);
					break;
				}
				_g_object_unref0 (from);
			}
		}
	}
	_tmp21_ = self->priv->_conversation;
	_tmp22_ = self->priv->email_store;
	_tmp23_ = self->priv->contacts;
	_tmp24_ = self->priv->config;
	_tmp25_ = self->priv->cancellable;
	_tmp26_ = conversation_email_new (_tmp21_, email, _tmp22_, _tmp23_, _tmp24_, is_sent, conversation_list_box_is_draft (self, email), _tmp25_);
	g_object_ref_sink (_tmp26_);
	view = _tmp26_;
	_tmp27_ = view;
	g_signal_connect_object (_tmp27_, "internal-link-activated", (GCallback) _conversation_list_box_on_internal_link_activated_conversation_email_internal_link_activated, self, 0);
	_tmp28_ = view;
	g_signal_connect_object (_tmp28_, "body-selection-changed", (GCallback) ___lambda134__conversation_email_body_selection_changed, self, 0);
	_tmp29_ = view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, G_TYPE_OBJECT, GObject), "notify::message-body-state", (GCallback) _conversation_list_box_on_message_body_state_notify_g_object_notify, self, 0);
	_tmp30_ = view;
	_tmp31_ = conversation_email_get_primary_message (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = _g_object_ref0 (_tmp32_);
	conversation_message = _tmp33_;
	_tmp34_ = conversation_message;
	_tmp35_ = conversation_message_get_body_container (_tmp34_);
	_tmp36_ = _tmp35_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, gtk_widget_get_type (), GtkWidget), "button-release-event", (GCallback) ___lambda135__gtk_widget_button_release_event, self, G_CONNECT_AFTER);
	_tmp37_ = view;
	_tmp38_ = conversation_list_box_email_row_new (_tmp37_);
	g_object_ref_sink (_tmp38_);
	row = _tmp38_;
	_tmp39_ = row;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), "email-loaded", (GCallback) ___lambda136__conversation_list_box_conversation_row_email_loaded, self, 0);
	_tmp40_ = self->priv->email_rows;
	_tmp41_ = geary_email_get_id (email);
	_tmp42_ = _tmp41_;
	_tmp43_ = row;
	gee_map_set (_tmp40_, _tmp42_, _tmp43_);
	if (append_row) {
		ConversationListBoxEmailRow* _tmp44_;
		_tmp44_ = row;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, gtk_widget_get_type (), GtkWidget));
	} else {
		ConversationListBoxEmailRow* _tmp45_;
		_tmp45_ = row;
		conversation_list_box_insert (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, gtk_widget_get_type (), GtkWidget), 0);
	}
	result = row;
	_g_object_unref0 (conversation_message);
	_g_object_unref0 (view);
	_g_object_unref0 (account);
	return result;
}

static void
conversation_list_box_remove_email (ConversationListBox* self,
                                    GearyEmail* email)
{
	ConversationListBoxEmailRow* row = NULL;
	GeeMap* _tmp0_;
	GearyEmailIdentifier* _tmp1_;
	GearyEmailIdentifier* _tmp2_;
	gpointer _tmp3_ = NULL;
	gboolean _tmp4_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL));
	row = NULL;
	_tmp0_ = self->priv->email_rows;
	_tmp1_ = geary_email_get_id (email);
	_tmp2_ = _tmp1_;
	_tmp4_ = gee_map_unset (_tmp0_, _tmp2_, &_tmp3_);
	_g_object_unref0 (row);
	row = _tmp3_;
	if (_tmp4_) {
		ConversationListBoxEmailRow* _tmp5_;
		_tmp5_ = row;
		gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget));
	}
	_g_object_unref0 (row);
}

static GtkAllocation*
_gtk_allocation_dup (GtkAllocation* self)
{
	GtkAllocation* dup;
	dup = g_new0 (GtkAllocation, 1);
	memcpy (dup, self, sizeof (GtkAllocation));
	return dup;
}

static gpointer
__gtk_allocation_dup0 (gpointer self)
{
	return self ? _gtk_allocation_dup (self) : NULL;
}

static void
conversation_list_box_scroll_to_row (ConversationListBox* self,
                                     ConversationListBoxConversationRow* row)
{
	GtkAllocation* alloc = NULL;
	GtkAllocation _tmp0_ = {0};
	GtkAllocation _tmp1_;
	GtkAllocation* _tmp2_;
	gint y = 0;
	GtkAllocation* _tmp3_;
	GtkAdjustment* _tmp5_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (row));
	alloc = NULL;
	gtk_widget_get_allocation (G_TYPE_CHECK_INSTANCE_CAST (row, gtk_widget_get_type (), GtkWidget), &_tmp0_);
	_g_free0 (alloc);
	_tmp1_ = _tmp0_;
	_tmp2_ = __gtk_allocation_dup0 (&_tmp1_);
	alloc = _tmp2_;
	y = 0;
	_tmp3_ = alloc;
	if ((*_tmp3_).y > CONVERSATION_LIST_BOX_EMAIL_TOP_OFFSET) {
		GtkAllocation* _tmp4_;
		_tmp4_ = alloc;
		y = (*_tmp4_).y - CONVERSATION_LIST_BOX_EMAIL_TOP_OFFSET;
	}
	_tmp5_ = gtk_list_box_get_adjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox));
	gtk_adjustment_set_value (_tmp5_, (gdouble) y);
	_g_free0 (alloc);
}

static void
conversation_list_box_scroll_to_anchor (ConversationListBox* self,
                                        ConversationListBoxEmailRow* row,
                                        gint anchor_y)
{
	GtkAllocation* alloc = NULL;
	GtkAllocation _tmp0_ = {0};
	GtkAllocation _tmp1_;
	GtkAllocation* _tmp2_;
	gint x = 0;
	gint y = 0;
	ConversationEmail* _tmp3_;
	ConversationEmail* _tmp4_;
	ConversationMessage* _tmp5_;
	ConversationMessage* _tmp6_;
	gint _tmp7_ = 0;
	gint _tmp8_ = 0;
	GtkAdjustment* adj = NULL;
	GtkAdjustment* _tmp9_;
	GtkAdjustment* _tmp10_;
	GtkAllocation* _tmp11_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (row));
	alloc = NULL;
	gtk_widget_get_allocation (G_TYPE_CHECK_INSTANCE_CAST (row, gtk_widget_get_type (), GtkWidget), &_tmp0_);
	_g_free0 (alloc);
	_tmp1_ = _tmp0_;
	_tmp2_ = __gtk_allocation_dup0 (&_tmp1_);
	alloc = _tmp2_;
	x = 0;
	y = 0;
	_tmp3_ = conversation_list_box_email_row_get_view (row);
	_tmp4_ = _tmp3_;
	_tmp5_ = conversation_email_get_primary_message (_tmp4_);
	_tmp6_ = _tmp5_;
	conversation_message_web_view_translate_coordinates (_tmp6_, G_TYPE_CHECK_INSTANCE_CAST (row, gtk_widget_get_type (), GtkWidget), x, anchor_y, &_tmp7_, &_tmp8_);
	x = _tmp7_;
	y = _tmp8_;
	_tmp9_ = gtk_list_box_get_adjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox));
	_tmp10_ = _g_object_ref0 (_tmp9_);
	adj = _tmp10_;
	_tmp11_ = alloc;
	y = (*_tmp11_).y + y;
	gtk_adjustment_set_value (adj, (gdouble) y);
	_g_object_unref0 (adj);
	_g_free0 (alloc);
}

/**
     * Finds any currently visible messages, marks them as being read.
     */
static Block87Data*
block87_data_ref (Block87Data* _data87_)
{
	g_atomic_int_inc (&_data87_->_ref_count_);
	return _data87_;
}

static void
block87_data_unref (void * _userdata_)
{
	Block87Data* _data87_;
	_data87_ = (Block87Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data87_->_ref_count_)) {
		ConversationListBox* self;
		self = _data87_->self;
		_g_object_unref0 (_data87_->email_ids);
		_g_object_unref0 (self);
		g_slice_free (Block87Data, _data87_);
	}
}

static void
__lambda133_ (Block87Data* _data87_,
              GtkWidget* child)
{
	ConversationListBox* self;
	ConversationListBoxEmailRow* row = NULL;
	ConversationListBoxEmailRow* _tmp0_;
	ConversationEmail* _tmp1_ = NULL;
	ConversationListBoxEmailRow* _tmp2_;
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp6_;
	GearyEmail* _tmp7_ = NULL;
	ConversationEmail* _tmp8_;
	GearyEmail* email = NULL;
	GearyEmail* _tmp12_;
	gboolean _tmp13_ = FALSE;
	gboolean _tmp14_ = FALSE;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	ConversationListBoxEmailRow* _tmp17_;
	self = _data87_->self;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_widget_get_type ()));
	_tmp0_ = _g_object_ref0 (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (child) ? ((ConversationListBoxEmailRow*) child) : NULL);
	row = _tmp0_;
	_tmp2_ = row;
	if (_tmp2_ != NULL) {
		ConversationListBoxEmailRow* _tmp3_;
		ConversationEmail* _tmp4_;
		ConversationEmail* _tmp5_;
		_tmp3_ = row;
		_tmp4_ = conversation_list_box_email_row_get_view (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_;
	} else {
		_tmp1_ = NULL;
	}
	_tmp6_ = _g_object_ref0 (_tmp1_);
	view = _tmp6_;
	_tmp8_ = view;
	if (_tmp8_ != NULL) {
		ConversationEmail* _tmp9_;
		GearyEmail* _tmp10_;
		GearyEmail* _tmp11_;
		_tmp9_ = view;
		_tmp10_ = conversation_email_get_email (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp7_ = _tmp11_;
	} else {
		_tmp7_ = NULL;
	}
	_tmp12_ = _g_object_ref0 (_tmp7_);
	email = _tmp12_;
	_tmp17_ = row;
	if (_tmp17_ != NULL) {
		ConversationListBoxEmailRow* _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		_tmp18_ = row;
		_tmp19_ = conversation_list_box_conversation_row_get_is_expanded (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
		_tmp20_ = _tmp19_;
		_tmp16_ = _tmp20_;
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		ConversationEmail* _tmp21_;
		ConversationEmailLoadState _tmp22_;
		ConversationEmailLoadState _tmp23_;
		_tmp21_ = view;
		_tmp22_ = conversation_email_get_message_body_state (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp15_ = _tmp23_ == CONVERSATION_EMAIL_LOAD_STATE_COMPLETED;
	} else {
		_tmp15_ = FALSE;
	}
	if (_tmp15_) {
		ConversationEmail* _tmp24_;
		gboolean _tmp25_;
		gboolean _tmp26_;
		_tmp24_ = view;
		_tmp25_ = conversation_email_get_is_manually_read (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp14_ = !_tmp26_;
	} else {
		_tmp14_ = FALSE;
	}
	if (_tmp14_) {
		GearyEmail* _tmp27_;
		_tmp27_ = email;
		_tmp13_ = geary_trillian_is_certain (geary_email_is_unread (_tmp27_));
	} else {
		_tmp13_ = FALSE;
	}
	if (_tmp13_) {
		ConversationMessage* conversation_message = NULL;
		ConversationEmail* _tmp28_;
		ConversationMessage* _tmp29_;
		ConversationMessage* _tmp30_;
		ConversationMessage* _tmp31_;
		gint body_top = 0;
		gint body_left = 0;
		ConversationMessage* _tmp32_;
		gint _tmp33_ = 0;
		gint _tmp34_ = 0;
		gint body_height = 0;
		ConversationMessage* _tmp35_;
		gint body_bottom = 0;
		gboolean _tmp36_ = FALSE;
		gboolean _tmp37_ = FALSE;
		_tmp28_ = view;
		_tmp29_ = conversation_email_get_primary_message (_tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = _g_object_ref0 (_tmp30_);
		conversation_message = _tmp31_;
		body_top = 0;
		body_left = 0;
		_tmp32_ = conversation_message;
		conversation_message_web_view_translate_coordinates (_tmp32_, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), 0, 0, &_tmp33_, &_tmp34_);
		body_left = _tmp33_;
		body_top = _tmp34_;
		_tmp35_ = conversation_message;
		body_height = conversation_message_web_view_get_allocated_height (_tmp35_);
		body_bottom = body_top + body_height;
		if (body_height > 0) {
			_tmp37_ = body_bottom > _data87_->top_bound;
		} else {
			_tmp37_ = FALSE;
		}
		if (_tmp37_) {
			_tmp36_ = (body_top + CONVERSATION_LIST_BOX_MARK_READ_PADDING) < _data87_->bottom_bound;
		} else {
			_tmp36_ = FALSE;
		}
		if (_tmp36_) {
			GeeList* _tmp38_;
			ConversationEmail* _tmp39_;
			GearyEmail* _tmp40_;
			GearyEmail* _tmp41_;
			GearyEmailIdentifier* _tmp42_;
			GearyEmailIdentifier* _tmp43_;
			ConversationEmail* _tmp44_;
			_tmp38_ = _data87_->email_ids;
			_tmp39_ = view;
			_tmp40_ = conversation_email_get_email (_tmp39_);
			_tmp41_ = _tmp40_;
			_tmp42_ = geary_email_get_id (_tmp41_);
			_tmp43_ = _tmp42_;
			gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, GEE_TYPE_COLLECTION, GeeCollection), _tmp43_);
			_tmp44_ = view;
			conversation_email_set_is_manually_read (_tmp44_, TRUE);
		}
		_g_object_unref0 (conversation_message);
	}
	_g_object_unref0 (email);
	_g_object_unref0 (view);
	_g_object_unref0 (row);
}

static void
___lambda133__gtk_callback (GtkWidget* widget,
                            gpointer self)
{
	__lambda133_ (self, widget);
}

static void
conversation_list_box_check_mark_read (ConversationListBox* self)
{
	Block87Data* _data87_;
	GeeLinkedList* _tmp0_;
	GtkAdjustment* adj = NULL;
	GtkAdjustment* _tmp1_;
	GtkAdjustment* _tmp2_;
	GtkAdjustment* _tmp3_;
	gdouble _tmp4_;
	gdouble _tmp5_;
	GtkAdjustment* _tmp6_;
	gdouble _tmp7_;
	gdouble _tmp8_;
	GeeList* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	_data87_ = g_slice_new0 (Block87Data);
	_data87_->_ref_count_ = 1;
	_data87_->self = g_object_ref (self);
	_tmp0_ = gee_linked_list_new (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data87_->email_ids = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST, GeeList);
	_tmp1_ = gtk_list_box_get_adjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox));
	_tmp2_ = _g_object_ref0 (_tmp1_);
	adj = _tmp2_;
	_tmp3_ = adj;
	_tmp4_ = gtk_adjustment_get_value (_tmp3_);
	_tmp5_ = _tmp4_;
	_data87_->top_bound = (gint) _tmp5_;
	_tmp6_ = adj;
	_tmp7_ = gtk_adjustment_get_page_size (_tmp6_);
	_tmp8_ = _tmp7_;
	_data87_->bottom_bound = _data87_->top_bound + ((gint) _tmp8_);
	gtk_container_foreach (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), ___lambda133__gtk_callback, _data87_);
	_tmp9_ = _data87_->email_ids;
	_tmp10_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp11_ = _tmp10_;
	if (_tmp11_ > 0) {
		GeeList* _tmp12_;
		GearyNamedFlag* _tmp13_;
		GearyNamedFlag* _tmp14_;
		GearyNamedFlag* _tmp15_;
		_tmp12_ = _data87_->email_ids;
		_tmp13_ = geary_email_flags_get_UNREAD ();
		_tmp14_ = _tmp13_;
		_tmp15_ = _tmp14_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL], 0, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_COLLECTION, GeeCollection), NULL, _tmp15_);
		_g_object_unref0 (_tmp15_);
	}
	_g_object_unref0 (adj);
	block87_data_unref (_data87_);
	_data87_ = NULL;
}

/**
     * Returns an new Iterable over all email views in the viewer
     */
static ConversationEmail*
__lambda145_ (ConversationListBox* self,
              ConversationListBoxEmailRow* row)
{
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	ConversationEmail* _tmp2_;
	ConversationEmail* result;
	g_return_val_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (row), NULL);
	_tmp0_ = conversation_list_box_email_row_get_view (G_TYPE_CHECK_INSTANCE_CAST (row, CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	result = _tmp2_;
	_g_object_unref0 (row);
	return result;
}

static gpointer
___lambda145__gee_map_func (gpointer g,
                            gpointer self)
{
	gpointer result;
	result = __lambda145_ ((ConversationListBox*) self, (ConversationListBoxEmailRow*) g);
	return result;
}

static GeeIterator*
conversation_list_box_email_view_iterator (ConversationListBox* self)
{
	GeeMap* _tmp0_;
	GeeCollection* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _tmp5_;
	GeeIterator* result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	_tmp0_ = self->priv->email_rows;
	_tmp1_ = gee_map_get_values (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_traversable_map (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_TRAVERSABLE, GeeTraversable), TYPE_CONVERSATION_EMAIL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, ___lambda145__gee_map_func, self);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp3_);
	result = _tmp5_;
	return result;
}

/**
     * Returns a new Iterable over all message views in the viewer
     */
static GeeIterator*
__lambda146_ (ConversationListBox* self,
              ConversationEmail* email_view)
{
	GeeIterator* _tmp0_;
	GeeIterator* result;
	g_return_val_if_fail (IS_CONVERSATION_EMAIL (email_view), NULL);
	_tmp0_ = conversation_email_iterator (email_view);
	result = _tmp0_;
	_g_object_unref0 (email_view);
	return result;
}

static gpointer
___lambda146__gee_map_func (gpointer g,
                            gpointer self)
{
	gpointer result;
	result = __lambda146_ ((ConversationListBox*) self, (ConversationEmail*) g);
	return result;
}

static GeeIterator*
conversation_list_box_message_view_iterator (ConversationListBox* self)
{
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	GeeIterator* _tmp2_;
	GeeIterator* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _tmp5_;
	GeeIterator* result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	_tmp0_ = conversation_list_box_email_view_iterator (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gee_traversable_map (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_TRAVERSABLE, GeeTraversable), GEE_TYPE_ITERATOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, ___lambda146__gee_map_func, self);
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_iterator_concat (TYPE_CONVERSATION_MESSAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	result = _tmp5_;
	return result;
}

/** Determines if an email should be expanded by default. */
static inline gboolean
conversation_list_box_is_interesting (ConversationListBox* self,
                                      GearyEmail* email)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL), FALSE);
	if (geary_trillian_is_certain (geary_email_is_unread (email))) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = geary_trillian_is_certain (geary_email_is_flagged (email));
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = conversation_list_box_is_draft (self, email);
	}
	result = _tmp0_;
	return result;
}

/** Determines if an email should be considered to be a draft. */
static inline gboolean
conversation_list_box_is_draft (ConversationListBox* self,
                                GearyEmail* email)
{
	GearyFolderSpecialUse use = 0;
	GearyAppConversation* _tmp0_;
	GearyFolder* _tmp1_;
	GearyFolder* _tmp2_;
	GearyFolderSpecialUse _tmp3_;
	GearyFolderSpecialUse _tmp4_;
	gboolean is_in_folder = FALSE;
	GearyAppConversation* _tmp5_;
	GearyEmailIdentifier* _tmp6_;
	GearyEmailIdentifier* _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL), FALSE);
	_tmp0_ = self->priv->_conversation;
	_tmp1_ = geary_app_conversation_get_base_folder (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = geary_folder_get_used_as (_tmp2_);
	_tmp4_ = _tmp3_;
	use = _tmp4_;
	_tmp5_ = self->priv->_conversation;
	_tmp6_ = geary_email_get_id (email);
	_tmp7_ = _tmp6_;
	is_in_folder = geary_app_conversation_is_in_base_folder (_tmp5_, _tmp7_);
	if (is_in_folder) {
		_tmp8_ = use == GEARY_FOLDER_SPECIAL_USE_DRAFTS;
	} else {
		_tmp8_ = FALSE;
	}
	result = _tmp8_;
	return result;
}

static ConversationEmail*
conversation_list_box_action_target_to_view (ConversationListBox* self,
                                             GVariant* target)
{
	GearyEmailIdentifier* id = NULL;
	ConversationListBoxEmailRow* _tmp10_ = NULL;
	GearyEmailIdentifier* _tmp11_;
	ConversationListBoxEmailRow* row = NULL;
	ConversationListBoxEmailRow* _tmp15_;
	ConversationEmail* _tmp16_ = NULL;
	ConversationListBoxEmailRow* _tmp17_;
	ConversationEmail* _tmp21_;
	GError* _inner_error0_ = NULL;
	ConversationEmail* result;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (self), NULL);
	g_return_val_if_fail (target != NULL, NULL);
	id = NULL;
	{
		GearyEmailIdentifier* _tmp0_ = NULL;
		GearyAppConversation* _tmp1_;
		GearyFolder* _tmp2_;
		GearyFolder* _tmp3_;
		GearyAccount* _tmp4_;
		GearyAccount* _tmp5_;
		GearyEmailIdentifier* _tmp6_;
		GearyEmailIdentifier* _tmp7_;
		_tmp1_ = self->priv->_conversation;
		_tmp2_ = geary_app_conversation_get_base_folder (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = geary_folder_get_account (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = geary_account_to_email_identifier (_tmp5_, target, &_inner_error0_);
		_tmp0_ = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == GEARY_ENGINE_ERROR) {
				goto __catch0_geary_engine_error;
			}
			_g_object_unref0 (id);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp7_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (id);
		id = _tmp7_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_geary_engine_error:
	{
		GError* err = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp8_ = err;
		_tmp9_ = _tmp8_->message;
		g_debug ("conversation-list-box.vala:1342: Failed to get email id for action tar" \
"get: %s", _tmp9_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (id);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp11_ = id;
	if (_tmp11_ != NULL) {
		GeeMap* _tmp12_;
		GearyEmailIdentifier* _tmp13_;
		gpointer _tmp14_;
		_tmp12_ = self->priv->email_rows;
		_tmp13_ = id;
		_tmp14_ = gee_map_get (_tmp12_, _tmp13_);
		_g_object_unref0 (_tmp10_);
		_tmp10_ = (ConversationListBoxEmailRow*) _tmp14_;
	} else {
		_g_object_unref0 (_tmp10_);
		_tmp10_ = NULL;
	}
	_tmp15_ = _g_object_ref0 (_tmp10_);
	row = _tmp15_;
	_tmp17_ = row;
	if (_tmp17_ != NULL) {
		ConversationListBoxEmailRow* _tmp18_;
		ConversationEmail* _tmp19_;
		ConversationEmail* _tmp20_;
		_tmp18_ = row;
		_tmp19_ = conversation_list_box_email_row_get_view (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp16_ = _tmp20_;
	} else {
		_tmp16_ = NULL;
	}
	_tmp21_ = _g_object_ref0 (_tmp16_);
	result = _tmp21_;
	_g_object_unref0 (row);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (id);
	return result;
}

static void
conversation_list_box_on_conversation_appended (ConversationListBox* self,
                                                GearyAppConversation* conversation,
                                                GearyEmail* email)
{
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (conversation, GEARY_APP_TYPE_CONVERSATION));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL));
	conversation_list_box_on_conversation_appended_async (self, conversation, email, NULL, NULL);
}

static void
conversation_list_box_on_conversation_appended_async_data_free (gpointer _data)
{
	ConversationListBoxOnConversationAppendedAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->conversation);
	_g_object_unref0 (_data_->part_email);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationListBoxOnConversationAppendedAsyncData, _data_);
}

static void
conversation_list_box_on_conversation_appended_async (ConversationListBox* self,
                                                      GearyAppConversation* conversation,
                                                      GearyEmail* part_email,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	ConversationListBoxOnConversationAppendedAsyncData* _data_;
	ConversationListBox* _tmp0_;
	GearyAppConversation* _tmp1_;
	GearyEmail* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (conversation, GEARY_APP_TYPE_CONVERSATION));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (part_email, GEARY_TYPE_EMAIL));
	_data_ = g_slice_new0 (ConversationListBoxOnConversationAppendedAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_on_conversation_appended_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (_data_->conversation);
	_data_->conversation = _tmp1_;
	_tmp2_ = _g_object_ref0 (part_email);
	_g_object_unref0 (_data_->part_email);
	_data_->part_email = _tmp2_;
	conversation_list_box_on_conversation_appended_async_co (_data_);
}

static void
conversation_list_box_on_conversation_appended_finish (ConversationListBox* self,
                                                       GAsyncResult* _res_)
{
	ConversationListBoxOnConversationAppendedAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
___lambda137_ (ConversationListBox* self,
               GObject* obj,
               GAsyncResult* ret)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (ret, g_async_result_get_type ()));
	{
		conversation_list_box_load_full_email_finish (self, ret, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = err;
		_tmp1_ = _tmp0_->message;
		g_debug ("conversation-list-box.vala:1363: Unable to append email to conversatio" \
"n: %s", _tmp1_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
____lambda137__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda137_ ((ConversationListBox*) self, source_object, res);
	g_object_unref (self);
}

static gboolean
conversation_list_box_on_conversation_appended_async_co (ConversationListBoxOnConversationAppendedAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->email_rows;
	_data_->_tmp2_ = geary_email_get_id (_data_->part_email);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (!gee_map_has_key (_data_->_tmp1_, _data_->_tmp3_)) {
		_data_->_tmp4_ = geary_email_get_id (_data_->part_email);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = _data_->self->priv->draft_id;
		_data_->_tmp0_ = _data_->_tmp5_ != _data_->_tmp6_;
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		_data_->_tmp7_ = geary_email_get_id (_data_->part_email);
		_data_->_tmp8_ = _data_->_tmp7_;
		conversation_list_box_load_full_email (_data_->self, _data_->_tmp8_, ____lambda137__gasync_ready_callback, g_object_ref (_data_->self));
	}
	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
conversation_list_box_on_conversation_trimmed (ConversationListBox* self,
                                               GearyEmail* email)
{
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL));
	conversation_list_box_remove_email (self, email);
}

static void
conversation_list_box_on_update_flags (ConversationListBox* self,
                                       GearyEmail* email)
{
	GeeMap* _tmp0_;
	GearyEmailIdentifier* _tmp1_;
	GearyEmailIdentifier* _tmp2_;
	ConversationListBoxEmailRow* row = NULL;
	GeeMap* _tmp3_;
	GearyEmailIdentifier* _tmp4_;
	GearyEmailIdentifier* _tmp5_;
	gpointer _tmp6_;
	ConversationListBoxEmailRow* _tmp7_;
	ConversationEmail* _tmp8_;
	ConversationEmail* _tmp9_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL));
	_tmp0_ = self->priv->email_rows;
	_tmp1_ = geary_email_get_id (email);
	_tmp2_ = _tmp1_;
	if (!gee_map_has_key (_tmp0_, _tmp2_)) {
		return;
	}
	_tmp3_ = self->priv->email_rows;
	_tmp4_ = geary_email_get_id (email);
	_tmp5_ = _tmp4_;
	_tmp6_ = gee_map_get (_tmp3_, _tmp5_);
	row = (ConversationListBoxEmailRow*) _tmp6_;
	_tmp7_ = row;
	_tmp8_ = conversation_list_box_email_row_get_view (_tmp7_);
	_tmp9_ = _tmp8_;
	conversation_email_update_flags (_tmp9_, email);
	_g_object_unref0 (row);
}

static void
conversation_list_box_on_message_body_state_notify (ConversationListBox* self,
                                                    GObject* obj,
                                                    GParamSpec* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ConversationEmail* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (param, G_TYPE_PARAM));
	_tmp0_ = _g_object_ref0 (IS_CONVERSATION_EMAIL (obj) ? ((ConversationEmail*) obj) : NULL);
	view = _tmp0_;
	_tmp2_ = view;
	if (_tmp2_ != NULL) {
		ConversationEmail* _tmp3_;
		ConversationEmailLoadState _tmp4_;
		ConversationEmailLoadState _tmp5_;
		_tmp3_ = view;
		_tmp4_ = conversation_email_get_message_body_state (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ == CONVERSATION_EMAIL_LOAD_STATE_COMPLETED;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		if (!self->priv->suppress_mark_timer) {
			GearyTimeoutManager* _tmp6_;
			_tmp6_ = self->priv->mark_read_timer;
			geary_timeout_manager_start (_tmp6_);
		}
		self->priv->suppress_mark_timer = FALSE;
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_row_activated (ConversationListBox* self,
                                        GtkListBoxRow* widget)
{
	ConversationListBoxEmailRow* row = NULL;
	ConversationListBoxEmailRow* _tmp0_;
	ConversationListBoxEmailRow* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (widget, gtk_list_box_row_get_type ()));
	_tmp0_ = _g_object_ref0 (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (widget) ? ((ConversationListBoxEmailRow*) widget) : NULL);
	row = _tmp0_;
	_tmp1_ = row;
	if (_tmp1_ != NULL) {
		ConversationListBoxEmailRow* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = row;
		_tmp3_ = conversation_list_box_conversation_row_get_is_expanded (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
		_tmp4_ = _tmp3_;
		if (_tmp4_) {
			ConversationListBoxEmailRow* _tmp5_;
			GtkListBoxRow* _tmp6_;
			_tmp5_ = row;
			_tmp6_ = gtk_list_box_get_row_at_index (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_get_type (), GtkListBox), gtk_list_box_row_get_index (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_list_box_row_get_type (), GtkListBoxRow)) + 1);
			if (_tmp6_ != NULL) {
				ConversationListBoxEmailRow* _tmp7_;
				_tmp7_ = row;
				conversation_list_box_conversation_row_collapse (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
			}
		} else {
			ConversationListBoxEmailRow* _tmp8_;
			_tmp8_ = row;
			conversation_list_box_conversation_row_expand (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), NULL, NULL);
		}
	}
	_g_object_unref0 (row);
}

static void
conversation_list_box_on_internal_link_activated (ConversationListBox* self,
                                                  ConversationEmail* email,
                                                  gint y)
{
	ConversationListBoxEmailRow* row = NULL;
	GearyEmail* _tmp0_;
	GearyEmail* _tmp1_;
	GearyEmailIdentifier* _tmp2_;
	GearyEmailIdentifier* _tmp3_;
	ConversationListBoxEmailRow* _tmp4_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (IS_CONVERSATION_EMAIL (email));
	_tmp0_ = conversation_email_get_email (email);
	_tmp1_ = _tmp0_;
	_tmp2_ = geary_email_get_id (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = conversation_list_box_get_email_row_by_id (self, _tmp3_);
	row = _tmp4_;
	conversation_list_box_scroll_to_anchor (self, row, y);
	_g_object_unref0 (row);
}

static Block88Data*
block88_data_ref (Block88Data* _data88_)
{
	g_atomic_int_inc (&_data88_->_ref_count_);
	return _data88_;
}

static void
block88_data_unref (void * _userdata_)
{
	Block88Data* _data88_;
	_data88_ = (Block88Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data88_->_ref_count_)) {
		ConversationListBox* self;
		self = _data88_->self;
		_g_object_unref0 (_data88_->view);
		_g_object_unref0 (self);
		g_slice_free (Block88Data, _data88_);
	}
}

static void
___lambda132_ (Block88Data* _data88_,
               GObject* obj,
               GAsyncResult* res)
{
	ConversationListBox* self;
	gchar* quote = NULL;
	ConversationEmail* _tmp0_;
	gchar* _tmp1_;
	ConversationEmail* _tmp2_;
	GearyEmail* _tmp3_;
	GearyEmail* _tmp4_;
	self = _data88_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	_tmp0_ = _data88_->view;
	_tmp1_ = conversation_email_get_selection_for_quoting_finish (_tmp0_, res);
	quote = _tmp1_;
	_tmp2_ = _data88_->view;
	_tmp3_ = conversation_email_get_email (_tmp2_);
	_tmp4_ = _tmp3_;
	g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_REPLY_TO_SENDER_EMAIL_SIGNAL], 0, _tmp4_, quote);
	_g_free0 (quote);
}

static void
____lambda132__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda132_ (self, source_object, res);
	block88_data_unref (self);
}

static void
conversation_list_box_on_email_reply_sender (ConversationListBox* self,
                                             GSimpleAction* action,
                                             GVariant* param)
{
	Block88Data* _data88_;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_data88_ = g_slice_new0 (Block88Data);
	_data88_->_ref_count_ = 1;
	_data88_->self = g_object_ref (self);
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	_data88_->view = _tmp0_;
	_tmp1_ = _data88_->view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		_tmp2_ = _data88_->view;
		conversation_email_get_selection_for_quoting (_tmp2_, ____lambda132__gasync_ready_callback, block88_data_ref (_data88_));
	}
	block88_data_unref (_data88_);
	_data88_ = NULL;
}

static Block89Data*
block89_data_ref (Block89Data* _data89_)
{
	g_atomic_int_inc (&_data89_->_ref_count_);
	return _data89_;
}

static void
block89_data_unref (void * _userdata_)
{
	Block89Data* _data89_;
	_data89_ = (Block89Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data89_->_ref_count_)) {
		ConversationListBox* self;
		self = _data89_->self;
		_g_object_unref0 (_data89_->view);
		_g_object_unref0 (self);
		g_slice_free (Block89Data, _data89_);
	}
}

static void
___lambda131_ (Block89Data* _data89_,
               GObject* obj,
               GAsyncResult* res)
{
	ConversationListBox* self;
	gchar* quote = NULL;
	ConversationEmail* _tmp0_;
	gchar* _tmp1_;
	ConversationEmail* _tmp2_;
	GearyEmail* _tmp3_;
	GearyEmail* _tmp4_;
	self = _data89_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	_tmp0_ = _data89_->view;
	_tmp1_ = conversation_email_get_selection_for_quoting_finish (_tmp0_, res);
	quote = _tmp1_;
	_tmp2_ = _data89_->view;
	_tmp3_ = conversation_email_get_email (_tmp2_);
	_tmp4_ = _tmp3_;
	g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_REPLY_TO_ALL_EMAIL_SIGNAL], 0, _tmp4_, quote);
	_g_free0 (quote);
}

static void
____lambda131__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda131_ (self, source_object, res);
	block89_data_unref (self);
}

static void
conversation_list_box_on_email_reply_all (ConversationListBox* self,
                                          GSimpleAction* action,
                                          GVariant* param)
{
	Block89Data* _data89_;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_data89_ = g_slice_new0 (Block89Data);
	_data89_->_ref_count_ = 1;
	_data89_->self = g_object_ref (self);
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	_data89_->view = _tmp0_;
	_tmp1_ = _data89_->view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		_tmp2_ = _data89_->view;
		conversation_email_get_selection_for_quoting (_tmp2_, ____lambda131__gasync_ready_callback, block89_data_ref (_data89_));
	}
	block89_data_unref (_data89_);
	_data89_ = NULL;
}

static Block90Data*
block90_data_ref (Block90Data* _data90_)
{
	g_atomic_int_inc (&_data90_->_ref_count_);
	return _data90_;
}

static void
block90_data_unref (void * _userdata_)
{
	Block90Data* _data90_;
	_data90_ = (Block90Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data90_->_ref_count_)) {
		ConversationListBox* self;
		self = _data90_->self;
		_g_object_unref0 (_data90_->view);
		_g_object_unref0 (self);
		g_slice_free (Block90Data, _data90_);
	}
}

static void
___lambda129_ (Block90Data* _data90_,
               GObject* obj,
               GAsyncResult* res)
{
	ConversationListBox* self;
	gchar* quote = NULL;
	ConversationEmail* _tmp0_;
	gchar* _tmp1_;
	ConversationEmail* _tmp2_;
	GearyEmail* _tmp3_;
	GearyEmail* _tmp4_;
	self = _data90_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	_tmp0_ = _data90_->view;
	_tmp1_ = conversation_email_get_selection_for_quoting_finish (_tmp0_, res);
	quote = _tmp1_;
	_tmp2_ = _data90_->view;
	_tmp3_ = conversation_email_get_email (_tmp2_);
	_tmp4_ = _tmp3_;
	g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_FORWARD_EMAIL_SIGNAL], 0, _tmp4_, quote);
	_g_free0 (quote);
}

static void
____lambda129__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda129_ (self, source_object, res);
	block90_data_unref (self);
}

static void
conversation_list_box_on_email_forward (ConversationListBox* self,
                                        GSimpleAction* action,
                                        GVariant* param)
{
	Block90Data* _data90_;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_data90_ = g_slice_new0 (Block90Data);
	_data90_->_ref_count_ = 1;
	_data90_->self = g_object_ref (self);
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	_data90_->view = _tmp0_;
	_tmp1_ = _data90_->view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		_tmp2_ = _data90_->view;
		conversation_email_get_selection_for_quoting (_tmp2_, ____lambda129__gasync_ready_callback, block90_data_ref (_data90_));
	}
	block90_data_unref (_data90_);
	_data90_ = NULL;
}

static void
conversation_list_box_on_email_mark_read (ConversationListBox* self,
                                          GSimpleAction* action,
                                          GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		GearyEmailIdentifier* _tmp5_;
		GearyEmailIdentifier* _tmp6_;
		GeeCollection* _tmp7_;
		GeeCollection* _tmp8_;
		GearyNamedFlag* _tmp9_;
		GearyNamedFlag* _tmp10_;
		GearyNamedFlag* _tmp11_;
		_tmp2_ = view;
		_tmp3_ = conversation_email_get_email (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = geary_email_get_id (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = geary_collection_single (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = geary_email_flags_get_UNREAD ();
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL], 0, _tmp8_, NULL, _tmp11_);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (_tmp8_);
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_mark_unread (ConversationListBox* self,
                                            GSimpleAction* action,
                                            GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		GearyEmailIdentifier* _tmp5_;
		GearyEmailIdentifier* _tmp6_;
		GeeCollection* _tmp7_;
		GeeCollection* _tmp8_;
		GearyNamedFlag* _tmp9_;
		GearyNamedFlag* _tmp10_;
		GearyNamedFlag* _tmp11_;
		_tmp2_ = view;
		_tmp3_ = conversation_email_get_email (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = geary_email_get_id (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = geary_collection_single (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = geary_email_flags_get_UNREAD ();
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL], 0, _tmp8_, _tmp11_, NULL);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (_tmp8_);
	}
	_g_object_unref0 (view);
}

static Block91Data*
block91_data_ref (Block91Data* _data91_)
{
	g_atomic_int_inc (&_data91_->_ref_count_);
	return _data91_;
}

static void
block91_data_unref (void * _userdata_)
{
	Block91Data* _data91_;
	_data91_ = (Block91Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data91_->_ref_count_)) {
		ConversationListBox* self;
		self = _data91_->self;
		_g_object_unref0 (_data91_->ids);
		_g_object_unref0 (_data91_->email);
		_g_object_unref0 (self);
		g_slice_free (Block91Data, _data91_);
	}
}

static void
___lambda130_ (Block91Data* _data91_,
               GtkWidget* row)
{
	ConversationListBox* self;
	self = _data91_->self;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (row, gtk_widget_get_type ()));
	if (gtk_widget_get_visible (row)) {
		GearyEmail* other = NULL;
		ConversationEmail* _tmp0_;
		ConversationEmail* _tmp1_;
		GearyEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		GearyEmail* _tmp5_;
		GearyEmail* _tmp6_;
		_tmp0_ = conversation_list_box_email_row_get_view (G_TYPE_CHECK_INSTANCE_CAST (row, CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRow));
		_tmp1_ = _tmp0_;
		_tmp2_ = conversation_email_get_email (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		other = _tmp4_;
		_tmp5_ = _data91_->email;
		_tmp6_ = other;
		if (geary_email_compare_sent_date_ascending (_tmp5_, _tmp6_) < 0) {
			GeeLinkedList* _tmp7_;
			GearyEmail* _tmp8_;
			GearyEmailIdentifier* _tmp9_;
			GearyEmailIdentifier* _tmp10_;
			_tmp7_ = _data91_->ids;
			_tmp8_ = other;
			_tmp9_ = geary_email_get_id (_tmp8_);
			_tmp10_ = _tmp9_;
			gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp10_);
		}
		_g_object_unref0 (other);
	}
}

static void
____lambda130__gtk_callback (GtkWidget* widget,
                             gpointer self)
{
	___lambda130_ (self, widget);
}

static void
conversation_list_box_on_email_mark_unread_down (ConversationListBox* self,
                                                 GSimpleAction* action,
                                                 GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		Block91Data* _data91_;
		ConversationEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		GearyEmail* _tmp5_;
		GeeLinkedList* _tmp6_;
		GeeLinkedList* _tmp7_;
		GearyEmail* _tmp8_;
		GearyEmailIdentifier* _tmp9_;
		GearyEmailIdentifier* _tmp10_;
		GeeLinkedList* _tmp11_;
		GearyNamedFlag* _tmp12_;
		GearyNamedFlag* _tmp13_;
		GearyNamedFlag* _tmp14_;
		_data91_ = g_slice_new0 (Block91Data);
		_data91_->_ref_count_ = 1;
		_data91_->self = g_object_ref (self);
		_tmp2_ = view;
		_tmp3_ = conversation_email_get_email (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_data91_->email = _tmp5_;
		_tmp6_ = gee_linked_list_new (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
		_data91_->ids = _tmp6_;
		_tmp7_ = _data91_->ids;
		_tmp8_ = _data91_->email;
		_tmp9_ = geary_email_get_id (_tmp8_);
		_tmp10_ = _tmp9_;
		gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp10_);
		gtk_container_foreach (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), ____lambda130__gtk_callback, _data91_);
		_tmp11_ = _data91_->ids;
		_tmp12_ = geary_email_flags_get_UNREAD ();
		_tmp13_ = _tmp12_;
		_tmp14_ = _tmp13_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL], 0, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_COLLECTION, GeeCollection), _tmp14_, NULL);
		_g_object_unref0 (_tmp14_);
		block91_data_unref (_data91_);
		_data91_ = NULL;
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_mark_starred (ConversationListBox* self,
                                             GSimpleAction* action,
                                             GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		GearyEmailIdentifier* _tmp5_;
		GearyEmailIdentifier* _tmp6_;
		GeeCollection* _tmp7_;
		GeeCollection* _tmp8_;
		GearyNamedFlag* _tmp9_;
		GearyNamedFlag* _tmp10_;
		GearyNamedFlag* _tmp11_;
		_tmp2_ = view;
		_tmp3_ = conversation_email_get_email (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = geary_email_get_id (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = geary_collection_single (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = geary_email_flags_get_FLAGGED ();
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL], 0, _tmp8_, _tmp11_, NULL);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (_tmp8_);
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_mark_unstarred (ConversationListBox* self,
                                               GSimpleAction* action,
                                               GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		GearyEmailIdentifier* _tmp5_;
		GearyEmailIdentifier* _tmp6_;
		GeeCollection* _tmp7_;
		GeeCollection* _tmp8_;
		GearyNamedFlag* _tmp9_;
		GearyNamedFlag* _tmp10_;
		GearyNamedFlag* _tmp11_;
		_tmp2_ = view;
		_tmp3_ = conversation_email_get_email (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = geary_email_get_id (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = geary_collection_single (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = geary_email_flags_get_FLAGGED ();
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL], 0, _tmp8_, NULL, _tmp11_);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (_tmp8_);
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_load_remote (ConversationListBox* self,
                                            GSimpleAction* action,
                                            GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		GearyEmailIdentifier* _tmp5_;
		GearyEmailIdentifier* _tmp6_;
		GeeCollection* _tmp7_;
		GeeCollection* _tmp8_;
		GearyNamedFlag* _tmp9_;
		GearyNamedFlag* _tmp10_;
		GearyNamedFlag* _tmp11_;
		_tmp2_ = view;
		_tmp3_ = conversation_email_get_email (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = geary_email_get_id (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = geary_collection_single (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = geary_email_flags_get_LOAD_REMOTE_IMAGES ();
		_tmp10_ = _tmp9_;
		_tmp11_ = _tmp10_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL], 0, _tmp8_, _tmp11_, NULL);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (_tmp8_);
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_trash (ConversationListBox* self,
                                      GSimpleAction* action,
                                      GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		_tmp2_ = view;
		_tmp3_ = conversation_email_get_email (_tmp2_);
		_tmp4_ = _tmp3_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_TRASH_EMAIL_SIGNAL], 0, _tmp4_);
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_delete (ConversationListBox* self,
                                       GSimpleAction* action,
                                       GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		GearyEmail* _tmp3_;
		GearyEmail* _tmp4_;
		_tmp2_ = view;
		_tmp3_ = conversation_email_get_email (_tmp2_);
		_tmp4_ = _tmp3_;
		g_signal_emit (self, conversation_list_box_signals[CONVERSATION_LIST_BOX_DELETE_EMAIL_SIGNAL], 0, _tmp4_);
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_save_all_attachments (ConversationListBox* self,
                                                     GSimpleAction* action,
                                                     GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	gboolean _tmp1_ = FALSE;
	ConversationEmail* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp2_ = view;
	if (_tmp2_ != NULL) {
		ConversationEmail* _tmp3_;
		ComponentsAttachmentPane* _tmp4_;
		ComponentsAttachmentPane* _tmp5_;
		_tmp3_ = view;
		_tmp4_ = conversation_email_get_attachments_pane (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ConversationEmail* _tmp6_;
		ComponentsAttachmentPane* _tmp7_;
		ComponentsAttachmentPane* _tmp8_;
		_tmp6_ = view;
		_tmp7_ = conversation_email_get_attachments_pane (_tmp6_);
		_tmp8_ = _tmp7_;
		components_attachment_pane_save_all (_tmp8_);
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_print (ConversationListBox* self,
                                      GSimpleAction* action,
                                      GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		_tmp2_ = view;
		conversation_email_print (_tmp2_, NULL, NULL);
	}
	_g_object_unref0 (view);
}

static void
conversation_list_box_on_email_view_source (ConversationListBox* self,
                                            GSimpleAction* action,
                                            GVariant* param)
{
	ConversationEmail* view = NULL;
	ConversationEmail* _tmp0_;
	ConversationEmail* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_LIST_BOX (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = conversation_list_box_action_target_to_view (self, param);
	view = _tmp0_;
	_tmp1_ = view;
	if (_tmp1_ != NULL) {
		ConversationEmail* _tmp2_;
		_tmp2_ = view;
		conversation_email_view_source (_tmp2_, NULL, NULL);
	}
	_g_object_unref0 (view);
}

static inline gpointer
conversation_list_box_search_manager_get_instance_private (ConversationListBoxSearchManager* self)
{
	return G_STRUCT_MEMBER_P (self, ConversationListBoxSearchManager_private_offset);
}

ConversationListBoxSearchManager*
conversation_list_box_search_manager_construct (GType object_type,
                                                ConversationListBox* list,
                                                GearyAppConversation* conversation)
{
	ConversationListBoxSearchManager * self = NULL;
	GearyAppConversation* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_LIST_BOX (list), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (conversation, GEARY_APP_TYPE_CONVERSATION), NULL);
	self = (ConversationListBoxSearchManager*) geary_base_object_construct (object_type);
	self->priv->list = list;
	_tmp0_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->conversation);
	self->priv->conversation = _tmp0_;
	return self;
}

ConversationListBoxSearchManager*
conversation_list_box_search_manager_new (ConversationListBox* list,
                                          GearyAppConversation* conversation)
{
	return conversation_list_box_search_manager_construct (CONVERSATION_LIST_BOX_TYPE_SEARCH_MANAGER, list, conversation);
}

static void
conversation_list_box_search_manager_highlight_matching_email_data_free (gpointer _data)
{
	ConversationListBoxSearchManagerHighlightMatchingEmailData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->query);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationListBoxSearchManagerHighlightMatchingEmailData, _data_);
}

void
conversation_list_box_search_manager_highlight_matching_email (ConversationListBoxSearchManager* self,
                                                               GearySearchQuery* query,
                                                               gboolean enable_scroll,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	ConversationListBoxSearchManagerHighlightMatchingEmailData* _data_;
	ConversationListBoxSearchManager* _tmp0_;
	GearySearchQuery* _tmp1_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_SEARCH_MANAGER (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (query, GEARY_TYPE_SEARCH_QUERY));
	_data_ = g_slice_new0 (ConversationListBoxSearchManagerHighlightMatchingEmailData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_search_manager_highlight_matching_email_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (query);
	_g_object_unref0 (_data_->query);
	_data_->query = _tmp1_;
	_data_->enable_scroll = enable_scroll;
	conversation_list_box_search_manager_highlight_matching_email_co (_data_);
}

void
conversation_list_box_search_manager_highlight_matching_email_finish (ConversationListBoxSearchManager* self,
                                                                      GAsyncResult* _res_,
                                                                      GError** error)
{
	ConversationListBoxSearchManagerHighlightMatchingEmailData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
         * Loads search term matches for this list's emails.
         */
static void
conversation_list_box_search_manager_highlight_matching_email_ready (GObject* source_object,
                                                                     GAsyncResult* _res_,
                                                                     gpointer _user_data_)
{
	ConversationListBoxSearchManagerHighlightMatchingEmailData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_list_box_search_manager_highlight_matching_email_co (_data_);
}

static gboolean
conversation_list_box_search_manager_highlight_matching_email_co (ConversationListBoxSearchManagerHighlightMatchingEmailData* _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:
	conversation_list_box_search_manager_cancel (_data_->self);
	_data_->_tmp0_ = _data_->self->priv->highlight_cancellable;
	_data_->_tmp1_ = _g_object_ref0 (_data_->_tmp0_);
	_data_->cancellable = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->self->priv->conversation;
	_data_->_tmp3_ = geary_app_conversation_get_base_folder (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = geary_folder_get_account (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _g_object_ref0 (_data_->_tmp6_);
	_data_->account = _data_->_tmp7_;
	_data_->_tmp8_ = _data_->account;
	_data_->_tmp9_ = _data_->self->priv->conversation;
	_data_->_tmp10_ = _data_->self->priv->conversation;
	_data_->_tmp11_ = geary_app_conversation_get_email_ids (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = _data_->cancellable;
	_data_->_state_ = 1;
	geary_account_local_search_async (_data_->_tmp8_, _data_->query, geary_app_conversation_get_count (_data_->_tmp9_), 0, NULL, _data_->_tmp12_, _data_->_tmp13_, conversation_list_box_search_manager_highlight_matching_email_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp14_ = geary_account_local_search_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_g_object_unref0 (_data_->_tmp12_);
	_data_->matching = _data_->_tmp15_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->account);
		_g_object_unref0 (_data_->cancellable);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp16_ = _data_->matching;
	if (_data_->_tmp16_ != NULL) {
		_data_->_tmp17_ = _data_->account;
		_data_->_tmp18_ = _data_->matching;
		_data_->_tmp19_ = _data_->cancellable;
		_data_->_state_ = 2;
		geary_account_get_search_matches_async (_data_->_tmp17_, _data_->query, _data_->_tmp18_, _data_->_tmp19_, conversation_list_box_search_manager_highlight_matching_email_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp20_ = geary_account_get_search_matches_finish (_data_->_tmp17_, _data_->_res_, &_data_->_inner_error0_);
		_data_->terms = _data_->_tmp20_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->matching);
			_g_object_unref0 (_data_->account);
			_g_object_unref0 (_data_->cancellable);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp21_ = _data_->cancellable;
		if (g_cancellable_is_cancelled (_data_->_tmp21_)) {
			_data_->_tmp22_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Search term highlighting cancelled");
			_data_->_inner_error0_ = _data_->_tmp22_;
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->terms);
			_g_object_unref0 (_data_->matching);
			_g_object_unref0 (_data_->account);
			_g_object_unref0 (_data_->cancellable);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp24_ = _data_->terms;
		if (_data_->_tmp24_ != NULL) {
			_data_->_tmp25_ = _data_->terms;
			_data_->_tmp26_ = gee_collection_get_is_empty (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp25_, GEE_TYPE_COLLECTION, GeeCollection));
			_data_->_tmp27_ = _data_->_tmp26_;
			_data_->_tmp23_ = !_data_->_tmp27_;
		} else {
			_data_->_tmp23_ = FALSE;
		}
		if (_data_->_tmp23_) {
			_data_->_tmp28_ = _data_->terms;
			_data_->_tmp29_ = _g_object_ref0 (_data_->_tmp28_);
			_g_object_unref0 (_data_->self->priv->terms);
			_data_->self->priv->terms = _data_->_tmp29_;
			_data_->first = NULL;
			{
				_data_->_tmp30_ = _data_->matching;
				_data_->_tmp31_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp30_, GEE_TYPE_ITERABLE, GeeIterable));
				_data_->_id_it = _data_->_tmp31_;
				while (TRUE) {
					_data_->_tmp32_ = _data_->_id_it;
					if (!gee_iterator_next (_data_->_tmp32_)) {
						break;
					}
					_data_->_tmp33_ = _data_->_id_it;
					_data_->_tmp34_ = gee_iterator_get (_data_->_tmp33_);
					_data_->id = (GearyEmailIdentifier*) _data_->_tmp34_;
					_data_->_tmp35_ = _data_->self->priv->list;
					_data_->_tmp36_ = _data_->id;
					_data_->_tmp37_ = conversation_list_box_get_email_row_by_id (_data_->_tmp35_, _data_->_tmp36_);
					_data_->row = _data_->_tmp37_;
					_data_->_tmp39_ = _data_->row;
					if (_data_->_tmp39_ != NULL) {
						_data_->_tmp41_ = _data_->first;
						if (_data_->_tmp41_ == NULL) {
							_data_->_tmp40_ = TRUE;
						} else {
							_data_->_tmp42_ = _data_->row;
							_data_->_tmp43_ = _data_->first;
							_data_->_tmp40_ = gtk_list_box_row_get_index (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp42_, gtk_list_box_row_get_type (), GtkListBoxRow)) < gtk_list_box_row_get_index (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp43_, gtk_list_box_row_get_type (), GtkListBoxRow));
						}
						_data_->_tmp38_ = _data_->_tmp40_;
					} else {
						_data_->_tmp38_ = FALSE;
					}
					if (_data_->_tmp38_) {
						_data_->_tmp44_ = _data_->row;
						_data_->_tmp45_ = _g_object_ref0 (_data_->_tmp44_);
						_g_object_unref0 (_data_->first);
						_data_->first = _data_->_tmp45_;
					}
					_g_object_unref0 (_data_->row);
					_g_object_unref0 (_data_->id);
				}
				_g_object_unref0 (_data_->_id_it);
			}
			_data_->_tmp47_ = _data_->first;
			if (_data_->_tmp47_ != NULL) {
				_data_->_tmp46_ = _data_->enable_scroll;
			} else {
				_data_->_tmp46_ = FALSE;
			}
			if (_data_->_tmp46_) {
				_data_->_tmp48_ = _data_->self->priv->list;
				_data_->_tmp49_ = _data_->first;
				conversation_list_box_scroll_to_row (_data_->_tmp48_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp49_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
			}
			{
				_data_->_tmp50_ = _data_->matching;
				_data_->_tmp51_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp50_, GEE_TYPE_ITERABLE, GeeIterable));
				_data_->_vala1__id_it = _data_->_tmp51_;
				while (TRUE) {
					_data_->_tmp52_ = _data_->_vala1__id_it;
					if (!gee_iterator_next (_data_->_tmp52_)) {
						break;
					}
					_data_->_tmp53_ = _data_->_vala1__id_it;
					_data_->_tmp54_ = gee_iterator_get (_data_->_tmp53_);
					_data_->_vala1_id = (GearyEmailIdentifier*) _data_->_tmp54_;
					_data_->_tmp55_ = _data_->self->priv->list;
					_data_->_tmp56_ = _data_->_vala1_id;
					_data_->_tmp57_ = conversation_list_box_get_email_row_by_id (_data_->_tmp55_, _data_->_tmp56_);
					_data_->_vala1_row = _data_->_tmp57_;
					_data_->_tmp58_ = _data_->_vala1_row;
					if (_data_->_tmp58_ != NULL) {
						_data_->_tmp59_ = _data_->_vala1_row;
						_data_->_tmp60_ = _data_->terms;
						_data_->_tmp61_ = _data_->cancellable;
						conversation_list_box_search_manager_apply_terms (_data_->self, _data_->_tmp59_, _data_->_tmp60_, _data_->_tmp61_);
						_data_->_tmp62_ = _data_->_vala1_row;
						conversation_list_box_conversation_row_expand (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp62_, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), NULL, NULL);
					}
					_g_object_unref0 (_data_->_vala1_row);
					_g_object_unref0 (_data_->_vala1_id);
				}
				_g_object_unref0 (_data_->_vala1__id_it);
			}
			_g_object_unref0 (_data_->first);
		}
		_g_object_unref0 (_data_->terms);
	}
	_g_object_unref0 (_data_->matching);
	_g_object_unref0 (_data_->account);
	_g_object_unref0 (_data_->cancellable);
	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;
}

/**
         * Highlights matching terms in the given email row, if any.
         */
void
conversation_list_box_search_manager_highlight_row_if_matching (ConversationListBoxSearchManager* self,
                                                                ConversationListBoxEmailRow* row)
{
	GeeSet* _tmp0_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_SEARCH_MANAGER (self));
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (row));
	_tmp0_ = self->priv->terms;
	if (_tmp0_ != NULL) {
		GeeSet* _tmp1_;
		GCancellable* _tmp2_;
		_tmp1_ = self->priv->terms;
		_tmp2_ = self->priv->highlight_cancellable;
		conversation_list_box_search_manager_apply_terms (self, row, _tmp1_, _tmp2_);
	}
}

/**
         * Removes search term highlighting from all messages.
         */
static void
__lambda128_ (ConversationListBoxSearchManager* self,
              GtkWidget* child)
{
	ConversationListBoxEmailRow* row = NULL;
	ConversationListBoxEmailRow* _tmp0_;
	ConversationListBoxEmailRow* _tmp1_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_widget_get_type ()));
	_tmp0_ = _g_object_ref0 (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (child) ? ((ConversationListBoxEmailRow*) child) : NULL);
	row = _tmp0_;
	_tmp1_ = row;
	if (_tmp1_ != NULL) {
		ConversationListBoxEmailRow* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = row;
		_tmp3_ = conversation_list_box_email_row_get_is_search_match (_tmp2_);
		_tmp4_ = _tmp3_;
		if (_tmp4_) {
			ConversationListBoxEmailRow* _tmp5_;
			_tmp5_ = row;
			conversation_list_box_email_row_set_is_search_match (_tmp5_, FALSE);
			{
				GeeIterator* _msg_view_it = NULL;
				ConversationListBoxEmailRow* _tmp6_;
				ConversationEmail* _tmp7_;
				ConversationEmail* _tmp8_;
				GeeIterator* _tmp9_;
				_tmp6_ = row;
				_tmp7_ = conversation_list_box_email_row_get_view (_tmp6_);
				_tmp8_ = _tmp7_;
				_tmp9_ = conversation_email_iterator (_tmp8_);
				_msg_view_it = _tmp9_;
				while (TRUE) {
					GeeIterator* _tmp10_;
					ConversationMessage* msg_view = NULL;
					GeeIterator* _tmp11_;
					gpointer _tmp12_;
					ConversationMessage* _tmp13_;
					_tmp10_ = _msg_view_it;
					if (!gee_iterator_next (_tmp10_)) {
						break;
					}
					_tmp11_ = _msg_view_it;
					_tmp12_ = gee_iterator_get (_tmp11_);
					msg_view = (ConversationMessage*) _tmp12_;
					_tmp13_ = msg_view;
					conversation_message_unmark_search_terms (_tmp13_);
					_g_object_unref0 (msg_view);
				}
				_g_object_unref0 (_msg_view_it);
			}
		}
	}
	_g_object_unref0 (row);
}

static void
___lambda128__gtk_callback (GtkWidget* widget,
                            gpointer self)
{
	__lambda128_ ((ConversationListBoxSearchManager*) self, widget);
}

void
conversation_list_box_search_manager_unmark_terms (ConversationListBoxSearchManager* self)
{
	ConversationListBox* _tmp0_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_SEARCH_MANAGER (self));
	conversation_list_box_search_manager_cancel (self);
	_tmp0_ = self->priv->list;
	gtk_container_foreach (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_container_get_type (), GtkContainer), ___lambda128__gtk_callback, self);
}

void
conversation_list_box_search_manager_cancel (ConversationListBoxSearchManager* self)
{
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_SEARCH_MANAGER (self));
	_tmp0_ = self->priv->highlight_cancellable;
	g_cancellable_cancel (_tmp0_);
	_tmp1_ = g_cancellable_new ();
	_g_object_unref0 (self->priv->highlight_cancellable);
	self->priv->highlight_cancellable = _tmp1_;
	_g_object_unref0 (self->priv->terms);
	self->priv->terms = NULL;
	self->priv->matches_found = (guint) 0;
	conversation_list_box_search_manager_notify_matches_updated (self);
}

static Block92Data*
block92_data_ref (Block92Data* _data92_)
{
	g_atomic_int_inc (&_data92_->_ref_count_);
	return _data92_;
}

static void
block92_data_unref (void * _userdata_)
{
	Block92Data* _data92_;
	_data92_ = (Block92Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data92_->_ref_count_)) {
		ConversationListBoxSearchManager* self;
		self = _data92_->self;
		_g_object_unref0 (_data92_->row);
		_g_object_unref0 (_data92_->terms);
		_g_object_unref0 (_data92_->cancellable);
		_g_object_unref0 (self);
		g_slice_free (Block92Data, _data92_);
	}
}

static void
_conversation_list_box_search_manager_apply_terms_impl_finished_gasync_ready_callback (GObject* source_object,
                                                                                       GAsyncResult* res,
                                                                                       gpointer self)
{
	conversation_list_box_search_manager_apply_terms_impl_finished ((ConversationListBoxSearchManager*) self, source_object, res);
	g_object_unref (self);
}

static void
___lambda127_ (Block92Data* _data92_)
{
	ConversationListBoxSearchManager* self;
	self = _data92_->self;
	conversation_list_box_search_manager_apply_terms_impl (self, _data92_->row, _data92_->terms, _data92_->cancellable, _conversation_list_box_search_manager_apply_terms_impl_finished_gasync_ready_callback, g_object_ref (self));
}

static void
____lambda127__g_object_notify (GObject* _sender,
                                GParamSpec* pspec,
                                gpointer self)
{
	___lambda127_ (self);
}

static void
conversation_list_box_search_manager_apply_terms (ConversationListBoxSearchManager* self,
                                                  ConversationListBoxEmailRow* row,
                                                  GeeSet* terms,
                                                  GCancellable* cancellable)
{
	Block92Data* _data92_;
	ConversationListBoxEmailRow* _tmp0_;
	GeeSet* _tmp1_;
	GCancellable* _tmp2_;
	ConversationEmail* _tmp3_;
	ConversationEmail* _tmp4_;
	ConversationEmailLoadState _tmp5_;
	ConversationEmailLoadState _tmp6_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_SEARCH_MANAGER (self));
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (row));
	g_return_if_fail ((terms == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (terms, GEE_TYPE_SET));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data92_ = g_slice_new0 (Block92Data);
	_data92_->_ref_count_ = 1;
	_data92_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (row);
	_g_object_unref0 (_data92_->row);
	_data92_->row = _tmp0_;
	_tmp1_ = _g_object_ref0 (terms);
	_g_object_unref0 (_data92_->terms);
	_data92_->terms = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data92_->cancellable);
	_data92_->cancellable = _tmp2_;
	_tmp3_ = conversation_list_box_email_row_get_view (_data92_->row);
	_tmp4_ = _tmp3_;
	_tmp5_ = conversation_email_get_message_body_state (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == CONVERSATION_EMAIL_LOAD_STATE_COMPLETED) {
		conversation_list_box_search_manager_apply_terms_impl (self, _data92_->row, _data92_->terms, _data92_->cancellable, _conversation_list_box_search_manager_apply_terms_impl_finished_gasync_ready_callback, g_object_ref (self));
	} else {
		ConversationEmail* _tmp7_;
		ConversationEmail* _tmp8_;
		_tmp7_ = conversation_list_box_email_row_get_view (_data92_->row);
		_tmp8_ = _tmp7_;
		g_signal_connect_data (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, G_TYPE_OBJECT, GObject), "notify::message-body-state", (GCallback) ____lambda127__g_object_notify, block92_data_ref (_data92_), (GClosureNotify) block92_data_unref, 0);
	}
	block92_data_unref (_data92_);
	_data92_ = NULL;
}

static void
conversation_list_box_search_manager_apply_terms_impl_data_free (gpointer _data)
{
	ConversationListBoxSearchManagerApplyTermsImplData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->row);
	_g_object_unref0 (_data_->terms);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationListBoxSearchManagerApplyTermsImplData, _data_);
}

static void
conversation_list_box_search_manager_apply_terms_impl (ConversationListBoxSearchManager* self,
                                                       ConversationListBoxEmailRow* row,
                                                       GeeSet* terms,
                                                       GCancellable* cancellable,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	ConversationListBoxSearchManagerApplyTermsImplData* _data_;
	ConversationListBoxSearchManager* _tmp0_;
	ConversationListBoxEmailRow* _tmp1_;
	GeeSet* _tmp2_;
	GCancellable* _tmp3_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_SEARCH_MANAGER (self));
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (row));
	g_return_if_fail ((terms == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (terms, GEE_TYPE_SET));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ConversationListBoxSearchManagerApplyTermsImplData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_search_manager_apply_terms_impl_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (row);
	_g_object_unref0 (_data_->row);
	_data_->row = _tmp1_;
	_tmp2_ = _g_object_ref0 (terms);
	_g_object_unref0 (_data_->terms);
	_data_->terms = _tmp2_;
	_tmp3_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp3_;
	conversation_list_box_search_manager_apply_terms_impl_co (_data_);
}

static guint
conversation_list_box_search_manager_apply_terms_impl_finish (ConversationListBoxSearchManager* self,
                                                              GAsyncResult* _res_,
                                                              GError** error)
{
	guint result;
	ConversationListBoxSearchManagerApplyTermsImplData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		guint _tmp0_ = 0U;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
conversation_list_box_search_manager_apply_terms_impl_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_)
{
	ConversationListBoxSearchManagerApplyTermsImplData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_list_box_search_manager_apply_terms_impl_co (_data_);
}

static gboolean
conversation_list_box_search_manager_apply_terms_impl_co (ConversationListBoxSearchManagerApplyTermsImplData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->count = (guint) 0;
	{
		_data_->_tmp0_ = conversation_list_box_email_row_get_view (_data_->row);
		_data_->_tmp1_ = _data_->_tmp0_;
		_data_->_tmp2_ = conversation_email_iterator (_data_->_tmp1_);
		_data_->_view_it = _data_->_tmp2_;
		while (TRUE) {
			_data_->_tmp3_ = _data_->_view_it;
			if (!gee_iterator_next (_data_->_tmp3_)) {
				break;
			}
			_data_->_tmp4_ = _data_->_view_it;
			_data_->_tmp5_ = gee_iterator_get (_data_->_tmp4_);
			_data_->view = (ConversationMessage*) _data_->_tmp5_;
			if (g_cancellable_is_cancelled (_data_->cancellable)) {
				_data_->_tmp6_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Applying search terms cancelled");
				_data_->_inner_error0_ = _data_->_tmp6_;
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->view);
					_g_object_unref0 (_data_->_view_it);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_object_unref0 (_data_->view);
					_g_object_unref0 (_data_->_view_it);
					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;
				}
			}
			_data_->_tmp8_ = _data_->view;
			_data_->_state_ = 1;
			conversation_message_highlight_search_terms (_data_->_tmp8_, _data_->terms, _data_->cancellable, conversation_list_box_search_manager_apply_terms_impl_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp7_ = conversation_message_highlight_search_terms_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == G_IO_ERROR) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->view);
					_g_object_unref0 (_data_->_view_it);
					g_object_unref (_data_->_async_result);
					return FALSE;
				} else {
					_g_object_unref0 (_data_->view);
					_g_object_unref0 (_data_->_view_it);
					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;
				}
			}
			_data_->count += _data_->_tmp7_;
			_g_object_unref0 (_data_->view);
		}
		_g_object_unref0 (_data_->_view_it);
	}
	conversation_list_box_email_row_set_is_search_match (_data_->row, _data_->count > ((guint) 0));
	_data_->result = _data_->count;
	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
conversation_list_box_search_manager_apply_terms_impl_finished (ConversationListBoxSearchManager* self,
                                                                GObject* obj,
                                                                GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_SEARCH_MANAGER (self));
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	{
		guint _tmp0_ = 0U;
		_tmp0_ = conversation_list_box_search_manager_apply_terms_impl_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (g_error_matches (_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		self->priv->matches_found = self->priv->matches_found + _tmp0_;
		conversation_list_box_search_manager_notify_matches_updated (self);
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static inline void
conversation_list_box_search_manager_notify_matches_updated (ConversationListBoxSearchManager* self)
{
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_SEARCH_MANAGER (self));
	g_signal_emit (self, conversation_list_box_search_manager_signals[CONVERSATION_LIST_BOX_SEARCH_MANAGER_MATCHES_UPDATED_SIGNAL], 0, self->priv->matches_found);
}

static void
conversation_list_box_search_manager_class_init (ConversationListBoxSearchManagerClass * klass,
                                                 gpointer klass_data)
{
	conversation_list_box_search_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConversationListBoxSearchManager_private_offset);
	G_OBJECT_CLASS (klass)->finalize = conversation_list_box_search_manager_finalize;
	/** Fired when the number of matching emails has changed. */
	conversation_list_box_search_manager_signals[CONVERSATION_LIST_BOX_SEARCH_MANAGER_MATCHES_UPDATED_SIGNAL] = g_signal_new ("matches-updated", CONVERSATION_LIST_BOX_TYPE_SEARCH_MANAGER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
}

static void
conversation_list_box_search_manager_instance_init (ConversationListBoxSearchManager * self,
                                                    gpointer klass)
{
	GCancellable* _tmp0_;
	self->priv = conversation_list_box_search_manager_get_instance_private (self);
	self->priv->terms = NULL;
	self->priv->matches_found = (guint) 0;
	_tmp0_ = g_cancellable_new ();
	self->priv->highlight_cancellable = _tmp0_;
}

static void
conversation_list_box_search_manager_finalize (GObject * obj)
{
	ConversationListBoxSearchManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONVERSATION_LIST_BOX_TYPE_SEARCH_MANAGER, ConversationListBoxSearchManager);
	_g_object_unref0 (self->priv->conversation);
	_g_object_unref0 (self->priv->terms);
	_g_object_unref0 (self->priv->highlight_cancellable);
	G_OBJECT_CLASS (conversation_list_box_search_manager_parent_class)->finalize (obj);
}

/** Manages find/search term matching in a conversation. */
static GType
conversation_list_box_search_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationListBoxSearchManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_list_box_search_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationListBoxSearchManager), 0, (GInstanceInitFunc) conversation_list_box_search_manager_instance_init, NULL };
	GType conversation_list_box_search_manager_type_id;
	conversation_list_box_search_manager_type_id = g_type_register_static (GEARY_TYPE_BASE_OBJECT, "ConversationListBoxSearchManager", &g_define_type_info, 0);
	ConversationListBoxSearchManager_private_offset = g_type_add_instance_private (conversation_list_box_search_manager_type_id, sizeof (ConversationListBoxSearchManagerPrivate));
	return conversation_list_box_search_manager_type_id;
}

GType
conversation_list_box_search_manager_get_type (void)
{
	static volatile gsize conversation_list_box_search_manager_type_id__once = 0;
	if (g_once_init_enter (&conversation_list_box_search_manager_type_id__once)) {
		GType conversation_list_box_search_manager_type_id;
		conversation_list_box_search_manager_type_id = conversation_list_box_search_manager_get_type_once ();
		g_once_init_leave (&conversation_list_box_search_manager_type_id__once, conversation_list_box_search_manager_type_id);
	}
	return conversation_list_box_search_manager_type_id__once;
}

static inline gpointer
conversation_list_box_conversation_row_get_instance_private (ConversationListBoxConversationRow* self)
{
	return G_STRUCT_MEMBER_P (self, ConversationListBoxConversationRow_private_offset);
}

GearyEmail*
conversation_list_box_conversation_row_get_email (ConversationListBoxConversationRow* self)
{
	GearyEmail* result;
	GearyEmail* _tmp0_;
	g_return_val_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self), NULL);
	_tmp0_ = self->priv->_email;
	result = _tmp0_;
	return result;
}

static void
conversation_list_box_conversation_row_set_email (ConversationListBoxConversationRow* self,
                                                  GearyEmail* value)
{
	GearyEmail* old_value;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self));
	old_value = conversation_list_box_conversation_row_get_email (self);
	if (old_value != value) {
		GearyEmail* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_email);
		self->priv->_email = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_list_box_conversation_row_properties[CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_PROPERTY]);
	}
}

gboolean
conversation_list_box_conversation_row_get_is_expanded (ConversationListBoxConversationRow* self)
{
	gboolean result;
	g_return_val_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self), FALSE);
	result = self->priv->_is_expanded;
	return result;
}

void
conversation_list_box_conversation_row_set_is_expanded (ConversationListBoxConversationRow* self,
                                                        gboolean value)
{
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self));
	self->priv->_is_expanded = value;
	g_object_notify (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject), "is-expanded");
	g_object_notify_by_pspec ((GObject *) self, conversation_list_box_conversation_row_properties[CONVERSATION_LIST_BOX_CONVERSATION_ROW_IS_EXPANDED_PROPERTY]);
}

static void
_conversation_list_box_conversation_row_update_css_class_g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self)
{
	conversation_list_box_conversation_row_update_css_class ((ConversationListBoxConversationRow*) self);
}

ConversationListBoxConversationRow*
conversation_list_box_conversation_row_construct (GType object_type,
                                                  GearyEmail* email)
{
	ConversationListBoxConversationRow * self = NULL;
	g_return_val_if_fail ((email == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL), NULL);
	self = (ConversationListBoxConversationRow*) g_object_new (object_type, NULL);
	geary_base_interface_base_ref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	conversation_list_box_conversation_row_set_email (self, email);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject), "notify::is-expanded", (GCallback) _conversation_list_box_conversation_row_update_css_class_g_object_notify, self, 0);
	gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	return self;
}

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

static void
conversation_list_box_conversation_row_real_expand (ConversationListBoxConversationRow* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	ConversationListBoxConversationRowExpandData* _data_;
	ConversationListBoxConversationRow* _tmp0_;
	_data_ = g_slice_new0 (ConversationListBoxConversationRowExpandData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_conversation_row_real_expand_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	conversation_list_box_conversation_row_real_expand_co (_data_);
}

static void
conversation_list_box_conversation_row_real_expand_finish (ConversationListBoxConversationRow* self,
                                                           GAsyncResult* _res_,
                                                           GError** error)
{
	ConversationListBoxConversationRowExpandData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gboolean
conversation_list_box_conversation_row_real_expand_co (ConversationListBoxConversationRowExpandData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	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
conversation_list_box_conversation_row_expand (ConversationListBoxConversationRow* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	ConversationListBoxConversationRowClass* _klass_;
	_klass_ = CONVERSATION_LIST_BOX_CONVERSATION_ROW_GET_CLASS (self);
	if (_klass_->expand) {
		_klass_->expand (self, _callback_, _user_data_);
	}
}

void
conversation_list_box_conversation_row_expand_finish (ConversationListBoxConversationRow* self,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	ConversationListBoxConversationRowClass* _klass_;
	_klass_ = CONVERSATION_LIST_BOX_CONVERSATION_ROW_GET_CLASS (self);
	if (_klass_->expand_finish) {
		_klass_->expand_finish (self, _res_, error);
	}
}

static void
conversation_list_box_conversation_row_real_collapse (ConversationListBoxConversationRow* self)
{
}

void
conversation_list_box_conversation_row_collapse (ConversationListBoxConversationRow* self)
{
	ConversationListBoxConversationRowClass* _klass_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self));
	_klass_ = CONVERSATION_LIST_BOX_CONVERSATION_ROW_GET_CLASS (self);
	if (_klass_->collapse) {
		_klass_->collapse (self);
	}
}

static void
_conversation_list_box_conversation_row_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender,
                                                                                   GtkAllocation* allocation,
                                                                                   gpointer self)
{
	conversation_list_box_conversation_row_on_size_allocate ((ConversationListBoxConversationRow*) self);
}

void
conversation_list_box_conversation_row_enable_should_scroll (ConversationListBoxConversationRow* self)
{
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self));
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "size-allocate", (GCallback) _conversation_list_box_conversation_row_on_size_allocate_gtk_widget_size_allocate, self, 0);
}

static void
conversation_list_box_conversation_row_update_css_class (ConversationListBoxConversationRow* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self));
	_tmp0_ = conversation_list_box_conversation_row_get_is_expanded (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		GtkStyleContext* _tmp2_;
		_tmp2_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_add_class (_tmp2_, CONVERSATION_LIST_BOX_CONVERSATION_ROW_EXPANDED_CLASS);
	} else {
		GtkStyleContext* _tmp3_;
		_tmp3_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_remove_class (_tmp3_, CONVERSATION_LIST_BOX_CONVERSATION_ROW_EXPANDED_CLASS);
	}
	conversation_list_box_conversation_row_update_previous_sibling_css_class (self);
}

static GtkWidget*
conversation_list_box_conversation_row_get_previous_sibling (ConversationListBoxConversationRow* self)
{
	GtkContainer* _tmp0_;
	GtkContainer* _tmp1_;
	GtkWidget* result;
	g_return_val_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self), NULL);
	_tmp0_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = _tmp0_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_container_get_type ())) {
		GList* siblings = NULL;
		GtkContainer* _tmp2_;
		GtkContainer* _tmp3_;
		GList* _tmp4_;
		GList* l = NULL;
		gboolean _tmp17_ = FALSE;
		gboolean _tmp18_ = FALSE;
		GList* _tmp19_;
		_tmp2_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		_tmp3_ = _tmp2_;
		_tmp4_ = gtk_container_get_children (_tmp3_);
		siblings = _tmp4_;
		{
			GList* _tmp5_;
			gboolean _tmp6_ = FALSE;
			_tmp5_ = siblings;
			l = _tmp5_;
			_tmp6_ = TRUE;
			while (TRUE) {
				gboolean _tmp9_ = FALSE;
				gboolean _tmp10_ = FALSE;
				GList* _tmp11_;
				if (!_tmp6_) {
					GList* _tmp7_;
					GList* _tmp8_;
					_tmp7_ = l;
					_tmp8_ = _tmp7_->next;
					l = _tmp8_;
				}
				_tmp6_ = FALSE;
				_tmp11_ = l;
				if (_tmp11_ != NULL) {
					GList* _tmp12_;
					GList* _tmp13_;
					_tmp12_ = l;
					_tmp13_ = _tmp12_->next;
					_tmp10_ = _tmp13_ != NULL;
				} else {
					_tmp10_ = FALSE;
				}
				if (_tmp10_) {
					GList* _tmp14_;
					GList* _tmp15_;
					gconstpointer _tmp16_;
					_tmp14_ = l;
					_tmp15_ = _tmp14_->next;
					_tmp16_ = _tmp15_->data;
					_tmp9_ = ((GtkWidget*) _tmp16_) != G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget);
				} else {
					_tmp9_ = FALSE;
				}
				if (!_tmp9_) {
					break;
				}
			}
		}
		_tmp19_ = l;
		if (_tmp19_ != NULL) {
			GList* _tmp20_;
			GList* _tmp21_;
			_tmp20_ = l;
			_tmp21_ = _tmp20_->next;
			_tmp18_ = _tmp21_ != NULL;
		} else {
			_tmp18_ = FALSE;
		}
		if (_tmp18_) {
			GList* _tmp22_;
			GList* _tmp23_;
			gconstpointer _tmp24_;
			_tmp22_ = l;
			_tmp23_ = _tmp22_->next;
			_tmp24_ = _tmp23_->data;
			_tmp17_ = ((GtkWidget*) _tmp24_) == G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget);
		} else {
			_tmp17_ = FALSE;
		}
		if (_tmp17_) {
			GList* _tmp25_;
			gconstpointer _tmp26_;
			GtkWidget* _tmp27_;
			_tmp25_ = l;
			_tmp26_ = _tmp25_->data;
			_tmp27_ = _g_object_ref0 ((GtkWidget*) _tmp26_);
			result = _tmp27_;
			(siblings == NULL) ? NULL : (siblings = (g_list_free (siblings), NULL));
			return result;
		}
		(siblings == NULL) ? NULL : (siblings = (g_list_free (siblings), NULL));
	}
	result = NULL;
	return result;
}

static void
conversation_list_box_conversation_row_update_previous_sibling_css_class (ConversationListBoxConversationRow* self)
{
	GtkWidget* previous_sibling = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self));
	_tmp0_ = conversation_list_box_conversation_row_get_previous_sibling (self);
	previous_sibling = _tmp0_;
	_tmp1_ = previous_sibling;
	if (_tmp1_ != NULL) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = conversation_list_box_conversation_row_get_is_expanded (self);
		_tmp3_ = _tmp2_;
		if (_tmp3_) {
			GtkWidget* _tmp4_;
			GtkStyleContext* _tmp5_;
			_tmp4_ = previous_sibling;
			_tmp5_ = gtk_widget_get_style_context (_tmp4_);
			gtk_style_context_add_class (_tmp5_, "geary-expanded-previous-sibling");
		} else {
			GtkWidget* _tmp6_;
			GtkStyleContext* _tmp7_;
			_tmp6_ = previous_sibling;
			_tmp7_ = gtk_widget_get_style_context (_tmp6_);
			gtk_style_context_remove_class (_tmp7_, "geary-expanded-previous-sibling");
		}
	}
	_g_object_unref0 (previous_sibling);
}

inline void
conversation_list_box_conversation_row_set_style_context_class (ConversationListBoxConversationRow* self,
                                                                const gchar* class_name,
                                                                gboolean value)
{
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self));
	g_return_if_fail (class_name != NULL);
	if (value) {
		GtkStyleContext* _tmp0_;
		_tmp0_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_add_class (_tmp0_, class_name);
	} else {
		GtkStyleContext* _tmp1_;
		_tmp1_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_remove_class (_tmp1_, class_name);
	}
}

void
conversation_list_box_conversation_row_on_size_allocate (ConversationListBoxConversationRow* self)
{
	guint _tmp0_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_CONVERSATION_ROW (self));
	g_signal_parse_name ("size-allocate", gtk_widget_get_type (), &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _conversation_list_box_conversation_row_on_size_allocate_gtk_widget_size_allocate, self);
	g_signal_emit (self, conversation_list_box_conversation_row_signals[CONVERSATION_LIST_BOX_CONVERSATION_ROW_SHOULD_SCROLL_SIGNAL], 0);
}

static void
conversation_list_box_conversation_row_class_init (ConversationListBoxConversationRowClass * klass,
                                                   gpointer klass_data)
{
	conversation_list_box_conversation_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConversationListBoxConversationRow_private_offset);
	((ConversationListBoxConversationRowClass *) klass)->expand = (void (*) (ConversationListBoxConversationRow*, GAsyncReadyCallback, gpointer)) conversation_list_box_conversation_row_real_expand;
	((ConversationListBoxConversationRowClass *) klass)->expand_finish = (void (*) (ConversationListBoxConversationRow*, GAsyncResult*, GError**)) conversation_list_box_conversation_row_real_expand_finish;
	((ConversationListBoxConversationRowClass *) klass)->collapse = (void (*) (ConversationListBoxConversationRow*)) conversation_list_box_conversation_row_real_collapse;
	G_OBJECT_CLASS (klass)->get_property = _vala_conversation_list_box_conversation_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_conversation_list_box_conversation_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = conversation_list_box_conversation_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_PROPERTY, conversation_list_box_conversation_row_properties[CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_PROPERTY] = g_param_spec_object ("email", "email", "email", GEARY_TYPE_EMAIL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_CONVERSATION_ROW_IS_EXPANDED_PROPERTY, conversation_list_box_conversation_row_properties[CONVERSATION_LIST_BOX_CONVERSATION_ROW_IS_EXPANDED_PROPERTY] = g_param_spec_boolean ("is-expanded", "is-expanded", "is-expanded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	conversation_list_box_conversation_row_signals[CONVERSATION_LIST_BOX_CONVERSATION_ROW_SHOULD_SCROLL_SIGNAL] = g_signal_new ("should-scroll", CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	conversation_list_box_conversation_row_signals[CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_LOADED_SIGNAL] = g_signal_new ("email-loaded", CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GEARY_TYPE_EMAIL);
}

static void
conversation_list_box_conversation_row_geary_base_interface_interface_init (GearyBaseInterfaceIface * iface,
                                                                            gpointer iface_data)
{
	conversation_list_box_conversation_row_geary_base_interface_parent_iface = g_type_interface_peek_parent (iface);
}

static void
conversation_list_box_conversation_row_instance_init (ConversationListBoxConversationRow * self,
                                                      gpointer klass)
{
	self->priv = conversation_list_box_conversation_row_get_instance_private (self);
	self->priv->_email = NULL;
	self->priv->_is_expanded = FALSE;
}

static void
conversation_list_box_conversation_row_finalize (GObject * obj)
{
	ConversationListBoxConversationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow);
	geary_base_interface_base_unref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	_g_object_unref0 (self->priv->_email);
	G_OBJECT_CLASS (conversation_list_box_conversation_row_parent_class)->finalize (obj);
}

static GType
conversation_list_box_conversation_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationListBoxConversationRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_list_box_conversation_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationListBoxConversationRow), 0, (GInstanceInitFunc) conversation_list_box_conversation_row_instance_init, NULL };
	static const GInterfaceInfo geary_base_interface_info = { (GInterfaceInitFunc) conversation_list_box_conversation_row_geary_base_interface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType conversation_list_box_conversation_row_type_id;
	conversation_list_box_conversation_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "ConversationListBoxConversationRow", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (conversation_list_box_conversation_row_type_id, GEARY_TYPE_BASE_INTERFACE, &geary_base_interface_info);
	ConversationListBoxConversationRow_private_offset = g_type_add_instance_private (conversation_list_box_conversation_row_type_id, sizeof (ConversationListBoxConversationRowPrivate));
	return conversation_list_box_conversation_row_type_id;
}

GType
conversation_list_box_conversation_row_get_type (void)
{
	static volatile gsize conversation_list_box_conversation_row_type_id__once = 0;
	if (g_once_init_enter (&conversation_list_box_conversation_row_type_id__once)) {
		GType conversation_list_box_conversation_row_type_id;
		conversation_list_box_conversation_row_type_id = conversation_list_box_conversation_row_get_type_once ();
		g_once_init_leave (&conversation_list_box_conversation_row_type_id__once, conversation_list_box_conversation_row_type_id);
	}
	return conversation_list_box_conversation_row_type_id__once;
}

static void
_vala_conversation_list_box_conversation_row_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	ConversationListBoxConversationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow);
	switch (property_id) {
		case CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_PROPERTY:
		g_value_set_object (value, conversation_list_box_conversation_row_get_email (self));
		break;
		case CONVERSATION_LIST_BOX_CONVERSATION_ROW_IS_EXPANDED_PROPERTY:
		g_value_set_boolean (value, conversation_list_box_conversation_row_get_is_expanded (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_conversation_list_box_conversation_row_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec)
{
	ConversationListBoxConversationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow);
	switch (property_id) {
		case CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_PROPERTY:
		conversation_list_box_conversation_row_set_email (self, g_value_get_object (value));
		break;
		case CONVERSATION_LIST_BOX_CONVERSATION_ROW_IS_EXPANDED_PROPERTY:
		conversation_list_box_conversation_row_set_is_expanded (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
conversation_list_box_email_row_get_instance_private (ConversationListBoxEmailRow* self)
{
	return G_STRUCT_MEMBER_P (self, ConversationListBoxEmailRow_private_offset);
}

gboolean
conversation_list_box_email_row_get_is_pinned (ConversationListBoxEmailRow* self)
{
	gboolean result;
	g_return_val_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (self), FALSE);
	result = self->priv->_is_pinned;
	return result;
}

static void
conversation_list_box_email_row_set_is_pinned (ConversationListBoxEmailRow* self,
                                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (self));
	old_value = conversation_list_box_email_row_get_is_pinned (self);
	if (old_value != value) {
		self->priv->_is_pinned = value;
		g_object_notify_by_pspec ((GObject *) self, conversation_list_box_email_row_properties[CONVERSATION_LIST_BOX_EMAIL_ROW_IS_PINNED_PROPERTY]);
	}
}

gboolean
conversation_list_box_email_row_get_is_search_match (ConversationListBoxEmailRow* self)
{
	gboolean result;
	GtkStyleContext* _tmp0_;
	g_return_val_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (self), FALSE);
	_tmp0_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	result = gtk_style_context_has_class (_tmp0_, CONVERSATION_LIST_BOX_EMAIL_ROW_MATCH_CLASS);
	return result;
}

void
conversation_list_box_email_row_set_is_search_match (ConversationListBoxEmailRow* self,
                                                     gboolean value)
{
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (self));
	conversation_list_box_conversation_row_set_style_context_class (G_TYPE_CHECK_INSTANCE_CAST (self, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), CONVERSATION_LIST_BOX_EMAIL_ROW_MATCH_CLASS, value);
	conversation_list_box_email_row_set_is_pinned (self, value);
	conversation_list_box_email_row_update_row_expansion (self);
	g_object_notify_by_pspec ((GObject *) self, conversation_list_box_email_row_properties[CONVERSATION_LIST_BOX_EMAIL_ROW_IS_SEARCH_MATCH_PROPERTY]);
}

ConversationEmail*
conversation_list_box_email_row_get_view (ConversationListBoxEmailRow* self)
{
	ConversationEmail* result;
	ConversationEmail* _tmp0_;
	g_return_val_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (self), NULL);
	_tmp0_ = self->priv->_view;
	result = _tmp0_;
	return result;
}

static void
conversation_list_box_email_row_set_view (ConversationListBoxEmailRow* self,
                                          ConversationEmail* value)
{
	ConversationEmail* old_value;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (self));
	old_value = conversation_list_box_email_row_get_view (self);
	if (old_value != value) {
		ConversationEmail* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_view);
		self->priv->_view = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_list_box_email_row_properties[CONVERSATION_LIST_BOX_EMAIL_ROW_VIEW_PROPERTY]);
	}
}

ConversationListBoxEmailRow*
conversation_list_box_email_row_construct (GType object_type,
                                           ConversationEmail* view)
{
	ConversationListBoxEmailRow * self = NULL;
	GearyEmail* _tmp0_;
	GearyEmail* _tmp1_;
	g_return_val_if_fail (IS_CONVERSATION_EMAIL (view), NULL);
	_tmp0_ = conversation_email_get_email (view);
	_tmp1_ = _tmp0_;
	self = (ConversationListBoxEmailRow*) conversation_list_box_conversation_row_construct (object_type, _tmp1_);
	conversation_list_box_email_row_set_view (self, view);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (view, gtk_widget_get_type (), GtkWidget));
	return self;
}

ConversationListBoxEmailRow*
conversation_list_box_email_row_new (ConversationEmail* view)
{
	return conversation_list_box_email_row_construct (CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, view);
}

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

static void
conversation_list_box_email_row_real_expand (ConversationListBoxConversationRow* base,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	ConversationListBoxEmailRow * self;
	ConversationListBoxEmailRowExpandData* _data_;
	ConversationListBoxEmailRow* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRow);
	_data_ = g_slice_new0 (ConversationListBoxEmailRowExpandData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_list_box_email_row_real_expand_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	conversation_list_box_email_row_real_expand_co (_data_);
}

static void
conversation_list_box_email_row_expand_finish (ConversationListBoxConversationRow* base,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	ConversationListBoxEmailRowExpandData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
conversation_list_box_email_row_expand_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	ConversationListBoxEmailRowExpandData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_list_box_email_row_real_expand_co (_data_);
}

static gboolean
conversation_list_box_email_row_real_expand_co (ConversationListBoxEmailRowExpandData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	conversation_list_box_conversation_row_set_is_expanded (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), TRUE);
	conversation_list_box_email_row_update_row_expansion (_data_->self);
	_data_->_tmp0_ = _data_->self->priv->_view;
	_data_->_tmp1_ = conversation_email_get_message_body_state (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_ == CONVERSATION_EMAIL_LOAD_STATE_NOT_STARTED) {
		_data_->_tmp3_ = _data_->self->priv->_view;
		_data_->_state_ = 1;
		conversation_email_load_body (_data_->_tmp3_, conversation_list_box_email_row_expand_ready, _data_);
		return FALSE;
		_state_1:
		conversation_email_load_body_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp4_ = _data_->self->priv->_view;
		_data_->_tmp5_ = conversation_email_get_email (_data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		g_signal_emit (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), conversation_list_box_conversation_row_signals[CONVERSATION_LIST_BOX_CONVERSATION_ROW_EMAIL_LOADED_SIGNAL], 0, _data_->_tmp6_);
	}
	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
conversation_list_box_email_row_real_collapse (ConversationListBoxConversationRow* base)
{
	ConversationListBoxEmailRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRow);
	conversation_list_box_conversation_row_set_is_expanded (G_TYPE_CHECK_INSTANCE_CAST (self, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), FALSE);
	conversation_list_box_email_row_set_is_pinned (self, FALSE);
	conversation_list_box_email_row_update_row_expansion (self);
}

static inline void
conversation_list_box_email_row_update_row_expansion (ConversationListBoxEmailRow* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_EMAIL_ROW (self));
	_tmp1_ = conversation_list_box_conversation_row_get_is_expanded (G_TYPE_CHECK_INSTANCE_CAST (self, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow));
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp3_;
		_tmp3_ = self->priv->_is_pinned;
		_tmp0_ = _tmp3_;
	}
	if (_tmp0_) {
		ConversationEmail* _tmp4_;
		_tmp4_ = self->priv->_view;
		conversation_email_expand_email (_tmp4_, TRUE);
	} else {
		ConversationEmail* _tmp5_;
		_tmp5_ = self->priv->_view;
		conversation_email_collapse_email (_tmp5_);
	}
}

static void
conversation_list_box_email_row_class_init (ConversationListBoxEmailRowClass * klass,
                                            gpointer klass_data)
{
	conversation_list_box_email_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConversationListBoxEmailRow_private_offset);
	((ConversationListBoxConversationRowClass *) klass)->expand = (void (*) (ConversationListBoxConversationRow*, GAsyncReadyCallback, gpointer)) conversation_list_box_email_row_real_expand;
	((ConversationListBoxConversationRowClass *) klass)->expand_finish = (void (*) (ConversationListBoxConversationRow*, GAsyncResult*, GError**)) conversation_list_box_email_row_expand_finish;
	((ConversationListBoxConversationRowClass *) klass)->collapse = (void (*) (ConversationListBoxConversationRow*)) conversation_list_box_email_row_real_collapse;
	G_OBJECT_CLASS (klass)->get_property = _vala_conversation_list_box_email_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_conversation_list_box_email_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = conversation_list_box_email_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_EMAIL_ROW_IS_PINNED_PROPERTY, conversation_list_box_email_row_properties[CONVERSATION_LIST_BOX_EMAIL_ROW_IS_PINNED_PROPERTY] = g_param_spec_boolean ("is-pinned", "is-pinned", "is-pinned", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_EMAIL_ROW_IS_SEARCH_MATCH_PROPERTY, conversation_list_box_email_row_properties[CONVERSATION_LIST_BOX_EMAIL_ROW_IS_SEARCH_MATCH_PROPERTY] = g_param_spec_boolean ("is-search-match", "is-search-match", "is-search-match", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_EMAIL_ROW_VIEW_PROPERTY, conversation_list_box_email_row_properties[CONVERSATION_LIST_BOX_EMAIL_ROW_VIEW_PROPERTY] = g_param_spec_object ("view", "view", "view", TYPE_CONVERSATION_EMAIL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
conversation_list_box_email_row_instance_init (ConversationListBoxEmailRow * self,
                                               gpointer klass)
{
	self->priv = conversation_list_box_email_row_get_instance_private (self);
	self->priv->_is_pinned = FALSE;
}

static void
conversation_list_box_email_row_finalize (GObject * obj)
{
	ConversationListBoxEmailRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRow);
	_g_object_unref0 (self->priv->_view);
	G_OBJECT_CLASS (conversation_list_box_email_row_parent_class)->finalize (obj);
}

static GType
conversation_list_box_email_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationListBoxEmailRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_list_box_email_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationListBoxEmailRow), 0, (GInstanceInitFunc) conversation_list_box_email_row_instance_init, NULL };
	GType conversation_list_box_email_row_type_id;
	conversation_list_box_email_row_type_id = g_type_register_static (CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, "ConversationListBoxEmailRow", &g_define_type_info, 0);
	ConversationListBoxEmailRow_private_offset = g_type_add_instance_private (conversation_list_box_email_row_type_id, sizeof (ConversationListBoxEmailRowPrivate));
	return conversation_list_box_email_row_type_id;
}

GType
conversation_list_box_email_row_get_type (void)
{
	static volatile gsize conversation_list_box_email_row_type_id__once = 0;
	if (g_once_init_enter (&conversation_list_box_email_row_type_id__once)) {
		GType conversation_list_box_email_row_type_id;
		conversation_list_box_email_row_type_id = conversation_list_box_email_row_get_type_once ();
		g_once_init_leave (&conversation_list_box_email_row_type_id__once, conversation_list_box_email_row_type_id);
	}
	return conversation_list_box_email_row_type_id__once;
}

static void
_vala_conversation_list_box_email_row_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	ConversationListBoxEmailRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRow);
	switch (property_id) {
		case CONVERSATION_LIST_BOX_EMAIL_ROW_IS_PINNED_PROPERTY:
		g_value_set_boolean (value, conversation_list_box_email_row_get_is_pinned (self));
		break;
		case CONVERSATION_LIST_BOX_EMAIL_ROW_IS_SEARCH_MATCH_PROPERTY:
		g_value_set_boolean (value, conversation_list_box_email_row_get_is_search_match (self));
		break;
		case CONVERSATION_LIST_BOX_EMAIL_ROW_VIEW_PROPERTY:
		g_value_set_object (value, conversation_list_box_email_row_get_view (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_conversation_list_box_email_row_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	ConversationListBoxEmailRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, ConversationListBoxEmailRow);
	switch (property_id) {
		case CONVERSATION_LIST_BOX_EMAIL_ROW_IS_PINNED_PROPERTY:
		conversation_list_box_email_row_set_is_pinned (self, g_value_get_boolean (value));
		break;
		case CONVERSATION_LIST_BOX_EMAIL_ROW_IS_SEARCH_MATCH_PROPERTY:
		conversation_list_box_email_row_set_is_search_match (self, g_value_get_boolean (value));
		break;
		case CONVERSATION_LIST_BOX_EMAIL_ROW_VIEW_PROPERTY:
		conversation_list_box_email_row_set_view (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

ConversationListBoxLoadingRow*
conversation_list_box_loading_row_construct (GType object_type)
{
	ConversationListBoxLoadingRow * self = NULL;
	GtkStyleContext* _tmp0_;
	GtkSpinner* spinner = NULL;
	GtkSpinner* _tmp1_;
	self = (ConversationListBoxLoadingRow*) conversation_list_box_conversation_row_construct (object_type, NULL);
	_tmp0_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp0_, CONVERSATION_LIST_BOX_LOADING_ROW_LOADING_CLASS);
	_tmp1_ = (GtkSpinner*) gtk_spinner_new ();
	g_object_ref_sink (_tmp1_);
	spinner = _tmp1_;
	g_object_set (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), "height-request", 16, NULL);
	g_object_set (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), "width-request", 16, NULL);
	gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget));
	gtk_spinner_start (spinner);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (spinner);
	return self;
}

ConversationListBoxLoadingRow*
conversation_list_box_loading_row_new (void)
{
	return conversation_list_box_loading_row_construct (CONVERSATION_LIST_BOX_TYPE_LOADING_ROW);
}

static void
conversation_list_box_loading_row_class_init (ConversationListBoxLoadingRowClass * klass,
                                              gpointer klass_data)
{
	conversation_list_box_loading_row_parent_class = g_type_class_peek_parent (klass);
}

static void
conversation_list_box_loading_row_instance_init (ConversationListBoxLoadingRow * self,
                                                 gpointer klass)
{
}

static GType
conversation_list_box_loading_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationListBoxLoadingRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_list_box_loading_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationListBoxLoadingRow), 0, (GInstanceInitFunc) conversation_list_box_loading_row_instance_init, NULL };
	GType conversation_list_box_loading_row_type_id;
	conversation_list_box_loading_row_type_id = g_type_register_static (CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, "ConversationListBoxLoadingRow", &g_define_type_info, 0);
	return conversation_list_box_loading_row_type_id;
}

GType
conversation_list_box_loading_row_get_type (void)
{
	static volatile gsize conversation_list_box_loading_row_type_id__once = 0;
	if (g_once_init_enter (&conversation_list_box_loading_row_type_id__once)) {
		GType conversation_list_box_loading_row_type_id;
		conversation_list_box_loading_row_type_id = conversation_list_box_loading_row_get_type_once ();
		g_once_init_leave (&conversation_list_box_loading_row_type_id__once, conversation_list_box_loading_row_type_id);
	}
	return conversation_list_box_loading_row_type_id__once;
}

static inline gpointer
conversation_list_box_composer_row_get_instance_private (ConversationListBoxComposerRow* self)
{
	return G_STRUCT_MEMBER_P (self, ConversationListBoxComposerRow_private_offset);
}

ComposerEmbed*
conversation_list_box_composer_row_get_view (ConversationListBoxComposerRow* self)
{
	ComposerEmbed* result;
	ComposerEmbed* _tmp0_;
	g_return_val_if_fail (CONVERSATION_LIST_BOX_IS_COMPOSER_ROW (self), NULL);
	_tmp0_ = self->priv->_view;
	result = _tmp0_;
	return result;
}

static void
conversation_list_box_composer_row_set_view (ConversationListBoxComposerRow* self,
                                             ComposerEmbed* value)
{
	ComposerEmbed* old_value;
	g_return_if_fail (CONVERSATION_LIST_BOX_IS_COMPOSER_ROW (self));
	old_value = conversation_list_box_composer_row_get_view (self);
	if (old_value != value) {
		ComposerEmbed* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_view);
		self->priv->_view = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_list_box_composer_row_properties[CONVERSATION_LIST_BOX_COMPOSER_ROW_VIEW_PROPERTY]);
	}
}

ConversationListBoxComposerRow*
conversation_list_box_composer_row_construct (GType object_type,
                                              ComposerEmbed* view)
{
	ConversationListBoxComposerRow * self = NULL;
	GearyEmail* _tmp0_;
	GearyEmail* _tmp1_;
	ComposerEmbed* _tmp2_;
	g_return_val_if_fail (COMPOSER_IS_EMBED (view), NULL);
	_tmp0_ = composer_embed_get_referred (view);
	_tmp1_ = _tmp0_;
	self = (ConversationListBoxComposerRow*) conversation_list_box_conversation_row_construct (object_type, _tmp1_);
	conversation_list_box_composer_row_set_view (self, view);
	conversation_list_box_conversation_row_set_is_expanded (G_TYPE_CHECK_INSTANCE_CAST (self, CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, ConversationListBoxConversationRow), TRUE);
	_tmp2_ = self->priv->_view;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	gtk_widget_set_focus_on_click (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), FALSE);
	return self;
}

ConversationListBoxComposerRow*
conversation_list_box_composer_row_new (ComposerEmbed* view)
{
	return conversation_list_box_composer_row_construct (CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW, view);
}

static void
conversation_list_box_composer_row_class_init (ConversationListBoxComposerRowClass * klass,
                                               gpointer klass_data)
{
	conversation_list_box_composer_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConversationListBoxComposerRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_conversation_list_box_composer_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_conversation_list_box_composer_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = conversation_list_box_composer_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_COMPOSER_ROW_VIEW_PROPERTY, conversation_list_box_composer_row_properties[CONVERSATION_LIST_BOX_COMPOSER_ROW_VIEW_PROPERTY] = g_param_spec_object ("view", "view", "view", COMPOSER_TYPE_EMBED, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
conversation_list_box_composer_row_instance_init (ConversationListBoxComposerRow * self,
                                                  gpointer klass)
{
	self->priv = conversation_list_box_composer_row_get_instance_private (self);
}

static void
conversation_list_box_composer_row_finalize (GObject * obj)
{
	ConversationListBoxComposerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW, ConversationListBoxComposerRow);
	_g_object_unref0 (self->priv->_view);
	G_OBJECT_CLASS (conversation_list_box_composer_row_parent_class)->finalize (obj);
}

static GType
conversation_list_box_composer_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationListBoxComposerRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_list_box_composer_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationListBoxComposerRow), 0, (GInstanceInitFunc) conversation_list_box_composer_row_instance_init, NULL };
	GType conversation_list_box_composer_row_type_id;
	conversation_list_box_composer_row_type_id = g_type_register_static (CONVERSATION_LIST_BOX_TYPE_CONVERSATION_ROW, "ConversationListBoxComposerRow", &g_define_type_info, 0);
	ConversationListBoxComposerRow_private_offset = g_type_add_instance_private (conversation_list_box_composer_row_type_id, sizeof (ConversationListBoxComposerRowPrivate));
	return conversation_list_box_composer_row_type_id;
}

GType
conversation_list_box_composer_row_get_type (void)
{
	static volatile gsize conversation_list_box_composer_row_type_id__once = 0;
	if (g_once_init_enter (&conversation_list_box_composer_row_type_id__once)) {
		GType conversation_list_box_composer_row_type_id;
		conversation_list_box_composer_row_type_id = conversation_list_box_composer_row_get_type_once ();
		g_once_init_leave (&conversation_list_box_composer_row_type_id__once, conversation_list_box_composer_row_type_id);
	}
	return conversation_list_box_composer_row_type_id__once;
}

static void
_vala_conversation_list_box_composer_row_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	ConversationListBoxComposerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW, ConversationListBoxComposerRow);
	switch (property_id) {
		case CONVERSATION_LIST_BOX_COMPOSER_ROW_VIEW_PROPERTY:
		g_value_set_object (value, conversation_list_box_composer_row_get_view (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_conversation_list_box_composer_row_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	ConversationListBoxComposerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONVERSATION_LIST_BOX_TYPE_COMPOSER_ROW, ConversationListBoxComposerRow);
	switch (property_id) {
		case CONVERSATION_LIST_BOX_COMPOSER_ROW_VIEW_PROPERTY:
		conversation_list_box_composer_row_set_view (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
conversation_list_box_class_init (ConversationListBoxClass * klass,
                                  gpointer klass_data)
{
	GtkBindingSet* bindings = NULL;
	GTypeClass* _tmp0_;
	GObjectClass* _tmp1_;
	GtkBindingSet* _tmp2_;
	GtkBindingSet* _tmp3_;
	GtkBindingSet* _tmp4_;
	GtkBindingSet* _tmp5_;
	GtkBindingSet* _tmp6_;
	GtkBindingSet* _tmp7_;
	GtkBindingSet* _tmp8_;
	GtkBindingSet* _tmp9_;
	GtkBindingSet* _tmp10_;
	GtkBindingSet* _tmp11_;
	GtkBindingSet* _tmp12_;
	GtkBindingSet* _tmp13_;
	conversation_list_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConversationListBox_private_offset);
	((GtkWidgetClass *) klass)->destroy = (void (*) (GtkWidget*)) conversation_list_box_real_destroy;
	((ConversationListBoxClass *) klass)->scroll = conversation_list_box_real_scroll;
	((ConversationListBoxClass *) klass)->focus_next = conversation_list_box_real_focus_next;
	((ConversationListBoxClass *) klass)->focus_prev = conversation_list_box_real_focus_prev;
	G_OBJECT_CLASS (klass)->get_property = _vala_conversation_list_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_conversation_list_box_set_property;
	G_OBJECT_CLASS (klass)->finalize = conversation_list_box_finalize;
	/** Conversation being displayed. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_CONVERSATION_PROPERTY, conversation_list_box_properties[CONVERSATION_LIST_BOX_CONVERSATION_PROPERTY] = g_param_spec_object ("conversation", "conversation", "conversation", GEARY_APP_TYPE_CONVERSATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Search manager for highlighting search terms in this list. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_SEARCH_PROPERTY, conversation_list_box_properties[CONVERSATION_LIST_BOX_SEARCH_PROPERTY] = g_param_spec_object ("search", "search", "search", CONVERSATION_LIST_BOX_TYPE_SEARCH_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Specifies if this list box currently has an embedded composer. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_LIST_BOX_HAS_COMPOSER_PROPERTY, conversation_list_box_properties[CONVERSATION_LIST_BOX_HAS_COMPOSER_PROPERTY] = g_param_spec_boolean ("has-composer", "has-composer", "has-composer", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Keyboard action to scroll the conversation. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_SCROLL_SIGNAL] = g_signal_new ("scroll", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (ConversationListBoxClass, scroll), NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, gtk_scroll_type_get_type ());
	/** Keyboard action to shift focus to the next message, if any. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_FOCUS_NEXT_SIGNAL] = g_signal_new ("focus-next", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (ConversationListBoxClass, focus_next), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	/** Keyboard action to shift focus to the prev message, if any. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_FOCUS_PREV_SIGNAL] = g_signal_new ("focus-prev", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (ConversationListBoxClass, focus_prev), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	/** Fired when an email is fully loaded in the list box. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_EMAIL_LOADED_SIGNAL] = g_signal_new ("email-loaded", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GEARY_TYPE_EMAIL);
	/** Fired when the user clicks "reply" in the message menu. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_REPLY_TO_SENDER_EMAIL_SIGNAL] = g_signal_new ("reply-to-sender-email", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2, GEARY_TYPE_EMAIL, G_TYPE_STRING);
	/** Fired when the user clicks "reply all" in the message menu. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_REPLY_TO_ALL_EMAIL_SIGNAL] = g_signal_new ("reply-to-all-email", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2, GEARY_TYPE_EMAIL, G_TYPE_STRING);
	/** Fired when the user clicks "forward" in the message menu. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_FORWARD_EMAIL_SIGNAL] = g_signal_new ("forward-email", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2, GEARY_TYPE_EMAIL, G_TYPE_STRING);
	/** Emitted when email message flags are to be updated. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_MARK_EMAIL_SIGNAL] = g_signal_new ("mark-email", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_OBJECT, G_TYPE_NONE, 3, GEE_TYPE_COLLECTION, GEARY_TYPE_NAMED_FLAG, GEARY_TYPE_NAMED_FLAG);
	/** Fired when the user clicks "trash" in the message menu. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_TRASH_EMAIL_SIGNAL] = g_signal_new ("trash-email", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GEARY_TYPE_EMAIL);
	/** Fired when the user clicks "delete" in the message menu. */
	conversation_list_box_signals[CONVERSATION_LIST_BOX_DELETE_EMAIL_SIGNAL] = g_signal_new ("delete-email", TYPE_CONVERSATION_LIST_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GEARY_TYPE_EMAIL);
	_tmp0_ = g_type_class_ref (TYPE_CONVERSATION_LIST_BOX);
	_tmp1_ = (GObjectClass*) _tmp0_;
	_tmp2_ = gtk_binding_set_by_class ((gpointer) _tmp1_);
	_tmp3_ = _tmp2_;
	_g_type_class_unref0 (_tmp1_);
	bindings = _tmp3_;
	_tmp4_ = bindings;
	gtk_binding_entry_add_signal (_tmp4_, GDK_KEY_space, 0, "focus-next", (guint) 0, NULL);
	_tmp5_ = bindings;
	gtk_binding_entry_add_signal (_tmp5_, GDK_KEY_KP_Space, 0, "focus-next", (guint) 0, NULL);
	_tmp6_ = bindings;
	gtk_binding_entry_add_signal (_tmp6_, GDK_KEY_space, GDK_SHIFT_MASK, "focus-prev", (guint) 0, NULL);
	_tmp7_ = bindings;
	gtk_binding_entry_add_signal (_tmp7_, GDK_KEY_KP_Space, GDK_SHIFT_MASK, "focus-prev", (guint) 0, NULL);
	_tmp8_ = bindings;
	gtk_binding_entry_add_signal (_tmp8_, GDK_KEY_Up, 0, "scroll", (guint) 1, gtk_scroll_type_get_type (), GTK_SCROLL_STEP_UP, NULL);
	_tmp9_ = bindings;
	gtk_binding_entry_add_signal (_tmp9_, GDK_KEY_Down, 0, "scroll", (guint) 1, gtk_scroll_type_get_type (), GTK_SCROLL_STEP_DOWN, NULL);
	_tmp10_ = bindings;
	gtk_binding_entry_add_signal (_tmp10_, GDK_KEY_Page_Up, 0, "scroll", (guint) 1, gtk_scroll_type_get_type (), GTK_SCROLL_PAGE_UP, NULL);
	_tmp11_ = bindings;
	gtk_binding_entry_add_signal (_tmp11_, GDK_KEY_Page_Down, 0, "scroll", (guint) 1, gtk_scroll_type_get_type (), GTK_SCROLL_PAGE_DOWN, NULL);
	_tmp12_ = bindings;
	gtk_binding_entry_add_signal (_tmp12_, GDK_KEY_Home, 0, "scroll", (guint) 1, gtk_scroll_type_get_type (), GTK_SCROLL_START, NULL);
	_tmp13_ = bindings;
	gtk_binding_entry_add_signal (_tmp13_, GDK_KEY_End, 0, "scroll", (guint) 1, gtk_scroll_type_get_type (), GTK_SCROLL_END, NULL);
}

static void
conversation_list_box_geary_base_interface_interface_init (GearyBaseInterfaceIface * iface,
                                                           gpointer iface_data)
{
	conversation_list_box_geary_base_interface_parent_iface = g_type_interface_peek_parent (iface);
}

static void
conversation_list_box_instance_init (ConversationListBox * self,
                                     gpointer klass)
{
	GCancellable* _tmp0_;
	GeeHashMap* _tmp1_;
	GSimpleActionGroup* _tmp2_;
	self->priv = conversation_list_box_get_instance_private (self);
	_tmp0_ = g_cancellable_new ();
	self->priv->cancellable = _tmp0_;
	self->priv->body_selected_view = NULL;
	_tmp1_ = gee_hash_map_new (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, CONVERSATION_LIST_BOX_TYPE_EMAIL_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->email_rows = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_MAP, GeeMap);
	self->priv->current_composer = NULL;
	self->priv->draft_id = NULL;
	_tmp2_ = g_simple_action_group_new ();
	self->priv->email_actions = _tmp2_;
}

static void
conversation_list_box_finalize (GObject * obj)
{
	ConversationListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CONVERSATION_LIST_BOX, ConversationListBox);
	geary_base_interface_base_unref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	_g_object_unref0 (self->priv->_conversation);
	_g_object_unref0 (self->priv->_search);
	_g_object_unref0 (self->priv->email_store);
	_g_object_unref0 (self->priv->contacts);
	_g_object_unref0 (self->priv->config);
	_g_object_unref0 (self->priv->cancellable);
	_g_object_unref0 (self->priv->body_selected_view);
	_g_object_unref0 (self->priv->email_rows);
	_g_object_unref0 (self->priv->current_composer);
	_g_object_unref0 (self->priv->draft_id);
	_g_object_unref0 (self->priv->mark_read_timer);
	_g_object_unref0 (self->priv->email_actions);
	G_OBJECT_CLASS (conversation_list_box_parent_class)->finalize (obj);
}

/**
 * A widget for displaying conversations as a list of emails.
 *
 * The view displays the current selected {@link
 * Geary.App.Conversation} from the conversation list. To do so, it
 * listens to signals from both the list and the current conversation
 * monitor, updating the email list as needed.
 *
 * Unlike ConversationListStore (which sorts by date received),
 * ConversationListBox sorts by the {@link Geary.Email.date} field
 * (the Date: header), as that's the date displayed to the user.
 */
static GType
conversation_list_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationListBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_list_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationListBox), 0, (GInstanceInitFunc) conversation_list_box_instance_init, NULL };
	static const GInterfaceInfo geary_base_interface_info = { (GInterfaceInitFunc) conversation_list_box_geary_base_interface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType conversation_list_box_type_id;
	conversation_list_box_type_id = g_type_register_static (gtk_list_box_get_type (), "ConversationListBox", &g_define_type_info, 0);
	g_type_add_interface_static (conversation_list_box_type_id, GEARY_TYPE_BASE_INTERFACE, &geary_base_interface_info);
	ConversationListBox_private_offset = g_type_add_instance_private (conversation_list_box_type_id, sizeof (ConversationListBoxPrivate));
	return conversation_list_box_type_id;
}

GType
conversation_list_box_get_type (void)
{
	static volatile gsize conversation_list_box_type_id__once = 0;
	if (g_once_init_enter (&conversation_list_box_type_id__once)) {
		GType conversation_list_box_type_id;
		conversation_list_box_type_id = conversation_list_box_get_type_once ();
		g_once_init_leave (&conversation_list_box_type_id__once, conversation_list_box_type_id);
	}
	return conversation_list_box_type_id__once;
}

static void
_vala_conversation_list_box_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	ConversationListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CONVERSATION_LIST_BOX, ConversationListBox);
	switch (property_id) {
		case CONVERSATION_LIST_BOX_CONVERSATION_PROPERTY:
		g_value_set_object (value, conversation_list_box_get_conversation (self));
		break;
		case CONVERSATION_LIST_BOX_SEARCH_PROPERTY:
		g_value_set_object (value, conversation_list_box_get_search (self));
		break;
		case CONVERSATION_LIST_BOX_HAS_COMPOSER_PROPERTY:
		g_value_set_boolean (value, conversation_list_box_get_has_composer (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_conversation_list_box_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	ConversationListBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CONVERSATION_LIST_BOX, ConversationListBox);
	switch (property_id) {
		case CONVERSATION_LIST_BOX_CONVERSATION_PROPERTY:
		conversation_list_box_set_conversation (self, g_value_get_object (value));
		break;
		case CONVERSATION_LIST_BOX_SEARCH_PROPERTY:
		conversation_list_box_set_search (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

