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

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <json-glib/json-glib.h>
#include <gio/gio.h>

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

#define DC_TYPE_ENTERED_LOGIN_PARAMS (dc_entered_login_params_get_type ())
#define DC_ENTERED_LOGIN_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_ENTERED_LOGIN_PARAMS, DcEnteredLoginParams))
#define DC_ENTERED_LOGIN_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_ENTERED_LOGIN_PARAMS, DcEnteredLoginParamsClass))
#define DC_IS_ENTERED_LOGIN_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_ENTERED_LOGIN_PARAMS))
#define DC_IS_ENTERED_LOGIN_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_ENTERED_LOGIN_PARAMS))
#define DC_ENTERED_LOGIN_PARAMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_ENTERED_LOGIN_PARAMS, DcEnteredLoginParamsClass))

typedef struct _DcEnteredLoginParams DcEnteredLoginParams;
typedef struct _DcEnteredLoginParamsClass DcEnteredLoginParamsClass;
typedef struct _DcEnteredLoginParamsPrivate DcEnteredLoginParamsPrivate;
enum  {
	DC_ENTERED_LOGIN_PARAMS_0_PROPERTY,
	DC_ENTERED_LOGIN_PARAMS_NUM_PROPERTIES
};
static GParamSpec* dc_entered_login_params_properties[DC_ENTERED_LOGIN_PARAMS_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define DC_TYPE_RPC_CLIENT (dc_rpc_client_get_type ())
#define DC_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_RPC_CLIENT, DcRpcClient))
#define DC_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_RPC_CLIENT, DcRpcClientClass))
#define DC_IS_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_RPC_CLIENT))
#define DC_IS_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_RPC_CLIENT))
#define DC_RPC_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_RPC_CLIENT, DcRpcClientClass))

typedef struct _DcRpcClient DcRpcClient;
typedef struct _DcRpcClientClass DcRpcClientClass;
typedef struct _DcRpcClientPrivate DcRpcClientPrivate;

#define DC_TYPE_RPC_TRANSPORT (dc_rpc_transport_get_type ())
#define DC_RPC_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_RPC_TRANSPORT, DcRpcTransport))
#define DC_RPC_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_RPC_TRANSPORT, DcRpcTransportClass))
#define DC_IS_RPC_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_RPC_TRANSPORT))
#define DC_IS_RPC_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_RPC_TRANSPORT))
#define DC_RPC_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_RPC_TRANSPORT, DcRpcTransportClass))

typedef struct _DcRpcTransport DcRpcTransport;
typedef struct _DcRpcTransportClass DcRpcTransportClass;
enum  {
	DC_RPC_CLIENT_0_PROPERTY,
	DC_RPC_CLIENT_IS_CONNECTED_PROPERTY,
	DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY,
	DC_RPC_CLIENT_SELF_EMAIL_PROPERTY,
	DC_RPC_CLIENT_NUM_PROPERTIES
};
static GParamSpec* dc_rpc_client_properties[DC_RPC_CLIENT_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _DcRpcClientStartData DcRpcClientStartData;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
typedef struct _DcRpcClientCallData DcRpcClientCallData;

#define DC_TYPE_PARAMS (dc_params_get_type ())
#define DC_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_PARAMS, DcParams))
#define DC_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_PARAMS, DcParamsClass))
#define DC_IS_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_PARAMS))
#define DC_IS_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_PARAMS))
#define DC_PARAMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_PARAMS, DcParamsClass))

typedef struct _DcParams DcParams;
typedef struct _DcParamsClass DcParamsClass;
typedef struct _DcRpcClientGetAllAccountsData DcRpcClientGetAllAccountsData;
typedef struct _DcRpcClientAddAccountData DcRpcClientAddAccountData;
typedef struct _DcRpcClientSelectAccountData DcRpcClientSelectAccountData;
typedef struct _DcRpcClientIsConfiguredData DcRpcClientIsConfiguredData;
typedef struct _DcRpcClientRemoveAccountData DcRpcClientRemoveAccountData;
typedef struct _DcRpcClientStartIoData DcRpcClientStartIoData;
typedef struct _DcRpcClientStopIoData DcRpcClientStopIoData;
typedef struct _DcRpcClientStartIoForAllAccountsData DcRpcClientStartIoForAllAccountsData;
typedef struct _DcRpcClientGetConnectivityData DcRpcClientGetConnectivityData;
typedef struct _DcRpcClientGetConnectivityHtmlData DcRpcClientGetConnectivityHtmlData;
typedef struct _DcRpcClientGetAccountFileSizeData DcRpcClientGetAccountFileSizeData;
typedef struct _DcRpcClientGetBlobDirData DcRpcClientGetBlobDirData;
typedef struct _DcRpcClientAddTransportFromQrData DcRpcClientAddTransportFromQrData;
typedef struct _DcRpcClientGetBackupData DcRpcClientGetBackupData;
typedef struct _DcRpcClientProvideBackupData DcRpcClientProvideBackupData;
typedef struct _DcRpcClientGetBackupQrData DcRpcClientGetBackupQrData;
typedef struct _DcRpcClientCreateQrSvgData DcRpcClientCreateQrSvgData;
typedef struct _DcRpcClientGetChatSecurejoinQrCodeData DcRpcClientGetChatSecurejoinQrCodeData;
typedef struct _DcRpcClientStopOngoingProcessData DcRpcClientStopOngoingProcessData;
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
typedef struct _DcRpcClientGetHttpResponseData DcRpcClientGetHttpResponseData;
typedef struct _DcRpcClientCheckQrData DcRpcClientCheckQrData;
typedef struct _DcRpcClientSecureJoinData DcRpcClientSecureJoinData;
typedef struct _DcRpcClientSetConfigFromQrData DcRpcClientSetConfigFromQrData;
typedef struct _DcRpcClientAddOrUpdateTransportData DcRpcClientAddOrUpdateTransportData;
typedef struct _DcRpcClientListTransportsData DcRpcClientListTransportsData;
typedef struct _DcRpcClientDeleteTransportData DcRpcClientDeleteTransportData;
typedef struct _DcRpcClientBatchSetConfigData DcRpcClientBatchSetConfigData;
typedef struct _DcRpcClientGetConfigData DcRpcClientGetConfigData;
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
typedef struct _DcRpcClientGetChatlistEntriesForData DcRpcClientGetChatlistEntriesForData;
typedef struct _DcRpcClientGetChatlistItemsByEntriesForData DcRpcClientGetChatlistItemsByEntriesForData;
typedef struct _DcRpcClientGetFreshMsgCountData DcRpcClientGetFreshMsgCountData;
typedef struct _DcRpcClientGetFreshMsgIdsData DcRpcClientGetFreshMsgIdsData;
typedef struct _DcRpcClientGetFullChatByIdForData DcRpcClientGetFullChatByIdForData;
typedef struct _DcRpcClientGetMessageIdsForData DcRpcClientGetMessageIdsForData;
typedef struct _DcRpcClientGetMessageForData DcRpcClientGetMessageForData;
typedef struct _DcRpcClientGetMessageHtmlForData DcRpcClientGetMessageHtmlForData;
typedef struct _DcRpcClientGetMessageHtmlData DcRpcClientGetMessageHtmlData;
typedef struct _DcRpcClientDownloadFullMessageData DcRpcClientDownloadFullMessageData;

#define DC_TYPE_MESSAGE (dc_message_get_type ())
#define DC_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MESSAGE, DcMessage))
#define DC_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MESSAGE, DcMessageClass))
#define DC_IS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MESSAGE))
#define DC_IS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MESSAGE))
#define DC_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MESSAGE, DcMessageClass))

typedef struct _DcMessage DcMessage;
typedef struct _DcMessageClass DcMessageClass;
typedef struct _DcRpcClientFetchMessageData DcRpcClientFetchMessageData;
typedef struct _DcRpcClientFetchMessageForData DcRpcClientFetchMessageForData;
typedef struct _DcRpcClientGetMessagesForData DcRpcClientGetMessagesForData;
typedef struct _DcRpcClientGetParsedMessagesData DcRpcClientGetParsedMessagesData;
typedef struct _DcRpcClientSendMsgData DcRpcClientSendMsgData;
typedef struct _DcRpcClientGetDraftData DcRpcClientGetDraftData;
typedef struct _DcRpcClientSetDraftData DcRpcClientSetDraftData;
typedef struct _DcRpcClientRemoveDraftData DcRpcClientRemoveDraftData;
typedef struct _DcRpcClientSendEditRequestData DcRpcClientSendEditRequestData;
typedef struct _DcRpcClientSendReactionData DcRpcClientSendReactionData;
typedef struct _DcRpcClientSetPinnedMessageStateData DcRpcClientSetPinnedMessageStateData;
typedef struct _DcRpcClientGetPinnedMessagesData DcRpcClientGetPinnedMessagesData;
typedef struct _DcRpcClientMarknoticedChatData DcRpcClientMarknoticedChatData;
typedef struct _DcRpcClientMarkfreshChatData DcRpcClientMarkfreshChatData;
typedef struct _DcRpcClientMarkSeenMsgsData DcRpcClientMarkSeenMsgsData;
typedef struct _DcRpcClientGetNextEventData DcRpcClientGetNextEventData;
typedef struct _DcRpcClientGetContactIdsForData DcRpcClientGetContactIdsForData;
typedef struct _DcRpcClientCreateContactData DcRpcClientCreateContactData;
typedef struct _DcRpcClientLookupContactData DcRpcClientLookupContactData;
typedef struct _DcRpcClientGetOrCreateContactData DcRpcClientGetOrCreateContactData;
typedef struct _DcRpcClientGetOrCreateChatByContactData DcRpcClientGetOrCreateChatByContactData;
typedef struct _DcRpcClientCreateGroupData DcRpcClientCreateGroupData;
typedef struct _DcRpcClientCreateBroadcastData DcRpcClientCreateBroadcastData;
typedef struct _DcRpcClientLeaveGroupData DcRpcClientLeaveGroupData;
typedef struct _DcRpcClientDeleteChatData DcRpcClientDeleteChatData;
typedef struct _DcRpcClientAcceptChatData DcRpcClientAcceptChatData;
typedef struct _DcRpcClientBlockChatData DcRpcClientBlockChatData;
typedef struct _DcRpcClientBlockContactData DcRpcClientBlockContactData;
typedef struct _DcRpcClientUnblockContactData DcRpcClientUnblockContactData;
typedef struct _DcRpcClientChangeContactNameData DcRpcClientChangeContactNameData;
typedef struct _DcRpcClientSetChatMuteDurationData DcRpcClientSetChatMuteDurationData;
typedef struct _DcRpcClientSetChatVisibilityData DcRpcClientSetChatVisibilityData;
typedef struct _DcRpcClientGetChatMediaData DcRpcClientGetChatMediaData;
typedef struct _DcRpcClientDeleteMessagesData DcRpcClientDeleteMessagesData;
typedef struct _DcRpcClientForwardMessagesData DcRpcClientForwardMessagesData;
typedef struct _DcRpcClientDeleteMessagesForAllData DcRpcClientDeleteMessagesForAllData;
typedef struct _DcRpcClientGetContactForData DcRpcClientGetContactForData;
typedef struct _DcRpcClientAddContactToChatData DcRpcClientAddContactToChatData;
typedef struct _DcRpcClientRemoveContactFromChatData DcRpcClientRemoveContactFromChatData;
typedef struct _DcRpcClientSetChatProfileImageData DcRpcClientSetChatProfileImageData;
typedef struct _DcRpcClientSetChatNameData DcRpcClientSetChatNameData;
typedef struct _DcRpcClientSetChatEphemeralTimerData DcRpcClientSetChatEphemeralTimerData;
enum  {
	DC_RPC_CLIENT_DISCONNECTED_SIGNAL,
	DC_RPC_CLIENT_NUM_SIGNALS
};
static guint dc_rpc_client_signals[DC_RPC_CLIENT_NUM_SIGNALS] = {0};

struct _DcEnteredLoginParams {
	GObject parent_instance;
	DcEnteredLoginParamsPrivate * priv;
	gchar* addr;
	gchar* password;
	gchar* imap_user;
	gchar* imap_server;
	gint imap_port;
	gchar* imap_security;
	gchar* smtp_user;
	gchar* smtp_password;
	gchar* smtp_server;
	gint smtp_port;
	gchar* smtp_security;
	gchar* certificate_checks;
};

struct _DcEnteredLoginParamsClass {
	GObjectClass parent_class;
};

struct _DcRpcClient {
	GObject parent_instance;
	DcRpcClientPrivate * priv;
};

struct _DcRpcClientClass {
	GObjectClass parent_class;
};

struct _DcRpcClientPrivate {
	DcRpcTransport* transport;
	gint _account_id;
	gchar* _self_email;
};

struct _DcRpcClientStartData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar** argv;
	gint argv_length1;
	gchar* cwd;
	gchar* accounts_path;
	DcRpcTransport* _tmp0_;
	GError* _inner_error0_;
};

struct _DcRpcClientCallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* method;
	JsonNode* params;
	JsonNode* result;
	JsonNode* _tmp0_;
	DcRpcTransport* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* _tmp3_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetAllAccountsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	JsonNode* result;
	JsonNode* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientAddAccountData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	GError* _inner_error0_;
};

struct _DcRpcClientSelectAccountData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientIsConfiguredData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gboolean result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientRemoveAccountData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientStartIoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientStopIoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientStartIoForAllAccountsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetConnectivityData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetConnectivityHtmlData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetAccountFileSizeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint64 result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetBlobDirData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	gboolean _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientAddTransportFromQrData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetBackupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientProvideBackupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetBackupQrData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientCreateQrSvgData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* text;
	gchar* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatSecurejoinQrCodeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint chat_id;
	gchar* result;
	DcParams* p;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	JsonNode* _result_;
	DcParams* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	JsonNode* _tmp13_;
	JsonNode* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	GError* _inner_error0_;
};

struct _DcRpcClientStopOngoingProcessData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetHttpResponseData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* url;
	gchar* mimetype;
	guint8* result;
	gint result_length1;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	gboolean _tmp11_;
	JsonNode* _tmp12_;
	JsonNode* _tmp13_;
	GError* _tmp14_;
	JsonObject* obj;
	JsonNode* _tmp15_;
	JsonObject* _tmp16_;
	JsonObject* _tmp17_;
	gboolean _tmp18_;
	JsonObject* _tmp19_;
	JsonObject* _tmp20_;
	JsonNode* _tmp21_;
	JsonObject* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	const gchar* _tmp25_;
	JsonObject* _tmp26_;
	JsonObject* _tmp27_;
	const gchar* _tmp28_;
	gchar* blob;
	gchar* _tmp29_;
	gint rem;
	const gchar* _tmp30_;
	gint _tmp31_;
	gint _tmp32_;
	const gchar* _tmp33_;
	gchar* _tmp34_;
	const gchar* _tmp35_;
	gchar* _tmp36_;
	const gchar* _tmp37_;
	gsize _tmp38_;
	guchar* _tmp39_;
	guint8* _tmp40_;
	gint _tmp40__length1;
	GError* _inner_error0_;
};

struct _DcRpcClientCheckQrData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	gboolean _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSecureJoinData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetConfigFromQrData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientAddOrUpdateTransportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcEnteredLoginParams* p;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	const gchar* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	const gchar* _tmp9_;
	DcParams* _tmp10_;
	DcParams* _tmp11_;
	const gchar* _tmp12_;
	DcParams* _tmp13_;
	DcParams* _tmp14_;
	const gchar* _tmp15_;
	DcParams* _tmp16_;
	DcParams* _tmp17_;
	DcParams* _tmp18_;
	DcParams* _tmp19_;
	const gchar* _tmp20_;
	DcParams* _tmp21_;
	DcParams* _tmp22_;
	const gchar* _tmp23_;
	DcParams* _tmp24_;
	DcParams* _tmp25_;
	const gchar* _tmp26_;
	DcParams* _tmp27_;
	DcParams* _tmp28_;
	const gchar* _tmp29_;
	DcParams* _tmp30_;
	DcParams* _tmp31_;
	DcParams* _tmp32_;
	DcParams* _tmp33_;
	const gchar* _tmp34_;
	DcParams* _tmp35_;
	DcParams* _tmp36_;
	const gchar* _tmp37_;
	DcParams* _tmp38_;
	DcParams* _tmp39_;
	DcParams* _tmp40_;
	DcParams* _tmp41_;
	DcParams* _tmp42_;
	DcParams* _tmp43_;
	JsonNode* _tmp44_;
	JsonNode* _tmp45_;
	JsonNode* _tmp46_;
	JsonNode* _tmp47_;
	GError* _inner_error0_;
};

struct _DcRpcClientListTransportsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	JsonNode* result;
	JsonNode* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientDeleteTransportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* addr;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientBatchSetConfigData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* key;
	gchar* val;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	JsonNode* _tmp13_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetConfigData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* key;
	gint acct_id;
	gchar* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatlistEntriesForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* query;
	gint list_flags;
	JsonArray* result;
	DcParams* params;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	JsonNode* _result_;
	DcParams* _tmp10_;
	DcParams* _tmp11_;
	DcParams* _tmp12_;
	DcParams* _tmp13_;
	DcParams* _tmp14_;
	JsonNode* _tmp15_;
	JsonNode* _tmp16_;
	JsonNode* _tmp17_;
	JsonNode* _tmp18_;
	JsonArray* _tmp19_;
	JsonArray* _tmp20_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatlistItemsByEntriesForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	JsonArray* entries;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetFreshMsgCountData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint result;
	gint* _tmp0_;
	gint _tmp1_;
	gint* _tmp2_;
	gint _tmp0__length1;
	gint __tmp0__size_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetFreshMsgIdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint* result;
	gint result_length1;
	gint* _tmp0_;
	gint* _tmp1_;
	gint _tmp1__length1;
	JsonNode* _result_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	gboolean _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	gint* _tmp13_;
	gint* _tmp14_;
	gint _tmp14__length1;
	JsonArray* arr;
	JsonNode* _tmp15_;
	JsonArray* _tmp16_;
	JsonArray* _tmp17_;
	gint* ids;
	JsonArray* _tmp18_;
	gint* _tmp19_;
	gint ids_length1;
	gint _ids_size_;
	guint i;
	gboolean _tmp20_;
	guint _tmp21_;
	JsonArray* _tmp22_;
	gint* _tmp23_;
	gint _tmp23__length1;
	JsonArray* _tmp24_;
	gint* _tmp25_;
	gint _tmp25__length1;
	GError* _inner_error0_;
};

struct _DcRpcClientGetFullChatByIdForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint chat_id;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessageIdsForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint chat_id;
	gboolean info_only;
	JsonArray* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	JsonNode* _tmp13_;
	JsonArray* _tmp14_;
	JsonArray* _tmp15_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessageForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint msg_id;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessageHtmlForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint msg_id;
	gchar* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessageHtmlData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	gchar* result;
	gchar* _tmp0_;
	gint _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GError* _inner_error0_;
};

struct _DcRpcClientDownloadFullMessageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientFetchMessageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	DcMessage* result;
	DcMessage* _tmp0_;
	gint _tmp1_;
	const gchar* _tmp2_;
	DcMessage* _tmp3_;
	DcMessage* _tmp4_;
	GError* _inner_error0_;
};

struct _DcRpcClientFetchMessageForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint msg_id;
	gchar* self_addr;
	DcMessage* result;
	JsonObject* obj;
	JsonObject* _tmp0_;
	DcMessage* _tmp1_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessagesForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint* msg_ids;
	gint msg_ids_length1;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetParsedMessagesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	DcMessage** result;
	gint result_length1;
	JsonObject* map;
	gint _tmp0_;
	JsonObject* _tmp1_;
	DcMessage** msgs;
	DcMessage** _tmp2_;
	gint msgs_length1;
	gint _msgs_size_;
	JsonObject* _tmp3_;
	DcMessage** _tmp4_;
	gint _tmp4__length1;
	gint* msg_id_collection;
	gint msg_id_collection_length1;
	gint _msg_id_collection_size_;
	gint msg_id_it;
	gint msg_id;
	gchar* key;
	gchar* _tmp5_;
	JsonObject* _tmp6_;
	const gchar* _tmp7_;
	JsonNode* node;
	JsonObject* _tmp8_;
	const gchar* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	gboolean _tmp12_;
	JsonNode* _tmp13_;
	JsonNode* _tmp14_;
	JsonObject* obj;
	JsonNode* _tmp15_;
	JsonObject* _tmp16_;
	JsonObject* _tmp17_;
	JsonObject* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gboolean _tmp21_;
	JsonObject* _tmp22_;
	const gchar* _tmp23_;
	DcMessage* _tmp24_;
	DcMessage** _tmp25_;
	gint _tmp25__length1;
	GError* _inner_error0_;
};

struct _DcRpcClientSendMsgData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar* text;
	gchar* file_path;
	gchar* file_name;
	gint quoted_msg_id;
	gchar* view_type;
	gint result;
	DcParams* p;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	DcParams* _tmp10_;
	DcParams* _tmp11_;
	DcParams* _tmp12_;
	DcParams* _tmp13_;
	DcParams* _tmp14_;
	DcParams* _tmp15_;
	DcParams* _tmp16_;
	DcParams* _tmp17_;
	DcParams* _tmp18_;
	DcParams* _tmp19_;
	DcParams* _tmp20_;
	DcParams* _tmp21_;
	DcParams* _tmp22_;
	DcParams* _tmp23_;
	DcParams* _tmp24_;
	DcParams* _tmp25_;
	JsonNode* _result_;
	DcParams* _tmp26_;
	JsonNode* _tmp27_;
	JsonNode* _tmp28_;
	JsonNode* _tmp29_;
	JsonNode* _tmp30_;
	gint _tmp31_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetDraftData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcMessage* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	JsonObject* _tmp13_;
	const gchar* _tmp14_;
	DcMessage* _tmp15_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetDraftData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar* text;
	gchar* file_path;
	gchar* file_name;
	gint quoted_msg_id;
	gchar* view_type;
	DcParams* p;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	DcParams* _tmp10_;
	DcParams* _tmp11_;
	DcParams* _tmp12_;
	DcParams* _tmp13_;
	DcParams* _tmp14_;
	DcParams* _tmp15_;
	DcParams* _tmp16_;
	DcParams* _tmp17_;
	DcParams* _tmp18_;
	DcParams* _tmp19_;
	DcParams* _tmp20_;
	DcParams* _tmp21_;
	DcParams* _tmp22_;
	JsonNode* _tmp23_;
	JsonNode* _tmp24_;
	JsonNode* _tmp25_;
	JsonNode* _tmp26_;
	GError* _inner_error0_;
};

struct _DcRpcClientRemoveDraftData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientSendEditRequestData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	gchar* new_text;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSendReactionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	gchar** emojis;
	gint emojis_length1;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetPinnedMessageStateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	gboolean pinned;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetPinnedMessagesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gint* result;
	gint result_length1;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	gboolean _tmp11_;
	gint* _tmp12_;
	gint* _tmp13_;
	gint _tmp13__length1;
	JsonArray* arr;
	JsonArray* _tmp14_;
	JsonArray* _tmp15_;
	gint* msg_ids;
	JsonArray* _tmp16_;
	gint* _tmp17_;
	gint msg_ids_length1;
	gint _msg_ids_size_;
	guint i;
	gboolean _tmp18_;
	guint _tmp19_;
	JsonArray* _tmp20_;
	gint* _tmp21_;
	gint _tmp21__length1;
	JsonArray* _tmp22_;
	gint* _tmp23_;
	gint _tmp23__length1;
	GError* _inner_error0_;
};

struct _DcRpcClientMarknoticedChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientMarkfreshChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientMarkSeenMsgsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetNextEventData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	gboolean _tmp6_;
	JsonObject* _tmp7_;
	JsonObject* _tmp8_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetContactIdsForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* query;
	JsonArray* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	gboolean _tmp12_;
	JsonArray* _tmp13_;
	JsonArray* _tmp14_;
	GError* _inner_error0_;
};

struct _DcRpcClientCreateContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* email;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientLookupContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* email;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	gboolean _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetOrCreateContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* email;
	gint result;
	gint contact_id;
	gint _tmp0_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetOrCreateChatByContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint contact_id;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	JsonNode* _tmp13_;
	JsonNode* _tmp14_;
	JsonNode* _tmp15_;
	JsonNode* _tmp16_;
	JsonNode* _tmp17_;
	DcParams* _tmp18_;
	DcParams* _tmp19_;
	gint _tmp20_;
	DcParams* _tmp21_;
	DcParams* _tmp22_;
	DcParams* _tmp23_;
	DcParams* _tmp24_;
	JsonNode* _tmp25_;
	JsonNode* _tmp26_;
	JsonNode* _tmp27_;
	JsonNode* _tmp28_;
	JsonNode* _tmp29_;
	JsonNode* _tmp30_;
	GError* _inner_error0_;
};

struct _DcRpcClientCreateGroupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* name;
	gboolean protect;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientCreateBroadcastData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* name;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientLeaveGroupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientDeleteChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientAcceptChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientBlockChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientBlockContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint contact_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientUnblockContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint contact_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientChangeContactNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint contact_id;
	gchar* name;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetChatMuteDurationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gint seconds;
	DcParams* p;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	DcParams* _tmp10_;
	DcParams* _tmp11_;
	DcParams* _tmp12_;
	DcParams* _tmp13_;
	DcParams* _tmp14_;
	const gchar* _tmp15_;
	DcParams* _tmp16_;
	DcParams* _tmp17_;
	DcParams* _tmp18_;
	DcParams* _tmp19_;
	DcParams* _tmp20_;
	DcParams* _tmp21_;
	JsonNode* _tmp22_;
	JsonNode* _tmp23_;
	JsonNode* _tmp24_;
	JsonNode* _tmp25_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetChatVisibilityData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar* visibility;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatMediaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar** types;
	gint types_length1;
	gint* result;
	gint result_length1;
	DcParams* p;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	DcParams* _tmp10_;
	gint i;
	gboolean _tmp11_;
	gint _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	DcParams* _tmp15_;
	DcParams* _tmp16_;
	DcParams* _tmp17_;
	JsonNode* _result_;
	DcParams* _tmp18_;
	JsonNode* _tmp19_;
	JsonNode* _tmp20_;
	JsonNode* _tmp21_;
	JsonNode* _tmp22_;
	gboolean _tmp23_;
	gint* _tmp24_;
	gint* _tmp25_;
	gint _tmp25__length1;
	JsonArray* arr;
	JsonArray* _tmp26_;
	JsonArray* _tmp27_;
	gint* ids;
	JsonArray* _tmp28_;
	gint* _tmp29_;
	gint ids_length1;
	gint _ids_size_;
	guint _vala1_i;
	gboolean _tmp30_;
	guint _tmp31_;
	JsonArray* _tmp32_;
	gint* _tmp33_;
	gint _tmp33__length1;
	JsonArray* _tmp34_;
	gint* _tmp35_;
	gint _tmp35__length1;
	GError* _inner_error0_;
};

struct _DcRpcClientDeleteMessagesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientForwardMessagesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientDeleteMessagesForAllData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetContactForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint contact_id;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	gboolean _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientAddContactToChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gint contact_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientRemoveContactFromChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gint contact_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetChatProfileImageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar* image_path;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetChatNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar* name;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetChatEphemeralTimerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gint timer;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

static gpointer dc_entered_login_params_parent_class = NULL;
static gint DcRpcClient_private_offset;
static gpointer dc_rpc_client_parent_class = NULL;

VALA_EXTERN GType dc_entered_login_params_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcEnteredLoginParams, g_object_unref)
VALA_EXTERN DcEnteredLoginParams* dc_entered_login_params_from_json (JsonObject* obj);
VALA_EXTERN DcEnteredLoginParams* dc_entered_login_params_new (void);
VALA_EXTERN DcEnteredLoginParams* dc_entered_login_params_construct (GType object_type);
VALA_EXTERN gchar* dc_json_str (JsonObject* obj,
                    const gchar* key);
VALA_EXTERN gint64 dc_json_int (JsonObject* obj,
                    const gchar* key,
                    gint64 fallback);
static void dc_entered_login_params_finalize (GObject * obj);
static GType dc_entered_login_params_get_type_once (void);
VALA_EXTERN GType dc_rpc_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRpcClient, g_object_unref)
VALA_EXTERN GType dc_rpc_transport_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRpcTransport, g_object_unref)
static void dc_rpc_client_start_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_start (DcRpcClient* self,
                          gchar** argv,
                          gint argv_length1,
                          const gchar* cwd,
                          const gchar* accounts_path,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_start_finish (DcRpcClient* self,
                                 GAsyncResult* _res_,
                                 GError** error);
static gboolean dc_rpc_client_start_co (DcRpcClientStartData* _data_);
VALA_EXTERN void dc_rpc_transport_start (DcRpcTransport* self,
                             gchar** argv,
                             gint argv_length1,
                             const gchar* cwd,
                             const gchar* accounts_path,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_transport_start_finish (DcRpcTransport* self,
                                    GAsyncResult* _res_,
                                    GError** error);
static void dc_rpc_client_start_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_stop (DcRpcClient* self);
VALA_EXTERN void dc_rpc_transport_stop (DcRpcTransport* self);
static void _vala_JsonNode_free (JsonNode* self);
static void dc_rpc_client_call_data_free (gpointer _data);
static JsonNode* _vala_JsonNode_copy (JsonNode* self);
VALA_EXTERN void dc_rpc_client_call (DcRpcClient* self,
                         const gchar* method,
                         JsonNode* params,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_);
VALA_EXTERN JsonNode* dc_rpc_client_call_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error);
static gboolean dc_rpc_client_call_co (DcRpcClientCallData* _data_);
VALA_EXTERN void dc_rpc_transport_call (DcRpcTransport* self,
                            const gchar* method,
                            JsonNode* params,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_);
VALA_EXTERN JsonNode* dc_rpc_transport_call_finish (DcRpcTransport* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static void dc_rpc_client_call_ready (GObject* source_object,
                               GAsyncResult* _res_,
                               gpointer _user_data_);
static void dc_rpc_client_get_all_accounts_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_all_accounts (DcRpcClient* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN JsonNode* dc_rpc_client_get_all_accounts_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_get_all_accounts_co (DcRpcClientGetAllAccountsData* _data_);
VALA_EXTERN GType dc_params_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcParams, g_object_unref)
VALA_EXTERN DcParams* dc_params_begin (void);
VALA_EXTERN JsonNode* dc_params_build (DcParams* self);
static void dc_rpc_client_get_all_accounts_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_add_account_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_add_account (DcRpcClient* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_add_account_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_add_account_co (DcRpcClientAddAccountData* _data_);
static void dc_rpc_client_add_account_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_select_account_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_select_account (DcRpcClient* self,
                                   gint acct_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_select_account_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_select_account_co (DcRpcClientSelectAccountData* _data_);
VALA_EXTERN DcParams* dc_params_add_int (DcParams* self,
                             gint v);
static void dc_rpc_client_select_account_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_is_configured_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_is_configured (DcRpcClient* self,
                                  gint acct_id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN gboolean dc_rpc_client_is_configured_finish (DcRpcClient* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static gboolean dc_rpc_client_is_configured_co (DcRpcClientIsConfiguredData* _data_);
static void dc_rpc_client_is_configured_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_remove_account_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_remove_account (DcRpcClient* self,
                                   gint acct_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_remove_account_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_remove_account_co (DcRpcClientRemoveAccountData* _data_);
static void dc_rpc_client_remove_account_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_start_io_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_start_io (DcRpcClient* self,
                             gint acct_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_start_io_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error);
static gboolean dc_rpc_client_start_io_co (DcRpcClientStartIoData* _data_);
static void dc_rpc_client_start_io_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_);
static void dc_rpc_client_stop_io_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_stop_io (DcRpcClient* self,
                            gint acct_id,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_stop_io_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error);
static gboolean dc_rpc_client_stop_io_co (DcRpcClientStopIoData* _data_);
static void dc_rpc_client_stop_io_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_);
static void dc_rpc_client_start_io_for_all_accounts_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_start_io_for_all_accounts (DcRpcClient* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_start_io_for_all_accounts_finish (DcRpcClient* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static gboolean dc_rpc_client_start_io_for_all_accounts_co (DcRpcClientStartIoForAllAccountsData* _data_);
static void dc_rpc_client_start_io_for_all_accounts_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void dc_rpc_client_get_connectivity_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_connectivity (DcRpcClient* self,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_connectivity_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_get_connectivity_co (DcRpcClientGetConnectivityData* _data_);
static void dc_rpc_client_get_connectivity_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_get_connectivity_html_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_connectivity_html (DcRpcClient* self,
                                          gint acct_id,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_connectivity_html_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_get_connectivity_html_co (DcRpcClientGetConnectivityHtmlData* _data_);
static void dc_rpc_client_get_connectivity_html_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_get_account_file_size_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_account_file_size (DcRpcClient* self,
                                          gint acct_id,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN gint64 dc_rpc_client_get_account_file_size_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_get_account_file_size_co (DcRpcClientGetAccountFileSizeData* _data_);
static void dc_rpc_client_get_account_file_size_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_get_blob_dir_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_blob_dir (DcRpcClient* self,
                                 gint acct_id,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_blob_dir_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_get_blob_dir_co (DcRpcClientGetBlobDirData* _data_);
static void dc_rpc_client_get_blob_dir_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void dc_rpc_client_add_transport_from_qr_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_add_transport_from_qr (DcRpcClient* self,
                                          gint acct_id,
                                          const gchar* qr_text,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_add_transport_from_qr_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_add_transport_from_qr_co (DcRpcClientAddTransportFromQrData* _data_);
VALA_EXTERN DcParams* dc_params_add_string (DcParams* self,
                                const gchar* v);
static void dc_rpc_client_add_transport_from_qr_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_get_backup_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_backup (DcRpcClient* self,
                               gint acct_id,
                               const gchar* qr_text,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_get_backup_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error);
static gboolean dc_rpc_client_get_backup_co (DcRpcClientGetBackupData* _data_);
static void dc_rpc_client_get_backup_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_);
static void dc_rpc_client_provide_backup_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_provide_backup (DcRpcClient* self,
                                   gint acct_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_provide_backup_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_provide_backup_co (DcRpcClientProvideBackupData* _data_);
static void dc_rpc_client_provide_backup_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_get_backup_qr_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_backup_qr (DcRpcClient* self,
                                  gint acct_id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_backup_qr_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_get_backup_qr_co (DcRpcClientGetBackupQrData* _data_);
static void dc_rpc_client_get_backup_qr_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_create_qr_svg_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_create_qr_svg (DcRpcClient* self,
                                  const gchar* text,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_create_qr_svg_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_create_qr_svg_co (DcRpcClientCreateQrSvgData* _data_);
static void dc_rpc_client_create_qr_svg_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_get_chat_securejoin_qr_code_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_chat_securejoin_qr_code (DcRpcClient* self,
                                                gint acct_id,
                                                gint chat_id,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_chat_securejoin_qr_code_finish (DcRpcClient* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static gboolean dc_rpc_client_get_chat_securejoin_qr_code_co (DcRpcClientGetChatSecurejoinQrCodeData* _data_);
VALA_EXTERN DcParams* dc_params_add_null (DcParams* self);
static void dc_rpc_client_get_chat_securejoin_qr_code_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void dc_rpc_client_stop_ongoing_process_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_stop_ongoing_process (DcRpcClient* self,
                                         gint acct_id,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_stop_ongoing_process_finish (DcRpcClient* self,
                                                GAsyncResult* _res_,
                                                GError** error);
static gboolean dc_rpc_client_stop_ongoing_process_co (DcRpcClientStopOngoingProcessData* _data_);
static void dc_rpc_client_stop_ongoing_process_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void dc_rpc_client_get_http_response_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_http_response (DcRpcClient* self,
                                      const gchar* url,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN guint8* dc_rpc_client_get_http_response_finish (DcRpcClient* self,
                                                GAsyncResult* _res_,
                                                gchar** mimetype,
                                                gint* result_length1,
                                                GError** error);
static gboolean dc_rpc_client_get_http_response_co (DcRpcClientGetHttpResponseData* _data_);
VALA_EXTERN gint dc_rpc_client_get_account_id (DcRpcClient* self);
static void dc_rpc_client_get_http_response_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void dc_rpc_client_check_qr_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_check_qr (DcRpcClient* self,
                             gint acct_id,
                             const gchar* qr_text,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_check_qr_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_check_qr_co (DcRpcClientCheckQrData* _data_);
static void dc_rpc_client_check_qr_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_);
static void dc_rpc_client_secure_join_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_secure_join (DcRpcClient* self,
                                gint acct_id,
                                const gchar* qr_text,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_secure_join_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_secure_join_co (DcRpcClientSecureJoinData* _data_);
static void dc_rpc_client_secure_join_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_set_config_from_qr_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_config_from_qr (DcRpcClient* self,
                                       gint acct_id,
                                       const gchar* qr_text,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_config_from_qr_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static gboolean dc_rpc_client_set_config_from_qr_co (DcRpcClientSetConfigFromQrData* _data_);
static void dc_rpc_client_set_config_from_qr_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_);
static void dc_rpc_client_add_or_update_transport_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_add_or_update_transport (DcRpcClient* self,
                                            gint acct_id,
                                            DcEnteredLoginParams* p,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_add_or_update_transport_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_add_or_update_transport_co (DcRpcClientAddOrUpdateTransportData* _data_);
VALA_EXTERN DcParams* dc_params_begin_object (DcParams* self);
VALA_EXTERN DcParams* dc_params_set_string_member (DcParams* self,
                                       const gchar* name,
                                       const gchar* value);
VALA_EXTERN DcParams* dc_params_set_opt_int_member (DcParams* self,
                                        const gchar* name,
                                        gint value);
VALA_EXTERN DcParams* dc_params_set_null_member (DcParams* self,
                                     const gchar* name);
VALA_EXTERN DcParams* dc_params_end_object (DcParams* self);
static void dc_rpc_client_add_or_update_transport_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void dc_rpc_client_list_transports_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_list_transports (DcRpcClient* self,
                                    gint acct_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN JsonNode* dc_rpc_client_list_transports_finish (DcRpcClient* self,
                                                GAsyncResult* _res_,
                                                GError** error);
static gboolean dc_rpc_client_list_transports_co (DcRpcClientListTransportsData* _data_);
static void dc_rpc_client_list_transports_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_delete_transport_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_delete_transport (DcRpcClient* self,
                                     gint acct_id,
                                     const gchar* addr,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_transport_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_delete_transport_co (DcRpcClientDeleteTransportData* _data_);
static void dc_rpc_client_delete_transport_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_batch_set_config_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_batch_set_config (DcRpcClient* self,
                                     const gchar* key,
                                     const gchar* val,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_batch_set_config_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_batch_set_config_co (DcRpcClientBatchSetConfigData* _data_);
static void dc_rpc_client_batch_set_config_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_get_config_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_config (DcRpcClient* self,
                               const gchar* key,
                               gint acct_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_config_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static gboolean dc_rpc_client_get_config_co (DcRpcClientGetConfigData* _data_);
static void dc_rpc_client_get_config_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_);
static void dc_rpc_client_get_chatlist_entries_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_chatlist_entries_for (DcRpcClient* self,
                                             gint acct_id,
                                             const gchar* query,
                                             gint list_flags,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_chatlist_entries_for_finish (DcRpcClient* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static gboolean dc_rpc_client_get_chatlist_entries_for_co (DcRpcClientGetChatlistEntriesForData* _data_);
static void dc_rpc_client_get_chatlist_entries_for_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void dc_rpc_client_get_chatlist_items_by_entries_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_chatlist_items_by_entries_for (DcRpcClient* self,
                                                      gint acct_id,
                                                      JsonArray* entries,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_chatlist_items_by_entries_for_finish (DcRpcClient* self,
                                                                    GAsyncResult* _res_,
                                                                    GError** error);
static gboolean dc_rpc_client_get_chatlist_items_by_entries_for_co (DcRpcClientGetChatlistItemsByEntriesForData* _data_);
VALA_EXTERN DcParams* dc_params_add_json_array (DcParams* self,
                                    JsonArray* arr);
static void dc_rpc_client_get_chatlist_items_by_entries_for_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_);
static void dc_rpc_client_get_fresh_msg_count_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_fresh_msg_count (DcRpcClient* self,
                                        gint acct_id,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_fresh_msg_count_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_get_fresh_msg_count_co (DcRpcClientGetFreshMsgCountData* _data_);
VALA_EXTERN void dc_rpc_client_get_fresh_msg_ids (DcRpcClient* self,
                                      gint acct_id,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN gint* dc_rpc_client_get_fresh_msg_ids_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              gint* result_length1,
                                              GError** error);
static void dc_rpc_client_get_fresh_msg_count_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_get_fresh_msg_ids_data_free (gpointer _data);
static gboolean dc_rpc_client_get_fresh_msg_ids_co (DcRpcClientGetFreshMsgIdsData* _data_);
static void dc_rpc_client_get_fresh_msg_ids_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void dc_rpc_client_get_full_chat_by_id_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_full_chat_by_id_for (DcRpcClient* self,
                                            gint acct_id,
                                            gint chat_id,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_full_chat_by_id_for_finish (DcRpcClient* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static gboolean dc_rpc_client_get_full_chat_by_id_for_co (DcRpcClientGetFullChatByIdForData* _data_);
static void dc_rpc_client_get_full_chat_by_id_for_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void dc_rpc_client_get_message_ids_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_message_ids_for (DcRpcClient* self,
                                        gint acct_id,
                                        gint chat_id,
                                        gboolean info_only,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_message_ids_for_finish (DcRpcClient* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static gboolean dc_rpc_client_get_message_ids_for_co (DcRpcClientGetMessageIdsForData* _data_);
VALA_EXTERN DcParams* dc_params_add_bool (DcParams* self,
                              gboolean v);
static void dc_rpc_client_get_message_ids_for_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_get_message_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_message_for (DcRpcClient* self,
                                    gint acct_id,
                                    gint msg_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_message_for_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean dc_rpc_client_get_message_for_co (DcRpcClientGetMessageForData* _data_);
static void dc_rpc_client_get_message_for_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_get_message_html_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_message_html_for (DcRpcClient* self,
                                         gint acct_id,
                                         gint msg_id,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_message_html_for_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean dc_rpc_client_get_message_html_for_co (DcRpcClientGetMessageHtmlForData* _data_);
static void dc_rpc_client_get_message_html_for_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void dc_rpc_client_get_message_html_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_message_html (DcRpcClient* self,
                                     gint msg_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_message_html_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static gboolean dc_rpc_client_get_message_html_co (DcRpcClientGetMessageHtmlData* _data_);
static void dc_rpc_client_get_message_html_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_download_full_message_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_download_full_message (DcRpcClient* self,
                                          gint msg_id,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_download_full_message_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_download_full_message_co (DcRpcClientDownloadFullMessageData* _data_);
static void dc_rpc_client_download_full_message_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_fetch_message_data_free (gpointer _data);
VALA_EXTERN GType dc_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessage, g_object_unref)
VALA_EXTERN void dc_rpc_client_fetch_message (DcRpcClient* self,
                                  gint msg_id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN DcMessage* dc_rpc_client_fetch_message_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_fetch_message_co (DcRpcClientFetchMessageData* _data_);
VALA_EXTERN void dc_rpc_client_fetch_message_for (DcRpcClient* self,
                                      gint acct_id,
                                      gint msg_id,
                                      const gchar* self_addr,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN DcMessage* dc_rpc_client_fetch_message_for_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
VALA_EXTERN const gchar* dc_rpc_client_get_self_email (DcRpcClient* self);
static void dc_rpc_client_fetch_message_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_fetch_message_for_data_free (gpointer _data);
static gboolean dc_rpc_client_fetch_message_for_co (DcRpcClientFetchMessageForData* _data_);
static void dc_rpc_client_fetch_message_for_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
VALA_EXTERN DcMessage* dc_rpc_parsers_parse_message (JsonObject* obj,
                                         const gchar* self_email);
static void dc_rpc_client_get_messages_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_messages_for (DcRpcClient* self,
                                     gint acct_id,
                                     gint* msg_ids,
                                     gint msg_ids_length1,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_messages_for_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_get_messages_for_co (DcRpcClientGetMessagesForData* _data_);
VALA_EXTERN DcParams* dc_params_add_int_array (DcParams* self,
                                   gint* values,
                                   gint values_length1);
static void dc_rpc_client_get_messages_for_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_get_parsed_messages_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_parsed_messages (DcRpcClient* self,
                                        gint* msg_ids,
                                        gint msg_ids_length1,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN DcMessage** dc_rpc_client_get_parsed_messages_finish (DcRpcClient* self,
                                                      GAsyncResult* _res_,
                                                      gint* result_length1,
                                                      GError** error);
static gboolean dc_rpc_client_get_parsed_messages_co (DcRpcClientGetParsedMessagesData* _data_);
static void dc_rpc_client_get_parsed_messages_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void _vala_array_add17 (DcMessage** * array,
                        gint* length,
                        gint* size,
                        DcMessage* value);
static void dc_rpc_client_send_msg_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_send_msg (DcRpcClient* self,
                             gint chat_id,
                             const gchar* text,
                             const gchar* file_path,
                             const gchar* file_name,
                             gint quoted_msg_id,
                             const gchar* view_type,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_send_msg_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error);
static gboolean dc_rpc_client_send_msg_co (DcRpcClientSendMsgData* _data_);
VALA_EXTERN DcParams* dc_params_set_int_member (DcParams* self,
                                    const gchar* name,
                                    gint value);
static void dc_rpc_client_send_msg_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_);
static void dc_rpc_client_get_draft_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_draft (DcRpcClient* self,
                              gint chat_id,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
VALA_EXTERN DcMessage* dc_rpc_client_get_draft_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_get_draft_co (DcRpcClientGetDraftData* _data_);
static void dc_rpc_client_get_draft_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_);
static void dc_rpc_client_set_draft_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_draft (DcRpcClient* self,
                              gint chat_id,
                              const gchar* text,
                              const gchar* file_path,
                              const gchar* file_name,
                              gint quoted_msg_id,
                              const gchar* view_type,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_draft_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error);
static gboolean dc_rpc_client_set_draft_co (DcRpcClientSetDraftData* _data_);
static void dc_rpc_client_set_draft_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_);
static void dc_rpc_client_remove_draft_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_remove_draft (DcRpcClient* self,
                                 gint chat_id,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_remove_draft_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static gboolean dc_rpc_client_remove_draft_co (DcRpcClientRemoveDraftData* _data_);
static void dc_rpc_client_remove_draft_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void dc_rpc_client_send_edit_request_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_send_edit_request (DcRpcClient* self,
                                      gint msg_id,
                                      const gchar* new_text,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_send_edit_request_finish (DcRpcClient* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static gboolean dc_rpc_client_send_edit_request_co (DcRpcClientSendEditRequestData* _data_);
static void dc_rpc_client_send_edit_request_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void dc_rpc_client_send_reaction_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_send_reaction (DcRpcClient* self,
                                  gint msg_id,
                                  gchar** emojis,
                                  gint emojis_length1,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_send_reaction_finish (DcRpcClient* self,
                                         GAsyncResult* _res_,
                                         GError** error);
static gboolean dc_rpc_client_send_reaction_co (DcRpcClientSendReactionData* _data_);
VALA_EXTERN DcParams* dc_params_add_string_array (DcParams* self,
                                      gchar** values,
                                      gint values_length1);
static void dc_rpc_client_send_reaction_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_set_pinned_message_state_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_pinned_message_state (DcRpcClient* self,
                                             gint msg_id,
                                             gboolean pinned,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_pinned_message_state_finish (DcRpcClient* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static gboolean dc_rpc_client_set_pinned_message_state_co (DcRpcClientSetPinnedMessageStateData* _data_);
static void dc_rpc_client_set_pinned_message_state_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void dc_rpc_client_get_pinned_messages_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_pinned_messages (DcRpcClient* self,
                                        gint chat_id,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN gint* dc_rpc_client_get_pinned_messages_finish (DcRpcClient* self,
                                                GAsyncResult* _res_,
                                                gint* result_length1,
                                                GError** error);
static gboolean dc_rpc_client_get_pinned_messages_co (DcRpcClientGetPinnedMessagesData* _data_);
static void dc_rpc_client_get_pinned_messages_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_marknoticed_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_marknoticed_chat (DcRpcClient* self,
                                     gint chat_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_marknoticed_chat_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_marknoticed_chat_co (DcRpcClientMarknoticedChatData* _data_);
static void dc_rpc_client_marknoticed_chat_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_markfresh_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_markfresh_chat (DcRpcClient* self,
                                   gint chat_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_markfresh_chat_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_markfresh_chat_co (DcRpcClientMarkfreshChatData* _data_);
static void dc_rpc_client_markfresh_chat_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_mark_seen_msgs_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_mark_seen_msgs (DcRpcClient* self,
                                   gint* msg_ids,
                                   gint msg_ids_length1,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_mark_seen_msgs_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_mark_seen_msgs_co (DcRpcClientMarkSeenMsgsData* _data_);
static void dc_rpc_client_mark_seen_msgs_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_get_next_event_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_next_event (DcRpcClient* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_next_event_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_get_next_event_co (DcRpcClientGetNextEventData* _data_);
static void dc_rpc_client_get_next_event_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_get_contact_ids_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_contact_ids_for (DcRpcClient* self,
                                        gint acct_id,
                                        const gchar* query,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_contact_ids_for_finish (DcRpcClient* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static gboolean dc_rpc_client_get_contact_ids_for_co (DcRpcClientGetContactIdsForData* _data_);
static void dc_rpc_client_get_contact_ids_for_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_create_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_create_contact (DcRpcClient* self,
                                   const gchar* email,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_create_contact_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_create_contact_co (DcRpcClientCreateContactData* _data_);
static void dc_rpc_client_create_contact_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_lookup_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_lookup_contact (DcRpcClient* self,
                                   const gchar* email,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_lookup_contact_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_lookup_contact_co (DcRpcClientLookupContactData* _data_);
static void dc_rpc_client_lookup_contact_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_get_or_create_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_or_create_contact (DcRpcClient* self,
                                          const gchar* email,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_or_create_contact_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_get_or_create_contact_co (DcRpcClientGetOrCreateContactData* _data_);
static void dc_rpc_client_get_or_create_contact_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_get_or_create_chat_by_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_or_create_chat_by_contact (DcRpcClient* self,
                                                  gint contact_id,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_or_create_chat_by_contact_finish (DcRpcClient* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static gboolean dc_rpc_client_get_or_create_chat_by_contact_co (DcRpcClientGetOrCreateChatByContactData* _data_);
static void dc_rpc_client_get_or_create_chat_by_contact_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void dc_rpc_client_create_group_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_create_group (DcRpcClient* self,
                                 const gchar* name,
                                 gboolean protect,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_create_group_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static gboolean dc_rpc_client_create_group_co (DcRpcClientCreateGroupData* _data_);
static void dc_rpc_client_create_group_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void dc_rpc_client_create_broadcast_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_create_broadcast (DcRpcClient* self,
                                     const gchar* name,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_create_broadcast_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_create_broadcast_co (DcRpcClientCreateBroadcastData* _data_);
static void dc_rpc_client_create_broadcast_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_leave_group_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_leave_group (DcRpcClient* self,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_leave_group_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_leave_group_co (DcRpcClientLeaveGroupData* _data_);
static void dc_rpc_client_leave_group_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_delete_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_delete_chat (DcRpcClient* self,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_chat_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_delete_chat_co (DcRpcClientDeleteChatData* _data_);
static void dc_rpc_client_delete_chat_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_accept_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_accept_chat (DcRpcClient* self,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_accept_chat_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_accept_chat_co (DcRpcClientAcceptChatData* _data_);
static void dc_rpc_client_accept_chat_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_block_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_block_chat (DcRpcClient* self,
                               gint chat_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_block_chat_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error);
static gboolean dc_rpc_client_block_chat_co (DcRpcClientBlockChatData* _data_);
static void dc_rpc_client_block_chat_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_);
static void dc_rpc_client_block_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_block_contact (DcRpcClient* self,
                                  gint contact_id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_block_contact_finish (DcRpcClient* self,
                                         GAsyncResult* _res_,
                                         GError** error);
static gboolean dc_rpc_client_block_contact_co (DcRpcClientBlockContactData* _data_);
static void dc_rpc_client_block_contact_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_unblock_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_unblock_contact (DcRpcClient* self,
                                    gint contact_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_unblock_contact_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_unblock_contact_co (DcRpcClientUnblockContactData* _data_);
static void dc_rpc_client_unblock_contact_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_change_contact_name_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_change_contact_name (DcRpcClient* self,
                                        gint contact_id,
                                        const gchar* name,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_change_contact_name_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_change_contact_name_co (DcRpcClientChangeContactNameData* _data_);
static void dc_rpc_client_change_contact_name_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_set_chat_mute_duration_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_chat_mute_duration (DcRpcClient* self,
                                           gint chat_id,
                                           gint seconds,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_chat_mute_duration_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean dc_rpc_client_set_chat_mute_duration_co (DcRpcClientSetChatMuteDurationData* _data_);
static void dc_rpc_client_set_chat_mute_duration_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void dc_rpc_client_set_chat_visibility_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_chat_visibility (DcRpcClient* self,
                                        gint chat_id,
                                        const gchar* visibility,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_chat_visibility_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_set_chat_visibility_co (DcRpcClientSetChatVisibilityData* _data_);
static void dc_rpc_client_set_chat_visibility_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_get_chat_media_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_chat_media (DcRpcClient* self,
                                   gint chat_id,
                                   gchar** types,
                                   gint types_length1,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN gint* dc_rpc_client_get_chat_media_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           gint* result_length1,
                                           GError** error);
static gboolean dc_rpc_client_get_chat_media_co (DcRpcClientGetChatMediaData* _data_);
static void dc_rpc_client_get_chat_media_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_delete_messages_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_delete_messages (DcRpcClient* self,
                                    gint* msg_ids,
                                    gint msg_ids_length1,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_messages_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_delete_messages_co (DcRpcClientDeleteMessagesData* _data_);
static void dc_rpc_client_delete_messages_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_forward_messages_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_forward_messages (DcRpcClient* self,
                                     gint* msg_ids,
                                     gint msg_ids_length1,
                                     gint chat_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_forward_messages_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_forward_messages_co (DcRpcClientForwardMessagesData* _data_);
static void dc_rpc_client_forward_messages_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_delete_messages_for_all_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_delete_messages_for_all (DcRpcClient* self,
                                            gint* msg_ids,
                                            gint msg_ids_length1,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_messages_for_all_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_delete_messages_for_all_co (DcRpcClientDeleteMessagesForAllData* _data_);
static void dc_rpc_client_delete_messages_for_all_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void dc_rpc_client_get_contact_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_contact_for (DcRpcClient* self,
                                    gint acct_id,
                                    gint contact_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_contact_for_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean dc_rpc_client_get_contact_for_co (DcRpcClientGetContactForData* _data_);
static void dc_rpc_client_get_contact_for_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_add_contact_to_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_add_contact_to_chat (DcRpcClient* self,
                                        gint chat_id,
                                        gint contact_id,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_add_contact_to_chat_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_add_contact_to_chat_co (DcRpcClientAddContactToChatData* _data_);
static void dc_rpc_client_add_contact_to_chat_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_remove_contact_from_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_remove_contact_from_chat (DcRpcClient* self,
                                             gint chat_id,
                                             gint contact_id,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_remove_contact_from_chat_finish (DcRpcClient* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static gboolean dc_rpc_client_remove_contact_from_chat_co (DcRpcClientRemoveContactFromChatData* _data_);
static void dc_rpc_client_remove_contact_from_chat_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void dc_rpc_client_set_chat_profile_image_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_chat_profile_image (DcRpcClient* self,
                                           gint chat_id,
                                           const gchar* image_path,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_chat_profile_image_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean dc_rpc_client_set_chat_profile_image_co (DcRpcClientSetChatProfileImageData* _data_);
static void dc_rpc_client_set_chat_profile_image_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void dc_rpc_client_set_chat_name_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_chat_name (DcRpcClient* self,
                                  gint chat_id,
                                  const gchar* name,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_chat_name_finish (DcRpcClient* self,
                                         GAsyncResult* _res_,
                                         GError** error);
static gboolean dc_rpc_client_set_chat_name_co (DcRpcClientSetChatNameData* _data_);
static void dc_rpc_client_set_chat_name_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_set_chat_ephemeral_timer_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_chat_ephemeral_timer (DcRpcClient* self,
                                             gint chat_id,
                                             gint timer,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_chat_ephemeral_timer_finish (DcRpcClient* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static gboolean dc_rpc_client_set_chat_ephemeral_timer_co (DcRpcClientSetChatEphemeralTimerData* _data_);
static void dc_rpc_client_set_chat_ephemeral_timer_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
VALA_EXTERN DcRpcClient* dc_rpc_client_new (void);
VALA_EXTERN DcRpcClient* dc_rpc_client_construct (GType object_type);
VALA_EXTERN gboolean dc_rpc_client_get_is_connected (DcRpcClient* self);
VALA_EXTERN gboolean dc_rpc_transport_get_is_connected (DcRpcTransport* self);
VALA_EXTERN void dc_rpc_client_set_account_id (DcRpcClient* self,
                                   gint value);
VALA_EXTERN void dc_rpc_client_set_self_email (DcRpcClient* self,
                                   const gchar* value);
static GObject * dc_rpc_client_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties);
VALA_EXTERN DcRpcTransport* dc_rpc_transport_new (void);
VALA_EXTERN DcRpcTransport* dc_rpc_transport_construct (GType object_type);
static void _dc_rpc_client___lambda6_ (DcRpcClient* self,
                                const gchar* reason);
static void __dc_rpc_client___lambda6__dc_rpc_transport_disconnected (DcRpcTransport* _sender,
                                                               const gchar* reason,
                                                               gpointer self);
static void dc_rpc_client_finalize (GObject * obj);
static GType dc_rpc_client_get_type_once (void);
static void _vala_dc_rpc_client_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec);
static void _vala_dc_rpc_client_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

DcEnteredLoginParams*
dc_entered_login_params_from_json (JsonObject* obj)
{
	DcEnteredLoginParams* p = NULL;
	DcEnteredLoginParams* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	DcEnteredLoginParams* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_;
	DcEnteredLoginParams* _tmp9_;
	gchar* _tmp10_;
	DcEnteredLoginParams* _tmp11_;
	gchar* _tmp12_;
	DcEnteredLoginParams* _tmp13_;
	gchar* _tmp14_;
	DcEnteredLoginParams* _tmp15_;
	DcEnteredLoginParams* _tmp16_;
	gchar* _tmp17_;
	DcEnteredLoginParams* _tmp18_;
	gchar* _tmp19_;
	DcEnteredLoginParams* _tmp20_;
	gchar* _tmp21_;
	DcEnteredLoginParams* _tmp22_;
	gchar* _tmp23_;
	DcEnteredLoginParams* _tmp24_;
	DcEnteredLoginParams* _tmp25_;
	gchar* _tmp26_;
	DcEnteredLoginParams* _tmp27_;
	gchar* _tmp28_;
	DcEnteredLoginParams* _tmp29_;
	const gchar* _tmp30_;
	DcEnteredLoginParams* _tmp32_;
	const gchar* _tmp33_;
	DcEnteredLoginParams* _tmp35_;
	const gchar* _tmp36_;
	DcEnteredLoginParams* result;
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = dc_entered_login_params_new ();
	p = _tmp0_;
	_tmp2_ = dc_json_str (obj, "addr");
	_tmp1_ = _tmp2_;
	if (_tmp1_ == NULL) {
		gchar* _tmp3_;
		_tmp3_ = g_strdup ("");
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp3_;
	}
	_tmp4_ = p;
	_tmp5_ = _tmp1_;
	_tmp1_ = NULL;
	_g_free0 (_tmp4_->addr);
	_tmp4_->addr = _tmp5_;
	_tmp7_ = dc_json_str (obj, "password");
	_tmp6_ = _tmp7_;
	if (_tmp6_ == NULL) {
		gchar* _tmp8_;
		_tmp8_ = g_strdup ("");
		_g_free0 (_tmp6_);
		_tmp6_ = _tmp8_;
	}
	_tmp9_ = p;
	_tmp10_ = _tmp6_;
	_tmp6_ = NULL;
	_g_free0 (_tmp9_->password);
	_tmp9_->password = _tmp10_;
	_tmp11_ = p;
	_tmp12_ = dc_json_str (obj, "imapUser");
	_g_free0 (_tmp11_->imap_user);
	_tmp11_->imap_user = _tmp12_;
	_tmp13_ = p;
	_tmp14_ = dc_json_str (obj, "imapServer");
	_g_free0 (_tmp13_->imap_server);
	_tmp13_->imap_server = _tmp14_;
	_tmp15_ = p;
	_tmp15_->imap_port = (gint) dc_json_int (obj, "imapPort", (gint64) 0);
	_tmp16_ = p;
	_tmp17_ = dc_json_str (obj, "imapSecurity");
	_g_free0 (_tmp16_->imap_security);
	_tmp16_->imap_security = _tmp17_;
	_tmp18_ = p;
	_tmp19_ = dc_json_str (obj, "smtpUser");
	_g_free0 (_tmp18_->smtp_user);
	_tmp18_->smtp_user = _tmp19_;
	_tmp20_ = p;
	_tmp21_ = dc_json_str (obj, "smtpPassword");
	_g_free0 (_tmp20_->smtp_password);
	_tmp20_->smtp_password = _tmp21_;
	_tmp22_ = p;
	_tmp23_ = dc_json_str (obj, "smtpServer");
	_g_free0 (_tmp22_->smtp_server);
	_tmp22_->smtp_server = _tmp23_;
	_tmp24_ = p;
	_tmp24_->smtp_port = (gint) dc_json_int (obj, "smtpPort", (gint64) 0);
	_tmp25_ = p;
	_tmp26_ = dc_json_str (obj, "smtpSecurity");
	_g_free0 (_tmp25_->smtp_security);
	_tmp25_->smtp_security = _tmp26_;
	_tmp27_ = p;
	_tmp28_ = dc_json_str (obj, "certificateChecks");
	_g_free0 (_tmp27_->certificate_checks);
	_tmp27_->certificate_checks = _tmp28_;
	_tmp29_ = p;
	_tmp30_ = _tmp29_->imap_security;
	if (g_strcmp0 (_tmp30_, "automatic") == 0) {
		DcEnteredLoginParams* _tmp31_;
		_tmp31_ = p;
		_g_free0 (_tmp31_->imap_security);
		_tmp31_->imap_security = NULL;
	}
	_tmp32_ = p;
	_tmp33_ = _tmp32_->smtp_security;
	if (g_strcmp0 (_tmp33_, "automatic") == 0) {
		DcEnteredLoginParams* _tmp34_;
		_tmp34_ = p;
		_g_free0 (_tmp34_->smtp_security);
		_tmp34_->smtp_security = NULL;
	}
	_tmp35_ = p;
	_tmp36_ = _tmp35_->certificate_checks;
	if (g_strcmp0 (_tmp36_, "automatic") == 0) {
		DcEnteredLoginParams* _tmp37_;
		_tmp37_ = p;
		_g_free0 (_tmp37_->certificate_checks);
		_tmp37_->certificate_checks = NULL;
	}
	result = p;
	_g_free0 (_tmp6_);
	_g_free0 (_tmp1_);
	return result;
}

DcEnteredLoginParams*
dc_entered_login_params_construct (GType object_type)
{
	DcEnteredLoginParams * self = NULL;
	self = (DcEnteredLoginParams*) g_object_new (object_type, NULL);
	return self;
}

DcEnteredLoginParams*
dc_entered_login_params_new (void)
{
	return dc_entered_login_params_construct (DC_TYPE_ENTERED_LOGIN_PARAMS);
}

static void
dc_entered_login_params_class_init (DcEnteredLoginParamsClass * klass,
                                    gpointer klass_data)
{
	dc_entered_login_params_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = dc_entered_login_params_finalize;
}

static void
dc_entered_login_params_instance_init (DcEnteredLoginParams * self,
                                       gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	_tmp0_ = g_strdup ("");
	self->addr = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->password = _tmp1_;
	self->imap_user = NULL;
	self->imap_server = NULL;
	self->imap_port = 0;
	self->imap_security = NULL;
	self->smtp_user = NULL;
	self->smtp_password = NULL;
	self->smtp_server = NULL;
	self->smtp_port = 0;
	self->smtp_security = NULL;
	self->certificate_checks = NULL;
}

static void
dc_entered_login_params_finalize (GObject * obj)
{
	DcEnteredLoginParams * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_ENTERED_LOGIN_PARAMS, DcEnteredLoginParams);
	_g_free0 (self->addr);
	_g_free0 (self->password);
	_g_free0 (self->imap_user);
	_g_free0 (self->imap_server);
	_g_free0 (self->imap_security);
	_g_free0 (self->smtp_user);
	_g_free0 (self->smtp_password);
	_g_free0 (self->smtp_server);
	_g_free0 (self->smtp_security);
	_g_free0 (self->certificate_checks);
	G_OBJECT_CLASS (dc_entered_login_params_parent_class)->finalize (obj);
}

/**
     * Login parameters for a classic email transport, mirroring the
     * JSON-RPC EnteredLoginParam object. Optional fields left null (or
     * ports left at 0) are sent as null so the core autoconfigures them.
     */
static GType
dc_entered_login_params_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcEnteredLoginParamsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_entered_login_params_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcEnteredLoginParams), 0, (GInstanceInitFunc) dc_entered_login_params_instance_init, NULL };
	GType dc_entered_login_params_type_id;
	dc_entered_login_params_type_id = g_type_register_static (G_TYPE_OBJECT, "DcEnteredLoginParams", &g_define_type_info, 0);
	return dc_entered_login_params_type_id;
}

GType
dc_entered_login_params_get_type (void)
{
	static volatile gsize dc_entered_login_params_type_id__once = 0;
	if (g_once_init_enter (&dc_entered_login_params_type_id__once)) {
		GType dc_entered_login_params_type_id;
		dc_entered_login_params_type_id = dc_entered_login_params_get_type_once ();
		g_once_init_leave (&dc_entered_login_params_type_id__once, dc_entered_login_params_type_id);
	}
	return dc_entered_login_params_type_id__once;
}

static inline gpointer
dc_rpc_client_get_instance_private (DcRpcClient* self)
{
	return G_STRUCT_MEMBER_P (self, DcRpcClient_private_offset);
}

static void
dc_rpc_client_start_data_free (gpointer _data)
{
	DcRpcClientStartData* _data_;
	_data_ = _data;
	_g_free0 (_data_->cwd);
	_g_free0 (_data_->accounts_path);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStartData, _data_);
}

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

void
dc_rpc_client_start (DcRpcClient* self,
                     gchar** argv,
                     gint argv_length1,
                     const gchar* cwd,
                     const gchar* accounts_path,
                     GAsyncReadyCallback _callback_,
                     gpointer _user_data_)
{
	DcRpcClientStartData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStartData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_start_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->argv = argv;
	_data_->argv_length1 = argv_length1;
	_tmp1_ = g_strdup (cwd);
	_g_free0 (_data_->cwd);
	_data_->cwd = _tmp1_;
	_tmp2_ = g_strdup (accounts_path);
	_g_free0 (_data_->accounts_path);
	_data_->accounts_path = _tmp2_;
	dc_rpc_client_start_co (_data_);
}

void
dc_rpc_client_start_finish (DcRpcClient* self,
                            GAsyncResult* _res_,
                            GError** error)
{
	DcRpcClientStartData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_start_ready (GObject* source_object,
                           GAsyncResult* _res_,
                           gpointer _user_data_)
{
	DcRpcClientStartData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_start_co (_data_);
}

static gboolean
dc_rpc_client_start_co (DcRpcClientStartData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->transport;
	_data_->_state_ = 1;
	dc_rpc_transport_start (_data_->_tmp0_, _data_->argv, (gint) _data_->argv_length1, _data_->cwd, _data_->accounts_path, dc_rpc_client_start_ready, _data_);
	return FALSE;
	_state_1:
	dc_rpc_transport_start_finish (_data_->_tmp0_, _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;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
dc_rpc_client_stop (DcRpcClient* self)
{
	DcRpcTransport* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->transport;
	dc_rpc_transport_stop (_tmp0_);
}

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

static void
dc_rpc_client_call_data_free (gpointer _data)
{
	DcRpcClientCallData* _data_;
	_data_ = _data;
	_g_free0 (_data_->method);
	__vala_JsonNode_free0 (_data_->params);
	__vala_JsonNode_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCallData, _data_);
}

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

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

void
dc_rpc_client_call (DcRpcClient* self,
                    const gchar* method,
                    JsonNode* params,
                    GAsyncReadyCallback _callback_,
                    gpointer _user_data_)
{
	DcRpcClientCallData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	JsonNode* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (method != NULL);
	g_return_if_fail (params != NULL);
	_data_ = g_slice_new0 (DcRpcClientCallData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_call_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (method);
	_g_free0 (_data_->method);
	_data_->method = _tmp1_;
	_tmp2_ = __vala_JsonNode_copy0 (params);
	__vala_JsonNode_free0 (_data_->params);
	_data_->params = _tmp2_;
	dc_rpc_client_call_co (_data_);
}

JsonNode*
dc_rpc_client_call_finish (DcRpcClient* self,
                           GAsyncResult* _res_,
                           GError** error)
{
	JsonNode* result;
	DcRpcClientCallData* _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
dc_rpc_client_call_ready (GObject* source_object,
                          GAsyncResult* _res_,
                          gpointer _user_data_)
{
	DcRpcClientCallData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_call_co (_data_);
}

static gboolean
dc_rpc_client_call_co (DcRpcClientCallData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->transport;
	_data_->_state_ = 1;
	dc_rpc_transport_call (_data_->_tmp1_, _data_->method, _data_->params, dc_rpc_client_call_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_rpc_transport_call_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp3_;
	__vala_JsonNode_free0 (_data_->_tmp0_);
	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
dc_rpc_client_get_all_accounts_data_free (gpointer _data)
{
	DcRpcClientGetAllAccountsData* _data_;
	_data_ = _data;
	__vala_JsonNode_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetAllAccountsData, _data_);
}

void
dc_rpc_client_get_all_accounts (DcRpcClient* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientGetAllAccountsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetAllAccountsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_all_accounts_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_get_all_accounts_co (_data_);
}

JsonNode*
dc_rpc_client_get_all_accounts_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	JsonNode* result;
	DcRpcClientGetAllAccountsData* _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
dc_rpc_client_get_all_accounts_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientGetAllAccountsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_all_accounts_co (_data_);
}

static gboolean
dc_rpc_client_get_all_accounts_co (DcRpcClientGetAllAccountsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = dc_params_begin ();
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = dc_params_build (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_all_accounts", _data_->_tmp4_, dc_rpc_client_get_all_accounts_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp5_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp6_ = _data_->_tmp5_;
	__vala_JsonNode_free0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp2_);
	_data_->_tmp0_ = _data_->_tmp6_;
	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_->_tmp7_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp7_;
	__vala_JsonNode_free0 (_data_->_tmp0_);
	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
dc_rpc_client_add_account_data_free (gpointer _data)
{
	DcRpcClientAddAccountData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAddAccountData, _data_);
}

void
dc_rpc_client_add_account (DcRpcClient* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientAddAccountData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientAddAccountData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_add_account_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_add_account_co (_data_);
}

gint
dc_rpc_client_add_account_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	gint result;
	DcRpcClientAddAccountData* _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
dc_rpc_client_add_account_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientAddAccountData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_add_account_co (_data_);
}

static gboolean
dc_rpc_client_add_account_co (DcRpcClientAddAccountData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_build (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "add_account", _data_->_tmp3_, dc_rpc_client_add_account_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp5_ = _data_->_tmp4_;
	__vala_JsonNode_free0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp5_;
	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_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_select_account_data_free (gpointer _data)
{
	DcRpcClientSelectAccountData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSelectAccountData, _data_);
}

void
dc_rpc_client_select_account (DcRpcClient* self,
                              gint acct_id,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientSelectAccountData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSelectAccountData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_select_account_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_select_account_co (_data_);
}

void
dc_rpc_client_select_account_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientSelectAccountData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_select_account_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientSelectAccountData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_select_account_co (_data_);
}

static gboolean
dc_rpc_client_select_account_co (DcRpcClientSelectAccountData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "select_account", _data_->_tmp5_, dc_rpc_client_select_account_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_is_configured_data_free (gpointer _data)
{
	DcRpcClientIsConfiguredData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientIsConfiguredData, _data_);
}

void
dc_rpc_client_is_configured (DcRpcClient* self,
                             gint acct_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientIsConfiguredData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientIsConfiguredData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_is_configured_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_is_configured_co (_data_);
}

gboolean
dc_rpc_client_is_configured_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	gboolean result;
	DcRpcClientIsConfiguredData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_is_configured_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientIsConfiguredData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_is_configured_co (_data_);
}

static gboolean
dc_rpc_client_is_configured_co (DcRpcClientIsConfiguredData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "is_configured", _data_->_tmp5_, dc_rpc_client_is_configured_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	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_->result = json_node_get_boolean (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_remove_account_data_free (gpointer _data)
{
	DcRpcClientRemoveAccountData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientRemoveAccountData, _data_);
}

void
dc_rpc_client_remove_account (DcRpcClient* self,
                              gint acct_id,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientRemoveAccountData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientRemoveAccountData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_remove_account_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_remove_account_co (_data_);
}

void
dc_rpc_client_remove_account_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientRemoveAccountData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_remove_account_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientRemoveAccountData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_remove_account_co (_data_);
}

static gboolean
dc_rpc_client_remove_account_co (DcRpcClientRemoveAccountData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "remove_account", _data_->_tmp5_, dc_rpc_client_remove_account_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_start_io_data_free (gpointer _data)
{
	DcRpcClientStartIoData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStartIoData, _data_);
}

void
dc_rpc_client_start_io (DcRpcClient* self,
                        gint acct_id,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_)
{
	DcRpcClientStartIoData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStartIoData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_start_io_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_start_io_co (_data_);
}

void
dc_rpc_client_start_io_finish (DcRpcClient* self,
                               GAsyncResult* _res_,
                               GError** error)
{
	DcRpcClientStartIoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_start_io_ready (GObject* source_object,
                              GAsyncResult* _res_,
                              gpointer _user_data_)
{
	DcRpcClientStartIoData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_start_io_co (_data_);
}

static gboolean
dc_rpc_client_start_io_co (DcRpcClientStartIoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "start_io", _data_->_tmp5_, dc_rpc_client_start_io_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_stop_io_data_free (gpointer _data)
{
	DcRpcClientStopIoData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStopIoData, _data_);
}

void
dc_rpc_client_stop_io (DcRpcClient* self,
                       gint acct_id,
                       GAsyncReadyCallback _callback_,
                       gpointer _user_data_)
{
	DcRpcClientStopIoData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStopIoData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_stop_io_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_stop_io_co (_data_);
}

void
dc_rpc_client_stop_io_finish (DcRpcClient* self,
                              GAsyncResult* _res_,
                              GError** error)
{
	DcRpcClientStopIoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_stop_io_ready (GObject* source_object,
                             GAsyncResult* _res_,
                             gpointer _user_data_)
{
	DcRpcClientStopIoData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_stop_io_co (_data_);
}

static gboolean
dc_rpc_client_stop_io_co (DcRpcClientStopIoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "stop_io", _data_->_tmp5_, dc_rpc_client_stop_io_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_start_io_for_all_accounts_data_free (gpointer _data)
{
	DcRpcClientStartIoForAllAccountsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStartIoForAllAccountsData, _data_);
}

void
dc_rpc_client_start_io_for_all_accounts (DcRpcClient* self,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	DcRpcClientStartIoForAllAccountsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStartIoForAllAccountsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_start_io_for_all_accounts_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_start_io_for_all_accounts_co (_data_);
}

void
dc_rpc_client_start_io_for_all_accounts_finish (DcRpcClient* self,
                                                GAsyncResult* _res_,
                                                GError** error)
{
	DcRpcClientStartIoForAllAccountsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_start_io_for_all_accounts_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	DcRpcClientStartIoForAllAccountsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_start_io_for_all_accounts_co (_data_);
}

static gboolean
dc_rpc_client_start_io_for_all_accounts_co (DcRpcClientStartIoForAllAccountsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_build (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "start_io_for_all_accounts", _data_->_tmp3_, dc_rpc_client_start_io_for_all_accounts_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp5_ = _data_->_tmp4_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	__vala_JsonNode_free0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_connectivity_data_free (gpointer _data)
{
	DcRpcClientGetConnectivityData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetConnectivityData, _data_);
}

void
dc_rpc_client_get_connectivity (DcRpcClient* self,
                                gint acct_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientGetConnectivityData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetConnectivityData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_connectivity_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_connectivity_co (_data_);
}

gint
dc_rpc_client_get_connectivity_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	gint result;
	DcRpcClientGetConnectivityData* _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
dc_rpc_client_get_connectivity_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientGetConnectivityData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_connectivity_co (_data_);
}

static gboolean
dc_rpc_client_get_connectivity_co (DcRpcClientGetConnectivityData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_connectivity", _data_->_tmp5_, dc_rpc_client_get_connectivity_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	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_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_connectivity_html_data_free (gpointer _data)
{
	DcRpcClientGetConnectivityHtmlData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetConnectivityHtmlData, _data_);
}

void
dc_rpc_client_get_connectivity_html (DcRpcClient* self,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientGetConnectivityHtmlData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetConnectivityHtmlData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_connectivity_html_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_connectivity_html_co (_data_);
}

gchar*
dc_rpc_client_get_connectivity_html_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	gchar* result;
	DcRpcClientGetConnectivityHtmlData* _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
dc_rpc_client_get_connectivity_html_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientGetConnectivityHtmlData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_connectivity_html_co (_data_);
}

static gboolean
dc_rpc_client_get_connectivity_html_co (DcRpcClientGetConnectivityHtmlData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_connectivity_html", _data_->_tmp5_, dc_rpc_client_get_connectivity_html_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	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_->_tmp8_ = json_node_get_string (_data_->_result_);
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_account_file_size_data_free (gpointer _data)
{
	DcRpcClientGetAccountFileSizeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetAccountFileSizeData, _data_);
}

void
dc_rpc_client_get_account_file_size (DcRpcClient* self,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientGetAccountFileSizeData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetAccountFileSizeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_account_file_size_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_account_file_size_co (_data_);
}

gint64
dc_rpc_client_get_account_file_size_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	gint64 result;
	DcRpcClientGetAccountFileSizeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint64 _tmp0_ = 0LL;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_get_account_file_size_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientGetAccountFileSizeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_account_file_size_co (_data_);
}

static gboolean
dc_rpc_client_get_account_file_size_co (DcRpcClientGetAccountFileSizeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_account_file_size", _data_->_tmp5_, dc_rpc_client_get_account_file_size_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	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_->result = json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_blob_dir_data_free (gpointer _data)
{
	DcRpcClientGetBlobDirData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetBlobDirData, _data_);
}

void
dc_rpc_client_get_blob_dir (DcRpcClient* self,
                            gint acct_id,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	DcRpcClientGetBlobDirData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetBlobDirData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_blob_dir_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_blob_dir_co (_data_);
}

gchar*
dc_rpc_client_get_blob_dir_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	gchar* result;
	DcRpcClientGetBlobDirData* _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
dc_rpc_client_get_blob_dir_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	DcRpcClientGetBlobDirData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_blob_dir_co (_data_);
}

static gboolean
dc_rpc_client_get_blob_dir_co (DcRpcClientGetBlobDirData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_blob_dir", _data_->_tmp5_, dc_rpc_client_get_blob_dir_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	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_->_result_ == NULL) {
		_data_->_tmp8_ = TRUE;
	} else {
		_data_->_tmp8_ = json_node_is_null (_data_->_result_);
	}
	if (_data_->_tmp8_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_ = json_node_get_string (_data_->_result_);
	_data_->_tmp10_ = g_strdup (_data_->_tmp9_);
	_data_->result = _data_->_tmp10_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_add_transport_from_qr_data_free (gpointer _data)
{
	DcRpcClientAddTransportFromQrData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAddTransportFromQrData, _data_);
}

void
dc_rpc_client_add_transport_from_qr (DcRpcClient* self,
                                     gint acct_id,
                                     const gchar* qr_text,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientAddTransportFromQrData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientAddTransportFromQrData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_add_transport_from_qr_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_add_transport_from_qr_co (_data_);
}

void
dc_rpc_client_add_transport_from_qr_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	DcRpcClientAddTransportFromQrData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_add_transport_from_qr_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientAddTransportFromQrData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_add_transport_from_qr_co (_data_);
}

static gboolean
dc_rpc_client_add_transport_from_qr_co (DcRpcClientAddTransportFromQrData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "add_transport_from_qr", _data_->_tmp7_, dc_rpc_client_add_transport_from_qr_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_backup_data_free (gpointer _data)
{
	DcRpcClientGetBackupData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetBackupData, _data_);
}

void
dc_rpc_client_get_backup (DcRpcClient* self,
                          gint acct_id,
                          const gchar* qr_text,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_)
{
	DcRpcClientGetBackupData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetBackupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_backup_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_get_backup_co (_data_);
}

void
dc_rpc_client_get_backup_finish (DcRpcClient* self,
                                 GAsyncResult* _res_,
                                 GError** error)
{
	DcRpcClientGetBackupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_get_backup_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_)
{
	DcRpcClientGetBackupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_backup_co (_data_);
}

static gboolean
dc_rpc_client_get_backup_co (DcRpcClientGetBackupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_backup", _data_->_tmp7_, dc_rpc_client_get_backup_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_provide_backup_data_free (gpointer _data)
{
	DcRpcClientProvideBackupData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientProvideBackupData, _data_);
}

void
dc_rpc_client_provide_backup (DcRpcClient* self,
                              gint acct_id,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientProvideBackupData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientProvideBackupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_provide_backup_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_provide_backup_co (_data_);
}

void
dc_rpc_client_provide_backup_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientProvideBackupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_provide_backup_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientProvideBackupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_provide_backup_co (_data_);
}

static gboolean
dc_rpc_client_provide_backup_co (DcRpcClientProvideBackupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "provide_backup", _data_->_tmp5_, dc_rpc_client_provide_backup_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_backup_qr_data_free (gpointer _data)
{
	DcRpcClientGetBackupQrData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetBackupQrData, _data_);
}

void
dc_rpc_client_get_backup_qr (DcRpcClient* self,
                             gint acct_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientGetBackupQrData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetBackupQrData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_backup_qr_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_backup_qr_co (_data_);
}

gchar*
dc_rpc_client_get_backup_qr_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	gchar* result;
	DcRpcClientGetBackupQrData* _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
dc_rpc_client_get_backup_qr_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientGetBackupQrData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_backup_qr_co (_data_);
}

static gboolean
dc_rpc_client_get_backup_qr_co (DcRpcClientGetBackupQrData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_backup_qr", _data_->_tmp5_, dc_rpc_client_get_backup_qr_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	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_->_tmp8_ = json_node_get_string (_data_->_result_);
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_create_qr_svg_data_free (gpointer _data)
{
	DcRpcClientCreateQrSvgData* _data_;
	_data_ = _data;
	_g_free0 (_data_->text);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCreateQrSvgData, _data_);
}

void
dc_rpc_client_create_qr_svg (DcRpcClient* self,
                             const gchar* text,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientCreateQrSvgData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_data_ = g_slice_new0 (DcRpcClientCreateQrSvgData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_create_qr_svg_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (text);
	_g_free0 (_data_->text);
	_data_->text = _tmp1_;
	dc_rpc_client_create_qr_svg_co (_data_);
}

gchar*
dc_rpc_client_create_qr_svg_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	gchar* result;
	DcRpcClientCreateQrSvgData* _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
dc_rpc_client_create_qr_svg_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientCreateQrSvgData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_create_qr_svg_co (_data_);
}

static gboolean
dc_rpc_client_create_qr_svg_co (DcRpcClientCreateQrSvgData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_string (_data_->_tmp1_, _data_->text);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "create_qr_svg", _data_->_tmp5_, dc_rpc_client_create_qr_svg_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	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_->_tmp8_ = json_node_get_string (_data_->_result_);
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_chat_securejoin_qr_code_data_free (gpointer _data)
{
	DcRpcClientGetChatSecurejoinQrCodeData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatSecurejoinQrCodeData, _data_);
}

void
dc_rpc_client_get_chat_securejoin_qr_code (DcRpcClient* self,
                                           gint acct_id,
                                           gint chat_id,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DcRpcClientGetChatSecurejoinQrCodeData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatSecurejoinQrCodeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chat_securejoin_qr_code_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->chat_id = chat_id;
	dc_rpc_client_get_chat_securejoin_qr_code_co (_data_);
}

gchar*
dc_rpc_client_get_chat_securejoin_qr_code_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error)
{
	gchar* result;
	DcRpcClientGetChatSecurejoinQrCodeData* _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
dc_rpc_client_get_chat_securejoin_qr_code_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	DcRpcClientGetChatSecurejoinQrCodeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chat_securejoin_qr_code_co (_data_);
}

static gboolean
dc_rpc_client_get_chat_securejoin_qr_code_co (DcRpcClientGetChatSecurejoinQrCodeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_g_object_unref0 (_data_->_tmp1_);
	_data_->p = _data_->_tmp3_;
	if (_data_->chat_id > 0) {
		_data_->_tmp4_ = _data_->p;
		_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
		_data_->_tmp6_ = _data_->_tmp5_;
		_g_object_unref0 (_data_->_tmp6_);
	} else {
		_data_->_tmp7_ = _data_->p;
		_data_->_tmp8_ = dc_params_add_null (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_g_object_unref0 (_data_->_tmp9_);
	}
	_data_->_tmp10_ = _data_->p;
	_data_->_tmp11_ = dc_params_build (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chat_securejoin_qr_code", _data_->_tmp12_, dc_rpc_client_get_chat_securejoin_qr_code_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp13_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp14_ = _data_->_tmp13_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	_data_->_result_ = _data_->_tmp14_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->p);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = json_node_get_string (_data_->_result_);
	_data_->_tmp16_ = g_strdup (_data_->_tmp15_);
	_data_->result = _data_->_tmp16_;
	__vala_JsonNode_free0 (_data_->_result_);
	_g_object_unref0 (_data_->p);
	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
dc_rpc_client_stop_ongoing_process_data_free (gpointer _data)
{
	DcRpcClientStopOngoingProcessData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStopOngoingProcessData, _data_);
}

void
dc_rpc_client_stop_ongoing_process (DcRpcClient* self,
                                    gint acct_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	DcRpcClientStopOngoingProcessData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStopOngoingProcessData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_stop_ongoing_process_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_stop_ongoing_process_co (_data_);
}

void
dc_rpc_client_stop_ongoing_process_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	DcRpcClientStopOngoingProcessData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_stop_ongoing_process_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	DcRpcClientStopOngoingProcessData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_stop_ongoing_process_co (_data_);
}

static gboolean
dc_rpc_client_stop_ongoing_process_co (DcRpcClientStopOngoingProcessData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "stop_ongoing_process", _data_->_tmp5_, dc_rpc_client_stop_ongoing_process_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_http_response_data_free (gpointer _data)
{
	DcRpcClientGetHttpResponseData* _data_;
	_data_ = _data;
	_g_free0 (_data_->url);
	_data_->result = (g_free (_data_->result), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetHttpResponseData, _data_);
}

void
dc_rpc_client_get_http_response (DcRpcClient* self,
                                 const gchar* url,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DcRpcClientGetHttpResponseData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (url != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetHttpResponseData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_http_response_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (url);
	_g_free0 (_data_->url);
	_data_->url = _tmp1_;
	dc_rpc_client_get_http_response_co (_data_);
}

guint8*
dc_rpc_client_get_http_response_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        gchar** mimetype,
                                        gint* result_length1,
                                        GError** error)
{
	guint8* result;
	DcRpcClientGetHttpResponseData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	if (mimetype) {
		*mimetype = _data_->mimetype;
	} else {
		_g_free0 (_data_->mimetype);
	}
	_data_->mimetype = NULL;
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}

/** HTTP GET through core (proxy-aware, cached). Returns the raw
            body; `mimetype` is the Content-Type without parameters, null
            when the server sent none. */
static void
dc_rpc_client_get_http_response_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DcRpcClientGetHttpResponseData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_http_response_co (_data_);
}

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

static gboolean
dc_rpc_client_get_http_response_co (DcRpcClientGetHttpResponseData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_g_free0 (_data_->mimetype);
	_data_->mimetype = NULL;
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_string (_data_->_tmp4_, _data_->url);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_http_response", _data_->_tmp8_, dc_rpc_client_get_http_response_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->mimetype);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp12_ = _data_->_result_;
	if (_data_->_tmp12_ == NULL) {
		_data_->_tmp11_ = TRUE;
	} else {
		_data_->_tmp13_ = _data_->_result_;
		_data_->_tmp11_ = json_node_get_node_type (_data_->_tmp13_) != JSON_NODE_OBJECT;
	}
	if (_data_->_tmp11_) {
		_data_->_tmp14_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, "Unexpected get_http_response result");
		_data_->_inner_error0_ = _data_->_tmp14_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		__vala_JsonNode_free0 (_data_->_result_);
		_g_free0 (_data_->mimetype);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = _data_->_result_;
	_data_->_tmp16_ = json_node_get_object (_data_->_tmp15_);
	_data_->_tmp17_ = _json_object_ref0 (_data_->_tmp16_);
	_data_->obj = _data_->_tmp17_;
	_data_->_tmp19_ = _data_->obj;
	if (json_object_has_member (_data_->_tmp19_, "mimetype")) {
		_data_->_tmp20_ = _data_->obj;
		_data_->_tmp21_ = json_object_get_member (_data_->_tmp20_, "mimetype");
		_data_->_tmp18_ = json_node_get_node_type (_data_->_tmp21_) == JSON_NODE_VALUE;
	} else {
		_data_->_tmp18_ = FALSE;
	}
	if (_data_->_tmp18_) {
		_data_->_tmp22_ = _data_->obj;
		_data_->_tmp23_ = json_object_get_string_member (_data_->_tmp22_, "mimetype");
		_data_->_tmp24_ = g_strdup (_data_->_tmp23_);
		_g_free0 (_data_->mimetype);
		_data_->mimetype = _data_->_tmp24_;
	}
	_data_->_tmp26_ = _data_->obj;
	if (json_object_has_member (_data_->_tmp26_, "blob")) {
		_data_->_tmp27_ = _data_->obj;
		_data_->_tmp28_ = json_object_get_string_member (_data_->_tmp27_, "blob");
		_data_->_tmp25_ = _data_->_tmp28_;
	} else {
		_data_->_tmp25_ = "";
	}
	_data_->_tmp29_ = g_strdup (_data_->_tmp25_);
	_data_->blob = _data_->_tmp29_;
	_data_->_tmp30_ = _data_->blob;
	_data_->_tmp31_ = strlen (_data_->_tmp30_);
	_data_->_tmp32_ = _data_->_tmp31_;
	_data_->rem = _data_->_tmp32_ % 4;
	if (_data_->rem == 2) {
		_data_->_tmp33_ = _data_->blob;
		_data_->_tmp34_ = g_strconcat (_data_->_tmp33_, "==", NULL);
		_g_free0 (_data_->blob);
		_data_->blob = _data_->_tmp34_;
	} else {
		if (_data_->rem == 3) {
			_data_->_tmp35_ = _data_->blob;
			_data_->_tmp36_ = g_strconcat (_data_->_tmp35_, "=", NULL);
			_g_free0 (_data_->blob);
			_data_->blob = _data_->_tmp36_;
		}
	}
	_data_->_tmp37_ = _data_->blob;
	_data_->_tmp38_ = 0;
	_data_->_tmp39_ = g_base64_decode (_data_->_tmp37_, &_data_->_tmp38_);
	_data_->_tmp40_ = _data_->_tmp39_;
	_data_->_tmp40__length1 = _data_->_tmp38_;
	_data_->result_length1 = _data_->_tmp40__length1;
	_data_->result = _data_->_tmp40_;
	_g_free0 (_data_->blob);
	_json_object_unref0 (_data_->obj);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_check_qr_data_free (gpointer _data)
{
	DcRpcClientCheckQrData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCheckQrData, _data_);
}

void
dc_rpc_client_check_qr (DcRpcClient* self,
                        gint acct_id,
                        const gchar* qr_text,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_)
{
	DcRpcClientCheckQrData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientCheckQrData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_check_qr_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_check_qr_co (_data_);
}

JsonObject*
dc_rpc_client_check_qr_finish (DcRpcClient* self,
                               GAsyncResult* _res_,
                               GError** error)
{
	JsonObject* result;
	DcRpcClientCheckQrData* _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
dc_rpc_client_check_qr_ready (GObject* source_object,
                              GAsyncResult* _res_,
                              gpointer _user_data_)
{
	DcRpcClientCheckQrData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_check_qr_co (_data_);
}

static gboolean
dc_rpc_client_check_qr_co (DcRpcClientCheckQrData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "check_qr", _data_->_tmp7_, dc_rpc_client_check_qr_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp10_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_OBJECT;
	}
	if (_data_->_tmp10_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp11_ = json_node_get_object (_data_->_result_);
	_data_->_tmp12_ = _json_object_ref0 (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_secure_join_data_free (gpointer _data)
{
	DcRpcClientSecureJoinData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSecureJoinData, _data_);
}

void
dc_rpc_client_secure_join (DcRpcClient* self,
                           gint acct_id,
                           const gchar* qr_text,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientSecureJoinData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientSecureJoinData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_secure_join_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_secure_join_co (_data_);
}

gint
dc_rpc_client_secure_join_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	gint result;
	DcRpcClientSecureJoinData* _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
dc_rpc_client_secure_join_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientSecureJoinData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_secure_join_co (_data_);
}

static gboolean
dc_rpc_client_secure_join_co (DcRpcClientSecureJoinData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "secure_join", _data_->_tmp7_, dc_rpc_client_secure_join_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_set_config_from_qr_data_free (gpointer _data)
{
	DcRpcClientSetConfigFromQrData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetConfigFromQrData, _data_);
}

void
dc_rpc_client_set_config_from_qr (DcRpcClient* self,
                                  gint acct_id,
                                  const gchar* qr_text,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	DcRpcClientSetConfigFromQrData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetConfigFromQrData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_config_from_qr_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_set_config_from_qr_co (_data_);
}

void
dc_rpc_client_set_config_from_qr_finish (DcRpcClient* self,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	DcRpcClientSetConfigFromQrData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_config_from_qr_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_)
{
	DcRpcClientSetConfigFromQrData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_config_from_qr_co (_data_);
}

static gboolean
dc_rpc_client_set_config_from_qr_co (DcRpcClientSetConfigFromQrData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_config_from_qr", _data_->_tmp7_, dc_rpc_client_set_config_from_qr_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_add_or_update_transport_data_free (gpointer _data)
{
	DcRpcClientAddOrUpdateTransportData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->p);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAddOrUpdateTransportData, _data_);
}

void
dc_rpc_client_add_or_update_transport (DcRpcClient* self,
                                       gint acct_id,
                                       DcEnteredLoginParams* p,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DcRpcClientAddOrUpdateTransportData* _data_;
	DcRpcClient* _tmp0_;
	DcEnteredLoginParams* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (p != NULL);
	_data_ = g_slice_new0 (DcRpcClientAddOrUpdateTransportData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_add_or_update_transport_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = _g_object_ref0 (p);
	_g_object_unref0 (_data_->p);
	_data_->p = _tmp1_;
	dc_rpc_client_add_or_update_transport_co (_data_);
}

void
dc_rpc_client_add_or_update_transport_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	DcRpcClientAddOrUpdateTransportData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_add_or_update_transport_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	DcRpcClientAddOrUpdateTransportData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_add_or_update_transport_co (_data_);
}

static gboolean
dc_rpc_client_add_or_update_transport_co (DcRpcClientAddOrUpdateTransportData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_begin_object (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->p->addr;
	_data_->_tmp7_ = dc_params_set_string_member (_data_->_tmp5_, "addr", _data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = _data_->p->password;
	_data_->_tmp10_ = dc_params_set_string_member (_data_->_tmp8_, "password", _data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = _data_->p->imap_user;
	_data_->_tmp13_ = dc_params_set_string_member (_data_->_tmp11_, "imapUser", _data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	_data_->_tmp15_ = _data_->p->imap_server;
	_data_->_tmp16_ = dc_params_set_string_member (_data_->_tmp14_, "imapServer", _data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	_data_->_tmp18_ = dc_params_set_opt_int_member (_data_->_tmp17_, "imapPort", _data_->p->imap_port);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = _data_->p->imap_security;
	_data_->_tmp21_ = dc_params_set_string_member (_data_->_tmp19_, "imapSecurity", _data_->_tmp20_);
	_data_->_tmp22_ = _data_->_tmp21_;
	_data_->_tmp23_ = _data_->p->smtp_user;
	_data_->_tmp24_ = dc_params_set_string_member (_data_->_tmp22_, "smtpUser", _data_->_tmp23_);
	_data_->_tmp25_ = _data_->_tmp24_;
	_data_->_tmp26_ = _data_->p->smtp_password;
	_data_->_tmp27_ = dc_params_set_string_member (_data_->_tmp25_, "smtpPassword", _data_->_tmp26_);
	_data_->_tmp28_ = _data_->_tmp27_;
	_data_->_tmp29_ = _data_->p->smtp_server;
	_data_->_tmp30_ = dc_params_set_string_member (_data_->_tmp28_, "smtpServer", _data_->_tmp29_);
	_data_->_tmp31_ = _data_->_tmp30_;
	_data_->_tmp32_ = dc_params_set_opt_int_member (_data_->_tmp31_, "smtpPort", _data_->p->smtp_port);
	_data_->_tmp33_ = _data_->_tmp32_;
	_data_->_tmp34_ = _data_->p->smtp_security;
	_data_->_tmp35_ = dc_params_set_string_member (_data_->_tmp33_, "smtpSecurity", _data_->_tmp34_);
	_data_->_tmp36_ = _data_->_tmp35_;
	_data_->_tmp37_ = _data_->p->certificate_checks;
	_data_->_tmp38_ = dc_params_set_string_member (_data_->_tmp36_, "certificateChecks", _data_->_tmp37_);
	_data_->_tmp39_ = _data_->_tmp38_;
	_data_->_tmp40_ = dc_params_set_null_member (_data_->_tmp39_, "oauth2");
	_data_->_tmp41_ = _data_->_tmp40_;
	_data_->_tmp42_ = dc_params_end_object (_data_->_tmp41_);
	_data_->_tmp43_ = _data_->_tmp42_;
	_data_->_tmp44_ = dc_params_build (_data_->_tmp43_);
	_data_->_tmp45_ = _data_->_tmp44_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "add_or_update_transport", _data_->_tmp45_, dc_rpc_client_add_or_update_transport_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp46_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp47_ = _data_->_tmp46_;
	__vala_JsonNode_free0 (_data_->_tmp47_);
	__vala_JsonNode_free0 (_data_->_tmp45_);
	_g_object_unref0 (_data_->_tmp43_);
	_g_object_unref0 (_data_->_tmp41_);
	_g_object_unref0 (_data_->_tmp39_);
	_g_object_unref0 (_data_->_tmp36_);
	_g_object_unref0 (_data_->_tmp33_);
	_g_object_unref0 (_data_->_tmp31_);
	_g_object_unref0 (_data_->_tmp28_);
	_g_object_unref0 (_data_->_tmp25_);
	_g_object_unref0 (_data_->_tmp22_);
	_g_object_unref0 (_data_->_tmp19_);
	_g_object_unref0 (_data_->_tmp17_);
	_g_object_unref0 (_data_->_tmp14_);
	_g_object_unref0 (_data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_list_transports_data_free (gpointer _data)
{
	DcRpcClientListTransportsData* _data_;
	_data_ = _data;
	__vala_JsonNode_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientListTransportsData, _data_);
}

void
dc_rpc_client_list_transports (DcRpcClient* self,
                               gint acct_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientListTransportsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientListTransportsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_list_transports_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_list_transports_co (_data_);
}

JsonNode*
dc_rpc_client_list_transports_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	JsonNode* result;
	DcRpcClientListTransportsData* _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
dc_rpc_client_list_transports_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientListTransportsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_list_transports_co (_data_);
}

static gboolean
dc_rpc_client_list_transports_co (DcRpcClientListTransportsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = dc_params_begin ();
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp2_, _data_->acct_id);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_build (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "list_transports", _data_->_tmp6_, dc_rpc_client_list_transports_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp7_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp8_ = _data_->_tmp7_;
	__vala_JsonNode_free0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp2_);
	_data_->_tmp0_ = _data_->_tmp8_;
	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_->_tmp9_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp0_);
	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
dc_rpc_client_delete_transport_data_free (gpointer _data)
{
	DcRpcClientDeleteTransportData* _data_;
	_data_ = _data;
	_g_free0 (_data_->addr);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDeleteTransportData, _data_);
}

void
dc_rpc_client_delete_transport (DcRpcClient* self,
                                gint acct_id,
                                const gchar* addr,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientDeleteTransportData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (addr != NULL);
	_data_ = g_slice_new0 (DcRpcClientDeleteTransportData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_delete_transport_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (addr);
	_g_free0 (_data_->addr);
	_data_->addr = _tmp1_;
	dc_rpc_client_delete_transport_co (_data_);
}

void
dc_rpc_client_delete_transport_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	DcRpcClientDeleteTransportData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_delete_transport_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientDeleteTransportData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_delete_transport_co (_data_);
}

static gboolean
dc_rpc_client_delete_transport_co (DcRpcClientDeleteTransportData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->addr);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "delete_transport", _data_->_tmp7_, dc_rpc_client_delete_transport_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_batch_set_config_data_free (gpointer _data)
{
	DcRpcClientBatchSetConfigData* _data_;
	_data_ = _data;
	_g_free0 (_data_->key);
	_g_free0 (_data_->val);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientBatchSetConfigData, _data_);
}

void
dc_rpc_client_batch_set_config (DcRpcClient* self,
                                const gchar* key,
                                const gchar* val,
                                gint acct_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientBatchSetConfigData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (val != NULL);
	_data_ = g_slice_new0 (DcRpcClientBatchSetConfigData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_batch_set_config_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (key);
	_g_free0 (_data_->key);
	_data_->key = _tmp1_;
	_tmp2_ = g_strdup (val);
	_g_free0 (_data_->val);
	_data_->val = _tmp2_;
	_data_->acct_id = acct_id;
	dc_rpc_client_batch_set_config_co (_data_);
}

void
dc_rpc_client_batch_set_config_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	DcRpcClientBatchSetConfigData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_batch_set_config_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientBatchSetConfigData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_batch_set_config_co (_data_);
}

static gboolean
dc_rpc_client_batch_set_config_co (DcRpcClientBatchSetConfigData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_begin_object (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_set_string_member (_data_->_tmp5_, _data_->key, _data_->val);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_end_object (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = dc_params_build (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "batch_set_config", _data_->_tmp11_, dc_rpc_client_batch_set_config_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp12_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp13_ = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_tmp13_);
	__vala_JsonNode_free0 (_data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_config_data_free (gpointer _data)
{
	DcRpcClientGetConfigData* _data_;
	_data_ = _data;
	_g_free0 (_data_->key);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetConfigData, _data_);
}

void
dc_rpc_client_get_config (DcRpcClient* self,
                          const gchar* key,
                          gint acct_id,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_)
{
	DcRpcClientGetConfigData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetConfigData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_config_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (key);
	_g_free0 (_data_->key);
	_data_->key = _tmp1_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_config_co (_data_);
}

gchar*
dc_rpc_client_get_config_finish (DcRpcClient* self,
                                 GAsyncResult* _res_,
                                 GError** error)
{
	gchar* result;
	DcRpcClientGetConfigData* _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
dc_rpc_client_get_config_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_)
{
	DcRpcClientGetConfigData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_config_co (_data_);
}

static gboolean
dc_rpc_client_get_config_co (DcRpcClientGetConfigData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->key);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_config", _data_->_tmp7_, dc_rpc_client_get_config_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp10_ = json_node_is_null (_data_->_result_);
	}
	if (_data_->_tmp10_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp11_ = json_node_get_string (_data_->_result_);
	_data_->_tmp12_ = g_strdup (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_chatlist_entries_for_data_free (gpointer _data)
{
	DcRpcClientGetChatlistEntriesForData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatlistEntriesForData, _data_);
}

void
dc_rpc_client_get_chatlist_entries_for (DcRpcClient* self,
                                        gint acct_id,
                                        const gchar* query,
                                        gint list_flags,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcRpcClientGetChatlistEntriesForData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatlistEntriesForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chatlist_entries_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (query);
	_g_free0 (_data_->query);
	_data_->query = _tmp1_;
	_data_->list_flags = list_flags;
	dc_rpc_client_get_chatlist_entries_for_co (_data_);
}

JsonArray*
dc_rpc_client_get_chatlist_entries_for_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	JsonArray* result;
	DcRpcClientGetChatlistEntriesForData* _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
dc_rpc_client_get_chatlist_entries_for_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcRpcClientGetChatlistEntriesForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chatlist_entries_for_co (_data_);
}

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

static gboolean
dc_rpc_client_get_chatlist_entries_for_co (DcRpcClientGetChatlistEntriesForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_g_object_unref0 (_data_->_tmp1_);
	_data_->params = _data_->_tmp3_;
	if (_data_->list_flags < 0) {
		_data_->_tmp4_ = _data_->params;
		_data_->_tmp5_ = dc_params_add_null (_data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		_g_object_unref0 (_data_->_tmp6_);
	} else {
		_data_->_tmp7_ = _data_->params;
		_data_->_tmp8_ = dc_params_add_int (_data_->_tmp7_, _data_->list_flags);
		_data_->_tmp9_ = _data_->_tmp8_;
		_g_object_unref0 (_data_->_tmp9_);
	}
	_data_->_tmp10_ = _data_->params;
	_data_->_tmp11_ = dc_params_add_string (_data_->_tmp10_, _data_->query);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = dc_params_add_null (_data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	_data_->_tmp15_ = dc_params_build (_data_->_tmp14_);
	_data_->_tmp16_ = _data_->_tmp15_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chatlist_entries", _data_->_tmp16_, dc_rpc_client_get_chatlist_entries_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp17_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp18_ = _data_->_tmp17_;
	__vala_JsonNode_free0 (_data_->_tmp16_);
	_g_object_unref0 (_data_->_tmp14_);
	_g_object_unref0 (_data_->_tmp12_);
	_data_->_result_ = _data_->_tmp18_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->params);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		_g_object_unref0 (_data_->params);
		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_->_tmp19_ = json_node_get_array (_data_->_result_);
	_data_->_tmp20_ = _json_array_ref0 (_data_->_tmp19_);
	_data_->result = _data_->_tmp20_;
	__vala_JsonNode_free0 (_data_->_result_);
	_g_object_unref0 (_data_->params);
	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
dc_rpc_client_get_chatlist_items_by_entries_for_data_free (gpointer _data)
{
	DcRpcClientGetChatlistItemsByEntriesForData* _data_;
	_data_ = _data;
	_json_array_unref0 (_data_->entries);
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatlistItemsByEntriesForData, _data_);
}

void
dc_rpc_client_get_chatlist_items_by_entries_for (DcRpcClient* self,
                                                 gint acct_id,
                                                 JsonArray* entries,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	DcRpcClientGetChatlistItemsByEntriesForData* _data_;
	DcRpcClient* _tmp0_;
	JsonArray* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (entries != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatlistItemsByEntriesForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chatlist_items_by_entries_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = _json_array_ref0 (entries);
	_json_array_unref0 (_data_->entries);
	_data_->entries = _tmp1_;
	dc_rpc_client_get_chatlist_items_by_entries_for_co (_data_);
}

JsonObject*
dc_rpc_client_get_chatlist_items_by_entries_for_finish (DcRpcClient* self,
                                                        GAsyncResult* _res_,
                                                        GError** error)
{
	JsonObject* result;
	DcRpcClientGetChatlistItemsByEntriesForData* _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
dc_rpc_client_get_chatlist_items_by_entries_for_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_)
{
	DcRpcClientGetChatlistItemsByEntriesForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chatlist_items_by_entries_for_co (_data_);
}

static gboolean
dc_rpc_client_get_chatlist_items_by_entries_for_co (DcRpcClientGetChatlistItemsByEntriesForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_json_array (_data_->_tmp3_, _data_->entries);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chatlist_items_by_entries", _data_->_tmp7_, dc_rpc_client_get_chatlist_items_by_entries_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp10_ = json_node_get_object (_data_->_result_);
	_data_->_tmp11_ = _json_object_ref0 (_data_->_tmp10_);
	_data_->result = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_fresh_msg_count_data_free (gpointer _data)
{
	DcRpcClientGetFreshMsgCountData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetFreshMsgCountData, _data_);
}

void
dc_rpc_client_get_fresh_msg_count (DcRpcClient* self,
                                   gint acct_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientGetFreshMsgCountData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetFreshMsgCountData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_fresh_msg_count_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_fresh_msg_count_co (_data_);
}

gint
dc_rpc_client_get_fresh_msg_count_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	gint result;
	DcRpcClientGetFreshMsgCountData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

/**
         * Number of fresh (notification-worthy) messages for an account.
         * Mirrors the Delta Chat core semantics for badge counters: messages in
         * muted chats and contact requests are excluded.
         */
static void
dc_rpc_client_get_fresh_msg_count_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientGetFreshMsgCountData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_fresh_msg_count_co (_data_);
}

static gboolean
dc_rpc_client_get_fresh_msg_count_co (DcRpcClientGetFreshMsgCountData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = 0;
	_data_->_state_ = 1;
	dc_rpc_client_get_fresh_msg_ids (_data_->self, _data_->acct_id, dc_rpc_client_get_fresh_msg_count_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_rpc_client_get_fresh_msg_ids_finish (_data_->self, _data_->_res_, &_data_->_tmp1_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp2_;
	_data_->_tmp0__length1 = _data_->_tmp1_;
	_data_->__tmp0__size_ = _data_->_tmp0__length1;
	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_->result = _data_->_tmp0__length1;
	_data_->_tmp0_ = (g_free (_data_->_tmp0_), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
dc_rpc_client_get_fresh_msg_ids_data_free (gpointer _data)
{
	DcRpcClientGetFreshMsgIdsData* _data_;
	_data_ = _data;
	_data_->result = (g_free (_data_->result), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetFreshMsgIdsData, _data_);
}

void
dc_rpc_client_get_fresh_msg_ids (DcRpcClient* self,
                                 gint acct_id,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DcRpcClientGetFreshMsgIdsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetFreshMsgIdsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_fresh_msg_ids_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_fresh_msg_ids_co (_data_);
}

gint*
dc_rpc_client_get_fresh_msg_ids_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        gint* result_length1,
                                        GError** error)
{
	gint* result;
	DcRpcClientGetFreshMsgIdsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_fresh_msg_ids_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DcRpcClientGetFreshMsgIdsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_fresh_msg_ids_co (_data_);
}

static gboolean
dc_rpc_client_get_fresh_msg_ids_co (DcRpcClientGetFreshMsgIdsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->acct_id <= 0) {
		_data_->_tmp0_ = g_new0 (gint, 0);
		_data_->_tmp1_ = _data_->_tmp0_;
		_data_->_tmp1__length1 = 0;
		_data_->result_length1 = _data_->_tmp1__length1;
		_data_->result = _data_->_tmp1_;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = dc_params_begin ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->acct_id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_fresh_msgs", _data_->_tmp7_, dc_rpc_client_get_fresh_msg_ids_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->_result_ = _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_->_result_;
	if (_data_->_tmp11_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp12_ = _data_->_result_;
		_data_->_tmp10_ = json_node_get_node_type (_data_->_tmp12_) != JSON_NODE_ARRAY;
	}
	if (_data_->_tmp10_) {
		_data_->_tmp13_ = g_new0 (gint, 0);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp14__length1 = 0;
		_data_->result_length1 = _data_->_tmp14__length1;
		_data_->result = _data_->_tmp14_;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_result_;
	_data_->_tmp16_ = json_node_get_array (_data_->_tmp15_);
	_data_->_tmp17_ = _json_array_ref0 (_data_->_tmp16_);
	_data_->arr = _data_->_tmp17_;
	_data_->_tmp18_ = _data_->arr;
	_data_->_tmp19_ = g_new0 (gint, json_array_get_length (_data_->_tmp18_));
	_data_->ids = _data_->_tmp19_;
	_data_->ids_length1 = json_array_get_length (_data_->_tmp18_);
	_data_->_ids_size_ = _data_->ids_length1;
	{
		_data_->i = (guint) 0;
		{
			_data_->_tmp20_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp20_) {
					_data_->_tmp21_ = _data_->i;
					_data_->i = _data_->_tmp21_ + 1;
				}
				_data_->_tmp20_ = FALSE;
				_data_->_tmp22_ = _data_->arr;
				if (!(_data_->i < json_array_get_length (_data_->_tmp22_))) {
					break;
				}
				_data_->_tmp23_ = _data_->ids;
				_data_->_tmp23__length1 = _data_->ids_length1;
				_data_->_tmp24_ = _data_->arr;
				_data_->_tmp23_[_data_->i] = (gint) json_array_get_int_element (_data_->_tmp24_, _data_->i);
			}
		}
	}
	_data_->_tmp25_ = _data_->ids;
	_data_->_tmp25__length1 = _data_->ids_length1;
	_data_->result_length1 = _data_->_tmp25__length1;
	_data_->result = _data_->_tmp25_;
	_json_array_unref0 (_data_->arr);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_full_chat_by_id_for_data_free (gpointer _data)
{
	DcRpcClientGetFullChatByIdForData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetFullChatByIdForData, _data_);
}

void
dc_rpc_client_get_full_chat_by_id_for (DcRpcClient* self,
                                       gint acct_id,
                                       gint chat_id,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DcRpcClientGetFullChatByIdForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetFullChatByIdForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_full_chat_by_id_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->chat_id = chat_id;
	dc_rpc_client_get_full_chat_by_id_for_co (_data_);
}

JsonObject*
dc_rpc_client_get_full_chat_by_id_for_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	JsonObject* result;
	DcRpcClientGetFullChatByIdForData* _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
dc_rpc_client_get_full_chat_by_id_for_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	DcRpcClientGetFullChatByIdForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_full_chat_by_id_for_co (_data_);
}

static gboolean
dc_rpc_client_get_full_chat_by_id_for_co (DcRpcClientGetFullChatByIdForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->chat_id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_full_chat_by_id", _data_->_tmp7_, dc_rpc_client_get_full_chat_by_id_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp10_ = json_node_get_object (_data_->_result_);
	_data_->_tmp11_ = _json_object_ref0 (_data_->_tmp10_);
	_data_->result = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_message_ids_for_data_free (gpointer _data)
{
	DcRpcClientGetMessageIdsForData* _data_;
	_data_ = _data;
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessageIdsForData, _data_);
}

void
dc_rpc_client_get_message_ids_for (DcRpcClient* self,
                                   gint acct_id,
                                   gint chat_id,
                                   gboolean info_only,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientGetMessageIdsForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessageIdsForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_message_ids_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->chat_id = chat_id;
	_data_->info_only = info_only;
	dc_rpc_client_get_message_ids_for_co (_data_);
}

JsonArray*
dc_rpc_client_get_message_ids_for_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	JsonArray* result;
	DcRpcClientGetMessageIdsForData* _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
dc_rpc_client_get_message_ids_for_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientGetMessageIdsForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_message_ids_for_co (_data_);
}

static gboolean
dc_rpc_client_get_message_ids_for_co (DcRpcClientGetMessageIdsForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->chat_id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_add_bool (_data_->_tmp5_, _data_->info_only);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_add_bool (_data_->_tmp7_, FALSE);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = dc_params_build (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_message_ids", _data_->_tmp11_, dc_rpc_client_get_message_ids_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp12_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp13_ = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp13_;
	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_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp14_ = json_node_get_array (_data_->_result_);
	_data_->_tmp15_ = _json_array_ref0 (_data_->_tmp14_);
	_data_->result = _data_->_tmp15_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_message_for_data_free (gpointer _data)
{
	DcRpcClientGetMessageForData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessageForData, _data_);
}

void
dc_rpc_client_get_message_for (DcRpcClient* self,
                               gint acct_id,
                               gint msg_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientGetMessageForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessageForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_message_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->msg_id = msg_id;
	dc_rpc_client_get_message_for_co (_data_);
}

JsonObject*
dc_rpc_client_get_message_for_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	JsonObject* result;
	DcRpcClientGetMessageForData* _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
dc_rpc_client_get_message_for_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientGetMessageForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_message_for_co (_data_);
}

static gboolean
dc_rpc_client_get_message_for_co (DcRpcClientGetMessageForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->msg_id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_message", _data_->_tmp7_, dc_rpc_client_get_message_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp10_ = json_node_get_object (_data_->_result_);
	_data_->_tmp11_ = _json_object_ref0 (_data_->_tmp10_);
	_data_->result = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_message_html_for_data_free (gpointer _data)
{
	DcRpcClientGetMessageHtmlForData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessageHtmlForData, _data_);
}

void
dc_rpc_client_get_message_html_for (DcRpcClient* self,
                                    gint acct_id,
                                    gint msg_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	DcRpcClientGetMessageHtmlForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessageHtmlForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_message_html_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->msg_id = msg_id;
	dc_rpc_client_get_message_html_for_co (_data_);
}

gchar*
dc_rpc_client_get_message_html_for_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	gchar* result;
	DcRpcClientGetMessageHtmlForData* _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
dc_rpc_client_get_message_html_for_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	DcRpcClientGetMessageHtmlForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_message_html_for_co (_data_);
}

static gboolean
dc_rpc_client_get_message_html_for_co (DcRpcClientGetMessageHtmlForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->msg_id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_message_html", _data_->_tmp7_, dc_rpc_client_get_message_html_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp10_ = json_node_is_null (_data_->_result_);
	}
	if (_data_->_tmp10_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp11_ = json_node_get_string (_data_->_result_);
	_data_->_tmp12_ = g_strdup (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_message_html_data_free (gpointer _data)
{
	DcRpcClientGetMessageHtmlData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessageHtmlData, _data_);
}

void
dc_rpc_client_get_message_html (DcRpcClient* self,
                                gint msg_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientGetMessageHtmlData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessageHtmlData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_message_html_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	dc_rpc_client_get_message_html_co (_data_);
}

gchar*
dc_rpc_client_get_message_html_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	gchar* result;
	DcRpcClientGetMessageHtmlData* _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
dc_rpc_client_get_message_html_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientGetMessageHtmlData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_message_html_co (_data_);
}

static gboolean
dc_rpc_client_get_message_html_co (DcRpcClientGetMessageHtmlData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->_account_id;
	_data_->_state_ = 1;
	dc_rpc_client_get_message_html_for (_data_->self, _data_->_tmp1_, _data_->msg_id, dc_rpc_client_get_message_html_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_rpc_client_get_message_html_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp3_;
	_g_free0 (_data_->_tmp0_);
	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
dc_rpc_client_download_full_message_data_free (gpointer _data)
{
	DcRpcClientDownloadFullMessageData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDownloadFullMessageData, _data_);
}

void
dc_rpc_client_download_full_message (DcRpcClient* self,
                                     gint msg_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientDownloadFullMessageData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientDownloadFullMessageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_download_full_message_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	dc_rpc_client_download_full_message_co (_data_);
}

void
dc_rpc_client_download_full_message_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	DcRpcClientDownloadFullMessageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_download_full_message_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientDownloadFullMessageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_download_full_message_co (_data_);
}

static gboolean
dc_rpc_client_download_full_message_co (DcRpcClientDownloadFullMessageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->msg_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "download_full_message", _data_->_tmp8_, dc_rpc_client_download_full_message_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_fetch_message_data_free (gpointer _data)
{
	DcRpcClientFetchMessageData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientFetchMessageData, _data_);
}

void
dc_rpc_client_fetch_message (DcRpcClient* self,
                             gint msg_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientFetchMessageData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientFetchMessageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_fetch_message_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	dc_rpc_client_fetch_message_co (_data_);
}

DcMessage*
dc_rpc_client_fetch_message_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	DcMessage* result;
	DcRpcClientFetchMessageData* _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
dc_rpc_client_fetch_message_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientFetchMessageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_fetch_message_co (_data_);
}

static gboolean
dc_rpc_client_fetch_message_co (DcRpcClientFetchMessageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->_account_id;
	_data_->_tmp2_ = _data_->self->priv->_self_email;
	_data_->_state_ = 1;
	dc_rpc_client_fetch_message_for (_data_->self, _data_->_tmp1_, _data_->msg_id, _data_->_tmp2_, dc_rpc_client_fetch_message_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = dc_rpc_client_fetch_message_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp3_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp4_;
	_g_object_unref0 (_data_->_tmp0_);
	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
dc_rpc_client_fetch_message_for_data_free (gpointer _data)
{
	DcRpcClientFetchMessageForData* _data_;
	_data_ = _data;
	_g_free0 (_data_->self_addr);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientFetchMessageForData, _data_);
}

void
dc_rpc_client_fetch_message_for (DcRpcClient* self,
                                 gint acct_id,
                                 gint msg_id,
                                 const gchar* self_addr,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DcRpcClientFetchMessageForData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientFetchMessageForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_fetch_message_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->msg_id = msg_id;
	_tmp1_ = g_strdup (self_addr);
	_g_free0 (_data_->self_addr);
	_data_->self_addr = _tmp1_;
	dc_rpc_client_fetch_message_for_co (_data_);
}

DcMessage*
dc_rpc_client_fetch_message_for_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	DcMessage* result;
	DcRpcClientFetchMessageForData* _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
dc_rpc_client_fetch_message_for_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DcRpcClientFetchMessageForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_fetch_message_for_co (_data_);
}

static gboolean
dc_rpc_client_fetch_message_for_co (DcRpcClientFetchMessageForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	dc_rpc_client_get_message_for (_data_->self, _data_->acct_id, _data_->msg_id, dc_rpc_client_fetch_message_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = dc_rpc_client_get_message_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->obj = _data_->_tmp0_;
	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_->obj == NULL) {
		_data_->result = NULL;
		_json_object_unref0 (_data_->obj);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = dc_rpc_parsers_parse_message (_data_->obj, _data_->self_addr);
	_data_->result = _data_->_tmp1_;
	_json_object_unref0 (_data_->obj);
	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
dc_rpc_client_get_messages_for_data_free (gpointer _data)
{
	DcRpcClientGetMessagesForData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessagesForData, _data_);
}

void
dc_rpc_client_get_messages_for (DcRpcClient* self,
                                gint acct_id,
                                gint* msg_ids,
                                gint msg_ids_length1,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientGetMessagesForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessagesForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_messages_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_get_messages_for_co (_data_);
}

JsonObject*
dc_rpc_client_get_messages_for_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	JsonObject* result;
	DcRpcClientGetMessagesForData* _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
dc_rpc_client_get_messages_for_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientGetMessagesForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_messages_for_co (_data_);
}

static gboolean
dc_rpc_client_get_messages_for_co (DcRpcClientGetMessagesForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int_array (_data_->_tmp3_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_messages", _data_->_tmp7_, dc_rpc_client_get_messages_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp10_ = json_node_get_object (_data_->_result_);
	_data_->_tmp11_ = _json_object_ref0 (_data_->_tmp10_);
	_data_->result = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_parsed_messages_data_free (gpointer _data)
{
	DcRpcClientGetParsedMessagesData* _data_;
	_data_ = _data;
	_data_->result = (_vala_array_free (_data_->result, _data_->result_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetParsedMessagesData, _data_);
}

void
dc_rpc_client_get_parsed_messages (DcRpcClient* self,
                                   gint* msg_ids,
                                   gint msg_ids_length1,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientGetParsedMessagesData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetParsedMessagesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_parsed_messages_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_get_parsed_messages_co (_data_);
}

DcMessage**
dc_rpc_client_get_parsed_messages_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          gint* result_length1,
                                          GError** error)
{
	DcMessage** result;
	DcRpcClientGetParsedMessagesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}

/** Fetch and parse several messages at once, keeping msg_ids
            order. Entries that are missing or tagged "loadingError"
            (get_messages results are tagged) are skipped. */
static void
dc_rpc_client_get_parsed_messages_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientGetParsedMessagesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_parsed_messages_co (_data_);
}

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

static gboolean
dc_rpc_client_get_parsed_messages_co (DcRpcClientGetParsedMessagesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_account_id;
	_data_->_state_ = 1;
	dc_rpc_client_get_messages_for (_data_->self, _data_->_tmp0_, _data_->msg_ids, (gint) _data_->msg_ids_length1, dc_rpc_client_get_parsed_messages_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = dc_rpc_client_get_messages_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->map = _data_->_tmp1_;
	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_->_tmp2_ = g_new0 (DcMessage*, 0 + 1);
	_data_->msgs = _data_->_tmp2_;
	_data_->msgs_length1 = 0;
	_data_->_msgs_size_ = _data_->msgs_length1;
	_data_->_tmp3_ = _data_->map;
	if (_data_->_tmp3_ == NULL) {
		_data_->_tmp4_ = _data_->msgs;
		_data_->_tmp4__length1 = _data_->msgs_length1;
		_data_->result_length1 = _data_->_tmp4__length1;
		_data_->result = _data_->_tmp4_;
		_json_object_unref0 (_data_->map);
		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_->msg_id_collection_length1 = 0;
		_data_->_msg_id_collection_size_ = 0;
		_data_->msg_id_collection = _data_->msg_ids;
		_data_->msg_id_collection_length1 = _data_->msg_ids_length1;
		for (_data_->msg_id_it = 0; _data_->msg_id_it < _data_->msg_id_collection_length1; _data_->msg_id_it = _data_->msg_id_it + 1) {
			_data_->msg_id = _data_->msg_id_collection[_data_->msg_id_it];
			{
				_data_->_tmp5_ = g_strdup_printf ("%i", _data_->msg_id);
				_data_->key = _data_->_tmp5_;
				_data_->_tmp6_ = _data_->map;
				_data_->_tmp7_ = _data_->key;
				if (!json_object_has_member (_data_->_tmp6_, _data_->_tmp7_)) {
					_g_free0 (_data_->key);
					continue;
				}
				_data_->_tmp8_ = _data_->map;
				_data_->_tmp9_ = _data_->key;
				_data_->_tmp10_ = json_object_get_member (_data_->_tmp8_, _data_->_tmp9_);
				_data_->_tmp11_ = __vala_JsonNode_copy0 (_data_->_tmp10_);
				_data_->node = _data_->_tmp11_;
				_data_->_tmp13_ = _data_->node;
				if (_data_->_tmp13_ == NULL) {
					_data_->_tmp12_ = TRUE;
				} else {
					_data_->_tmp14_ = _data_->node;
					_data_->_tmp12_ = json_node_get_node_type (_data_->_tmp14_) != JSON_NODE_OBJECT;
				}
				if (_data_->_tmp12_) {
					__vala_JsonNode_free0 (_data_->node);
					_g_free0 (_data_->key);
					continue;
				}
				_data_->_tmp15_ = _data_->node;
				_data_->_tmp16_ = json_node_get_object (_data_->_tmp15_);
				_data_->_tmp17_ = _json_object_ref0 (_data_->_tmp16_);
				_data_->obj = _data_->_tmp17_;
				_data_->_tmp18_ = _data_->obj;
				_data_->_tmp19_ = dc_json_str (_data_->_tmp18_, "kind");
				_data_->_tmp20_ = _data_->_tmp19_;
				_data_->_tmp21_ = g_strcmp0 (_data_->_tmp20_, "message") != 0;
				_g_free0 (_data_->_tmp20_);
				if (_data_->_tmp21_) {
					_json_object_unref0 (_data_->obj);
					__vala_JsonNode_free0 (_data_->node);
					_g_free0 (_data_->key);
					continue;
				}
				_data_->_tmp22_ = _data_->obj;
				_data_->_tmp23_ = _data_->self->priv->_self_email;
				_data_->_tmp24_ = dc_rpc_parsers_parse_message (_data_->_tmp22_, _data_->_tmp23_);
				_vala_array_add17 (&_data_->msgs, &_data_->msgs_length1, &_data_->_msgs_size_, _data_->_tmp24_);
				_json_object_unref0 (_data_->obj);
				__vala_JsonNode_free0 (_data_->node);
				_g_free0 (_data_->key);
			}
		}
	}
	_data_->_tmp25_ = _data_->msgs;
	_data_->_tmp25__length1 = _data_->msgs_length1;
	_data_->result_length1 = _data_->_tmp25__length1;
	_data_->result = _data_->_tmp25_;
	_json_object_unref0 (_data_->map);
	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
dc_rpc_client_send_msg_data_free (gpointer _data)
{
	DcRpcClientSendMsgData* _data_;
	_data_ = _data;
	_g_free0 (_data_->text);
	_g_free0 (_data_->file_path);
	_g_free0 (_data_->file_name);
	_g_free0 (_data_->view_type);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSendMsgData, _data_);
}

void
dc_rpc_client_send_msg (DcRpcClient* self,
                        gint chat_id,
                        const gchar* text,
                        const gchar* file_path,
                        const gchar* file_name,
                        gint quoted_msg_id,
                        const gchar* view_type,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_)
{
	DcRpcClientSendMsgData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSendMsgData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_send_msg_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_tmp1_ = g_strdup (text);
	_g_free0 (_data_->text);
	_data_->text = _tmp1_;
	_tmp2_ = g_strdup (file_path);
	_g_free0 (_data_->file_path);
	_data_->file_path = _tmp2_;
	_tmp3_ = g_strdup (file_name);
	_g_free0 (_data_->file_name);
	_data_->file_name = _tmp3_;
	_data_->quoted_msg_id = quoted_msg_id;
	_tmp4_ = g_strdup (view_type);
	_g_free0 (_data_->view_type);
	_data_->view_type = _tmp4_;
	dc_rpc_client_send_msg_co (_data_);
}

gint
dc_rpc_client_send_msg_finish (DcRpcClient* self,
                               GAsyncResult* _res_,
                               GError** error)
{
	gint result;
	DcRpcClientSendMsgData* _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
dc_rpc_client_send_msg_ready (GObject* source_object,
                              GAsyncResult* _res_,
                              gpointer _user_data_)
{
	DcRpcClientSendMsgData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_send_msg_co (_data_);
}

static gboolean
dc_rpc_client_send_msg_co (DcRpcClientSendMsgData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_begin_object (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_set_string_member (_data_->_tmp8_, "text", _data_->text);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = dc_params_set_string_member (_data_->_tmp10_, "file", _data_->file_path);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = dc_params_set_string_member (_data_->_tmp12_, "filename", _data_->file_name);
	_data_->_tmp14_ = _data_->_tmp13_;
	_data_->_tmp15_ = dc_params_set_string_member (_data_->_tmp14_, "viewtype", _data_->view_type);
	_data_->_tmp16_ = _data_->_tmp15_;
	_g_object_unref0 (_data_->_tmp14_);
	_g_object_unref0 (_data_->_tmp12_);
	_g_object_unref0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->p = _data_->_tmp16_;
	if (_data_->quoted_msg_id > 0) {
		_data_->_tmp17_ = _data_->p;
		_data_->_tmp18_ = dc_params_set_int_member (_data_->_tmp17_, "quotedMessageId", _data_->quoted_msg_id);
		_data_->_tmp19_ = _data_->_tmp18_;
		_g_object_unref0 (_data_->_tmp19_);
	} else {
		_data_->_tmp20_ = _data_->p;
		_data_->_tmp21_ = dc_params_set_null_member (_data_->_tmp20_, "quotedMessageId");
		_data_->_tmp22_ = _data_->_tmp21_;
		_g_object_unref0 (_data_->_tmp22_);
	}
	_data_->_tmp23_ = _data_->p;
	_data_->_tmp24_ = dc_params_end_object (_data_->_tmp23_);
	_data_->_tmp25_ = _data_->_tmp24_;
	_g_object_unref0 (_data_->_tmp25_);
	_data_->_tmp26_ = _data_->p;
	_data_->_tmp27_ = dc_params_build (_data_->_tmp26_);
	_data_->_tmp28_ = _data_->_tmp27_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "send_msg", _data_->_tmp28_, dc_rpc_client_send_msg_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp29_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp30_ = _data_->_tmp29_;
	__vala_JsonNode_free0 (_data_->_tmp28_);
	_data_->_result_ = _data_->_tmp30_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->p);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ != NULL) {
		_data_->_tmp31_ = (gint) json_node_get_int (_data_->_result_);
	} else {
		_data_->_tmp31_ = 0;
	}
	_data_->result = _data_->_tmp31_;
	__vala_JsonNode_free0 (_data_->_result_);
	_g_object_unref0 (_data_->p);
	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
dc_rpc_client_get_draft_data_free (gpointer _data)
{
	DcRpcClientGetDraftData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetDraftData, _data_);
}

void
dc_rpc_client_get_draft (DcRpcClient* self,
                         gint chat_id,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	DcRpcClientGetDraftData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetDraftData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_draft_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_get_draft_co (_data_);
}

DcMessage*
dc_rpc_client_get_draft_finish (DcRpcClient* self,
                                GAsyncResult* _res_,
                                GError** error)
{
	DcMessage* result;
	DcRpcClientGetDraftData* _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
dc_rpc_client_get_draft_ready (GObject* source_object,
                               GAsyncResult* _res_,
                               gpointer _user_data_)
{
	DcRpcClientGetDraftData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_draft_co (_data_);
}

static gboolean
dc_rpc_client_get_draft_co (DcRpcClientGetDraftData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_draft", _data_->_tmp8_, dc_rpc_client_get_draft_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	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_->_result_ == NULL) {
		_data_->_tmp12_ = TRUE;
	} else {
		_data_->_tmp12_ = json_node_is_null (_data_->_result_);
	}
	if (_data_->_tmp12_) {
		_data_->_tmp11_ = TRUE;
	} else {
		_data_->_tmp11_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_OBJECT;
	}
	if (_data_->_tmp11_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp13_ = json_node_get_object (_data_->_result_);
	_data_->_tmp14_ = _data_->self->priv->_self_email;
	_data_->_tmp15_ = dc_rpc_parsers_parse_message (_data_->_tmp13_, _data_->_tmp14_);
	_data_->result = _data_->_tmp15_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_set_draft_data_free (gpointer _data)
{
	DcRpcClientSetDraftData* _data_;
	_data_ = _data;
	_g_free0 (_data_->text);
	_g_free0 (_data_->file_path);
	_g_free0 (_data_->file_name);
	_g_free0 (_data_->view_type);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetDraftData, _data_);
}

void
dc_rpc_client_set_draft (DcRpcClient* self,
                         gint chat_id,
                         const gchar* text,
                         const gchar* file_path,
                         const gchar* file_name,
                         gint quoted_msg_id,
                         const gchar* view_type,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	DcRpcClientSetDraftData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetDraftData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_draft_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_tmp1_ = g_strdup (text);
	_g_free0 (_data_->text);
	_data_->text = _tmp1_;
	_tmp2_ = g_strdup (file_path);
	_g_free0 (_data_->file_path);
	_data_->file_path = _tmp2_;
	_tmp3_ = g_strdup (file_name);
	_g_free0 (_data_->file_name);
	_data_->file_name = _tmp3_;
	_data_->quoted_msg_id = quoted_msg_id;
	_tmp4_ = g_strdup (view_type);
	_g_free0 (_data_->view_type);
	_data_->view_type = _tmp4_;
	dc_rpc_client_set_draft_co (_data_);
}

void
dc_rpc_client_set_draft_finish (DcRpcClient* self,
                                GAsyncResult* _res_,
                                GError** error)
{
	DcRpcClientSetDraftData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_draft_ready (GObject* source_object,
                               GAsyncResult* _res_,
                               gpointer _user_data_)
{
	DcRpcClientSetDraftData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_draft_co (_data_);
}

static gboolean
dc_rpc_client_set_draft_co (DcRpcClientSetDraftData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->text);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_add_string (_data_->_tmp8_, _data_->file_path);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = dc_params_add_string (_data_->_tmp10_, _data_->file_name);
	_data_->_tmp12_ = _data_->_tmp11_;
	_g_object_unref0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->p = _data_->_tmp12_;
	if (_data_->quoted_msg_id > 0) {
		_data_->_tmp13_ = _data_->p;
		_data_->_tmp14_ = dc_params_add_int (_data_->_tmp13_, _data_->quoted_msg_id);
		_data_->_tmp15_ = _data_->_tmp14_;
		_g_object_unref0 (_data_->_tmp15_);
	} else {
		_data_->_tmp16_ = _data_->p;
		_data_->_tmp17_ = dc_params_add_null (_data_->_tmp16_);
		_data_->_tmp18_ = _data_->_tmp17_;
		_g_object_unref0 (_data_->_tmp18_);
	}
	_data_->_tmp19_ = _data_->p;
	_data_->_tmp20_ = dc_params_add_string (_data_->_tmp19_, _data_->view_type);
	_data_->_tmp21_ = _data_->_tmp20_;
	_g_object_unref0 (_data_->_tmp21_);
	_data_->_tmp22_ = _data_->p;
	_data_->_tmp23_ = dc_params_build (_data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "misc_set_draft", _data_->_tmp24_, dc_rpc_client_set_draft_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp25_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp26_ = _data_->_tmp25_;
	__vala_JsonNode_free0 (_data_->_tmp26_);
	__vala_JsonNode_free0 (_data_->_tmp24_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->p);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->p);
	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
dc_rpc_client_remove_draft_data_free (gpointer _data)
{
	DcRpcClientRemoveDraftData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientRemoveDraftData, _data_);
}

void
dc_rpc_client_remove_draft (DcRpcClient* self,
                            gint chat_id,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	DcRpcClientRemoveDraftData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientRemoveDraftData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_remove_draft_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_remove_draft_co (_data_);
}

void
dc_rpc_client_remove_draft_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	DcRpcClientRemoveDraftData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_remove_draft_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	DcRpcClientRemoveDraftData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_remove_draft_co (_data_);
}

static gboolean
dc_rpc_client_remove_draft_co (DcRpcClientRemoveDraftData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "remove_draft", _data_->_tmp8_, dc_rpc_client_remove_draft_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_send_edit_request_data_free (gpointer _data)
{
	DcRpcClientSendEditRequestData* _data_;
	_data_ = _data;
	_g_free0 (_data_->new_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSendEditRequestData, _data_);
}

void
dc_rpc_client_send_edit_request (DcRpcClient* self,
                                 gint msg_id,
                                 const gchar* new_text,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DcRpcClientSendEditRequestData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientSendEditRequestData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_send_edit_request_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_tmp1_ = g_strdup (new_text);
	_g_free0 (_data_->new_text);
	_data_->new_text = _tmp1_;
	dc_rpc_client_send_edit_request_co (_data_);
}

void
dc_rpc_client_send_edit_request_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	DcRpcClientSendEditRequestData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_send_edit_request_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DcRpcClientSendEditRequestData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_send_edit_request_co (_data_);
}

static gboolean
dc_rpc_client_send_edit_request_co (DcRpcClientSendEditRequestData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->msg_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->new_text);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "send_edit_request", _data_->_tmp10_, dc_rpc_client_send_edit_request_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_send_reaction_data_free (gpointer _data)
{
	DcRpcClientSendReactionData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSendReactionData, _data_);
}

void
dc_rpc_client_send_reaction (DcRpcClient* self,
                             gint msg_id,
                             gchar** emojis,
                             gint emojis_length1,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientSendReactionData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSendReactionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_send_reaction_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_data_->emojis = emojis;
	_data_->emojis_length1 = emojis_length1;
	dc_rpc_client_send_reaction_co (_data_);
}

void
dc_rpc_client_send_reaction_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	DcRpcClientSendReactionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_send_reaction_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientSendReactionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_send_reaction_co (_data_);
}

static gboolean
dc_rpc_client_send_reaction_co (DcRpcClientSendReactionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->msg_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string_array (_data_->_tmp6_, _data_->emojis, (gint) _data_->emojis_length1);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "send_reaction", _data_->_tmp10_, dc_rpc_client_send_reaction_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_set_pinned_message_state_data_free (gpointer _data)
{
	DcRpcClientSetPinnedMessageStateData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetPinnedMessageStateData, _data_);
}

void
dc_rpc_client_set_pinned_message_state (DcRpcClient* self,
                                        gint msg_id,
                                        gboolean pinned,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcRpcClientSetPinnedMessageStateData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetPinnedMessageStateData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_pinned_message_state_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_data_->pinned = pinned;
	dc_rpc_client_set_pinned_message_state_co (_data_);
}

void
dc_rpc_client_set_pinned_message_state_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	DcRpcClientSetPinnedMessageStateData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_pinned_message_state_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcRpcClientSetPinnedMessageStateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_pinned_message_state_co (_data_);
}

static gboolean
dc_rpc_client_set_pinned_message_state_co (DcRpcClientSetPinnedMessageStateData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->msg_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_bool (_data_->_tmp6_, _data_->pinned);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_pinned_message_state", _data_->_tmp10_, dc_rpc_client_set_pinned_message_state_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_pinned_messages_data_free (gpointer _data)
{
	DcRpcClientGetPinnedMessagesData* _data_;
	_data_ = _data;
	_data_->result = (g_free (_data_->result), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetPinnedMessagesData, _data_);
}

void
dc_rpc_client_get_pinned_messages (DcRpcClient* self,
                                   gint chat_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientGetPinnedMessagesData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetPinnedMessagesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_pinned_messages_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_get_pinned_messages_co (_data_);
}

gint*
dc_rpc_client_get_pinned_messages_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          gint* result_length1,
                                          GError** error)
{
	gint* result;
	DcRpcClientGetPinnedMessagesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_pinned_messages_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientGetPinnedMessagesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_pinned_messages_co (_data_);
}

static gboolean
dc_rpc_client_get_pinned_messages_co (DcRpcClientGetPinnedMessagesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_pinned_messages", _data_->_tmp8_, dc_rpc_client_get_pinned_messages_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	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_->_result_ == NULL) {
		_data_->_tmp11_ = TRUE;
	} else {
		_data_->_tmp11_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_ARRAY;
	}
	if (_data_->_tmp11_) {
		_data_->_tmp12_ = g_new0 (gint, 0);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp13__length1 = 0;
		_data_->result_length1 = _data_->_tmp13__length1;
		_data_->result = _data_->_tmp13_;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp14_ = json_node_get_array (_data_->_result_);
	_data_->_tmp15_ = _json_array_ref0 (_data_->_tmp14_);
	_data_->arr = _data_->_tmp15_;
	_data_->_tmp16_ = _data_->arr;
	_data_->_tmp17_ = g_new0 (gint, json_array_get_length (_data_->_tmp16_));
	_data_->msg_ids = _data_->_tmp17_;
	_data_->msg_ids_length1 = json_array_get_length (_data_->_tmp16_);
	_data_->_msg_ids_size_ = _data_->msg_ids_length1;
	{
		_data_->i = (guint) 0;
		{
			_data_->_tmp18_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp18_) {
					_data_->_tmp19_ = _data_->i;
					_data_->i = _data_->_tmp19_ + 1;
				}
				_data_->_tmp18_ = FALSE;
				_data_->_tmp20_ = _data_->arr;
				if (!(_data_->i < json_array_get_length (_data_->_tmp20_))) {
					break;
				}
				_data_->_tmp21_ = _data_->msg_ids;
				_data_->_tmp21__length1 = _data_->msg_ids_length1;
				_data_->_tmp22_ = _data_->arr;
				_data_->_tmp21_[_data_->i] = (gint) json_array_get_int_element (_data_->_tmp22_, _data_->i);
			}
		}
	}
	_data_->_tmp23_ = _data_->msg_ids;
	_data_->_tmp23__length1 = _data_->msg_ids_length1;
	_data_->result_length1 = _data_->_tmp23__length1;
	_data_->result = _data_->_tmp23_;
	_json_array_unref0 (_data_->arr);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_marknoticed_chat_data_free (gpointer _data)
{
	DcRpcClientMarknoticedChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientMarknoticedChatData, _data_);
}

void
dc_rpc_client_marknoticed_chat (DcRpcClient* self,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientMarknoticedChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientMarknoticedChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_marknoticed_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_marknoticed_chat_co (_data_);
}

void
dc_rpc_client_marknoticed_chat_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	DcRpcClientMarknoticedChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_marknoticed_chat_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientMarknoticedChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_marknoticed_chat_co (_data_);
}

static gboolean
dc_rpc_client_marknoticed_chat_co (DcRpcClientMarknoticedChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "marknoticed_chat", _data_->_tmp8_, dc_rpc_client_marknoticed_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_markfresh_chat_data_free (gpointer _data)
{
	DcRpcClientMarkfreshChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientMarkfreshChatData, _data_);
}

void
dc_rpc_client_markfresh_chat (DcRpcClient* self,
                              gint chat_id,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientMarkfreshChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientMarkfreshChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_markfresh_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_markfresh_chat_co (_data_);
}

void
dc_rpc_client_markfresh_chat_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientMarkfreshChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_markfresh_chat_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientMarkfreshChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_markfresh_chat_co (_data_);
}

static gboolean
dc_rpc_client_markfresh_chat_co (DcRpcClientMarkfreshChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "markfresh_chat", _data_->_tmp8_, dc_rpc_client_markfresh_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_mark_seen_msgs_data_free (gpointer _data)
{
	DcRpcClientMarkSeenMsgsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientMarkSeenMsgsData, _data_);
}

void
dc_rpc_client_mark_seen_msgs (DcRpcClient* self,
                              gint* msg_ids,
                              gint msg_ids_length1,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientMarkSeenMsgsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientMarkSeenMsgsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_mark_seen_msgs_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_mark_seen_msgs_co (_data_);
}

void
dc_rpc_client_mark_seen_msgs_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientMarkSeenMsgsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_mark_seen_msgs_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientMarkSeenMsgsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_mark_seen_msgs_co (_data_);
}

static gboolean
dc_rpc_client_mark_seen_msgs_co (DcRpcClientMarkSeenMsgsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int_array (_data_->_tmp4_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "markseen_msgs", _data_->_tmp8_, dc_rpc_client_mark_seen_msgs_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_next_event_data_free (gpointer _data)
{
	DcRpcClientGetNextEventData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetNextEventData, _data_);
}

void
dc_rpc_client_get_next_event (DcRpcClient* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientGetNextEventData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetNextEventData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_next_event_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_get_next_event_co (_data_);
}

JsonObject*
dc_rpc_client_get_next_event_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	JsonObject* result;
	DcRpcClientGetNextEventData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

/**
         * Blocks until the next event from the RPC server.
         * Returns the full event result: { contextId, event: { kind, ... } }
         * This is a global call (not per-account).
         */
static void
dc_rpc_client_get_next_event_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientGetNextEventData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_next_event_co (_data_);
}

static gboolean
dc_rpc_client_get_next_event_co (DcRpcClientGetNextEventData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_build (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_next_event", _data_->_tmp3_, dc_rpc_client_get_next_event_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp5_ = _data_->_tmp4_;
	__vala_JsonNode_free0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp5_;
	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_->_result_ == NULL) {
		_data_->_tmp6_ = TRUE;
	} else {
		_data_->_tmp6_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_OBJECT;
	}
	if (_data_->_tmp6_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp7_ = json_node_get_object (_data_->_result_);
	_data_->_tmp8_ = _json_object_ref0 (_data_->_tmp7_);
	_data_->result = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_contact_ids_for_data_free (gpointer _data)
{
	DcRpcClientGetContactIdsForData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetContactIdsForData, _data_);
}

void
dc_rpc_client_get_contact_ids_for (DcRpcClient* self,
                                   gint acct_id,
                                   const gchar* query,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientGetContactIdsForData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetContactIdsForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_contact_ids_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (query);
	_g_free0 (_data_->query);
	_data_->query = _tmp1_;
	dc_rpc_client_get_contact_ids_for_co (_data_);
}

JsonArray*
dc_rpc_client_get_contact_ids_for_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	JsonArray* result;
	DcRpcClientGetContactIdsForData* _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
dc_rpc_client_get_contact_ids_for_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientGetContactIdsForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_contact_ids_for_co (_data_);
}

static gboolean
dc_rpc_client_get_contact_ids_for_co (DcRpcClientGetContactIdsForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, 0);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_add_string (_data_->_tmp5_, _data_->query);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_build (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_contact_ids", _data_->_tmp9_, dc_rpc_client_get_contact_ids_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp10_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp11_ = _data_->_tmp10_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp11_;
	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_->_result_ == NULL) {
		_data_->_tmp12_ = TRUE;
	} else {
		_data_->_tmp12_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_ARRAY;
	}
	if (_data_->_tmp12_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp13_ = json_node_get_array (_data_->_result_);
	_data_->_tmp14_ = _json_array_ref0 (_data_->_tmp13_);
	_data_->result = _data_->_tmp14_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_create_contact_data_free (gpointer _data)
{
	DcRpcClientCreateContactData* _data_;
	_data_ = _data;
	_g_free0 (_data_->email);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCreateContactData, _data_);
}

void
dc_rpc_client_create_contact (DcRpcClient* self,
                              const gchar* email,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientCreateContactData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (email != NULL);
	_data_ = g_slice_new0 (DcRpcClientCreateContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_create_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (email);
	_g_free0 (_data_->email);
	_data_->email = _tmp1_;
	dc_rpc_client_create_contact_co (_data_);
}

gint
dc_rpc_client_create_contact_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	gint result;
	DcRpcClientCreateContactData* _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
dc_rpc_client_create_contact_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientCreateContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_create_contact_co (_data_);
}

static gboolean
dc_rpc_client_create_contact_co (DcRpcClientCreateContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_string (_data_->_tmp4_, _data_->email);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, NULL);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "create_contact", _data_->_tmp10_, dc_rpc_client_create_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp12_;
	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_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_lookup_contact_data_free (gpointer _data)
{
	DcRpcClientLookupContactData* _data_;
	_data_ = _data;
	_g_free0 (_data_->email);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientLookupContactData, _data_);
}

void
dc_rpc_client_lookup_contact (DcRpcClient* self,
                              const gchar* email,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientLookupContactData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (email != NULL);
	_data_ = g_slice_new0 (DcRpcClientLookupContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_lookup_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (email);
	_g_free0 (_data_->email);
	_data_->email = _tmp1_;
	dc_rpc_client_lookup_contact_co (_data_);
}

gint
dc_rpc_client_lookup_contact_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	gint result;
	DcRpcClientLookupContactData* _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
dc_rpc_client_lookup_contact_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientLookupContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_lookup_contact_co (_data_);
}

static gboolean
dc_rpc_client_lookup_contact_co (DcRpcClientLookupContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_string (_data_->_tmp4_, _data_->email);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "lookup_contact_id_by_addr", _data_->_tmp8_, dc_rpc_client_lookup_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	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_->_result_ == NULL) {
		_data_->_tmp11_ = TRUE;
	} else {
		_data_->_tmp11_ = json_node_is_null (_data_->_result_);
	}
	if (_data_->_tmp11_) {
		_data_->result = 0;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_get_or_create_contact_data_free (gpointer _data)
{
	DcRpcClientGetOrCreateContactData* _data_;
	_data_ = _data;
	_g_free0 (_data_->email);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetOrCreateContactData, _data_);
}

void
dc_rpc_client_get_or_create_contact (DcRpcClient* self,
                                     const gchar* email,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientGetOrCreateContactData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (email != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetOrCreateContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_or_create_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (email);
	_g_free0 (_data_->email);
	_data_->email = _tmp1_;
	dc_rpc_client_get_or_create_contact_co (_data_);
}

gint
dc_rpc_client_get_or_create_contact_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	gint result;
	DcRpcClientGetOrCreateContactData* _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
dc_rpc_client_get_or_create_contact_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientGetOrCreateContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_or_create_contact_co (_data_);
}

static gboolean
dc_rpc_client_get_or_create_contact_co (DcRpcClientGetOrCreateContactData* _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_->_state_ = 1;
	dc_rpc_client_lookup_contact (_data_->self, _data_->email, dc_rpc_client_get_or_create_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->contact_id = dc_rpc_client_lookup_contact_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_->contact_id == 0) {
		_data_->_state_ = 2;
		dc_rpc_client_create_contact (_data_->self, _data_->email, dc_rpc_client_get_or_create_contact_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp0_ = dc_rpc_client_create_contact_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;
		}
		_data_->contact_id = _data_->_tmp0_;
	}
	_data_->result = _data_->contact_id;
	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
dc_rpc_client_get_or_create_chat_by_contact_data_free (gpointer _data)
{
	DcRpcClientGetOrCreateChatByContactData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetOrCreateChatByContactData, _data_);
}

void
dc_rpc_client_get_or_create_chat_by_contact (DcRpcClient* self,
                                             gint contact_id,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	DcRpcClientGetOrCreateChatByContactData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetOrCreateChatByContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_or_create_chat_by_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->contact_id = contact_id;
	dc_rpc_client_get_or_create_chat_by_contact_co (_data_);
}

gint
dc_rpc_client_get_or_create_chat_by_contact_finish (DcRpcClient* self,
                                                    GAsyncResult* _res_,
                                                    GError** error)
{
	gint result;
	DcRpcClientGetOrCreateChatByContactData* _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
dc_rpc_client_get_or_create_chat_by_contact_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	DcRpcClientGetOrCreateChatByContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_or_create_chat_by_contact_co (_data_);
}

static gboolean
dc_rpc_client_get_or_create_chat_by_contact_co (DcRpcClientGetOrCreateChatByContactData* _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_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->contact_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chat_id_by_contact_id", _data_->_tmp8_, dc_rpc_client_get_or_create_chat_by_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	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_->_tmp13_ = _data_->_result_;
	if (_data_->_tmp13_ != NULL) {
		_data_->_tmp14_ = _data_->_result_;
		_data_->_tmp12_ = !json_node_is_null (_data_->_tmp14_);
	} else {
		_data_->_tmp12_ = FALSE;
	}
	if (_data_->_tmp12_) {
		_data_->_tmp15_ = _data_->_result_;
		_data_->_tmp11_ = json_node_get_int (_data_->_tmp15_) > ((gint64) 0);
	} else {
		_data_->_tmp11_ = FALSE;
	}
	if (_data_->_tmp11_) {
		_data_->_tmp16_ = _data_->_result_;
		_data_->result = (gint) json_node_get_int (_data_->_tmp16_);
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp18_ = dc_params_begin ();
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = _data_->self->priv->_account_id;
	_data_->_tmp21_ = dc_params_add_int (_data_->_tmp19_, _data_->_tmp20_);
	_data_->_tmp22_ = _data_->_tmp21_;
	_data_->_tmp23_ = dc_params_add_int (_data_->_tmp22_, _data_->contact_id);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = dc_params_build (_data_->_tmp24_);
	_data_->_tmp26_ = _data_->_tmp25_;
	_data_->_state_ = 2;
	dc_rpc_client_call (_data_->self, "create_chat_by_contact_id", _data_->_tmp26_, dc_rpc_client_get_or_create_chat_by_contact_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp27_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp28_ = _data_->_tmp27_;
	__vala_JsonNode_free0 (_data_->_tmp26_);
	_g_object_unref0 (_data_->_tmp24_);
	_g_object_unref0 (_data_->_tmp22_);
	_g_object_unref0 (_data_->_tmp19_);
	_data_->_tmp17_ = _data_->_tmp28_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		__vala_JsonNode_free0 (_data_->_result_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp29_ = _data_->_tmp17_;
	_data_->_tmp17_ = NULL;
	__vala_JsonNode_free0 (_data_->_result_);
	_data_->_result_ = _data_->_tmp29_;
	_data_->_tmp30_ = _data_->_result_;
	_data_->result = (gint) json_node_get_int (_data_->_tmp30_);
	__vala_JsonNode_free0 (_data_->_tmp17_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_create_group_data_free (gpointer _data)
{
	DcRpcClientCreateGroupData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCreateGroupData, _data_);
}

void
dc_rpc_client_create_group (DcRpcClient* self,
                            const gchar* name,
                            gboolean protect,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	DcRpcClientCreateGroupData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_data_ = g_slice_new0 (DcRpcClientCreateGroupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_create_group_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	_data_->protect = protect;
	dc_rpc_client_create_group_co (_data_);
}

gint
dc_rpc_client_create_group_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	gint result;
	DcRpcClientCreateGroupData* _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
dc_rpc_client_create_group_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	DcRpcClientCreateGroupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_create_group_co (_data_);
}

static gboolean
dc_rpc_client_create_group_co (DcRpcClientCreateGroupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_string (_data_->_tmp4_, _data_->name);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_bool (_data_->_tmp6_, _data_->protect);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "create_group_chat", _data_->_tmp10_, dc_rpc_client_create_group_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp12_;
	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_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_create_broadcast_data_free (gpointer _data)
{
	DcRpcClientCreateBroadcastData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCreateBroadcastData, _data_);
}

void
dc_rpc_client_create_broadcast (DcRpcClient* self,
                                const gchar* name,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientCreateBroadcastData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_data_ = g_slice_new0 (DcRpcClientCreateBroadcastData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_create_broadcast_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	dc_rpc_client_create_broadcast_co (_data_);
}

gint
dc_rpc_client_create_broadcast_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	gint result;
	DcRpcClientCreateBroadcastData* _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
dc_rpc_client_create_broadcast_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientCreateBroadcastData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_create_broadcast_co (_data_);
}

static gboolean
dc_rpc_client_create_broadcast_co (DcRpcClientCreateBroadcastData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_string (_data_->_tmp4_, _data_->name);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "create_broadcast", _data_->_tmp8_, dc_rpc_client_create_broadcast_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	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_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_leave_group_data_free (gpointer _data)
{
	DcRpcClientLeaveGroupData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientLeaveGroupData, _data_);
}

void
dc_rpc_client_leave_group (DcRpcClient* self,
                           gint chat_id,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientLeaveGroupData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientLeaveGroupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_leave_group_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_leave_group_co (_data_);
}

void
dc_rpc_client_leave_group_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	DcRpcClientLeaveGroupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_leave_group_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientLeaveGroupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_leave_group_co (_data_);
}

static gboolean
dc_rpc_client_leave_group_co (DcRpcClientLeaveGroupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "leave_group", _data_->_tmp8_, dc_rpc_client_leave_group_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_delete_chat_data_free (gpointer _data)
{
	DcRpcClientDeleteChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDeleteChatData, _data_);
}

void
dc_rpc_client_delete_chat (DcRpcClient* self,
                           gint chat_id,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientDeleteChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientDeleteChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_delete_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_delete_chat_co (_data_);
}

void
dc_rpc_client_delete_chat_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	DcRpcClientDeleteChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_delete_chat_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientDeleteChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_delete_chat_co (_data_);
}

static gboolean
dc_rpc_client_delete_chat_co (DcRpcClientDeleteChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "delete_chat", _data_->_tmp8_, dc_rpc_client_delete_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_accept_chat_data_free (gpointer _data)
{
	DcRpcClientAcceptChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAcceptChatData, _data_);
}

void
dc_rpc_client_accept_chat (DcRpcClient* self,
                           gint chat_id,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientAcceptChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientAcceptChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_accept_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_accept_chat_co (_data_);
}

void
dc_rpc_client_accept_chat_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	DcRpcClientAcceptChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_accept_chat_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientAcceptChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_accept_chat_co (_data_);
}

static gboolean
dc_rpc_client_accept_chat_co (DcRpcClientAcceptChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "accept_chat", _data_->_tmp8_, dc_rpc_client_accept_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_block_chat_data_free (gpointer _data)
{
	DcRpcClientBlockChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientBlockChatData, _data_);
}

void
dc_rpc_client_block_chat (DcRpcClient* self,
                          gint chat_id,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_)
{
	DcRpcClientBlockChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientBlockChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_block_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_block_chat_co (_data_);
}

void
dc_rpc_client_block_chat_finish (DcRpcClient* self,
                                 GAsyncResult* _res_,
                                 GError** error)
{
	DcRpcClientBlockChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_block_chat_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_)
{
	DcRpcClientBlockChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_block_chat_co (_data_);
}

static gboolean
dc_rpc_client_block_chat_co (DcRpcClientBlockChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "block_chat", _data_->_tmp8_, dc_rpc_client_block_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_block_contact_data_free (gpointer _data)
{
	DcRpcClientBlockContactData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientBlockContactData, _data_);
}

void
dc_rpc_client_block_contact (DcRpcClient* self,
                             gint contact_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientBlockContactData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientBlockContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_block_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->contact_id = contact_id;
	dc_rpc_client_block_contact_co (_data_);
}

void
dc_rpc_client_block_contact_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	DcRpcClientBlockContactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_block_contact_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientBlockContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_block_contact_co (_data_);
}

static gboolean
dc_rpc_client_block_contact_co (DcRpcClientBlockContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->contact_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "block_contact", _data_->_tmp8_, dc_rpc_client_block_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_unblock_contact_data_free (gpointer _data)
{
	DcRpcClientUnblockContactData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientUnblockContactData, _data_);
}

void
dc_rpc_client_unblock_contact (DcRpcClient* self,
                               gint contact_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientUnblockContactData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientUnblockContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_unblock_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->contact_id = contact_id;
	dc_rpc_client_unblock_contact_co (_data_);
}

void
dc_rpc_client_unblock_contact_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	DcRpcClientUnblockContactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_unblock_contact_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientUnblockContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_unblock_contact_co (_data_);
}

static gboolean
dc_rpc_client_unblock_contact_co (DcRpcClientUnblockContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->contact_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "unblock_contact", _data_->_tmp8_, dc_rpc_client_unblock_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_change_contact_name_data_free (gpointer _data)
{
	DcRpcClientChangeContactNameData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientChangeContactNameData, _data_);
}

void
dc_rpc_client_change_contact_name (DcRpcClient* self,
                                   gint contact_id,
                                   const gchar* name,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientChangeContactNameData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_data_ = g_slice_new0 (DcRpcClientChangeContactNameData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_change_contact_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->contact_id = contact_id;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	dc_rpc_client_change_contact_name_co (_data_);
}

void
dc_rpc_client_change_contact_name_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	DcRpcClientChangeContactNameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_change_contact_name_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientChangeContactNameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_change_contact_name_co (_data_);
}

static gboolean
dc_rpc_client_change_contact_name_co (DcRpcClientChangeContactNameData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->contact_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->name);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "change_contact_name", _data_->_tmp10_, dc_rpc_client_change_contact_name_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_set_chat_mute_duration_data_free (gpointer _data)
{
	DcRpcClientSetChatMuteDurationData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetChatMuteDurationData, _data_);
}

void
dc_rpc_client_set_chat_mute_duration (DcRpcClient* self,
                                      gint chat_id,
                                      gint seconds,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	DcRpcClientSetChatMuteDurationData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetChatMuteDurationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_chat_mute_duration_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->seconds = seconds;
	dc_rpc_client_set_chat_mute_duration_co (_data_);
}

void
dc_rpc_client_set_chat_mute_duration_finish (DcRpcClient* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	DcRpcClientSetChatMuteDurationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_chat_mute_duration_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	DcRpcClientSetChatMuteDurationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_chat_mute_duration_co (_data_);
}

static gboolean
dc_rpc_client_set_chat_mute_duration_co (DcRpcClientSetChatMuteDurationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_begin_object (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->p = _data_->_tmp8_;
	if (_data_->seconds > 0) {
		_data_->_tmp9_ = _data_->p;
		_data_->_tmp10_ = dc_params_set_string_member (_data_->_tmp9_, "kind", "Until");
		_data_->_tmp11_ = _data_->_tmp10_;
		_g_object_unref0 (_data_->_tmp11_);
		_data_->_tmp12_ = _data_->p;
		_data_->_tmp13_ = dc_params_set_int_member (_data_->_tmp12_, "duration", _data_->seconds);
		_data_->_tmp14_ = _data_->_tmp13_;
		_g_object_unref0 (_data_->_tmp14_);
	} else {
		if (_data_->seconds < 0) {
			_data_->_tmp15_ = "Forever";
		} else {
			_data_->_tmp15_ = "NotMuted";
		}
		_data_->_tmp16_ = _data_->p;
		_data_->_tmp17_ = dc_params_set_string_member (_data_->_tmp16_, "kind", _data_->_tmp15_);
		_data_->_tmp18_ = _data_->_tmp17_;
		_g_object_unref0 (_data_->_tmp18_);
	}
	_data_->_tmp19_ = _data_->p;
	_data_->_tmp20_ = dc_params_end_object (_data_->_tmp19_);
	_data_->_tmp21_ = _data_->_tmp20_;
	_data_->_tmp22_ = dc_params_build (_data_->_tmp21_);
	_data_->_tmp23_ = _data_->_tmp22_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_chat_mute_duration", _data_->_tmp23_, dc_rpc_client_set_chat_mute_duration_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp24_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp25_ = _data_->_tmp24_;
	__vala_JsonNode_free0 (_data_->_tmp25_);
	__vala_JsonNode_free0 (_data_->_tmp23_);
	_g_object_unref0 (_data_->_tmp21_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->p);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->p);
	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
dc_rpc_client_set_chat_visibility_data_free (gpointer _data)
{
	DcRpcClientSetChatVisibilityData* _data_;
	_data_ = _data;
	_g_free0 (_data_->visibility);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetChatVisibilityData, _data_);
}

void
dc_rpc_client_set_chat_visibility (DcRpcClient* self,
                                   gint chat_id,
                                   const gchar* visibility,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientSetChatVisibilityData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (visibility != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetChatVisibilityData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_chat_visibility_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_tmp1_ = g_strdup (visibility);
	_g_free0 (_data_->visibility);
	_data_->visibility = _tmp1_;
	dc_rpc_client_set_chat_visibility_co (_data_);
}

void
dc_rpc_client_set_chat_visibility_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	DcRpcClientSetChatVisibilityData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_chat_visibility_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientSetChatVisibilityData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_chat_visibility_co (_data_);
}

static gboolean
dc_rpc_client_set_chat_visibility_co (DcRpcClientSetChatVisibilityData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->visibility);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_chat_visibility", _data_->_tmp10_, dc_rpc_client_set_chat_visibility_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_chat_media_data_free (gpointer _data)
{
	DcRpcClientGetChatMediaData* _data_;
	_data_ = _data;
	_data_->result = (g_free (_data_->result), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatMediaData, _data_);
}

void
dc_rpc_client_get_chat_media (DcRpcClient* self,
                              gint chat_id,
                              gchar** types,
                              gint types_length1,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientGetChatMediaData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatMediaData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chat_media_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->types = types;
	_data_->types_length1 = types_length1;
	dc_rpc_client_get_chat_media_co (_data_);
}

gint*
dc_rpc_client_get_chat_media_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     gint* result_length1,
                                     GError** error)
{
	gint* result;
	DcRpcClientGetChatMediaData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}

/**
         * Message ids of the given viewtypes (at most three) in a chat,
         * or in any chat of the account when chat_id <= 0. This is a
         * metadata-only database query in core — nothing is downloaded.
         * The result is sorted oldest first; callers wanting newest-first
         * must reverse it.
         */
static void
dc_rpc_client_get_chat_media_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientGetChatMediaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chat_media_co (_data_);
}

static gboolean
dc_rpc_client_get_chat_media_co (DcRpcClientGetChatMediaData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_g_object_unref0 (_data_->_tmp1_);
	_data_->p = _data_->_tmp4_;
	if (_data_->chat_id > 0) {
		_data_->_tmp5_ = _data_->p;
		_data_->_tmp6_ = dc_params_add_int (_data_->_tmp5_, _data_->chat_id);
		_data_->_tmp7_ = _data_->_tmp6_;
		_g_object_unref0 (_data_->_tmp7_);
	} else {
		_data_->_tmp8_ = _data_->p;
		_data_->_tmp9_ = dc_params_add_null (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_g_object_unref0 (_data_->_tmp10_);
	}
	{
		_data_->i = 0;
		{
			_data_->_tmp11_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp11_) {
					_data_->_tmp12_ = _data_->i;
					_data_->i = _data_->_tmp12_ + 1;
				}
				_data_->_tmp11_ = FALSE;
				if (!(_data_->i < 3)) {
					break;
				}
				if (_data_->i < _data_->types_length1) {
					_data_->_tmp14_ = _data_->types[_data_->i];
					_data_->_tmp13_ = _data_->_tmp14_;
				} else {
					_data_->_tmp13_ = NULL;
				}
				_data_->_tmp15_ = _data_->p;
				_data_->_tmp16_ = dc_params_add_string (_data_->_tmp15_, _data_->_tmp13_);
				_data_->_tmp17_ = _data_->_tmp16_;
				_g_object_unref0 (_data_->_tmp17_);
			}
		}
	}
	_data_->_tmp18_ = _data_->p;
	_data_->_tmp19_ = dc_params_build (_data_->_tmp18_);
	_data_->_tmp20_ = _data_->_tmp19_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chat_media", _data_->_tmp20_, dc_rpc_client_get_chat_media_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp21_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp22_ = _data_->_tmp21_;
	__vala_JsonNode_free0 (_data_->_tmp20_);
	_data_->_result_ = _data_->_tmp22_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->p);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp23_ = TRUE;
	} else {
		_data_->_tmp23_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_ARRAY;
	}
	if (_data_->_tmp23_) {
		_data_->_tmp24_ = g_new0 (gint, 0);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp25__length1 = 0;
		_data_->result_length1 = _data_->_tmp25__length1;
		_data_->result = _data_->_tmp25_;
		__vala_JsonNode_free0 (_data_->_result_);
		_g_object_unref0 (_data_->p);
		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_->_tmp26_ = json_node_get_array (_data_->_result_);
	_data_->_tmp27_ = _json_array_ref0 (_data_->_tmp26_);
	_data_->arr = _data_->_tmp27_;
	_data_->_tmp28_ = _data_->arr;
	_data_->_tmp29_ = g_new0 (gint, json_array_get_length (_data_->_tmp28_));
	_data_->ids = _data_->_tmp29_;
	_data_->ids_length1 = json_array_get_length (_data_->_tmp28_);
	_data_->_ids_size_ = _data_->ids_length1;
	{
		_data_->_vala1_i = (guint) 0;
		{
			_data_->_tmp30_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp30_) {
					_data_->_tmp31_ = _data_->_vala1_i;
					_data_->_vala1_i = _data_->_tmp31_ + 1;
				}
				_data_->_tmp30_ = FALSE;
				_data_->_tmp32_ = _data_->arr;
				if (!(_data_->_vala1_i < json_array_get_length (_data_->_tmp32_))) {
					break;
				}
				_data_->_tmp33_ = _data_->ids;
				_data_->_tmp33__length1 = _data_->ids_length1;
				_data_->_tmp34_ = _data_->arr;
				_data_->_tmp33_[_data_->_vala1_i] = (gint) json_array_get_int_element (_data_->_tmp34_, _data_->_vala1_i);
			}
		}
	}
	_data_->_tmp35_ = _data_->ids;
	_data_->_tmp35__length1 = _data_->ids_length1;
	_data_->result_length1 = _data_->_tmp35__length1;
	_data_->result = _data_->_tmp35_;
	_json_array_unref0 (_data_->arr);
	__vala_JsonNode_free0 (_data_->_result_);
	_g_object_unref0 (_data_->p);
	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
dc_rpc_client_delete_messages_data_free (gpointer _data)
{
	DcRpcClientDeleteMessagesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDeleteMessagesData, _data_);
}

void
dc_rpc_client_delete_messages (DcRpcClient* self,
                               gint* msg_ids,
                               gint msg_ids_length1,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientDeleteMessagesData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientDeleteMessagesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_delete_messages_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_delete_messages_co (_data_);
}

void
dc_rpc_client_delete_messages_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	DcRpcClientDeleteMessagesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_delete_messages_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientDeleteMessagesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_delete_messages_co (_data_);
}

static gboolean
dc_rpc_client_delete_messages_co (DcRpcClientDeleteMessagesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int_array (_data_->_tmp4_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "delete_messages", _data_->_tmp8_, dc_rpc_client_delete_messages_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_forward_messages_data_free (gpointer _data)
{
	DcRpcClientForwardMessagesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientForwardMessagesData, _data_);
}

void
dc_rpc_client_forward_messages (DcRpcClient* self,
                                gint* msg_ids,
                                gint msg_ids_length1,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientForwardMessagesData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientForwardMessagesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_forward_messages_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	_data_->chat_id = chat_id;
	dc_rpc_client_forward_messages_co (_data_);
}

void
dc_rpc_client_forward_messages_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	DcRpcClientForwardMessagesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_forward_messages_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientForwardMessagesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_forward_messages_co (_data_);
}

static gboolean
dc_rpc_client_forward_messages_co (DcRpcClientForwardMessagesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int_array (_data_->_tmp4_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_int (_data_->_tmp6_, _data_->chat_id);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "forward_messages", _data_->_tmp10_, dc_rpc_client_forward_messages_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_delete_messages_for_all_data_free (gpointer _data)
{
	DcRpcClientDeleteMessagesForAllData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDeleteMessagesForAllData, _data_);
}

void
dc_rpc_client_delete_messages_for_all (DcRpcClient* self,
                                       gint* msg_ids,
                                       gint msg_ids_length1,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DcRpcClientDeleteMessagesForAllData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientDeleteMessagesForAllData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_delete_messages_for_all_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_delete_messages_for_all_co (_data_);
}

void
dc_rpc_client_delete_messages_for_all_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	DcRpcClientDeleteMessagesForAllData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_delete_messages_for_all_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	DcRpcClientDeleteMessagesForAllData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_delete_messages_for_all_co (_data_);
}

static gboolean
dc_rpc_client_delete_messages_for_all_co (DcRpcClientDeleteMessagesForAllData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int_array (_data_->_tmp4_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "delete_messages_for_all", _data_->_tmp8_, dc_rpc_client_delete_messages_for_all_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_get_contact_for_data_free (gpointer _data)
{
	DcRpcClientGetContactForData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetContactForData, _data_);
}

void
dc_rpc_client_get_contact_for (DcRpcClient* self,
                               gint acct_id,
                               gint contact_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientGetContactForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetContactForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_contact_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->contact_id = contact_id;
	dc_rpc_client_get_contact_for_co (_data_);
}

JsonObject*
dc_rpc_client_get_contact_for_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	JsonObject* result;
	DcRpcClientGetContactForData* _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
dc_rpc_client_get_contact_for_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientGetContactForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_contact_for_co (_data_);
}

static gboolean
dc_rpc_client_get_contact_for_co (DcRpcClientGetContactForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->contact_id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_contact", _data_->_tmp7_, dc_rpc_client_get_contact_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _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;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp10_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_OBJECT;
	}
	if (_data_->_tmp10_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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_->_tmp11_ = json_node_get_object (_data_->_result_);
	_data_->_tmp12_ = _json_object_ref0 (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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
dc_rpc_client_add_contact_to_chat_data_free (gpointer _data)
{
	DcRpcClientAddContactToChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAddContactToChatData, _data_);
}

void
dc_rpc_client_add_contact_to_chat (DcRpcClient* self,
                                   gint chat_id,
                                   gint contact_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientAddContactToChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientAddContactToChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_add_contact_to_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->contact_id = contact_id;
	dc_rpc_client_add_contact_to_chat_co (_data_);
}

void
dc_rpc_client_add_contact_to_chat_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	DcRpcClientAddContactToChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_add_contact_to_chat_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientAddContactToChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_add_contact_to_chat_co (_data_);
}

static gboolean
dc_rpc_client_add_contact_to_chat_co (DcRpcClientAddContactToChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_int (_data_->_tmp6_, _data_->contact_id);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "add_contact_to_chat", _data_->_tmp10_, dc_rpc_client_add_contact_to_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_remove_contact_from_chat_data_free (gpointer _data)
{
	DcRpcClientRemoveContactFromChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientRemoveContactFromChatData, _data_);
}

void
dc_rpc_client_remove_contact_from_chat (DcRpcClient* self,
                                        gint chat_id,
                                        gint contact_id,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcRpcClientRemoveContactFromChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientRemoveContactFromChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_remove_contact_from_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->contact_id = contact_id;
	dc_rpc_client_remove_contact_from_chat_co (_data_);
}

void
dc_rpc_client_remove_contact_from_chat_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	DcRpcClientRemoveContactFromChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_remove_contact_from_chat_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcRpcClientRemoveContactFromChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_remove_contact_from_chat_co (_data_);
}

static gboolean
dc_rpc_client_remove_contact_from_chat_co (DcRpcClientRemoveContactFromChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_int (_data_->_tmp6_, _data_->contact_id);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "remove_contact_from_chat", _data_->_tmp10_, dc_rpc_client_remove_contact_from_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_set_chat_profile_image_data_free (gpointer _data)
{
	DcRpcClientSetChatProfileImageData* _data_;
	_data_ = _data;
	_g_free0 (_data_->image_path);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetChatProfileImageData, _data_);
}

void
dc_rpc_client_set_chat_profile_image (DcRpcClient* self,
                                      gint chat_id,
                                      const gchar* image_path,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	DcRpcClientSetChatProfileImageData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (image_path != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetChatProfileImageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_chat_profile_image_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_tmp1_ = g_strdup (image_path);
	_g_free0 (_data_->image_path);
	_data_->image_path = _tmp1_;
	dc_rpc_client_set_chat_profile_image_co (_data_);
}

void
dc_rpc_client_set_chat_profile_image_finish (DcRpcClient* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	DcRpcClientSetChatProfileImageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_chat_profile_image_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	DcRpcClientSetChatProfileImageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_chat_profile_image_co (_data_);
}

static gboolean
dc_rpc_client_set_chat_profile_image_co (DcRpcClientSetChatProfileImageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->image_path);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_chat_profile_image", _data_->_tmp10_, dc_rpc_client_set_chat_profile_image_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_set_chat_name_data_free (gpointer _data)
{
	DcRpcClientSetChatNameData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetChatNameData, _data_);
}

void
dc_rpc_client_set_chat_name (DcRpcClient* self,
                             gint chat_id,
                             const gchar* name,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientSetChatNameData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetChatNameData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_chat_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	dc_rpc_client_set_chat_name_co (_data_);
}

void
dc_rpc_client_set_chat_name_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	DcRpcClientSetChatNameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_chat_name_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientSetChatNameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_chat_name_co (_data_);
}

static gboolean
dc_rpc_client_set_chat_name_co (DcRpcClientSetChatNameData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->name);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_chat_name", _data_->_tmp10_, dc_rpc_client_set_chat_name_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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
dc_rpc_client_set_chat_ephemeral_timer_data_free (gpointer _data)
{
	DcRpcClientSetChatEphemeralTimerData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetChatEphemeralTimerData, _data_);
}

void
dc_rpc_client_set_chat_ephemeral_timer (DcRpcClient* self,
                                        gint chat_id,
                                        gint timer,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcRpcClientSetChatEphemeralTimerData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetChatEphemeralTimerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_chat_ephemeral_timer_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->timer = timer;
	dc_rpc_client_set_chat_ephemeral_timer_co (_data_);
}

void
dc_rpc_client_set_chat_ephemeral_timer_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	DcRpcClientSetChatEphemeralTimerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_chat_ephemeral_timer_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcRpcClientSetChatEphemeralTimerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_chat_ephemeral_timer_co (_data_);
}

static gboolean
dc_rpc_client_set_chat_ephemeral_timer_co (DcRpcClientSetChatEphemeralTimerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_int (_data_->_tmp6_, _data_->timer);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_chat_ephemeral_timer", _data_->_tmp10_, dc_rpc_client_set_chat_ephemeral_timer_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	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;
}

DcRpcClient*
dc_rpc_client_construct (GType object_type)
{
	DcRpcClient * self = NULL;
	self = (DcRpcClient*) g_object_new (object_type, NULL);
	return self;
}

DcRpcClient*
dc_rpc_client_new (void)
{
	return dc_rpc_client_construct (DC_TYPE_RPC_CLIENT);
}

gboolean
dc_rpc_client_get_is_connected (DcRpcClient* self)
{
	gboolean result;
	DcRpcTransport* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->transport;
	_tmp1_ = dc_rpc_transport_get_is_connected (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

gint
dc_rpc_client_get_account_id (DcRpcClient* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_account_id;
	return result;
}

void
dc_rpc_client_set_account_id (DcRpcClient* self,
                              gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_rpc_client_get_account_id (self);
	if (old_value != value) {
		self->priv->_account_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_rpc_client_properties[DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY]);
	}
}

const gchar*
dc_rpc_client_get_self_email (DcRpcClient* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_self_email;
	result = _tmp0_;
	return result;
}

void
dc_rpc_client_set_self_email (DcRpcClient* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_rpc_client_get_self_email (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_self_email);
		self->priv->_self_email = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_rpc_client_properties[DC_RPC_CLIENT_SELF_EMAIL_PROPERTY]);
	}
}

static void
_dc_rpc_client___lambda6_ (DcRpcClient* self,
                           const gchar* reason)
{
	g_return_if_fail (reason != NULL);
	g_signal_emit (self, dc_rpc_client_signals[DC_RPC_CLIENT_DISCONNECTED_SIGNAL], 0, reason);
}

static void
__dc_rpc_client___lambda6__dc_rpc_transport_disconnected (DcRpcTransport* _sender,
                                                          const gchar* reason,
                                                          gpointer self)
{
	_dc_rpc_client___lambda6_ ((DcRpcClient*) self, reason);
}

static GObject *
dc_rpc_client_constructor (GType type,
                           guint n_construct_properties,
                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DcRpcClient * self;
	DcRpcTransport* _tmp0_;
	DcRpcTransport* _tmp1_;
	parent_class = G_OBJECT_CLASS (dc_rpc_client_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_RPC_CLIENT, DcRpcClient);
	_tmp0_ = dc_rpc_transport_new ();
	_g_object_unref0 (self->priv->transport);
	self->priv->transport = _tmp0_;
	_tmp1_ = self->priv->transport;
	g_signal_connect_object (_tmp1_, "disconnected", (GCallback) __dc_rpc_client___lambda6__dc_rpc_transport_disconnected, self, 0);
	return obj;
}

static void
dc_rpc_client_class_init (DcRpcClientClass * klass,
                          gpointer klass_data)
{
	dc_rpc_client_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcRpcClient_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_rpc_client_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_rpc_client_set_property;
	G_OBJECT_CLASS (klass)->constructor = dc_rpc_client_constructor;
	G_OBJECT_CLASS (klass)->finalize = dc_rpc_client_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_RPC_CLIENT_IS_CONNECTED_PROPERTY, dc_rpc_client_properties[DC_RPC_CLIENT_IS_CONNECTED_PROPERTY] = g_param_spec_boolean ("is-connected", "is-connected", "is-connected", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY, dc_rpc_client_properties[DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY] = g_param_spec_int ("account-id", "account-id", "account-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_RPC_CLIENT_SELF_EMAIL_PROPERTY, dc_rpc_client_properties[DC_RPC_CLIENT_SELF_EMAIL_PROPERTY] = g_param_spec_string ("self-email", "self-email", "self-email", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	dc_rpc_client_signals[DC_RPC_CLIENT_DISCONNECTED_SIGNAL] = g_signal_new ("disconnected", DC_TYPE_RPC_CLIENT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
dc_rpc_client_instance_init (DcRpcClient * self,
                             gpointer klass)
{
	self->priv = dc_rpc_client_get_instance_private (self);
	self->priv->_account_id = 0;
	self->priv->_self_email = NULL;
}

static void
dc_rpc_client_finalize (GObject * obj)
{
	DcRpcClient * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_RPC_CLIENT, DcRpcClient);
	_g_object_unref0 (self->priv->transport);
	_g_free0 (self->priv->_self_email);
	G_OBJECT_CLASS (dc_rpc_client_parent_class)->finalize (obj);
}

/**
     * Typed Delta Chat RPC API facade.
     * Transport/process concerns live in RpcTransport.
     */
static GType
dc_rpc_client_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcRpcClientClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_rpc_client_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcRpcClient), 0, (GInstanceInitFunc) dc_rpc_client_instance_init, NULL };
	GType dc_rpc_client_type_id;
	dc_rpc_client_type_id = g_type_register_static (G_TYPE_OBJECT, "DcRpcClient", &g_define_type_info, 0);
	DcRpcClient_private_offset = g_type_add_instance_private (dc_rpc_client_type_id, sizeof (DcRpcClientPrivate));
	return dc_rpc_client_type_id;
}

GType
dc_rpc_client_get_type (void)
{
	static volatile gsize dc_rpc_client_type_id__once = 0;
	if (g_once_init_enter (&dc_rpc_client_type_id__once)) {
		GType dc_rpc_client_type_id;
		dc_rpc_client_type_id = dc_rpc_client_get_type_once ();
		g_once_init_leave (&dc_rpc_client_type_id__once, dc_rpc_client_type_id);
	}
	return dc_rpc_client_type_id__once;
}

static void
_vala_dc_rpc_client_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec)
{
	DcRpcClient * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_RPC_CLIENT, DcRpcClient);
	switch (property_id) {
		case DC_RPC_CLIENT_IS_CONNECTED_PROPERTY:
		g_value_set_boolean (value, dc_rpc_client_get_is_connected (self));
		break;
		case DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY:
		g_value_set_int (value, dc_rpc_client_get_account_id (self));
		break;
		case DC_RPC_CLIENT_SELF_EMAIL_PROPERTY:
		g_value_set_string (value, dc_rpc_client_get_self_email (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_rpc_client_set_property (GObject * object,
                                  guint property_id,
                                  const GValue * value,
                                  GParamSpec * pspec)
{
	DcRpcClient * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_RPC_CLIENT, DcRpcClient);
	switch (property_id) {
		case DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY:
		dc_rpc_client_set_account_id (self, g_value_get_int (value));
		break;
		case DC_RPC_CLIENT_SELF_EMAIL_PROPERTY:
		dc_rpc_client_set_self_email (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

