/* imap-engine-revokable-move.c generated by valac 0.56.3, the Vala compiler
 * generated from imap-engine-revokable-move.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 <glib-object.h>
#include <gee.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>

#define GEARY_IMAP_ENGINE_REVOKABLE_MOVE_COMMIT_TIMEOUT_SEC 5

#define GEARY_IMAP_ENGINE_TYPE_REVOKABLE_MOVE (geary_imap_engine_revokable_move_get_type ())
#define GEARY_IMAP_ENGINE_REVOKABLE_MOVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_MOVE, GearyImapEngineRevokableMove))
#define GEARY_IMAP_ENGINE_REVOKABLE_MOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_MOVE, GearyImapEngineRevokableMoveClass))
#define GEARY_IMAP_ENGINE_IS_REVOKABLE_MOVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_MOVE))
#define GEARY_IMAP_ENGINE_IS_REVOKABLE_MOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_MOVE))
#define GEARY_IMAP_ENGINE_REVOKABLE_MOVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_MOVE, GearyImapEngineRevokableMoveClass))

typedef struct _GearyImapEngineRevokableMove GearyImapEngineRevokableMove;
typedef struct _GearyImapEngineRevokableMoveClass GearyImapEngineRevokableMoveClass;
typedef struct _GearyImapEngineRevokableMovePrivate GearyImapEngineRevokableMovePrivate;

#define GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT (geary_imap_engine_generic_account_get_type ())
#define GEARY_IMAP_ENGINE_GENERIC_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT, GearyImapEngineGenericAccount))
#define GEARY_IMAP_ENGINE_GENERIC_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT, GearyImapEngineGenericAccountClass))
#define GEARY_IMAP_ENGINE_IS_GENERIC_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT))
#define GEARY_IMAP_ENGINE_IS_GENERIC_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT))
#define GEARY_IMAP_ENGINE_GENERIC_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_GENERIC_ACCOUNT, GearyImapEngineGenericAccountClass))

typedef struct _GearyImapEngineGenericAccount GearyImapEngineGenericAccount;
typedef struct _GearyImapEngineGenericAccountClass GearyImapEngineGenericAccountClass;

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

#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;
enum  {
	GEARY_IMAP_ENGINE_REVOKABLE_MOVE_0_PROPERTY,
	GEARY_IMAP_ENGINE_REVOKABLE_MOVE_NUM_PROPERTIES
};
static GParamSpec* geary_imap_engine_revokable_move_properties[GEARY_IMAP_ENGINE_REVOKABLE_MOVE_NUM_PROPERTIES];

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

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

#define GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_COMMIT (geary_imap_engine_move_email_commit_get_type ())
#define GEARY_IMAP_ENGINE_MOVE_EMAIL_COMMIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_COMMIT, GearyImapEngineMoveEmailCommit))
#define GEARY_IMAP_ENGINE_MOVE_EMAIL_COMMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_COMMIT, GearyImapEngineMoveEmailCommitClass))
#define GEARY_IMAP_ENGINE_IS_MOVE_EMAIL_COMMIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_COMMIT))
#define GEARY_IMAP_ENGINE_IS_MOVE_EMAIL_COMMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_COMMIT))
#define GEARY_IMAP_ENGINE_MOVE_EMAIL_COMMIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_COMMIT, GearyImapEngineMoveEmailCommitClass))

typedef struct _GearyImapEngineMoveEmailCommit GearyImapEngineMoveEmailCommit;
typedef struct _GearyImapEngineMoveEmailCommitClass GearyImapEngineMoveEmailCommitClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_REVOKE (geary_imap_engine_move_email_revoke_get_type ())
#define GEARY_IMAP_ENGINE_MOVE_EMAIL_REVOKE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_REVOKE, GearyImapEngineMoveEmailRevoke))
#define GEARY_IMAP_ENGINE_MOVE_EMAIL_REVOKE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_REVOKE, GearyImapEngineMoveEmailRevokeClass))
#define GEARY_IMAP_ENGINE_IS_MOVE_EMAIL_REVOKE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_REVOKE))
#define GEARY_IMAP_ENGINE_IS_MOVE_EMAIL_REVOKE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_REVOKE))
#define GEARY_IMAP_ENGINE_MOVE_EMAIL_REVOKE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_MOVE_EMAIL_REVOKE, GearyImapEngineMoveEmailRevokeClass))

typedef struct _GearyImapEngineMoveEmailRevoke GearyImapEngineMoveEmailRevoke;
typedef struct _GearyImapEngineMoveEmailRevokeClass GearyImapEngineMoveEmailRevokeClass;
typedef struct _GearyImapEngineRevokableMoveInternalRevokeAsyncData GearyImapEngineRevokableMoveInternalRevokeAsyncData;
typedef struct _GearyImapEngineReplayOperationPrivate GearyImapEngineReplayOperationPrivate;
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;
typedef struct _GearyImapEngineSendReplayOperationPrivate GearyImapEngineSendReplayOperationPrivate;
typedef struct _GearyImapEngineMoveEmailCommitPrivate GearyImapEngineMoveEmailCommitPrivate;

#define GEARY_IMAP_ENGINE_TYPE_REVOKABLE_COMMITTED_MOVE (geary_imap_engine_revokable_committed_move_get_type ())
#define GEARY_IMAP_ENGINE_REVOKABLE_COMMITTED_MOVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_COMMITTED_MOVE, GearyImapEngineRevokableCommittedMove))
#define GEARY_IMAP_ENGINE_REVOKABLE_COMMITTED_MOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_COMMITTED_MOVE, GearyImapEngineRevokableCommittedMoveClass))
#define GEARY_IMAP_ENGINE_IS_REVOKABLE_COMMITTED_MOVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_COMMITTED_MOVE))
#define GEARY_IMAP_ENGINE_IS_REVOKABLE_COMMITTED_MOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_COMMITTED_MOVE))
#define GEARY_IMAP_ENGINE_REVOKABLE_COMMITTED_MOVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_IMAP_ENGINE_TYPE_REVOKABLE_COMMITTED_MOVE, GearyImapEngineRevokableCommittedMoveClass))

typedef struct _GearyImapEngineRevokableCommittedMove GearyImapEngineRevokableCommittedMove;
typedef struct _GearyImapEngineRevokableCommittedMoveClass GearyImapEngineRevokableCommittedMoveClass;
typedef struct _GearyImapEngineRevokableMoveInternalCommitAsyncData GearyImapEngineRevokableMoveInternalCommitAsyncData;
typedef struct _Block102Data Block102Data;

struct _GearyImapEngineRevokableMove {
	GearyRevokable parent_instance;
	GearyImapEngineRevokableMovePrivate * priv;
};

struct _GearyImapEngineRevokableMoveClass {
	GearyRevokableClass parent_class;
};

struct _GearyImapEngineRevokableMovePrivate {
	GearyImapEngineGenericAccount* account;
	GearyImapEngineMinimalFolder* source;
	GearyFolder* destination;
	GeeSet* move_ids;
};

struct _GearyImapEngineRevokableMoveInternalRevokeAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineRevokableMove* self;
	GCancellable* cancellable;
	GearyImapEngineMoveEmailRevoke* op;
	GearyImapEngineMinimalFolder* _tmp0_;
	GeeSet* _tmp1_;
	GearyImapEngineMoveEmailRevoke* _tmp2_;
	GearyImapEngineMinimalFolder* _tmp3_;
	GearyImapEngineMoveEmailRevoke* _tmp4_;
	GearyImapEngineMoveEmailRevoke* _tmp5_;
	GearyImapEngineGenericAccount* _tmp6_;
	GearyFolder* _tmp7_;
	GError* _inner_error1_;
	GError* _inner_error0_;
};

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 _GearyImapEngineMoveEmailCommit {
	GearyImapEngineSendReplayOperation parent_instance;
	GeeSet* destination_uids;
	GearyImapEngineMoveEmailCommitPrivate * priv;
};

struct _GearyImapEngineMoveEmailCommitClass {
	GearyImapEngineSendReplayOperationClass parent_class;
};

struct _GearyImapEngineRevokableMoveInternalCommitAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyImapEngineRevokableMove* self;
	GCancellable* cancellable;
	GearyImapEngineMoveEmailCommit* op;
	GearyImapEngineMinimalFolder* _tmp0_;
	GeeSet* _tmp1_;
	GearyFolder* _tmp2_;
	GearyFolderPath* _tmp3_;
	GearyFolderPath* _tmp4_;
	GearyImapEngineMoveEmailCommit* _tmp5_;
	GearyImapEngineMinimalFolder* _tmp6_;
	GearyImapEngineMoveEmailCommit* _tmp7_;
	GearyImapEngineGenericAccount* _tmp8_;
	GearyImapEngineMinimalFolder* _tmp9_;
	GearyFolderPath* _tmp10_;
	GearyFolderPath* _tmp11_;
	GearyFolder* _tmp12_;
	GearyFolderPath* _tmp13_;
	GearyFolderPath* _tmp14_;
	GearyImapEngineMoveEmailCommit* _tmp15_;
	GeeSet* _tmp16_;
	GearyImapEngineRevokableCommittedMove* _tmp17_;
	GearyImapEngineRevokableCommittedMove* _tmp18_;
	GearyImapEngineMoveEmailCommit* _tmp19_;
	GearyImapEngineGenericAccount* _tmp20_;
	GearyFolder* _tmp21_;
	GError* _inner_error1_;
	GError* _inner_error0_;
};

struct _Block102Data {
	int _ref_count_;
	GearyImapEngineRevokableMove* self;
	GearyImapEngineMoveEmailCommit* op;
	GearyImapEngineGenericAccount* account;
	GearyFolder* destination;
};

static gint GearyImapEngineRevokableMove_private_offset;
static gpointer geary_imap_engine_revokable_move_parent_class = NULL;

VALA_EXTERN GType geary_imap_engine_revokable_move_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_generic_account_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_minimal_folder_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_db_email_identifier_get_type (void) G_GNUC_CONST ;
static void geary_imap_engine_revokable_move_on_folders_available_unavailable (GearyImapEngineRevokableMove* self,
                                                                        GeeCollection* available,
                                                                        GeeCollection* unavailable);
static void _geary_imap_engine_revokable_move_on_folders_available_unavailable_geary_account_folders_available_unavailable (GearyAccount* _sender,
                                                                                                                     GeeBidirSortedSet* available,
                                                                                                                     GeeBidirSortedSet* unavailable,
                                                                                                                     gpointer self);
static void geary_imap_engine_revokable_move_on_source_email_removed (GearyImapEngineRevokableMove* self,
                                                               GeeCollection* ids);
static void _geary_imap_engine_revokable_move_on_source_email_removed_geary_folder_email_removed (GearyFolder* _sender,
                                                                                           GeeCollection* ids,
                                                                                           gpointer self);
static void _geary_imap_engine_revokable_move_on_source_email_removed_geary_imap_engine_minimal_folder_marked_email_removed (GearyImapEngineMinimalFolder* _sender,
                                                                                                                      GeeCollection* removed,
                                                                                                                      gpointer self);
VALA_EXTERN GType geary_imap_engine_replay_operation_get_type (void) G_GNUC_CONST ;
static void geary_imap_engine_revokable_move_on_source_closing (GearyImapEngineRevokableMove* self,
                                                         GeeList* final_ops);
static void _geary_imap_engine_revokable_move_on_source_closing_geary_imap_engine_minimal_folder_closing (GearyImapEngineMinimalFolder* _sender,
                                                                                                   GeeList* final_ops,
                                                                                                   gpointer self);
VALA_EXTERN void geary_imap_engine_minimal_folder_schedule_op (GearyImapEngineMinimalFolder* self,
                                                   GearyImapEngineReplayOperation* op,
                                                   GError** error);
VALA_EXTERN GearyImapEngineMoveEmailCommit* geary_imap_engine_move_email_commit_new (GearyImapEngineMinimalFolder* engine,
                                                                         GeeCollection* to_move,
                                                                         GearyFolderPath* destination,
                                                                         GCancellable* cancellable);
VALA_EXTERN GearyImapEngineMoveEmailCommit* geary_imap_engine_move_email_commit_construct (GType object_type,
                                                                               GearyImapEngineMinimalFolder* engine,
                                                                               GeeCollection* to_move,
                                                                               GearyFolderPath* destination,
                                                                               GCancellable* cancellable);
VALA_EXTERN GType geary_imap_engine_send_replay_operation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType geary_imap_engine_move_email_commit_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GearyImapEngineRevokableMove* geary_imap_engine_revokable_move_new (GearyImapEngineGenericAccount* account,
                                                                    GearyImapEngineMinimalFolder* source,
                                                                    GearyFolder* destination,
                                                                    GeeSet* move_ids);
VALA_EXTERN GearyImapEngineRevokableMove* geary_imap_engine_revokable_move_construct (GType object_type,
                                                                          GearyImapEngineGenericAccount* account,
                                                                          GearyImapEngineMinimalFolder* source,
                                                                          GearyFolder* destination,
                                                                          GeeSet* move_ids);
static void geary_imap_engine_revokable_move_real_internal_revoke_async_data_free (gpointer _data);
static void geary_imap_engine_revokable_move_real_internal_revoke_async (GearyRevokable* base,
                                                                  GCancellable* cancellable,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_);
static gboolean geary_imap_engine_revokable_move_real_internal_revoke_async_co (GearyImapEngineRevokableMoveInternalRevokeAsyncData* _data_);
VALA_EXTERN GType geary_imap_engine_move_email_revoke_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GearyImapEngineMoveEmailRevoke* geary_imap_engine_move_email_revoke_new (GearyImapEngineMinimalFolder* engine,
                                                                         GeeCollection* to_revoke,
                                                                         GCancellable* cancellable);
VALA_EXTERN GearyImapEngineMoveEmailRevoke* geary_imap_engine_move_email_revoke_construct (GType object_type,
                                                                               GearyImapEngineMinimalFolder* engine,
                                                                               GeeCollection* to_revoke,
                                                                               GCancellable* cancellable);
VALA_EXTERN void geary_imap_engine_minimal_folder_exec_op_async (GearyImapEngineMinimalFolder* self,
                                                     GearyImapEngineReplayOperation* op,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN void geary_imap_engine_minimal_folder_exec_op_finish (GearyImapEngineMinimalFolder* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static void geary_imap_engine_revokable_move_internal_revoke_async_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_);
VALA_EXTERN void geary_imap_engine_replay_operation_wait_for_ready_async (GearyImapEngineReplayOperation* self,
                                                              GCancellable* cancellable,
                                                              GAsyncReadyCallback _callback_,
                                                              gpointer _user_data_);
VALA_EXTERN void geary_imap_engine_replay_operation_wait_for_ready_finish (GearyImapEngineReplayOperation* self,
                                                               GAsyncResult* _res_,
                                                               GError** error);
VALA_EXTERN void geary_imap_engine_generic_account_update_folder (GearyImapEngineGenericAccount* self,
                                                      GearyFolder* folder);
static void geary_imap_engine_revokable_move_real_internal_commit_async_data_free (gpointer _data);
static void geary_imap_engine_revokable_move_real_internal_commit_async (GearyRevokable* base,
                                                                  GCancellable* cancellable,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_);
static gboolean geary_imap_engine_revokable_move_real_internal_commit_async_co (GearyImapEngineRevokableMoveInternalCommitAsyncData* _data_);
static void geary_imap_engine_revokable_move_internal_commit_async_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_);
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 GearyImapEngineRevokableCommittedMove* geary_imap_engine_revokable_committed_move_new (GearyImapEngineGenericAccount* account,
                                                                                       GearyFolderPath* source,
                                                                                       GearyFolderPath* destination,
                                                                                       GeeSet* destination_uids);
VALA_EXTERN GearyImapEngineRevokableCommittedMove* geary_imap_engine_revokable_committed_move_construct (GType object_type,
                                                                                             GearyImapEngineGenericAccount* account,
                                                                                             GearyFolderPath* source,
                                                                                             GearyFolderPath* destination,
                                                                                             GeeSet* destination_uids);
VALA_EXTERN GType geary_imap_engine_revokable_committed_move_get_type (void) G_GNUC_CONST ;
static Block102Data* block102_data_ref (Block102Data* _data102_);
static void block102_data_unref (void * _userdata_);
static void __lambda130_ (Block102Data* _data102_,
                   GObject* obj,
                   GAsyncResult* res);
static void ___lambda130__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void geary_imap_engine_revokable_move_finalize (GObject * obj);
static GType geary_imap_engine_revokable_move_get_type_once (void);

static inline gpointer
geary_imap_engine_revokable_move_get_instance_private (GearyImapEngineRevokableMove* self)
{
	return G_STRUCT_MEMBER_P (self, GearyImapEngineRevokableMove_private_offset);
}

static void
_geary_imap_engine_revokable_move_on_folders_available_unavailable_geary_account_folders_available_unavailable (GearyAccount* _sender,
                                                                                                                GeeBidirSortedSet* available,
                                                                                                                GeeBidirSortedSet* unavailable,
                                                                                                                gpointer self)
{
	geary_imap_engine_revokable_move_on_folders_available_unavailable ((GearyImapEngineRevokableMove*) self, available, unavailable);
}

static void
_geary_imap_engine_revokable_move_on_source_email_removed_geary_folder_email_removed (GearyFolder* _sender,
                                                                                      GeeCollection* ids,
                                                                                      gpointer self)
{
	geary_imap_engine_revokable_move_on_source_email_removed ((GearyImapEngineRevokableMove*) self, ids);
}

static void
_geary_imap_engine_revokable_move_on_source_email_removed_geary_imap_engine_minimal_folder_marked_email_removed (GearyImapEngineMinimalFolder* _sender,
                                                                                                                 GeeCollection* removed,
                                                                                                                 gpointer self)
{
	geary_imap_engine_revokable_move_on_source_email_removed ((GearyImapEngineRevokableMove*) self, removed);
}

static void
_geary_imap_engine_revokable_move_on_source_closing_geary_imap_engine_minimal_folder_closing (GearyImapEngineMinimalFolder* _sender,
                                                                                              GeeList* final_ops,
                                                                                              gpointer self)
{
	geary_imap_engine_revokable_move_on_source_closing ((GearyImapEngineRevokableMove*) self, final_ops);
}

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

GearyImapEngineRevokableMove*
geary_imap_engine_revokable_move_construct (GType object_type,
                                            GearyImapEngineGenericAccount* account,
                                            GearyImapEngineMinimalFolder* source,
                                            GearyFolder* destination,
                                            GeeSet* move_ids)
{
	GearyImapEngineRevokableMove * self = NULL;
	GearyImapEngineGenericAccount* _tmp0_;
	GearyImapEngineMinimalFolder* _tmp1_;
	GearyFolder* _tmp2_;
	GeeSet* _tmp3_;
	g_return_val_if_fail (GEARY_IMAP_ENGINE_IS_GENERIC_ACCOUNT (account), NULL);
	g_return_val_if_fail (GEARY_IMAP_ENGINE_IS_MINIMAL_FOLDER (source), NULL);
	g_return_val_if_fail (GEARY_IS_FOLDER (destination), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (move_ids, GEE_TYPE_SET), NULL);
	self = (GearyImapEngineRevokableMove*) geary_revokable_construct (object_type, GEARY_IMAP_ENGINE_REVOKABLE_MOVE_COMMIT_TIMEOUT_SEC);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (self->priv->account);
	self->priv->account = _tmp0_;
	_tmp1_ = _g_object_ref0 (source);
	_g_object_unref0 (self->priv->source);
	self->priv->source = _tmp1_;
	_tmp2_ = _g_object_ref0 (destination);
	_g_object_unref0 (self->priv->destination);
	self->priv->destination = _tmp2_;
	_tmp3_ = _g_object_ref0 (move_ids);
	_g_object_unref0 (self->priv->move_ids);
	self->priv->move_ids = _tmp3_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (account, GEARY_TYPE_ACCOUNT, GearyAccount), "folders-available-unavailable", (GCallback) _geary_imap_engine_revokable_move_on_folders_available_unavailable_geary_account_folders_available_unavailable, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (source, GEARY_TYPE_FOLDER, GearyFolder), "email-removed", (GCallback) _geary_imap_engine_revokable_move_on_source_email_removed_geary_folder_email_removed, self, 0);
	g_signal_connect_object (source, "marked-email-removed", (GCallback) _geary_imap_engine_revokable_move_on_source_email_removed_geary_imap_engine_minimal_folder_marked_email_removed, self, 0);
	g_signal_connect_object (source, "closing", (GCallback) _geary_imap_engine_revokable_move_on_source_closing_geary_imap_engine_minimal_folder_closing, self, 0);
	return self;
}

GearyImapEngineRevokableMove*
geary_imap_engine_revokable_move_new (GearyImapEngineGenericAccount* account,
                                      GearyImapEngineMinimalFolder* source,
                                      GearyFolder* destination,
                                      GeeSet* move_ids)
{
	return geary_imap_engine_revokable_move_construct (GEARY_IMAP_ENGINE_TYPE_REVOKABLE_MOVE, account, source, destination, move_ids);
}

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

static void
geary_imap_engine_revokable_move_real_internal_revoke_async (GearyRevokable* base,
                                                             GCancellable* cancellable,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_)
{
	GearyImapEngineRevokableMove * self;
	GearyImapEngineRevokableMoveInternalRevokeAsyncData* _data_;
	GearyImapEngineRevokableMove* _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_TYPE_REVOKABLE_MOVE, GearyImapEngineRevokableMove);
	_data_ = g_slice_new0 (GearyImapEngineRevokableMoveInternalRevokeAsyncData);
	_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_revokable_move_real_internal_revoke_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_revokable_move_real_internal_revoke_async_co (_data_);
}

static void
geary_imap_engine_revokable_move_internal_revoke_finish (GearyRevokable* base,
                                                         GAsyncResult* _res_,
                                                         GError** error)
{
	GearyImapEngineRevokableMoveInternalRevokeAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
geary_imap_engine_revokable_move_internal_revoke_async_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_)
{
	GearyImapEngineRevokableMoveInternalRevokeAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_revokable_move_real_internal_revoke_async_co (_data_);
}

static gboolean
geary_imap_engine_revokable_move_real_internal_revoke_async_co (GearyImapEngineRevokableMoveInternalRevokeAsyncData* _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->source;
		_data_->_tmp1_ = _data_->self->priv->move_ids;
		_data_->_tmp2_ = geary_imap_engine_move_email_revoke_new (_data_->_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, GEE_TYPE_COLLECTION, GeeCollection), _data_->cancellable);
		_data_->op = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->self->priv->source;
		_data_->_tmp4_ = _data_->op;
		_data_->_state_ = 1;
		geary_imap_engine_minimal_folder_exec_op_async (_data_->_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp4_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), _data_->cancellable, geary_imap_engine_revokable_move_internal_revoke_async_ready, _data_);
		return FALSE;
		_state_1:
		geary_imap_engine_minimal_folder_exec_op_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->op);
			goto __finally0;
		}
		geary_revokable_notify_revoked (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_TYPE_REVOKABLE, GearyRevokable));
		_data_->_tmp5_ = _data_->op;
		_data_->_state_ = 2;
		geary_imap_engine_replay_operation_wait_for_ready_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), _data_->cancellable, geary_imap_engine_revokable_move_internal_revoke_async_ready, _data_);
		return FALSE;
		_state_2:
		geary_imap_engine_replay_operation_wait_for_ready_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->op);
			goto __finally0;
		}
		_data_->_tmp6_ = _data_->self->priv->account;
		_data_->_tmp7_ = _data_->self->priv->destination;
		geary_imap_engine_generic_account_update_folder (_data_->_tmp6_, _data_->_tmp7_);
		_g_object_unref0 (_data_->op);
	}
	__finally0:
	{
		geary_revokable_set_invalid (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_TYPE_REVOKABLE, GearyRevokable));
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
geary_imap_engine_revokable_move_real_internal_commit_async (GearyRevokable* base,
                                                             GCancellable* cancellable,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_)
{
	GearyImapEngineRevokableMove * self;
	GearyImapEngineRevokableMoveInternalCommitAsyncData* _data_;
	GearyImapEngineRevokableMove* _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_TYPE_REVOKABLE_MOVE, GearyImapEngineRevokableMove);
	_data_ = g_slice_new0 (GearyImapEngineRevokableMoveInternalCommitAsyncData);
	_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_revokable_move_real_internal_commit_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_revokable_move_real_internal_commit_async_co (_data_);
}

static void
geary_imap_engine_revokable_move_internal_commit_finish (GearyRevokable* base,
                                                         GAsyncResult* _res_,
                                                         GError** error)
{
	GearyImapEngineRevokableMoveInternalCommitAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
geary_imap_engine_revokable_move_internal_commit_async_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_)
{
	GearyImapEngineRevokableMoveInternalCommitAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_imap_engine_revokable_move_real_internal_commit_async_co (_data_);
}

static gboolean
geary_imap_engine_revokable_move_real_internal_commit_async_co (GearyImapEngineRevokableMoveInternalCommitAsyncData* _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->source;
		_data_->_tmp1_ = _data_->self->priv->move_ids;
		_data_->_tmp2_ = _data_->self->priv->destination;
		_data_->_tmp3_ = geary_folder_get_path (_data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = geary_imap_engine_move_email_commit_new (_data_->_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, GEE_TYPE_COLLECTION, GeeCollection), _data_->_tmp4_, _data_->cancellable);
		_data_->op = _data_->_tmp5_;
		_data_->_tmp6_ = _data_->self->priv->source;
		_data_->_tmp7_ = _data_->op;
		_data_->_state_ = 1;
		geary_imap_engine_minimal_folder_exec_op_async (_data_->_tmp6_, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp7_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), _data_->cancellable, geary_imap_engine_revokable_move_internal_commit_async_ready, _data_);
		return FALSE;
		_state_1:
		geary_imap_engine_minimal_folder_exec_op_finish (_data_->_tmp6_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->op);
			goto __finally0;
		}
		_data_->_tmp8_ = _data_->self->priv->account;
		_data_->_tmp9_ = _data_->self->priv->source;
		_data_->_tmp10_ = geary_folder_get_path (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp9_, GEARY_TYPE_FOLDER, GearyFolder));
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = _data_->self->priv->destination;
		_data_->_tmp13_ = geary_folder_get_path (_data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp15_ = _data_->op;
		_data_->_tmp16_ = _data_->_tmp15_->destination_uids;
		_data_->_tmp17_ = geary_imap_engine_revokable_committed_move_new (_data_->_tmp8_, _data_->_tmp11_, _data_->_tmp14_, _data_->_tmp16_);
		_data_->_tmp18_ = _data_->_tmp17_;
		geary_revokable_notify_committed (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_TYPE_REVOKABLE, GearyRevokable), G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp18_, GEARY_TYPE_REVOKABLE, GearyRevokable));
		_g_object_unref0 (_data_->_tmp18_);
		_data_->_tmp19_ = _data_->op;
		_data_->_state_ = 2;
		geary_imap_engine_replay_operation_wait_for_ready_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp19_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), _data_->cancellable, geary_imap_engine_revokable_move_internal_commit_async_ready, _data_);
		return FALSE;
		_state_2:
		geary_imap_engine_replay_operation_wait_for_ready_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp19_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->op);
			goto __finally0;
		}
		_data_->_tmp20_ = _data_->self->priv->account;
		_data_->_tmp21_ = _data_->self->priv->destination;
		geary_imap_engine_generic_account_update_folder (_data_->_tmp20_, _data_->_tmp21_);
		_g_object_unref0 (_data_->op);
	}
	__finally0:
	{
		geary_revokable_set_invalid (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_TYPE_REVOKABLE, GearyRevokable));
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
geary_imap_engine_revokable_move_on_folders_available_unavailable (GearyImapEngineRevokableMove* self,
                                                                   GeeCollection* available,
                                                                   GeeCollection* unavailable)
{
	g_return_if_fail (GEARY_IMAP_ENGINE_IS_REVOKABLE_MOVE (self));
	g_return_if_fail ((available == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (available, GEE_TYPE_COLLECTION));
	g_return_if_fail ((unavailable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (unavailable, GEE_TYPE_COLLECTION));
	if (unavailable != NULL) {
		{
			GeeIterator* _folder_it = NULL;
			GeeIterator* _tmp0_;
			_tmp0_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (unavailable, GEE_TYPE_ITERABLE, GeeIterable));
			_folder_it = _tmp0_;
			while (TRUE) {
				GeeIterator* _tmp1_;
				GearyFolder* folder = NULL;
				GeeIterator* _tmp2_;
				gpointer _tmp3_;
				gboolean _tmp4_ = FALSE;
				GearyFolder* _tmp5_;
				GearyFolderPath* _tmp6_;
				GearyFolderPath* _tmp7_;
				GearyImapEngineMinimalFolder* _tmp8_;
				GearyFolderPath* _tmp9_;
				GearyFolderPath* _tmp10_;
				_tmp1_ = _folder_it;
				if (!gee_iterator_next (_tmp1_)) {
					break;
				}
				_tmp2_ = _folder_it;
				_tmp3_ = gee_iterator_get (_tmp2_);
				folder = (GearyFolder*) _tmp3_;
				_tmp5_ = folder;
				_tmp6_ = geary_folder_get_path (_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = self->priv->source;
				_tmp9_ = geary_folder_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEARY_TYPE_FOLDER, GearyFolder));
				_tmp10_ = _tmp9_;
				if (gee_hashable_equal_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_HASHABLE, GeeHashable), _tmp10_)) {
					_tmp4_ = TRUE;
				} else {
					GearyFolder* _tmp11_;
					GearyFolderPath* _tmp12_;
					GearyFolderPath* _tmp13_;
					GearyFolder* _tmp14_;
					GearyFolderPath* _tmp15_;
					GearyFolderPath* _tmp16_;
					_tmp11_ = folder;
					_tmp12_ = geary_folder_get_path (_tmp11_);
					_tmp13_ = _tmp12_;
					_tmp14_ = self->priv->destination;
					_tmp15_ = geary_folder_get_path (_tmp14_);
					_tmp16_ = _tmp15_;
					_tmp4_ = gee_hashable_equal_to (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_HASHABLE, GeeHashable), _tmp16_);
				}
				if (_tmp4_) {
					geary_revokable_set_invalid (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_REVOKABLE, GearyRevokable));
					_g_object_unref0 (folder);
					break;
				}
				_g_object_unref0 (folder);
			}
			_g_object_unref0 (_folder_it);
		}
	}
}

static void
geary_imap_engine_revokable_move_on_source_email_removed (GearyImapEngineRevokableMove* self,
                                                          GeeCollection* ids)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GeeSet* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	g_return_if_fail (GEARY_IMAP_ENGINE_IS_REVOKABLE_MOVE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (ids, GEE_TYPE_COLLECTION));
	_tmp0_ = geary_revokable_get_valid (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_REVOKABLE, GearyRevokable));
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	{
		GeeIterator* _id_it = NULL;
		GeeIterator* _tmp2_;
		_tmp2_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (ids, GEE_TYPE_ITERABLE, GeeIterable));
		_id_it = _tmp2_;
		while (TRUE) {
			GeeIterator* _tmp3_;
			GearyEmailIdentifier* id = NULL;
			GeeIterator* _tmp4_;
			gpointer _tmp5_;
			GeeSet* _tmp6_;
			GearyEmailIdentifier* _tmp7_;
			_tmp3_ = _id_it;
			if (!gee_iterator_next (_tmp3_)) {
				break;
			}
			_tmp4_ = _id_it;
			_tmp5_ = gee_iterator_get (_tmp4_);
			id = (GearyEmailIdentifier*) _tmp5_;
			_tmp6_ = self->priv->move_ids;
			_tmp7_ = id;
			gee_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEARY_IMAP_DB_TYPE_EMAIL_IDENTIFIER, GearyImapDBEmailIdentifier));
			_g_object_unref0 (id);
		}
		_g_object_unref0 (_id_it);
	}
	_tmp8_ = self->priv->move_ids;
	_tmp9_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp10_ = _tmp9_;
	if (_tmp10_ <= 0) {
		geary_revokable_set_invalid (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_REVOKABLE, GearyRevokable));
	}
}

static Block102Data*
block102_data_ref (Block102Data* _data102_)
{
	g_atomic_int_inc (&_data102_->_ref_count_);
	return _data102_;
}

static void
block102_data_unref (void * _userdata_)
{
	Block102Data* _data102_;
	_data102_ = (Block102Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data102_->_ref_count_)) {
		GearyImapEngineRevokableMove* self;
		self = _data102_->self;
		_g_object_unref0 (_data102_->destination);
		_g_object_unref0 (_data102_->account);
		_g_object_unref0 (_data102_->op);
		_g_object_unref0 (self);
		g_slice_free (Block102Data, _data102_);
	}
}

static void
__lambda130_ (Block102Data* _data102_,
              GObject* obj,
              GAsyncResult* res)
{
	GearyImapEngineRevokableMove* self;
	GError* _inner_error0_ = NULL;
	self = _data102_->self;
	g_return_if_fail ((obj == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (obj, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (res, g_async_result_get_type ()));
	{
		GearyImapEngineMoveEmailCommit* _tmp0_;
		GearyImapEngineGenericAccount* _tmp1_;
		GearyFolder* _tmp2_;
		_tmp0_ = _data102_->op;
		geary_imap_engine_replay_operation_wait_for_ready_finish (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = _data102_->account;
		_tmp2_ = _data102_->destination;
		geary_imap_engine_generic_account_update_folder (_tmp1_, _tmp2_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda130__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda130_ (self, source_object, res);
	block102_data_unref (self);
}

static void
geary_imap_engine_revokable_move_on_source_closing (GearyImapEngineRevokableMove* self,
                                                    GeeList* final_ops)
{
	Block102Data* _data102_;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GearyImapEngineMinimalFolder* _tmp2_;
	GeeSet* _tmp3_;
	GearyFolder* _tmp4_;
	GearyFolderPath* _tmp5_;
	GearyFolderPath* _tmp6_;
	GearyImapEngineMoveEmailCommit* _tmp7_;
	GearyImapEngineMoveEmailCommit* _tmp8_;
	GearyImapEngineGenericAccount* _tmp9_;
	GearyImapEngineGenericAccount* _tmp10_;
	GearyFolder* _tmp11_;
	GearyFolder* _tmp12_;
	GearyImapEngineMoveEmailCommit* _tmp13_;
	g_return_if_fail (GEARY_IMAP_ENGINE_IS_REVOKABLE_MOVE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (final_ops, GEE_TYPE_LIST));
	_data102_ = g_slice_new0 (Block102Data);
	_data102_->_ref_count_ = 1;
	_data102_->self = g_object_ref (self);
	_tmp0_ = geary_revokable_get_valid (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_REVOKABLE, GearyRevokable));
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		block102_data_unref (_data102_);
		_data102_ = NULL;
		return;
	}
	_tmp2_ = self->priv->source;
	_tmp3_ = self->priv->move_ids;
	_tmp4_ = self->priv->destination;
	_tmp5_ = geary_folder_get_path (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = geary_imap_engine_move_email_commit_new (_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection), _tmp6_, NULL);
	_data102_->op = _tmp7_;
	_tmp8_ = _data102_->op;
	gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (final_ops, GEE_TYPE_COLLECTION, GeeCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation));
	geary_revokable_set_invalid (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_REVOKABLE, GearyRevokable));
	_tmp9_ = self->priv->account;
	_tmp10_ = _g_object_ref0 (_tmp9_);
	_data102_->account = _tmp10_;
	_tmp11_ = self->priv->destination;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_data102_->destination = _tmp12_;
	_tmp13_ = _data102_->op;
	geary_imap_engine_replay_operation_wait_for_ready_async (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), NULL, ___lambda130__gasync_ready_callback, block102_data_ref (_data102_));
	block102_data_unref (_data102_);
	_data102_ = NULL;
}

static void
geary_imap_engine_revokable_move_class_init (GearyImapEngineRevokableMoveClass * klass,
                                             gpointer klass_data)
{
	geary_imap_engine_revokable_move_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GearyImapEngineRevokableMove_private_offset);
	((GearyRevokableClass *) klass)->internal_revoke_async = (void (*) (GearyRevokable*, GCancellable*, GAsyncReadyCallback, gpointer)) geary_imap_engine_revokable_move_real_internal_revoke_async;
	((GearyRevokableClass *) klass)->internal_revoke_finish = (void (*) (GearyRevokable*, GAsyncResult*, GError**)) geary_imap_engine_revokable_move_internal_revoke_finish;
	((GearyRevokableClass *) klass)->internal_commit_async = (void (*) (GearyRevokable*, GCancellable*, GAsyncReadyCallback, gpointer)) geary_imap_engine_revokable_move_real_internal_commit_async;
	((GearyRevokableClass *) klass)->internal_commit_finish = (void (*) (GearyRevokable*, GAsyncResult*, GError**)) geary_imap_engine_revokable_move_internal_commit_finish;
	G_OBJECT_CLASS (klass)->finalize = geary_imap_engine_revokable_move_finalize;
}

static void
geary_imap_engine_revokable_move_instance_init (GearyImapEngineRevokableMove * self,
                                                gpointer klass)
{
	self->priv = geary_imap_engine_revokable_move_get_instance_private (self);
}

static void
geary_imap_engine_revokable_move_finalize (GObject * obj)
{
	GearyImapEngineRevokableMove * self;
	GearyImapEngineGenericAccount* _tmp0_;
	guint _tmp1_;
	GearyImapEngineMinimalFolder* _tmp2_;
	guint _tmp3_;
	GearyImapEngineMinimalFolder* _tmp4_;
	guint _tmp5_;
	GearyImapEngineMinimalFolder* _tmp6_;
	guint _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_;
	gboolean _tmp10_;
	GError* _inner_error0_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEARY_IMAP_ENGINE_TYPE_REVOKABLE_MOVE, GearyImapEngineRevokableMove);
	_tmp0_ = self->priv->account;
	g_signal_parse_name ("folders-available-unavailable", GEARY_TYPE_ACCOUNT, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEARY_TYPE_ACCOUNT, GearyAccount), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _geary_imap_engine_revokable_move_on_folders_available_unavailable_geary_account_folders_available_unavailable, self);
	_tmp2_ = self->priv->source;
	g_signal_parse_name ("email-removed", GEARY_TYPE_FOLDER, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEARY_TYPE_FOLDER, GearyFolder), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _geary_imap_engine_revokable_move_on_source_email_removed_geary_folder_email_removed, self);
	_tmp4_ = self->priv->source;
	g_signal_parse_name ("marked-email-removed", GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, &_tmp5_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _geary_imap_engine_revokable_move_on_source_email_removed_geary_imap_engine_minimal_folder_marked_email_removed, self);
	_tmp6_ = self->priv->source;
	g_signal_parse_name ("closing", GEARY_IMAP_ENGINE_TYPE_MINIMAL_FOLDER, &_tmp7_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp6_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) _geary_imap_engine_revokable_move_on_source_closing_geary_imap_engine_minimal_folder_closing, self);
	_tmp9_ = geary_revokable_get_valid (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_REVOKABLE, GearyRevokable));
	_tmp10_ = _tmp9_;
	if (_tmp10_) {
		GearyImapEngineMinimalFolder* _tmp11_;
		_tmp11_ = self->priv->source;
		_tmp8_ = geary_folder_get_open_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEARY_TYPE_FOLDER, GearyFolder)) != GEARY_FOLDER_OPEN_STATE_CLOSED;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		GeeSet* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		GearyImapEngineMinimalFolder* _tmp15_;
		GearyFolderPath* _tmp16_;
		GearyFolderPath* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		GearyFolder* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		_tmp12_ = self->priv->move_ids;
		_tmp13_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp14_ = _tmp13_;
		_tmp15_ = self->priv->source;
		_tmp16_ = geary_folder_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEARY_TYPE_FOLDER, GearyFolder));
		_tmp17_ = _tmp16_;
		_tmp18_ = geary_folder_path_to_string (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = self->priv->destination;
		_tmp21_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
		_tmp22_ = _tmp21_;
		g_debug ("imap-engine-revokable-move.vala:47: Freeing revokable, scheduling move" \
" %d emails from %s to %s", _tmp14_, _tmp19_, _tmp22_);
		_g_free0 (_tmp22_);
		_g_free0 (_tmp19_);
		{
			GearyImapEngineMinimalFolder* _tmp23_;
			GearyImapEngineMinimalFolder* _tmp24_;
			GeeSet* _tmp25_;
			GearyFolder* _tmp26_;
			GearyFolderPath* _tmp27_;
			GearyFolderPath* _tmp28_;
			GearyImapEngineMoveEmailCommit* _tmp29_;
			GearyImapEngineMoveEmailCommit* _tmp30_;
			_tmp23_ = self->priv->source;
			_tmp24_ = self->priv->source;
			_tmp25_ = self->priv->move_ids;
			_tmp26_ = self->priv->destination;
			_tmp27_ = geary_folder_get_path (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = geary_imap_engine_move_email_commit_new (_tmp24_, G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GEE_TYPE_COLLECTION, GeeCollection), _tmp28_, NULL);
			_tmp30_ = _tmp29_;
			geary_imap_engine_minimal_folder_schedule_op (_tmp23_, G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, GEARY_IMAP_ENGINE_TYPE_REPLAY_OPERATION, GearyImapEngineReplayOperation), &_inner_error0_);
			_g_object_unref0 (_tmp30_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* err = NULL;
			GearyImapEngineMinimalFolder* _tmp31_;
			GearyFolderPath* _tmp32_;
			GearyFolderPath* _tmp33_;
			gchar* _tmp34_;
			gchar* _tmp35_;
			GearyFolder* _tmp36_;
			gchar* _tmp37_;
			gchar* _tmp38_;
			GError* _tmp39_;
			const gchar* _tmp40_;
			err = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp31_ = self->priv->source;
			_tmp32_ = geary_folder_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, GEARY_TYPE_FOLDER, GearyFolder));
			_tmp33_ = _tmp32_;
			_tmp34_ = geary_folder_path_to_string (_tmp33_);
			_tmp35_ = _tmp34_;
			_tmp36_ = self->priv->destination;
			_tmp37_ = geary_logging_source_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEARY_LOGGING_TYPE_SOURCE, GearyLoggingSource));
			_tmp38_ = _tmp37_;
			_tmp39_ = err;
			_tmp40_ = _tmp39_->message;
			g_debug ("imap-engine-revokable-move.vala:53: Move from %s to %s failed: %s", _tmp35_, _tmp38_, _tmp40_);
			_g_free0 (_tmp38_);
			_g_free0 (_tmp35_);
			_g_error_free0 (err);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
		}
	} else {
		gboolean _tmp41_;
		gboolean _tmp42_;
		_tmp41_ = geary_revokable_get_valid (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_TYPE_REVOKABLE, GearyRevokable));
		_tmp42_ = _tmp41_;
		if (_tmp42_) {
			GearyImapEngineMinimalFolder* _tmp43_;
			GearyFolderPath* _tmp44_;
			GearyFolderPath* _tmp45_;
			gchar* _tmp46_;
			gchar* _tmp47_;
			GearyImapEngineMinimalFolder* _tmp48_;
			gchar* _tmp49_;
			_tmp43_ = self->priv->source;
			_tmp44_ = geary_folder_get_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, GEARY_TYPE_FOLDER, GearyFolder));
			_tmp45_ = _tmp44_;
			_tmp46_ = geary_folder_path_to_string (_tmp45_);
			_tmp47_ = _tmp46_;
			_tmp48_ = self->priv->source;
			_tmp49_ = g_enum_to_string (GEARY_FOLDER_TYPE_OPEN_STATE, geary_folder_get_open_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, GEARY_TYPE_FOLDER, GearyFolder)));
			g_debug ("imap-engine-revokable-move.vala:57: Not scheduling freed move revokabl" \
"e for %s, open_state=%s", _tmp47_, _tmp49_);
			_g_free0 (_tmp49_);
			_g_free0 (_tmp47_);
		}
	}
	_g_object_unref0 (self->priv->account);
	_g_object_unref0 (self->priv->source);
	_g_object_unref0 (self->priv->destination);
	_g_object_unref0 (self->priv->move_ids);
	G_OBJECT_CLASS (geary_imap_engine_revokable_move_parent_class)->finalize (obj);
}

/**
 * A @{link Geary.Revokable} for {@link MinimalFolder} move operations.
 *
 * This will delay executing the move until (a) the source Folder is closed or (b) a timeout passes.
 * Even then, it will fire its "committed" signal with a {@link RevokableCommittedMove} to allow
 * the user to undo the operation, albeit taking more time to connect, open the destination folder,
 * and move the mail back.
 */
 G_GNUC_NO_INLINE static GType
geary_imap_engine_revokable_move_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyImapEngineRevokableMoveClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_imap_engine_revokable_move_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyImapEngineRevokableMove), 0, (GInstanceInitFunc) geary_imap_engine_revokable_move_instance_init, NULL };
	GType geary_imap_engine_revokable_move_type_id;
	geary_imap_engine_revokable_move_type_id = g_type_register_static (GEARY_TYPE_REVOKABLE, "GearyImapEngineRevokableMove", &g_define_type_info, 0);
	GearyImapEngineRevokableMove_private_offset = g_type_add_instance_private (geary_imap_engine_revokable_move_type_id, sizeof (GearyImapEngineRevokableMovePrivate));
	return geary_imap_engine_revokable_move_type_id;
}

GType
geary_imap_engine_revokable_move_get_type (void)
{
	static gsize geary_imap_engine_revokable_move_type_id__once = 0;
	if (g_once_init_enter (&geary_imap_engine_revokable_move_type_id__once)) {
		GType geary_imap_engine_revokable_move_type_id;
		geary_imap_engine_revokable_move_type_id = geary_imap_engine_revokable_move_get_type_once ();
		g_once_init_leave (&geary_imap_engine_revokable_move_type_id__once, geary_imap_engine_revokable_move_type_id);
	}
	return geary_imap_engine_revokable_move_type_id__once;
}

