/* imap-engine-abstract-list-email.c generated by valac 0.56.19, the Vala compiler
 * generated from imap-engine-abstract-list-email.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * 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-engine.h"
#include <gee.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>

#define GEARY_IMAP_DB_FOLDER_REQUIRED_FIELDS ((GEARY_EMAIL_FIELD_PROPERTIES | GEARY_EMAIL_FIELD_REFERENCES) | GEARY_EMAIL_FIELD_FLAGS)
#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 GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION (geary_imap_engine_replay_operation_get_type ())
#define GEARY_IMAP_ENGINE_REPLAY_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation))
#define GEARY_IMAP_ENGINE_REPLAY_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperationClass))
#define GEARY_IMAP_ENGINE_IS_REPLAY_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION))
#define GEARY_IMAP_ENGINE_IS_REPLAY_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION))
#define GEARY_IMAP_ENGINE_REPLAY_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperationClass))

typedef struct _GearyImapEngineReplayOperation GearyImapEngineReplayOperation;
typedef struct _GearyImapEngineReplayOperationClass GearyImapEngineReplayOperationClass;
typedef struct _GearyImapEngineReplayOperationPrivate GearyImapEngineReplayOperationPrivate;

#define GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER (geary_imap_db_email_identifier_get_type ())
#define GEARY_IMAP_DB_EMAIL_IDENTIFIER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER, GearyImapDBEmailIdentifier))
#define GEARY_IMAP_DB_EMAIL_IDENTIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER, GearyImapDBEmailIdentifierClass))
#define GEARY_IMAP_DB_IS_EMAIL_IDENTIFIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER))
#define GEARY_IMAP_DB_IS_EMAIL_IDENTIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER))
#define GEARY_IMAP_DB_EMAIL_IDENTIFIER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER, GearyImapDBEmailIdentifierClass))

typedef struct _GearyImapDBEmailIdentifier GearyImapDBEmailIdentifier;
typedef struct _GearyImapDBEmailIdentifierClass GearyImapDBEmailIdentifierClass;
typedef enum  {
	GEARY_IMAP_ENGINE_REPLAY_OPERATION_STATUS_COMPLETED,
	GEARY_IMAP_ENGINE_REPLAY_OPERATION_STATUS_CONTINUE
} GearyImapEngineReplayOperationStatus;

#define GEARY_IMAP_ENGINE_REPLAY_OPERATION_TYPE_STATUS (geary_imap_engine_replay_operation_status_get_type ())

#define GEARY_IMAP_TYPE_FOLDER_SESSION (geary_imap_folder_session_get_type ())
#define GEARY_IMAP_FOLDER_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_TYPE_FOLDER_SESSION, GearyImapFolderSession))
#define GEARY_IMAP_FOLDER_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_TYPE_FOLDER_SESSION, GearyImapFolderSessionClass))
#define GEARY_IMAP_IS_FOLDER_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_TYPE_FOLDER_SESSION))
#define GEARY_IMAP_IS_FOLDER_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_TYPE_FOLDER_SESSION))
#define GEARY_IMAP_FOLDER_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_TYPE_FOLDER_SESSION, GearyImapFolderSessionClass))

typedef struct _GearyImapFolderSession GearyImapFolderSession;
typedef struct _GearyImapFolderSessionClass GearyImapFolderSessionClass;

#define GEARY_IMAP_ENGINE_TYPE_SEND_REPLAY_OPERATION (geary_imap_engine_send_replay_operation_get_type ())
#define GEARY_IMAP_ENGINE_SEND_REPLAY_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_SEND_REPLAY_OPERATION, GearyImapEngineSendReplayOperation))
#define GEARY_IMAP_ENGINE_SEND_REPLAY_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_SEND_REPLAY_OPERATION, GearyImapEngineSendReplayOperationClass))
#define GEARY_IMAP_ENGINE_IS_SEND_REPLAY_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_SEND_REPLAY_OPERATION))
#define GEARY_IMAP_ENGINE_IS_SEND_REPLAY_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_SEND_REPLAY_OPERATION))
#define GEARY_IMAP_ENGINE_SEND_REPLAY_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_SEND_REPLAY_OPERATION, GearyImapEngineSendReplayOperationClass))

typedef struct _GearyImapEngineSendReplayOperation GearyImapEngineSendReplayOperation;
typedef struct _GearyImapEngineSendReplayOperationClass GearyImapEngineSendReplayOperationClass;
typedef struct _GearyImapEngineSendReplayOperationPrivate GearyImapEngineSendReplayOperationPrivate;

#define GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL (geary_imap_engine_abstract_list_email_get_type ())
#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL, GearyImapEngineAbstractListEmail))
#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL, GearyImapEngineAbstractListEmailClass))
#define GEARY_IMAP_ENGINE_IS_ABSTRACT_LIST_EMAIL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL))
#define GEARY_IMAP_ENGINE_IS_ABSTRACT_LIST_EMAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL))
#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL, GearyImapEngineAbstractListEmailClass))

typedef struct _GearyImapEngineAbstractListEmail GearyImapEngineAbstractListEmail;
typedef struct _GearyImapEngineAbstractListEmailClass GearyImapEngineAbstractListEmailClass;
typedef struct _GearyImapEngineAbstractListEmailPrivate GearyImapEngineAbstractListEmailPrivate;

#define GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER (geary_imap_engine_minimal_folder_get_type ())
#define GEARY_IMAP_ENGINE_MINIMAL_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolder))
#define GEARY_IMAP_ENGINE_MINIMAL_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolderClass))
#define GEARY_IMAP_ENGINE_IS_MINIMAL_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER))
#define GEARY_IMAP_ENGINE_IS_MINIMAL_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER))
#define GEARY_IMAP_ENGINE_MINIMAL_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, GearyImapEngineMinimalFolderClass))

typedef struct _GearyImapEngineMinimalFolder GearyImapEngineMinimalFolder;
typedef struct _GearyImapEngineMinimalFolderClass GearyImapEngineMinimalFolderClass;
enum  {
	GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_0_PROPERTY,
	GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_NUM_PROPERTIES
};
static GParamSpec* geary_imap_engine_abstract_list_email_properties[GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef enum  {
	GEARY_IMAP_ENGINE_REPLAY_OPERATION_ON_ERROR_THROW,
	GEARY_IMAP_ENGINE_REPLAY_OPERATION_ON_ERROR_RETRY,
	GEARY_IMAP_ENGINE_REPLAY_OPERATION_ON_ERROR_IGNORE_REMOTE
} GearyImapEngineReplayOperationOnError;

#define GEARY_IMAP_ENGINE_REPLAY_OPERATION_TYPE_ON_ERROR (geary_imap_engine_replay_operation_on_error_get_type ())
typedef struct _Block103Data Block103Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION (geary_imap_engine_abstract_list_email_remote_batch_operation_get_type ())
#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_REMOTE_BATCH_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION, GearyImapEngineAbstractListEmailRemoteBatchOperation))
#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_REMOTE_BATCH_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION, GearyImapEngineAbstractListEmailRemoteBatchOperationClass))
#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_IS_REMOTE_BATCH_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION))
#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_IS_REMOTE_BATCH_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION))
#define GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_REMOTE_BATCH_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION, GearyImapEngineAbstractListEmailRemoteBatchOperationClass))

typedef struct _GearyImapEngineAbstractListEmailRemoteBatchOperation GearyImapEngineAbstractListEmailRemoteBatchOperation;
typedef struct _GearyImapEngineAbstractListEmailRemoteBatchOperationClass GearyImapEngineAbstractListEmailRemoteBatchOperationClass;

#define GEARY_IMAP_DB_TYPE_FOLDER (geary_imap_db_folder_get_type ())
#define GEARY_IMAP_DB_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_DB_TYPE_FOLDER, GearyImapDBFolder))
#define GEARY_IMAP_DB_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_DB_TYPE_FOLDER, GearyImapDBFolderClass))
#define GEARY_IMAP_DB_IS_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_DB_TYPE_FOLDER))
#define GEARY_IMAP_DB_IS_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_DB_TYPE_FOLDER))
#define GEARY_IMAP_DB_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_DB_TYPE_FOLDER, GearyImapDBFolderClass))

typedef struct _GearyImapDBFolder GearyImapDBFolder;
typedef struct _GearyImapDBFolderClass GearyImapDBFolderClass;

#define GEARY_TYPE_CONTACT_HARVESTER (geary_contact_harvester_get_type ())
#define GEARY_CONTACT_HARVESTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_TYPE_CONTACT_HARVESTER, GearyContactHarvester))
#define GEARY_IS_CONTACT_HARVESTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_TYPE_CONTACT_HARVESTER))
#define GEARY_CONTACT_HARVESTER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEARY_TYPE_CONTACT_HARVESTER, GearyContactHarvesterIface))

typedef struct _GearyContactHarvester GearyContactHarvester;
typedef struct _GearyContactHarvesterIface GearyContactHarvesterIface;
typedef struct _GearyImapEngineAbstractListEmailRemoteBatchOperationPrivate GearyImapEngineAbstractListEmailRemoteBatchOperationPrivate;
typedef struct _GearyImapEngineAbstractListEmailReplayRemoteAsyncData GearyImapEngineAbstractListEmailReplayRemoteAsyncData;

#define GEARY_IMAP_TYPE_FOLDER (geary_imap_folder_get_type ())
#define GEARY_IMAP_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_TYPE_FOLDER, GearyImapFolder))
#define GEARY_IMAP_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_TYPE_FOLDER, GearyImapFolderClass))
#define GEARY_IMAP_IS_FOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_TYPE_FOLDER))
#define GEARY_IMAP_IS_FOLDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_TYPE_FOLDER))
#define GEARY_IMAP_FOLDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_TYPE_FOLDER, GearyImapFolderClass))

typedef struct _GearyImapFolder GearyImapFolder;
typedef struct _GearyImapFolderClass GearyImapFolderClass;
typedef enum  {
	GEARY_IMAP_DB_FOLDER_LIST_FLAGS_NONE = 0,
	GEARY_IMAP_DB_FOLDER_LIST_FLAGS_PARTIAL_OK = 1 << 0,
	GEARY_IMAP_DB_FOLDER_LIST_FLAGS_INCLUDE_MARKED_FOR_REMOVE = 1 << 1,
	GEARY_IMAP_DB_FOLDER_LIST_FLAGS_INCLUDING_ID = 1 << 2,
	GEARY_IMAP_DB_FOLDER_LIST_FLAGS_OLDEST_TO_NEWEST = 1 << 3,
	GEARY_IMAP_DB_FOLDER_LIST_FLAGS_ONLY_INCOMPLETE = 1 << 4
} GearyImapDBFolderListFlags;

#define GEARY_IMAP_DB_FOLDER_TYPE_LIST_FLAGS (geary_imap_db_folder_list_flags_get_type ())
typedef struct _GearyImapEngineAbstractListEmailExpandVectorAsyncData GearyImapEngineAbstractListEmailExpandVectorAsyncData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData;
enum  {
	GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_REMOTE_BATCH_OPERATION_0_PROPERTY,
	GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_REMOTE_BATCH_OPERATION_NUM_PROPERTIES
};
static GParamSpec* geary_imap_engine_abstract_list_email_remote_batch_operation_properties[GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_REMOTE_BATCH_OPERATION_NUM_PROPERTIES];
typedef struct _GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GearyImapEngineReplayOperation {
	GearyBaseObject parent_instance;
	GearyImapEngineReplayOperationPrivate * priv;
};

struct _GearyImapEngineReplayOperationClass {
	GearyBaseObjectClass parent_class;
	void (*notify_remote_removed_position) (GearyImapEngineReplayOperation* self, GearyImapSequenceNumber* removed);
	void (*notify_remote_removed_ids) (GearyImapEngineReplayOperation* self, GeeCollection* ids);
	void (*get_ids_to_be_remote_removed) (GearyImapEngineReplayOperation* self, GeeCollection* ids);
	void (*replay_local_async) (GearyImapEngineReplayOperation* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GearyImapEngineReplayOperationStatus (*replay_local_finish) (GearyImapEngineReplayOperation* self, GAsyncResult* _res_, GError** error);
	void (*replay_remote_async) (GearyImapEngineReplayOperation* self, GearyImapFolderSession* remote, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*replay_remote_finish) (GearyImapEngineReplayOperation* self, GAsyncResult* _res_, GError** error);
	void (*backout_local_async) (GearyImapEngineReplayOperation* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*backout_local_finish) (GearyImapEngineReplayOperation* self, GAsyncResult* _res_, GError** error);
	gchar* (*describe_state) (GearyImapEngineReplayOperation* self);
};

struct _GearyImapEngineSendReplayOperation {
	GearyImapEngineReplayOperation parent_instance;
	GearyImapEngineSendReplayOperationPrivate * priv;
};

struct _GearyImapEngineSendReplayOperationClass {
	GearyImapEngineReplayOperationClass parent_class;
};

struct _GearyImapEngineAbstractListEmail {
	GearyImapEngineSendReplayOperation parent_instance;
	GeeList* accumulator;
	GearyImapEngineMinimalFolder* owner;
	GearyEmailField required_fields;
	GCancellable* cancellable;
	GearyFolderListFlags flags;
	GearyImapEngineAbstractListEmailPrivate * priv;
};

struct _GearyImapEngineAbstractListEmailClass {
	GearyImapEngineSendReplayOperationClass parent_class;
};

struct _GearyImapEngineAbstractListEmailPrivate {
	GeeHashMap* unfulfilled;
};

struct _Block103Data {
	int _ref_count_;
	GearyImapEngineAbstractListEmail* self;
	GeeCollection* ids;
};

struct _GearyContactHarvesterIface {
	GTypeInterface parent_iface;
	void (*harvest_from_email) (GearyContactHarvester* self, GeeCollection* messages, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*harvest_from_email_finish) (GearyContactHarvester* self, GAsyncResult* _res_, GError** error);
};

struct _GearyImapEngineAbstractListEmailRemoteBatchOperation {
	GearyNonblockingBatchOperation parent_instance;
	GearyImapFolderSession* remote;
	GearyImapDBFolder* local;
	GearyImapMessageSet* msg_set;
	GearyEmailField unfulfilled_fields;
	GearyEmailField required_fields;
	gboolean update_unread;
	GeeSet* created_ids;
	GearyImapEngineAbstractListEmailRemoteBatchOperationPrivate * priv;
};

struct _GearyImapEngineAbstractListEmailRemoteBatchOperationClass {
	GearyNonblockingBatchOperationClass parent_class;
};

struct _GearyImapEngineAbstractListEmailReplayRemoteAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineAbstractListEmail* self;
	GearyImapFolderSession* remote;
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint fetches_avoided;
	GearyImapEngineMinimalFolder* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GeeHashMap* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	GeeHashMultiMap* reverse_unfulfilled;
	GeeHashMultiMap* _tmp9_;
	GeeIterator* _uid_it;
	GeeHashMap* _tmp10_;
	GeeSet* _tmp11_;
	GeeSet* _tmp12_;
	GeeSet* _tmp13_;
	GeeIterator* _tmp14_;
	GeeIterator* _tmp15_;
	GeeIterator* _tmp16_;
	GearyImapUID* uid;
	GeeIterator* _tmp17_;
	gpointer _tmp18_;
	GeeHashMultiMap* _tmp19_;
	GeeHashMap* _tmp20_;
	GearyImapUID* _tmp21_;
	gpointer _tmp22_;
	GearyImapUID* _tmp23_;
	GearyNonblockingBatch* batch;
	GearyNonblockingBatch* _tmp24_;
	GeeIterator* _unfulfilled_fields_it;
	GeeHashMultiMap* _tmp25_;
	GeeSet* _tmp26_;
	GeeSet* _tmp27_;
	GeeIterator* _tmp28_;
	GeeIterator* _tmp29_;
	GeeIterator* _tmp30_;
	GearyEmailField unfulfilled_fields;
	GeeIterator* _tmp31_;
	gpointer _tmp32_;
	GeeCollection* unfulfilled_uids;
	GeeHashMultiMap* _tmp33_;
	GeeCollection* _tmp34_;
	GeeCollection* _tmp35_;
	gint _tmp36_;
	gint _tmp37_;
	GeeList* msg_sets;
	GeeCollection* _tmp38_;
	GeeList* _tmp39_;
	GeeList* _msg_set_list;
	GeeList* _tmp40_;
	gint _msg_set_size;
	GeeList* _tmp41_;
	gint _tmp42_;
	gint _tmp43_;
	gint _msg_set_index;
	gint _tmp44_;
	gint _tmp45_;
	GearyImapMessageSet* msg_set;
	GeeList* _tmp46_;
	gpointer _tmp47_;
	GearyImapEngineAbstractListEmailRemoteBatchOperation* remote_op;
	GearyImapEngineMinimalFolder* _tmp48_;
	GearyImapDBFolder* _tmp49_;
	GearyImapDBFolder* _tmp50_;
	GearyImapMessageSet* _tmp51_;
	GearyImapEngineMinimalFolder* _tmp52_;
	GearyContactHarvester* _tmp53_;
	GearyContactHarvester* _tmp54_;
	GearyImapEngineAbstractListEmailRemoteBatchOperation* _tmp55_;
	GearyNonblockingBatch* _tmp56_;
	GearyImapEngineAbstractListEmailRemoteBatchOperation* _tmp57_;
	GearyNonblockingBatch* _tmp58_;
	GCancellable* _tmp59_;
	GearyNonblockingBatch* _tmp60_;
	GeeArrayList* result_list;
	GeeArrayList* _tmp61_;
	GeeHashSet* created_ids;
	GeeHashSet* _tmp62_;
	GeeIterator* _batch_id_it;
	GearyNonblockingBatch* _tmp63_;
	GeeSet* _tmp64_;
	GeeSet* _tmp65_;
	GeeIterator* _tmp66_;
	GeeIterator* _tmp67_;
	GeeIterator* _tmp68_;
	gint batch_id;
	GeeIterator* _tmp69_;
	gpointer _tmp70_;
	GObject* _tmp71_;
	GearyNonblockingBatch* _tmp72_;
	GObject* _tmp73_;
	GeeList* list;
	GeeList* _tmp74_;
	gboolean _tmp75_;
	GeeList* _tmp76_;
	GeeList* _tmp77_;
	gint _tmp78_;
	gint _tmp79_;
	GeeArrayList* _tmp80_;
	GeeList* _tmp81_;
	GearyImapEngineAbstractListEmailRemoteBatchOperation* op;
	GearyNonblockingBatch* _tmp82_;
	GearyNonblockingBatchOperation* _tmp83_;
	GeeHashSet* _tmp84_;
	GearyImapEngineAbstractListEmailRemoteBatchOperation* _tmp85_;
	GeeSet* _tmp86_;
	GeeArrayList* _tmp87_;
	gint _tmp88_;
	gint _tmp89_;
	GeeList* _tmp90_;
	GeeArrayList* _tmp91_;
	GeeHashSet* _tmp92_;
	gint _tmp93_;
	gint _tmp94_;
	GearyImapEngineMinimalFolder* _tmp95_;
	GeeHashSet* _tmp96_;
	GearyImapEngineMinimalFolder* _tmp97_;
	GeeHashSet* _tmp98_;
	GError* _inner_error0_;
};

struct _GearyImapEngineAbstractListEmailExpandVectorAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineAbstractListEmail* self;
	GearyImapFolderSession* remote;
	GearyImapUID* initial_uid;
	gint count;
	GeeSet* result;
	GearyImapEngineMinimalFolder* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gint remote_count;
	GearyImapFolder* _tmp3_;
	GearyImapFolder* _tmp4_;
	GearyImapFolderProperties* _tmp5_;
	GearyImapFolderProperties* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gint local_count;
	GearyImapEngineMinimalFolder* _tmp9_;
	GearyImapDBFolder* _tmp10_;
	GearyImapDBFolder* _tmp11_;
	GCancellable* _tmp12_;
	gint64 vector_start;
	gint64 low_pos;
	gint64 high_pos;
	gint64 initial_pos;
	GeeMap* map;
	GearyImapMessageSet* _tmp13_;
	GearyImapMessageSet* _tmp14_;
	GCancellable* _tmp15_;
	GeeMap* _tmp16_;
	GeeMap* _tmp17_;
	GearyImapSequenceNumber* pos;
	GeeMap* _tmp18_;
	gpointer _tmp19_;
	GearyImapSequenceNumber* _tmp20_;
	GearyImapSequenceNumber* _tmp21_;
	gint64 _tmp22_;
	gint64 _tmp23_;
	GearyImapEngineMinimalFolder* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	GearyImapMessageSet* msg_set;
	GearyImapSequenceNumber* _tmp31_;
	GearyImapSequenceNumber* _tmp32_;
	GearyImapSequenceNumber* _tmp33_;
	GearyImapSequenceNumber* _tmp34_;
	GearyImapMessageSet* _tmp35_;
	GearyImapMessageSet* _tmp36_;
	gint64 actual_count;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	GearyImapEngineMinimalFolder* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	GearyImapMessageSet* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	GeeList* list;
	GearyImapMessageSet* _tmp50_;
	GCancellable* _tmp51_;
	GeeList* _tmp52_;
	GeeSet* uids;
	GeeHashSet* _tmp53_;
	GeeList* _tmp54_;
	GeeList* _email_list;
	GeeList* _tmp55_;
	gint _email_size;
	GeeList* _tmp56_;
	gint _tmp57_;
	gint _tmp58_;
	gint _email_index;
	gint _tmp59_;
	gint _tmp60_;
	GearyEmail* email;
	GeeList* _tmp61_;
	gpointer _tmp62_;
	GeeSet* _tmp63_;
	GearyEmail* _tmp64_;
	GearyEmailIdentifier* _tmp65_;
	GearyEmailIdentifier* _tmp66_;
	GearyImapUID* _tmp67_;
	GearyImapUID* _tmp68_;
	GeeCollection* ids;
	GearyImapEngineMinimalFolder* _tmp69_;
	GearyImapDBFolder* _tmp70_;
	GearyImapDBFolder* _tmp71_;
	GeeSet* _tmp72_;
	GCancellable* _tmp73_;
	GeeSet* _tmp74_;
	gboolean _tmp75_;
	GeeCollection* _tmp76_;
	GeeCollection* _tmp77_;
	gint _tmp78_;
	gint _tmp79_;
	GeeIterator* _id_it;
	GeeCollection* _tmp80_;
	GeeIterator* _tmp81_;
	GeeIterator* _tmp82_;
	GearyImapDBEmailIdentifier* id;
	GeeIterator* _tmp83_;
	gpointer _tmp84_;
	GearyImapDBEmailIdentifier* _tmp85_;
	GeeSet* _tmp86_;
	GearyImapDBEmailIdentifier* _tmp87_;
	GearyImapUID* _tmp88_;
	GearyImapUID* _tmp89_;
	GeeSet* _tmp90_;
	gint _tmp91_;
	GeeSet* _tmp92_;
	GeeSet* _tmp93_;
	gint _tmp94_;
	gint _tmp95_;
	GearyImapEngineMinimalFolder* _tmp96_;
	gchar* _tmp97_;
	gchar* _tmp98_;
	GeeSet* _tmp99_;
	gboolean _tmp100_;
	GeeSet* _tmp101_;
	GeeSet* _tmp102_;
	gint _tmp103_;
	gint _tmp104_;
	GeeSet* _tmp105_;
	GeeSet* _tmp106_;
	GError* _inner_error0_;
};

struct _GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineAbstractListEmail* self;
	gint result;
	GearyImapDBFolderListFlags list_flags;
	GeeSet* unfulfilled_ids;
	GearyImapEngineMinimalFolder* _tmp0_;
	GearyImapDBFolder* _tmp1_;
	GearyImapDBFolder* _tmp2_;
	GeeHashMap* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	GeeSet* _tmp6_;
	GCancellable* _tmp7_;
	GeeSet* _tmp8_;
	GeeSet* _tmp9_;
	gboolean _tmp10_;
	GeeSet* _tmp11_;
	GeeSet* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	GeeMap* local_fields;
	GearyImapEngineMinimalFolder* _tmp15_;
	GearyImapDBFolder* _tmp16_;
	GearyImapDBFolder* _tmp17_;
	GeeSet* _tmp18_;
	GCancellable* _tmp19_;
	GeeMap* _tmp20_;
	gboolean _tmp21_;
	GeeMap* _tmp22_;
	GeeMap* _tmp23_;
	gint _tmp24_;
	gint _tmp25_;
	gint fetch_avoided;
	GeeIterator* _id_it;
	GeeMap* _tmp26_;
	GeeSet* _tmp27_;
	GeeSet* _tmp28_;
	GeeSet* _tmp29_;
	GeeIterator* _tmp30_;
	GeeIterator* _tmp31_;
	GeeIterator* _tmp32_;
	GearyImapDBEmailIdentifier* id;
	GeeIterator* _tmp33_;
	gpointer _tmp34_;
	GeeMap* _tmp35_;
	GearyImapDBEmailIdentifier* _tmp36_;
	gpointer _tmp37_;
	GearyEmail* email;
	GearyImapEngineMinimalFolder* _tmp38_;
	GearyImapDBFolder* _tmp39_;
	GearyImapDBFolder* _tmp40_;
	GearyImapDBEmailIdentifier* _tmp41_;
	GCancellable* _tmp42_;
	GearyEmail* _tmp43_;
	GeeList* _tmp44_;
	GearyEmail* _tmp45_;
	GError* err;
	GError* _tmp46_;
	GError* _tmp47_;
	GError* _tmp48_;
	GeeHashMap* _tmp49_;
	GearyImapDBEmailIdentifier* _tmp50_;
	GearyImapUID* _tmp51_;
	GearyImapUID* _tmp52_;
	gint _tmp53_;
	GError* _inner_error0_;
};

struct _GearyImapEngineAbstractListEmailRemoteBatchOperationPrivate {
	GearyContactHarvester* harvester;
};

struct _GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineAbstractListEmailRemoteBatchOperation* self;
	GCancellable* cancellable;
	GObject* result;
	GeeList* list;
	GearyImapFolderSession* _tmp0_;
	GearyImapMessageSet* _tmp1_;
	GeeList* _tmp2_;
	gboolean _tmp3_;
	GeeList* _tmp4_;
	GeeList* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	GeeMap* created_or_merged;
	GearyImapDBFolder* _tmp8_;
	GeeList* _tmp9_;
	GearyContactHarvester* _tmp10_;
	GeeMap* _tmp11_;
	gint ctr;
	gboolean _tmp12_;
	gint _tmp13_;
	GeeList* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	GearyEmail* email;
	GeeList* _tmp17_;
	gpointer _tmp18_;
	GeeMap* _tmp19_;
	GearyEmail* _tmp20_;
	gpointer _tmp21_;
	GeeSet* _tmp22_;
	GearyEmail* _tmp23_;
	GearyEmailIdentifier* _tmp24_;
	GearyEmailIdentifier* _tmp25_;
	GearyEmail* _tmp26_;
	GearyEmailField _tmp27_;
	GearyEmailField _tmp28_;
	GearyEmail* _tmp29_;
	GearyImapDBFolder* _tmp30_;
	GearyEmail* _tmp31_;
	GearyEmailIdentifier* _tmp32_;
	GearyEmailIdentifier* _tmp33_;
	GearyEmail* _tmp34_;
	GearyEmail* _tmp35_;
	GeeList* _tmp36_;
	GearyEmail* _tmp37_;
	GError* _inner_error0_;
};

static gint GearyImapEngineAbstractListEmail_private_offset;
static gpointer geary_imap_engine_abstract_list_email_parent_class = NULL;
static gint geary_imap_engine_abstract_list_email_total_fetches_avoided;
static gint geary_imap_engine_abstract_list_email_total_fetches_avoided = 0;
static gint GearyImapEngineAbstractListEmailRemoteBatchOperation_private_offset;
static gpointer geary_imap_engine_abstract_list_email_remote_batch_operation_parent_class = NULL;

VALA_EXTERN GType geary_imap_engine_replay_operation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_db_email_identifier_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_replay_operation_status_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_folder_session_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_send_replay_operation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_abstract_list_email_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_minimal_folder_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void geary_imap_engine_replay_operation_notify_remote_removed_ids (GearyImapEngineReplayOperation* self,
                                                                   GeeCollection* ids);
VALA_EXTERN void geary_imap_engine_replay_operation_replay_remote_async (GearyImapEngineReplayOperation* self,
                                                             GearyImapFolderSession* remote,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
VALA_EXTERN void geary_imap_engine_replay_operation_replay_remote_finish (GearyImapEngineReplayOperation* self,
                                                              GAsyncResult* _res_,
                                                              GError** error);
VALA_EXTERN gchar* geary_imap_engine_replay_operation_describe_state (GearyImapEngineReplayOperation* self);
VALA_EXTERN GearyImapEngineAbstractListEmail* geary_imap_engine_abstract_list_email_construct (GType object_type,
                                                                                   const gchar* name,
                                                                                   GearyImapEngineMinimalFolder* owner,
                                                                                   GearyEmailField required_fields,
                                                                                   GearyFolderListFlags flags,
                                                                                   GCancellable* cancellable);
VALA_EXTERN GType geary_imap_engine_replay_operation_on_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GearyImapEngineSendReplayOperation* geary_imap_engine_send_replay_operation_construct (GType object_type,
                                                                                       const gchar* name,
                                                                                       GearyImapEngineReplayOperationOnError on_remote_error);
VALA_EXTERN void geary_imap_engine_abstract_list_email_add_unfulfilled_fields (GearyImapEngineAbstractListEmail* self,
                                                                   GearyImapUID* uid,
                                                                   GearyEmailField unfulfilled_fields);
VALA_EXTERN void geary_imap_engine_abstract_list_email_add_many_unfulfilled_fields (GearyImapEngineAbstractListEmail* self,
                                                                        GeeCollection* uids,
                                                                        GearyEmailField unfulfilled_fields);
VALA_EXTERN gint geary_imap_engine_abstract_list_email_get_unfulfilled_count (GearyImapEngineAbstractListEmail* self);
static void geary_imap_engine_abstract_list_email_real_notify_remote_removed_ids (GearyImapEngineReplayOperation* base,
                                                                           GeeCollection* ids);
static Block103Data* block103_data_ref (Block103Data* _data103_);
static void block103_data_unref (void * _userdata_);
static gboolean __lambda110_ (Block103Data* _data103_,
                       GearyEmail* email);
static gboolean ___lambda110__gee_predicate (gconstpointer g,
                                      gpointer self);
VALA_EXTERN gboolean geary_imap_db_email_identifier_has_uid (GearyImapDBEmailIdentifier* self);
VALA_EXTERN GearyImapUID* geary_imap_db_email_identifier_get_uid (GearyImapDBEmailIdentifier* self);
static void geary_imap_engine_abstract_list_email_real_replay_remote_async_data_free (gpointer _data);
static void geary_imap_engine_abstract_list_email_real_replay_remote_async (GearyImapEngineReplayOperation* base,
                                                                     GearyImapFolderSession* remote,
                                                                     GAsyncReadyCallback _callback_,
                                                                     gpointer _user_data_);
static gboolean geary_imap_engine_abstract_list_email_real_replay_remote_async_co (GearyImapEngineAbstractListEmailReplayRemoteAsyncData* _data_);
static void geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async (GearyImapEngineAbstractListEmail* self,
                                                                        GAsyncReadyCallback _callback_,
                                                                        gpointer _user_data_);
static gint geary_imap_engine_abstract_list_email_remove_fulfilled_uids_finish (GearyImapEngineAbstractListEmail* self,
                                                                         GAsyncResult* _res_,
                                                                         GError** error);
static void geary_imap_engine_abstract_list_email_replay_remote_async_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_);
static GType geary_imap_engine_abstract_list_email_remote_batch_operation_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN GType geary_imap_db_folder_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GearyImapDBFolder* geary_imap_engine_minimal_folder_get_local_folder (GearyImapEngineMinimalFolder* self);
VALA_EXTERN GType geary_contact_harvester_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GearyContactHarvester* geary_imap_engine_minimal_folder_get_harvester (GearyImapEngineMinimalFolder* self);
static GearyImapEngineAbstractListEmailRemoteBatchOperation* geary_imap_engine_abstract_list_email_remote_batch_operation_new (GearyImapFolderSession* remote,
                                                                                                                        GearyImapDBFolder* local,
                                                                                                                        GearyImapMessageSet* msg_set,
                                                                                                                        GearyEmailField unfulfilled_fields,
                                                                                                                        GearyEmailField required_fields,
                                                                                                                        gboolean update_unread,
                                                                                                                        GearyContactHarvester* harvester);
static GearyImapEngineAbstractListEmailRemoteBatchOperation* geary_imap_engine_abstract_list_email_remote_batch_operation_construct (GType object_type,
                                                                                                                              GearyImapFolderSession* remote,
                                                                                                                              GearyImapDBFolder* local,
                                                                                                                              GearyImapMessageSet* msg_set,
                                                                                                                              GearyEmailField unfulfilled_fields,
                                                                                                                              GearyEmailField required_fields,
                                                                                                                              gboolean update_unread,
                                                                                                                              GearyContactHarvester* harvester);
VALA_EXTERN void geary_imap_engine_minimal_folder_replay_notify_email_inserted (GearyImapEngineMinimalFolder* self,
                                                                    GeeCollection* ids);
VALA_EXTERN void geary_imap_engine_minimal_folder_replay_notify_email_locally_inserted (GearyImapEngineMinimalFolder* self,
                                                                            GeeCollection* ids);
static void geary_imap_engine_abstract_list_email_expand_vector_async_data_free (gpointer _data);
VALA_EXTERN void geary_imap_engine_abstract_list_email_expand_vector_async (GearyImapEngineAbstractListEmail* self,
                                                                GearyImapFolderSession* remote,
                                                                GearyImapUID* initial_uid,
                                                                gint count,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
VALA_EXTERN GeeSet* geary_imap_engine_abstract_list_email_expand_vector_finish (GearyImapEngineAbstractListEmail* self,
                                                                    GAsyncResult* _res_,
                                                                    GError** error);
static gboolean geary_imap_engine_abstract_list_email_expand_vector_async_co (GearyImapEngineAbstractListEmailExpandVectorAsyncData* _data_);
VALA_EXTERN GType geary_imap_folder_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GearyImapFolder* geary_imap_folder_session_get_folder (GearyImapFolderSession* self);
VALA_EXTERN GearyImapFolderProperties* geary_imap_folder_get_properties (GearyImapFolder* self);
VALA_EXTERN GType geary_imap_db_folder_list_flags_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void geary_imap_db_folder_get_email_count_async (GearyImapDBFolder* self,
                                                 GearyImapDBFolderListFlags flags,
                                                 GCancellable* cancellable,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
VALA_EXTERN gint geary_imap_db_folder_get_email_count_finish (GearyImapDBFolder* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static void geary_imap_engine_abstract_list_email_expand_vector_async_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_);
VALA_EXTERN void geary_imap_folder_session_uid_to_position_async (GearyImapFolderSession* self,
                                                      GearyImapMessageSet* msg_set,
                                                      GCancellable* cancellable,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
VALA_EXTERN GeeMap* geary_imap_folder_session_uid_to_position_finish (GearyImapFolderSession* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
VALA_EXTERN void geary_imap_folder_session_list_email_async (GearyImapFolderSession* self,
                                                 GearyImapMessageSet* msg_set,
                                                 GearyEmailField fields,
                                                 GCancellable* cancellable,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
VALA_EXTERN GeeList* geary_imap_folder_session_list_email_finish (GearyImapFolderSession* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
VALA_EXTERN void geary_imap_db_folder_get_ids_async (GearyImapDBFolder* self,
                                         GeeCollection* uids,
                                         GearyImapDBFolderListFlags flags,
                                         GCancellable* cancellable,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN GeeSet* geary_imap_db_folder_get_ids_finish (GearyImapDBFolder* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static void geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_data_free (gpointer _data);
static gboolean geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_co (GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData* _data_);
VALA_EXTERN GearyImapDBFolderListFlags geary_imap_db_folder_list_flags_from_folder_flags (GearyFolderListFlags flags);
static void geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_ready (GObject* source_object,
                                                                              GAsyncResult* _res_,
                                                                              gpointer _user_data_);
VALA_EXTERN void geary_imap_db_folder_list_email_fields_by_id_async (GearyImapDBFolder* self,
                                                         GeeCollection* ids,
                                                         GearyImapDBFolderListFlags flags,
                                                         GCancellable* cancellable,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
VALA_EXTERN GeeMap* geary_imap_db_folder_list_email_fields_by_id_finish (GearyImapDBFolder* self,
                                                             GAsyncResult* _res_,
                                                             GError** error);
VALA_EXTERN void geary_imap_db_folder_fetch_email_async (GearyImapDBFolder* self,
                                             GearyImapDBEmailIdentifier* id,
                                             GearyEmailField required_fields,
                                             GearyImapDBFolderListFlags flags,
                                             GCancellable* cancellable,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN GearyEmail* geary_imap_db_folder_fetch_email_finish (GearyImapDBFolder* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static gchar* geary_imap_engine_abstract_list_email_real_describe_state (GearyImapEngineReplayOperation* base);
static void geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async_data_free (gpointer _data);
static void geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async (GearyNonblockingBatchOperation* base,
                                                                                      GCancellable* cancellable,
                                                                                      GAsyncReadyCallback _callback_,
                                                                                      gpointer _user_data_);
static gboolean geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async_co (GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData* _data_);
static void geary_imap_engine_abstract_list_email_remote_batch_operation_execute_async_ready (GObject* source_object,
                                                                                       GAsyncResult* _res_,
                                                                                       gpointer _user_data_);
VALA_EXTERN void geary_imap_db_folder_create_or_merge_email_async (GearyImapDBFolder* self,
                                                       GeeCollection* emails,
                                                       gboolean update_totals,
                                                       GearyContactHarvester* harvester,
                                                       GCancellable* cancellable,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_);
VALA_EXTERN GeeMap* geary_imap_db_folder_create_or_merge_email_finish (GearyImapDBFolder* self,
                                                           GAsyncResult* _res_,
                                                           GError** error);
static void geary_imap_engine_abstract_list_email_remote_batch_operation_finalize (GObject * obj);
static GType geary_imap_engine_abstract_list_email_remote_batch_operation_get_type_once (void);
static void geary_imap_engine_abstract_list_email_finalize (GObject * obj);
static GType geary_imap_engine_abstract_list_email_get_type_once (void);

static inline gpointer
geary_imap_engine_abstract_list_email_get_instance_private (GearyImapEngineAbstractListEmail* self)
{
	return G_STRUCT_MEMBER_P (self, GearyImapEngineAbstractListEmail_private_offset);
}

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

GearyImapEngineAbstractListEmail*
geary_imap_engine_abstract_list_email_construct (GType object_type,
                                                 const gchar* name,
                                                 GearyImapEngineMinimalFolder* owner,
                                                 GearyEmailField required_fields,
                                                 GearyFolderListFlags flags,
                                                 GCancellable* cancellable)
{
	GearyImapEngineAbstractListEmail * self = NULL;
	GearyImapEngineMinimalFolder* _tmp0_;
	GCancellable* _tmp1_;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (GEARY_IMAP_ENGINE_IS_MINIMAL_FOLDER (owner), NULL);
	g_return_val_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()), NULL);
	self = (GearyImapEngineAbstractListEmail*) geary_imap_engine_send_replay_operation_construct (object_type, name, GEARY_IMAP_ENGINE_REPLAY_OPERATION_ON_ERROR_IGNORE_REMOTE);
	_tmp0_ = _g_object_ref0 (owner);
	_g_object_unref0 (self->owner);
	self->owner = _tmp0_;
	self->required_fields = required_fields;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (self->cancellable);
	self->cancellable = _tmp1_;
	self->flags = flags;
	return self;
}

void
geary_imap_engine_abstract_list_email_add_unfulfilled_fields (GearyImapEngineAbstractListEmail* self,
                                                              GearyImapUID* uid,
                                                              GearyEmailField unfulfilled_fields)
{
	GeeHashMap* _tmp0_;
	g_return_if_fail (GEARY_IMAP_ENGINE_IS_ABSTRACT_LIST_EMAIL (self));
	g_return_if_fail ((uid == NULL) || GEARY_IMAP_IS_UID (uid));
	_vala_assert (uid != NULL, "uid != null");
	_vala_assert (geary_imap_uid_is_valid (uid), "uid.is_valid()");
	_tmp0_ = self->priv->unfulfilled;
	if (!gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), uid)) {
		GeeHashMap* _tmp1_;
		_tmp1_ = self->priv->unfulfilled;
		gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), uid, (gpointer) ((gintptr) unfulfilled_fields));
	} else {
		GeeHashMap* _tmp2_;
		GeeHashMap* _tmp3_;
		gpointer _tmp4_;
		_tmp2_ = self->priv->unfulfilled;
		_tmp3_ = self->priv->unfulfilled;
		_tmp4_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), uid);
		gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), uid, (gpointer) ((gintptr) (((GearyEmailField) ((gintptr) _tmp4_)) | unfulfilled_fields)));
	}
}

void
geary_imap_engine_abstract_list_email_add_many_unfulfilled_fields (GearyImapEngineAbstractListEmail* self,
                                                                   GeeCollection* uids,
                                                                   GearyEmailField unfulfilled_fields)
{
	g_return_if_fail (GEARY_IMAP_ENGINE_IS_ABSTRACT_LIST_EMAIL (self));
	g_return_if_fail ((uids == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (uids, GEE_TYPE_COLLECTION));
	if (uids != NULL) {
		{
			GeeIterator* _uid_it = NULL;
			GeeIterator* _tmp0_;
			_tmp0_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (uids, GEE_TYPE_ITERABLE, GeeIterable));
			_uid_it = _tmp0_;
			while (TRUE) {
				GeeIterator* _tmp1_;
				GearyImapUID* uid = NULL;
				GeeIterator* _tmp2_;
				gpointer _tmp3_;
				GearyImapUID* _tmp4_;
				_tmp1_ = _uid_it;
				if (!gee_iterator_next (_tmp1_)) {
					break;
				}
				_tmp2_ = _uid_it;
				_tmp3_ = gee_iterator_get (_tmp2_);
				uid = (GearyImapUID*) _tmp3_;
				_tmp4_ = uid;
				geary_imap_engine_abstract_list_email_add_unfulfilled_fields (self, _tmp4_, unfulfilled_fields);
				_g_object_unref0 (uid);
			}
			_g_object_unref0 (_uid_it);
		}
	}
}

gint
geary_imap_engine_abstract_list_email_get_unfulfilled_count (GearyImapEngineAbstractListEmail* self)
{
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint result;
	g_return_val_if_fail (GEARY_IMAP_ENGINE_IS_ABSTRACT_LIST_EMAIL (self), -1);
	_tmp0_ = self->priv->unfulfilled;
	_tmp1_ = gee_abstract_map_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static Block103Data*
block103_data_ref (Block103Data* _data103_)
{
	g_atomic_int_inc (&_data103_->_ref_count_);
	return _data103_;
}

static void
block103_data_unref (void * _userdata_)
{
	Block103Data* _data103_;
	_data103_ = (Block103Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data103_->_ref_count_)) {
		GearyImapEngineAbstractListEmail* self;
		self = _data103_->self;
		_g_object_unref0 (_data103_->ids);
		_g_object_unref0 (self);
		g_slice_free (Block103Data, _data103_);
	}
}

static gboolean
__lambda110_ (Block103Data* _data103_,
              GearyEmail* email)
{
	GearyImapEngineAbstractListEmail* self;
	GearyEmailIdentifier* _tmp0_;
	GearyEmailIdentifier* _tmp1_;
	gboolean result;
	self = _data103_->self;
	g_return_val_if_fail (GEARY_IS_EMAIL (email), FALSE);
	_tmp0_ = geary_email_get_id (email);
	_tmp1_ = _tmp0_;
	result = gee_collection_contains (_data103_->ids, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER, GearyImapDBEmailIdentifier));
	return result;
}

static gboolean
___lambda110__gee_predicate (gconstpointer g,
                             gpointer self)
{
	gboolean result;
	result = __lambda110_ (self, (GearyEmail*) g);
	return result;
}

static void
geary_imap_engine_abstract_list_email_real_notify_remote_removed_ids (GearyImapEngineReplayOperation* base,
                                                                      GeeCollection* ids)
{
	GearyImapEngineAbstractListEmail * self;
	Block103Data* _data103_;
	GeeCollection* _tmp0_;
	GeeList* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL, GearyImapEngineAbstractListEmail);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (ids, GEE_TYPE_COLLECTION));
	_data103_ = g_slice_new0 (Block103Data);
	_data103_->_ref_count_ = 1;
	_data103_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (ids);
	_g_object_unref0 (_data103_->ids);
	_data103_->ids = _tmp0_;
	_tmp1_ = self->accumulator;
	_tmp2_ = geary_collection_remove_if (GEARY_TYPE_EMAIL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection), ___lambda110__gee_predicate, block103_data_ref (_data103_), block103_data_unref);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp3_);
	{
		GeeIterator* _id_it = NULL;
		GeeIterator* _tmp4_;
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data103_->ids, GEE_TYPE_ITERABLE, GeeIterable));
		_id_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			GearyImapDBEmailIdentifier* id = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			GearyImapDBEmailIdentifier* _tmp8_;
			_tmp5_ = _id_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _id_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			id = (GearyImapDBEmailIdentifier*) _tmp7_;
			_tmp8_ = id;
			if (geary_imap_db_email_identifier_has_uid (_tmp8_)) {
				GeeHashMap* _tmp9_;
				GearyImapDBEmailIdentifier* _tmp10_;
				GearyImapUID* _tmp11_;
				GearyImapUID* _tmp12_;
				_tmp9_ = self->priv->unfulfilled;
				_tmp10_ = id;
				_tmp11_ = geary_imap_db_email_identifier_get_uid (_tmp10_);
				_tmp12_ = _tmp11_;
				gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp12_, NULL);
			}
			_g_object_unref0 (id);
		}
		_g_object_unref0 (_id_it);
	}
	block103_data_unref (_data103_);
	_data103_ = NULL;
}

static void
geary_imap_engine_abstract_list_email_real_replay_remote_async_data_free (gpointer _data)
{
	GearyImapEngineAbstractListEmailReplayRemoteAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->remote);
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyImapEngineAbstractListEmailReplayRemoteAsyncData, _data_);
}

static void
geary_imap_engine_abstract_list_email_real_replay_remote_async (GearyImapEngineReplayOperation* base,
                                                                GearyImapFolderSession* remote,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_)
{
	GearyImapEngineAbstractListEmail * self;
	GearyImapEngineAbstractListEmailReplayRemoteAsyncData* _data_;
	GearyImapEngineAbstractListEmail* _tmp0_;
	GearyImapFolderSession* _tmp1_;
	g_return_if_fail (GEARY_IMAP_IS_FOLDER_SESSION (remote));
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL, GearyImapEngineAbstractListEmail);
	_data_ = g_slice_new0 (GearyImapEngineAbstractListEmailReplayRemoteAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_imap_engine_abstract_list_email_real_replay_remote_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (remote);
	_g_object_unref0 (_data_->remote);
	_data_->remote = _tmp1_;
	geary_imap_engine_abstract_list_email_real_replay_remote_async_co (_data_);
}

static void
geary_imap_engine_abstract_list_email_replay_remote_finish (GearyImapEngineReplayOperation* base,
                                                            GAsyncResult* _res_,
                                                            GError** error)
{
	GearyImapEngineAbstractListEmailReplayRemoteAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
geary_imap_engine_abstract_list_email_replay_remote_async_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_)
{
	GearyImapEngineAbstractListEmailReplayRemoteAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_abstract_list_email_real_replay_remote_async_co (_data_);
}

static gboolean
geary_imap_engine_abstract_list_email_real_replay_remote_async_co (GearyImapEngineAbstractListEmailReplayRemoteAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->unfulfilled;
	_data_->_tmp1_ = gee_abstract_map_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_ == 0) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 1;
	geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async (_data_->self, geary_imap_engine_abstract_list_email_replay_remote_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->fetches_avoided = geary_imap_engine_abstract_list_email_remove_fulfilled_uids_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_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->fetches_avoided > 0) {
		geary_imap_engine_abstract_list_email_total_fetches_avoided = geary_imap_engine_abstract_list_email_total_fetches_avoided + _data_->fetches_avoided;
		_data_->_tmp3_ = _data_->self->owner;
		_data_->_tmp4_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp3_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
		_data_->_tmp5_ = _data_->_tmp4_;
		g_debug ("imap-engine-abstract-list-email.vala:158: [%s] %d previously-fulfilled" \
" fetches avoided in list operation, %d total", _data_->_tmp5_, _data_->fetches_avoided, geary_imap_engine_abstract_list_email_total_fetches_avoided);
		_g_free0 (_data_->_tmp5_);
		_data_->_tmp6_ = _data_->self->priv->unfulfilled;
		_data_->_tmp7_ = gee_abstract_map_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp6_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
		_data_->_tmp8_ = _data_->_tmp7_;
		if (_data_->_tmp8_ == 0) {
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp9_ = gee_hash_multi_map_new (GEARY_EMAIL_TYPE_FIELD, NULL, NULL, GEARY_IMAP_TYPE_UID, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->reverse_unfulfilled = _data_->_tmp9_;
	{
		_data_->_tmp10_ = _data_->self->priv->unfulfilled;
		_data_->_tmp11_ = gee_abstract_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp14_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp13_, GEE_TYPE_ITERABLE, GeeIterable));
		_data_->_tmp15_ = _data_->_tmp14_;
		_g_object_unref0 (_data_->_tmp13_);
		_data_->_uid_it = _data_->_tmp15_;
		while (TRUE) {
			_data_->_tmp16_ = _data_->_uid_it;
			if (!gee_iterator_next (_data_->_tmp16_)) {
				break;
			}
			_data_->_tmp17_ = _data_->_uid_it;
			_data_->_tmp18_ = gee_iterator_get (_data_->_tmp17_);
			_data_->uid = (GearyImapUID*) _data_->_tmp18_;
			_data_->_tmp19_ = _data_->reverse_unfulfilled;
			_data_->_tmp20_ = _data_->self->priv->unfulfilled;
			_data_->_tmp21_ = _data_->uid;
			_data_->_tmp22_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp20_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _data_->_tmp21_);
			_data_->_tmp23_ = _data_->uid;
			gee_multi_map_set (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp19_, GEE_TYPE_MULTI_MAP, GeeMultiMap), (gpointer) ((gintptr) _data_->_tmp22_), _data_->_tmp23_);
			_g_object_unref0 (_data_->uid);
		}
		_g_object_unref0 (_data_->_uid_it);
	}
	_data_->_tmp24_ = geary_nonblocking_batch_new ();
	_data_->batch = _data_->_tmp24_;
	{
		_data_->_tmp25_ = _data_->reverse_unfulfilled;
		_data_->_tmp26_ = gee_multi_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp25_, GEE_TYPE_MULTI_MAP, GeeMultiMap));
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp28_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp27_, GEE_TYPE_ITERABLE, GeeIterable));
		_data_->_tmp29_ = _data_->_tmp28_;
		_g_object_unref0 (_data_->_tmp27_);
		_data_->_unfulfilled_fields_it = _data_->_tmp29_;
		while (TRUE) {
			_data_->_tmp30_ = _data_->_unfulfilled_fields_it;
			if (!gee_iterator_next (_data_->_tmp30_)) {
				break;
			}
			_data_->_tmp31_ = _data_->_unfulfilled_fields_it;
			_data_->_tmp32_ = gee_iterator_get (_data_->_tmp31_);
			_data_->unfulfilled_fields = (GearyEmailField) ((gintptr) _data_->_tmp32_);
			_data_->_tmp33_ = _data_->reverse_unfulfilled;
			_data_->_tmp34_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp33_, GEE_TYPE_MULTI_MAP, GeeMultiMap), (gpointer) ((gintptr) _data_->unfulfilled_fields));
			_data_->unfulfilled_uids = _data_->_tmp34_;
			_data_->_tmp35_ = _data_->unfulfilled_uids;
			_data_->_tmp36_ = gee_collection_get_size (_data_->_tmp35_);
			_data_->_tmp37_ = _data_->_tmp36_;
			if (_data_->_tmp37_ == 0) {
				_g_object_unref0 (_data_->unfulfilled_uids);
				continue;
			}
			_data_->_tmp38_ = _data_->unfulfilled_uids;
			_data_->_tmp39_ = geary_imap_message_set_uid_sparse (_data_->_tmp38_);
			_data_->msg_sets = _data_->_tmp39_;
			{
				_data_->_tmp40_ = _data_->msg_sets;
				_data_->_msg_set_list = _data_->_tmp40_;
				_data_->_tmp41_ = _data_->_msg_set_list;
				_data_->_tmp42_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp41_, GEE_TYPE_COLLECTION, GeeCollection));
				_data_->_tmp43_ = _data_->_tmp42_;
				_data_->_msg_set_size = _data_->_tmp43_;
				_data_->_msg_set_index = -1;
				while (TRUE) {
					_data_->_msg_set_index = _data_->_msg_set_index + 1;
					_data_->_tmp44_ = _data_->_msg_set_index;
					_data_->_tmp45_ = _data_->_msg_set_size;
					if (!(_data_->_tmp44_ < _data_->_tmp45_)) {
						break;
					}
					_data_->_tmp46_ = _data_->_msg_set_list;
					_data_->_tmp47_ = gee_list_get (_data_->_tmp46_, _data_->_msg_set_index);
					_data_->msg_set = (GearyImapMessageSet*) _data_->_tmp47_;
					_data_->_tmp48_ = _data_->self->owner;
					_data_->_tmp49_ = geary_imap_engine_minimal_folder_get_local_folder (_data_->_tmp48_);
					_data_->_tmp50_ = _data_->_tmp49_;
					_data_->_tmp51_ = _data_->msg_set;
					_data_->_tmp52_ = _data_->self->owner;
					_data_->_tmp53_ = geary_imap_engine_minimal_folder_get_harvester (_data_->_tmp52_);
					_data_->_tmp54_ = _data_->_tmp53_;
					_data_->_tmp55_ = geary_imap_engine_abstract_list_email_remote_batch_operation_new (_data_->remote, _data_->_tmp50_, _data_->_tmp51_, _data_->unfulfilled_fields, _data_->self->required_fields, !geary_folder_list_flags_is_any_set (_data_->self->flags, GEARY_FOLDER_LIST_FLAGS_NO_UNREAD_UPDATE), _data_->_tmp54_);
					_data_->remote_op = _data_->_tmp55_;
					_data_->_tmp56_ = _data_->batch;
					_data_->_tmp57_ = _data_->remote_op;
					geary_nonblocking_batch_add (_data_->_tmp56_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp57_, GEARY_NONBLOCKING_TYPE_BATCH_OPERATION, GearyNonblockingBatchOperation));
					_g_object_unref0 (_data_->remote_op);
					_g_object_unref0 (_data_->msg_set);
				}
			}
			_g_object_unref0 (_data_->msg_sets);
			_g_object_unref0 (_data_->unfulfilled_uids);
		}
		_g_object_unref0 (_data_->_unfulfilled_fields_it);
	}
	_data_->_tmp58_ = _data_->batch;
	_data_->_tmp59_ = _data_->self->cancellable;
	_data_->_state_ = 2;
	geary_nonblocking_batch_execute_all_async (_data_->_tmp58_, _data_->_tmp59_, geary_imap_engine_abstract_list_email_replay_remote_async_ready, _data_);
	return FALSE;
	_state_2:
	geary_nonblocking_batch_execute_all_finish (_data_->_tmp58_, _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_->batch);
		_g_object_unref0 (_data_->reverse_unfulfilled);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp60_ = _data_->batch;
	geary_nonblocking_batch_throw_first_exception (_data_->_tmp60_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->batch);
		_g_object_unref0 (_data_->reverse_unfulfilled);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp61_ = gee_array_list_new (GEARY_TYPE_EMAIL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_data_->result_list = _data_->_tmp61_;
	_data_->_tmp62_ = gee_hash_set_new (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->created_ids = _data_->_tmp62_;
	{
		_data_->_tmp63_ = _data_->batch;
		_data_->_tmp64_ = geary_nonblocking_batch_get_ids (_data_->_tmp63_);
		_data_->_tmp65_ = _data_->_tmp64_;
		_data_->_tmp66_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp65_, GEE_TYPE_ITERABLE, GeeIterable));
		_data_->_tmp67_ = _data_->_tmp66_;
		_g_object_unref0 (_data_->_tmp65_);
		_data_->_batch_id_it = _data_->_tmp67_;
		while (TRUE) {
			_data_->_tmp68_ = _data_->_batch_id_it;
			if (!gee_iterator_next (_data_->_tmp68_)) {
				break;
			}
			_data_->_tmp69_ = _data_->_batch_id_it;
			_data_->_tmp70_ = gee_iterator_get (_data_->_tmp69_);
			_data_->batch_id = (gint) ((gintptr) _data_->_tmp70_);
			_data_->_tmp72_ = _data_->batch;
			_data_->_tmp73_ = geary_nonblocking_batch_get_result (_data_->_tmp72_, _data_->batch_id, &_data_->_inner_error0_);
			_data_->_tmp71_ = _data_->_tmp73_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->_batch_id_it);
				_g_object_unref0 (_data_->created_ids);
				_g_object_unref0 (_data_->result_list);
				_g_object_unref0 (_data_->batch);
				_g_object_unref0 (_data_->reverse_unfulfilled);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp74_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp71_, GEE_TYPE_LIST, GeeList));
			_data_->list = _data_->_tmp74_;
			_data_->_tmp76_ = _data_->list;
			if (_data_->_tmp76_ != NULL) {
				_data_->_tmp77_ = _data_->list;
				_data_->_tmp78_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp77_, GEE_TYPE_COLLECTION, GeeCollection));
				_data_->_tmp79_ = _data_->_tmp78_;
				_data_->_tmp75_ = _data_->_tmp79_ > 0;
			} else {
				_data_->_tmp75_ = FALSE;
			}
			if (_data_->_tmp75_) {
				_data_->_tmp80_ = _data_->result_list;
				_data_->_tmp81_ = _data_->list;
				gee_array_list_add_all (_data_->_tmp80_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp81_, GEE_TYPE_COLLECTION, GeeCollection));
				_data_->_tmp82_ = _data_->batch;
				_data_->_tmp83_ = geary_nonblocking_batch_get_operation (_data_->_tmp82_, _data_->batch_id);
				_data_->op = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp83_, GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION, GearyImapEngineAbstractListEmailRemoteBatchOperation);
				_data_->_tmp84_ = _data_->created_ids;
				_data_->_tmp85_ = _data_->op;
				_data_->_tmp86_ = _data_->_tmp85_->created_ids;
				gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp84_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp86_, GEE_TYPE_COLLECTION, GeeCollection));
				_g_object_unref0 (_data_->op);
			}
			_g_object_unref0 (_data_->list);
			_g_object_unref0 (_data_->_tmp71_);
		}
		_g_object_unref0 (_data_->_batch_id_it);
	}
	_data_->_tmp87_ = _data_->result_list;
	_data_->_tmp88_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp87_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
	_data_->_tmp89_ = _data_->_tmp88_;
	if (_data_->_tmp89_ > 0) {
		_data_->_tmp90_ = _data_->self->accumulator;
		_data_->_tmp91_ = _data_->result_list;
		gee_collection_add_all (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp90_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp91_, GEE_TYPE_COLLECTION, GeeCollection));
	}
	_data_->_tmp92_ = _data_->created_ids;
	_data_->_tmp93_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp92_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
	_data_->_tmp94_ = _data_->_tmp93_;
	if (_data_->_tmp94_ > 0) {
		_data_->_tmp95_ = _data_->self->owner;
		_data_->_tmp96_ = _data_->created_ids;
		geary_imap_engine_minimal_folder_replay_notify_email_inserted (_data_->_tmp95_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp96_, GEE_TYPE_COLLECTION, GeeCollection));
		_data_->_tmp97_ = _data_->self->owner;
		_data_->_tmp98_ = _data_->created_ids;
		geary_imap_engine_minimal_folder_replay_notify_email_locally_inserted (_data_->_tmp97_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp98_, GEE_TYPE_COLLECTION, GeeCollection));
	}
	_g_object_unref0 (_data_->created_ids);
	_g_object_unref0 (_data_->result_list);
	_g_object_unref0 (_data_->batch);
	_g_object_unref0 (_data_->reverse_unfulfilled);
	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
geary_imap_engine_abstract_list_email_expand_vector_async_data_free (gpointer _data)
{
	GearyImapEngineAbstractListEmailExpandVectorAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->remote);
	_g_object_unref0 (_data_->initial_uid);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyImapEngineAbstractListEmailExpandVectorAsyncData, _data_);
}

void
geary_imap_engine_abstract_list_email_expand_vector_async (GearyImapEngineAbstractListEmail* self,
                                                           GearyImapFolderSession* remote,
                                                           GearyImapUID* initial_uid,
                                                           gint count,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	GearyImapEngineAbstractListEmailExpandVectorAsyncData* _data_;
	GearyImapEngineAbstractListEmail* _tmp0_;
	GearyImapFolderSession* _tmp1_;
	GearyImapUID* _tmp2_;
	g_return_if_fail (GEARY_IMAP_ENGINE_IS_ABSTRACT_LIST_EMAIL (self));
	g_return_if_fail (GEARY_IMAP_IS_FOLDER_SESSION (remote));
	g_return_if_fail ((initial_uid == NULL) || GEARY_IMAP_IS_UID (initial_uid));
	_data_ = g_slice_new0 (GearyImapEngineAbstractListEmailExpandVectorAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_imap_engine_abstract_list_email_expand_vector_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (remote);
	_g_object_unref0 (_data_->remote);
	_data_->remote = _tmp1_;
	_tmp2_ = _g_object_ref0 (initial_uid);
	_g_object_unref0 (_data_->initial_uid);
	_data_->initial_uid = _tmp2_;
	_data_->count = count;
	geary_imap_engine_abstract_list_email_expand_vector_async_co (_data_);
}

GeeSet*
geary_imap_engine_abstract_list_email_expand_vector_finish (GearyImapEngineAbstractListEmail* self,
                                                            GAsyncResult* _res_,
                                                            GError** error)
{
	GeeSet* result;
	GearyImapEngineAbstractListEmailExpandVectorAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

/**
     * Expands the owning folder's vector.
     *
     * Lists on the remote messages needed to fulfill ImapDB's
     * requirements from `initial_uid` (inclusive) forward to the
     * start of the vector if the OLDEST_TO_NEWEST flag is set, else
     * from `initial_uid` (inclusive) back at most by `count` number
     * of messages. If `initial_uid` is null, the start or end of the
     * vector is used, respectively.
     *
     * The returned UIDs are those added to the vector, which can then
     * be examined and added to the messages to be fulfilled if
     * needed.
     */
static void
geary_imap_engine_abstract_list_email_expand_vector_async_ready (GObject* source_object,
                                                                 GAsyncResult* _res_,
                                                                 gpointer _user_data_)
{
	GearyImapEngineAbstractListEmailExpandVectorAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_abstract_list_email_expand_vector_async_co (_data_);
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static gboolean
geary_imap_engine_abstract_list_email_expand_vector_async_co (GearyImapEngineAbstractListEmailExpandVectorAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->owner;
	_data_->_tmp1_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp0_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
	_data_->_tmp2_ = _data_->_tmp1_;
	g_debug ("imap-engine-abstract-list-email.vala:240: %s: expanding vector...", _data_->_tmp2_);
	_g_free0 (_data_->_tmp2_);
	_data_->_tmp3_ = geary_imap_folder_session_get_folder (_data_->remote);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = geary_imap_folder_get_properties (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = geary_folder_properties_get_email_total (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp6_, GEARY_TYPE_FOLDER_PROPERTIES, GearyFolderProperties));
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->remote_count = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->self->owner;
	_data_->_tmp10_ = geary_imap_engine_minimal_folder_get_local_folder (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = _data_->self->cancellable;
	_data_->_state_ = 1;
	geary_imap_db_folder_get_email_count_async (_data_->_tmp11_, GEARY_IMAP_DB_FOLDER_LIST_FLAGS_INCLUDE_MARKED_FOR_REMOVE, _data_->_tmp12_, geary_imap_engine_abstract_list_email_expand_vector_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->local_count = geary_imap_db_folder_get_email_count_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->local_count >= _data_->remote_count) {
		_data_->result = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->vector_start = (gint64) ((_data_->remote_count - _data_->local_count) + 1);
	_data_->low_pos = (gint64) -1;
	_data_->high_pos = (gint64) -1;
	_data_->initial_pos = (gint64) -1;
	if (_data_->initial_uid != NULL) {
		_data_->_tmp13_ = geary_imap_message_set_new_uid (_data_->initial_uid);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp15_ = _data_->self->cancellable;
		_data_->_state_ = 2;
		geary_imap_folder_session_uid_to_position_async (_data_->remote, _data_->_tmp14_, _data_->_tmp15_, geary_imap_engine_abstract_list_email_expand_vector_async_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp16_ = geary_imap_folder_session_uid_to_position_finish (_data_->remote, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_g_object_unref0 (_data_->_tmp14_);
		_data_->map = _data_->_tmp17_;
		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_->_tmp18_ = _data_->map;
		_data_->_tmp19_ = gee_map_get (_data_->_tmp18_, _data_->initial_uid);
		_data_->pos = (GearyImapSequenceNumber*) _data_->_tmp19_;
		_data_->_tmp20_ = _data_->pos;
		if (_data_->_tmp20_ != NULL) {
			_data_->_tmp21_ = _data_->pos;
			_data_->_tmp22_ = geary_message_data_int64_message_data_get_value (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp21_, GEARY_MESSAGE_DATA_TYPE_INT64_MESSAGE_DATA, GearyMessageDataInt64MessageData));
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->initial_pos = _data_->_tmp23_;
		}
		_g_object_unref0 (_data_->pos);
		_g_object_unref0 (_data_->map);
	}
	if (geary_folder_list_flags_is_oldest_to_newest (_data_->self->flags)) {
		_data_->low_pos = GEARY_IMAP_SEQUENCE_NUMBER_MIN;
		if (_data_->initial_pos > GEARY_IMAP_SEQUENCE_NUMBER_MIN) {
			_data_->low_pos = _data_->initial_pos;
		}
		_data_->high_pos = _data_->vector_start - 1;
	} else {
		if (_data_->initial_pos <= GEARY_IMAP_SEQUENCE_NUMBER_MIN) {
			_data_->high_pos = (gint64) _data_->remote_count;
			_data_->low_pos = geary_numeric_int64_floor ((_data_->high_pos - _data_->count) + 1, GEARY_IMAP_SEQUENCE_NUMBER_MIN);
		} else {
			_data_->high_pos = geary_numeric_int64_floor (_data_->initial_pos, _data_->vector_start - 1);
			_data_->low_pos = geary_numeric_int64_floor (_data_->initial_pos - (_data_->count - 1), GEARY_IMAP_SEQUENCE_NUMBER_MIN);
		}
	}
	if (_data_->low_pos > _data_->high_pos) {
		_data_->_tmp24_ = _data_->self->owner;
		_data_->_tmp25_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp24_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
		_data_->_tmp26_ = _data_->_tmp25_;
		_data_->_tmp27_ = g_strdup_printf ("%" G_GINT64_FORMAT, _data_->low_pos);
		_data_->_tmp28_ = _data_->_tmp27_;
		_data_->_tmp29_ = g_strdup_printf ("%" G_GINT64_FORMAT, _data_->high_pos);
		_data_->_tmp30_ = _data_->_tmp29_;
		g_debug ("imap-engine-abstract-list-email.vala:297: %s: Aborting vector expansio" \
"n, low_pos=%s > high_pos=%s", _data_->_tmp26_, _data_->_tmp28_, _data_->_tmp30_);
		_g_free0 (_data_->_tmp30_);
		_g_free0 (_data_->_tmp28_);
		_g_free0 (_data_->_tmp26_);
		_data_->result = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp31_ = geary_imap_sequence_number_new (_data_->low_pos);
	_data_->_tmp32_ = _data_->_tmp31_;
	_data_->_tmp33_ = geary_imap_sequence_number_new (_data_->high_pos);
	_data_->_tmp34_ = _data_->_tmp33_;
	_data_->_tmp35_ = geary_imap_message_set_new_range_by_first_last (_data_->_tmp32_, _data_->_tmp34_);
	_data_->_tmp36_ = _data_->_tmp35_;
	_g_object_unref0 (_data_->_tmp34_);
	_g_object_unref0 (_data_->_tmp32_);
	_data_->msg_set = _data_->_tmp36_;
	_data_->actual_count = (_data_->high_pos - _data_->low_pos) + 1;
	if (_data_->initial_uid != NULL) {
		_data_->_tmp38_ = geary_message_data_abstract_message_data_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->initial_uid, GEARY_MESSAGE_DATA_TYPE_ABSTRACT_MESSAGE_DATA, GearyMessageDataAbstractMessageData));
		_g_free0 (_data_->_tmp37_);
		_data_->_tmp37_ = _data_->_tmp38_;
	} else {
		_data_->_tmp39_ = g_strdup ("(null)");
		_g_free0 (_data_->_tmp37_);
		_data_->_tmp37_ = _data_->_tmp39_;
	}
	_data_->_tmp40_ = _data_->self->owner;
	_data_->_tmp41_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp40_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
	_data_->_tmp42_ = _data_->_tmp41_;
	_data_->_tmp43_ = _data_->msg_set;
	_data_->_tmp44_ = geary_imap_message_set_to_string (_data_->_tmp43_);
	_data_->_tmp45_ = _data_->_tmp44_;
	_data_->_tmp46_ = g_strdup_printf ("%" G_GINT64_FORMAT, _data_->actual_count);
	_data_->_tmp47_ = _data_->_tmp46_;
	_data_->_tmp48_ = bool_to_string (geary_folder_list_flags_is_oldest_to_newest (_data_->self->flags));
	_data_->_tmp49_ = _data_->_tmp48_;
	g_debug ("imap-engine-abstract-list-email.vala:308: %s: Performing vector expans" \
"ion using %s for initial_uid=%s count=%d actual_count=%s local_count=%" \
"d remote_count=%d oldest_to_newest=%s", _data_->_tmp42_, _data_->_tmp45_, _data_->_tmp37_, _data_->count, _data_->_tmp47_, _data_->local_count, _data_->remote_count, _data_->_tmp49_);
	_g_free0 (_data_->_tmp49_);
	_g_free0 (_data_->_tmp47_);
	_g_free0 (_data_->_tmp45_);
	_g_free0 (_data_->_tmp42_);
	_data_->_tmp50_ = _data_->msg_set;
	_data_->_tmp51_ = _data_->self->cancellable;
	_data_->_state_ = 3;
	geary_imap_folder_session_list_email_async (_data_->remote, _data_->_tmp50_, GEARY_EMAIL_FIELD_NONE, _data_->_tmp51_, geary_imap_engine_abstract_list_email_expand_vector_async_ready, _data_);
	return FALSE;
	_state_3:
	_data_->_tmp52_ = geary_imap_folder_session_list_email_finish (_data_->remote, _data_->_res_, &_data_->_inner_error0_);
	_data_->list = _data_->_tmp52_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->_tmp37_);
		_g_object_unref0 (_data_->msg_set);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp53_ = gee_hash_set_new (GEARY_IMAP_TYPE_UID, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	_data_->uids = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp53_, GEE_TYPE_SET, GeeSet);
	_data_->_tmp54_ = _data_->list;
	if (_data_->_tmp54_ != NULL) {
		{
			_data_->_tmp55_ = _data_->list;
			_data_->_email_list = _data_->_tmp55_;
			_data_->_tmp56_ = _data_->_email_list;
			_data_->_tmp57_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp56_, GEE_TYPE_COLLECTION, GeeCollection));
			_data_->_tmp58_ = _data_->_tmp57_;
			_data_->_email_size = _data_->_tmp58_;
			_data_->_email_index = -1;
			while (TRUE) {
				_data_->_email_index = _data_->_email_index + 1;
				_data_->_tmp59_ = _data_->_email_index;
				_data_->_tmp60_ = _data_->_email_size;
				if (!(_data_->_tmp59_ < _data_->_tmp60_)) {
					break;
				}
				_data_->_tmp61_ = _data_->_email_list;
				_data_->_tmp62_ = gee_list_get (_data_->_tmp61_, _data_->_email_index);
				_data_->email = (GearyEmail*) _data_->_tmp62_;
				_data_->_tmp63_ = _data_->uids;
				_data_->_tmp64_ = _data_->email;
				_data_->_tmp65_ = geary_email_get_id (_data_->_tmp64_);
				_data_->_tmp66_ = _data_->_tmp65_;
				_data_->_tmp67_ = geary_imap_db_email_identifier_get_uid (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp66_, GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER, GearyImapDBEmailIdentifier));
				_data_->_tmp68_ = _data_->_tmp67_;
				gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp63_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp68_);
				_g_object_unref0 (_data_->email);
			}
		}
		_data_->_tmp69_ = _data_->self->owner;
		_data_->_tmp70_ = geary_imap_engine_minimal_folder_get_local_folder (_data_->_tmp69_);
		_data_->_tmp71_ = _data_->_tmp70_;
		_data_->_tmp72_ = _data_->uids;
		_data_->_tmp73_ = _data_->self->cancellable;
		_data_->_state_ = 4;
		geary_imap_db_folder_get_ids_async (_data_->_tmp71_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp72_, GEE_TYPE_COLLECTION, GeeCollection), GEARY_IMAP_DB_FOLDER_LIST_FLAGS_INCLUDE_MARKED_FOR_REMOVE, _data_->_tmp73_, geary_imap_engine_abstract_list_email_expand_vector_async_ready, _data_);
		return FALSE;
		_state_4:
		_data_->_tmp74_ = geary_imap_db_folder_get_ids_finish (_data_->_tmp71_, _data_->_res_, &_data_->_inner_error0_);
		_data_->ids = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp74_, GEE_TYPE_COLLECTION, GeeCollection);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->uids);
			_g_object_unref0 (_data_->list);
			_g_free0 (_data_->_tmp37_);
			_g_object_unref0 (_data_->msg_set);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp76_ = _data_->ids;
		if (_data_->_tmp76_ != NULL) {
			_data_->_tmp77_ = _data_->ids;
			_data_->_tmp78_ = gee_collection_get_size (_data_->_tmp77_);
			_data_->_tmp79_ = _data_->_tmp78_;
			_data_->_tmp75_ = _data_->_tmp79_ > 0;
		} else {
			_data_->_tmp75_ = FALSE;
		}
		if (_data_->_tmp75_) {
			{
				_data_->_tmp80_ = _data_->ids;
				_data_->_tmp81_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp80_, GEE_TYPE_ITERABLE, GeeIterable));
				_data_->_id_it = _data_->_tmp81_;
				while (TRUE) {
					_data_->_tmp82_ = _data_->_id_it;
					if (!gee_iterator_next (_data_->_tmp82_)) {
						break;
					}
					_data_->_tmp83_ = _data_->_id_it;
					_data_->_tmp84_ = gee_iterator_get (_data_->_tmp83_);
					_data_->id = (GearyImapDBEmailIdentifier*) _data_->_tmp84_;
					_data_->_tmp85_ = _data_->id;
					_vala_assert (geary_imap_db_email_identifier_has_uid (_data_->_tmp85_), "id.has_uid()");
					_data_->_tmp86_ = _data_->uids;
					_data_->_tmp87_ = _data_->id;
					_data_->_tmp88_ = geary_imap_db_email_identifier_get_uid (_data_->_tmp87_);
					_data_->_tmp89_ = _data_->_tmp88_;
					gee_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp86_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp89_);
					_g_object_unref0 (_data_->id);
				}
				_g_object_unref0 (_data_->_id_it);
			}
		}
		_data_->_tmp90_ = _data_->uids;
		geary_imap_engine_abstract_list_email_add_many_unfulfilled_fields (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp90_, GEE_TYPE_COLLECTION, GeeCollection), GEARY_IMAP_DB_FOLDER_REQUIRED_FIELDS);
		_g_object_unref0 (_data_->ids);
	}
	_data_->_tmp92_ = _data_->uids;
	if (_data_->_tmp92_ != NULL) {
		_data_->_tmp93_ = _data_->uids;
		_data_->_tmp94_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp93_, GEE_TYPE_COLLECTION, GeeCollection));
		_data_->_tmp95_ = _data_->_tmp94_;
		_data_->_tmp91_ = _data_->_tmp95_;
	} else {
		_data_->_tmp91_ = 0;
	}
	_data_->_tmp96_ = _data_->self->owner;
	_data_->_tmp97_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp96_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
	_data_->_tmp98_ = _data_->_tmp97_;
	g_debug ("imap-engine-abstract-list-email.vala:338: %s: Vector expansion complet" \
"ed (%d new email)", _data_->_tmp98_, _data_->_tmp91_);
	_g_free0 (_data_->_tmp98_);
	_data_->_tmp101_ = _data_->uids;
	if (_data_->_tmp101_ != NULL) {
		_data_->_tmp102_ = _data_->uids;
		_data_->_tmp103_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp102_, GEE_TYPE_COLLECTION, GeeCollection));
		_data_->_tmp104_ = _data_->_tmp103_;
		_data_->_tmp100_ = _data_->_tmp104_ > 0;
	} else {
		_data_->_tmp100_ = FALSE;
	}
	if (_data_->_tmp100_) {
		_data_->_tmp105_ = _data_->uids;
		_data_->_tmp99_ = _data_->_tmp105_;
	} else {
		_data_->_tmp99_ = NULL;
	}
	_data_->_tmp106_ = _g_object_ref0 (_data_->_tmp99_);
	_data_->result = _data_->_tmp106_;
	_g_object_unref0 (_data_->uids);
	_g_object_unref0 (_data_->list);
	_g_free0 (_data_->_tmp37_);
	_g_object_unref0 (_data_->msg_set);
	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
geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_data_free (gpointer _data)
{
	GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData, _data_);
}

static void
geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async (GearyImapEngineAbstractListEmail* self,
                                                                   GAsyncReadyCallback _callback_,
                                                                   gpointer _user_data_)
{
	GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData* _data_;
	GearyImapEngineAbstractListEmail* _tmp0_;
	g_return_if_fail (GEARY_IMAP_ENGINE_IS_ABSTRACT_LIST_EMAIL (self));
	_data_ = g_slice_new0 (GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_co (_data_);
}

static gint
geary_imap_engine_abstract_list_email_remove_fulfilled_uids_finish (GearyImapEngineAbstractListEmail* self,
                                                                    GAsyncResult* _res_,
                                                                    GError** error)
{
	gint result;
	GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_ready (GObject* source_object,
                                                                         GAsyncResult* _res_,
                                                                         gpointer _user_data_)
{
	GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_co (_data_);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_co (GearyImapEngineAbstractListEmailRemoveFulfilledUidsAsyncData* _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 (geary_folder_list_flags_is_force_update (_data_->self->flags)) {
		_data_->result = 0;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->list_flags = geary_imap_db_folder_list_flags_from_folder_flags (_data_->self->flags);
	_data_->_tmp0_ = _data_->self->owner;
	_data_->_tmp1_ = geary_imap_engine_minimal_folder_get_local_folder (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->self->priv->unfulfilled;
	_data_->_tmp4_ = gee_abstract_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp3_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->self->cancellable;
	_data_->_state_ = 1;
	geary_imap_db_folder_get_ids_async (_data_->_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp6_, GEE_TYPE_COLLECTION, GeeCollection), _data_->list_flags, _data_->_tmp7_, geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = geary_imap_db_folder_get_ids_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_object_unref0 (_data_->_tmp6_);
	_data_->unfulfilled_ids = _data_->_tmp9_;
	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_->_tmp11_ = _data_->unfulfilled_ids;
	if (_data_->_tmp11_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp12_ = _data_->unfulfilled_ids;
		_data_->_tmp13_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp12_, GEE_TYPE_COLLECTION, GeeCollection));
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp10_ = _data_->_tmp14_ == 0;
	}
	if (_data_->_tmp10_) {
		_data_->result = 0;
		_g_object_unref0 (_data_->unfulfilled_ids);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = _data_->self->owner;
	_data_->_tmp16_ = geary_imap_engine_minimal_folder_get_local_folder (_data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	_data_->_tmp18_ = _data_->unfulfilled_ids;
	_data_->_tmp19_ = _data_->self->cancellable;
	_data_->_state_ = 2;
	geary_imap_db_folder_list_email_fields_by_id_async (_data_->_tmp17_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp18_, GEE_TYPE_COLLECTION, GeeCollection), _data_->list_flags, _data_->_tmp19_, geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp20_ = geary_imap_db_folder_list_email_fields_by_id_finish (_data_->_tmp17_, _data_->_res_, &_data_->_inner_error0_);
	_data_->local_fields = _data_->_tmp20_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->unfulfilled_ids);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp22_ = _data_->local_fields;
	if (_data_->_tmp22_ == NULL) {
		_data_->_tmp21_ = TRUE;
	} else {
		_data_->_tmp23_ = _data_->local_fields;
		_data_->_tmp24_ = gee_map_get_size (_data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp21_ = _data_->_tmp25_ == 0;
	}
	if (_data_->_tmp21_) {
		_data_->result = 0;
		_g_object_unref0 (_data_->local_fields);
		_g_object_unref0 (_data_->unfulfilled_ids);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->fetch_avoided = 0;
	{
		_data_->_tmp26_ = _data_->local_fields;
		_data_->_tmp27_ = gee_map_get_keys (_data_->_tmp26_);
		_data_->_tmp28_ = _data_->_tmp27_;
		_data_->_tmp29_ = _data_->_tmp28_;
		_data_->_tmp30_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp29_, GEE_TYPE_ITERABLE, GeeIterable));
		_data_->_tmp31_ = _data_->_tmp30_;
		_g_object_unref0 (_data_->_tmp29_);
		_data_->_id_it = _data_->_tmp31_;
		while (TRUE) {
			_data_->_tmp32_ = _data_->_id_it;
			if (!gee_iterator_next (_data_->_tmp32_)) {
				break;
			}
			_data_->_tmp33_ = _data_->_id_it;
			_data_->_tmp34_ = gee_iterator_get (_data_->_tmp33_);
			_data_->id = (GearyImapDBEmailIdentifier*) _data_->_tmp34_;
			_data_->_tmp35_ = _data_->local_fields;
			_data_->_tmp36_ = _data_->id;
			_data_->_tmp37_ = gee_map_get (_data_->_tmp35_, _data_->_tmp36_);
			if (!geary_email_field_fulfills ((GearyEmailField) ((gintptr) _data_->_tmp37_), _data_->self->required_fields)) {
				_g_object_unref0 (_data_->id);
				continue;
			}
			{
				_data_->_tmp38_ = _data_->self->owner;
				_data_->_tmp39_ = geary_imap_engine_minimal_folder_get_local_folder (_data_->_tmp38_);
				_data_->_tmp40_ = _data_->_tmp39_;
				_data_->_tmp41_ = _data_->id;
				_data_->_tmp42_ = _data_->self->cancellable;
				_data_->_state_ = 3;
				geary_imap_db_folder_fetch_email_async (_data_->_tmp40_, _data_->_tmp41_, _data_->self->required_fields, _data_->list_flags, _data_->_tmp42_, geary_imap_engine_abstract_list_email_remove_fulfilled_uids_async_ready, _data_);
				return FALSE;
				_state_3:
				_data_->_tmp43_ = geary_imap_db_folder_fetch_email_finish (_data_->_tmp40_, _data_->_res_, &_data_->_inner_error0_);
				_data_->email = _data_->_tmp43_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_data_->_tmp44_ = _data_->self->accumulator;
				_data_->_tmp45_ = _data_->email;
				gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp44_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp45_);
				_g_object_unref0 (_data_->email);
			}
			goto __finally0;
			__catch0_g_error:
			{
				_data_->err = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				_data_->_tmp46_ = _data_->err;
				if (g_error_matches (_data_->_tmp46_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
					_data_->_tmp47_ = _data_->err;
					_data_->_tmp48_ = _g_error_copy0 (_data_->_tmp47_);
					_data_->_inner_error0_ = _data_->_tmp48_;
					_g_error_free0 (_data_->err);
					goto __finally0;
				}
				_g_error_free0 (_data_->err);
				_g_object_unref0 (_data_->id);
				continue;
			}
			__finally0:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->id);
				_g_object_unref0 (_data_->_id_it);
				_g_object_unref0 (_data_->local_fields);
				_g_object_unref0 (_data_->unfulfilled_ids);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->_tmp49_ = _data_->self->priv->unfulfilled;
			_data_->_tmp50_ = _data_->id;
			_data_->_tmp51_ = geary_imap_db_email_identifier_get_uid (_data_->_tmp50_);
			_data_->_tmp52_ = _data_->_tmp51_;
			gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp49_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _data_->_tmp52_, NULL);
			_data_->_tmp53_ = _data_->fetch_avoided;
			_data_->fetch_avoided = _data_->_tmp53_ + 1;
			_g_object_unref0 (_data_->id);
		}
		_g_object_unref0 (_data_->_id_it);
	}
	_data_->result = _data_->fetch_avoided;
	_g_object_unref0 (_data_->local_fields);
	_g_object_unref0 (_data_->unfulfilled_ids);
	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*
geary_imap_engine_abstract_list_email_real_describe_state (GearyImapEngineReplayOperation* base)
{
	GearyImapEngineAbstractListEmail * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL, GearyImapEngineAbstractListEmail);
	_tmp0_ = bool_to_string (geary_folder_list_flags_is_local_only (self->flags));
	_tmp1_ = _tmp0_;
	_tmp2_ = bool_to_string (geary_folder_list_flags_is_force_update (self->flags));
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf ("required_fields=%Xh local_only=%s force_update=%s", (guint) self->required_fields, _tmp1_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	result = _tmp5_;
	return result;
}

static inline gpointer
geary_imap_engine_abstract_list_email_remote_batch_operation_get_instance_private (GearyImapEngineAbstractListEmailRemoteBatchOperation* self)
{
	return G_STRUCT_MEMBER_P (self, GearyImapEngineAbstractListEmailRemoteBatchOperation_private_offset);
}

static GearyImapEngineAbstractListEmailRemoteBatchOperation*
geary_imap_engine_abstract_list_email_remote_batch_operation_construct (GType object_type,
                                                                        GearyImapFolderSession* remote,
                                                                        GearyImapDBFolder* local,
                                                                        GearyImapMessageSet* msg_set,
                                                                        GearyEmailField unfulfilled_fields,
                                                                        GearyEmailField required_fields,
                                                                        gboolean update_unread,
                                                                        GearyContactHarvester* harvester)
{
	GearyImapEngineAbstractListEmailRemoteBatchOperation * self = NULL;
	GearyImapFolderSession* _tmp0_;
	GearyImapDBFolder* _tmp1_;
	GearyImapMessageSet* _tmp2_;
	GearyContactHarvester* _tmp3_;
	g_return_val_if_fail (GEARY_IMAP_IS_FOLDER_SESSION (remote), NULL);
	g_return_val_if_fail (GEARY_IMAP_DB_IS_FOLDER (local), NULL);
	g_return_val_if_fail (GEARY_IMAP_IS_MESSAGE_SET (msg_set), NULL);
	g_return_val_if_fail (GEARY_IS_CONTACT_HARVESTER (harvester), NULL);
	self = (GearyImapEngineAbstractListEmailRemoteBatchOperation*) geary_nonblocking_batch_operation_construct (object_type);
	_tmp0_ = _g_object_ref0 (remote);
	_g_object_unref0 (self->remote);
	self->remote = _tmp0_;
	_tmp1_ = _g_object_ref0 (local);
	_g_object_unref0 (self->local);
	self->local = _tmp1_;
	_tmp2_ = _g_object_ref0 (msg_set);
	_g_object_unref0 (self->msg_set);
	self->msg_set = _tmp2_;
	self->unfulfilled_fields = unfulfilled_fields;
	self->required_fields = required_fields;
	self->update_unread = update_unread;
	_tmp3_ = _g_object_ref0 (harvester);
	_g_object_unref0 (self->priv->harvester);
	self->priv->harvester = _tmp3_;
	return self;
}

static GearyImapEngineAbstractListEmailRemoteBatchOperation*
geary_imap_engine_abstract_list_email_remote_batch_operation_new (GearyImapFolderSession* remote,
                                                                  GearyImapDBFolder* local,
                                                                  GearyImapMessageSet* msg_set,
                                                                  GearyEmailField unfulfilled_fields,
                                                                  GearyEmailField required_fields,
                                                                  gboolean update_unread,
                                                                  GearyContactHarvester* harvester)
{
	return geary_imap_engine_abstract_list_email_remote_batch_operation_construct (GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION, remote, local, msg_set, unfulfilled_fields, required_fields, update_unread, harvester);
}

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

static void
geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async (GearyNonblockingBatchOperation* base,
                                                                                 GCancellable* cancellable,
                                                                                 GAsyncReadyCallback _callback_,
                                                                                 gpointer _user_data_)
{
	GearyImapEngineAbstractListEmailRemoteBatchOperation * self;
	GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData* _data_;
	GearyImapEngineAbstractListEmailRemoteBatchOperation* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION, GearyImapEngineAbstractListEmailRemoteBatchOperation);
	_data_ = g_slice_new0 (GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async_co (_data_);
}

static GObject*
geary_imap_engine_abstract_list_email_remote_batch_operation_execute_finish (GearyNonblockingBatchOperation* base,
                                                                             GAsyncResult* _res_,
                                                                             GError** error)
{
	GObject* result;
	GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData* _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
geary_imap_engine_abstract_list_email_remote_batch_operation_execute_async_ready (GObject* source_object,
                                                                                  GAsyncResult* _res_,
                                                                                  gpointer _user_data_)
{
	GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async_co (_data_);
}

static gboolean
geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async_co (GearyImapEngineAbstractListEmailRemoteBatchOperationExecuteAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->remote;
	_data_->_tmp1_ = _data_->self->msg_set;
	_data_->_state_ = 1;
	geary_imap_folder_session_list_email_async (_data_->_tmp0_, _data_->_tmp1_, _data_->self->unfulfilled_fields, _data_->cancellable, geary_imap_engine_abstract_list_email_remote_batch_operation_execute_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = geary_imap_folder_session_list_email_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
	_data_->list = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = _data_->list;
	if (_data_->_tmp4_ == NULL) {
		_data_->_tmp3_ = TRUE;
	} else {
		_data_->_tmp5_ = _data_->list;
		_data_->_tmp6_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, GEE_TYPE_COLLECTION, GeeCollection));
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp3_ = _data_->_tmp7_ == 0;
	}
	if (_data_->_tmp3_) {
		_data_->result = NULL;
		_g_object_unref0 (_data_->list);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = _data_->self->local;
	_data_->_tmp9_ = _data_->list;
	_data_->_tmp10_ = _data_->self->priv->harvester;
	_data_->_state_ = 2;
	geary_imap_db_folder_create_or_merge_email_async (_data_->_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp9_, GEE_TYPE_COLLECTION, GeeCollection), _data_->self->update_unread, _data_->_tmp10_, _data_->cancellable, geary_imap_engine_abstract_list_email_remote_batch_operation_execute_async_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp11_ = geary_imap_db_folder_create_or_merge_email_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error0_);
	_data_->created_or_merged = _data_->_tmp11_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->list);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->ctr = 0;
		{
			_data_->_tmp12_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp12_) {
					_data_->_tmp13_ = _data_->ctr;
					_data_->ctr = _data_->_tmp13_ + 1;
				}
				_data_->_tmp12_ = FALSE;
				_data_->_tmp14_ = _data_->list;
				_data_->_tmp15_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp14_, GEE_TYPE_COLLECTION, GeeCollection));
				_data_->_tmp16_ = _data_->_tmp15_;
				if (!(_data_->ctr < _data_->_tmp16_)) {
					break;
				}
				_data_->_tmp17_ = _data_->list;
				_data_->_tmp18_ = gee_list_get (_data_->_tmp17_, _data_->ctr);
				_data_->email = (GearyEmail*) _data_->_tmp18_;
				_data_->_tmp19_ = _data_->created_or_merged;
				_data_->_tmp20_ = _data_->email;
				_data_->_tmp21_ = gee_map_get (_data_->_tmp19_, _data_->_tmp20_);
				if ((gboolean) ((gintptr) _data_->_tmp21_)) {
					_data_->_tmp22_ = _data_->self->created_ids;
					_data_->_tmp23_ = _data_->email;
					_data_->_tmp24_ = geary_email_get_id (_data_->_tmp23_);
					_data_->_tmp25_ = _data_->_tmp24_;
					gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp22_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp25_);
				}
				_data_->_tmp26_ = _data_->email;
				_data_->_tmp27_ = geary_email_get_fields (_data_->_tmp26_);
				_data_->_tmp28_ = _data_->_tmp27_;
				if (!geary_email_field_fulfills (_data_->_tmp28_, _data_->self->required_fields)) {
					_data_->_tmp30_ = _data_->self->local;
					_data_->_tmp31_ = _data_->email;
					_data_->_tmp32_ = geary_email_get_id (_data_->_tmp31_);
					_data_->_tmp33_ = _data_->_tmp32_;
					_data_->_state_ = 3;
					geary_imap_db_folder_fetch_email_async (_data_->_tmp30_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp33_, GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER, GearyImapDBEmailIdentifier), _data_->self->required_fields, GEARY_IMAP_DB_FOLDER_LIST_FLAGS_NONE, _data_->cancellable, geary_imap_engine_abstract_list_email_remote_batch_operation_execute_async_ready, _data_);
					return FALSE;
					_state_3:
					_data_->_tmp34_ = geary_imap_db_folder_fetch_email_finish (_data_->_tmp30_, _data_->_res_, &_data_->_inner_error0_);
					_data_->_tmp29_ = _data_->_tmp34_;
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
						_g_object_unref0 (_data_->email);
						_g_object_unref0 (_data_->created_or_merged);
						_g_object_unref0 (_data_->list);
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
					_data_->_tmp35_ = _data_->_tmp29_;
					_data_->_tmp29_ = NULL;
					_g_object_unref0 (_data_->email);
					_data_->email = _data_->_tmp35_;
					_data_->_tmp36_ = _data_->list;
					_data_->_tmp37_ = _data_->email;
					gee_list_set (_data_->_tmp36_, _data_->ctr, _data_->_tmp37_);
					_g_object_unref0 (_data_->_tmp29_);
				}
				_g_object_unref0 (_data_->email);
			}
		}
	}
	_data_->result = G_TYPE_CHECK_INSTANCE_CAST (_data_->list, G_TYPE_OBJECT, GObject);
	_g_object_unref0 (_data_->created_or_merged);
	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
geary_imap_engine_abstract_list_email_remote_batch_operation_class_init (GearyImapEngineAbstractListEmailRemoteBatchOperationClass * klass,
                                                                         gpointer klass_data)
{
	geary_imap_engine_abstract_list_email_remote_batch_operation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GearyImapEngineAbstractListEmailRemoteBatchOperation_private_offset);
	((GearyNonblockingBatchOperationClass *) klass)->execute_async = (void (*) (GearyNonblockingBatchOperation*, GCancellable*, GAsyncReadyCallback, gpointer)) geary_imap_engine_abstract_list_email_remote_batch_operation_real_execute_async;
	((GearyNonblockingBatchOperationClass *) klass)->execute_finish = (GObject* (*) (GearyNonblockingBatchOperation*, GAsyncResult*, GError**)) geary_imap_engine_abstract_list_email_remote_batch_operation_execute_finish;
	G_OBJECT_CLASS (klass)->finalize = geary_imap_engine_abstract_list_email_remote_batch_operation_finalize;
}

static void
geary_imap_engine_abstract_list_email_remote_batch_operation_instance_init (GearyImapEngineAbstractListEmailRemoteBatchOperation * self,
                                                                            gpointer klass)
{
	GeeHashSet* _tmp0_;
	self->priv = geary_imap_engine_abstract_list_email_remote_batch_operation_get_instance_private (self);
	_tmp0_ = gee_hash_set_new (GEARY_TYPE_EMAIL_IDENTIFIER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	self->created_ids = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SET, GeeSet);
}

static void
geary_imap_engine_abstract_list_email_remote_batch_operation_finalize (GObject * obj)
{
	GearyImapEngineAbstractListEmailRemoteBatchOperation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEARY_IMAP_ENGINE_ABSTRACT_LIST_EMAIL_TYPE_REMOTE_BATCH_OPERATION, GearyImapEngineAbstractListEmailRemoteBatchOperation);
	_g_object_unref0 (self->remote);
	_g_object_unref0 (self->local);
	_g_object_unref0 (self->msg_set);
	_g_object_unref0 (self->created_ids);
	_g_object_unref0 (self->priv->harvester);
	G_OBJECT_CLASS (geary_imap_engine_abstract_list_email_remote_batch_operation_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
geary_imap_engine_abstract_list_email_remote_batch_operation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyImapEngineAbstractListEmailRemoteBatchOperationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_imap_engine_abstract_list_email_remote_batch_operation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyImapEngineAbstractListEmailRemoteBatchOperation), 0, (GInstanceInitFunc) geary_imap_engine_abstract_list_email_remote_batch_operation_instance_init, NULL };
	GType geary_imap_engine_abstract_list_email_remote_batch_operation_type_id;
	geary_imap_engine_abstract_list_email_remote_batch_operation_type_id = g_type_register_static (GEARY_NONBLOCKING_TYPE_BATCH_OPERATION, "GearyImapEngineAbstractListEmailRemoteBatchOperation", &g_define_type_info, 0);
	GearyImapEngineAbstractListEmailRemoteBatchOperation_private_offset = g_type_add_instance_private (geary_imap_engine_abstract_list_email_remote_batch_operation_type_id, sizeof (GearyImapEngineAbstractListEmailRemoteBatchOperationPrivate));
	return geary_imap_engine_abstract_list_email_remote_batch_operation_type_id;
}

static GType
geary_imap_engine_abstract_list_email_remote_batch_operation_get_type (void)
{
	static gsize geary_imap_engine_abstract_list_email_remote_batch_operation_type_id__once = 0;
	if (g_once_init_enter (&geary_imap_engine_abstract_list_email_remote_batch_operation_type_id__once)) {
		GType geary_imap_engine_abstract_list_email_remote_batch_operation_type_id;
		geary_imap_engine_abstract_list_email_remote_batch_operation_type_id = geary_imap_engine_abstract_list_email_remote_batch_operation_get_type_once ();
		g_once_init_leave (&geary_imap_engine_abstract_list_email_remote_batch_operation_type_id__once, geary_imap_engine_abstract_list_email_remote_batch_operation_type_id);
	}
	return geary_imap_engine_abstract_list_email_remote_batch_operation_type_id__once;
}

static void
geary_imap_engine_abstract_list_email_class_init (GearyImapEngineAbstractListEmailClass * klass,
                                                  gpointer klass_data)
{
	geary_imap_engine_abstract_list_email_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GearyImapEngineAbstractListEmail_private_offset);
	((GearyImapEngineReplayOperationClass *) klass)->notify_remote_removed_ids = (void (*) (GearyImapEngineReplayOperation*, GeeCollection*)) geary_imap_engine_abstract_list_email_real_notify_remote_removed_ids;
	((GearyImapEngineReplayOperationClass *) klass)->replay_remote_async = (void (*) (GearyImapEngineReplayOperation*, GearyImapFolderSession*, GAsyncReadyCallback, gpointer)) geary_imap_engine_abstract_list_email_real_replay_remote_async;
	((GearyImapEngineReplayOperationClass *) klass)->replay_remote_finish = (void (*) (GearyImapEngineReplayOperation*, GAsyncResult*, GError**)) geary_imap_engine_abstract_list_email_replay_remote_finish;
	((GearyImapEngineReplayOperationClass *) klass)->describe_state = (gchar* (*) (GearyImapEngineReplayOperation*)) geary_imap_engine_abstract_list_email_real_describe_state;
	G_OBJECT_CLASS (klass)->finalize = geary_imap_engine_abstract_list_email_finalize;
}

static void
geary_imap_engine_abstract_list_email_instance_init (GearyImapEngineAbstractListEmail * self,
                                                     gpointer klass)
{
	GeeArrayList* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = geary_imap_engine_abstract_list_email_get_instance_private (self);
	_tmp0_ = gee_array_list_new (GEARY_TYPE_EMAIL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->accumulator = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST, GeeList);
	_tmp1_ = gee_hash_map_new (GEARY_IMAP_TYPE_UID, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, GEARY_EMAIL_TYPE_FIELD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->unfulfilled = _tmp1_;
}

static void
geary_imap_engine_abstract_list_email_finalize (GObject * obj)
{
	GearyImapEngineAbstractListEmail * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEARY_IMAP_ENGINE_TYPE_ABSTRACT_LIST_EMAIL, GearyImapEngineAbstractListEmail);
	_g_object_unref0 (self->accumulator);
	_g_object_unref0 (self->owner);
	_g_object_unref0 (self->cancellable);
	_g_object_unref0 (self->priv->unfulfilled);
	G_OBJECT_CLASS (geary_imap_engine_abstract_list_email_parent_class)->finalize (obj);
}

/**
 * A base class for building replay operations that list messages.
 */
 G_GNUC_NO_INLINE static GType
geary_imap_engine_abstract_list_email_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyImapEngineAbstractListEmailClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_imap_engine_abstract_list_email_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyImapEngineAbstractListEmail), 0, (GInstanceInitFunc) geary_imap_engine_abstract_list_email_instance_init, NULL };
	GType geary_imap_engine_abstract_list_email_type_id;
	geary_imap_engine_abstract_list_email_type_id = g_type_register_static (GEARY_IMAP_ENGINE_TYPE_SEND_REPLAY_OPERATION, "GearyImapEngineAbstractListEmail", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	GearyImapEngineAbstractListEmail_private_offset = g_type_add_instance_private (geary_imap_engine_abstract_list_email_type_id, sizeof (GearyImapEngineAbstractListEmailPrivate));
	return geary_imap_engine_abstract_list_email_type_id;
}

GType
geary_imap_engine_abstract_list_email_get_type (void)
{
	static gsize geary_imap_engine_abstract_list_email_type_id__once = 0;
	if (g_once_init_enter (&geary_imap_engine_abstract_list_email_type_id__once)) {
		GType geary_imap_engine_abstract_list_email_type_id;
		geary_imap_engine_abstract_list_email_type_id = geary_imap_engine_abstract_list_email_get_type_once ();
		g_once_init_leave (&geary_imap_engine_abstract_list_email_type_id__once, geary_imap_engine_abstract_list_email_type_id);
	}
	return geary_imap_engine_abstract_list_email_type_id__once;
}

