/* conversation-message.c generated by valac 0.56.19, the Vala compiler
 * generated from conversation-message.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-46.0.h"
#include "geary-engine.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <handy.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gee.h>
#include <glib-object.h>
#include <webkit2/webkit2.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.h>
#include <jsc/jsc.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>

#define CONVERSATION_MESSAGE_FROM_CLASS "geary-from"
#define CONVERSATION_MESSAGE_MATCH_CLASS "geary-match"
#define CONVERSATION_MESSAGE_SPOOF_CLASS "geary-spoofed"
#define CONVERSATION_MESSAGE_INTERNAL_ANCHOR_PREFIX "geary:body#"
#define CONVERSATION_MESSAGE_REPLACED_CID_TEMPLATE "replaced_%02u@geary"
#define CONVERSATION_MESSAGE_REPLACED_IMAGE_CLASS "geary_replaced_inline_image"
#define CONVERSATION_MESSAGE_MAILTO_URI_PREFIX "mailto:"
#define CONVERSATION_MESSAGE_MAX_PREVIEW_BYTES GEARY_EMAIL_MAX_PREVIEW_BYTES
#define CONVERSATION_MESSAGE_MAX_INLINE_IMAGE_MAJOR_DIM 1024
#define CONVERSATION_MESSAGE_ACTION_CONVERSATION_NEW "conversation-new"
#define CONVERSATION_MESSAGE_ACTION_COPY_EMAIL "copy-email"
#define CONVERSATION_MESSAGE_ACTION_COPY_LINK "copy-link"
#define CONVERSATION_MESSAGE_ACTION_COPY_SELECTION "copy-selection"
#define CONVERSATION_MESSAGE_ACTION_OPEN_INSPECTOR "open-inspector"
#define CONVERSATION_MESSAGE_ACTION_OPEN_LINK "open-link"
#define CONVERSATION_MESSAGE_ACTION_SAVE_IMAGE "save-image"
#define CONVERSATION_MESSAGE_ACTION_SELECT_ALL "select-all"
#define CONVERSATION_MESSAGE_ACTION_SHOW_IMAGES_MESSAGE "show-images-message"
#define CONVERSATION_MESSAGE_ACTION_SHOW_IMAGES_SENDER "show-images-sender"
#define CONVERSATION_MESSAGE_ACTION_SHOW_IMAGES_DOMAIN "show-images-domain"
#define CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_PRIMARY_CLASS "geary-primary"
#define CONVERSATION_MESSAGE_CONTACT_LIST_SHORT_RESULTS 11
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD (conversation_message_contact_flow_box_child_get_type ())
#define CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, ConversationMessageContactFlowBoxChild))
#define CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, ConversationMessageContactFlowBoxChildClass))
#define CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD))
#define CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD))
#define CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, ConversationMessageContactFlowBoxChildClass))

typedef struct _ConversationMessageContactFlowBoxChild ConversationMessageContactFlowBoxChild;
typedef struct _ConversationMessageContactFlowBoxChildClass ConversationMessageContactFlowBoxChildClass;
enum  {
	CONVERSATION_MESSAGE_0_PROPERTY,
	CONVERSATION_MESSAGE_PRIMARY_CONTACT_PROPERTY,
	CONVERSATION_MESSAGE_PRIMARY_ORIGINATOR_PROPERTY,
	CONVERSATION_MESSAGE_SUMMARY_PROPERTY,
	CONVERSATION_MESSAGE_BODY_CONTAINER_PROPERTY,
	CONVERSATION_MESSAGE_INFO_BARS_PROPERTY,
	CONVERSATION_MESSAGE_IS_CONTENT_LOADED_PROPERTY,
	CONVERSATION_MESSAGE_NUM_PROPERTIES
};
static GParamSpec* conversation_message_properties[CONVERSATION_MESSAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _ConversationMessageGetSelectionForQuotingData ConversationMessageGetSelectionForQuotingData;
typedef struct _ConversationMessageGetSelectionForFindData ConversationMessageGetSelectionForFindData;
typedef struct _ConversationMessageEvaluateJavascriptData ConversationMessageEvaluateJavascriptData;
typedef struct _ConversationMessageLoadContactsData ConversationMessageLoadContactsData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _ConversationMessageLoadMessageBodyData ConversationMessageLoadMessageBodyData;
typedef struct _ConversationMessageHighlightSearchTermsData ConversationMessageHighlightSearchTermsData;
typedef struct _ConversationMessageFormatOriginatorCompactData ConversationMessageFormatOriginatorCompactData;
typedef enum  {
	CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_FROM,
	CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_OTHER
} ConversationMessageContactFlowBoxChildType;

#define CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_TYPE (conversation_message_contact_flow_box_child_type_get_type ())
typedef struct _ConversationMessageFillOriginatorAddressesData ConversationMessageFillOriginatorAddressesData;
typedef struct _ConversationMessageFillHeaderAddressesData ConversationMessageFillHeaderAddressesData;
typedef struct _Block98Data Block98Data;
typedef struct _Block99Data Block99Data;
typedef struct _Block100Data Block100Data;
typedef struct _Block101Data Block101Data;
typedef struct _ConversationMessageContactFlowBoxChildPrivate ConversationMessageContactFlowBoxChildPrivate;
enum  {
	CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_0_PROPERTY,
	CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_ADDRESS_TYPE_PROPERTY,
	CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_CONTACT_PROPERTY,
	CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_DISPLAYED_PROPERTY,
	CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_SOURCE_PROPERTY,
	CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_NUM_PROPERTIES
};
static GParamSpec* conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_NUM_PROPERTIES];
enum  {
	CONVERSATION_MESSAGE_CONTACT_LIST_0_PROPERTY,
	CONVERSATION_MESSAGE_CONTACT_LIST_NUM_PROPERTIES
};
static GParamSpec* conversation_message_contact_list_properties[CONVERSATION_MESSAGE_CONTACT_LIST_NUM_PROPERTIES];
enum  {
	CONVERSATION_MESSAGE_INTERNAL_LINK_ACTIVATED_SIGNAL,
	CONVERSATION_MESSAGE_FLAG_REMOTE_IMAGES_SIGNAL,
	CONVERSATION_MESSAGE_SAVE_IMAGE_SIGNAL,
	CONVERSATION_MESSAGE_INTERNAL_RESOURCE_LOADED_SIGNAL,
	CONVERSATION_MESSAGE_SELECTION_CHANGED_SIGNAL,
	CONVERSATION_MESSAGE_CONTENT_LOADED_SIGNAL,
	CONVERSATION_MESSAGE_NUM_SIGNALS
};
static guint conversation_message_signals[CONVERSATION_MESSAGE_NUM_SIGNALS] = {0};

struct _ConversationMessagePrivate {
	ApplicationContact* _primary_contact;
	GearyRFC822MailboxAddress* _primary_originator;
	GtkGrid* _summary;
	GtkGrid* _body_container;
	ComponentsInfoBarStack* _info_bars;
	ConversationWebView* _web_view;
	GearyEmailHeaderSet* headers;
	ApplicationConfiguration* config;
	ApplicationContactStore* contacts;
	GDateTime* local_date;
	HdyAvatar* avatar;
	GtkRevealer* compact_revealer;
	GtkLabel* compact_from;
	GtkLabel* compact_date;
	GtkLabel* compact_body;
	GtkRevealer* header_revealer;
	GtkFlowBox* from;
	GtkLabel* subject;
	gchar* subject_searchable;
	GtkLabel* date;
	GtkGrid* sender_header;
	GtkFlowBox* sender_address;
	GtkGrid* reply_to_header;
	GtkFlowBox* reply_to_addresses;
	GtkGrid* to_header;
	GtkGrid* cc_header;
	GtkGrid* bcc_header;
	GtkRevealer* body_revealer;
	GtkProgressBar* body_progress;
	ComponentsInfoBar* remote_images_info_bar;
	GtkWidget* body_placeholder;
	gchar* empty_from_label;
	GtkMenu* context_menu;
	GMenuModel* context_menu_link;
	GMenuModel* context_menu_email;
	GMenuModel* context_menu_image;
	GMenuModel* context_menu_main;
	GMenuModel* context_menu_inspector;
	GMenuModel* show_images_menu;
	GeeList* searchable_addresses;
	GeeMap* resources;
	GSimpleActionGroup* message_actions;
	gint next_replaced_buffer_number;
	gboolean load_remote_resources;
	gint remote_resources_requested;
	gint remote_resources_loaded;
	gboolean authenticated_message;
	GearyTimeoutManager* show_progress_timeout;
	GearyTimeoutManager* hide_progress_timeout;
	GearyTimeoutManager* progress_pulse;
};

struct _ConversationMessageGetSelectionForQuotingData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	gchar* result;
	ConversationWebView* _tmp0_;
	gchar* _tmp1_;
	ConversationWebView* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GError* _inner_error0_;
};

struct _ConversationMessageGetSelectionForFindData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	gchar* result;
	ConversationWebView* _tmp0_;
	gchar* _tmp1_;
	ConversationWebView* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GError* _inner_error0_;
};

struct _ConversationMessageEvaluateJavascriptData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	gchar* script;
	GCancellable* cancellable;
	ConversationWebView* _tmp0_;
	ConversationWebView* _tmp1_;
	JSCValue* _tmp2_;
	JSCValue* _tmp3_;
	GError* _inner_error0_;
};

struct _ConversationMessageLoadContactsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	GCancellable* cancellable;
	ApplicationMainWindow* main;
	GtkWidget* _tmp0_;
	ApplicationMainWindow* _tmp1_;
	gboolean _tmp2_;
	ApplicationMainWindow* _tmp3_;
	GearyRFC822MailboxAddress* _tmp4_;
	ApplicationContact* _tmp5_;
	ApplicationContactStore* _tmp6_;
	GearyRFC822MailboxAddress* _tmp7_;
	ApplicationContact* _tmp8_;
	ApplicationContact* _tmp9_;
	ApplicationContact* _tmp10_;
	HdyAvatar* _tmp11_;
	ApplicationContact* _tmp12_;
	HdyAvatar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	GtkLabel* _tmp16_;
	GearyEmailHeaderSet* headers;
	GearyEmailHeaderSet* _tmp17_;
	GearyEmailHeaderSet* _tmp18_;
	GearyEmailHeaderSet* _tmp19_;
	GearyRFC822MailboxAddresses* _tmp20_;
	GearyRFC822MailboxAddresses* _tmp21_;
	GearyEmailHeaderSet* _tmp22_;
	GearyRFC822MailboxAddresses* _tmp23_;
	GearyRFC822MailboxAddresses* _tmp24_;
	GearyEmailHeaderSet* _tmp25_;
	GearyRFC822MailboxAddress* _tmp26_;
	GearyRFC822MailboxAddress* _tmp27_;
	GtkGrid* _tmp28_;
	GearyEmailHeaderSet* _tmp29_;
	GearyRFC822MailboxAddresses* _tmp30_;
	GearyRFC822MailboxAddresses* _tmp31_;
	GtkGrid* _tmp32_;
	GearyEmailHeaderSet* _tmp33_;
	GearyRFC822MailboxAddresses* _tmp34_;
	GearyRFC822MailboxAddresses* _tmp35_;
	GtkGrid* _tmp36_;
	GearyEmailHeaderSet* _tmp37_;
	GearyRFC822MailboxAddresses* _tmp38_;
	GearyRFC822MailboxAddresses* _tmp39_;
	GError* _inner_error0_;
};

struct _ConversationMessageLoadMessageBodyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	GearyRFC822Message* message;
	GCancellable* load_cancelled;
	GError* _tmp0_;
	ConversationWebView* _tmp1_;
	gboolean contact_load_images;
	ApplicationContact* _tmp2_;
	ApplicationConfiguration* _tmp3_;
	gboolean _tmp4_;
	GearyRFC822AuthenticationResults* _tmp5_;
	GearyRFC822AuthenticationResults* _tmp6_;
	gboolean _tmp7_;
	GearyRFC822AuthenticationResults* _tmp8_;
	GearyRFC822AuthenticationResults* _tmp9_;
	GearyRFC822AuthenticationResults* _tmp10_;
	GearyRFC822AuthenticationResults* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	ConversationWebView* _tmp14_;
	gchar* body_text;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	GError* err;
	GError* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	ConversationWebView* _tmp23_;
	GError* _inner_error0_;
};

struct _ConversationMessageHighlightSearchTermsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	GeeSet* search_matches;
	GCancellable* cancellable;
	guint result;
	guint headers_found;
	GeeIterator* _raw_match_it;
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	gchar* raw_match;
	GeeIterator* _tmp2_;
	gpointer _tmp3_;
	gchar* match;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	GtkLabel* _tmp8_;
	GtkStyleContext* _tmp9_;
	guint _tmp10_;
	GtkLabel* _tmp11_;
	GtkStyleContext* _tmp12_;
	GeeList* _address_list;
	GeeList* _tmp13_;
	gint _address_size;
	GeeList* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gint _address_index;
	gint _tmp17_;
	gint _tmp18_;
	ConversationMessageContactFlowBoxChild* address;
	GeeList* _tmp19_;
	gpointer _tmp20_;
	ConversationMessageContactFlowBoxChild* _tmp21_;
	const gchar* _tmp22_;
	guint _tmp23_;
	ConversationWebView* _tmp24_;
	guint webkit_found;
	ConversationWebView* _tmp25_;
	GError* _inner_error0_;
};

struct _ConversationMessageFormatOriginatorCompactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	GCancellable* cancellable;
	gchar* result;
	GearyRFC822MailboxAddresses* from;
	GearyEmailHeaderSet* _tmp0_;
	GearyRFC822MailboxAddresses* _tmp1_;
	GearyRFC822MailboxAddresses* _tmp2_;
	GearyRFC822MailboxAddresses* _tmp3_;
	gchar* text;
	gchar* _tmp4_;
	gboolean _tmp5_;
	GearyRFC822MailboxAddresses* _tmp6_;
	GearyRFC822MailboxAddresses* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	gint i;
	GeeList* list;
	GearyRFC822MailboxAddresses* _tmp10_;
	GeeList* _tmp11_;
	GeeList* _addr_list;
	GeeList* _tmp12_;
	gint _addr_size;
	GeeList* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	gint _addr_index;
	gint _tmp16_;
	gint _tmp17_;
	GearyRFC822MailboxAddress* addr;
	GeeList* _tmp18_;
	gpointer _tmp19_;
	ApplicationContact* originator;
	ApplicationContactStore* _tmp20_;
	GearyRFC822MailboxAddress* _tmp21_;
	ApplicationContact* _tmp22_;
	const gchar* _tmp23_;
	ApplicationContact* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	gint _tmp28_;
	GeeList* _tmp29_;
	gint _tmp30_;
	gint _tmp31_;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	GError* _inner_error0_;
};

struct _ConversationMessageFillOriginatorAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	GearyRFC822MailboxAddresses* from;
	GearyRFC822MailboxAddresses* reply_to;
	GearyRFC822MailboxAddress* sender;
	GCancellable* cancellable;
	gboolean _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	GearyRFC822MailboxAddresses* _address_list;
	gint _address_size;
	GearyRFC822MailboxAddresses* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _address_index;
	gint _tmp6_;
	gint _tmp7_;
	GearyRFC822MailboxAddress* address;
	GearyRFC822MailboxAddresses* _tmp8_;
	GearyRFC822MailboxAddress* _tmp9_;
	ApplicationContact* _tmp10_;
	ApplicationContactStore* _tmp11_;
	GearyRFC822MailboxAddress* _tmp12_;
	ApplicationContact* _tmp13_;
	ConversationMessageContactFlowBoxChild* child;
	GearyRFC822MailboxAddress* _tmp14_;
	ConversationMessageContactFlowBoxChild* _tmp15_;
	GeeList* _tmp16_;
	ConversationMessageContactFlowBoxChild* _tmp17_;
	GtkFlowBox* _tmp18_;
	ConversationMessageContactFlowBoxChild* _tmp19_;
	GtkLabel* label;
	GtkLabel* _tmp20_;
	GtkLabel* _tmp21_;
	const gchar* _tmp22_;
	GtkFlowBoxChild* _vala1_child;
	GtkFlowBoxChild* _tmp23_;
	GtkFlowBoxChild* _tmp24_;
	GtkLabel* _tmp25_;
	GtkFlowBoxChild* _tmp26_;
	GtkFlowBoxChild* _tmp27_;
	GtkFlowBox* _tmp28_;
	GtkFlowBoxChild* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	ApplicationContact* _tmp34_;
	ApplicationContactStore* _tmp35_;
	ApplicationContact* _tmp36_;
	ConversationMessageContactFlowBoxChild* _vala2_child;
	ConversationMessageContactFlowBoxChild* _tmp37_;
	GeeList* _tmp38_;
	ConversationMessageContactFlowBoxChild* _tmp39_;
	GtkGrid* _tmp40_;
	GtkFlowBox* _tmp41_;
	ConversationMessageContactFlowBoxChild* _tmp42_;
	GearyRFC822MailboxAddresses* _vala1__address_list;
	gint _vala1__address_size;
	GearyRFC822MailboxAddresses* _tmp43_;
	gint _tmp44_;
	gint _tmp45_;
	gint _vala1__address_index;
	gint _tmp46_;
	gint _tmp47_;
	GearyRFC822MailboxAddress* _vala1_address;
	GearyRFC822MailboxAddresses* _tmp48_;
	GearyRFC822MailboxAddress* _tmp49_;
	gboolean _tmp50_;
	GearyRFC822MailboxAddress* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	ApplicationContact* _tmp54_;
	ApplicationContactStore* _tmp55_;
	GearyRFC822MailboxAddress* _tmp56_;
	ApplicationContact* _tmp57_;
	ConversationMessageContactFlowBoxChild* _vala3_child;
	GearyRFC822MailboxAddress* _tmp58_;
	ConversationMessageContactFlowBoxChild* _tmp59_;
	GeeList* _tmp60_;
	ConversationMessageContactFlowBoxChild* _tmp61_;
	GtkFlowBox* _tmp62_;
	ConversationMessageContactFlowBoxChild* _tmp63_;
	GtkGrid* _tmp64_;
	GError* _inner_error0_;
};

struct _ConversationMessageFillHeaderAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ConversationMessage* self;
	GtkGrid* header;
	GearyRFC822MailboxAddresses* addresses;
	GCancellable* cancellable;
	gboolean _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	ConversationMessageContactList* box;
	GList* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	gconstpointer _tmp6_;
	GtkWidget* _tmp7_;
	ConversationMessageContactList* _tmp8_;
	ConversationMessageContactList* _tmp9_;
	ConversationMessageContactList* _tmp10_;
	GearyRFC822MailboxAddresses* _address_list;
	gint _address_size;
	GearyRFC822MailboxAddresses* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gint _address_index;
	gint _tmp14_;
	gint _tmp15_;
	GearyRFC822MailboxAddress* address;
	GearyRFC822MailboxAddresses* _tmp16_;
	GearyRFC822MailboxAddress* _tmp17_;
	ApplicationContact* _tmp18_;
	ApplicationContactStore* _tmp19_;
	GearyRFC822MailboxAddress* _tmp20_;
	ApplicationContact* _tmp21_;
	ConversationMessageContactFlowBoxChild* child;
	GearyRFC822MailboxAddress* _tmp22_;
	ConversationMessageContactFlowBoxChild* _tmp23_;
	GeeList* _tmp24_;
	ConversationMessageContactFlowBoxChild* _tmp25_;
	ConversationMessageContactList* _tmp26_;
	ConversationMessageContactFlowBoxChild* _tmp27_;
	GError* _inner_error0_;
};

struct _Block98Data {
	int _ref_count_;
	ConversationMessage* self;
	ConversationMessageContactFlowBoxChild* address_child;
};

struct _Block99Data {
	int _ref_count_;
	ConversationMessage* self;
	GtkPopover* link_popover;
	ApplicationMainWindow* main;
};

struct _Block100Data {
	int _ref_count_;
	ConversationMessage* self;
	gchar* uri;
	gchar* alt_text;
};

struct _Block101Data {
	int _ref_count_;
	Block100Data * _data100_;
	WebKitWebResource* response;
};

struct _ConversationMessageContactFlowBoxChild {
	GtkFlowBoxChild parent_instance;
	ConversationMessageContactFlowBoxChildPrivate * priv;
};

struct _ConversationMessageContactFlowBoxChildClass {
	GtkFlowBoxChildClass parent_class;
};

struct _ConversationMessageContactFlowBoxChildPrivate {
	ConversationMessageContactFlowBoxChildType _address_type;
	ApplicationContact* _contact;
	GearyRFC822MailboxAddress* _displayed;
	GearyRFC822MailboxAddress* _source;
	gchar* search_value;
	GtkBin* container;
};

struct _ConversationMessageContactListPrivate {
	GtkLabel* show_more;
	GtkLabel* show_less;
	gboolean expanded;
	gint children;
};

static gint ConversationMessage_private_offset;
static gpointer conversation_message_parent_class = NULL;
static gint ConversationMessageContactFlowBoxChild_private_offset;
static gpointer conversation_message_contact_flow_box_child_parent_class = NULL;
static gint ConversationMessageContactList_private_offset;
static gpointer conversation_message_contact_list_parent_class = NULL;
static GearyBaseInterfaceIface * conversation_message_contact_list_geary_base_interface_parent_iface = NULL;
static GearyBaseInterfaceIface * conversation_message_geary_base_interface_parent_iface = NULL;

static GType conversation_message_contact_flow_box_child_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN ApplicationContact* conversation_message_get_primary_contact (ConversationMessage* self);
static void conversation_message_set_primary_contact (ConversationMessage* self,
                                               ApplicationContact* value);
VALA_EXTERN GearyRFC822MailboxAddress* conversation_message_get_primary_originator (ConversationMessage* self);
static void conversation_message_set_primary_originator (ConversationMessage* self,
                                                  GearyRFC822MailboxAddress* value);
VALA_EXTERN GtkGrid* conversation_message_get_summary (ConversationMessage* self);
VALA_EXTERN GtkGrid* conversation_message_get_body_container (ConversationMessage* self);
VALA_EXTERN ComponentsInfoBarStack* conversation_message_get_info_bars (ConversationMessage* self);
VALA_EXTERN gboolean conversation_message_get_is_content_loaded (ConversationMessage* self);
static ConversationWebView* conversation_message_get_web_view (ConversationMessage* self);
static void conversation_message_set_web_view (ConversationMessage* self,
                                        ConversationWebView* value);
static void g_cclosure_user_marshal_VOID__STRING_STRING_OBJECT (GClosure * closure,
                                                         GValue * return_value,
                                                         guint n_param_values,
                                                         const GValue * param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
static ConversationMessage* conversation_message_new (GearyEmailHeaderSet* headers,
                                               const gchar* preview,
                                               gboolean load_remote_resources,
                                               ApplicationContactStore* contacts,
                                               ApplicationConfiguration* config);
static ConversationMessage* conversation_message_construct (GType object_type,
                                                     GearyEmailHeaderSet* headers,
                                                     const gchar* preview,
                                                     gboolean load_remote_resources,
                                                     ApplicationContactStore* contacts,
                                                     ApplicationConfiguration* config);
static void conversation_message_trigger_internal_resource_loaded (ConversationMessage* self,
                                                            const gchar* name);
static void conversation_message_trigger_content_loaded (ConversationMessage* self);
static GSimpleAction* conversation_message_add_action (ConversationMessage* self,
                                                const gchar* name,
                                                gboolean enabled,
                                                const GVariantType* type);
static void conversation_message_on_link_activated (ConversationMessage* self,
                                             GVariant* param);
static void _conversation_message_on_link_activated_g_simple_action_activate (GSimpleAction* _sender,
                                                                       GVariant* parameter,
                                                                       gpointer self);
static void conversation_message_on_copy_email_address (ConversationMessage* self,
                                                 GVariant* param);
static void _conversation_message_on_copy_email_address_g_simple_action_activate (GSimpleAction* _sender,
                                                                           GVariant* parameter,
                                                                           gpointer self);
static void conversation_message_on_copy_link (ConversationMessage* self,
                                        GVariant* param);
static void _conversation_message_on_copy_link_g_simple_action_activate (GSimpleAction* _sender,
                                                                  GVariant* parameter,
                                                                  gpointer self);
static void conversation_message_on_save_image (ConversationMessage* self,
                                         GVariant* param);
static void _conversation_message_on_save_image_g_simple_action_activate (GSimpleAction* _sender,
                                                                   GVariant* parameter,
                                                                   gpointer self);
static void conversation_message_on_show_images (ConversationMessage* self,
                                          GVariant* param);
static void _conversation_message_on_show_images_g_simple_action_activate (GSimpleAction* _sender,
                                                                    GVariant* parameter,
                                                                    gpointer self);
static void conversation_message_on_show_images_sender (ConversationMessage* self,
                                                 GVariant* param);
static void _conversation_message_on_show_images_sender_g_simple_action_activate (GSimpleAction* _sender,
                                                                           GVariant* parameter,
                                                                           gpointer self);
static void conversation_message_on_show_images_domain (ConversationMessage* self,
                                                 GVariant* param);
static void _conversation_message_on_show_images_domain_g_simple_action_activate (GSimpleAction* _sender,
                                                                           GVariant* parameter,
                                                                           gpointer self);
static void conversation_message_on_show_progress_timeout (ConversationMessage* self);
static void _conversation_message_on_show_progress_timeout_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                                        gpointer self);
static void conversation_message_on_hide_progress_timeout (ConversationMessage* self);
static void _conversation_message_on_hide_progress_timeout_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                                        gpointer self);
static void _gtk_progress_bar_pulse_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                 gpointer self);
static void conversation_message_initialize_web_view (ConversationMessage* self);
VALA_EXTERN ConversationWebView* conversation_viewer_get_previous_web_view (ConversationViewer* self);
VALA_EXTERN ConversationWebView* conversation_web_view_new_with_related_view (ApplicationConfiguration* config,
                                                                  ConversationWebView* related);
VALA_EXTERN ConversationWebView* conversation_web_view_construct_with_related_view (GType object_type,
                                                                        ApplicationConfiguration* config,
                                                                        ConversationWebView* related);
VALA_EXTERN void conversation_viewer_set_previous_web_view (ConversationViewer* self,
                                                ConversationWebView* value);
static gboolean conversation_message_on_context_menu (ConversationMessage* self,
                                               WebKitWebView* view,
                                               WebKitContextMenu* context_menu,
                                               GdkEvent* event,
                                               WebKitHitTestResult* hit_test);
static gboolean _conversation_message_on_context_menu_webkit_web_view_context_menu (WebKitWebView* _sender,
                                                                             WebKitContextMenu* context_menu,
                                                                             GdkEvent* event,
                                                                             WebKitHitTestResult* hit_test_result,
                                                                             gpointer self);
static void conversation_message_on_deceptive_link_clicked (ConversationMessage* self,
                                                     ConversationWebViewDeceptiveText reason,
                                                     const gchar* text,
                                                     const gchar* href,
                                                     GdkRectangle* location);
static void _conversation_message_on_deceptive_link_clicked_conversation_web_view_deceptive_link_clicked (ConversationWebView* _sender,
                                                                                                   ConversationWebViewDeceptiveText reason,
                                                                                                   const gchar* text,
                                                                                                   const gchar* href,
                                                                                                   GdkRectangle* location,
                                                                                                   gpointer self);
static void __lambda84_ (ConversationMessage* self,
                  const gchar* link);
static void ___lambda84__components_web_view_link_activated (ComponentsWebView* _sender,
                                                      const gchar* uri,
                                                      gpointer self);
static void conversation_message_on_mouse_target_changed (ConversationMessage* self,
                                                   WebKitWebView* web_view,
                                                   WebKitHitTestResult* hit_test,
                                                   guint modifiers);
static void _conversation_message_on_mouse_target_changed_webkit_web_view_mouse_target_changed (WebKitWebView* _sender,
                                                                                         WebKitHitTestResult* hit_test_result,
                                                                                         guint modifiers,
                                                                                         gpointer self);
static void conversation_message_on_selection_changed (ConversationMessage* self);
static void _conversation_message_on_selection_changed_g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self);
static void conversation_message_on_resource_load_started (ConversationMessage* self,
                                                    WebKitWebView* view,
                                                    WebKitWebResource* res,
                                                    WebKitURIRequest* req);
static void _conversation_message_on_resource_load_started_webkit_web_view_resource_load_started (WebKitWebView* _sender,
                                                                                           WebKitWebResource* resource,
                                                                                           WebKitURIRequest* request,
                                                                                           gpointer self);
static void conversation_message_on_remote_resources_blocked (ConversationMessage* self);
static void _conversation_message_on_remote_resources_blocked_components_web_view_remote_resource_load_blocked (ComponentsWebView* _sender,
                                                                                                         gpointer self);
static void _conversation_message_trigger_internal_resource_loaded_components_web_view_internal_resource_loaded (ComponentsWebView* _sender,
                                                                                                          const gchar* name,
                                                                                                          gpointer self);
static void _conversation_message_trigger_content_loaded_components_web_view_content_loaded (ComponentsWebView* _sender,
                                                                                      gpointer self);
static void __lambda87_ (ConversationMessage* self);
static void ___lambda87__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda88_ (ConversationMessage* self);
static void ___lambda88__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda89_ (ConversationMessage* self);
static void ___lambda89__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void conversation_message_real_destroy (GtkWidget* base);
static void conversation_message_get_selection_for_quoting_data_free (gpointer _data);
static gboolean conversation_message_get_selection_for_quoting_co (ConversationMessageGetSelectionForQuotingData* _data_);
static void conversation_message_get_selection_for_quoting_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void conversation_message_get_selection_for_find_data_free (gpointer _data);
static gboolean conversation_message_get_selection_for_find_co (ConversationMessageGetSelectionForFindData* _data_);
static void conversation_message_get_selection_for_find_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void conversation_message_evaluate_javascript_data_free (gpointer _data);
static gboolean conversation_message_evaluate_javascript_co (ConversationMessageEvaluateJavascriptData* _data_);
static void conversation_message_evaluate_javascript_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static inline void conversation_message_set_revealer (ConversationMessage* self,
                                        GtkRevealer* revealer,
                                        gboolean expand,
                                        gboolean use_transition);
static void conversation_message_show_placeholder_pane (ConversationMessage* self,
                                                 GtkWidget* placeholder);
static void conversation_message_load_contacts_data_free (gpointer _data);
static gboolean conversation_message_load_contacts_co (ConversationMessageLoadContactsData* _data_);
static void conversation_message_load_contacts_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void conversation_message_format_originator_compact (ConversationMessage* self,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static gchar* conversation_message_format_originator_compact_finish (ConversationMessage* self,
                                                              GAsyncResult* _res_,
                                                              GError** error);
static void conversation_message_fill_originator_addresses (ConversationMessage* self,
                                                     GearyRFC822MailboxAddresses* from,
                                                     GearyRFC822MailboxAddresses* reply_to,
                                                     GearyRFC822MailboxAddress* sender,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
static void conversation_message_fill_originator_addresses_finish (ConversationMessage* self,
                                                            GAsyncResult* _res_,
                                                            GError** error);
static void conversation_message_fill_header_addresses (ConversationMessage* self,
                                                 GtkGrid* header,
                                                 GearyRFC822MailboxAddresses* addresses,
                                                 GCancellable* cancellable,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void conversation_message_fill_header_addresses_finish (ConversationMessage* self,
                                                        GAsyncResult* _res_,
                                                        GError** error);
static void conversation_message_load_message_body_data_free (gpointer _data);
static gboolean conversation_message_load_message_body_co (ConversationMessageLoadMessageBodyData* _data_);
static void conversation_message_load_message_body_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static gchar* conversation_message_inline_image_replacer (ConversationMessage* self,
                                                   GearyRFC822Part* part);
static gchar* _conversation_message_inline_image_replacer_geary_rf_c822_message_inline_part_replacer (GearyRFC822Part* part,
                                                                                               gpointer self);
static void __lambda92_ (ConversationMessage* self);
static void ___lambda92__g_cancellable_cancelled (GCancellable* _sender,
                                           gpointer self);
static void conversation_message_highlight_search_terms_data_free (gpointer _data);
static gboolean conversation_message_highlight_search_terms_co (ConversationMessageHighlightSearchTermsData* _data_);
static gboolean conversation_message_contact_flow_box_child_highlight_search_term (ConversationMessageContactFlowBoxChild* self,
                                                                            const gchar* term);
static void conversation_message_highlight_search_terms_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void conversation_message_contact_flow_box_child_unmark_search_terms (ConversationMessageContactFlowBoxChild* self);
static void conversation_message_set_action_enabled (ConversationMessage* self,
                                              const gchar* name,
                                              gboolean enabled);
static GMenu* conversation_message_set_action_param_value (ConversationMessage* self,
                                                    GMenuModel* existing,
                                                    GVariant* value);
static void conversation_message_format_originator_compact_data_free (gpointer _data);
static gboolean conversation_message_format_originator_compact_co (ConversationMessageFormatOriginatorCompactData* _data_);
static void conversation_message_format_originator_compact_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void conversation_message_fill_originator_addresses_data_free (gpointer _data);
static gboolean conversation_message_fill_originator_addresses_co (ConversationMessageFillOriginatorAddressesData* _data_);
static void conversation_message_fill_originator_addresses_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static GType conversation_message_contact_flow_box_child_type_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static ConversationMessageContactFlowBoxChild* conversation_message_contact_flow_box_child_new (ApplicationContact* contact,
                                                                                         GearyRFC822MailboxAddress* source,
                                                                                         ConversationMessageContactFlowBoxChildType address_type);
static ConversationMessageContactFlowBoxChild* conversation_message_contact_flow_box_child_construct (GType object_type,
                                                                                               ApplicationContact* contact,
                                                                                               GearyRFC822MailboxAddress* source,
                                                                                               ConversationMessageContactFlowBoxChildType address_type);
static void conversation_message_fill_header_addresses_data_free (gpointer _data);
static gboolean conversation_message_fill_header_addresses_co (ConversationMessageFillHeaderAddressesData* _data_);
static void conversation_message_fill_header_addresses_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static void conversation_message_show_images (ConversationMessage* self,
                                       gboolean update_email_flag);
static void __lambda85_ (ConversationMessage* self);
static void ___lambda85__webkit_web_resource_finished (WebKitWebResource* _sender,
                                                gpointer self);
static void conversation_message_on_address_box_child_activated (ConversationMessage* self,
                                                          GtkFlowBox* box,
                                                          GtkFlowBoxChild* child);
static Block98Data* block98_data_ref (Block98Data* _data98_);
static void block98_data_unref (void * _userdata_);
static GearyRFC822MailboxAddress* conversation_message_contact_flow_box_child_get_displayed (ConversationMessageContactFlowBoxChild* self);
static GVariant* _variant_new26 (gchar* value);
static ApplicationContact* conversation_message_contact_flow_box_child_get_contact (ConversationMessageContactFlowBoxChild* self);
static void ___lambda96_ (Block98Data* _data98_,
                   gboolean enabled);
static void ____lambda96__conversation_contact_popover_load_remote_resources_changed (ConversationContactPopover* _sender,
                                                                               gboolean enabled,
                                                                               gpointer self);
static void ___lambda97_ (Block98Data* _data98_);
static void ____lambda97__gtk_popover_closed (GtkPopover* _sender,
                                       gpointer self);
static void _conversation_message_on_address_box_child_activated_gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                                                                        GtkFlowBoxChild* child,
                                                                                        gpointer self);
static Block99Data* block99_data_ref (Block99Data* _data99_);
static void block99_data_unref (void * _userdata_);
static gboolean __lambda81_ (Block99Data* _data99_,
                      GtkLabel* label,
                      const gchar* uri);
static gboolean ___lambda81__gtk_label_activate_link (GtkLabel* _sender,
                                               const gchar* uri,
                                               gpointer self);
static gboolean __lambda82_ (Block99Data* _data99_,
                      GtkLabel* label,
                      const gchar* uri);
static gboolean ___lambda82__gtk_label_activate_link (GtkLabel* _sender,
                                               const gchar* uri,
                                               gpointer self);
static void __lambda83_ (Block99Data* _data99_);
static void ___lambda83__gtk_popover_closed (GtkPopover* _sender,
                                      gpointer self);
static void ____lambda86_ (ConversationMessage* self);
static void _____lambda86__components_info_bar_response (ComponentsInfoBar* _sender,
                                                  gint response_id,
                                                  gpointer self);
static Block100Data* block100_data_ref (Block100Data* _data100_);
static void block100_data_unref (void * _userdata_);
static gchar* _variant_get15 (GVariant* value);
static gchar* _variant_get16 (GVariant* value);
static Block101Data* block101_data_ref (Block101Data* _data101_);
static void block101_data_unref (void * _userdata_);
static void ___lambda80_ (Block101Data* _data101_,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda80__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void ___lambda47_ (ConversationMessage* self,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda47__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static ConversationMessageContactFlowBoxChildType conversation_message_contact_flow_box_child_get_address_type (ConversationMessageContactFlowBoxChild* self);
static void conversation_message_contact_flow_box_child_set_address_type (ConversationMessageContactFlowBoxChild* self,
                                                                   ConversationMessageContactFlowBoxChildType value);
static void conversation_message_contact_flow_box_child_set_contact (ConversationMessageContactFlowBoxChild* self,
                                                              ApplicationContact* value);
static void conversation_message_contact_flow_box_child_set_displayed (ConversationMessageContactFlowBoxChild* self,
                                                                GearyRFC822MailboxAddress* value);
static GearyRFC822MailboxAddress* conversation_message_contact_flow_box_child_get_source (ConversationMessageContactFlowBoxChild* self);
static void conversation_message_contact_flow_box_child_set_source (ConversationMessageContactFlowBoxChild* self,
                                                             GearyRFC822MailboxAddress* value);
static gboolean conversation_message_contact_flow_box_child_on_prelight_in_event (ConversationMessageContactFlowBoxChild* self,
                                                                           GdkEvent* event);
static gboolean _conversation_message_contact_flow_box_child_on_prelight_in_event_gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                                                                          GdkEventCrossing* event,
                                                                                                          gpointer self);
static gboolean conversation_message_contact_flow_box_child_on_prelight_out_event (ConversationMessageContactFlowBoxChild* self,
                                                                            GdkEvent* event);
static gboolean _conversation_message_contact_flow_box_child_on_prelight_out_event_gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                                                                           GdkEventCrossing* event,
                                                                                                           gpointer self);
static void conversation_message_contact_flow_box_child_on_contact_changed (ConversationMessageContactFlowBoxChild* self);
static void _conversation_message_contact_flow_box_child_on_contact_changed_application_contact_changed (ApplicationContact* _sender,
                                                                                                  gpointer self);
static void conversation_message_contact_flow_box_child_update (ConversationMessageContactFlowBoxChild* self);
static void conversation_message_contact_flow_box_child_real_destroy (GtkWidget* base);
static void conversation_message_contact_flow_box_child_finalize (GObject * obj);
static GType conversation_message_contact_flow_box_child_get_type_once (void);
static void _vala_conversation_message_contact_flow_box_child_get_property (GObject * object,
                                                                     guint property_id,
                                                                     GValue * value,
                                                                     GParamSpec * pspec);
static void _vala_conversation_message_contact_flow_box_child_set_property (GObject * object,
                                                                     guint property_id,
                                                                     const GValue * value,
                                                                     GParamSpec * pspec);
static void conversation_message_contact_list_real_add (GtkContainer* base,
                                                 GtkWidget* child);
static GtkLabel* conversation_message_contact_list_create_label (ConversationMessageContactList* self);
static void conversation_message_contact_list_set_expanded (ConversationMessageContactList* self,
                                                     gboolean expanded);
static gboolean conversation_message_contact_list_filter_func (ConversationMessageContactList* self,
                                                        GtkFlowBoxChild* child);
static GObject * conversation_message_contact_list_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties);
static gboolean _conversation_message_contact_list___lambda90_ (ConversationMessageContactList* self);
static gboolean __conversation_message_contact_list___lambda90__gtk_label_activate_link (GtkLabel* _sender,
                                                                                  const gchar* uri,
                                                                                  gpointer self);
static gboolean _conversation_message_contact_list___lambda91_ (ConversationMessageContactList* self);
static gboolean __conversation_message_contact_list___lambda91__gtk_label_activate_link (GtkLabel* _sender,
                                                                                  const gchar* uri,
                                                                                  gpointer self);
static gboolean _conversation_message_contact_list_filter_func_gtk_flow_box_filter_func (GtkFlowBoxChild* child,
                                                                                  gpointer self);
static void conversation_message_contact_list_finalize (GObject * obj);
static GType conversation_message_contact_list_get_type_once (void);
static void conversation_message_finalize (GObject * obj);
static GType conversation_message_get_type_once (void);
static void _vala_conversation_message_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_conversation_message_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
conversation_message_get_instance_private (ConversationMessage* self)
{
	return G_STRUCT_MEMBER_P (self, ConversationMessage_private_offset);
}

ApplicationContact*
conversation_message_get_primary_contact (ConversationMessage* self)
{
	ApplicationContact* result;
	ApplicationContact* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	_tmp0_ = self->priv->_primary_contact;
	result = _tmp0_;
	return result;
}

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

static void
conversation_message_set_primary_contact (ConversationMessage* self,
                                          ApplicationContact* value)
{
	ApplicationContact* old_value;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	old_value = conversation_message_get_primary_contact (self);
	if (old_value != value) {
		ApplicationContact* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_primary_contact);
		self->priv->_primary_contact = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_message_properties[CONVERSATION_MESSAGE_PRIMARY_CONTACT_PROPERTY]);
	}
}

GearyRFC822MailboxAddress*
conversation_message_get_primary_originator (ConversationMessage* self)
{
	GearyRFC822MailboxAddress* result;
	GearyRFC822MailboxAddress* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	_tmp0_ = self->priv->_primary_originator;
	result = _tmp0_;
	return result;
}

static void
conversation_message_set_primary_originator (ConversationMessage* self,
                                             GearyRFC822MailboxAddress* value)
{
	GearyRFC822MailboxAddress* old_value;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	old_value = conversation_message_get_primary_originator (self);
	if (old_value != value) {
		GearyRFC822MailboxAddress* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_primary_originator);
		self->priv->_primary_originator = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_message_properties[CONVERSATION_MESSAGE_PRIMARY_ORIGINATOR_PROPERTY]);
	}
}

GtkGrid*
conversation_message_get_summary (ConversationMessage* self)
{
	GtkGrid* result;
	GtkGrid* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	_tmp0_ = self->priv->_summary;
	result = _tmp0_;
	return result;
}

GtkGrid*
conversation_message_get_body_container (ConversationMessage* self)
{
	GtkGrid* result;
	GtkGrid* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	_tmp0_ = self->priv->_body_container;
	result = _tmp0_;
	return result;
}

ComponentsInfoBarStack*
conversation_message_get_info_bars (ConversationMessage* self)
{
	ComponentsInfoBarStack* result;
	ComponentsInfoBarStack* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	_tmp0_ = self->priv->_info_bars;
	result = _tmp0_;
	return result;
}

gboolean
conversation_message_get_is_content_loaded (ConversationMessage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	ConversationWebView* _tmp1_;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), FALSE);
	_tmp1_ = self->priv->_web_view;
	if (_tmp1_ != NULL) {
		ConversationWebView* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->_web_view;
		_tmp3_ = components_web_view_get_is_content_loaded (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static ConversationWebView*
conversation_message_get_web_view (ConversationMessage* self)
{
	ConversationWebView* result;
	ConversationWebView* _tmp0_;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	_tmp0_ = self->priv->_web_view;
	result = _tmp0_;
	return result;
}

static void
conversation_message_set_web_view (ConversationMessage* self,
                                   ConversationWebView* value)
{
	ConversationWebView* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_web_view);
	self->priv->_web_view = _tmp0_;
}

static void
g_cclosure_user_marshal_VOID__STRING_STRING_OBJECT (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_STRING_OBJECT) (gpointer data1, const char* arg_1, const char* arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__STRING_STRING_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__STRING_STRING_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_string (param_values + 2), g_value_get_object (param_values + 3), data2);
}

/**
     * Constructs a new view from an email's headers and body.
     *
     * This method sets up most of the user interface for displaying
     * the message, but does not attempt any possibly long-running
     * loading processes.
     */
ConversationMessage*
conversation_message_construct_from_email (GType object_type,
                                           GearyEmail* email,
                                           gboolean load_remote_resources,
                                           ApplicationContactStore* contacts,
                                           ApplicationConfiguration* config)
{
	ConversationMessage * self = NULL;
	gchar* _tmp0_ = NULL;
	GearyRFC822PreviewText* _tmp1_;
	GearyRFC822PreviewText* _tmp2_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (email, GEARY_TYPE_EMAIL), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONTACT_STORE (contacts), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONFIGURATION (config), NULL);
	_tmp1_ = geary_email_get_preview (email);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		GearyRFC822PreviewText* _tmp3_;
		GearyRFC822PreviewText* _tmp4_;
		GearyMemoryBuffer* _tmp5_;
		GearyMemoryBuffer* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = geary_email_get_preview (email);
		_tmp4_ = _tmp3_;
		_tmp5_ = geary_message_data_block_message_data_get_buffer (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEARY_MESSAGE_DATA_TYPE_BLOCK_MESSAGE_DATA, GearyMessageDataBlockMessageData));
		_tmp6_ = _tmp5_;
		_tmp7_ = geary_memory_buffer_get_valid_utf8 (_tmp6_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp7_;
	} else {
		_g_free0 (_tmp0_);
		_tmp0_ = NULL;
	}
	self = (ConversationMessage*) conversation_message_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (email, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet), _tmp0_, load_remote_resources, contacts, config);
	_g_free0 (_tmp0_);
	return self;
}

ConversationMessage*
conversation_message_new_from_email (GearyEmail* email,
                                     gboolean load_remote_resources,
                                     ApplicationContactStore* contacts,
                                     ApplicationConfiguration* config)
{
	return conversation_message_construct_from_email (TYPE_CONVERSATION_MESSAGE, email, load_remote_resources, contacts, config);
}

/**
     * Constructs a new view from an RFC 822 message's headers and body.
     *
     * This method sets up most of the user interface for displaying
     * the message, but does not attempt any possibly long-running
     * loading processes.
     */
ConversationMessage*
conversation_message_construct_from_message (GType object_type,
                                             GearyRFC822Message* message,
                                             gboolean load_remote_resources,
                                             ApplicationContactStore* contacts,
                                             ApplicationConfiguration* config)
{
	ConversationMessage * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (message, GEARY_RF_C822_TYPE_MESSAGE), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONTACT_STORE (contacts), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONFIGURATION (config), NULL);
	_tmp0_ = geary_rf_c822_message_get_preview (message);
	_tmp1_ = _tmp0_;
	self = (ConversationMessage*) conversation_message_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (message, GEARY_TYPE_EMAIL_HEADER_SET, GearyEmailHeaderSet), _tmp1_, load_remote_resources, contacts, config);
	_g_free0 (_tmp1_);
	return self;
}

ConversationMessage*
conversation_message_new_from_message (GearyRFC822Message* message,
                                       gboolean load_remote_resources,
                                       ApplicationContactStore* contacts,
                                       ApplicationConfiguration* config)
{
	return conversation_message_construct_from_message (TYPE_CONVERSATION_MESSAGE, message, load_remote_resources, contacts, config);
}

static void
conversation_message_trigger_internal_resource_loaded (ConversationMessage* self,
                                                       const gchar* name)
{
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (name != NULL);
	g_signal_emit (self, conversation_message_signals[CONVERSATION_MESSAGE_INTERNAL_RESOURCE_LOADED_SIGNAL], 0, name);
}

static void
conversation_message_trigger_content_loaded (ConversationMessage* self)
{
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_signal_emit (self, conversation_message_signals[CONVERSATION_MESSAGE_CONTENT_LOADED_SIGNAL], 0);
}

static void
_conversation_message_on_link_activated_g_simple_action_activate (GSimpleAction* _sender,
                                                                  GVariant* parameter,
                                                                  gpointer self)
{
	conversation_message_on_link_activated ((ConversationMessage*) self, parameter);
}

static void
_conversation_message_on_copy_email_address_g_simple_action_activate (GSimpleAction* _sender,
                                                                      GVariant* parameter,
                                                                      gpointer self)
{
	conversation_message_on_copy_email_address ((ConversationMessage*) self, parameter);
}

static void
_conversation_message_on_copy_link_g_simple_action_activate (GSimpleAction* _sender,
                                                             GVariant* parameter,
                                                             gpointer self)
{
	conversation_message_on_copy_link ((ConversationMessage*) self, parameter);
}

static void
_conversation_message_on_save_image_g_simple_action_activate (GSimpleAction* _sender,
                                                              GVariant* parameter,
                                                              gpointer self)
{
	conversation_message_on_save_image ((ConversationMessage*) self, parameter);
}

static void
_conversation_message_on_show_images_g_simple_action_activate (GSimpleAction* _sender,
                                                               GVariant* parameter,
                                                               gpointer self)
{
	conversation_message_on_show_images ((ConversationMessage*) self, parameter);
}

static void
_conversation_message_on_show_images_sender_g_simple_action_activate (GSimpleAction* _sender,
                                                                      GVariant* parameter,
                                                                      gpointer self)
{
	conversation_message_on_show_images_sender ((ConversationMessage*) self, parameter);
}

static void
_conversation_message_on_show_images_domain_g_simple_action_activate (GSimpleAction* _sender,
                                                                      GVariant* parameter,
                                                                      gpointer self)
{
	conversation_message_on_show_images_domain ((ConversationMessage*) self, parameter);
}

static void
_conversation_message_on_show_progress_timeout_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                                   gpointer self)
{
	conversation_message_on_show_progress_timeout ((ConversationMessage*) self);
}

static void
_conversation_message_on_hide_progress_timeout_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                                                   gpointer self)
{
	conversation_message_on_hide_progress_timeout ((ConversationMessage*) self);
}

static void
_gtk_progress_bar_pulse_geary_timeout_manager_timeout_func (GearyTimeoutManager* manager,
                                                            gpointer self)
{
	gtk_progress_bar_pulse ((GtkProgressBar*) self);
}

static ConversationMessage*
conversation_message_construct (GType object_type,
                                GearyEmailHeaderSet* headers,
                                const gchar* preview,
                                gboolean load_remote_resources,
                                ApplicationContactStore* contacts,
                                ApplicationConfiguration* config)
{
	ConversationMessage * self = NULL;
	GearyEmailHeaderSet* _tmp0_;
	GearyRFC822MailboxAddress* _tmp1_;
	GearyRFC822MailboxAddress* _tmp2_;
	ApplicationConfiguration* _tmp3_;
	ApplicationContactStore* _tmp4_;
	const GVariantType* _tmp5_;
	GSimpleAction* _tmp6_;
	GSimpleAction* _tmp7_;
	const GVariantType* _tmp8_;
	GSimpleAction* _tmp9_;
	GSimpleAction* _tmp10_;
	const GVariantType* _tmp11_;
	GSimpleAction* _tmp12_;
	GSimpleAction* _tmp13_;
	const GVariantType* _tmp14_;
	GSimpleAction* _tmp15_;
	GSimpleAction* _tmp16_;
	GVariantType* _tmp17_;
	GVariantType* _tmp18_;
	GSimpleAction* _tmp19_;
	GSimpleAction* _tmp20_;
	GSimpleAction* _tmp21_;
	GSimpleAction* _tmp22_;
	GSimpleAction* _tmp23_;
	GSimpleAction* _tmp24_;
	GSimpleAction* _tmp25_;
	GSimpleAction* _tmp26_;
	GSimpleActionGroup* _tmp27_;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp28_;
	GtkBuilder* _tmp29_;
	GObject* _tmp30_;
	GMenuModel* _tmp31_;
	GtkBuilder* _tmp32_;
	GObject* _tmp33_;
	GMenuModel* _tmp34_;
	GtkBuilder* _tmp35_;
	GObject* _tmp36_;
	GMenuModel* _tmp37_;
	GtkBuilder* _tmp38_;
	GObject* _tmp39_;
	GMenuModel* _tmp40_;
	GtkBuilder* _tmp41_;
	GObject* _tmp42_;
	GMenuModel* _tmp43_;
	gboolean _tmp44_;
	gboolean _tmp45_;
	GearyRFC822Date* _tmp49_;
	GearyRFC822Date* _tmp50_;
	gchar* _tmp56_;
	GtkLabel* _tmp57_;
	GtkStyleContext* _tmp58_;
	GearyRFC822Subject* _tmp67_;
	GearyRFC822Subject* _tmp68_;
	GtkGrid* _tmp80_;
	GearyTimeoutManager* _tmp81_;
	GearyTimeoutManager* _tmp82_;
	GtkProgressBar* _tmp83_;
	GearyTimeoutManager* _tmp84_;
	GearyTimeoutManager* _tmp85_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (headers, GEARY_TYPE_EMAIL_HEADER_SET), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONTACT_STORE (contacts), NULL);
	g_return_val_if_fail (APPLICATION_IS_CONFIGURATION (config), NULL);
	self = (ConversationMessage*) g_object_new (object_type, NULL);
	geary_base_interface_base_ref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	_tmp0_ = _g_object_ref0 (headers);
	_g_object_unref0 (self->priv->headers);
	self->priv->headers = _tmp0_;
	self->priv->load_remote_resources = load_remote_resources;
	_tmp1_ = util_email_get_primary_originator (headers);
	_tmp2_ = _tmp1_;
	conversation_message_set_primary_originator (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = _g_object_ref0 (config);
	_g_object_unref0 (self->priv->config);
	self->priv->config = _tmp3_;
	_tmp4_ = _g_object_ref0 (contacts);
	_g_object_unref0 (self->priv->contacts);
	self->priv->contacts = _tmp4_;
	_tmp5_ = G_VARIANT_TYPE_STRING;
	_tmp6_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_CONVERSATION_NEW, TRUE, _tmp5_);
	_tmp7_ = _tmp6_;
	g_signal_connect_object (_tmp7_, "activate", (GCallback) _conversation_message_on_link_activated_g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = G_VARIANT_TYPE_STRING;
	_tmp9_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_COPY_EMAIL, TRUE, _tmp8_);
	_tmp10_ = _tmp9_;
	g_signal_connect_object (_tmp10_, "activate", (GCallback) _conversation_message_on_copy_email_address_g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = G_VARIANT_TYPE_STRING;
	_tmp12_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_COPY_LINK, TRUE, _tmp11_);
	_tmp13_ = _tmp12_;
	g_signal_connect_object (_tmp13_, "activate", (GCallback) _conversation_message_on_copy_link_g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp13_);
	_tmp14_ = G_VARIANT_TYPE_STRING;
	_tmp15_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_OPEN_LINK, TRUE, _tmp14_);
	_tmp16_ = _tmp15_;
	g_signal_connect_object (_tmp16_, "activate", (GCallback) _conversation_message_on_link_activated_g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp16_);
	_tmp17_ = g_variant_type_new ("(sms)");
	_tmp18_ = _tmp17_;
	_tmp19_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_SAVE_IMAGE, TRUE, _tmp18_);
	_tmp20_ = _tmp19_;
	g_signal_connect_object (_tmp20_, "activate", (GCallback) _conversation_message_on_save_image_g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp20_);
	_g_variant_type_free0 (_tmp18_);
	_tmp21_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_SHOW_IMAGES_MESSAGE, TRUE, NULL);
	_tmp22_ = _tmp21_;
	g_signal_connect_object (_tmp22_, "activate", (GCallback) _conversation_message_on_show_images_g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp22_);
	_tmp23_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_SHOW_IMAGES_SENDER, TRUE, NULL);
	_tmp24_ = _tmp23_;
	g_signal_connect_object (_tmp24_, "activate", (GCallback) _conversation_message_on_show_images_sender_g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp24_);
	_tmp25_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_SHOW_IMAGES_DOMAIN, TRUE, NULL);
	_tmp26_ = _tmp25_;
	g_signal_connect_object (_tmp26_, "activate", (GCallback) _conversation_message_on_show_images_domain_g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp26_);
	_tmp27_ = self->priv->message_actions;
	gtk_widget_insert_action_group (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "msg", G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, g_action_group_get_type (), GActionGroup));
	_tmp28_ = gtk_builder_new_from_resource ("/org/gnome/Geary/conversation-message-menus.ui");
	builder = _tmp28_;
	_tmp29_ = builder;
	_tmp30_ = gtk_builder_get_object (_tmp29_, "context_menu_link");
	_tmp31_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, g_menu_model_get_type (), GMenuModel));
	_g_object_unref0 (self->priv->context_menu_link);
	self->priv->context_menu_link = _tmp31_;
	_tmp32_ = builder;
	_tmp33_ = gtk_builder_get_object (_tmp32_, "context_menu_email");
	_tmp34_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, g_menu_model_get_type (), GMenuModel));
	_g_object_unref0 (self->priv->context_menu_email);
	self->priv->context_menu_email = _tmp34_;
	_tmp35_ = builder;
	_tmp36_ = gtk_builder_get_object (_tmp35_, "context_menu_image");
	_tmp37_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, g_menu_model_get_type (), GMenuModel));
	_g_object_unref0 (self->priv->context_menu_image);
	self->priv->context_menu_image = _tmp37_;
	_tmp38_ = builder;
	_tmp39_ = gtk_builder_get_object (_tmp38_, "context_menu_main");
	_tmp40_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, g_menu_model_get_type (), GMenuModel));
	_g_object_unref0 (self->priv->context_menu_main);
	self->priv->context_menu_main = _tmp40_;
	_tmp41_ = builder;
	_tmp42_ = gtk_builder_get_object (_tmp41_, "show_images_menu");
	_tmp43_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, g_menu_model_get_type (), GMenuModel));
	_g_object_unref0 (self->priv->show_images_menu);
	self->priv->show_images_menu = _tmp43_;
	_tmp44_ = application_configuration_get_enable_inspector (config);
	_tmp45_ = _tmp44_;
	if (_tmp45_) {
		GtkBuilder* _tmp46_;
		GObject* _tmp47_;
		GMenuModel* _tmp48_;
		_tmp46_ = builder;
		_tmp47_ = gtk_builder_get_object (_tmp46_, "context_menu_inspector");
		_tmp48_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, g_menu_model_get_type (), GMenuModel));
		_g_object_unref0 (self->priv->context_menu_inspector);
		self->priv->context_menu_inspector = _tmp48_;
	}
	_tmp49_ = geary_email_header_set_get_date (headers);
	_tmp50_ = _tmp49_;
	if (_tmp50_ != NULL) {
		GearyRFC822Date* _tmp51_;
		GearyRFC822Date* _tmp52_;
		GDateTime* _tmp53_;
		GDateTime* _tmp54_;
		GDateTime* _tmp55_;
		_tmp51_ = geary_email_header_set_get_date (headers);
		_tmp52_ = _tmp51_;
		_tmp53_ = geary_rf_c822_date_get_value (_tmp52_);
		_tmp54_ = _tmp53_;
		_tmp55_ = g_date_time_to_local (_tmp54_);
		_g_date_time_unref0 (self->priv->local_date);
		self->priv->local_date = _tmp55_;
	}
	conversation_message_update_display (self);
	_tmp56_ = g_strdup (_ ("No sender"));
	_g_free0 (self->priv->empty_from_label);
	self->priv->empty_from_label = _tmp56_;
	_tmp57_ = self->priv->compact_from;
	_tmp58_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp58_, CONVERSATION_MESSAGE_FROM_CLASS);
	if (preview != NULL) {
		gchar* clean_preview = NULL;
		gchar* _tmp59_;
		gint _tmp60_;
		gint _tmp61_;
		GtkLabel* _tmp65_;
		const gchar* _tmp66_;
		_tmp59_ = g_strdup (preview);
		clean_preview = _tmp59_;
		_tmp60_ = strlen (preview);
		_tmp61_ = _tmp60_;
		if (_tmp61_ > CONVERSATION_MESSAGE_MAX_PREVIEW_BYTES) {
			gchar* _tmp62_;
			const gchar* _tmp63_;
			gchar* _tmp64_;
			_tmp62_ = geary_string_safe_byte_substring (preview, (gssize) CONVERSATION_MESSAGE_MAX_PREVIEW_BYTES);
			_g_free0 (clean_preview);
			clean_preview = _tmp62_;
			_tmp63_ = clean_preview;
			_tmp64_ = g_strconcat (_tmp63_, "…", NULL);
			_g_free0 (clean_preview);
			clean_preview = _tmp64_;
		}
		_tmp65_ = self->priv->compact_body;
		_tmp66_ = clean_preview;
		gtk_label_set_text (_tmp65_, _tmp66_);
		_g_free0 (clean_preview);
	}
	_tmp67_ = geary_email_header_set_get_subject (headers);
	_tmp68_ = _tmp67_;
	if (_tmp68_ != NULL) {
		GtkLabel* _tmp69_;
		GearyRFC822Subject* _tmp70_;
		GearyRFC822Subject* _tmp71_;
		const gchar* _tmp72_;
		const gchar* _tmp73_;
		GtkLabel* _tmp74_;
		GearyRFC822Subject* _tmp75_;
		GearyRFC822Subject* _tmp76_;
		const gchar* _tmp77_;
		const gchar* _tmp78_;
		gchar* _tmp79_;
		_tmp69_ = self->priv->subject;
		_tmp70_ = geary_email_header_set_get_subject (headers);
		_tmp71_ = _tmp70_;
		_tmp72_ = geary_message_data_string_message_data_get_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, GEARY_MESSAGE_DATA_TYPE_STRING_MESSAGE_DATA, GearyMessageDataStringMessageData));
		_tmp73_ = _tmp72_;
		gtk_label_set_text (_tmp69_, _tmp73_);
		_tmp74_ = self->priv->subject;
		gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, gtk_widget_get_type (), GtkWidget), TRUE);
		_tmp75_ = geary_email_header_set_get_subject (headers);
		_tmp76_ = _tmp75_;
		_tmp77_ = geary_message_data_string_message_data_get_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp76_, GEARY_MESSAGE_DATA_TYPE_STRING_MESSAGE_DATA, GearyMessageDataStringMessageData));
		_tmp78_ = _tmp77_;
		_tmp79_ = g_utf8_casefold (_tmp78_, (gssize) -1);
		_g_free0 (self->priv->subject_searchable);
		self->priv->subject_searchable = _tmp79_;
	}
	_tmp80_ = self->priv->_body_container;
	gtk_widget_set_has_tooltip (G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp81_ = geary_timeout_manager_new_milliseconds ((guint) UTIL_GTK_SHOW_PROGRESS_TIMEOUT_MSEC, _conversation_message_on_show_progress_timeout_geary_timeout_manager_timeout_func, self);
	_g_object_unref0 (self->priv->show_progress_timeout);
	self->priv->show_progress_timeout = _tmp81_;
	_tmp82_ = geary_timeout_manager_new_milliseconds ((guint) UTIL_GTK_HIDE_PROGRESS_TIMEOUT_MSEC, _conversation_message_on_hide_progress_timeout_geary_timeout_manager_timeout_func, self);
	_g_object_unref0 (self->priv->hide_progress_timeout);
	self->priv->hide_progress_timeout = _tmp82_;
	_tmp83_ = self->priv->body_progress;
	_tmp84_ = geary_timeout_manager_new_milliseconds ((guint) UTIL_GTK_PROGRESS_PULSE_TIMEOUT_MSEC, _gtk_progress_bar_pulse_geary_timeout_manager_timeout_func, _tmp83_);
	_g_object_unref0 (self->priv->progress_pulse);
	self->priv->progress_pulse = _tmp84_;
	_tmp85_ = self->priv->progress_pulse;
	_tmp85_->repetition = GEARY_TIMEOUT_MANAGER_REPEAT_FOREVER;
	_g_object_unref0 (builder);
	return self;
}

static ConversationMessage*
conversation_message_new (GearyEmailHeaderSet* headers,
                          const gchar* preview,
                          gboolean load_remote_resources,
                          ApplicationContactStore* contacts,
                          ApplicationConfiguration* config)
{
	return conversation_message_construct (TYPE_CONVERSATION_MESSAGE, headers, preview, load_remote_resources, contacts, config);
}

static gboolean
_conversation_message_on_context_menu_webkit_web_view_context_menu (WebKitWebView* _sender,
                                                                    WebKitContextMenu* context_menu,
                                                                    GdkEvent* event,
                                                                    WebKitHitTestResult* hit_test_result,
                                                                    gpointer self)
{
	gboolean result;
	result = conversation_message_on_context_menu ((ConversationMessage*) self, _sender, context_menu, event, hit_test_result);
	return result;
}

static void
_conversation_message_on_deceptive_link_clicked_conversation_web_view_deceptive_link_clicked (ConversationWebView* _sender,
                                                                                              ConversationWebViewDeceptiveText reason,
                                                                                              const gchar* text,
                                                                                              const gchar* href,
                                                                                              GdkRectangle* location,
                                                                                              gpointer self)
{
	conversation_message_on_deceptive_link_clicked ((ConversationMessage*) self, reason, text, href, location);
}

static void
__lambda84_ (ConversationMessage* self,
             const gchar* link)
{
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	g_return_if_fail (link != NULL);
	_tmp0_ = g_variant_new ("s", link, NULL);
	g_variant_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	conversation_message_on_link_activated (self, _tmp1_);
	_g_variant_unref0 (_tmp1_);
}

static void
___lambda84__components_web_view_link_activated (ComponentsWebView* _sender,
                                                 const gchar* uri,
                                                 gpointer self)
{
	__lambda84_ ((ConversationMessage*) self, uri);
}

static void
_conversation_message_on_mouse_target_changed_webkit_web_view_mouse_target_changed (WebKitWebView* _sender,
                                                                                    WebKitHitTestResult* hit_test_result,
                                                                                    guint modifiers,
                                                                                    gpointer self)
{
	conversation_message_on_mouse_target_changed ((ConversationMessage*) self, _sender, hit_test_result, modifiers);
}

static void
_conversation_message_on_selection_changed_g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self)
{
	conversation_message_on_selection_changed ((ConversationMessage*) self);
}

static void
_conversation_message_on_resource_load_started_webkit_web_view_resource_load_started (WebKitWebView* _sender,
                                                                                      WebKitWebResource* resource,
                                                                                      WebKitURIRequest* request,
                                                                                      gpointer self)
{
	conversation_message_on_resource_load_started ((ConversationMessage*) self, _sender, resource, request);
}

static void
_conversation_message_on_remote_resources_blocked_components_web_view_remote_resource_load_blocked (ComponentsWebView* _sender,
                                                                                                    gpointer self)
{
	conversation_message_on_remote_resources_blocked ((ConversationMessage*) self);
}

static void
_conversation_message_trigger_internal_resource_loaded_components_web_view_internal_resource_loaded (ComponentsWebView* _sender,
                                                                                                     const gchar* name,
                                                                                                     gpointer self)
{
	conversation_message_trigger_internal_resource_loaded ((ConversationMessage*) self, name);
}

static void
_conversation_message_trigger_content_loaded_components_web_view_content_loaded (ComponentsWebView* _sender,
                                                                                 gpointer self)
{
	conversation_message_trigger_content_loaded ((ConversationMessage*) self);
}

static void
__lambda87_ (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	_tmp0_ = self->priv->_web_view;
	components_web_view_copy_clipboard (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
}

static void
___lambda87__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda87_ ((ConversationMessage*) self);
}

static void
__lambda88_ (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	WebKitWebInspector* _tmp1_;
	_tmp0_ = self->priv->_web_view;
	_tmp1_ = webkit_web_view_get_inspector (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, webkit_web_view_get_type (), WebKitWebView));
	webkit_web_inspector_show (_tmp1_);
}

static void
___lambda88__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda88_ ((ConversationMessage*) self);
}

static void
__lambda89_ (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	_tmp0_ = self->priv->_web_view;
	components_web_view_select_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
}

static void
___lambda89__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda89_ ((ConversationMessage*) self);
}

static void
conversation_message_initialize_web_view (ConversationMessage* self)
{
	ConversationViewer* viewer = NULL;
	GtkWidget* _tmp0_;
	ConversationViewer* _tmp1_;
	gboolean _tmp2_ = FALSE;
	ConversationViewer* _tmp3_;
	ConversationViewer* _tmp16_;
	ConversationWebView* _tmp19_;
	ConversationWebView* _tmp20_;
	ConversationWebView* _tmp21_;
	ConversationWebView* _tmp22_;
	ConversationWebView* _tmp23_;
	ConversationWebView* _tmp24_;
	ConversationWebView* _tmp25_;
	ConversationWebView* _tmp26_;
	ConversationWebView* _tmp27_;
	ConversationWebView* _tmp28_;
	ConversationWebView* _tmp29_;
	ConversationWebView* _tmp30_;
	GtkGrid* _tmp31_;
	ConversationWebView* _tmp32_;
	GSimpleAction* _tmp33_;
	GSimpleAction* _tmp34_;
	ApplicationConfiguration* _tmp35_;
	gboolean _tmp36_;
	gboolean _tmp37_;
	GSimpleAction* _tmp38_;
	GSimpleAction* _tmp39_;
	GSimpleAction* _tmp40_;
	GSimpleAction* _tmp41_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = gtk_widget_get_ancestor (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), TYPE_CONVERSATION_VIEWER);
	_tmp1_ = _g_object_ref0 (IS_CONVERSATION_VIEWER (_tmp0_) ? ((ConversationViewer*) _tmp0_) : NULL);
	viewer = _tmp1_;
	_tmp3_ = viewer;
	if (_tmp3_ != NULL) {
		ConversationViewer* _tmp4_;
		ConversationWebView* _tmp5_;
		ConversationWebView* _tmp6_;
		_tmp4_ = viewer;
		_tmp5_ = conversation_viewer_get_previous_web_view (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp2_ = _tmp6_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		ApplicationConfiguration* _tmp7_;
		ConversationViewer* _tmp8_;
		ConversationWebView* _tmp9_;
		ConversationWebView* _tmp10_;
		ConversationWebView* _tmp11_;
		ConversationWebView* _tmp12_;
		_tmp7_ = self->priv->config;
		_tmp8_ = viewer;
		_tmp9_ = conversation_viewer_get_previous_web_view (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = conversation_web_view_new_with_related_view (_tmp7_, _tmp10_);
		g_object_ref_sink (_tmp11_);
		_tmp12_ = _tmp11_;
		conversation_message_set_web_view (self, _tmp12_);
		_g_object_unref0 (_tmp12_);
	} else {
		ApplicationConfiguration* _tmp13_;
		ConversationWebView* _tmp14_;
		ConversationWebView* _tmp15_;
		_tmp13_ = self->priv->config;
		_tmp14_ = conversation_web_view_new (_tmp13_);
		g_object_ref_sink (_tmp14_);
		_tmp15_ = _tmp14_;
		conversation_message_set_web_view (self, _tmp15_);
		_g_object_unref0 (_tmp15_);
	}
	_tmp16_ = viewer;
	if (_tmp16_ != NULL) {
		ConversationViewer* _tmp17_;
		ConversationWebView* _tmp18_;
		_tmp17_ = viewer;
		_tmp18_ = self->priv->_web_view;
		conversation_viewer_set_previous_web_view (_tmp17_, _tmp18_);
	}
	_tmp19_ = self->priv->_web_view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, webkit_web_view_get_type (), WebKitWebView), "context-menu", (GCallback) _conversation_message_on_context_menu_webkit_web_view_context_menu, self, 0);
	_tmp20_ = self->priv->_web_view;
	g_signal_connect_object (_tmp20_, "deceptive-link-clicked", (GCallback) _conversation_message_on_deceptive_link_clicked_conversation_web_view_deceptive_link_clicked, self, 0);
	_tmp21_ = self->priv->_web_view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), "link-activated", (GCallback) ___lambda84__components_web_view_link_activated, self, 0);
	_tmp22_ = self->priv->_web_view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, webkit_web_view_get_type (), WebKitWebView), "mouse-target-changed", (GCallback) _conversation_message_on_mouse_target_changed_webkit_web_view_mouse_target_changed, self, 0);
	_tmp23_ = self->priv->_web_view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, G_TYPE_OBJECT, GObject), "notify::has-selection", (GCallback) _conversation_message_on_selection_changed_g_object_notify, self, 0);
	_tmp24_ = self->priv->_web_view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, webkit_web_view_get_type (), WebKitWebView), "resource-load-started", (GCallback) _conversation_message_on_resource_load_started_webkit_web_view_resource_load_started, self, 0);
	_tmp25_ = self->priv->_web_view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), "remote-resource-load-blocked", (GCallback) _conversation_message_on_remote_resources_blocked_components_web_view_remote_resource_load_blocked, self, 0);
	_tmp26_ = self->priv->_web_view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), "internal-resource-loaded", (GCallback) _conversation_message_trigger_internal_resource_loaded_components_web_view_internal_resource_loaded, self, 0);
	_tmp27_ = self->priv->_web_view;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), "content-loaded", (GCallback) _conversation_message_trigger_content_loaded_components_web_view_content_loaded, self, 0);
	_tmp28_ = self->priv->_web_view;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp29_ = self->priv->_web_view;
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp30_ = self->priv->_web_view;
	gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_widget_get_type (), GtkWidget));
	_tmp31_ = self->priv->_body_container;
	_tmp32_ = self->priv->_web_view;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_widget_get_type (), GtkWidget));
	_tmp33_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_COPY_SELECTION, FALSE, NULL);
	_tmp34_ = _tmp33_;
	g_signal_connect_object (_tmp34_, "activate", (GCallback) ___lambda87__g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp34_);
	_tmp35_ = self->priv->config;
	_tmp36_ = application_configuration_get_enable_inspector (_tmp35_);
	_tmp37_ = _tmp36_;
	_tmp38_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_OPEN_INSPECTOR, _tmp37_, NULL);
	_tmp39_ = _tmp38_;
	g_signal_connect_object (_tmp39_, "activate", (GCallback) ___lambda88__g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp39_);
	_tmp40_ = conversation_message_add_action (self, CONVERSATION_MESSAGE_ACTION_SELECT_ALL, TRUE, NULL);
	_tmp41_ = _tmp40_;
	g_signal_connect_object (_tmp41_, "activate", (GCallback) ___lambda89__g_simple_action_activate, self, 0);
	_g_object_unref0 (_tmp41_);
	_g_object_unref0 (viewer);
}

static void
conversation_message_real_destroy (GtkWidget* base)
{
	ConversationMessage * self;
	GearyTimeoutManager* _tmp0_;
	GearyTimeoutManager* _tmp1_;
	GearyTimeoutManager* _tmp2_;
	GeeMap* _tmp3_;
	GeeList* _tmp4_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CONVERSATION_MESSAGE, ConversationMessage);
	_tmp0_ = self->priv->show_progress_timeout;
	geary_timeout_manager_reset (_tmp0_);
	_tmp1_ = self->priv->hide_progress_timeout;
	geary_timeout_manager_reset (_tmp1_);
	_tmp2_ = self->priv->progress_pulse;
	geary_timeout_manager_reset (_tmp2_);
	_tmp3_ = self->priv->resources;
	gee_map_clear (_tmp3_);
	_tmp4_ = self->priv->searchable_addresses;
	gee_collection_clear (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection));
	GTK_WIDGET_CLASS (conversation_message_parent_class)->destroy (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_grid_get_type (), GtkGrid), gtk_widget_get_type (), GtkWidget));
}

static void
conversation_message_get_selection_for_quoting_data_free (gpointer _data)
{
	ConversationMessageGetSelectionForQuotingData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageGetSelectionForQuotingData, _data_);
}

void
conversation_message_get_selection_for_quoting (ConversationMessage* self,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ConversationMessageGetSelectionForQuotingData* _data_;
	ConversationMessage* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_data_ = g_slice_new0 (ConversationMessageGetSelectionForQuotingData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_get_selection_for_quoting_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	conversation_message_get_selection_for_quoting_co (_data_);
}

gchar*
conversation_message_get_selection_for_quoting_finish (ConversationMessage* self,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	gchar* result;
	ConversationMessageGetSelectionForQuotingData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
conversation_message_get_selection_for_quoting_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	ConversationMessageGetSelectionForQuotingData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_get_selection_for_quoting_co (_data_);
}

static gboolean
conversation_message_get_selection_for_quoting_co (ConversationMessageGetSelectionForQuotingData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_web_view;
	if (_data_->_tmp0_ == NULL) {
		conversation_message_initialize_web_view (_data_->self);
	}
	_data_->_tmp2_ = _data_->self->priv->_web_view;
	_data_->_state_ = 1;
	conversation_web_view_get_selection_for_quoting (_data_->_tmp2_, conversation_message_get_selection_for_quoting_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = conversation_web_view_get_selection_for_quoting_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp1_ = _data_->_tmp3_;
	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_->_tmp1_;
	_data_->_tmp1_ = NULL;
	_data_->result = _data_->_tmp4_;
	_g_free0 (_data_->_tmp1_);
	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_message_get_selection_for_find_data_free (gpointer _data)
{
	ConversationMessageGetSelectionForFindData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageGetSelectionForFindData, _data_);
}

void
conversation_message_get_selection_for_find (ConversationMessage* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	ConversationMessageGetSelectionForFindData* _data_;
	ConversationMessage* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_data_ = g_slice_new0 (ConversationMessageGetSelectionForFindData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_get_selection_for_find_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	conversation_message_get_selection_for_find_co (_data_);
}

gchar*
conversation_message_get_selection_for_find_finish (ConversationMessage* self,
                                                    GAsyncResult* _res_,
                                                    GError** error)
{
	gchar* result;
	ConversationMessageGetSelectionForFindData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
conversation_message_get_selection_for_find_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	ConversationMessageGetSelectionForFindData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_get_selection_for_find_co (_data_);
}

static gboolean
conversation_message_get_selection_for_find_co (ConversationMessageGetSelectionForFindData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_web_view;
	if (_data_->_tmp0_ == NULL) {
		conversation_message_initialize_web_view (_data_->self);
	}
	_data_->_tmp2_ = _data_->self->priv->_web_view;
	_data_->_state_ = 1;
	conversation_web_view_get_selection_for_find (_data_->_tmp2_, conversation_message_get_selection_for_find_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = conversation_web_view_get_selection_for_find_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp1_ = _data_->_tmp3_;
	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_->_tmp1_;
	_data_->_tmp1_ = NULL;
	_data_->result = _data_->_tmp4_;
	_g_free0 (_data_->_tmp1_);
	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;
}

/**
     * Adds a set of internal resources to web_view.
     *
     * @see Components.WebView.add_internal_resources
     */
void
conversation_message_add_internal_resources (ConversationMessage* self,
                                             GeeMap* res)
{
	ConversationWebView* _tmp0_;
	ConversationWebView* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, GEE_TYPE_MAP));
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = self->priv->_web_view;
	components_web_view_add_internal_resources (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), res);
}

WebKitPrintOperation*
conversation_message_new_print_operation (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	ConversationWebView* _tmp1_;
	WebKitPrintOperation* _tmp2_;
	WebKitPrintOperation* result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = self->priv->_web_view;
	_tmp2_ = webkit_print_operation_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, webkit_web_view_get_type (), WebKitWebView));
	result = _tmp2_;
	return result;
}

static void
conversation_message_evaluate_javascript_data_free (gpointer _data)
{
	ConversationMessageEvaluateJavascriptData* _data_;
	_data_ = _data;
	_g_free0 (_data_->script);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageEvaluateJavascriptData, _data_);
}

void
conversation_message_evaluate_javascript (ConversationMessage* self,
                                          const gchar* script,
                                          GCancellable* cancellable,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	ConversationMessageEvaluateJavascriptData* _data_;
	ConversationMessage* _tmp0_;
	gchar* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (script != NULL);
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ConversationMessageEvaluateJavascriptData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_evaluate_javascript_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (script);
	_g_free0 (_data_->script);
	_data_->script = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	conversation_message_evaluate_javascript_co (_data_);
}

void
conversation_message_evaluate_javascript_finish (ConversationMessage* self,
                                                 GAsyncResult* _res_,
                                                 GError** error)
{
	ConversationMessageEvaluateJavascriptData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
conversation_message_evaluate_javascript_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	ConversationMessageEvaluateJavascriptData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_evaluate_javascript_co (_data_);
}

static gboolean
conversation_message_evaluate_javascript_co (ConversationMessageEvaluateJavascriptData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_web_view;
	if (_data_->_tmp0_ == NULL) {
		conversation_message_initialize_web_view (_data_->self);
	}
	_data_->_tmp1_ = _data_->self->priv->_web_view;
	_data_->_state_ = 1;
	webkit_web_view_evaluate_javascript (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, webkit_web_view_get_type (), WebKitWebView), _data_->script, (gssize) -1, NULL, NULL, _data_->cancellable, conversation_message_evaluate_javascript_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = webkit_web_view_evaluate_javascript_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, webkit_web_view_get_type (), WebKitWebView), _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_g_object_unref0 (_data_->_tmp3_);
	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;
	}
	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_message_zoom_in (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	ConversationWebView* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = self->priv->_web_view;
	components_web_view_zoom_in (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
}

void
conversation_message_zoom_out (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	ConversationWebView* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = self->priv->_web_view;
	components_web_view_zoom_out (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
}

void
conversation_message_zoom_reset (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	ConversationWebView* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = self->priv->_web_view;
	components_web_view_zoom_reset (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
}

void
conversation_message_web_view_translate_coordinates (ConversationMessage* self,
                                                     GtkWidget* widget,
                                                     gint x,
                                                     gint anchor_y,
                                                     gint* x1,
                                                     gint* y1)
{
	gint _vala_x1 = 0;
	gint _vala_y1 = 0;
	ConversationWebView* _tmp0_;
	ConversationWebView* _tmp1_;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (widget, gtk_widget_get_type ()));
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = self->priv->_web_view;
	gtk_widget_translate_coordinates (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget), widget, x, anchor_y, &_tmp2_, &_tmp3_);
	_vala_x1 = _tmp2_;
	_vala_y1 = _tmp3_;
	if (x1) {
		*x1 = _vala_x1;
	}
	if (y1) {
		*y1 = _vala_y1;
	}
}

gint
conversation_message_web_view_get_allocated_height (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	ConversationWebView* _tmp1_;
	gint result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), -1);
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = self->priv->_web_view;
	result = gtk_widget_get_allocated_height (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
	return result;
}

/**
     * Shows the complete message and hides the compact headers.
     */
void
conversation_message_show_message_body (ConversationMessage* self,
                                        gboolean include_transitions)
{
	ConversationWebView* _tmp0_;
	GtkRevealer* _tmp1_;
	GtkRevealer* _tmp2_;
	GtkRevealer* _tmp3_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = self->priv->compact_revealer;
	conversation_message_set_revealer (self, _tmp1_, FALSE, include_transitions);
	_tmp2_ = self->priv->header_revealer;
	conversation_message_set_revealer (self, _tmp2_, TRUE, include_transitions);
	_tmp3_ = self->priv->body_revealer;
	conversation_message_set_revealer (self, _tmp3_, TRUE, include_transitions);
}

/**
     * Hides the complete message and shows the compact headers.
     */
void
conversation_message_hide_message_body (ConversationMessage* self)
{
	GtkRevealer* _tmp0_;
	GtkRevealer* _tmp1_;
	GtkRevealer* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->compact_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, TRUE);
	_tmp1_ = self->priv->header_revealer;
	gtk_revealer_set_reveal_child (_tmp1_, FALSE);
	_tmp2_ = self->priv->body_revealer;
	gtk_revealer_set_reveal_child (_tmp2_, FALSE);
}

/** Shows a panel when an email is being loaded. */
void
conversation_message_show_loading_pane (ConversationMessage* self)
{
	ComponentsPlaceholderPane* pane = NULL;
	ComponentsPlaceholderPane* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = components_placeholder_pane_new ();
	g_object_ref_sink (_tmp0_);
	pane = _tmp0_;
	components_placeholder_pane_set_icon_name (pane, "content-loading-symbolic");
	components_placeholder_pane_set_title (pane, "");
	components_placeholder_pane_set_subtitle (pane, "");
	conversation_message_show_placeholder_pane (self, G_TYPE_CHECK_INSTANCE_CAST (pane, gtk_widget_get_type (), GtkWidget));
	conversation_message_start_progress_pulse (self);
	_g_object_unref0 (pane);
}

/** Shows an error panel when email loading failed. */
void
conversation_message_show_load_error_pane (ConversationMessage* self)
{
	ComponentsPlaceholderPane* pane = NULL;
	ComponentsPlaceholderPane* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = components_placeholder_pane_new ();
	g_object_ref_sink (_tmp0_);
	pane = _tmp0_;
	components_placeholder_pane_set_icon_name (pane, "network-error-symbolic");
	components_placeholder_pane_set_title (pane, "");
	components_placeholder_pane_set_subtitle (pane, "");
	conversation_message_show_placeholder_pane (self, G_TYPE_CHECK_INSTANCE_CAST (pane, gtk_widget_get_type (), GtkWidget));
	conversation_message_stop_progress_pulse (self);
	_g_object_unref0 (pane);
}

/** Shows an error panel when offline. */
void
conversation_message_show_offline_pane (ConversationMessage* self)
{
	ComponentsPlaceholderPane* pane = NULL;
	ComponentsPlaceholderPane* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	conversation_message_show_message_body (self, TRUE);
	_tmp0_ = components_placeholder_pane_new ();
	g_object_ref_sink (_tmp0_);
	pane = _tmp0_;
	components_placeholder_pane_set_icon_name (pane, "network-offline-symbolic");
	components_placeholder_pane_set_title (pane, "");
	components_placeholder_pane_set_subtitle (pane, "");
	conversation_message_show_placeholder_pane (self, G_TYPE_CHECK_INSTANCE_CAST (pane, gtk_widget_get_type (), GtkWidget));
	conversation_message_stop_progress_pulse (self);
	_g_object_unref0 (pane);
}

/** Shows and initialises the progress meter. */
void
conversation_message_start_progress_loading (ConversationMessage* self)
{
	GearyTimeoutManager* _tmp0_;
	GtkProgressBar* _tmp1_;
	GearyTimeoutManager* _tmp2_;
	GearyTimeoutManager* _tmp3_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->progress_pulse;
	geary_timeout_manager_reset (_tmp0_);
	_tmp1_ = self->priv->body_progress;
	gtk_progress_bar_set_fraction (_tmp1_, 0.1);
	_tmp2_ = self->priv->show_progress_timeout;
	geary_timeout_manager_start (_tmp2_);
	_tmp3_ = self->priv->hide_progress_timeout;
	geary_timeout_manager_reset (_tmp3_);
}

/** Hides the progress meter. */
void
conversation_message_stop_progress_loading (ConversationMessage* self)
{
	GtkProgressBar* _tmp0_;
	GearyTimeoutManager* _tmp1_;
	GearyTimeoutManager* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->body_progress;
	gtk_progress_bar_set_fraction (_tmp0_, 1.0);
	_tmp1_ = self->priv->show_progress_timeout;
	geary_timeout_manager_reset (_tmp1_);
	_tmp2_ = self->priv->hide_progress_timeout;
	geary_timeout_manager_start (_tmp2_);
}

/** Shows and starts pulsing the progress meter. */
void
conversation_message_start_progress_pulse (ConversationMessage* self)
{
	GtkProgressBar* _tmp0_;
	GearyTimeoutManager* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->body_progress;
	gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = self->priv->progress_pulse;
	geary_timeout_manager_start (_tmp1_);
}

/** Hides and stops pulsing the progress meter. */
void
conversation_message_stop_progress_pulse (ConversationMessage* self)
{
	GtkProgressBar* _tmp0_;
	GearyTimeoutManager* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->body_progress;
	gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = self->priv->progress_pulse;
	geary_timeout_manager_reset (_tmp1_);
}

static void
conversation_message_load_contacts_data_free (gpointer _data)
{
	ConversationMessageLoadContactsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageLoadContactsData, _data_);
}

void
conversation_message_load_contacts (ConversationMessage* self,
                                    GCancellable* cancellable,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	ConversationMessageLoadContactsData* _data_;
	ConversationMessage* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ConversationMessageLoadContactsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_load_contacts_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	conversation_message_load_contacts_co (_data_);
}

void
conversation_message_load_contacts_finish (ConversationMessage* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	ConversationMessageLoadContactsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
     * Starts loading message contacts and the avatar.
     */
static void
conversation_message_load_contacts_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	ConversationMessageLoadContactsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_load_contacts_co (_data_);
}

static gboolean
conversation_message_load_contacts_co (ConversationMessageLoadContactsData* _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_->_tmp0_ = gtk_widget_get_toplevel (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, gtk_widget_get_type (), GtkWidget));
	_data_->_tmp1_ = _g_object_ref0 (APPLICATION_IS_MAIN_WINDOW (_data_->_tmp0_) ? ((ApplicationMainWindow*) _data_->_tmp0_) : NULL);
	_data_->main = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->main;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp2_ = !g_cancellable_is_cancelled (_data_->cancellable);
	} else {
		_data_->_tmp2_ = FALSE;
	}
	if (_data_->_tmp2_) {
		_data_->_tmp4_ = _data_->self->priv->_primary_originator;
		if (_data_->_tmp4_ != NULL) {
			_data_->_tmp6_ = _data_->self->priv->contacts;
			_data_->_tmp7_ = _data_->self->priv->_primary_originator;
			_data_->_state_ = 1;
			application_contact_store_load (_data_->_tmp6_, _data_->_tmp7_, _data_->cancellable, conversation_message_load_contacts_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp8_ = application_contact_store_load_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error0_);
			_data_->_tmp5_ = _data_->_tmp8_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->main);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			conversation_message_set_primary_contact (_data_->self, _data_->_tmp5_);
			_data_->_tmp9_ = _data_->self->priv->_primary_contact;
			if (_data_->_tmp9_ != NULL) {
				_data_->_tmp10_ = _data_->self->priv->_primary_contact;
				_data_->_tmp11_ = _data_->self->priv->avatar;
				g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, G_TYPE_OBJECT, GObject), "display-name", G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, G_TYPE_OBJECT, GObject), "text", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
				_data_->_tmp12_ = _data_->self->priv->_primary_contact;
				_data_->_tmp13_ = _data_->self->priv->avatar;
				g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp12_, G_TYPE_OBJECT, GObject), "avatar", G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp13_, G_TYPE_OBJECT, GObject), "loadable-icon", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
			}
			_g_object_unref0 (_data_->_tmp5_);
		}
		_data_->_state_ = 2;
		conversation_message_format_originator_compact (_data_->self, _data_->cancellable, conversation_message_load_contacts_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp15_ = conversation_message_format_originator_compact_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp14_ = _data_->_tmp15_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->main);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp16_ = _data_->self->priv->compact_from;
		gtk_label_set_text (_data_->_tmp16_, _data_->_tmp14_);
		_data_->_tmp17_ = _data_->self->priv->headers;
		_data_->_tmp18_ = _g_object_ref0 (_data_->_tmp17_);
		_data_->headers = _data_->_tmp18_;
		_data_->_tmp19_ = _data_->headers;
		_data_->_tmp20_ = geary_email_header_set_get_from (_data_->_tmp19_);
		_data_->_tmp21_ = _data_->_tmp20_;
		_data_->_tmp22_ = _data_->headers;
		_data_->_tmp23_ = geary_email_header_set_get_reply_to (_data_->_tmp22_);
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_tmp25_ = _data_->headers;
		_data_->_tmp26_ = geary_email_header_set_get_sender (_data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_state_ = 3;
		conversation_message_fill_originator_addresses (_data_->self, _data_->_tmp21_, _data_->_tmp24_, _data_->_tmp27_, _data_->cancellable, conversation_message_load_contacts_ready, _data_);
		return FALSE;
		_state_3:
		conversation_message_fill_originator_addresses_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_->headers);
			_g_free0 (_data_->_tmp14_);
			_g_object_unref0 (_data_->main);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp28_ = _data_->self->priv->to_header;
		_data_->_tmp29_ = _data_->headers;
		_data_->_tmp30_ = geary_email_header_set_get_to (_data_->_tmp29_);
		_data_->_tmp31_ = _data_->_tmp30_;
		_data_->_state_ = 4;
		conversation_message_fill_header_addresses (_data_->self, _data_->_tmp28_, _data_->_tmp31_, _data_->cancellable, conversation_message_load_contacts_ready, _data_);
		return FALSE;
		_state_4:
		conversation_message_fill_header_addresses_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_->headers);
			_g_free0 (_data_->_tmp14_);
			_g_object_unref0 (_data_->main);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp32_ = _data_->self->priv->cc_header;
		_data_->_tmp33_ = _data_->headers;
		_data_->_tmp34_ = geary_email_header_set_get_cc (_data_->_tmp33_);
		_data_->_tmp35_ = _data_->_tmp34_;
		_data_->_state_ = 5;
		conversation_message_fill_header_addresses (_data_->self, _data_->_tmp32_, _data_->_tmp35_, _data_->cancellable, conversation_message_load_contacts_ready, _data_);
		return FALSE;
		_state_5:
		conversation_message_fill_header_addresses_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_->headers);
			_g_free0 (_data_->_tmp14_);
			_g_object_unref0 (_data_->main);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp36_ = _data_->self->priv->bcc_header;
		_data_->_tmp37_ = _data_->headers;
		_data_->_tmp38_ = geary_email_header_set_get_bcc (_data_->_tmp37_);
		_data_->_tmp39_ = _data_->_tmp38_;
		_data_->_state_ = 6;
		conversation_message_fill_header_addresses (_data_->self, _data_->_tmp36_, _data_->_tmp39_, _data_->cancellable, conversation_message_load_contacts_ready, _data_);
		return FALSE;
		_state_6:
		conversation_message_fill_header_addresses_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_->headers);
			_g_free0 (_data_->_tmp14_);
			_g_object_unref0 (_data_->main);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->headers);
		_g_free0 (_data_->_tmp14_);
	}
	_g_object_unref0 (_data_->main);
	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_message_load_message_body_data_free (gpointer _data)
{
	ConversationMessageLoadMessageBodyData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->message);
	_g_object_unref0 (_data_->load_cancelled);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageLoadMessageBodyData, _data_);
}

void
conversation_message_load_message_body (ConversationMessage* self,
                                        GearyRFC822Message* message,
                                        GCancellable* load_cancelled,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	ConversationMessageLoadMessageBodyData* _data_;
	ConversationMessage* _tmp0_;
	GearyRFC822Message* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (message, GEARY_RF_C822_TYPE_MESSAGE));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (load_cancelled, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ConversationMessageLoadMessageBodyData);
	_data_->_async_result = g_task_new (G_OBJECT (self), load_cancelled, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_load_message_body_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (message);
	_g_object_unref0 (_data_->message);
	_data_->message = _tmp1_;
	_tmp2_ = _g_object_ref0 (load_cancelled);
	_g_object_unref0 (_data_->load_cancelled);
	_data_->load_cancelled = _tmp2_;
	conversation_message_load_message_body_co (_data_);
}

void
conversation_message_load_message_body_finish (ConversationMessage* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	ConversationMessageLoadMessageBodyData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

/**
     * Starts loading the message body in the HTML view.
     */
static void
conversation_message_load_message_body_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	ConversationMessageLoadMessageBodyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_load_message_body_co (_data_);
}

static gchar*
_conversation_message_inline_image_replacer_geary_rf_c822_message_inline_part_replacer (GearyRFC822Part* part,
                                                                                        gpointer self)
{
	gchar* result;
	result = conversation_message_inline_image_replacer ((ConversationMessage*) self, part);
	return result;
}

static void
__lambda92_ (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	_tmp0_ = self->priv->_web_view;
	webkit_web_view_stop_loading (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, webkit_web_view_get_type (), WebKitWebView));
}

static void
___lambda92__g_cancellable_cancelled (GCancellable* _sender,
                                      gpointer self)
{
	__lambda92_ ((ConversationMessage*) self);
}

static gboolean
conversation_message_load_message_body_co (ConversationMessageLoadMessageBodyData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (g_cancellable_is_cancelled (_data_->load_cancelled)) {
		_data_->_tmp0_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Conversation load cancelled");
		_data_->_inner_error0_ = _data_->_tmp0_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = _data_->self->priv->_web_view;
	if (_data_->_tmp1_ == NULL) {
		conversation_message_initialize_web_view (_data_->self);
	}
	_data_->_tmp2_ = _data_->self->priv->_primary_contact;
	_data_->_tmp3_ = _data_->self->priv->config;
	_data_->contact_load_images = util_contact_should_load_images (_data_->_tmp2_, _data_->_tmp3_);
	_data_->_tmp5_ = geary_rf_c822_message_get_auth_results (_data_->message);
	_data_->_tmp6_ = _data_->_tmp5_;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp8_ = geary_rf_c822_message_get_auth_results (_data_->message);
		_data_->_tmp9_ = _data_->_tmp8_;
		if (geary_rf_c822_authentication_results_is_dkim_valid (_data_->_tmp9_)) {
			_data_->_tmp7_ = TRUE;
		} else {
			_data_->_tmp10_ = geary_rf_c822_message_get_auth_results (_data_->message);
			_data_->_tmp11_ = _data_->_tmp10_;
			_data_->_tmp7_ = geary_rf_c822_authentication_results_is_dmarc_valid (_data_->_tmp11_);
		}
		_data_->_tmp4_ = _data_->_tmp7_;
	} else {
		_data_->_tmp4_ = FALSE;
	}
	_data_->self->priv->authenticated_message = _data_->_tmp4_;
	if (_data_->self->priv->load_remote_resources) {
		_data_->_tmp12_ = TRUE;
	} else {
		if (_data_->contact_load_images) {
			_data_->_tmp13_ = _data_->self->priv->authenticated_message;
		} else {
			_data_->_tmp13_ = FALSE;
		}
		_data_->_tmp12_ = _data_->_tmp13_;
	}
	if (_data_->_tmp12_) {
		_data_->_tmp14_ = _data_->self->priv->_web_view;
		_data_->_state_ = 1;
		components_web_view_load_remote_resources (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp14_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), _data_->load_cancelled, conversation_message_load_message_body_ready, _data_);
		return FALSE;
		_state_1:
		components_web_view_load_remote_resources_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp14_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), _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;
		}
	}
	conversation_message_show_placeholder_pane (_data_->self, NULL);
	_data_->body_text = NULL;
	{
		if (geary_rf_c822_message_has_html_body (_data_->message)) {
			_data_->_tmp16_ = geary_rf_c822_message_get_html_body (_data_->message, _conversation_message_inline_image_replacer_geary_rf_c822_message_inline_part_replacer, _data_->self, &_data_->_inner_error0_);
			_g_free0 (_data_->_tmp15_);
			_data_->_tmp15_ = _data_->_tmp16_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_free0 (_data_->_tmp15_);
				goto __catch0_g_error;
			}
		} else {
			_data_->_tmp17_ = geary_rf_c822_message_get_plain_body (_data_->message, TRUE, _conversation_message_inline_image_replacer_geary_rf_c822_message_inline_part_replacer, _data_->self, &_data_->_inner_error0_);
			_g_free0 (_data_->_tmp15_);
			_data_->_tmp15_ = _data_->_tmp17_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_free0 (_data_->_tmp15_);
				goto __catch0_g_error;
			}
		}
		_data_->_tmp18_ = _data_->_tmp15_;
		_data_->_tmp15_ = NULL;
		_g_free0 (_data_->body_text);
		_data_->body_text = _data_->_tmp18_;
		_g_free0 (_data_->_tmp15_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp19_ = _data_->err;
		_data_->_tmp20_ = _data_->_tmp19_->message;
		g_debug ("conversation-message.vala:912: Could not get message text. %s", _data_->_tmp20_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->body_text);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_signal_connect_object (_data_->load_cancelled, "cancelled", (GCallback) ___lambda92__g_cancellable_cancelled, _data_->self, 0);
	_data_->_tmp22_ = _data_->body_text;
	_data_->_tmp21_ = _data_->_tmp22_;
	if (_data_->_tmp21_ == NULL) {
		_data_->_tmp21_ = "";
	}
	_data_->_tmp23_ = _data_->self->priv->_web_view;
	components_web_view_load_html (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp23_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), _data_->_tmp21_, NULL);
	_g_free0 (_data_->body_text);
	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_message_highlight_search_terms_data_free (gpointer _data)
{
	ConversationMessageHighlightSearchTermsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->search_matches);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageHighlightSearchTermsData, _data_);
}

void
conversation_message_highlight_search_terms (ConversationMessage* self,
                                             GeeSet* search_matches,
                                             GCancellable* cancellable,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	ConversationMessageHighlightSearchTermsData* _data_;
	ConversationMessage* _tmp0_;
	GeeSet* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (search_matches, GEE_TYPE_SET));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ConversationMessageHighlightSearchTermsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_highlight_search_terms_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (search_matches);
	_g_object_unref0 (_data_->search_matches);
	_data_->search_matches = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	conversation_message_highlight_search_terms_co (_data_);
}

guint
conversation_message_highlight_search_terms_finish (ConversationMessage* self,
                                                    GAsyncResult* _res_,
                                                    GError** error)
{
	guint result;
	ConversationMessageHighlightSearchTermsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		guint _tmp0_ = 0U;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

/**
     * Highlights user search terms in the message view.
     *
     * Highlighting includes both in the message headers, and the
     * message body. returns the number of matching search terms.
     */
static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
conversation_message_highlight_search_terms_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	ConversationMessageHighlightSearchTermsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_highlight_search_terms_co (_data_);
}

static gboolean
conversation_message_highlight_search_terms_co (ConversationMessageHighlightSearchTermsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->headers_found = (guint) 0;
	{
		_data_->_tmp0_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->search_matches, GEE_TYPE_ITERABLE, GeeIterable));
		_data_->_raw_match_it = _data_->_tmp0_;
		while (TRUE) {
			_data_->_tmp1_ = _data_->_raw_match_it;
			if (!gee_iterator_next (_data_->_tmp1_)) {
				break;
			}
			_data_->_tmp2_ = _data_->_raw_match_it;
			_data_->_tmp3_ = gee_iterator_get (_data_->_tmp2_);
			_data_->raw_match = (gchar*) _data_->_tmp3_;
			_data_->_tmp4_ = _data_->raw_match;
			_data_->_tmp5_ = g_utf8_casefold (_data_->_tmp4_, (gssize) -1);
			_data_->match = _data_->_tmp5_;
			_data_->_tmp6_ = _data_->self->priv->subject_searchable;
			_data_->_tmp7_ = _data_->match;
			if (string_contains (_data_->_tmp6_, _data_->_tmp7_)) {
				_data_->_tmp8_ = _data_->self->priv->subject;
				_data_->_tmp9_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp8_, gtk_widget_get_type (), GtkWidget));
				gtk_style_context_add_class (_data_->_tmp9_, CONVERSATION_MESSAGE_MATCH_CLASS);
				_data_->headers_found = _data_->headers_found + 1;
				_data_->_tmp10_ = _data_->headers_found;
			} else {
				_data_->_tmp11_ = _data_->self->priv->subject;
				_data_->_tmp12_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, gtk_widget_get_type (), GtkWidget));
				gtk_style_context_remove_class (_data_->_tmp12_, CONVERSATION_MESSAGE_MATCH_CLASS);
			}
			{
				_data_->_tmp13_ = _data_->self->priv->searchable_addresses;
				_data_->_address_list = _data_->_tmp13_;
				_data_->_tmp14_ = _data_->_address_list;
				_data_->_tmp15_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp14_, GEE_TYPE_COLLECTION, GeeCollection));
				_data_->_tmp16_ = _data_->_tmp15_;
				_data_->_address_size = _data_->_tmp16_;
				_data_->_address_index = -1;
				while (TRUE) {
					_data_->_address_index = _data_->_address_index + 1;
					_data_->_tmp17_ = _data_->_address_index;
					_data_->_tmp18_ = _data_->_address_size;
					if (!(_data_->_tmp17_ < _data_->_tmp18_)) {
						break;
					}
					_data_->_tmp19_ = _data_->_address_list;
					_data_->_tmp20_ = gee_list_get (_data_->_tmp19_, _data_->_address_index);
					_data_->address = (ConversationMessageContactFlowBoxChild*) _data_->_tmp20_;
					_data_->_tmp21_ = _data_->address;
					_data_->_tmp22_ = _data_->match;
					if (conversation_message_contact_flow_box_child_highlight_search_term (_data_->_tmp21_, _data_->_tmp22_)) {
						_data_->headers_found = _data_->headers_found + 1;
						_data_->_tmp23_ = _data_->headers_found;
					}
					_g_object_unref0 (_data_->address);
				}
			}
			_g_free0 (_data_->match);
			_g_free0 (_data_->raw_match);
		}
		_g_object_unref0 (_data_->_raw_match_it);
	}
	_data_->_tmp24_ = _data_->self->priv->_web_view;
	if (_data_->_tmp24_ == NULL) {
		conversation_message_initialize_web_view (_data_->self);
	}
	_data_->_tmp25_ = _data_->self->priv->_web_view;
	_data_->_state_ = 1;
	conversation_web_view_highlight_search_terms (_data_->_tmp25_, G_TYPE_CHECK_INSTANCE_CAST (_data_->search_matches, GEE_TYPE_COLLECTION, GeeCollection), _data_->cancellable, conversation_message_highlight_search_terms_ready, _data_);
	return FALSE;
	_state_1:
	_data_->webkit_found = conversation_web_view_highlight_search_terms_finish (_data_->_tmp25_, _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_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;
		}
	}
	_data_->result = _data_->headers_found + _data_->webkit_found;
	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;
}

/**
     * Disables highlighting of any search terms in the message view.
     */
void
conversation_message_unmark_search_terms (ConversationMessage* self)
{
	ConversationWebView* _tmp9_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	{
		GeeList* _address_list = NULL;
		GeeList* _tmp0_;
		gint _address_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _address_index = 0;
		_tmp0_ = self->priv->searchable_addresses;
		_address_list = _tmp0_;
		_tmp1_ = _address_list;
		_tmp2_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp3_ = _tmp2_;
		_address_size = _tmp3_;
		_address_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			ConversationMessageContactFlowBoxChild* address = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			ConversationMessageContactFlowBoxChild* _tmp8_;
			_address_index = _address_index + 1;
			_tmp4_ = _address_index;
			_tmp5_ = _address_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _address_list;
			_tmp7_ = gee_list_get (_tmp6_, _address_index);
			address = (ConversationMessageContactFlowBoxChild*) _tmp7_;
			_tmp8_ = address;
			conversation_message_contact_flow_box_child_unmark_search_terms (_tmp8_);
			_g_object_unref0 (address);
		}
	}
	_tmp9_ = self->priv->_web_view;
	if (_tmp9_ != NULL) {
		ConversationWebView* _tmp10_;
		_tmp10_ = self->priv->_web_view;
		conversation_web_view_unmark_search_terms (_tmp10_);
	}
}

/**
     * Updates the displayed date for each conversation row.
     */
void
conversation_message_update_display (ConversationMessage* self)
{
	gchar* date_text = NULL;
	gchar* _tmp0_;
	gchar* date_tooltip = NULL;
	gchar* _tmp1_;
	GDateTime* _tmp2_;
	GtkLabel* _tmp13_;
	const gchar* _tmp14_;
	GtkLabel* _tmp15_;
	const gchar* _tmp16_;
	GtkLabel* _tmp17_;
	const gchar* _tmp18_;
	GtkLabel* _tmp19_;
	const gchar* _tmp20_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = g_strdup ("");
	date_text = _tmp0_;
	_tmp1_ = g_strdup ("");
	date_tooltip = _tmp1_;
	_tmp2_ = self->priv->local_date;
	if (_tmp2_ != NULL) {
		GDateTime* _tmp3_;
		ApplicationConfiguration* _tmp4_;
		UtilDateClockFormat _tmp5_;
		UtilDateClockFormat _tmp6_;
		gchar* _tmp7_;
		GDateTime* _tmp8_;
		ApplicationConfiguration* _tmp9_;
		UtilDateClockFormat _tmp10_;
		UtilDateClockFormat _tmp11_;
		gchar* _tmp12_;
		_tmp3_ = self->priv->local_date;
		_tmp4_ = self->priv->config;
		_tmp5_ = application_configuration_get_clock_format (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = util_date_pretty_print (_tmp3_, _tmp6_);
		_g_free0 (date_text);
		date_text = _tmp7_;
		_tmp8_ = self->priv->local_date;
		_tmp9_ = self->priv->config;
		_tmp10_ = application_configuration_get_clock_format (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = util_date_pretty_print_verbose (_tmp8_, _tmp11_);
		_g_free0 (date_tooltip);
		date_tooltip = _tmp12_;
	}
	_tmp13_ = self->priv->compact_date;
	_tmp14_ = date_text;
	gtk_label_set_text (_tmp13_, _tmp14_);
	_tmp15_ = self->priv->compact_date;
	_tmp16_ = date_tooltip;
	gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), _tmp16_);
	_tmp17_ = self->priv->date;
	_tmp18_ = date_text;
	gtk_label_set_text (_tmp17_, _tmp18_);
	_tmp19_ = self->priv->date;
	_tmp20_ = date_tooltip;
	gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget), _tmp20_);
	_g_free0 (date_tooltip);
	_g_free0 (date_text);
}

static GSimpleAction*
conversation_message_add_action (ConversationMessage* self,
                                 const gchar* name,
                                 gboolean enabled,
                                 const GVariantType* type)
{
	GSimpleAction* action = NULL;
	GSimpleAction* _tmp0_;
	GSimpleActionGroup* _tmp1_;
	GSimpleAction* result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = g_simple_action_new (name, type);
	action = _tmp0_;
	g_simple_action_set_enabled (action, enabled);
	_tmp1_ = self->priv->message_actions;
	g_action_map_add_action (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, g_action_map_get_type (), GActionMap), G_TYPE_CHECK_INSTANCE_CAST (action, g_action_get_type (), GAction));
	result = action;
	return result;
}

static void
conversation_message_set_action_enabled (ConversationMessage* self,
                                         const gchar* name,
                                         gboolean enabled)
{
	GSimpleAction* action = NULL;
	GSimpleActionGroup* _tmp0_;
	GAction* _tmp1_;
	GSimpleAction* _tmp2_;
	GSimpleAction* _tmp3_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->message_actions;
	_tmp1_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, g_action_map_get_type (), GActionMap), name);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp1_) : NULL);
	action = _tmp2_;
	_tmp3_ = action;
	if (_tmp3_ != NULL) {
		GSimpleAction* _tmp4_;
		_tmp4_ = action;
		g_simple_action_set_enabled (_tmp4_, enabled);
	}
	_g_object_unref0 (action);
}

static GMenu*
conversation_message_set_action_param_value (ConversationMessage* self,
                                             GMenuModel* existing,
                                             GVariant* value)
{
	GMenu* menu = NULL;
	GMenu* _tmp0_;
	GMenu* result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (existing, g_menu_model_get_type ()), NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = g_menu_new ();
	menu = _tmp0_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GMenuItem* item = NULL;
				GMenuItem* _tmp3_;
				GVariant* action = NULL;
				GMenuItem* _tmp4_;
				const GVariantType* _tmp5_;
				GVariant* _tmp6_;
				GMenuItem* _tmp7_;
				GVariant* _tmp8_;
				const gchar* _tmp9_;
				GMenu* _tmp10_;
				GMenuItem* _tmp11_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(i < g_menu_model_get_n_items (existing))) {
					break;
				}
				_tmp3_ = g_menu_item_new_from_model (existing, i);
				item = _tmp3_;
				_tmp4_ = item;
				_tmp5_ = G_VARIANT_TYPE_STRING;
				_tmp6_ = g_menu_item_get_attribute_value (_tmp4_, G_MENU_ATTRIBUTE_ACTION, _tmp5_);
				action = _tmp6_;
				_tmp7_ = item;
				_tmp8_ = action;
				_tmp9_ = g_variant_get_string (_tmp8_, NULL);
				g_menu_item_set_action_and_target_value (_tmp7_, _tmp9_, value);
				_tmp10_ = menu;
				_tmp11_ = item;
				g_menu_append_item (_tmp10_, _tmp11_);
				_g_variant_unref0 (action);
				_g_object_unref0 (item);
			}
		}
	}
	result = menu;
	return result;
}

static void
conversation_message_format_originator_compact_data_free (gpointer _data)
{
	ConversationMessageFormatOriginatorCompactData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageFormatOriginatorCompactData, _data_);
}

static void
conversation_message_format_originator_compact (ConversationMessage* self,
                                                GCancellable* cancellable,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ConversationMessageFormatOriginatorCompactData* _data_;
	ConversationMessage* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ConversationMessageFormatOriginatorCompactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_format_originator_compact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	conversation_message_format_originator_compact_co (_data_);
}

static gchar*
conversation_message_format_originator_compact_finish (ConversationMessage* self,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	gchar* result;
	ConversationMessageFormatOriginatorCompactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
conversation_message_format_originator_compact_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	ConversationMessageFormatOriginatorCompactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_format_originator_compact_co (_data_);
}

static gboolean
conversation_message_format_originator_compact_co (ConversationMessageFormatOriginatorCompactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->headers;
	_data_->_tmp1_ = geary_email_header_set_get_from (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->from = _data_->_tmp3_;
	_data_->_tmp4_ = g_strdup ("");
	_data_->text = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->from;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp7_ = _data_->from;
		_data_->_tmp8_ = geary_rf_c822_mailbox_addresses_get_size (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp5_ = _data_->_tmp9_ > 0;
	} else {
		_data_->_tmp5_ = FALSE;
	}
	if (_data_->_tmp5_) {
		_data_->i = 0;
		_data_->_tmp10_ = _data_->from;
		_data_->_tmp11_ = geary_rf_c822_mailbox_addresses_get_all (_data_->_tmp10_);
		_data_->list = _data_->_tmp11_;
		{
			_data_->_tmp12_ = _data_->list;
			_data_->_addr_list = _data_->_tmp12_;
			_data_->_tmp13_ = _data_->_addr_list;
			_data_->_tmp14_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp13_, GEE_TYPE_COLLECTION, GeeCollection));
			_data_->_tmp15_ = _data_->_tmp14_;
			_data_->_addr_size = _data_->_tmp15_;
			_data_->_addr_index = -1;
			while (TRUE) {
				_data_->_addr_index = _data_->_addr_index + 1;
				_data_->_tmp16_ = _data_->_addr_index;
				_data_->_tmp17_ = _data_->_addr_size;
				if (!(_data_->_tmp16_ < _data_->_tmp17_)) {
					break;
				}
				_data_->_tmp18_ = _data_->_addr_list;
				_data_->_tmp19_ = gee_list_get (_data_->_tmp18_, _data_->_addr_index);
				_data_->addr = (GearyRFC822MailboxAddress*) _data_->_tmp19_;
				_data_->_tmp20_ = _data_->self->priv->contacts;
				_data_->_tmp21_ = _data_->addr;
				_data_->_state_ = 1;
				application_contact_store_load (_data_->_tmp20_, _data_->_tmp21_, _data_->cancellable, conversation_message_format_originator_compact_ready, _data_);
				return FALSE;
				_state_1:
				_data_->_tmp22_ = application_contact_store_load_finish (_data_->_tmp20_, _data_->_res_, &_data_->_inner_error0_);
				_data_->originator = _data_->_tmp22_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->addr);
					_g_object_unref0 (_data_->list);
					_g_free0 (_data_->text);
					_g_object_unref0 (_data_->from);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_data_->_tmp23_ = _data_->text;
				_data_->_tmp24_ = _data_->originator;
				_data_->_tmp25_ = application_contact_get_display_name (_data_->_tmp24_);
				_data_->_tmp26_ = _data_->_tmp25_;
				_data_->_tmp27_ = g_strconcat (_data_->_tmp23_, _data_->_tmp26_, NULL);
				_g_free0 (_data_->text);
				_data_->text = _data_->_tmp27_;
				_data_->i = _data_->i + 1;
				_data_->_tmp28_ = _data_->i;
				_data_->_tmp29_ = _data_->list;
				_data_->_tmp30_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp29_, GEE_TYPE_COLLECTION, GeeCollection));
				_data_->_tmp31_ = _data_->_tmp30_;
				if (_data_->_tmp28_ < _data_->_tmp31_) {
					_data_->_tmp32_ = _data_->text;
					_data_->_tmp33_ = g_strconcat (_data_->_tmp32_, _ (", "), NULL);
					_g_free0 (_data_->text);
					_data_->text = _data_->_tmp33_;
				}
				_g_object_unref0 (_data_->originator);
				_g_object_unref0 (_data_->addr);
			}
		}
		_g_object_unref0 (_data_->list);
	} else {
		_data_->_tmp34_ = _data_->self->priv->empty_from_label;
		_data_->_tmp35_ = g_strdup (_data_->_tmp34_);
		_g_free0 (_data_->text);
		_data_->text = _data_->_tmp35_;
	}
	_data_->result = _data_->text;
	_g_object_unref0 (_data_->from);
	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_message_fill_originator_addresses_data_free (gpointer _data)
{
	ConversationMessageFillOriginatorAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->from);
	_g_object_unref0 (_data_->reply_to);
	_g_object_unref0 (_data_->sender);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageFillOriginatorAddressesData, _data_);
}

static void
conversation_message_fill_originator_addresses (ConversationMessage* self,
                                                GearyRFC822MailboxAddresses* from,
                                                GearyRFC822MailboxAddresses* reply_to,
                                                GearyRFC822MailboxAddress* sender,
                                                GCancellable* cancellable,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_)
{
	ConversationMessageFillOriginatorAddressesData* _data_;
	ConversationMessage* _tmp0_;
	GearyRFC822MailboxAddresses* _tmp1_;
	GearyRFC822MailboxAddresses* _tmp2_;
	GearyRFC822MailboxAddress* _tmp3_;
	GCancellable* _tmp4_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail ((from == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (from, GEARY_RF_C822_TYPE_MAILBOX_ADDRESSES));
	g_return_if_fail ((reply_to == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (reply_to, GEARY_RF_C822_TYPE_MAILBOX_ADDRESSES));
	g_return_if_fail ((sender == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (sender, GEARY_RF_C822_TYPE_MAILBOX_ADDRESS));
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ConversationMessageFillOriginatorAddressesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_fill_originator_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (from);
	_g_object_unref0 (_data_->from);
	_data_->from = _tmp1_;
	_tmp2_ = _g_object_ref0 (reply_to);
	_g_object_unref0 (_data_->reply_to);
	_data_->reply_to = _tmp2_;
	_tmp3_ = _g_object_ref0 (sender);
	_g_object_unref0 (_data_->sender);
	_data_->sender = _tmp3_;
	_tmp4_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp4_;
	conversation_message_fill_originator_addresses_co (_data_);
}

static void
conversation_message_fill_originator_addresses_finish (ConversationMessage* self,
                                                       GAsyncResult* _res_,
                                                       GError** error)
{
	ConversationMessageFillOriginatorAddressesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
conversation_message_fill_originator_addresses_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	ConversationMessageFillOriginatorAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_fill_originator_addresses_co (_data_);
}

static gboolean
conversation_message_fill_originator_addresses_co (ConversationMessageFillOriginatorAddressesData* _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:
	if (_data_->from != NULL) {
		_data_->_tmp1_ = geary_rf_c822_mailbox_addresses_get_size (_data_->from);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp0_ = _data_->_tmp2_ > 0;
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		{
			_data_->_address_list = _data_->from;
			_data_->_tmp3_ = _data_->_address_list;
			_data_->_tmp4_ = geary_rf_c822_mailbox_addresses_get_size (_data_->_tmp3_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_data_->_address_size = _data_->_tmp5_;
			_data_->_address_index = -1;
			while (TRUE) {
				_data_->_address_index = _data_->_address_index + 1;
				_data_->_tmp6_ = _data_->_address_index;
				_data_->_tmp7_ = _data_->_address_size;
				if (!(_data_->_tmp6_ < _data_->_tmp7_)) {
					break;
				}
				_data_->_tmp8_ = _data_->_address_list;
				_data_->_tmp9_ = geary_rf_c822_mailbox_addresses_get (_data_->_tmp8_, _data_->_address_index);
				_data_->address = _data_->_tmp9_;
				_data_->_tmp11_ = _data_->self->priv->contacts;
				_data_->_tmp12_ = _data_->address;
				_data_->_state_ = 1;
				application_contact_store_load (_data_->_tmp11_, _data_->_tmp12_, _data_->cancellable, conversation_message_fill_originator_addresses_ready, _data_);
				return FALSE;
				_state_1:
				_data_->_tmp13_ = application_contact_store_load_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
				_data_->_tmp10_ = _data_->_tmp13_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					_g_object_unref0 (_data_->address);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
				_data_->_tmp14_ = _data_->address;
				_data_->_tmp15_ = conversation_message_contact_flow_box_child_new (_data_->_tmp10_, _data_->_tmp14_, CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_FROM);
				g_object_ref_sink (_data_->_tmp15_);
				_data_->child = _data_->_tmp15_;
				_data_->_tmp16_ = _data_->self->priv->searchable_addresses;
				_data_->_tmp17_ = _data_->child;
				gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp17_);
				_data_->_tmp18_ = _data_->self->priv->from;
				_data_->_tmp19_ = _data_->child;
				gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp18_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp19_, gtk_widget_get_type (), GtkWidget));
				_g_object_unref0 (_data_->child);
				_g_object_unref0 (_data_->_tmp10_);
				_g_object_unref0 (_data_->address);
			}
		}
	} else {
		_data_->_tmp20_ = (GtkLabel*) gtk_label_new (NULL);
		g_object_ref_sink (_data_->_tmp20_);
		_data_->label = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->label;
		_data_->_tmp22_ = _data_->self->priv->empty_from_label;
		gtk_label_set_text (_data_->_tmp21_, _data_->_tmp22_);
		_data_->_tmp23_ = (GtkFlowBoxChild*) gtk_flow_box_child_new ();
		g_object_ref_sink (_data_->_tmp23_);
		_data_->_vala1_child = _data_->_tmp23_;
		_data_->_tmp24_ = _data_->_vala1_child;
		_data_->_tmp25_ = _data_->label;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp24_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp25_, gtk_widget_get_type (), GtkWidget));
		_data_->_tmp26_ = _data_->_vala1_child;
		gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp26_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
		_data_->_tmp27_ = _data_->_vala1_child;
		gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp27_, gtk_widget_get_type (), GtkWidget));
		_data_->_tmp28_ = _data_->self->priv->from;
		_data_->_tmp29_ = _data_->_vala1_child;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp28_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp29_, gtk_widget_get_type (), GtkWidget));
		_g_object_unref0 (_data_->_vala1_child);
		_g_object_unref0 (_data_->label);
	}
	if (_data_->sender != NULL) {
		if (_data_->from == NULL) {
			_data_->_tmp31_ = TRUE;
		} else {
			_data_->_tmp32_ = geary_rf_c822_mailbox_address_get_address (_data_->sender);
			_data_->_tmp33_ = _data_->_tmp32_;
			_data_->_tmp31_ = !geary_rf_c822_mailbox_addresses_contains_normalized (_data_->from, _data_->_tmp33_);
		}
		_data_->_tmp30_ = _data_->_tmp31_;
	} else {
		_data_->_tmp30_ = FALSE;
	}
	if (_data_->_tmp30_) {
		_data_->_tmp35_ = _data_->self->priv->contacts;
		_data_->_state_ = 2;
		application_contact_store_load (_data_->_tmp35_, _data_->sender, _data_->cancellable, conversation_message_fill_originator_addresses_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp36_ = application_contact_store_load_finish (_data_->_tmp35_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp34_ = _data_->_tmp36_;
		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_->_tmp37_ = conversation_message_contact_flow_box_child_new (_data_->_tmp34_, _data_->sender, CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_OTHER);
		g_object_ref_sink (_data_->_tmp37_);
		_data_->_vala2_child = _data_->_tmp37_;
		_data_->_tmp38_ = _data_->self->priv->searchable_addresses;
		_data_->_tmp39_ = _data_->_vala2_child;
		gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp38_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp39_);
		_data_->_tmp40_ = _data_->self->priv->sender_header;
		gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp40_, gtk_widget_get_type (), GtkWidget));
		_data_->_tmp41_ = _data_->self->priv->sender_address;
		_data_->_tmp42_ = _data_->_vala2_child;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp41_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp42_, gtk_widget_get_type (), GtkWidget));
		_g_object_unref0 (_data_->_vala2_child);
		_g_object_unref0 (_data_->_tmp34_);
	}
	if (_data_->reply_to != NULL) {
		{
			_data_->_vala1__address_list = _data_->reply_to;
			_data_->_tmp43_ = _data_->_vala1__address_list;
			_data_->_tmp44_ = geary_rf_c822_mailbox_addresses_get_size (_data_->_tmp43_);
			_data_->_tmp45_ = _data_->_tmp44_;
			_data_->_vala1__address_size = _data_->_tmp45_;
			_data_->_vala1__address_index = -1;
			while (TRUE) {
				_data_->_vala1__address_index = _data_->_vala1__address_index + 1;
				_data_->_tmp46_ = _data_->_vala1__address_index;
				_data_->_tmp47_ = _data_->_vala1__address_size;
				if (!(_data_->_tmp46_ < _data_->_tmp47_)) {
					break;
				}
				_data_->_tmp48_ = _data_->_vala1__address_list;
				_data_->_tmp49_ = geary_rf_c822_mailbox_addresses_get (_data_->_tmp48_, _data_->_vala1__address_index);
				_data_->_vala1_address = _data_->_tmp49_;
				if (_data_->from == NULL) {
					_data_->_tmp50_ = TRUE;
				} else {
					_data_->_tmp51_ = _data_->_vala1_address;
					_data_->_tmp52_ = geary_rf_c822_mailbox_address_get_address (_data_->_tmp51_);
					_data_->_tmp53_ = _data_->_tmp52_;
					_data_->_tmp50_ = !geary_rf_c822_mailbox_addresses_contains_normalized (_data_->from, _data_->_tmp53_);
				}
				if (_data_->_tmp50_) {
					_data_->_tmp55_ = _data_->self->priv->contacts;
					_data_->_tmp56_ = _data_->_vala1_address;
					_data_->_state_ = 3;
					application_contact_store_load (_data_->_tmp55_, _data_->_tmp56_, _data_->cancellable, conversation_message_fill_originator_addresses_ready, _data_);
					return FALSE;
					_state_3:
					_data_->_tmp57_ = application_contact_store_load_finish (_data_->_tmp55_, _data_->_res_, &_data_->_inner_error0_);
					_data_->_tmp54_ = _data_->_tmp57_;
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
						_g_object_unref0 (_data_->_vala1_address);
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
					_data_->_tmp58_ = _data_->_vala1_address;
					_data_->_tmp59_ = conversation_message_contact_flow_box_child_new (_data_->_tmp54_, _data_->_tmp58_, CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_OTHER);
					g_object_ref_sink (_data_->_tmp59_);
					_data_->_vala3_child = _data_->_tmp59_;
					_data_->_tmp60_ = _data_->self->priv->searchable_addresses;
					_data_->_tmp61_ = _data_->_vala3_child;
					gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp60_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp61_);
					_data_->_tmp62_ = _data_->self->priv->reply_to_addresses;
					_data_->_tmp63_ = _data_->_vala3_child;
					gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp62_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp63_, gtk_widget_get_type (), GtkWidget));
					_data_->_tmp64_ = _data_->self->priv->reply_to_header;
					gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp64_, gtk_widget_get_type (), GtkWidget));
					_g_object_unref0 (_data_->_vala3_child);
					_g_object_unref0 (_data_->_tmp54_);
				}
				_g_object_unref0 (_data_->_vala1_address);
			}
		}
	}
	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_message_fill_header_addresses_data_free (gpointer _data)
{
	ConversationMessageFillHeaderAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->header);
	_g_object_unref0 (_data_->addresses);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (ConversationMessageFillHeaderAddressesData, _data_);
}

static void
conversation_message_fill_header_addresses (ConversationMessage* self,
                                            GtkGrid* header,
                                            GearyRFC822MailboxAddresses* addresses,
                                            GCancellable* cancellable,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	ConversationMessageFillHeaderAddressesData* _data_;
	ConversationMessage* _tmp0_;
	GtkGrid* _tmp1_;
	GearyRFC822MailboxAddresses* _tmp2_;
	GCancellable* _tmp3_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (header, gtk_grid_get_type ()));
	g_return_if_fail ((addresses == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (addresses, GEARY_RF_C822_TYPE_MAILBOX_ADDRESSES));
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (ConversationMessageFillHeaderAddressesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, conversation_message_fill_header_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (header);
	_g_object_unref0 (_data_->header);
	_data_->header = _tmp1_;
	_tmp2_ = _g_object_ref0 (addresses);
	_g_object_unref0 (_data_->addresses);
	_data_->addresses = _tmp2_;
	_tmp3_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp3_;
	conversation_message_fill_header_addresses_co (_data_);
}

static void
conversation_message_fill_header_addresses_finish (ConversationMessage* self,
                                                   GAsyncResult* _res_,
                                                   GError** error)
{
	ConversationMessageFillHeaderAddressesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
conversation_message_fill_header_addresses_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	ConversationMessageFillHeaderAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	conversation_message_fill_header_addresses_co (_data_);
}

static gboolean
conversation_message_fill_header_addresses_co (ConversationMessageFillHeaderAddressesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->addresses != NULL) {
		_data_->_tmp1_ = geary_rf_c822_mailbox_addresses_get_size (_data_->addresses);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp0_ = _data_->_tmp2_ > 0;
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		_data_->_tmp3_ = gtk_container_get_children (G_TYPE_CHECK_INSTANCE_CAST (_data_->header, gtk_container_get_type (), GtkContainer));
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = g_list_nth (_data_->_tmp4_, (guint) 0);
		_data_->_tmp6_ = _data_->_tmp5_->data;
		_data_->_tmp7_ = (GtkWidget*) _data_->_tmp6_;
		_data_->_tmp8_ = _g_object_ref0 (CONVERSATION_MESSAGE_IS_CONTACT_LIST (_data_->_tmp7_) ? ((ConversationMessageContactList*) _data_->_tmp7_) : NULL);
		_data_->_tmp9_ = _data_->_tmp8_;
		(_data_->_tmp4_ == NULL) ? NULL : (_data_->_tmp4_ = (g_list_free (_data_->_tmp4_), NULL));
		_data_->box = _data_->_tmp9_;
		_data_->_tmp10_ = _data_->box;
		if (_data_->_tmp10_ != NULL) {
			{
				_data_->_address_list = _data_->addresses;
				_data_->_tmp11_ = _data_->_address_list;
				_data_->_tmp12_ = geary_rf_c822_mailbox_addresses_get_size (_data_->_tmp11_);
				_data_->_tmp13_ = _data_->_tmp12_;
				_data_->_address_size = _data_->_tmp13_;
				_data_->_address_index = -1;
				while (TRUE) {
					_data_->_address_index = _data_->_address_index + 1;
					_data_->_tmp14_ = _data_->_address_index;
					_data_->_tmp15_ = _data_->_address_size;
					if (!(_data_->_tmp14_ < _data_->_tmp15_)) {
						break;
					}
					_data_->_tmp16_ = _data_->_address_list;
					_data_->_tmp17_ = geary_rf_c822_mailbox_addresses_get (_data_->_tmp16_, _data_->_address_index);
					_data_->address = _data_->_tmp17_;
					_data_->_tmp19_ = _data_->self->priv->contacts;
					_data_->_tmp20_ = _data_->address;
					_data_->_state_ = 1;
					application_contact_store_load (_data_->_tmp19_, _data_->_tmp20_, _data_->cancellable, conversation_message_fill_header_addresses_ready, _data_);
					return FALSE;
					_state_1:
					_data_->_tmp21_ = application_contact_store_load_finish (_data_->_tmp19_, _data_->_res_, &_data_->_inner_error0_);
					_data_->_tmp18_ = _data_->_tmp21_;
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
						_g_object_unref0 (_data_->address);
						_g_object_unref0 (_data_->box);
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
					_data_->_tmp22_ = _data_->address;
					_data_->_tmp23_ = conversation_message_contact_flow_box_child_new (_data_->_tmp18_, _data_->_tmp22_, CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_OTHER);
					g_object_ref_sink (_data_->_tmp23_);
					_data_->child = _data_->_tmp23_;
					_data_->_tmp24_ = _data_->self->priv->searchable_addresses;
					_data_->_tmp25_ = _data_->child;
					gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp24_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp25_);
					_data_->_tmp26_ = _data_->box;
					_data_->_tmp27_ = _data_->child;
					gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp26_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp27_, gtk_widget_get_type (), GtkWidget));
					_g_object_unref0 (_data_->child);
					_g_object_unref0 (_data_->_tmp18_);
					_g_object_unref0 (_data_->address);
				}
			}
		}
		gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_data_->header, gtk_widget_get_type (), GtkWidget), TRUE);
		_g_object_unref0 (_data_->box);
	}
	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 gchar*
conversation_message_inline_image_replacer (ConversationMessage* self,
                                            GearyRFC822Part* part)
{
	ConversationWebView* _tmp0_;
	GearyMimeContentType* content_type = NULL;
	GearyMimeContentType* _tmp1_;
	GearyMimeContentType* _tmp2_;
	GearyMimeContentType* _tmp3_;
	gboolean _tmp4_ = FALSE;
	GearyMimeContentType* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* id = NULL;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	const gchar* _tmp18_;
	gchar* UNKNOWN_FILENAME_ALT_TEXT = NULL;
	gchar* _tmp27_;
	gchar* _tmp28_ = NULL;
	gchar* _tmp29_;
	gchar* clean_filename = NULL;
	gchar* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (part, GEARY_RF_C822_TYPE_PART), NULL);
	_tmp0_ = self->priv->_web_view;
	if (_tmp0_ == NULL) {
		conversation_message_initialize_web_view (self);
	}
	_tmp1_ = geary_rf_c822_part_get_content_type (part);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	content_type = _tmp3_;
	_tmp5_ = content_type;
	_tmp6_ = geary_mime_content_type_get_media_type (_tmp5_);
	_tmp7_ = _tmp6_;
	if (g_strcmp0 (_tmp7_, "image") != 0) {
		_tmp4_ = TRUE;
	} else {
		ConversationWebView* _tmp8_;
		GearyMimeContentType* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp8_ = self->priv->_web_view;
		_tmp9_ = content_type;
		_tmp10_ = geary_mime_content_type_to_string (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp4_ = !webkit_web_view_can_show_mime_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, webkit_web_view_get_type (), WebKitWebView), _tmp11_);
		_g_free0 (_tmp11_);
	}
	if (_tmp4_) {
		GearyMimeContentType* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp12_ = content_type;
		_tmp13_ = geary_mime_content_type_to_string (_tmp12_);
		_tmp14_ = _tmp13_;
		g_debug ("conversation-message.vala:1131: Not displaying %s inline: unsupported " \
"Content-Type", _tmp14_);
		_g_free0 (_tmp14_);
		result = NULL;
		_g_object_unref0 (content_type);
		return result;
	}
	_tmp15_ = geary_rf_c822_part_get_content_id (part);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strdup (_tmp16_);
	id = _tmp17_;
	_tmp18_ = id;
	if (_tmp18_ == NULL) {
		gint _tmp19_;
		gchar* _tmp20_;
		_tmp19_ = self->priv->next_replaced_buffer_number;
		self->priv->next_replaced_buffer_number = _tmp19_ + 1;
		_tmp20_ = g_strdup_printf (CONVERSATION_MESSAGE_REPLACED_CID_TEMPLATE, _tmp19_);
		_g_free0 (id);
		id = _tmp20_;
	}
	{
		GearyMemoryBuffer* _tmp21_ = NULL;
		GearyMemoryBuffer* _tmp22_;
		ConversationWebView* _tmp23_;
		const gchar* _tmp24_;
		_tmp22_ = geary_rf_c822_part_write_to_buffer (part, GEARY_RF_C822_PART_ENCODING_CONVERSION_UTF8, GEARY_RF_C822_PART_BODY_FORMATTING_NONE, &_inner_error0_);
		_tmp21_ = _tmp22_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == GEARY_RF_C822_ERROR) {
				goto __catch0_geary_rf_c822_error;
			}
			_g_free0 (id);
			_g_object_unref0 (content_type);
			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;
		}
		_tmp23_ = self->priv->_web_view;
		_tmp24_ = id;
		components_web_view_add_internal_resource (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), _tmp24_, _tmp21_);
		_g_object_unref0 (_tmp21_);
	}
	goto __finally0;
	__catch0_geary_rf_c822_error:
	{
		GError* err = NULL;
		GError* _tmp25_;
		const gchar* _tmp26_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp25_ = err;
		_tmp26_ = _tmp25_->message;
		g_debug ("conversation-message.vala:1147: Failed to get inline buffer: %s", _tmp26_);
		result = NULL;
		_g_error_free0 (err);
		_g_free0 (id);
		_g_object_unref0 (content_type);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (id);
		_g_object_unref0 (content_type);
		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;
	}
	_tmp27_ = g_strdup (_ ("Image"));
	UNKNOWN_FILENAME_ALT_TEXT = _tmp27_;
	_tmp29_ = geary_rf_c822_part_get_clean_filename (part);
	_tmp28_ = _tmp29_;
	if (_tmp28_ == NULL) {
		const gchar* _tmp30_;
		gchar* _tmp31_;
		_tmp30_ = UNKNOWN_FILENAME_ALT_TEXT;
		_tmp31_ = g_strdup (_tmp30_);
		_g_free0 (_tmp28_);
		_tmp28_ = _tmp31_;
	}
	_tmp32_ = geary_html_escape_markup (_tmp28_);
	clean_filename = _tmp32_;
	_tmp33_ = clean_filename;
	_tmp34_ = id;
	_tmp35_ = geary_html_escape_markup (_tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = g_strdup_printf ("<img alt=\"%s\" class=\"%s\" src=\"%s%s\" />", _tmp33_, CONVERSATION_MESSAGE_REPLACED_IMAGE_CLASS, COMPONENTS_WEB_VIEW_CID_URL_PREFIX, _tmp36_);
	_tmp38_ = _tmp37_;
	_g_free0 (_tmp36_);
	result = _tmp38_;
	_g_free0 (clean_filename);
	_g_free0 (_tmp28_);
	_g_free0 (UNKNOWN_FILENAME_ALT_TEXT);
	_g_free0 (id);
	_g_object_unref0 (content_type);
	return result;
}

static void
conversation_message_show_images (ConversationMessage* self,
                                  gboolean update_email_flag)
{
	ComponentsInfoBar* _tmp0_;
	ConversationWebView* _tmp3_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->remote_images_info_bar;
	if (_tmp0_ != NULL) {
		ComponentsInfoBarStack* _tmp1_;
		ComponentsInfoBar* _tmp2_;
		_tmp1_ = self->priv->_info_bars;
		_tmp2_ = self->priv->remote_images_info_bar;
		components_info_bar_stack_remove (_tmp1_, _tmp2_);
		_g_object_unref0 (self->priv->remote_images_info_bar);
		self->priv->remote_images_info_bar = NULL;
	}
	self->priv->load_remote_resources = TRUE;
	self->priv->remote_resources_requested = 0;
	self->priv->remote_resources_loaded = 0;
	_tmp3_ = self->priv->_web_view;
	if (_tmp3_ != NULL) {
		ConversationWebView* _tmp4_;
		_tmp4_ = self->priv->_web_view;
		components_web_view_load_remote_resources (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView), NULL, NULL, NULL);
	}
	if (update_email_flag) {
		g_signal_emit (self, conversation_message_signals[CONVERSATION_MESSAGE_FLAG_REMOTE_IMAGES_SIGNAL], 0);
	}
}

static void
conversation_message_show_placeholder_pane (ConversationMessage* self,
                                            GtkWidget* placeholder)
{
	GtkWidget* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail ((placeholder == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (placeholder, gtk_widget_get_type ()));
	_tmp0_ = self->priv->body_placeholder;
	if (_tmp0_ != NULL) {
		GtkWidget* _tmp1_;
		GtkGrid* _tmp2_;
		GtkWidget* _tmp3_;
		_tmp1_ = self->priv->body_placeholder;
		gtk_widget_hide (_tmp1_);
		_tmp2_ = self->priv->_body_container;
		_tmp3_ = self->priv->body_placeholder;
		gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_container_get_type (), GtkContainer), _tmp3_);
		_g_object_unref0 (self->priv->body_placeholder);
		self->priv->body_placeholder = NULL;
	}
	if (placeholder != NULL) {
		GtkWidget* _tmp4_;
		ConversationWebView* _tmp5_;
		GtkGrid* _tmp7_;
		_tmp4_ = _g_object_ref0 (placeholder);
		_g_object_unref0 (self->priv->body_placeholder);
		self->priv->body_placeholder = _tmp4_;
		_tmp5_ = self->priv->_web_view;
		if (_tmp5_ != NULL) {
			ConversationWebView* _tmp6_;
			_tmp6_ = self->priv->_web_view;
			gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget));
		}
		_tmp7_ = self->priv->_body_container;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_container_get_type (), GtkContainer), placeholder);
		conversation_message_show_message_body (self, TRUE);
	} else {
		ConversationWebView* _tmp8_;
		_tmp8_ = self->priv->_web_view;
		if (_tmp8_ != NULL) {
			ConversationWebView* _tmp9_;
			_tmp9_ = self->priv->_web_view;
			gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
		}
	}
}

static inline void
conversation_message_set_revealer (ConversationMessage* self,
                                   GtkRevealer* revealer,
                                   gboolean expand,
                                   gboolean use_transition)
{
	GtkRevealerTransitionType transition = 0;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (revealer, gtk_revealer_get_type ()));
	transition = gtk_revealer_get_transition_type (revealer);
	if (!use_transition) {
		gtk_revealer_set_transition_type (revealer, GTK_REVEALER_TRANSITION_TYPE_NONE);
	}
	gtk_revealer_set_reveal_child (revealer, expand);
	gtk_revealer_set_transition_type (revealer, transition);
}

static void
conversation_message_on_show_progress_timeout (ConversationMessage* self)
{
	GtkProgressBar* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->body_progress;
	_tmp1_ = gtk_progress_bar_get_fraction (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ < 0.99) {
		GearyTimeoutManager* _tmp3_;
		GtkProgressBar* _tmp4_;
		_tmp3_ = self->priv->progress_pulse;
		geary_timeout_manager_reset (_tmp3_);
		_tmp4_ = self->priv->body_progress;
		gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
	}
}

static void
conversation_message_on_hide_progress_timeout (ConversationMessage* self)
{
	GearyTimeoutManager* _tmp0_;
	GtkProgressBar* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->progress_pulse;
	geary_timeout_manager_reset (_tmp0_);
	_tmp1_ = self->priv->body_progress;
	gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
}

static void
__lambda85_ (ConversationMessage* self)
{
	gint _tmp0_;
	GtkProgressBar* _tmp1_;
	_tmp0_ = self->priv->remote_resources_loaded;
	self->priv->remote_resources_loaded = _tmp0_ + 1;
	_tmp1_ = self->priv->body_progress;
	gtk_progress_bar_set_fraction (_tmp1_, (gdouble) (((gfloat) self->priv->remote_resources_loaded) / ((gfloat) self->priv->remote_resources_requested)));
	if (self->priv->remote_resources_loaded == self->priv->remote_resources_requested) {
		conversation_message_stop_progress_loading (self);
	}
}

static void
___lambda85__webkit_web_resource_finished (WebKitWebResource* _sender,
                                           gpointer self)
{
	__lambda85_ ((ConversationMessage*) self);
}

static void
conversation_message_on_resource_load_started (ConversationMessage* self,
                                               WebKitWebView* view,
                                               WebKitWebResource* res,
                                               WebKitURIRequest* req)
{
	GeeMap* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (view, webkit_web_view_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, webkit_web_resource_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (req, webkit_uri_request_get_type ()));
	_tmp0_ = self->priv->resources;
	_tmp1_ = webkit_web_resource_get_uri (res);
	gee_map_set (_tmp0_, _tmp1_, res);
	if (self->priv->remote_resources_loaded == self->priv->remote_resources_requested) {
		conversation_message_start_progress_loading (self);
	}
	_tmp2_ = self->priv->remote_resources_requested;
	self->priv->remote_resources_requested = _tmp2_ + 1;
	g_signal_connect_object (res, "finished", (GCallback) ___lambda85__webkit_web_resource_finished, self, 0);
}

static Block98Data*
block98_data_ref (Block98Data* _data98_)
{
	g_atomic_int_inc (&_data98_->_ref_count_);
	return _data98_;
}

static void
block98_data_unref (void * _userdata_)
{
	Block98Data* _data98_;
	_data98_ = (Block98Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data98_->_ref_count_)) {
		ConversationMessage* self;
		self = _data98_->self;
		_g_object_unref0 (_data98_->address_child);
		_g_object_unref0 (self);
		g_slice_free (Block98Data, _data98_);
	}
}

static GVariant*
_variant_new26 (gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static void
___lambda96_ (Block98Data* _data98_,
              gboolean enabled)
{
	ConversationMessage* self;
	gboolean _tmp0_ = FALSE;
	ApplicationContact* _tmp1_;
	ConversationMessageContactFlowBoxChild* _tmp2_;
	ApplicationContact* _tmp3_;
	ApplicationContact* _tmp4_;
	self = _data98_->self;
	_tmp1_ = self->priv->_primary_contact;
	_tmp2_ = _data98_->address_child;
	_tmp3_ = conversation_message_contact_flow_box_child_get_contact (_tmp2_);
	_tmp4_ = _tmp3_;
	if (application_contact_equal_to (_tmp1_, _tmp4_)) {
		_tmp0_ = enabled;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		conversation_message_show_images (self, FALSE);
	}
}

static void
____lambda96__conversation_contact_popover_load_remote_resources_changed (ConversationContactPopover* _sender,
                                                                          gboolean enabled,
                                                                          gpointer self)
{
	___lambda96_ (self, enabled);
}

static void
___lambda97_ (Block98Data* _data98_)
{
	ConversationMessage* self;
	ConversationMessageContactFlowBoxChild* _tmp0_;
	self = _data98_->self;
	_tmp0_ = _data98_->address_child;
	gtk_widget_unset_state_flags (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), GTK_STATE_FLAG_ACTIVE);
}

static void
____lambda97__gtk_popover_closed (GtkPopover* _sender,
                                  gpointer self)
{
	___lambda97_ (self);
}

static void
conversation_message_on_address_box_child_activated (ConversationMessage* self,
                                                     GtkFlowBox* box,
                                                     GtkFlowBoxChild* child)
{
	Block98Data* _data98_;
	ConversationMessageContactFlowBoxChild* _tmp0_;
	ConversationMessageContactFlowBoxChild* _tmp1_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (box, gtk_flow_box_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_flow_box_child_get_type ()));
	_data98_ = g_slice_new0 (Block98Data);
	_data98_->_ref_count_ = 1;
	_data98_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (child) ? ((ConversationMessageContactFlowBoxChild*) child) : NULL);
	_data98_->address_child = _tmp0_;
	_tmp1_ = _data98_->address_child;
	if (_tmp1_ != NULL) {
		ConversationMessageContactFlowBoxChild* _tmp2_;
		GearyRFC822MailboxAddress* address = NULL;
		ConversationMessageContactFlowBoxChild* _tmp3_;
		GearyRFC822MailboxAddress* _tmp4_;
		GearyRFC822MailboxAddress* _tmp5_;
		GearyRFC822MailboxAddress* _tmp6_;
		GeeMap* values = NULL;
		GeeHashMap* _tmp7_;
		GeeMap* _tmp8_;
		GearyRFC822MailboxAddress* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		GVariant* _tmp12_;
		ConversationContactPopover* popover = NULL;
		ConversationMessageContactFlowBoxChild* _tmp13_;
		ConversationMessageContactFlowBoxChild* _tmp14_;
		ApplicationContact* _tmp15_;
		ApplicationContact* _tmp16_;
		GearyRFC822MailboxAddress* _tmp17_;
		ApplicationConfiguration* _tmp18_;
		ConversationContactPopover* _tmp19_;
		ConversationContactPopover* _tmp20_;
		ConversationContactPopover* _tmp21_;
		ConversationContactPopover* _tmp22_;
		ConversationContactPopover* _tmp23_;
		_tmp2_ = _data98_->address_child;
		gtk_widget_set_state_flags (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), GTK_STATE_FLAG_ACTIVE, FALSE);
		_tmp3_ = _data98_->address_child;
		_tmp4_ = conversation_message_contact_flow_box_child_get_displayed (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _g_object_ref0 (_tmp5_);
		address = _tmp6_;
		_tmp7_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_VARIANT, (GBoxedCopyFunc) g_variant_ref, (GDestroyNotify) g_variant_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		values = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_MAP, GeeMap);
		_tmp8_ = values;
		_tmp9_ = address;
		_tmp10_ = geary_rf_c822_mailbox_address_to_full_display (_tmp9_, "<", ">");
		_tmp11_ = _tmp10_;
		_tmp12_ = _variant_new26 (_tmp11_);
		gee_map_set (_tmp8_, CONVERSATION_MESSAGE_ACTION_COPY_EMAIL, _tmp12_);
		_g_variant_unref0 (_tmp12_);
		_g_free0 (_tmp11_);
		_tmp13_ = _data98_->address_child;
		_tmp14_ = _data98_->address_child;
		_tmp15_ = conversation_message_contact_flow_box_child_get_contact (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = address;
		_tmp18_ = self->priv->config;
		_tmp19_ = conversation_contact_popover_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget), _tmp16_, _tmp17_, _tmp18_);
		g_object_ref_sink (_tmp19_);
		popover = _tmp19_;
		_tmp20_ = popover;
		gtk_popover_set_position (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_popover_get_type (), GtkPopover), GTK_POS_BOTTOM);
		_tmp21_ = popover;
		g_signal_connect_data (_tmp21_, "load-remote-resources-changed", (GCallback) ____lambda96__conversation_contact_popover_load_remote_resources_changed, block98_data_ref (_data98_), (GClosureNotify) block98_data_unref, 0);
		_tmp22_ = popover;
		g_signal_connect_data (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_popover_get_type (), GtkPopover), "closed", (GCallback) ____lambda97__gtk_popover_closed, block98_data_ref (_data98_), (GClosureNotify) block98_data_unref, 0);
		_tmp23_ = popover;
		gtk_popover_popup (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_popover_get_type (), GtkPopover));
		_g_object_unref0 (popover);
		_g_object_unref0 (values);
		_g_object_unref0 (address);
	}
	block98_data_unref (_data98_);
	_data98_ = NULL;
}

static void
_conversation_message_on_address_box_child_activated_gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                                                                   GtkFlowBoxChild* child,
                                                                                   gpointer self)
{
	conversation_message_on_address_box_child_activated ((ConversationMessage*) self, _sender, child);
}

static gboolean
conversation_message_on_context_menu (ConversationMessage* self,
                                      WebKitWebView* view,
                                      WebKitContextMenu* context_menu,
                                      GdkEvent* event,
                                      WebKitHitTestResult* hit_test)
{
	GtkMenu* _tmp0_;
	GMenu* model = NULL;
	GMenu* _tmp2_;
	GMenu* _tmp33_;
	GMenuModel* _tmp34_;
	GMenuModel* _tmp35_;
	GMenu* _tmp38_;
	GtkMenu* _tmp39_;
	GtkMenu* _tmp40_;
	GtkMenu* _tmp41_;
	gboolean result;
	g_return_val_if_fail (IS_CONVERSATION_MESSAGE (self), FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (view, webkit_web_view_get_type ()), FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (context_menu, webkit_context_menu_get_type ()), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (hit_test, webkit_hit_test_result_get_type ()), FALSE);
	_tmp0_ = self->priv->context_menu;
	if (_tmp0_ != NULL) {
		GtkMenu* _tmp1_;
		_tmp1_ = self->priv->context_menu;
		gtk_menu_detach (_tmp1_);
	}
	_tmp2_ = g_menu_new ();
	model = _tmp2_;
	if (webkit_hit_test_result_context_is_link (hit_test)) {
		gchar* link_url = NULL;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		GMenuModel* _tmp5_ = NULL;
		const gchar* _tmp6_;
		GMenuModel* link_menu = NULL;
		GMenuModel* _tmp9_;
		GMenu* _tmp10_;
		GMenuModel* _tmp11_;
		const gchar* _tmp12_;
		GVariant* _tmp13_;
		GVariant* _tmp14_;
		GMenu* _tmp15_;
		GMenu* _tmp16_;
		_tmp3_ = webkit_hit_test_result_get_link_uri (hit_test);
		_tmp4_ = g_strdup (_tmp3_);
		link_url = _tmp4_;
		_tmp6_ = link_url;
		if (g_str_has_prefix (_tmp6_, CONVERSATION_MESSAGE_MAILTO_URI_PREFIX)) {
			GMenuModel* _tmp7_;
			_tmp7_ = self->priv->context_menu_email;
			_tmp5_ = _tmp7_;
		} else {
			GMenuModel* _tmp8_;
			_tmp8_ = self->priv->context_menu_link;
			_tmp5_ = _tmp8_;
		}
		_tmp9_ = _g_object_ref0 (_tmp5_);
		link_menu = _tmp9_;
		_tmp10_ = model;
		_tmp11_ = link_menu;
		_tmp12_ = link_url;
		_tmp13_ = g_variant_new_string (_tmp12_);
		g_variant_ref_sink (_tmp13_);
		_tmp14_ = _tmp13_;
		_tmp15_ = conversation_message_set_action_param_value (self, _tmp11_, _tmp14_);
		_tmp16_ = _tmp15_;
		g_menu_append_section (_tmp10_, NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, g_menu_model_get_type (), GMenuModel));
		_g_object_unref0 (_tmp16_);
		_g_variant_unref0 (_tmp14_);
		_g_object_unref0 (link_menu);
		_g_free0 (link_url);
	}
	if (webkit_hit_test_result_context_is_image (hit_test)) {
		gchar* uri = NULL;
		const gchar* _tmp17_;
		gchar* _tmp18_;
		GeeMap* _tmp19_;
		const gchar* _tmp20_;
		GMenu* _tmp21_;
		GMenuModel* _tmp22_;
		const gchar* _tmp23_;
		GVariant* _tmp24_;
		const gchar* _tmp25_;
		GVariant* _tmp26_;
		GVariant** _tmp27_;
		GVariant** _tmp28_;
		gint _tmp28__length1;
		GVariant* _tmp29_;
		GVariant* _tmp30_;
		GMenu* _tmp31_;
		GMenu* _tmp32_;
		_tmp17_ = webkit_hit_test_result_get_image_uri (hit_test);
		_tmp18_ = g_strdup (_tmp17_);
		uri = _tmp18_;
		_tmp19_ = self->priv->resources;
		_tmp20_ = uri;
		conversation_message_set_action_enabled (self, CONVERSATION_MESSAGE_ACTION_SAVE_IMAGE, gee_map_has_key (_tmp19_, _tmp20_));
		_tmp21_ = model;
		_tmp22_ = self->priv->context_menu_image;
		_tmp23_ = uri;
		_tmp24_ = g_variant_new_string (_tmp23_);
		g_variant_ref_sink (_tmp24_);
		_tmp25_ = webkit_hit_test_result_get_link_label (hit_test);
		_tmp26_ = g_variant_new ("ms", _tmp25_, NULL);
		g_variant_ref_sink (_tmp26_);
		_tmp27_ = g_new0 (GVariant*, 2 + 1);
		_tmp27_[0] = _tmp24_;
		_tmp27_[1] = _tmp26_;
		_tmp28_ = _tmp27_;
		_tmp28__length1 = 2;
		_tmp29_ = g_variant_new_tuple (_tmp28_, 2);
		g_variant_ref_sink (_tmp29_);
		_tmp30_ = _tmp29_;
		_tmp31_ = conversation_message_set_action_param_value (self, _tmp22_, _tmp30_);
		_tmp32_ = _tmp31_;
		g_menu_append_section (_tmp21_, NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, g_menu_model_get_type (), GMenuModel));
		_g_object_unref0 (_tmp32_);
		_g_variant_unref0 (_tmp30_);
		_tmp28_ = (_vala_array_free (_tmp28_, _tmp28__length1, (GDestroyNotify) g_variant_unref), NULL);
		_g_free0 (uri);
	}
	_tmp33_ = model;
	_tmp34_ = self->priv->context_menu_main;
	g_menu_append_section (_tmp33_, NULL, _tmp34_);
	_tmp35_ = self->priv->context_menu_inspector;
	if (_tmp35_ != NULL) {
		GMenu* _tmp36_;
		GMenuModel* _tmp37_;
		_tmp36_ = model;
		_tmp37_ = self->priv->context_menu_inspector;
		g_menu_append_section (_tmp36_, NULL, _tmp37_);
	}
	_tmp38_ = model;
	_tmp39_ = (GtkMenu*) gtk_menu_new_from_model (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, g_menu_model_get_type (), GMenuModel));
	g_object_ref_sink (_tmp39_);
	_g_object_unref0 (self->priv->context_menu);
	self->priv->context_menu = _tmp39_;
	_tmp40_ = self->priv->context_menu;
	gtk_menu_attach_to_widget (_tmp40_, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), NULL);
	_tmp41_ = self->priv->context_menu;
	gtk_menu_popup_at_pointer (_tmp41_, event);
	result = TRUE;
	_g_object_unref0 (model);
	return result;
}

static void
conversation_message_on_mouse_target_changed (ConversationMessage* self,
                                              WebKitWebView* web_view,
                                              WebKitHitTestResult* hit_test,
                                              guint modifiers)
{
	gchar* _tmp0_ = NULL;
	GtkGrid* _tmp3_;
	GtkGrid* _tmp4_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (web_view, webkit_web_view_get_type ()));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (hit_test, webkit_hit_test_result_get_type ()));
	if (webkit_hit_test_result_context_is_link (hit_test)) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = webkit_hit_test_result_get_link_uri (hit_test);
		_tmp2_ = util_gtk_shorten_url (_tmp1_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	} else {
		_g_free0 (_tmp0_);
		_tmp0_ = NULL;
	}
	_tmp3_ = self->priv->_body_container;
	gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget), _tmp0_);
	_tmp4_ = self->priv->_body_container;
	gtk_widget_trigger_tooltip_query (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
	_g_free0 (_tmp0_);
}

static Block99Data*
block99_data_ref (Block99Data* _data99_)
{
	g_atomic_int_inc (&_data99_->_ref_count_);
	return _data99_;
}

static void
block99_data_unref (void * _userdata_)
{
	Block99Data* _data99_;
	_data99_ = (Block99Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data99_->_ref_count_)) {
		ConversationMessage* self;
		self = _data99_->self;
		_g_object_unref0 (_data99_->main);
		_g_object_unref0 (_data99_->link_popover);
		_g_object_unref0 (self);
		g_slice_free (Block99Data, _data99_);
	}
}

static gboolean
__lambda81_ (Block99Data* _data99_,
             GtkLabel* label,
             const gchar* uri)
{
	ConversationMessage* self;
	ApplicationClient* _tmp0_;
	ApplicationClient* _tmp1_;
	gboolean result;
	self = _data99_->self;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (label, gtk_label_get_type ()), FALSE);
	g_return_val_if_fail (uri != NULL, FALSE);
	gtk_popover_popdown (_data99_->link_popover);
	_tmp0_ = application_main_window_get_application (_data99_->main);
	_tmp1_ = _tmp0_;
	application_client_show_uri (_tmp1_, uri, NULL, NULL);
	result = GDK_EVENT_STOP;
	return result;
}

static gboolean
___lambda81__gtk_label_activate_link (GtkLabel* _sender,
                                      const gchar* uri,
                                      gpointer self)
{
	gboolean result;
	result = __lambda81_ (self, _sender, uri);
	return result;
}

static gboolean
__lambda82_ (Block99Data* _data99_,
             GtkLabel* label,
             const gchar* uri)
{
	ConversationMessage* self;
	ApplicationClient* _tmp0_;
	ApplicationClient* _tmp1_;
	gboolean result;
	self = _data99_->self;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (label, gtk_label_get_type ()), FALSE);
	g_return_val_if_fail (uri != NULL, FALSE);
	gtk_popover_popdown (_data99_->link_popover);
	_tmp0_ = application_main_window_get_application (_data99_->main);
	_tmp1_ = _tmp0_;
	application_client_show_uri (_tmp1_, uri, NULL, NULL);
	result = GDK_EVENT_STOP;
	return result;
}

static gboolean
___lambda82__gtk_label_activate_link (GtkLabel* _sender,
                                      const gchar* uri,
                                      gpointer self)
{
	gboolean result;
	result = __lambda82_ (self, _sender, uri);
	return result;
}

static void
__lambda83_ (Block99Data* _data99_)
{
	ConversationMessage* self;
	self = _data99_->self;
	gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_data99_->link_popover, gtk_widget_get_type (), GtkWidget));
}

static void
___lambda83__gtk_popover_closed (GtkPopover* _sender,
                                 gpointer self)
{
	__lambda83_ (self);
}

static void
conversation_message_on_deceptive_link_clicked (ConversationMessage* self,
                                                ConversationWebViewDeceptiveText reason,
                                                const gchar* text,
                                                const gchar* href,
                                                GdkRectangle* location)
{
	Block99Data* _data99_;
	gchar* text_href = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	gchar* _tmp7_ = NULL;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* text_label = NULL;
	gchar* _tmp11_;
	gchar* anchor_href = NULL;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gboolean _tmp16_;
	gchar* _tmp19_ = NULL;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* anchor_label = NULL;
	gchar* _tmp23_;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp24_;
	GObject* _tmp25_;
	GtkPopover* _tmp26_;
	GtkLabel* good_link = NULL;
	GObject* _tmp27_;
	GtkLabel* _tmp28_;
	GtkLabel* bad_link = NULL;
	GObject* _tmp29_;
	GtkLabel* _tmp30_;
	GtkWidget* _tmp31_;
	ApplicationMainWindow* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	const gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	ConversationWebView* _tmp40_;
	GdkRectangle _tmp41_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	g_return_if_fail (text != NULL);
	g_return_if_fail (href != NULL);
	g_return_if_fail (location != NULL);
	_data99_ = g_slice_new0 (Block99Data);
	_data99_->_ref_count_ = 1;
	_data99_->self = g_object_ref (self);
	_tmp0_ = g_strdup (text);
	text_href = _tmp0_;
	_tmp1_ = text_href;
	_tmp2_ = g_uri_parse_scheme (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_ == NULL;
	_g_free0 (_tmp3_);
	if (_tmp4_) {
		const gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = text_href;
		_tmp6_ = g_strconcat ("http://", _tmp5_, NULL);
		_g_free0 (text_href);
		text_href = _tmp6_;
	}
	_tmp8_ = text_href;
	_tmp9_ = g_uri_unescape_string (_tmp8_, NULL);
	_tmp7_ = _tmp9_;
	if (_tmp7_ == NULL) {
		gchar* _tmp10_;
		_tmp10_ = g_strdup (_ ("(unknown)"));
		_g_free0 (_tmp7_);
		_tmp7_ = _tmp10_;
	}
	_tmp11_ = _tmp7_;
	_tmp7_ = NULL;
	text_label = _tmp11_;
	_tmp12_ = g_strdup (href);
	anchor_href = _tmp12_;
	_tmp13_ = anchor_href;
	_tmp14_ = g_uri_parse_scheme (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_ == NULL;
	_g_free0 (_tmp15_);
	if (_tmp16_) {
		const gchar* _tmp17_;
		gchar* _tmp18_;
		_tmp17_ = anchor_href;
		_tmp18_ = g_strconcat ("http://", _tmp17_, NULL);
		_g_free0 (anchor_href);
		anchor_href = _tmp18_;
	}
	_tmp20_ = anchor_href;
	_tmp21_ = g_uri_unescape_string (_tmp20_, NULL);
	_tmp19_ = _tmp21_;
	if (_tmp19_ == NULL) {
		gchar* _tmp22_;
		_tmp22_ = g_strdup (_ ("(unknown)"));
		_g_free0 (_tmp19_);
		_tmp19_ = _tmp22_;
	}
	_tmp23_ = _tmp19_;
	_tmp19_ = NULL;
	anchor_label = _tmp23_;
	_tmp24_ = gtk_builder_new_from_resource ("/org/gnome/Geary/conversation-message-link-popover.ui");
	builder = _tmp24_;
	_tmp25_ = gtk_builder_get_object (builder, "link_popover");
	_tmp26_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp25_, gtk_popover_get_type ()) ? ((GtkPopover*) _tmp25_) : NULL);
	_data99_->link_popover = _tmp26_;
	_tmp27_ = gtk_builder_get_object (builder, "good_link_label");
	_tmp28_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp27_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp27_) : NULL);
	good_link = _tmp28_;
	_tmp29_ = gtk_builder_get_object (builder, "bad_link_label");
	_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp29_) : NULL);
	bad_link = _tmp30_;
	_tmp31_ = gtk_widget_get_toplevel (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp32_ = _g_object_ref0 (APPLICATION_IS_MAIN_WINDOW (_tmp31_) ? ((ApplicationMainWindow*) _tmp31_) : NULL);
	_data99_->main = _tmp32_;
	_tmp33_ = text_href;
	_tmp34_ = text_label;
	_tmp35_ = g_markup_printf_escaped ("<a href=\"%s\">%s</a>", _tmp33_, _tmp34_);
	_tmp36_ = _tmp35_;
	gtk_label_set_markup (good_link, _tmp36_);
	_g_free0 (_tmp36_);
	g_signal_connect_data (good_link, "activate-link", (GCallback) ___lambda81__gtk_label_activate_link, block99_data_ref (_data99_), (GClosureNotify) block99_data_unref, 0);
	_tmp37_ = anchor_href;
	_tmp38_ = g_markup_printf_escaped ("<a href=\"%s\">%s</a>", _tmp37_, anchor_label);
	_tmp39_ = _tmp38_;
	gtk_label_set_markup (bad_link, _tmp39_);
	_g_free0 (_tmp39_);
	g_signal_connect_data (bad_link, "activate-link", (GCallback) ___lambda82__gtk_label_activate_link, block99_data_ref (_data99_), (GClosureNotify) block99_data_unref, 0);
	_tmp40_ = self->priv->_web_view;
	gtk_popover_set_relative_to (_data99_->link_popover, G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, gtk_widget_get_type (), GtkWidget));
	_tmp41_ = *location;
	gtk_popover_set_pointing_to (_data99_->link_popover, &_tmp41_);
	g_signal_connect_data (_data99_->link_popover, "closed", (GCallback) ___lambda83__gtk_popover_closed, block99_data_ref (_data99_), (GClosureNotify) block99_data_unref, G_CONNECT_AFTER);
	gtk_popover_popup (_data99_->link_popover);
	_g_object_unref0 (bad_link);
	_g_object_unref0 (good_link);
	_g_object_unref0 (builder);
	_g_free0 (anchor_label);
	_g_free0 (_tmp19_);
	_g_free0 (anchor_href);
	_g_free0 (text_label);
	_g_free0 (_tmp7_);
	_g_free0 (text_href);
	block99_data_unref (_data99_);
	_data99_ = NULL;
}

static void
conversation_message_on_selection_changed (ConversationMessage* self)
{
	ConversationWebView* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	ConversationWebView* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->_web_view;
	_tmp1_ = components_web_view_get_has_selection (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
	_tmp2_ = _tmp1_;
	conversation_message_set_action_enabled (self, CONVERSATION_MESSAGE_ACTION_COPY_SELECTION, _tmp2_);
	_tmp3_ = self->priv->_web_view;
	_tmp4_ = components_web_view_get_has_selection (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, COMPONENTS_TYPE_WEB_VIEW, ComponentsWebView));
	_tmp5_ = _tmp4_;
	g_signal_emit (self, conversation_message_signals[CONVERSATION_MESSAGE_SELECTION_CHANGED_SIGNAL], 0, _tmp5_);
}

static void
____lambda86_ (ConversationMessage* self)
{
	conversation_message_show_images (self, TRUE);
}

static void
_____lambda86__components_info_bar_response (ComponentsInfoBar* _sender,
                                             gint response_id,
                                             gpointer self)
{
	____lambda86_ ((ConversationMessage*) self);
}

static void
conversation_message_on_remote_resources_blocked (ConversationMessage* self)
{
	ComponentsInfoBar* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = self->priv->remote_images_info_bar;
	if (_tmp0_ == NULL) {
		ComponentsInfoBarStack* _tmp22_;
		ComponentsInfoBar* _tmp23_;
		if (self->priv->authenticated_message) {
			ComponentsInfoBar* _tmp1_;
			GtkImage* menu_image = NULL;
			GtkImage* _tmp2_;
			GtkImage* _tmp3_;
			GtkMenuButton* menu_button = NULL;
			GtkMenuButton* _tmp4_;
			GtkMenuButton* _tmp5_;
			GtkMenuButton* _tmp6_;
			GtkImage* _tmp7_;
			GtkMenuButton* _tmp8_;
			GMenuModel* _tmp9_;
			GtkMenuButton* _tmp10_;
			GtkMenuButton* _tmp11_;
			GtkMenuButton* _tmp12_;
			ComponentsInfoBar* _tmp13_;
			GtkBox* _tmp14_;
			GtkBox* _tmp15_;
			GtkMenuButton* _tmp16_;
			_tmp1_ = components_info_bar_new (_ ("Remote images not shown"), _ ("Showing remote images allows the sender to track you"));
			g_object_ref_sink (_tmp1_);
			_g_object_unref0 (self->priv->remote_images_info_bar);
			self->priv->remote_images_info_bar = _tmp1_;
			_tmp2_ = (GtkImage*) gtk_image_new ();
			g_object_ref_sink (_tmp2_);
			menu_image = _tmp2_;
			_tmp3_ = menu_image;
			g_object_set (_tmp3_, "icon-name", "view-more-symbolic", NULL);
			_tmp4_ = (GtkMenuButton*) gtk_menu_button_new ();
			g_object_ref_sink (_tmp4_);
			menu_button = _tmp4_;
			_tmp5_ = menu_button;
			gtk_menu_button_set_use_popover (_tmp5_, TRUE);
			_tmp6_ = menu_button;
			_tmp7_ = menu_image;
			gtk_button_set_image (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_button_get_type (), GtkButton), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget));
			_tmp8_ = menu_button;
			_tmp9_ = self->priv->show_images_menu;
			gtk_menu_button_set_menu_model (_tmp8_, _tmp9_);
			_tmp10_ = menu_button;
			gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
			_tmp11_ = menu_button;
			gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), TRUE);
			_tmp12_ = menu_button;
			gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget));
			_tmp13_ = self->priv->remote_images_info_bar;
			_tmp14_ = components_info_bar_get_action_area (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = menu_button;
			gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget));
			_g_object_unref0 (_tmp15_);
			_g_object_unref0 (menu_button);
			_g_object_unref0 (menu_image);
		} else {
			ComponentsInfoBar* _tmp17_;
			ComponentsInfoBar* _tmp18_;
			GtkButton* _tmp19_;
			GtkButton* _tmp20_;
			ComponentsInfoBar* _tmp21_;
			_tmp17_ = components_info_bar_new (_ ("Remote images not shown"), _ ("This message can't be trusted."));
			g_object_ref_sink (_tmp17_);
			_g_object_unref0 (self->priv->remote_images_info_bar);
			self->priv->remote_images_info_bar = _tmp17_;
			_tmp18_ = self->priv->remote_images_info_bar;
			_tmp19_ = components_info_bar_add_button (_tmp18_, _ ("Show"), 1);
			_tmp20_ = _tmp19_;
			_g_object_unref0 (_tmp20_);
			_tmp21_ = self->priv->remote_images_info_bar;
			g_signal_connect_object (_tmp21_, "response", (GCallback) _____lambda86__components_info_bar_response, self, 0);
		}
		_tmp22_ = self->priv->_info_bars;
		_tmp23_ = self->priv->remote_images_info_bar;
		components_info_bar_stack_add (_tmp22_, _tmp23_);
	}
}

static void
conversation_message_on_copy_link (ConversationMessage* self,
                                   GVariant* param)
{
	GtkClipboard* clipboard = NULL;
	GtkClipboard* _tmp0_;
	GtkClipboard* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	clipboard = _tmp1_;
	_tmp2_ = g_variant_get_string (param, NULL);
	gtk_clipboard_set_text (clipboard, _tmp2_, -1);
	gtk_clipboard_store (clipboard);
	_g_object_unref0 (clipboard);
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static void
conversation_message_on_copy_email_address (ConversationMessage* self,
                                            GVariant* param)
{
	gchar* value = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkClipboard* clipboard = NULL;
	GtkClipboard* _tmp7_;
	GtkClipboard* _tmp8_;
	const gchar* _tmp9_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = g_variant_get_string (param, NULL);
	_tmp1_ = g_strdup (_tmp0_);
	value = _tmp1_;
	_tmp2_ = value;
	if (g_str_has_prefix (_tmp2_, CONVERSATION_MESSAGE_MAILTO_URI_PREFIX)) {
		const gchar* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gchar* _tmp6_;
		_tmp3_ = value;
		_tmp4_ = strlen (CONVERSATION_MESSAGE_MAILTO_URI_PREFIX);
		_tmp5_ = _tmp4_;
		_tmp6_ = string_substring (_tmp3_, (glong) _tmp5_, (glong) -1);
		_g_free0 (value);
		value = _tmp6_;
	}
	_tmp7_ = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
	_tmp8_ = _g_object_ref0 (_tmp7_);
	clipboard = _tmp8_;
	_tmp9_ = value;
	gtk_clipboard_set_text (clipboard, _tmp9_, -1);
	gtk_clipboard_store (clipboard);
	_g_object_unref0 (clipboard);
	_g_free0 (value);
}

static Block100Data*
block100_data_ref (Block100Data* _data100_)
{
	g_atomic_int_inc (&_data100_->_ref_count_);
	return _data100_;
}

static void
block100_data_unref (void * _userdata_)
{
	Block100Data* _data100_;
	_data100_ = (Block100Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data100_->_ref_count_)) {
		ConversationMessage* self;
		self = _data100_->self;
		_g_free0 (_data100_->alt_text);
		_g_free0 (_data100_->uri);
		_g_object_unref0 (self);
		g_slice_free (Block100Data, _data100_);
	}
}

static gchar*
_variant_get15 (GVariant* value)
{
	return g_variant_dup_string (value, NULL);
}

static gchar*
_variant_get16 (GVariant* value)
{
	return g_variant_dup_string (value, NULL);
}

static Block101Data*
block101_data_ref (Block101Data* _data101_)
{
	g_atomic_int_inc (&_data101_->_ref_count_);
	return _data101_;
}

static void
block101_data_unref (void * _userdata_)
{
	Block101Data* _data101_;
	_data101_ = (Block101Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data101_->_ref_count_)) {
		ConversationMessage* self;
		self = _data101_->_data100_->self;
		_g_object_unref0 (_data101_->response);
		block100_data_unref (_data101_->_data100_);
		_data101_->_data100_ = NULL;
		g_slice_free (Block101Data, _data101_);
	}
}

static void
___lambda80_ (Block101Data* _data101_,
              GObject* obj,
              GAsyncResult* res)
{
	Block100Data* _data100_;
	ConversationMessage* self;
	GError* _inner_error0_ = NULL;
	_data100_ = _data101_->_data100_;
	self = _data100_->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 ()));
	{
		guint8* data = NULL;
		WebKitWebResource* _tmp0_;
		gint _tmp1_ = 0;
		guint8* _tmp2_;
		gint data_length1;
		gint _data_size_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		GearyMemoryByteBuffer* _tmp5_;
		GearyMemoryByteBuffer* _tmp6_;
		_tmp0_ = _data101_->response;
		_tmp2_ = webkit_web_resource_get_data_finish (_tmp0_, res, &_tmp1_, &_inner_error0_);
		data = _tmp2_;
		data_length1 = _tmp1_;
		_data_size_ = data_length1;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = _data100_->uri;
		_tmp4_ = _data100_->alt_text;
		_tmp5_ = geary_memory_byte_buffer_new (data, data_length1, (gsize) data_length1);
		_tmp6_ = _tmp5_;
		g_signal_emit (self, conversation_message_signals[CONVERSATION_MESSAGE_SAVE_IMAGE_SIGNAL], 0, _tmp3_, _tmp4_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEARY_MEMORY_TYPE_BUFFER, GearyMemoryBuffer));
		_g_object_unref0 (_tmp6_);
		data = (g_free (data), NULL);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = err;
		_tmp8_ = _tmp7_->message;
		g_debug ("conversation-message.vala:1497: Failed to get image data from web view" \
": %s", _tmp8_);
		_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
____lambda80__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda80_ (self, source_object, res);
	block101_data_unref (self);
}

static void
conversation_message_on_save_image (ConversationMessage* self,
                                    GVariant* param)
{
	Block100Data* _data100_;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GVariant* alt_maybe = NULL;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	GVariant* _tmp8_;
	const gchar* _tmp11_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_data100_ = g_slice_new0 (Block100Data);
	_data100_->_ref_count_ = 1;
	_data100_->self = g_object_ref (self);
	_tmp0_ = g_variant_get_child_value (param, (gsize) 0);
	_tmp1_ = _tmp0_;
	_tmp2_ = _variant_get15 (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_variant_unref0 (_tmp1_);
	_data100_->uri = _tmp3_;
	_data100_->alt_text = NULL;
	_tmp4_ = g_variant_get_child_value (param, (gsize) 1);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_variant_get_maybe (_tmp5_);
	_tmp7_ = _tmp6_;
	_g_variant_unref0 (_tmp5_);
	alt_maybe = _tmp7_;
	_tmp8_ = alt_maybe;
	if (_tmp8_ != NULL) {
		GVariant* _tmp9_;
		gchar* _tmp10_;
		_tmp9_ = alt_maybe;
		_tmp10_ = _variant_get16 (_tmp9_);
		_g_free0 (_data100_->alt_text);
		_data100_->alt_text = _tmp10_;
	}
	_tmp11_ = _data100_->uri;
	if (g_str_has_prefix (_tmp11_, COMPONENTS_WEB_VIEW_CID_URL_PREFIX)) {
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		_tmp12_ = _data100_->uri;
		_tmp13_ = _data100_->alt_text;
		g_signal_emit (self, conversation_message_signals[CONVERSATION_MESSAGE_SAVE_IMAGE_SIGNAL], 0, _tmp12_, _tmp13_, NULL);
	} else {
		Block101Data* _data101_;
		GeeMap* _tmp14_;
		const gchar* _tmp15_;
		gpointer _tmp16_;
		WebKitWebResource* _tmp17_;
		_data101_ = g_slice_new0 (Block101Data);
		_data101_->_ref_count_ = 1;
		_data101_->_data100_ = block100_data_ref (_data100_);
		_tmp14_ = self->priv->resources;
		_tmp15_ = _data100_->uri;
		_tmp16_ = gee_map_get (_tmp14_, _tmp15_);
		_data101_->response = (WebKitWebResource*) _tmp16_;
		_tmp17_ = _data101_->response;
		webkit_web_resource_get_data (_tmp17_, NULL, ____lambda80__gasync_ready_callback, block101_data_ref (_data101_));
		block101_data_unref (_data101_);
		_data101_ = NULL;
	}
	_g_variant_unref0 (alt_maybe);
	block100_data_unref (_data100_);
	_data100_ = NULL;
}

static void
conversation_message_on_show_images (ConversationMessage* self,
                                     GVariant* param)
{
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	conversation_message_show_images (self, TRUE);
}

static void
conversation_message_on_show_images_sender (ConversationMessage* self,
                                            GVariant* param)
{
	ApplicationContact* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	conversation_message_show_images (self, FALSE);
	_tmp0_ = self->priv->_primary_contact;
	if (_tmp0_ != NULL) {
		ApplicationContact* _tmp1_;
		_tmp1_ = self->priv->_primary_contact;
		application_contact_set_remote_resource_loading (_tmp1_, TRUE, NULL, NULL, NULL);
	}
}

static void
conversation_message_on_show_images_domain (ConversationMessage* self,
                                            GVariant* param)
{
	ApplicationContact* _tmp0_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	conversation_message_show_images (self, FALSE);
	_tmp0_ = self->priv->_primary_contact;
	if (_tmp0_ != NULL) {
		GeeCollection* email_addresses = NULL;
		ApplicationContact* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeCollection* _tmp4_;
		_tmp1_ = self->priv->_primary_contact;
		_tmp2_ = application_contact_get_email_addresses (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		email_addresses = _tmp4_;
		{
			GeeIterator* _email_it = NULL;
			GeeCollection* _tmp5_;
			GeeIterator* _tmp6_;
			_tmp5_ = email_addresses;
			_tmp6_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ITERABLE, GeeIterable));
			_email_it = _tmp6_;
			while (TRUE) {
				GeeIterator* _tmp7_;
				GearyRFC822MailboxAddress* email = NULL;
				GeeIterator* _tmp8_;
				gpointer _tmp9_;
				ApplicationConfiguration* _tmp10_;
				GearyRFC822MailboxAddress* _tmp11_;
				const gchar* _tmp12_;
				const gchar* _tmp13_;
				_tmp7_ = _email_it;
				if (!gee_iterator_next (_tmp7_)) {
					break;
				}
				_tmp8_ = _email_it;
				_tmp9_ = gee_iterator_get (_tmp8_);
				email = (GearyRFC822MailboxAddress*) _tmp9_;
				_tmp10_ = self->priv->config;
				_tmp11_ = email;
				_tmp12_ = geary_rf_c822_mailbox_address_get_domain (_tmp11_);
				_tmp13_ = _tmp12_;
				application_configuration_add_images_trusted_domain (_tmp10_, _tmp13_);
				_g_object_unref0 (email);
				break;
			}
			_g_object_unref0 (_email_it);
		}
		_g_object_unref0 (email_addresses);
	}
}

static void
___lambda47_ (ConversationMessage* self,
              GObject* obj,
              GAsyncResult* res)
{
	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 (res, g_async_result_get_type ()));
	{
		gint y = 0;
		ConversationWebView* _tmp0_;
		gint* _tmp1_;
		gint* _tmp2_;
		gint _tmp3_;
		_tmp0_ = self->priv->_web_view;
		_tmp1_ = conversation_web_view_get_anchor_target_y_finish (_tmp0_, res, &_inner_error0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = *_tmp2_;
		_g_free0 (_tmp2_);
		y = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (y > 0) {
			g_signal_emit (self, conversation_message_signals[CONVERSATION_MESSAGE_INTERNAL_LINK_ACTIVATED_SIGNAL], 0, y);
		} else {
			g_debug ("conversation-message.vala:1543: Failed to get anchor destination");
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_debug ("conversation-message.vala:1546: Failed to get anchor destination");
	}
	__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
____lambda47__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda47_ ((ConversationMessage*) self, source_object, res);
	g_object_unref (self);
}

static void
conversation_message_on_link_activated (ConversationMessage* self,
                                        GVariant* param)
{
	gchar* link = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (IS_CONVERSATION_MESSAGE (self));
	_tmp0_ = g_variant_get_string (param, NULL);
	_tmp1_ = g_strdup (_tmp0_);
	link = _tmp1_;
	_tmp2_ = link;
	if (g_str_has_prefix (_tmp2_, CONVERSATION_MESSAGE_INTERNAL_ANCHOR_PREFIX)) {
		glong start = 0L;
		gint _tmp3_;
		gint _tmp4_;
		glong end = 0L;
		const gchar* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gchar* anchor_body = NULL;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		ConversationWebView* _tmp10_;
		const gchar* _tmp11_;
		_tmp3_ = strlen (CONVERSATION_MESSAGE_INTERNAL_ANCHOR_PREFIX);
		_tmp4_ = _tmp3_;
		start = (glong) _tmp4_;
		_tmp5_ = link;
		_tmp6_ = strlen (_tmp5_);
		_tmp7_ = _tmp6_;
		end = (glong) _tmp7_;
		_tmp8_ = link;
		_tmp9_ = string_substring (_tmp8_, start, end - start);
		anchor_body = _tmp9_;
		_tmp10_ = self->priv->_web_view;
		_tmp11_ = anchor_body;
		conversation_web_view_get_anchor_target_y (_tmp10_, _tmp11_, ____lambda47__gasync_ready_callback, g_object_ref (self));
		_g_free0 (anchor_body);
	} else {
		ApplicationMainWindow* main = NULL;
		GtkWidget* _tmp12_;
		ApplicationMainWindow* _tmp13_;
		ApplicationMainWindow* _tmp14_;
		_tmp12_ = gtk_widget_get_toplevel (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		_tmp13_ = _g_object_ref0 (APPLICATION_IS_MAIN_WINDOW (_tmp12_) ? ((ApplicationMainWindow*) _tmp12_) : NULL);
		main = _tmp13_;
		_tmp14_ = main;
		if (_tmp14_ != NULL) {
			ApplicationMainWindow* _tmp15_;
			ApplicationClient* _tmp16_;
			ApplicationClient* _tmp17_;
			const gchar* _tmp18_;
			_tmp15_ = main;
			_tmp16_ = application_main_window_get_application (_tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = link;
			application_client_show_uri (_tmp17_, _tmp18_, NULL, NULL);
		}
		_g_object_unref0 (main);
	}
	_g_free0 (link);
}

static inline gpointer
conversation_message_contact_flow_box_child_get_instance_private (ConversationMessageContactFlowBoxChild* self)
{
	return G_STRUCT_MEMBER_P (self, ConversationMessageContactFlowBoxChild_private_offset);
}

static GType
conversation_message_contact_flow_box_child_type_get_type_once (void)
{
	static const GEnumValue values[] = {{CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_FROM, "CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_FROM", "from"}, {CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_OTHER, "CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_OTHER", "other"}, {0, NULL, NULL}};
	GType conversation_message_contact_flow_box_child_type_type_id;
	conversation_message_contact_flow_box_child_type_type_id = g_enum_register_static ("ConversationMessageContactFlowBoxChildType", values);
	return conversation_message_contact_flow_box_child_type_type_id;
}

GType
conversation_message_contact_flow_box_child_type_get_type (void)
{
	static volatile gsize conversation_message_contact_flow_box_child_type_type_id__once = 0;
	if (g_once_init_enter (&conversation_message_contact_flow_box_child_type_type_id__once)) {
		GType conversation_message_contact_flow_box_child_type_type_id;
		conversation_message_contact_flow_box_child_type_type_id = conversation_message_contact_flow_box_child_type_get_type_once ();
		g_once_init_leave (&conversation_message_contact_flow_box_child_type_type_id__once, conversation_message_contact_flow_box_child_type_type_id);
	}
	return conversation_message_contact_flow_box_child_type_type_id__once;
}

static ConversationMessageContactFlowBoxChildType
conversation_message_contact_flow_box_child_get_address_type (ConversationMessageContactFlowBoxChild* self)
{
	ConversationMessageContactFlowBoxChildType result;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self), 0);
	result = self->priv->_address_type;
	return result;
}

static void
conversation_message_contact_flow_box_child_set_address_type (ConversationMessageContactFlowBoxChild* self,
                                                              ConversationMessageContactFlowBoxChildType value)
{
	ConversationMessageContactFlowBoxChildType old_value;
	g_return_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self));
	old_value = conversation_message_contact_flow_box_child_get_address_type (self);
	if (old_value != value) {
		self->priv->_address_type = value;
		g_object_notify_by_pspec ((GObject *) self, conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_ADDRESS_TYPE_PROPERTY]);
	}
}

static ApplicationContact*
conversation_message_contact_flow_box_child_get_contact (ConversationMessageContactFlowBoxChild* self)
{
	ApplicationContact* result;
	ApplicationContact* _tmp0_;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self), NULL);
	_tmp0_ = self->priv->_contact;
	result = _tmp0_;
	return result;
}

static void
conversation_message_contact_flow_box_child_set_contact (ConversationMessageContactFlowBoxChild* self,
                                                         ApplicationContact* value)
{
	ApplicationContact* old_value;
	g_return_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self));
	old_value = conversation_message_contact_flow_box_child_get_contact (self);
	if (old_value != value) {
		ApplicationContact* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_contact);
		self->priv->_contact = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_CONTACT_PROPERTY]);
	}
}

static GearyRFC822MailboxAddress*
conversation_message_contact_flow_box_child_get_displayed (ConversationMessageContactFlowBoxChild* self)
{
	GearyRFC822MailboxAddress* result;
	GearyRFC822MailboxAddress* _tmp0_;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self), NULL);
	_tmp0_ = self->priv->_displayed;
	result = _tmp0_;
	return result;
}

static void
conversation_message_contact_flow_box_child_set_displayed (ConversationMessageContactFlowBoxChild* self,
                                                           GearyRFC822MailboxAddress* value)
{
	GearyRFC822MailboxAddress* old_value;
	g_return_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self));
	old_value = conversation_message_contact_flow_box_child_get_displayed (self);
	if (old_value != value) {
		GearyRFC822MailboxAddress* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_displayed);
		self->priv->_displayed = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_DISPLAYED_PROPERTY]);
	}
}

static GearyRFC822MailboxAddress*
conversation_message_contact_flow_box_child_get_source (ConversationMessageContactFlowBoxChild* self)
{
	GearyRFC822MailboxAddress* result;
	GearyRFC822MailboxAddress* _tmp0_;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self), NULL);
	_tmp0_ = self->priv->_source;
	result = _tmp0_;
	return result;
}

static void
conversation_message_contact_flow_box_child_set_source (ConversationMessageContactFlowBoxChild* self,
                                                        GearyRFC822MailboxAddress* value)
{
	GearyRFC822MailboxAddress* old_value;
	g_return_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self));
	old_value = conversation_message_contact_flow_box_child_get_source (self);
	if (old_value != value) {
		GearyRFC822MailboxAddress* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_source);
		self->priv->_source = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_SOURCE_PROPERTY]);
	}
}

static gboolean
_conversation_message_contact_flow_box_child_on_prelight_in_event_gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                                                                 GdkEventCrossing* event,
                                                                                                 gpointer self)
{
	gboolean result;
	result = conversation_message_contact_flow_box_child_on_prelight_in_event ((ConversationMessageContactFlowBoxChild*) self, event);
	return result;
}

static gboolean
_conversation_message_contact_flow_box_child_on_prelight_out_event_gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                                                                  GdkEventCrossing* event,
                                                                                                  gpointer self)
{
	gboolean result;
	result = conversation_message_contact_flow_box_child_on_prelight_out_event ((ConversationMessageContactFlowBoxChild*) self, event);
	return result;
}

static void
_conversation_message_contact_flow_box_child_on_contact_changed_application_contact_changed (ApplicationContact* _sender,
                                                                                             gpointer self)
{
	conversation_message_contact_flow_box_child_on_contact_changed ((ConversationMessageContactFlowBoxChild*) self);
}

static ConversationMessageContactFlowBoxChild*
conversation_message_contact_flow_box_child_construct (GType object_type,
                                                       ApplicationContact* contact,
                                                       GearyRFC822MailboxAddress* source,
                                                       ConversationMessageContactFlowBoxChildType address_type)
{
	ConversationMessageContactFlowBoxChild * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GtkEventBox* events = NULL;
	GtkEventBox* _tmp3_;
	GtkBin* _tmp4_;
	ApplicationContact* _tmp5_;
	g_return_val_if_fail (APPLICATION_IS_CONTACT (contact), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (source, GEARY_RF_C822_TYPE_MAILBOX_ADDRESS), NULL);
	self = (ConversationMessageContactFlowBoxChild*) g_object_new (object_type, NULL);
	conversation_message_contact_flow_box_child_set_contact (self, contact);
	conversation_message_contact_flow_box_child_set_source (self, source);
	conversation_message_contact_flow_box_child_set_address_type (self, address_type);
	_tmp0_ = geary_message_data_searchable_message_data_to_searchable_string (G_TYPE_CHECK_INSTANCE_CAST (source, GEARY_MESSAGE_DATA_TYPE_SEARCHABLE_MESSAGE_DATA, GearyMessageDataSearchableMessageData));
	_tmp1_ = _tmp0_;
	_tmp2_ = g_utf8_casefold (_tmp1_, (gssize) -1);
	_g_free0 (self->priv->search_value);
	self->priv->search_value = _tmp2_;
	_g_free0 (_tmp1_);
	_tmp3_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp3_);
	events = _tmp3_;
	gtk_widget_add_events (G_TYPE_CHECK_INSTANCE_CAST (events, gtk_widget_get_type (), GtkWidget), (gint) (GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK));
	gtk_event_box_set_visible_window (events, FALSE);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (events, gtk_widget_get_type (), GtkWidget), "enter-notify-event", (GCallback) _conversation_message_contact_flow_box_child_on_prelight_in_event_gtk_widget_enter_notify_event, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (events, gtk_widget_get_type (), GtkWidget), "leave-notify-event", (GCallback) _conversation_message_contact_flow_box_child_on_prelight_out_event_gtk_widget_leave_notify_event, self, 0);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (events, gtk_widget_get_type (), GtkWidget));
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (events, gtk_bin_get_type (), GtkBin));
	_g_object_unref0 (self->priv->container);
	self->priv->container = _tmp4_;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	_tmp5_ = self->priv->_contact;
	g_signal_connect_object (_tmp5_, "changed", (GCallback) _conversation_message_contact_flow_box_child_on_contact_changed_application_contact_changed, self, 0);
	conversation_message_contact_flow_box_child_update (self);
	_g_object_unref0 (events);
	return self;
}

static ConversationMessageContactFlowBoxChild*
conversation_message_contact_flow_box_child_new (ApplicationContact* contact,
                                                 GearyRFC822MailboxAddress* source,
                                                 ConversationMessageContactFlowBoxChildType address_type)
{
	return conversation_message_contact_flow_box_child_construct (CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, contact, source, address_type);
}

static void
conversation_message_contact_flow_box_child_real_destroy (GtkWidget* base)
{
	ConversationMessageContactFlowBoxChild * self;
	ApplicationContact* _tmp0_;
	guint _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, ConversationMessageContactFlowBoxChild);
	_tmp0_ = self->priv->_contact;
	g_signal_parse_name ("changed", APPLICATION_TYPE_CONTACT, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _conversation_message_contact_flow_box_child_on_contact_changed_application_contact_changed, self);
	GTK_WIDGET_CLASS (conversation_message_contact_flow_box_child_parent_class)->destroy (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_flow_box_child_get_type (), GtkFlowBoxChild), gtk_widget_get_type (), GtkWidget));
}

static gboolean
conversation_message_contact_flow_box_child_highlight_search_term (ConversationMessageContactFlowBoxChild* self,
                                                                   const gchar* term)
{
	gboolean found = FALSE;
	const gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self), FALSE);
	g_return_val_if_fail (term != NULL, FALSE);
	_tmp0_ = self->priv->search_value;
	found = string_contains (_tmp0_, term);
	if (found) {
		GtkStyleContext* _tmp1_;
		_tmp1_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_add_class (_tmp1_, CONVERSATION_MESSAGE_MATCH_CLASS);
	} else {
		GtkStyleContext* _tmp2_;
		_tmp2_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_remove_class (_tmp2_, CONVERSATION_MESSAGE_MATCH_CLASS);
	}
	result = found;
	return result;
}

static void
conversation_message_contact_flow_box_child_unmark_search_terms (ConversationMessageContactFlowBoxChild* self)
{
	GtkStyleContext* _tmp0_;
	g_return_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self));
	_tmp0_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_remove_class (_tmp0_, CONVERSATION_MESSAGE_MATCH_CLASS);
}

static void
conversation_message_contact_flow_box_child_update (ConversationMessageContactFlowBoxChild* self)
{
	GtkGrid* address_parts = NULL;
	GtkGrid* _tmp0_;
	gboolean is_spoofed = FALSE;
	GearyRFC822MailboxAddress* _tmp1_;
	GtkLabel* primary = NULL;
	GtkLabel* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	GtkStyleContext* _tmp10_;
	ConversationMessageContactFlowBoxChildType _tmp11_;
	GtkGrid* _tmp14_;
	GtkLabel* _tmp15_;
	gchar* display_address = NULL;
	GearyRFC822MailboxAddress* _tmp16_;
	gchar* _tmp17_;
	gboolean _tmp18_ = FALSE;
	GtkWidget* existing_ui = NULL;
	GtkBin* _tmp64_;
	GtkWidget* _tmp65_;
	GtkWidget* _tmp66_;
	GtkWidget* _tmp67_;
	GtkBin* _tmp70_;
	GtkGrid* _tmp71_;
	g_return_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self));
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp0_);
	address_parts = _tmp0_;
	_tmp1_ = self->priv->_source;
	is_spoofed = geary_rf_c822_mailbox_address_is_spoofed (_tmp1_);
	if (is_spoofed) {
		GtkImage* spoof_img = NULL;
		GtkImage* _tmp2_;
		GtkGrid* _tmp3_;
		GtkImage* _tmp4_;
		GtkStyleContext* _tmp5_;
		_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name ("dialog-warning-symbolic", (GtkIconSize) GTK_ICON_SIZE_SMALL_TOOLBAR);
		g_object_ref_sink (_tmp2_);
		spoof_img = _tmp2_;
		gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _ ("This email address may have been forged"));
		_tmp3_ = address_parts;
		_tmp4_ = spoof_img;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget));
		_tmp5_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_add_class (_tmp5_, CONVERSATION_MESSAGE_SPOOF_CLASS);
		_g_object_unref0 (spoof_img);
	}
	_tmp6_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp6_);
	primary = _tmp6_;
	_tmp7_ = primary;
	gtk_label_set_ellipsize (_tmp7_, PANGO_ELLIPSIZE_END);
	_tmp8_ = primary;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	_tmp9_ = primary;
	_tmp10_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_add_class (_tmp10_, CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_PRIMARY_CLASS);
	_tmp11_ = self->priv->_address_type;
	if (_tmp11_ == CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_FROM) {
		GtkLabel* _tmp12_;
		GtkStyleContext* _tmp13_;
		_tmp12_ = primary;
		_tmp13_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_add_class (_tmp13_, CONVERSATION_MESSAGE_FROM_CLASS);
	}
	_tmp14_ = address_parts;
	_tmp15_ = primary;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget));
	_tmp16_ = self->priv->_source;
	_tmp17_ = geary_rf_c822_mailbox_address_to_address_display (_tmp16_, "", "");
	display_address = _tmp17_;
	if (is_spoofed) {
		_tmp18_ = TRUE;
	} else {
		ApplicationContact* _tmp19_;
		gboolean _tmp20_;
		gboolean _tmp21_;
		_tmp19_ = self->priv->_contact;
		_tmp20_ = application_contact_get_display_name_is_email (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp18_ = _tmp21_;
	}
	if (_tmp18_) {
		GtkLabel* _tmp22_;
		const gchar* _tmp23_;
		GearyRFC822MailboxAddress* _tmp24_;
		_tmp22_ = primary;
		_tmp23_ = display_address;
		gtk_label_set_text (_tmp22_, _tmp23_);
		_tmp24_ = self->priv->_source;
		conversation_message_contact_flow_box_child_set_displayed (self, _tmp24_);
	} else {
		ApplicationContact* _tmp25_;
		gboolean _tmp26_;
		gboolean _tmp27_;
		_tmp25_ = self->priv->_contact;
		_tmp26_ = application_contact_get_is_trusted (_tmp25_);
		_tmp27_ = _tmp26_;
		if (_tmp27_) {
			GtkLabel* _tmp28_;
			ApplicationContact* _tmp29_;
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			ApplicationContact* _tmp32_;
			const gchar* _tmp33_;
			const gchar* _tmp34_;
			GearyRFC822MailboxAddress* _tmp35_;
			const gchar* _tmp36_;
			const gchar* _tmp37_;
			GearyRFC822MailboxAddress* _tmp38_;
			GearyRFC822MailboxAddress* _tmp39_;
			GearyRFC822MailboxAddress* _tmp40_;
			const gchar* _tmp41_;
			const gchar* _tmp42_;
			_tmp28_ = primary;
			_tmp29_ = self->priv->_contact;
			_tmp30_ = application_contact_get_display_name (_tmp29_);
			_tmp31_ = _tmp30_;
			gtk_label_set_text (_tmp28_, _tmp31_);
			_tmp32_ = self->priv->_contact;
			_tmp33_ = application_contact_get_display_name (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = self->priv->_source;
			_tmp36_ = geary_rf_c822_mailbox_address_get_address (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = geary_rf_c822_mailbox_address_new (_tmp34_, _tmp37_);
			_tmp39_ = _tmp38_;
			conversation_message_contact_flow_box_child_set_displayed (self, _tmp39_);
			_g_object_unref0 (_tmp39_);
			_tmp40_ = self->priv->_source;
			_tmp41_ = geary_rf_c822_mailbox_address_get_address (_tmp40_);
			_tmp42_ = _tmp41_;
			gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp42_);
		} else {
			GtkLabel* _tmp43_;
			ApplicationContact* _tmp44_;
			const gchar* _tmp45_;
			const gchar* _tmp46_;
			ApplicationContact* _tmp47_;
			const gchar* _tmp48_;
			const gchar* _tmp49_;
			GearyRFC822MailboxAddress* _tmp50_;
			const gchar* _tmp51_;
			const gchar* _tmp52_;
			GearyRFC822MailboxAddress* _tmp53_;
			GearyRFC822MailboxAddress* _tmp54_;
			GtkLabel* secondary = NULL;
			GtkLabel* _tmp55_;
			GtkLabel* _tmp56_;
			GtkLabel* _tmp57_;
			GtkLabel* _tmp58_;
			GtkStyleContext* _tmp59_;
			GtkLabel* _tmp60_;
			const gchar* _tmp61_;
			GtkGrid* _tmp62_;
			GtkLabel* _tmp63_;
			_tmp43_ = primary;
			_tmp44_ = self->priv->_contact;
			_tmp45_ = application_contact_get_display_name (_tmp44_);
			_tmp46_ = _tmp45_;
			gtk_label_set_text (_tmp43_, _tmp46_);
			_tmp47_ = self->priv->_contact;
			_tmp48_ = application_contact_get_display_name (_tmp47_);
			_tmp49_ = _tmp48_;
			_tmp50_ = self->priv->_source;
			_tmp51_ = geary_rf_c822_mailbox_address_get_address (_tmp50_);
			_tmp52_ = _tmp51_;
			_tmp53_ = geary_rf_c822_mailbox_address_new (_tmp49_, _tmp52_);
			_tmp54_ = _tmp53_;
			conversation_message_contact_flow_box_child_set_displayed (self, _tmp54_);
			_g_object_unref0 (_tmp54_);
			_tmp55_ = (GtkLabel*) gtk_label_new (NULL);
			g_object_ref_sink (_tmp55_);
			secondary = _tmp55_;
			_tmp56_ = secondary;
			gtk_label_set_ellipsize (_tmp56_, PANGO_ELLIPSIZE_END);
			_tmp57_ = secondary;
			gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
			_tmp58_ = secondary;
			_tmp59_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, gtk_widget_get_type (), GtkWidget));
			gtk_style_context_add_class (_tmp59_, GTK_STYLE_CLASS_DIM_LABEL);
			_tmp60_ = secondary;
			_tmp61_ = display_address;
			gtk_label_set_text (_tmp60_, _tmp61_);
			_tmp62_ = address_parts;
			_tmp63_ = secondary;
			gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, gtk_widget_get_type (), GtkWidget));
			_g_object_unref0 (secondary);
		}
	}
	_tmp64_ = self->priv->container;
	_tmp65_ = gtk_bin_get_child (_tmp64_);
	_tmp66_ = _g_object_ref0 (_tmp65_);
	existing_ui = _tmp66_;
	_tmp67_ = existing_ui;
	if (_tmp67_ != NULL) {
		GtkBin* _tmp68_;
		GtkWidget* _tmp69_;
		_tmp68_ = self->priv->container;
		_tmp69_ = existing_ui;
		gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, gtk_container_get_type (), GtkContainer), _tmp69_);
	}
	_tmp70_ = self->priv->container;
	_tmp71_ = address_parts;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, gtk_widget_get_type (), GtkWidget));
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (existing_ui);
	_g_free0 (display_address);
	_g_object_unref0 (primary);
	_g_object_unref0 (address_parts);
}

static void
conversation_message_contact_flow_box_child_on_contact_changed (ConversationMessageContactFlowBoxChild* self)
{
	g_return_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self));
	conversation_message_contact_flow_box_child_update (self);
}

static gboolean
conversation_message_contact_flow_box_child_on_prelight_in_event (ConversationMessageContactFlowBoxChild* self,
                                                                  GdkEvent* event)
{
	gboolean result;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	gtk_widget_set_state_flags (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), GTK_STATE_FLAG_PRELIGHT, FALSE);
	result = GDK_EVENT_STOP;
	return result;
}

static gboolean
conversation_message_contact_flow_box_child_on_prelight_out_event (ConversationMessageContactFlowBoxChild* self,
                                                                   GdkEvent* event)
{
	gboolean result;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_FLOW_BOX_CHILD (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	gtk_widget_unset_state_flags (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), GTK_STATE_FLAG_PRELIGHT);
	result = GDK_EVENT_STOP;
	return result;
}

static void
conversation_message_contact_flow_box_child_class_init (ConversationMessageContactFlowBoxChildClass * klass,
                                                        gpointer klass_data)
{
	conversation_message_contact_flow_box_child_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConversationMessageContactFlowBoxChild_private_offset);
	((GtkWidgetClass *) klass)->destroy = (void (*) (GtkWidget*)) conversation_message_contact_flow_box_child_real_destroy;
	G_OBJECT_CLASS (klass)->get_property = _vala_conversation_message_contact_flow_box_child_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_conversation_message_contact_flow_box_child_set_property;
	G_OBJECT_CLASS (klass)->finalize = conversation_message_contact_flow_box_child_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_ADDRESS_TYPE_PROPERTY, conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_ADDRESS_TYPE_PROPERTY] = g_param_spec_enum ("address-type", "address-type", "address-type", CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_TYPE_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_CONTACT_PROPERTY, conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_CONTACT_PROPERTY] = g_param_spec_object ("contact", "contact", "contact", APPLICATION_TYPE_CONTACT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_DISPLAYED_PROPERTY, conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_DISPLAYED_PROPERTY] = g_param_spec_object ("displayed", "displayed", "displayed", GEARY_RF_C822_TYPE_MAILBOX_ADDRESS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_SOURCE_PROPERTY, conversation_message_contact_flow_box_child_properties[CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_SOURCE_PROPERTY] = g_param_spec_object ("source", "source", "source", GEARY_RF_C822_TYPE_MAILBOX_ADDRESS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
conversation_message_contact_flow_box_child_instance_init (ConversationMessageContactFlowBoxChild * self,
                                                           gpointer klass)
{
	self->priv = conversation_message_contact_flow_box_child_get_instance_private (self);
}

static void
conversation_message_contact_flow_box_child_finalize (GObject * obj)
{
	ConversationMessageContactFlowBoxChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, ConversationMessageContactFlowBoxChild);
	_g_object_unref0 (self->priv->_contact);
	_g_object_unref0 (self->priv->_displayed);
	_g_object_unref0 (self->priv->_source);
	_g_free0 (self->priv->search_value);
	_g_object_unref0 (self->priv->container);
	G_OBJECT_CLASS (conversation_message_contact_flow_box_child_parent_class)->finalize (obj);
}

static GType
conversation_message_contact_flow_box_child_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationMessageContactFlowBoxChildClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_message_contact_flow_box_child_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationMessageContactFlowBoxChild), 0, (GInstanceInitFunc) conversation_message_contact_flow_box_child_instance_init, NULL };
	GType conversation_message_contact_flow_box_child_type_id;
	conversation_message_contact_flow_box_child_type_id = g_type_register_static (gtk_flow_box_child_get_type (), "ConversationMessageContactFlowBoxChild", &g_define_type_info, 0);
	ConversationMessageContactFlowBoxChild_private_offset = g_type_add_instance_private (conversation_message_contact_flow_box_child_type_id, sizeof (ConversationMessageContactFlowBoxChildPrivate));
	return conversation_message_contact_flow_box_child_type_id;
}

static GType
conversation_message_contact_flow_box_child_get_type (void)
{
	static volatile gsize conversation_message_contact_flow_box_child_type_id__once = 0;
	if (g_once_init_enter (&conversation_message_contact_flow_box_child_type_id__once)) {
		GType conversation_message_contact_flow_box_child_type_id;
		conversation_message_contact_flow_box_child_type_id = conversation_message_contact_flow_box_child_get_type_once ();
		g_once_init_leave (&conversation_message_contact_flow_box_child_type_id__once, conversation_message_contact_flow_box_child_type_id);
	}
	return conversation_message_contact_flow_box_child_type_id__once;
}

static void
_vala_conversation_message_contact_flow_box_child_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec)
{
	ConversationMessageContactFlowBoxChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, ConversationMessageContactFlowBoxChild);
	switch (property_id) {
		case CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_ADDRESS_TYPE_PROPERTY:
		g_value_set_enum (value, conversation_message_contact_flow_box_child_get_address_type (self));
		break;
		case CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_CONTACT_PROPERTY:
		g_value_set_object (value, conversation_message_contact_flow_box_child_get_contact (self));
		break;
		case CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_DISPLAYED_PROPERTY:
		g_value_set_object (value, conversation_message_contact_flow_box_child_get_displayed (self));
		break;
		case CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_SOURCE_PROPERTY:
		g_value_set_object (value, conversation_message_contact_flow_box_child_get_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_conversation_message_contact_flow_box_child_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec)
{
	ConversationMessageContactFlowBoxChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, ConversationMessageContactFlowBoxChild);
	switch (property_id) {
		case CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_ADDRESS_TYPE_PROPERTY:
		conversation_message_contact_flow_box_child_set_address_type (self, g_value_get_enum (value));
		break;
		case CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_CONTACT_PROPERTY:
		conversation_message_contact_flow_box_child_set_contact (self, g_value_get_object (value));
		break;
		case CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_DISPLAYED_PROPERTY:
		conversation_message_contact_flow_box_child_set_displayed (self, g_value_get_object (value));
		break;
		case CONVERSATION_MESSAGE_CONTACT_FLOW_BOX_CHILD_SOURCE_PROPERTY:
		conversation_message_contact_flow_box_child_set_source (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
conversation_message_contact_list_get_instance_private (ConversationMessageContactList* self)
{
	return G_STRUCT_MEMBER_P (self, ConversationMessageContactList_private_offset);
}

static void
conversation_message_contact_list_real_add (GtkContainer* base,
                                            GtkWidget* child)
{
	ConversationMessageContactList * self;
	gint length = 0;
	GList* _tmp0_;
	GList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gboolean _tmp4_ = FALSE;
	GtkLabel* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, CONVERSATION_MESSAGE_TYPE_CONTACT_LIST, ConversationMessageContactList);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_widget_get_type ()));
	_tmp0_ = gtk_container_get_children (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer));
	_tmp1_ = _tmp0_;
	_tmp2_ = (gint) g_list_length (_tmp1_);
	(_tmp1_ == NULL) ? NULL : (_tmp1_ = (g_list_free (_tmp1_), NULL));
	length = _tmp2_;
	gtk_flow_box_insert (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_flow_box_get_type (), GtkFlowBox), child, length - 2);
	_tmp3_ = self->priv->children;
	self->priv->children = _tmp3_ + 1;
	if (self->priv->children >= CONVERSATION_MESSAGE_CONTACT_LIST_SHORT_RESULTS) {
		_tmp4_ = self->priv->children <= (CONVERSATION_MESSAGE_CONTACT_LIST_SHORT_RESULTS + 2);
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		gtk_flow_box_invalidate_filter (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_flow_box_get_type (), GtkFlowBox));
	}
	_tmp5_ = self->priv->show_more;
	_tmp6_ = g_strdup_printf (ngettext ("%d more…", "%d more…", (gulong) (self->priv->children - CONVERSATION_MESSAGE_CONTACT_LIST_SHORT_RESULTS)), self->priv->children - CONVERSATION_MESSAGE_CONTACT_LIST_SHORT_RESULTS);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf ("<a href=''>%s</a>", _tmp7_);
	_tmp9_ = _tmp8_;
	gtk_label_set_label (_tmp5_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
}

static GtkLabel*
conversation_message_contact_list_create_label (ConversationMessageContactList* self)
{
	GtkLabel* label = NULL;
	GtkLabel* _tmp0_;
	GtkLabel* result;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_LIST (self), NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp0_);
	label = _tmp0_;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (label, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_label_set_use_markup (label, TRUE);
	gtk_label_set_track_visited_links (label, FALSE);
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (label, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	result = label;
	return result;
}

static void
conversation_message_contact_list_set_expanded (ConversationMessageContactList* self,
                                                gboolean expanded)
{
	g_return_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_LIST (self));
	self->priv->expanded = expanded;
	gtk_flow_box_invalidate_filter (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_flow_box_get_type (), GtkFlowBox));
}

static gboolean
conversation_message_contact_list_filter_func (ConversationMessageContactList* self,
                                               GtkFlowBoxChild* child)
{
	gboolean is_expandable = FALSE;
	GtkWidget* _tmp0_;
	GtkLabel* _tmp1_;
	gboolean result;
	g_return_val_if_fail (CONVERSATION_MESSAGE_IS_CONTACT_LIST (self), FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (child, gtk_flow_box_child_get_type ()), FALSE);
	is_expandable = self->priv->children > (CONVERSATION_MESSAGE_CONTACT_LIST_SHORT_RESULTS + 1);
	_tmp0_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (child, gtk_bin_get_type (), GtkBin));
	_tmp1_ = self->priv->show_more;
	if (_tmp0_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget)) {
		gboolean _tmp2_ = FALSE;
		if (!self->priv->expanded) {
			_tmp2_ = is_expandable;
		} else {
			_tmp2_ = FALSE;
		}
		result = _tmp2_;
		return result;
	} else {
		GtkWidget* _tmp3_;
		GtkLabel* _tmp4_;
		_tmp3_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_CAST (child, gtk_bin_get_type (), GtkBin));
		_tmp4_ = self->priv->show_less;
		if (_tmp3_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget)) {
			result = self->priv->expanded;
			return result;
		} else {
			gboolean _tmp5_ = FALSE;
			if (!self->priv->expanded) {
				_tmp5_ = is_expandable;
			} else {
				_tmp5_ = FALSE;
			}
			if (_tmp5_) {
				result = gtk_flow_box_child_get_index (child) < CONVERSATION_MESSAGE_CONTACT_LIST_SHORT_RESULTS;
				return result;
			} else {
				result = TRUE;
				return result;
			}
		}
	}
}

ConversationMessageContactList*
conversation_message_contact_list_construct (GType object_type)
{
	ConversationMessageContactList * self = NULL;
	self = (ConversationMessageContactList*) g_object_new (object_type, NULL);
	return self;
}

ConversationMessageContactList*
conversation_message_contact_list_new (void)
{
	return conversation_message_contact_list_construct (CONVERSATION_MESSAGE_TYPE_CONTACT_LIST);
}

static gboolean
_conversation_message_contact_list___lambda90_ (ConversationMessageContactList* self)
{
	conversation_message_contact_list_set_expanded (self, TRUE);
}

static gboolean
__conversation_message_contact_list___lambda90__gtk_label_activate_link (GtkLabel* _sender,
                                                                         const gchar* uri,
                                                                         gpointer self)
{
	gboolean result;
	result = _conversation_message_contact_list___lambda90_ ((ConversationMessageContactList*) self);
	return result;
}

static gboolean
_conversation_message_contact_list___lambda91_ (ConversationMessageContactList* self)
{
	conversation_message_contact_list_set_expanded (self, FALSE);
}

static gboolean
__conversation_message_contact_list___lambda91__gtk_label_activate_link (GtkLabel* _sender,
                                                                         const gchar* uri,
                                                                         gpointer self)
{
	gboolean result;
	result = _conversation_message_contact_list___lambda91_ ((ConversationMessageContactList*) self);
	return result;
}

static gboolean
_conversation_message_contact_list_filter_func_gtk_flow_box_filter_func (GtkFlowBoxChild* child,
                                                                         gpointer self)
{
	gboolean result;
	result = conversation_message_contact_list_filter_func ((ConversationMessageContactList*) self, child);
	return result;
}

static GObject *
conversation_message_contact_list_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ConversationMessageContactList * self;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	parent_class = G_OBJECT_CLASS (conversation_message_contact_list_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONVERSATION_MESSAGE_TYPE_CONTACT_LIST, ConversationMessageContactList);
	_tmp0_ = conversation_message_contact_list_create_label (self);
	_g_object_unref0 (self->priv->show_more);
	self->priv->show_more = _tmp0_;
	_tmp1_ = self->priv->show_more;
	g_signal_connect_object (_tmp1_, "activate-link", (GCallback) __conversation_message_contact_list___lambda90__gtk_label_activate_link, self, 0);
	_tmp2_ = self->priv->show_more;
	GTK_CONTAINER_CLASS (conversation_message_contact_list_parent_class)->add (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_flow_box_get_type (), GtkFlowBox), gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	_tmp3_ = conversation_message_contact_list_create_label (self);
	_g_object_unref0 (self->priv->show_less);
	self->priv->show_less = _tmp3_;
	_tmp4_ = self->priv->show_less;
	_tmp5_ = g_strdup_printf ("<a href=''>%s</a>", _ ("Show less"));
	_tmp6_ = _tmp5_;
	gtk_label_set_label (_tmp4_, _tmp6_);
	_g_free0 (_tmp6_);
	_tmp7_ = self->priv->show_less;
	g_signal_connect_object (_tmp7_, "activate-link", (GCallback) __conversation_message_contact_list___lambda91__gtk_label_activate_link, self, 0);
	_tmp8_ = self->priv->show_less;
	GTK_CONTAINER_CLASS (conversation_message_contact_list_parent_class)->add (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_flow_box_get_type (), GtkFlowBox), gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget));
	gtk_flow_box_set_filter_func (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_flow_box_get_type (), GtkFlowBox), _conversation_message_contact_list_filter_func_gtk_flow_box_filter_func, g_object_ref (self), g_object_unref);
	return obj;
}

static void
conversation_message_contact_list_class_init (ConversationMessageContactListClass * klass,
                                              gpointer klass_data)
{
	conversation_message_contact_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConversationMessageContactList_private_offset);
	((GtkContainerClass *) klass)->add = (void (*) (GtkContainer*, GtkWidget*)) conversation_message_contact_list_real_add;
	G_OBJECT_CLASS (klass)->constructor = conversation_message_contact_list_constructor;
	G_OBJECT_CLASS (klass)->finalize = conversation_message_contact_list_finalize;
}

static void
conversation_message_contact_list_geary_base_interface_interface_init (GearyBaseInterfaceIface * iface,
                                                                       gpointer iface_data)
{
	conversation_message_contact_list_geary_base_interface_parent_iface = g_type_interface_peek_parent (iface);
}

static void
conversation_message_contact_list_instance_init (ConversationMessageContactList * self,
                                                 gpointer klass)
{
	self->priv = conversation_message_contact_list_get_instance_private (self);
	self->priv->expanded = FALSE;
	self->priv->children = 0;
}

static void
conversation_message_contact_list_finalize (GObject * obj)
{
	ConversationMessageContactList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONVERSATION_MESSAGE_TYPE_CONTACT_LIST, ConversationMessageContactList);
	_g_object_unref0 (self->priv->show_more);
	_g_object_unref0 (self->priv->show_less);
	G_OBJECT_CLASS (conversation_message_contact_list_parent_class)->finalize (obj);
}

/**
     * A FlowBox that limits its contents to 12 items until a link is
     * clicked to expand it. Used for to, cc, and bcc fields.
     */
static GType
conversation_message_contact_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationMessageContactListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_message_contact_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationMessageContactList), 0, (GInstanceInitFunc) conversation_message_contact_list_instance_init, NULL };
	static const GInterfaceInfo geary_base_interface_info = { (GInterfaceInitFunc) conversation_message_contact_list_geary_base_interface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType conversation_message_contact_list_type_id;
	conversation_message_contact_list_type_id = g_type_register_static (gtk_flow_box_get_type (), "ConversationMessageContactList", &g_define_type_info, 0);
	g_type_add_interface_static (conversation_message_contact_list_type_id, GEARY_TYPE_BASE_INTERFACE, &geary_base_interface_info);
	ConversationMessageContactList_private_offset = g_type_add_instance_private (conversation_message_contact_list_type_id, sizeof (ConversationMessageContactListPrivate));
	return conversation_message_contact_list_type_id;
}

GType
conversation_message_contact_list_get_type (void)
{
	static volatile gsize conversation_message_contact_list_type_id__once = 0;
	if (g_once_init_enter (&conversation_message_contact_list_type_id__once)) {
		GType conversation_message_contact_list_type_id;
		conversation_message_contact_list_type_id = conversation_message_contact_list_get_type_once ();
		g_once_init_leave (&conversation_message_contact_list_type_id__once, conversation_message_contact_list_type_id);
	}
	return conversation_message_contact_list_type_id__once;
}

static void
conversation_message_class_init (ConversationMessageClass * klass,
                                 gpointer klass_data)
{
	conversation_message_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConversationMessage_private_offset);
	((GtkWidgetClass *) klass)->destroy = (void (*) (GtkWidget*)) conversation_message_real_destroy;
	G_OBJECT_CLASS (klass)->get_property = _vala_conversation_message_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_conversation_message_set_property;
	G_OBJECT_CLASS (klass)->finalize = conversation_message_finalize;
	/** Contact for the primary originator, if any. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_PRIMARY_CONTACT_PROPERTY, conversation_message_properties[CONVERSATION_MESSAGE_PRIMARY_CONTACT_PROPERTY] = g_param_spec_object ("primary-contact", "primary-contact", "primary-contact", APPLICATION_TYPE_CONTACT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Mailbox assumed to be the primary sender. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_PRIMARY_ORIGINATOR_PROPERTY, conversation_message_properties[CONVERSATION_MESSAGE_PRIMARY_ORIGINATOR_PROPERTY] = g_param_spec_object ("primary-originator", "primary-originator", "primary-originator", GEARY_RF_C822_TYPE_MAILBOX_ADDRESS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Container for preview and full header widgets.  */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_SUMMARY_PROPERTY, conversation_message_properties[CONVERSATION_MESSAGE_SUMMARY_PROPERTY] = g_param_spec_object ("summary", "summary", "summary", gtk_grid_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Container for message body components.  */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_BODY_CONTAINER_PROPERTY, conversation_message_properties[CONVERSATION_MESSAGE_BODY_CONTAINER_PROPERTY] = g_param_spec_object ("body-container", "body-container", "body-container", gtk_grid_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/** Conainer for message InfoBar widgets. */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_INFO_BARS_PROPERTY, conversation_message_properties[CONVERSATION_MESSAGE_INFO_BARS_PROPERTY] = g_param_spec_object ("info-bars", "info-bars", "info-bars", COMPONENTS_TYPE_INFO_BAR_STACK, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	     * Emitted when web_view's content has finished loaded.
	     *
	     * See {@link Components.WebView.is_content_loaded} for details.
	     */
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONVERSATION_MESSAGE_IS_CONTENT_LOADED_PROPERTY, conversation_message_properties[CONVERSATION_MESSAGE_IS_CONTENT_LOADED_PROPERTY] = g_param_spec_boolean ("is-content-loaded", "is-content-loaded", "is-content-loaded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Geary/conversation-message.ui");
	/** Fired when the user clicks a internal link in the email. */
	conversation_message_signals[CONVERSATION_MESSAGE_INTERNAL_LINK_ACTIVATED_SIGNAL] = g_signal_new ("internal-link-activated", TYPE_CONVERSATION_MESSAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
	/** Fired when the email should be flagged for remote image loading. */
	conversation_message_signals[CONVERSATION_MESSAGE_FLAG_REMOTE_IMAGES_SIGNAL] = g_signal_new ("flag-remote-images", TYPE_CONVERSATION_MESSAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	/** Fired when the user saves an inline displayed image. */
	conversation_message_signals[CONVERSATION_MESSAGE_SAVE_IMAGE_SIGNAL] = g_signal_new ("save-image", TYPE_CONVERSATION_MESSAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_STRING_OBJECT, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, GEARY_MEMORY_TYPE_BUFFER);
	/** Emitted when web_view has loaded a resource added to it. */
	conversation_message_signals[CONVERSATION_MESSAGE_INTERNAL_RESOURCE_LOADED_SIGNAL] = g_signal_new ("internal-resource-loaded", TYPE_CONVERSATION_MESSAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	/** Emitted when web_view's selection has changed. */
	conversation_message_signals[CONVERSATION_MESSAGE_SELECTION_CHANGED_SIGNAL] = g_signal_new ("selection-changed", TYPE_CONVERSATION_MESSAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
	/**
	     * Emitted when web_view's content has finished loaded.
	     *
	     * See {@link Components.WebView.is_content_loaded} for details.
	     */
	conversation_message_signals[CONVERSATION_MESSAGE_CONTENT_LOADED_SIGNAL] = g_signal_new ("content-loaded", TYPE_CONVERSATION_MESSAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "summary", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, _summary));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "body_container", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, _body_container));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "info_bars", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, _info_bars));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "avatar", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, avatar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "compact_revealer", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, compact_revealer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "compact_from", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, compact_from));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "compact_date", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, compact_date));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "compact_body", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, compact_body));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "header_revealer", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, header_revealer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "from", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, from));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "subject", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, subject));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "date", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, date));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sender_header", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, sender_header));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "sender_address", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, sender_address));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "reply_to_header", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, reply_to_header));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "reply_to_addresses", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, reply_to_addresses));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "to_header", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, to_header));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "cc_header", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, cc_header));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "bcc_header", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, bcc_header));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "body_revealer", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, body_revealer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "body_progress", FALSE, ConversationMessage_private_offset + G_STRUCT_OFFSET (ConversationMessagePrivate, body_progress));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_address_box_child_activated", G_CALLBACK(_conversation_message_on_address_box_child_activated_gtk_flow_box_child_activated));
}

static void
conversation_message_geary_base_interface_interface_init (GearyBaseInterfaceIface * iface,
                                                          gpointer iface_data)
{
	conversation_message_geary_base_interface_parent_iface = g_type_interface_peek_parent (iface);
}

static void
conversation_message_instance_init (ConversationMessage * self,
                                    gpointer klass)
{
	gchar* _tmp0_;
	GeeLinkedList* _tmp1_;
	GeeHashMap* _tmp2_;
	GSimpleActionGroup* _tmp3_;
	self->priv = conversation_message_get_instance_private (self);
	self->priv->local_date = NULL;
	_tmp0_ = g_strdup ("");
	self->priv->subject_searchable = _tmp0_;
	self->priv->remote_images_info_bar = NULL;
	self->priv->body_placeholder = NULL;
	self->priv->context_menu = NULL;
	self->priv->context_menu_inspector = NULL;
	_tmp1_ = gee_linked_list_new (CONVERSATION_MESSAGE_TYPE_CONTACT_FLOW_BOX_CHILD, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->searchable_addresses = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_LIST, GeeList);
	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, webkit_web_resource_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->resources = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_MAP, GeeMap);
	_tmp3_ = g_simple_action_group_new ();
	self->priv->message_actions = _tmp3_;
	self->priv->next_replaced_buffer_number = 0;
	self->priv->remote_resources_requested = 0;
	self->priv->remote_resources_loaded = 0;
	self->priv->authenticated_message = FALSE;
	self->priv->show_progress_timeout = NULL;
	self->priv->hide_progress_timeout = NULL;
	g_type_ensure (COMPONENTS_TYPE_INFO_BAR_STACK);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
conversation_message_finalize (GObject * obj)
{
	ConversationMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CONVERSATION_MESSAGE, ConversationMessage);
	geary_base_interface_base_unref (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_BASE_INTERFACE, GearyBaseInterface));
	_g_object_unref0 (self->priv->_primary_contact);
	_g_object_unref0 (self->priv->_primary_originator);
	_g_object_unref0 (self->priv->_web_view);
	_g_object_unref0 (self->priv->headers);
	_g_object_unref0 (self->priv->config);
	_g_object_unref0 (self->priv->contacts);
	_g_date_time_unref0 (self->priv->local_date);
	_g_free0 (self->priv->subject_searchable);
	_g_object_unref0 (self->priv->remote_images_info_bar);
	_g_object_unref0 (self->priv->body_placeholder);
	_g_free0 (self->priv->empty_from_label);
	_g_object_unref0 (self->priv->context_menu);
	_g_object_unref0 (self->priv->context_menu_link);
	_g_object_unref0 (self->priv->context_menu_email);
	_g_object_unref0 (self->priv->context_menu_image);
	_g_object_unref0 (self->priv->context_menu_main);
	_g_object_unref0 (self->priv->context_menu_inspector);
	_g_object_unref0 (self->priv->show_images_menu);
	_g_object_unref0 (self->priv->searchable_addresses);
	_g_object_unref0 (self->priv->resources);
	_g_object_unref0 (self->priv->message_actions);
	_g_object_unref0 (self->priv->show_progress_timeout);
	_g_object_unref0 (self->priv->hide_progress_timeout);
	_g_object_unref0 (self->priv->progress_pulse);
	G_OBJECT_CLASS (conversation_message_parent_class)->finalize (obj);
}

/**
 * A widget for displaying an {@link Geary.RFC822.Message}.
 *
 * This view corresponds to {@link Geary.RFC822.Message}, displaying
 * both the message's headers and body. Any attachments and sub
 * messages are handled by {@link ConversationEmail}, which typically
 * embeds at least one instance of this class.
 */
static GType
conversation_message_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConversationMessageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) conversation_message_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConversationMessage), 0, (GInstanceInitFunc) conversation_message_instance_init, NULL };
	static const GInterfaceInfo geary_base_interface_info = { (GInterfaceInitFunc) conversation_message_geary_base_interface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType conversation_message_type_id;
	conversation_message_type_id = g_type_register_static (gtk_grid_get_type (), "ConversationMessage", &g_define_type_info, 0);
	g_type_add_interface_static (conversation_message_type_id, GEARY_TYPE_BASE_INTERFACE, &geary_base_interface_info);
	ConversationMessage_private_offset = g_type_add_instance_private (conversation_message_type_id, sizeof (ConversationMessagePrivate));
	return conversation_message_type_id;
}

GType
conversation_message_get_type (void)
{
	static volatile gsize conversation_message_type_id__once = 0;
	if (g_once_init_enter (&conversation_message_type_id__once)) {
		GType conversation_message_type_id;
		conversation_message_type_id = conversation_message_get_type_once ();
		g_once_init_leave (&conversation_message_type_id__once, conversation_message_type_id);
	}
	return conversation_message_type_id__once;
}

static void
_vala_conversation_message_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	ConversationMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CONVERSATION_MESSAGE, ConversationMessage);
	switch (property_id) {
		case CONVERSATION_MESSAGE_PRIMARY_CONTACT_PROPERTY:
		g_value_set_object (value, conversation_message_get_primary_contact (self));
		break;
		case CONVERSATION_MESSAGE_PRIMARY_ORIGINATOR_PROPERTY:
		g_value_set_object (value, conversation_message_get_primary_originator (self));
		break;
		case CONVERSATION_MESSAGE_SUMMARY_PROPERTY:
		g_value_set_object (value, conversation_message_get_summary (self));
		break;
		case CONVERSATION_MESSAGE_BODY_CONTAINER_PROPERTY:
		g_value_set_object (value, conversation_message_get_body_container (self));
		break;
		case CONVERSATION_MESSAGE_INFO_BARS_PROPERTY:
		g_value_set_object (value, conversation_message_get_info_bars (self));
		break;
		case CONVERSATION_MESSAGE_IS_CONTENT_LOADED_PROPERTY:
		g_value_set_boolean (value, conversation_message_get_is_content_loaded (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_conversation_message_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	ConversationMessage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CONVERSATION_MESSAGE, ConversationMessage);
	switch (property_id) {
		case CONVERSATION_MESSAGE_PRIMARY_CONTACT_PROPERTY:
		conversation_message_set_primary_contact (self, g_value_get_object (value));
		break;
		case CONVERSATION_MESSAGE_PRIMARY_ORIGINATOR_PROPERTY:
		conversation_message_set_primary_originator (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

