/* pastebin-plugin.c generated by valac 0.56.17, the Vala compiler
 * generated from pastebin-plugin.vala, do not modify */

/*
 * Copyright (C) 2010 Michal Hruby <michal.mhr@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 *
 * Authored by Michal Hruby <michal.mhr@gmail.com>
 *
 */

#include "plugins.h"
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include <synapse-core.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gio/gunixinputstream.h>
#include <gio/gunixoutputstream.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <libnotify/notify.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION (synapse_pastebin_plugin_pastebin_action_get_type ())
#define SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION, SynapsePastebinPluginPastebinAction))
#define SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION, SynapsePastebinPluginPastebinActionClass))
#define SYNAPSE_PASTEBIN_PLUGIN_IS_PASTEBIN_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION))
#define SYNAPSE_PASTEBIN_PLUGIN_IS_PASTEBIN_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION))
#define SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION, SynapsePastebinPluginPastebinActionClass))

typedef struct _SynapsePastebinPluginPastebinAction SynapsePastebinPluginPastebinAction;
typedef struct _SynapsePastebinPluginPastebinActionClass SynapsePastebinPluginPastebinActionClass;
enum  {
	SYNAPSE_PASTEBIN_PLUGIN_0_PROPERTY,
	SYNAPSE_PASTEBIN_PLUGIN_ENABLED_PROPERTY,
	SYNAPSE_PASTEBIN_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* synapse_pastebin_plugin_properties[SYNAPSE_PASTEBIN_PLUGIN_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _SynapsePastebinPluginPastebinActionPrivate SynapsePastebinPluginPastebinActionPrivate;
enum  {
	SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_ACTION_0_PROPERTY,
	SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_ACTION_NUM_PROPERTIES
};
static GParamSpec* synapse_pastebin_plugin_pastebin_action_properties[SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_ACTION_NUM_PROPERTIES];
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _SynapsePastebinPluginPastebinActionPastebinFileData SynapsePastebinPluginPastebinActionPastebinFileData;
typedef struct _SynapsePastebinPluginPastebinActionPastebinTextData SynapsePastebinPluginPastebinActionPastebinTextData;
typedef struct _Block5Data Block5Data;

#define SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_TO_CONTACT_ACTION (synapse_pastebin_plugin_pastebin_to_contact_action_get_type ())
#define SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_TO_CONTACT_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_TO_CONTACT_ACTION, SynapsePastebinPluginPastebinToContactAction))
#define SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_TO_CONTACT_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_TO_CONTACT_ACTION, SynapsePastebinPluginPastebinToContactActionClass))
#define SYNAPSE_PASTEBIN_PLUGIN_IS_PASTEBIN_TO_CONTACT_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_TO_CONTACT_ACTION))
#define SYNAPSE_PASTEBIN_PLUGIN_IS_PASTEBIN_TO_CONTACT_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_TO_CONTACT_ACTION))
#define SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_TO_CONTACT_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_TO_CONTACT_ACTION, SynapsePastebinPluginPastebinToContactActionClass))

typedef struct _SynapsePastebinPluginPastebinToContactAction SynapsePastebinPluginPastebinToContactAction;
typedef struct _SynapsePastebinPluginPastebinToContactActionClass SynapsePastebinPluginPastebinToContactActionClass;
typedef struct _SynapsePastebinPluginPastebinToContactActionPrivate SynapsePastebinPluginPastebinToContactActionPrivate;
enum  {
	SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_TO_CONTACT_ACTION_0_PROPERTY,
	SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_TO_CONTACT_ACTION_NUM_PROPERTIES
};
static GParamSpec* synapse_pastebin_plugin_pastebin_to_contact_action_properties[SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_TO_CONTACT_ACTION_NUM_PROPERTIES];

struct _SynapsePastebinPluginPrivate {
	gboolean _enabled;
	GeeList* actions;
};

struct _SynapsePastebinPluginPastebinAction {
	SynapseAction parent_instance;
	SynapsePastebinPluginPastebinActionPrivate * priv;
};

struct _SynapsePastebinPluginPastebinActionClass {
	SynapseActionClass parent_class;
	void (*process_pastebin_result) (SynapsePastebinPluginPastebinAction* self, const gchar* url, SynapseMatch* target);
};

struct _SynapsePastebinPluginPastebinActionPastebinFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SynapsePastebinPluginPastebinAction* self;
	gchar* path;
	gchar* result;
	gchar** argv;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gint argv_length1;
	gint _argv_size_;
	GPid pid;
	gint read_fd;
	gchar** _tmp4_;
	gint _tmp4__length1;
	GPid _tmp5_;
	gint _tmp6_;
	GUnixInputStream* read_stream;
	GUnixInputStream* _tmp7_;
	GDataInputStream* pastebinit_output;
	GUnixInputStream* _tmp8_;
	GDataInputStream* _tmp9_;
	gchar* line;
	gchar* complete_output;
	gchar* _tmp10_;
	gboolean _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	GDataInputStream* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	GRegex* url;
	GRegex* _tmp21_;
	GRegex* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	GError* _tmp25_;
	GError* err;
	GError* _tmp26_;
	const gchar* _tmp27_;
	GError* _inner_error0_;
};

struct _SynapsePastebinPluginPastebinActionPastebinTextData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SynapsePastebinPluginPastebinAction* self;
	gchar* content;
	gchar* result;
	gchar** argv;
	gchar* _tmp0_;
	gchar** _tmp1_;
	gint argv_length1;
	gint _argv_size_;
	GPid pid;
	gint read_fd;
	gint write_fd;
	gchar** _tmp2_;
	gint _tmp2__length1;
	GPid _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GUnixInputStream* read_stream;
	GUnixInputStream* _tmp6_;
	GDataInputStream* pastebinit_output;
	GUnixInputStream* _tmp7_;
	GDataInputStream* _tmp8_;
	GUnixOutputStream* write_stream;
	GUnixOutputStream* _tmp9_;
	GUnixOutputStream* _tmp10_;
	guint8* _tmp11_;
	gint _tmp11__length1;
	gint _tmp12_;
	guint8* _tmp13_;
	gint _tmp13__length1;
	GUnixOutputStream* _tmp14_;
	gchar* line;
	gchar* complete_output;
	gchar* _tmp15_;
	gboolean _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	GDataInputStream* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	gchar* _tmp25_;
	GRegex* url;
	GRegex* _tmp26_;
	GRegex* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	GError* _tmp30_;
	GError* err;
	GError* _tmp31_;
	const gchar* _tmp32_;
	GError* _inner_error0_;
};

struct _Block5Data {
	int _ref_count_;
	SynapsePastebinPluginPastebinAction* self;
	SynapseMatch* target;
};

struct _SynapsePastebinPluginPastebinToContactAction {
	SynapsePastebinPluginPastebinAction parent_instance;
	SynapsePastebinPluginPastebinToContactActionPrivate * priv;
};

struct _SynapsePastebinPluginPastebinToContactActionClass {
	SynapsePastebinPluginPastebinActionClass parent_class;
};

static gint SynapsePastebinPlugin_private_offset;
static gpointer synapse_pastebin_plugin_parent_class = NULL;
static gpointer synapse_pastebin_plugin_pastebin_action_parent_class = NULL;
static gpointer synapse_pastebin_plugin_pastebin_to_contact_action_parent_class = NULL;
static SynapseActivatableIface * synapse_pastebin_plugin_synapse_activatable_parent_iface = NULL;
static SynapseActionProviderIface * synapse_pastebin_plugin_synapse_action_provider_parent_iface = NULL;

static GType synapse_pastebin_plugin_pastebin_action_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void synapse_pastebin_plugin_real_activate (SynapseActivatable* base);
static void synapse_pastebin_plugin_real_deactivate (SynapseActivatable* base);
static void synapse_pastebin_plugin_register_plugin (void);
static void _synapse_pastebin_plugin_register_plugin_synapse_plugin_register_func (void);
static SynapseResultSet* synapse_pastebin_plugin_real_find_for_match (SynapseActionProvider* base,
                                                               SynapseQuery* q,
                                                               SynapseMatch* match);
static void synapse_pastebin_plugin_pastebin_action_process_pastebin_result (SynapsePastebinPluginPastebinAction* self,
                                                                      const gchar* url,
                                                                      SynapseMatch* target);
static SynapsePastebinPluginPastebinAction* synapse_pastebin_plugin_pastebin_action_new (void);
static SynapsePastebinPluginPastebinAction* synapse_pastebin_plugin_pastebin_action_construct (GType object_type);
static void synapse_pastebin_plugin_pastebin_action_pastebin_file_data_free (gpointer _data);
static void synapse_pastebin_plugin_pastebin_action_pastebin_file (SynapsePastebinPluginPastebinAction* self,
                                                            const gchar* path,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static gchar* synapse_pastebin_plugin_pastebin_action_pastebin_file_finish (SynapsePastebinPluginPastebinAction* self,
                                                                     GAsyncResult* _res_);
static gboolean synapse_pastebin_plugin_pastebin_action_pastebin_file_co (SynapsePastebinPluginPastebinActionPastebinFileData* _data_);
static void synapse_pastebin_plugin_pastebin_action_pastebin_file_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_);
static void synapse_pastebin_plugin_pastebin_action_pastebin_text_data_free (gpointer _data);
static void synapse_pastebin_plugin_pastebin_action_pastebin_text (SynapsePastebinPluginPastebinAction* self,
                                                            const gchar* content,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static gchar* synapse_pastebin_plugin_pastebin_action_pastebin_text_finish (SynapsePastebinPluginPastebinAction* self,
                                                                     GAsyncResult* _res_);
static gboolean synapse_pastebin_plugin_pastebin_action_pastebin_text_co (SynapsePastebinPluginPastebinActionPastebinTextData* _data_);
static void synapse_pastebin_plugin_pastebin_action_pastebin_text_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_);
static void synapse_pastebin_plugin_pastebin_action_real_process_pastebin_result (SynapsePastebinPluginPastebinAction* self,
                                                                           const gchar* url,
                                                                           SynapseMatch* target);
static void synapse_pastebin_plugin_pastebin_action_real_do_execute (SynapseAction* base,
                                                              SynapseMatch* match,
                                                              SynapseMatch* target);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void ___lambda16_ (Block5Data* _data5_,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda16__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void ____lambda17_ (Block5Data* _data5_,
                    GObject* obj,
                    GAsyncResult* res);
static void _____lambda17__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static gboolean synapse_pastebin_plugin_pastebin_action_real_valid_for_match (SynapseAction* base,
                                                                       SynapseMatch* match);
static GType synapse_pastebin_plugin_pastebin_action_get_type_once (void);
static GType synapse_pastebin_plugin_pastebin_to_contact_action_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SynapsePastebinPluginPastebinToContactAction* synapse_pastebin_plugin_pastebin_to_contact_action_new (void);
static SynapsePastebinPluginPastebinToContactAction* synapse_pastebin_plugin_pastebin_to_contact_action_construct (GType object_type);
static void synapse_pastebin_plugin_pastebin_to_contact_action_real_process_pastebin_result (SynapsePastebinPluginPastebinAction* base,
                                                                                      const gchar* url,
                                                                                      SynapseMatch* target);
static gboolean synapse_pastebin_plugin_pastebin_to_contact_action_real_needs_target (SynapseMatch* base);
static SynapseQueryFlags synapse_pastebin_plugin_pastebin_to_contact_action_real_target_flags (SynapseMatch* base);
static GType synapse_pastebin_plugin_pastebin_to_contact_action_get_type_once (void);
static GObject * synapse_pastebin_plugin_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void synapse_pastebin_plugin_finalize (GObject * obj);
static GType synapse_pastebin_plugin_get_type_once (void);
static void _vala_synapse_pastebin_plugin_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_synapse_pastebin_plugin_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
synapse_pastebin_plugin_get_instance_private (SynapsePastebinPlugin* self)
{
	return G_STRUCT_MEMBER_P (self, SynapsePastebinPlugin_private_offset);
}

static void
synapse_pastebin_plugin_real_activate (SynapseActivatable* base)
{
	SynapsePastebinPlugin * self;
#line 28 "pastebin-plugin.vala"
	self = (SynapsePastebinPlugin*) base;
#line 342 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_real_deactivate (SynapseActivatable* base)
{
	SynapsePastebinPlugin * self;
#line 33 "pastebin-plugin.vala"
	self = (SynapsePastebinPlugin*) base;
#line 351 "pastebin-plugin.c"
}

static void
_synapse_pastebin_plugin_register_plugin_synapse_plugin_register_func (void)
{
#line 259 "pastebin-plugin.vala"
	synapse_pastebin_plugin_register_plugin ();
#line 359 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_register_plugin (void)
{
	SynapsePluginRegistry* _tmp0_;
	SynapsePluginRegistry* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 259 "pastebin-plugin.vala"
	_tmp0_ = synapse_plugin_registry_get_default ();
#line 259 "pastebin-plugin.vala"
	_tmp1_ = _tmp0_;
#line 259 "pastebin-plugin.vala"
	_tmp2_ = g_find_program_in_path ("pastebinit");
#line 259 "pastebin-plugin.vala"
	_tmp3_ = _tmp2_;
#line 259 "pastebin-plugin.vala"
	synapse_plugin_registry_register_plugin (_tmp1_, SYNAPSE_TYPE_PASTEBIN_PLUGIN, _ ("Pastebin"), _ ("Upload files to pastebin."), "document-send", _synapse_pastebin_plugin_register_plugin_synapse_plugin_register_func, _tmp3_ != NULL, _ ("Unable to find \"pastebinit\" program"));
#line 259 "pastebin-plugin.vala"
	_g_free0 (_tmp3_);
#line 259 "pastebin-plugin.vala"
	_g_object_unref0 (_tmp1_);
#line 383 "pastebin-plugin.c"
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
#line 1413 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1414 "glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1414 "glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1415 "glib-2.0.vapi"
	g_strstrip (_result_);
#line 1416 "glib-2.0.vapi"
	result = _result_;
#line 1416 "glib-2.0.vapi"
	return result;
#line 404 "pastebin-plugin.c"
}

static SynapseResultSet*
synapse_pastebin_plugin_real_find_for_match (SynapseActionProvider* base,
                                             SynapseQuery* q,
                                             SynapseMatch* match)
{
	SynapsePastebinPlugin * self;
	GeeList* _tmp0_;
	gpointer _tmp1_;
	SynapsePastebinPluginPastebinAction* _tmp2_;
	gboolean _tmp3_;
	SynapseQuery _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gboolean query_empty = FALSE;
	SynapseQuery _tmp7_;
	const gchar* _tmp8_;
	SynapseResultSet* results = NULL;
	SynapseResultSet* _tmp9_;
	SynapseResultSet* result;
#line 284 "pastebin-plugin.vala"
	self = (SynapsePastebinPlugin*) base;
#line 284 "pastebin-plugin.vala"
	g_return_val_if_fail (q != NULL, NULL);
#line 284 "pastebin-plugin.vala"
	g_return_val_if_fail (match != NULL, NULL);
#line 286 "pastebin-plugin.vala"
	_tmp0_ = self->priv->actions;
#line 286 "pastebin-plugin.vala"
	_tmp1_ = gee_list_get (_tmp0_, 0);
#line 286 "pastebin-plugin.vala"
	_tmp2_ = (SynapsePastebinPluginPastebinAction*) _tmp1_;
#line 286 "pastebin-plugin.vala"
	_tmp3_ = !synapse_action_valid_for_match ((SynapseAction*) _tmp2_, match);
#line 286 "pastebin-plugin.vala"
	_g_object_unref0 (_tmp2_);
#line 286 "pastebin-plugin.vala"
	if (_tmp3_) {
#line 286 "pastebin-plugin.vala"
		result = NULL;
#line 286 "pastebin-plugin.vala"
		return result;
#line 448 "pastebin-plugin.c"
	}
#line 289 "pastebin-plugin.vala"
	_tmp4_ = *q;
#line 289 "pastebin-plugin.vala"
	_tmp5_ = _tmp4_.query_string;
#line 289 "pastebin-plugin.vala"
	_tmp6_ = string_strip (_tmp5_);
#line 289 "pastebin-plugin.vala"
	_g_free0 ((*q).query_string);
#line 289 "pastebin-plugin.vala"
	(*q).query_string = _tmp6_;
#line 290 "pastebin-plugin.vala"
	_tmp7_ = *q;
#line 290 "pastebin-plugin.vala"
	_tmp8_ = _tmp7_.query_string;
#line 290 "pastebin-plugin.vala"
	query_empty = g_strcmp0 (_tmp8_, "") == 0;
#line 292 "pastebin-plugin.vala"
	_tmp9_ = synapse_result_set_new ();
#line 292 "pastebin-plugin.vala"
	results = _tmp9_;
#line 294 "pastebin-plugin.vala"
	if (query_empty) {
#line 472 "pastebin-plugin.c"
		gint rel = 0;
		GeeList* _tmp10_;
		gpointer _tmp11_;
		SynapsePastebinPluginPastebinAction* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
#line 296 "pastebin-plugin.vala"
		_tmp10_ = self->priv->actions;
#line 296 "pastebin-plugin.vala"
		_tmp11_ = gee_list_get (_tmp10_, 0);
#line 296 "pastebin-plugin.vala"
		_tmp12_ = (SynapsePastebinPluginPastebinAction*) _tmp11_;
#line 296 "pastebin-plugin.vala"
		_tmp13_ = synapse_action_get_default_relevancy ((SynapseAction*) _tmp12_);
#line 296 "pastebin-plugin.vala"
		_tmp14_ = _tmp13_;
#line 296 "pastebin-plugin.vala"
		_tmp15_ = _tmp14_;
#line 296 "pastebin-plugin.vala"
		_g_object_unref0 (_tmp12_);
#line 296 "pastebin-plugin.vala"
		rel = _tmp15_;
#line 496 "pastebin-plugin.c"
		{
			GeeList* _action_list = NULL;
			GeeList* _tmp16_;
			gint _action_size = 0;
			GeeList* _tmp17_;
			gint _tmp18_;
			gint _tmp19_;
			gint _action_index = 0;
#line 297 "pastebin-plugin.vala"
			_tmp16_ = self->priv->actions;
#line 297 "pastebin-plugin.vala"
			_action_list = _tmp16_;
#line 297 "pastebin-plugin.vala"
			_tmp17_ = _action_list;
#line 297 "pastebin-plugin.vala"
			_tmp18_ = gee_collection_get_size ((GeeCollection*) _tmp17_);
#line 297 "pastebin-plugin.vala"
			_tmp19_ = _tmp18_;
#line 297 "pastebin-plugin.vala"
			_action_size = _tmp19_;
#line 297 "pastebin-plugin.vala"
			_action_index = -1;
#line 297 "pastebin-plugin.vala"
			while (TRUE) {
#line 521 "pastebin-plugin.c"
				gint _tmp20_;
				gint _tmp21_;
				SynapsePastebinPluginPastebinAction* action = NULL;
				GeeList* _tmp22_;
				gpointer _tmp23_;
				SynapseResultSet* _tmp24_;
				SynapsePastebinPluginPastebinAction* _tmp25_;
#line 297 "pastebin-plugin.vala"
				_action_index = _action_index + 1;
#line 297 "pastebin-plugin.vala"
				_tmp20_ = _action_index;
#line 297 "pastebin-plugin.vala"
				_tmp21_ = _action_size;
#line 297 "pastebin-plugin.vala"
				if (!(_tmp20_ < _tmp21_)) {
#line 297 "pastebin-plugin.vala"
					break;
#line 539 "pastebin-plugin.c"
				}
#line 297 "pastebin-plugin.vala"
				_tmp22_ = _action_list;
#line 297 "pastebin-plugin.vala"
				_tmp23_ = gee_list_get (_tmp22_, _action_index);
#line 297 "pastebin-plugin.vala"
				action = (SynapsePastebinPluginPastebinAction*) _tmp23_;
#line 298 "pastebin-plugin.vala"
				_tmp24_ = results;
#line 298 "pastebin-plugin.vala"
				_tmp25_ = action;
#line 298 "pastebin-plugin.vala"
				synapse_result_set_add (_tmp24_, (SynapseMatch*) _tmp25_, rel);
#line 297 "pastebin-plugin.vala"
				_g_object_unref0 (action);
#line 555 "pastebin-plugin.c"
			}
		}
	} else {
		GeeList* matchers = NULL;
		SynapseQuery _tmp26_;
		const gchar* _tmp27_;
		GeeList* _tmp28_;
#line 302 "pastebin-plugin.vala"
		_tmp26_ = *q;
#line 302 "pastebin-plugin.vala"
		_tmp27_ = _tmp26_.query_string;
#line 302 "pastebin-plugin.vala"
		_tmp28_ = synapse_query_get_matchers_for_query (_tmp27_, 0, G_REGEX_CASELESS);
#line 302 "pastebin-plugin.vala"
		matchers = _tmp28_;
#line 571 "pastebin-plugin.c"
		{
			GeeList* _action_list = NULL;
			GeeList* _tmp29_;
			gint _action_size = 0;
			GeeList* _tmp30_;
			gint _tmp31_;
			gint _tmp32_;
			gint _action_index = 0;
#line 304 "pastebin-plugin.vala"
			_tmp29_ = self->priv->actions;
#line 304 "pastebin-plugin.vala"
			_action_list = _tmp29_;
#line 304 "pastebin-plugin.vala"
			_tmp30_ = _action_list;
#line 304 "pastebin-plugin.vala"
			_tmp31_ = gee_collection_get_size ((GeeCollection*) _tmp30_);
#line 304 "pastebin-plugin.vala"
			_tmp32_ = _tmp31_;
#line 304 "pastebin-plugin.vala"
			_action_size = _tmp32_;
#line 304 "pastebin-plugin.vala"
			_action_index = -1;
#line 304 "pastebin-plugin.vala"
			while (TRUE) {
#line 596 "pastebin-plugin.c"
				gint _tmp33_;
				gint _tmp34_;
				SynapsePastebinPluginPastebinAction* action = NULL;
				GeeList* _tmp35_;
				gpointer _tmp36_;
#line 304 "pastebin-plugin.vala"
				_action_index = _action_index + 1;
#line 304 "pastebin-plugin.vala"
				_tmp33_ = _action_index;
#line 304 "pastebin-plugin.vala"
				_tmp34_ = _action_size;
#line 304 "pastebin-plugin.vala"
				if (!(_tmp33_ < _tmp34_)) {
#line 304 "pastebin-plugin.vala"
					break;
#line 612 "pastebin-plugin.c"
				}
#line 304 "pastebin-plugin.vala"
				_tmp35_ = _action_list;
#line 304 "pastebin-plugin.vala"
				_tmp36_ = gee_list_get (_tmp35_, _action_index);
#line 304 "pastebin-plugin.vala"
				action = (SynapsePastebinPluginPastebinAction*) _tmp36_;
#line 620 "pastebin-plugin.c"
				{
					GeeList* _matcher_list = NULL;
					GeeList* _tmp37_;
					gint _matcher_size = 0;
					GeeList* _tmp38_;
					gint _tmp39_;
					gint _tmp40_;
					gint _matcher_index = 0;
#line 306 "pastebin-plugin.vala"
					_tmp37_ = matchers;
#line 306 "pastebin-plugin.vala"
					_matcher_list = _tmp37_;
#line 306 "pastebin-plugin.vala"
					_tmp38_ = _matcher_list;
#line 306 "pastebin-plugin.vala"
					_tmp39_ = gee_collection_get_size ((GeeCollection*) _tmp38_);
#line 306 "pastebin-plugin.vala"
					_tmp40_ = _tmp39_;
#line 306 "pastebin-plugin.vala"
					_matcher_size = _tmp40_;
#line 306 "pastebin-plugin.vala"
					_matcher_index = -1;
#line 306 "pastebin-plugin.vala"
					while (TRUE) {
#line 645 "pastebin-plugin.c"
						gint _tmp41_;
						gint _tmp42_;
						GeeMapEntry* matcher = NULL;
						GeeList* _tmp43_;
						gpointer _tmp44_;
						GeeMapEntry* _tmp45_;
						gconstpointer _tmp46_;
						gconstpointer _tmp47_;
						SynapsePastebinPluginPastebinAction* _tmp48_;
						const gchar* _tmp49_;
						const gchar* _tmp50_;
#line 306 "pastebin-plugin.vala"
						_matcher_index = _matcher_index + 1;
#line 306 "pastebin-plugin.vala"
						_tmp41_ = _matcher_index;
#line 306 "pastebin-plugin.vala"
						_tmp42_ = _matcher_size;
#line 306 "pastebin-plugin.vala"
						if (!(_tmp41_ < _tmp42_)) {
#line 306 "pastebin-plugin.vala"
							break;
#line 667 "pastebin-plugin.c"
						}
#line 306 "pastebin-plugin.vala"
						_tmp43_ = _matcher_list;
#line 306 "pastebin-plugin.vala"
						_tmp44_ = gee_list_get (_tmp43_, _matcher_index);
#line 306 "pastebin-plugin.vala"
						matcher = (GeeMapEntry*) _tmp44_;
#line 308 "pastebin-plugin.vala"
						_tmp45_ = matcher;
#line 308 "pastebin-plugin.vala"
						_tmp46_ = gee_map_entry_get_key (_tmp45_);
#line 308 "pastebin-plugin.vala"
						_tmp47_ = _tmp46_;
#line 308 "pastebin-plugin.vala"
						_tmp48_ = action;
#line 308 "pastebin-plugin.vala"
						_tmp49_ = synapse_match_get_title ((SynapseMatch*) _tmp48_);
#line 308 "pastebin-plugin.vala"
						_tmp50_ = _tmp49_;
#line 308 "pastebin-plugin.vala"
						if (g_regex_match ((GRegex*) _tmp47_, _tmp50_, 0, NULL)) {
#line 689 "pastebin-plugin.c"
							SynapseResultSet* _tmp51_;
							SynapsePastebinPluginPastebinAction* _tmp52_;
							GeeMapEntry* _tmp53_;
							gconstpointer _tmp54_;
							gconstpointer _tmp55_;
#line 310 "pastebin-plugin.vala"
							_tmp51_ = results;
#line 310 "pastebin-plugin.vala"
							_tmp52_ = action;
#line 310 "pastebin-plugin.vala"
							_tmp53_ = matcher;
#line 310 "pastebin-plugin.vala"
							_tmp54_ = gee_map_entry_get_value (_tmp53_);
#line 310 "pastebin-plugin.vala"
							_tmp55_ = _tmp54_;
#line 310 "pastebin-plugin.vala"
							synapse_result_set_add (_tmp51_, (SynapseMatch*) _tmp52_, (gint) ((gintptr) _tmp55_));
#line 311 "pastebin-plugin.vala"
							_g_object_unref0 (matcher);
#line 311 "pastebin-plugin.vala"
							break;
#line 711 "pastebin-plugin.c"
						}
#line 306 "pastebin-plugin.vala"
						_g_object_unref0 (matcher);
#line 715 "pastebin-plugin.c"
					}
				}
#line 304 "pastebin-plugin.vala"
				_g_object_unref0 (action);
#line 720 "pastebin-plugin.c"
			}
		}
#line 294 "pastebin-plugin.vala"
		_g_object_unref0 (matchers);
#line 725 "pastebin-plugin.c"
	}
#line 317 "pastebin-plugin.vala"
	result = results;
#line 317 "pastebin-plugin.vala"
	return result;
#line 731 "pastebin-plugin.c"
}

SynapsePastebinPlugin*
synapse_pastebin_plugin_construct (GType object_type)
{
	SynapsePastebinPlugin * self = NULL;
#line 24 "pastebin-plugin.vala"
	self = (SynapsePastebinPlugin*) g_object_new (object_type, NULL);
#line 24 "pastebin-plugin.vala"
	return self;
#line 742 "pastebin-plugin.c"
}

SynapsePastebinPlugin*
synapse_pastebin_plugin_new (void)
{
#line 24 "pastebin-plugin.vala"
	return synapse_pastebin_plugin_construct (SYNAPSE_TYPE_PASTEBIN_PLUGIN);
#line 750 "pastebin-plugin.c"
}

static gboolean
synapse_pastebin_plugin_real_get_enabled (SynapseActivatable* base)
{
	gboolean result;
	SynapsePastebinPlugin* self;
#line 26 "pastebin-plugin.vala"
	self = (SynapsePastebinPlugin*) base;
#line 26 "pastebin-plugin.vala"
	result = self->priv->_enabled;
#line 26 "pastebin-plugin.vala"
	return result;
#line 764 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_real_set_enabled (SynapseActivatable* base,
                                          gboolean value)
{
	SynapsePastebinPlugin* self;
	gboolean old_value;
#line 26 "pastebin-plugin.vala"
	self = (SynapsePastebinPlugin*) base;
#line 26 "pastebin-plugin.vala"
	old_value = synapse_pastebin_plugin_real_get_enabled (base);
#line 26 "pastebin-plugin.vala"
	if (old_value != value) {
#line 26 "pastebin-plugin.vala"
		self->priv->_enabled = value;
#line 26 "pastebin-plugin.vala"
		g_object_notify_by_pspec ((GObject *) self, synapse_pastebin_plugin_properties[SYNAPSE_PASTEBIN_PLUGIN_ENABLED_PROPERTY]);
#line 783 "pastebin-plugin.c"
	}
}

static SynapsePastebinPluginPastebinAction*
synapse_pastebin_plugin_pastebin_action_construct (GType object_type)
{
	SynapsePastebinPluginPastebinAction * self = NULL;
#line 42 "pastebin-plugin.vala"
	self = (SynapsePastebinPluginPastebinAction*) g_object_new (object_type, "title", _ ("Pastebin"), "description", _ ("Pastebin selection"), "icon-name", "document-send", "has-thumbnail", FALSE, "default-relevancy", SYNAPSE_MATCH_SCORE_AVERAGE, NULL);
#line 40 "pastebin-plugin.vala"
	return self;
#line 795 "pastebin-plugin.c"
}

static SynapsePastebinPluginPastebinAction*
synapse_pastebin_plugin_pastebin_action_new (void)
{
#line 40 "pastebin-plugin.vala"
	return synapse_pastebin_plugin_pastebin_action_construct (SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION);
#line 803 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_pastebin_file_data_free (gpointer _data)
{
	SynapsePastebinPluginPastebinActionPastebinFileData* _data_;
	_data_ = _data;
#line 38 "pastebin-plugin.vala"
	_g_free0 (_data_->path);
#line 38 "pastebin-plugin.vala"
	_g_free0 (_data_->result);
#line 38 "pastebin-plugin.vala"
	_g_object_unref0 (_data_->self);
#line 38 "pastebin-plugin.vala"
	g_slice_free (SynapsePastebinPluginPastebinActionPastebinFileData, _data_);
#line 819 "pastebin-plugin.c"
}

static gpointer
_g_object_ref0 (gpointer self)
{
#line 38 "pastebin-plugin.vala"
	return self ? g_object_ref (self) : NULL;
#line 827 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_pastebin_file (SynapsePastebinPluginPastebinAction* self,
                                                       const gchar* path,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	SynapsePastebinPluginPastebinActionPastebinFileData* _data_;
	SynapsePastebinPluginPastebinAction* _tmp0_;
	gchar* _tmp1_;
#line 38 "pastebin-plugin.vala"
	g_return_if_fail (self != NULL);
#line 38 "pastebin-plugin.vala"
	g_return_if_fail (path != NULL);
#line 38 "pastebin-plugin.vala"
	_data_ = g_slice_new0 (SynapsePastebinPluginPastebinActionPastebinFileData);
#line 38 "pastebin-plugin.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 38 "pastebin-plugin.vala"
	g_task_set_task_data (_data_->_async_result, _data_, synapse_pastebin_plugin_pastebin_action_pastebin_file_data_free);
#line 38 "pastebin-plugin.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 38 "pastebin-plugin.vala"
	_data_->self = _tmp0_;
#line 38 "pastebin-plugin.vala"
	_tmp1_ = g_strdup (path);
#line 38 "pastebin-plugin.vala"
	_g_free0 (_data_->path);
#line 38 "pastebin-plugin.vala"
	_data_->path = _tmp1_;
#line 38 "pastebin-plugin.vala"
	synapse_pastebin_plugin_pastebin_action_pastebin_file_co (_data_);
#line 861 "pastebin-plugin.c"
}

static gchar*
synapse_pastebin_plugin_pastebin_action_pastebin_file_finish (SynapsePastebinPluginPastebinAction* self,
                                                              GAsyncResult* _res_)
{
	gchar* result;
	SynapsePastebinPluginPastebinActionPastebinFileData* _data_;
#line 38 "pastebin-plugin.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 38 "pastebin-plugin.vala"
	result = _data_->result;
#line 38 "pastebin-plugin.vala"
	_data_->result = NULL;
#line 38 "pastebin-plugin.vala"
	return result;
#line 878 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_pastebin_file_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_)
{
	SynapsePastebinPluginPastebinActionPastebinFileData* _data_;
#line 68 "pastebin-plugin.vala"
	_data_ = _user_data_;
#line 68 "pastebin-plugin.vala"
	_data_->_source_object_ = source_object;
#line 68 "pastebin-plugin.vala"
	_data_->_res_ = _res_;
#line 68 "pastebin-plugin.vala"
	synapse_pastebin_plugin_pastebin_action_pastebin_file_co (_data_);
#line 895 "pastebin-plugin.c"
}

static gboolean
synapse_pastebin_plugin_pastebin_action_pastebin_file_co (SynapsePastebinPluginPastebinActionPastebinFileData* _data_)
{
#line 48 "pastebin-plugin.vala"
	switch (_data_->_state_) {
#line 48 "pastebin-plugin.vala"
		case 0:
#line 905 "pastebin-plugin.c"
		goto _state_0;
#line 48 "pastebin-plugin.vala"
		case 1:
#line 909 "pastebin-plugin.c"
		goto _state_1;
		default:
#line 48 "pastebin-plugin.vala"
		g_assert_not_reached ();
#line 914 "pastebin-plugin.c"
	}
	_state_0:
#line 50 "pastebin-plugin.vala"
	_data_->_tmp0_ = g_strdup ("pastebinit");
#line 50 "pastebin-plugin.vala"
	_data_->_tmp1_ = g_strdup ("-i");
#line 50 "pastebin-plugin.vala"
	_data_->_tmp2_ = g_strdup (_data_->path);
#line 50 "pastebin-plugin.vala"
	_data_->_tmp3_ = g_new0 (gchar*, 3 + 1);
#line 50 "pastebin-plugin.vala"
	_data_->_tmp3_[0] = _data_->_tmp0_;
#line 50 "pastebin-plugin.vala"
	_data_->_tmp3_[1] = _data_->_tmp1_;
#line 50 "pastebin-plugin.vala"
	_data_->_tmp3_[2] = _data_->_tmp2_;
#line 50 "pastebin-plugin.vala"
	_data_->argv = _data_->_tmp3_;
#line 50 "pastebin-plugin.vala"
	_data_->argv_length1 = 3;
#line 50 "pastebin-plugin.vala"
	_data_->_argv_size_ = _data_->argv_length1;
#line 937 "pastebin-plugin.c"
	{
#line 57 "pastebin-plugin.vala"
		_data_->_tmp4_ = _data_->argv;
#line 57 "pastebin-plugin.vala"
		_data_->_tmp4__length1 = _data_->argv_length1;
#line 57 "pastebin-plugin.vala"
		_data_->_tmp5_ = 0;
#line 57 "pastebin-plugin.vala"
		_data_->_tmp6_ = 0;
#line 57 "pastebin-plugin.vala"
		g_spawn_async_with_pipes (NULL, _data_->_tmp4_, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &_data_->_tmp5_, NULL, &_data_->_tmp6_, NULL, &_data_->_inner_error0_);
#line 57 "pastebin-plugin.vala"
		_data_->pid = _data_->_tmp5_;
#line 57 "pastebin-plugin.vala"
		_data_->read_fd = _data_->_tmp6_;
#line 57 "pastebin-plugin.vala"
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 955 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 61 "pastebin-plugin.vala"
		_data_->_tmp7_ = (GUnixInputStream*) g_unix_input_stream_new (_data_->read_fd, TRUE);
#line 61 "pastebin-plugin.vala"
		_data_->read_stream = _data_->_tmp7_;
#line 62 "pastebin-plugin.vala"
		_data_->_tmp8_ = _data_->read_stream;
#line 62 "pastebin-plugin.vala"
		_data_->_tmp9_ = g_data_input_stream_new ((GInputStream*) _data_->_tmp8_);
#line 62 "pastebin-plugin.vala"
		_data_->pastebinit_output = _data_->_tmp9_;
#line 64 "pastebin-plugin.vala"
		_data_->line = NULL;
#line 65 "pastebin-plugin.vala"
		_data_->_tmp10_ = g_strdup ("");
#line 65 "pastebin-plugin.vala"
		_data_->complete_output = _data_->_tmp10_;
#line 974 "pastebin-plugin.c"
		{
#line 66 "pastebin-plugin.vala"
			_data_->_tmp11_ = TRUE;
#line 66 "pastebin-plugin.vala"
			while (TRUE) {
#line 66 "pastebin-plugin.vala"
				if (!_data_->_tmp11_) {
#line 73 "pastebin-plugin.vala"
					_data_->_tmp12_ = _data_->line;
#line 73 "pastebin-plugin.vala"
					if (!(_data_->_tmp12_ != NULL)) {
#line 73 "pastebin-plugin.vala"
						break;
#line 988 "pastebin-plugin.c"
					}
				}
#line 66 "pastebin-plugin.vala"
				_data_->_tmp11_ = FALSE;
#line 68 "pastebin-plugin.vala"
				_data_->_tmp14_ = _data_->pastebinit_output;
#line 68 "pastebin-plugin.vala"
				_data_->_state_ = 1;
#line 68 "pastebin-plugin.vala"
				g_data_input_stream_read_line_async (_data_->_tmp14_, G_PRIORITY_DEFAULT_IDLE, NULL, synapse_pastebin_plugin_pastebin_action_pastebin_file_ready, _data_);
#line 68 "pastebin-plugin.vala"
				return FALSE;
#line 1001 "pastebin-plugin.c"
				_state_1:
#line 68 "pastebin-plugin.vala"
				_data_->_tmp15_ = g_data_input_stream_read_line_finish (_data_->_tmp14_, _data_->_res_, NULL, &_data_->_inner_error0_);
#line 68 "pastebin-plugin.vala"
				_data_->_tmp13_ = _data_->_tmp15_;
#line 68 "pastebin-plugin.vala"
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 68 "pastebin-plugin.vala"
					_g_free0 (_data_->complete_output);
#line 68 "pastebin-plugin.vala"
					_g_free0 (_data_->line);
#line 68 "pastebin-plugin.vala"
					_g_object_unref0 (_data_->pastebinit_output);
#line 68 "pastebin-plugin.vala"
					_g_object_unref0 (_data_->read_stream);
#line 1017 "pastebin-plugin.c"
					goto __catch0_g_error;
				}
#line 68 "pastebin-plugin.vala"
				_data_->_tmp16_ = _data_->_tmp13_;
#line 68 "pastebin-plugin.vala"
				_data_->_tmp13_ = NULL;
#line 68 "pastebin-plugin.vala"
				_g_free0 (_data_->line);
#line 68 "pastebin-plugin.vala"
				_data_->line = _data_->_tmp16_;
#line 69 "pastebin-plugin.vala"
				_data_->_tmp17_ = _data_->line;
#line 69 "pastebin-plugin.vala"
				if (_data_->_tmp17_ != NULL) {
#line 71 "pastebin-plugin.vala"
					_data_->_tmp18_ = _data_->complete_output;
#line 71 "pastebin-plugin.vala"
					_data_->_tmp19_ = _data_->line;
#line 71 "pastebin-plugin.vala"
					_data_->_tmp20_ = g_strconcat (_data_->_tmp18_, _data_->_tmp19_, NULL);
#line 71 "pastebin-plugin.vala"
					_g_free0 (_data_->complete_output);
#line 71 "pastebin-plugin.vala"
					_data_->complete_output = _data_->_tmp20_;
#line 1042 "pastebin-plugin.c"
				}
#line 66 "pastebin-plugin.vala"
				_g_free0 (_data_->_tmp13_);
#line 1046 "pastebin-plugin.c"
			}
		}
#line 75 "pastebin-plugin.vala"
		_data_->_tmp21_ = g_regex_new ("^http(s)?://.*$", 0, 0, &_data_->_inner_error0_);
#line 75 "pastebin-plugin.vala"
		_data_->url = _data_->_tmp21_;
#line 75 "pastebin-plugin.vala"
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 75 "pastebin-plugin.vala"
			_g_free0 (_data_->complete_output);
#line 75 "pastebin-plugin.vala"
			_g_free0 (_data_->line);
#line 75 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->pastebinit_output);
#line 75 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->read_stream);
#line 1063 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 76 "pastebin-plugin.vala"
		_data_->_tmp22_ = _data_->url;
#line 76 "pastebin-plugin.vala"
		_data_->_tmp23_ = _data_->complete_output;
#line 76 "pastebin-plugin.vala"
		if (g_regex_match (_data_->_tmp22_, _data_->_tmp23_, 0, NULL)) {
#line 78 "pastebin-plugin.vala"
			_data_->result = _data_->complete_output;
#line 78 "pastebin-plugin.vala"
			_g_regex_unref0 (_data_->url);
#line 78 "pastebin-plugin.vala"
			_g_free0 (_data_->line);
#line 78 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->pastebinit_output);
#line 78 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->read_stream);
#line 78 "pastebin-plugin.vala"
			_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 78 "pastebin-plugin.vala"
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 78 "pastebin-plugin.vala"
			if (_data_->_state_ != 0) {
#line 78 "pastebin-plugin.vala"
				while (!g_task_get_completed (_data_->_async_result)) {
#line 78 "pastebin-plugin.vala"
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1092 "pastebin-plugin.c"
				}
			}
#line 78 "pastebin-plugin.vala"
			g_object_unref (_data_->_async_result);
#line 78 "pastebin-plugin.vala"
			return FALSE;
#line 1099 "pastebin-plugin.c"
		} else {
#line 82 "pastebin-plugin.vala"
			_data_->_tmp24_ = _data_->complete_output;
#line 82 "pastebin-plugin.vala"
			_data_->_tmp25_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, _data_->_tmp24_);
#line 82 "pastebin-plugin.vala"
			_data_->_inner_error0_ = _data_->_tmp25_;
#line 82 "pastebin-plugin.vala"
			_g_regex_unref0 (_data_->url);
#line 82 "pastebin-plugin.vala"
			_g_free0 (_data_->complete_output);
#line 82 "pastebin-plugin.vala"
			_g_free0 (_data_->line);
#line 82 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->pastebinit_output);
#line 82 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->read_stream);
#line 1117 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 52 "pastebin-plugin.vala"
		_g_regex_unref0 (_data_->url);
#line 52 "pastebin-plugin.vala"
		_g_free0 (_data_->complete_output);
#line 52 "pastebin-plugin.vala"
		_g_free0 (_data_->line);
#line 52 "pastebin-plugin.vala"
		_g_object_unref0 (_data_->pastebinit_output);
#line 52 "pastebin-plugin.vala"
		_g_object_unref0 (_data_->read_stream);
#line 1130 "pastebin-plugin.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 52 "pastebin-plugin.vala"
		_data_->err = _data_->_inner_error0_;
#line 52 "pastebin-plugin.vala"
		_data_->_inner_error0_ = NULL;
#line 87 "pastebin-plugin.vala"
		_data_->_tmp26_ = _data_->err;
#line 87 "pastebin-plugin.vala"
		_data_->_tmp27_ = _data_->_tmp26_->message;
#line 87 "pastebin-plugin.vala"
		g_warning ("pastebin-plugin.vala:87: %s", _data_->_tmp27_);
#line 52 "pastebin-plugin.vala"
		_g_error_free0 (_data_->err);
#line 1147 "pastebin-plugin.c"
	}
	__finally0:
#line 52 "pastebin-plugin.vala"
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 52 "pastebin-plugin.vala"
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 52 "pastebin-plugin.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
#line 52 "pastebin-plugin.vala"
		g_clear_error (&_data_->_inner_error0_);
#line 52 "pastebin-plugin.vala"
		g_object_unref (_data_->_async_result);
#line 52 "pastebin-plugin.vala"
		return FALSE;
#line 1162 "pastebin-plugin.c"
	}
#line 90 "pastebin-plugin.vala"
	_data_->result = NULL;
#line 90 "pastebin-plugin.vala"
	_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 90 "pastebin-plugin.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 90 "pastebin-plugin.vala"
	if (_data_->_state_ != 0) {
#line 90 "pastebin-plugin.vala"
		while (!g_task_get_completed (_data_->_async_result)) {
#line 90 "pastebin-plugin.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1176 "pastebin-plugin.c"
		}
	}
#line 90 "pastebin-plugin.vala"
	g_object_unref (_data_->_async_result);
#line 90 "pastebin-plugin.vala"
	return FALSE;
#line 1183 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_pastebin_text_data_free (gpointer _data)
{
	SynapsePastebinPluginPastebinActionPastebinTextData* _data_;
	_data_ = _data;
#line 38 "pastebin-plugin.vala"
	_g_free0 (_data_->content);
#line 38 "pastebin-plugin.vala"
	_g_free0 (_data_->result);
#line 38 "pastebin-plugin.vala"
	_g_object_unref0 (_data_->self);
#line 38 "pastebin-plugin.vala"
	g_slice_free (SynapsePastebinPluginPastebinActionPastebinTextData, _data_);
#line 1199 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_pastebin_text (SynapsePastebinPluginPastebinAction* self,
                                                       const gchar* content,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	SynapsePastebinPluginPastebinActionPastebinTextData* _data_;
	SynapsePastebinPluginPastebinAction* _tmp0_;
	gchar* _tmp1_;
#line 38 "pastebin-plugin.vala"
	g_return_if_fail (self != NULL);
#line 38 "pastebin-plugin.vala"
	g_return_if_fail (content != NULL);
#line 38 "pastebin-plugin.vala"
	_data_ = g_slice_new0 (SynapsePastebinPluginPastebinActionPastebinTextData);
#line 38 "pastebin-plugin.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 38 "pastebin-plugin.vala"
	g_task_set_task_data (_data_->_async_result, _data_, synapse_pastebin_plugin_pastebin_action_pastebin_text_data_free);
#line 38 "pastebin-plugin.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 38 "pastebin-plugin.vala"
	_data_->self = _tmp0_;
#line 38 "pastebin-plugin.vala"
	_tmp1_ = g_strdup (content);
#line 38 "pastebin-plugin.vala"
	_g_free0 (_data_->content);
#line 38 "pastebin-plugin.vala"
	_data_->content = _tmp1_;
#line 38 "pastebin-plugin.vala"
	synapse_pastebin_plugin_pastebin_action_pastebin_text_co (_data_);
#line 1233 "pastebin-plugin.c"
}

static gchar*
synapse_pastebin_plugin_pastebin_action_pastebin_text_finish (SynapsePastebinPluginPastebinAction* self,
                                                              GAsyncResult* _res_)
{
	gchar* result;
	SynapsePastebinPluginPastebinActionPastebinTextData* _data_;
#line 38 "pastebin-plugin.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 38 "pastebin-plugin.vala"
	result = _data_->result;
#line 38 "pastebin-plugin.vala"
	_data_->result = NULL;
#line 38 "pastebin-plugin.vala"
	return result;
#line 1250 "pastebin-plugin.c"
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
#line 1609 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1610 "glib-2.0.vapi"
	res = (guint8*) self;
#line 1610 "glib-2.0.vapi"
	res_length1 = -1;
#line 1610 "glib-2.0.vapi"
	_res_size_ = res_length1;
#line 1611 "glib-2.0.vapi"
	_tmp0_ = strlen (self);
#line 1611 "glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 1611 "glib-2.0.vapi"
	res_length1 = (gint) _tmp1_;
#line 1612 "glib-2.0.vapi"
	_tmp2_ = res;
#line 1612 "glib-2.0.vapi"
	_tmp2__length1 = res_length1;
#line 1612 "glib-2.0.vapi"
	if (result_length1) {
#line 1612 "glib-2.0.vapi"
		*result_length1 = _tmp2__length1;
#line 1287 "pastebin-plugin.c"
	}
#line 1612 "glib-2.0.vapi"
	result = _tmp2_;
#line 1612 "glib-2.0.vapi"
	return result;
#line 1293 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_pastebin_text_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_)
{
	SynapsePastebinPluginPastebinActionPastebinTextData* _data_;
#line 111 "pastebin-plugin.vala"
	_data_ = _user_data_;
#line 111 "pastebin-plugin.vala"
	_data_->_source_object_ = source_object;
#line 111 "pastebin-plugin.vala"
	_data_->_res_ = _res_;
#line 111 "pastebin-plugin.vala"
	synapse_pastebin_plugin_pastebin_action_pastebin_text_co (_data_);
#line 1310 "pastebin-plugin.c"
}

static gboolean
synapse_pastebin_plugin_pastebin_action_pastebin_text_co (SynapsePastebinPluginPastebinActionPastebinTextData* _data_)
{
#line 93 "pastebin-plugin.vala"
	switch (_data_->_state_) {
#line 93 "pastebin-plugin.vala"
		case 0:
#line 1320 "pastebin-plugin.c"
		goto _state_0;
#line 93 "pastebin-plugin.vala"
		case 1:
#line 1324 "pastebin-plugin.c"
		goto _state_1;
#line 93 "pastebin-plugin.vala"
		case 2:
#line 1328 "pastebin-plugin.c"
		goto _state_2;
#line 93 "pastebin-plugin.vala"
		case 3:
#line 1332 "pastebin-plugin.c"
		goto _state_3;
		default:
#line 93 "pastebin-plugin.vala"
		g_assert_not_reached ();
#line 1337 "pastebin-plugin.c"
	}
	_state_0:
#line 95 "pastebin-plugin.vala"
	_data_->_tmp0_ = g_strdup ("pastebinit");
#line 95 "pastebin-plugin.vala"
	_data_->_tmp1_ = g_new0 (gchar*, 1 + 1);
#line 95 "pastebin-plugin.vala"
	_data_->_tmp1_[0] = _data_->_tmp0_;
#line 95 "pastebin-plugin.vala"
	_data_->argv = _data_->_tmp1_;
#line 95 "pastebin-plugin.vala"
	_data_->argv_length1 = 1;
#line 95 "pastebin-plugin.vala"
	_data_->_argv_size_ = _data_->argv_length1;
#line 1352 "pastebin-plugin.c"
	{
#line 103 "pastebin-plugin.vala"
		_data_->_tmp2_ = _data_->argv;
#line 103 "pastebin-plugin.vala"
		_data_->_tmp2__length1 = _data_->argv_length1;
#line 103 "pastebin-plugin.vala"
		_data_->_tmp3_ = 0;
#line 103 "pastebin-plugin.vala"
		_data_->_tmp4_ = 0;
#line 103 "pastebin-plugin.vala"
		_data_->_tmp5_ = 0;
#line 103 "pastebin-plugin.vala"
		g_spawn_async_with_pipes (NULL, _data_->_tmp2_, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &_data_->_tmp3_, &_data_->_tmp4_, &_data_->_tmp5_, NULL, &_data_->_inner_error0_);
#line 103 "pastebin-plugin.vala"
		_data_->pid = _data_->_tmp3_;
#line 103 "pastebin-plugin.vala"
		_data_->write_fd = _data_->_tmp4_;
#line 103 "pastebin-plugin.vala"
		_data_->read_fd = _data_->_tmp5_;
#line 103 "pastebin-plugin.vala"
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 1374 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 107 "pastebin-plugin.vala"
		_data_->_tmp6_ = (GUnixInputStream*) g_unix_input_stream_new (_data_->read_fd, TRUE);
#line 107 "pastebin-plugin.vala"
		_data_->read_stream = _data_->_tmp6_;
#line 108 "pastebin-plugin.vala"
		_data_->_tmp7_ = _data_->read_stream;
#line 108 "pastebin-plugin.vala"
		_data_->_tmp8_ = g_data_input_stream_new ((GInputStream*) _data_->_tmp7_);
#line 108 "pastebin-plugin.vala"
		_data_->pastebinit_output = _data_->_tmp8_;
#line 109 "pastebin-plugin.vala"
		_data_->_tmp9_ = (GUnixOutputStream*) g_unix_output_stream_new (_data_->write_fd, TRUE);
#line 109 "pastebin-plugin.vala"
		_data_->write_stream = _data_->_tmp9_;
#line 111 "pastebin-plugin.vala"
		_data_->_tmp10_ = _data_->write_stream;
#line 111 "pastebin-plugin.vala"
		_data_->_tmp12_ = 0;
#line 111 "pastebin-plugin.vala"
		_data_->_tmp11_ = string_get_data (_data_->content, &_data_->_tmp12_);
#line 111 "pastebin-plugin.vala"
		_data_->_tmp11__length1 = _data_->_tmp12_;
#line 111 "pastebin-plugin.vala"
		_data_->_tmp13_ = _data_->_tmp11_;
#line 111 "pastebin-plugin.vala"
		_data_->_tmp13__length1 = _data_->_tmp11__length1;
#line 111 "pastebin-plugin.vala"
		_data_->_state_ = 1;
#line 111 "pastebin-plugin.vala"
		g_output_stream_write_async ((GOutputStream*) _data_->_tmp10_, _data_->_tmp13_, (gsize) _data_->_tmp13__length1, G_PRIORITY_DEFAULT, NULL, synapse_pastebin_plugin_pastebin_action_pastebin_text_ready, _data_);
#line 111 "pastebin-plugin.vala"
		return FALSE;
#line 1409 "pastebin-plugin.c"
		_state_1:
#line 111 "pastebin-plugin.vala"
		g_output_stream_write_finish ((GOutputStream*) _data_->_tmp10_, _data_->_res_, &_data_->_inner_error0_);
#line 111 "pastebin-plugin.vala"
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 111 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->write_stream);
#line 111 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->pastebinit_output);
#line 111 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->read_stream);
#line 1421 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 112 "pastebin-plugin.vala"
		_data_->_tmp14_ = _data_->write_stream;
#line 112 "pastebin-plugin.vala"
		_data_->_state_ = 2;
#line 112 "pastebin-plugin.vala"
		g_output_stream_close_async ((GOutputStream*) _data_->_tmp14_, G_PRIORITY_DEFAULT, NULL, synapse_pastebin_plugin_pastebin_action_pastebin_text_ready, _data_);
#line 112 "pastebin-plugin.vala"
		return FALSE;
#line 1432 "pastebin-plugin.c"
		_state_2:
#line 112 "pastebin-plugin.vala"
		g_output_stream_close_finish ((GOutputStream*) _data_->_tmp14_, _data_->_res_, &_data_->_inner_error0_);
#line 112 "pastebin-plugin.vala"
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 112 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->write_stream);
#line 112 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->pastebinit_output);
#line 112 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->read_stream);
#line 1444 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 114 "pastebin-plugin.vala"
		_data_->line = NULL;
#line 115 "pastebin-plugin.vala"
		_data_->_tmp15_ = g_strdup ("");
#line 115 "pastebin-plugin.vala"
		_data_->complete_output = _data_->_tmp15_;
#line 1453 "pastebin-plugin.c"
		{
#line 116 "pastebin-plugin.vala"
			_data_->_tmp16_ = TRUE;
#line 116 "pastebin-plugin.vala"
			while (TRUE) {
#line 116 "pastebin-plugin.vala"
				if (!_data_->_tmp16_) {
#line 123 "pastebin-plugin.vala"
					_data_->_tmp17_ = _data_->line;
#line 123 "pastebin-plugin.vala"
					if (!(_data_->_tmp17_ != NULL)) {
#line 123 "pastebin-plugin.vala"
						break;
#line 1467 "pastebin-plugin.c"
					}
				}
#line 116 "pastebin-plugin.vala"
				_data_->_tmp16_ = FALSE;
#line 118 "pastebin-plugin.vala"
				_data_->_tmp19_ = _data_->pastebinit_output;
#line 118 "pastebin-plugin.vala"
				_data_->_state_ = 3;
#line 118 "pastebin-plugin.vala"
				g_data_input_stream_read_line_async (_data_->_tmp19_, G_PRIORITY_DEFAULT_IDLE, NULL, synapse_pastebin_plugin_pastebin_action_pastebin_text_ready, _data_);
#line 118 "pastebin-plugin.vala"
				return FALSE;
#line 1480 "pastebin-plugin.c"
				_state_3:
#line 118 "pastebin-plugin.vala"
				_data_->_tmp20_ = g_data_input_stream_read_line_finish (_data_->_tmp19_, _data_->_res_, NULL, &_data_->_inner_error0_);
#line 118 "pastebin-plugin.vala"
				_data_->_tmp18_ = _data_->_tmp20_;
#line 118 "pastebin-plugin.vala"
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 118 "pastebin-plugin.vala"
					_g_free0 (_data_->complete_output);
#line 118 "pastebin-plugin.vala"
					_g_free0 (_data_->line);
#line 118 "pastebin-plugin.vala"
					_g_object_unref0 (_data_->write_stream);
#line 118 "pastebin-plugin.vala"
					_g_object_unref0 (_data_->pastebinit_output);
#line 118 "pastebin-plugin.vala"
					_g_object_unref0 (_data_->read_stream);
#line 1498 "pastebin-plugin.c"
					goto __catch0_g_error;
				}
#line 118 "pastebin-plugin.vala"
				_data_->_tmp21_ = _data_->_tmp18_;
#line 118 "pastebin-plugin.vala"
				_data_->_tmp18_ = NULL;
#line 118 "pastebin-plugin.vala"
				_g_free0 (_data_->line);
#line 118 "pastebin-plugin.vala"
				_data_->line = _data_->_tmp21_;
#line 119 "pastebin-plugin.vala"
				_data_->_tmp22_ = _data_->line;
#line 119 "pastebin-plugin.vala"
				if (_data_->_tmp22_ != NULL) {
#line 121 "pastebin-plugin.vala"
					_data_->_tmp23_ = _data_->complete_output;
#line 121 "pastebin-plugin.vala"
					_data_->_tmp24_ = _data_->line;
#line 121 "pastebin-plugin.vala"
					_data_->_tmp25_ = g_strconcat (_data_->_tmp23_, _data_->_tmp24_, NULL);
#line 121 "pastebin-plugin.vala"
					_g_free0 (_data_->complete_output);
#line 121 "pastebin-plugin.vala"
					_data_->complete_output = _data_->_tmp25_;
#line 1523 "pastebin-plugin.c"
				}
#line 116 "pastebin-plugin.vala"
				_g_free0 (_data_->_tmp18_);
#line 1527 "pastebin-plugin.c"
			}
		}
#line 125 "pastebin-plugin.vala"
		_data_->_tmp26_ = g_regex_new ("^http(s)?://.*$", 0, 0, &_data_->_inner_error0_);
#line 125 "pastebin-plugin.vala"
		_data_->url = _data_->_tmp26_;
#line 125 "pastebin-plugin.vala"
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 125 "pastebin-plugin.vala"
			_g_free0 (_data_->complete_output);
#line 125 "pastebin-plugin.vala"
			_g_free0 (_data_->line);
#line 125 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->write_stream);
#line 125 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->pastebinit_output);
#line 125 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->read_stream);
#line 1546 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 126 "pastebin-plugin.vala"
		_data_->_tmp27_ = _data_->url;
#line 126 "pastebin-plugin.vala"
		_data_->_tmp28_ = _data_->complete_output;
#line 126 "pastebin-plugin.vala"
		if (g_regex_match (_data_->_tmp27_, _data_->_tmp28_, 0, NULL)) {
#line 128 "pastebin-plugin.vala"
			_data_->result = _data_->complete_output;
#line 128 "pastebin-plugin.vala"
			_g_regex_unref0 (_data_->url);
#line 128 "pastebin-plugin.vala"
			_g_free0 (_data_->line);
#line 128 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->write_stream);
#line 128 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->pastebinit_output);
#line 128 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->read_stream);
#line 128 "pastebin-plugin.vala"
			_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 128 "pastebin-plugin.vala"
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 128 "pastebin-plugin.vala"
			if (_data_->_state_ != 0) {
#line 128 "pastebin-plugin.vala"
				while (!g_task_get_completed (_data_->_async_result)) {
#line 128 "pastebin-plugin.vala"
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1577 "pastebin-plugin.c"
				}
			}
#line 128 "pastebin-plugin.vala"
			g_object_unref (_data_->_async_result);
#line 128 "pastebin-plugin.vala"
			return FALSE;
#line 1584 "pastebin-plugin.c"
		} else {
#line 132 "pastebin-plugin.vala"
			_data_->_tmp29_ = _data_->complete_output;
#line 132 "pastebin-plugin.vala"
			_data_->_tmp30_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, _data_->_tmp29_);
#line 132 "pastebin-plugin.vala"
			_data_->_inner_error0_ = _data_->_tmp30_;
#line 132 "pastebin-plugin.vala"
			_g_regex_unref0 (_data_->url);
#line 132 "pastebin-plugin.vala"
			_g_free0 (_data_->complete_output);
#line 132 "pastebin-plugin.vala"
			_g_free0 (_data_->line);
#line 132 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->write_stream);
#line 132 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->pastebinit_output);
#line 132 "pastebin-plugin.vala"
			_g_object_unref0 (_data_->read_stream);
#line 1604 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 97 "pastebin-plugin.vala"
		_g_regex_unref0 (_data_->url);
#line 97 "pastebin-plugin.vala"
		_g_free0 (_data_->complete_output);
#line 97 "pastebin-plugin.vala"
		_g_free0 (_data_->line);
#line 97 "pastebin-plugin.vala"
		_g_object_unref0 (_data_->write_stream);
#line 97 "pastebin-plugin.vala"
		_g_object_unref0 (_data_->pastebinit_output);
#line 97 "pastebin-plugin.vala"
		_g_object_unref0 (_data_->read_stream);
#line 1619 "pastebin-plugin.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 97 "pastebin-plugin.vala"
		_data_->err = _data_->_inner_error0_;
#line 97 "pastebin-plugin.vala"
		_data_->_inner_error0_ = NULL;
#line 137 "pastebin-plugin.vala"
		_data_->_tmp31_ = _data_->err;
#line 137 "pastebin-plugin.vala"
		_data_->_tmp32_ = _data_->_tmp31_->message;
#line 137 "pastebin-plugin.vala"
		g_warning ("pastebin-plugin.vala:137: %s", _data_->_tmp32_);
#line 97 "pastebin-plugin.vala"
		_g_error_free0 (_data_->err);
#line 1636 "pastebin-plugin.c"
	}
	__finally0:
#line 97 "pastebin-plugin.vala"
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
#line 97 "pastebin-plugin.vala"
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 97 "pastebin-plugin.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
#line 97 "pastebin-plugin.vala"
		g_clear_error (&_data_->_inner_error0_);
#line 97 "pastebin-plugin.vala"
		g_object_unref (_data_->_async_result);
#line 97 "pastebin-plugin.vala"
		return FALSE;
#line 1651 "pastebin-plugin.c"
	}
#line 140 "pastebin-plugin.vala"
	_data_->result = NULL;
#line 140 "pastebin-plugin.vala"
	_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 140 "pastebin-plugin.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 140 "pastebin-plugin.vala"
	if (_data_->_state_ != 0) {
#line 140 "pastebin-plugin.vala"
		while (!g_task_get_completed (_data_->_async_result)) {
#line 140 "pastebin-plugin.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1665 "pastebin-plugin.c"
		}
	}
#line 140 "pastebin-plugin.vala"
	g_object_unref (_data_->_async_result);
#line 140 "pastebin-plugin.vala"
	return FALSE;
#line 1672 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_real_process_pastebin_result (SynapsePastebinPluginPastebinAction* self,
                                                                      const gchar* url,
                                                                      SynapseMatch* target)
{
	gchar* msg = NULL;
	GError* _inner_error0_ = NULL;
#line 146 "pastebin-plugin.vala"
	if (url != NULL) {
#line 1684 "pastebin-plugin.c"
		GtkClipboard* cb = NULL;
		GtkClipboard* _tmp0_;
		GtkClipboard* _tmp1_;
		GtkClipboard* _tmp2_;
		gchar* _tmp3_;
#line 148 "pastebin-plugin.vala"
		_tmp0_ = gtk_clipboard_get (GDK_NONE);
#line 148 "pastebin-plugin.vala"
		_tmp1_ = _g_object_ref0 (_tmp0_);
#line 148 "pastebin-plugin.vala"
		cb = _tmp1_;
#line 149 "pastebin-plugin.vala"
		_tmp2_ = cb;
#line 149 "pastebin-plugin.vala"
		gtk_clipboard_set_text (_tmp2_, url, -1);
#line 151 "pastebin-plugin.vala"
		_tmp3_ = g_strdup (_ ("The selection was successfully uploaded and its URL was copied to clip" \
"board."));
#line 151 "pastebin-plugin.vala"
		_g_free0 (msg);
#line 151 "pastebin-plugin.vala"
		msg = _tmp3_;
#line 146 "pastebin-plugin.vala"
		_g_object_unref0 (cb);
#line 1708 "pastebin-plugin.c"
	} else {
		gchar* _tmp4_;
#line 155 "pastebin-plugin.vala"
		_tmp4_ = g_strdup (_ ("An error occurred during upload, please check the log for more informa" \
"tion."));
#line 155 "pastebin-plugin.vala"
		_g_free0 (msg);
#line 155 "pastebin-plugin.vala"
		msg = _tmp4_;
#line 1717 "pastebin-plugin.c"
	}
	{
		NotifyNotification* notification = NULL;
		const gchar* _tmp5_;
		GObject* _tmp6_;
		GObject* _tmp7_;
		NotifyNotification* _tmp8_;
#line 161 "pastebin-plugin.vala"
		_tmp5_ = msg;
#line 161 "pastebin-plugin.vala"
		_tmp6_ = g_object_new (notify_notification_get_type (), "summary", _ ("Synapse - Pastebin"), "body", _tmp5_, "icon-name", "synapse", NULL, NULL);
#line 161 "pastebin-plugin.vala"
		_tmp7_ = G_IS_INITIALLY_UNOWNED (_tmp6_) ? g_object_ref_sink (_tmp6_) : _tmp6_;
#line 161 "pastebin-plugin.vala"
		_tmp8_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, notify_notification_get_type ()) ? ((NotifyNotification*) _tmp7_) : NULL;
#line 161 "pastebin-plugin.vala"
		if (_tmp8_ == NULL) {
#line 161 "pastebin-plugin.vala"
			_g_object_unref0 (_tmp7_);
#line 1737 "pastebin-plugin.c"
		}
#line 161 "pastebin-plugin.vala"
		notification = _tmp8_;
#line 167 "pastebin-plugin.vala"
		notify_notification_set_timeout (notification, 10);
#line 168 "pastebin-plugin.vala"
		notify_notification_show (notification, &_inner_error0_);
#line 168 "pastebin-plugin.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 168 "pastebin-plugin.vala"
			_g_object_unref0 (notification);
#line 1749 "pastebin-plugin.c"
			goto __catch0_g_error;
		}
#line 161 "pastebin-plugin.vala"
		_g_object_unref0 (notification);
#line 1754 "pastebin-plugin.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
#line 161 "pastebin-plugin.vala"
		err = _inner_error0_;
#line 161 "pastebin-plugin.vala"
		_inner_error0_ = NULL;
#line 172 "pastebin-plugin.vala"
		_tmp9_ = err;
#line 172 "pastebin-plugin.vala"
		_tmp10_ = _tmp9_->message;
#line 172 "pastebin-plugin.vala"
		g_warning ("pastebin-plugin.vala:172: %s", _tmp10_);
#line 161 "pastebin-plugin.vala"
		_g_error_free0 (err);
#line 1774 "pastebin-plugin.c"
	}
	__finally0:
#line 161 "pastebin-plugin.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 161 "pastebin-plugin.vala"
		_g_free0 (msg);
#line 161 "pastebin-plugin.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 161 "pastebin-plugin.vala"
		g_clear_error (&_inner_error0_);
#line 161 "pastebin-plugin.vala"
		return;
#line 1787 "pastebin-plugin.c"
	}
#line 158 "pastebin-plugin.vala"
	_g_free0 (msg);
#line 1791 "pastebin-plugin.c"
}

void
synapse_pastebin_plugin_pastebin_action_process_pastebin_result (SynapsePastebinPluginPastebinAction* self,
                                                                 const gchar* url,
                                                                 SynapseMatch* target)
{
	SynapsePastebinPluginPastebinActionClass* _klass_;
#line 158 "pastebin-plugin.vala"
	g_return_if_fail (self != NULL);
#line 158 "pastebin-plugin.vala"
	_klass_ = SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_ACTION_GET_CLASS (self);
#line 158 "pastebin-plugin.vala"
	if (_klass_->process_pastebin_result) {
#line 158 "pastebin-plugin.vala"
		_klass_->process_pastebin_result (self, url, target);
#line 1808 "pastebin-plugin.c"
	}
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
#line 176 "pastebin-plugin.vala"
	g_atomic_int_inc (&_data5_->_ref_count_);
#line 176 "pastebin-plugin.vala"
	return _data5_;
#line 1819 "pastebin-plugin.c"
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
#line 176 "pastebin-plugin.vala"
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
#line 1829 "pastebin-plugin.c"
		SynapsePastebinPluginPastebinAction* self;
#line 176 "pastebin-plugin.vala"
		self = _data5_->self;
#line 176 "pastebin-plugin.vala"
		_g_object_unref0 (_data5_->target);
#line 176 "pastebin-plugin.vala"
		_g_object_unref0 (self);
#line 176 "pastebin-plugin.vala"
		g_slice_free (Block5Data, _data5_);
#line 1839 "pastebin-plugin.c"
	}
}

static void
___lambda16_ (Block5Data* _data5_,
              GObject* obj,
              GAsyncResult* res)
{
	SynapsePastebinPluginPastebinAction* self;
	gchar* url = NULL;
	gchar* _tmp0_;
#line 189 "pastebin-plugin.vala"
	self = _data5_->self;
#line 189 "pastebin-plugin.vala"
	g_return_if_fail (res != NULL);
#line 190 "pastebin-plugin.vala"
	_tmp0_ = synapse_pastebin_plugin_pastebin_action_pastebin_file_finish (self, res);
#line 190 "pastebin-plugin.vala"
	url = _tmp0_;
#line 191 "pastebin-plugin.vala"
	synapse_pastebin_plugin_pastebin_action_process_pastebin_result (self, url, _data5_->target);
#line 189 "pastebin-plugin.vala"
	_g_free0 (url);
#line 1863 "pastebin-plugin.c"
}

static void
____lambda16__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
#line 189 "pastebin-plugin.vala"
	___lambda16_ (self, source_object, res);
#line 189 "pastebin-plugin.vala"
	block5_data_unref (self);
#line 1875 "pastebin-plugin.c"
}

static void
____lambda17_ (Block5Data* _data5_,
               GObject* obj,
               GAsyncResult* res)
{
	SynapsePastebinPluginPastebinAction* self;
	gchar* url = NULL;
	gchar* _tmp0_;
#line 199 "pastebin-plugin.vala"
	self = _data5_->self;
#line 199 "pastebin-plugin.vala"
	g_return_if_fail (res != NULL);
#line 200 "pastebin-plugin.vala"
	_tmp0_ = synapse_pastebin_plugin_pastebin_action_pastebin_text_finish (self, res);
#line 200 "pastebin-plugin.vala"
	url = _tmp0_;
#line 201 "pastebin-plugin.vala"
	synapse_pastebin_plugin_pastebin_action_process_pastebin_result (self, url, _data5_->target);
#line 199 "pastebin-plugin.vala"
	_g_free0 (url);
#line 1898 "pastebin-plugin.c"
}

static void
_____lambda17__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
#line 199 "pastebin-plugin.vala"
	____lambda17_ (self, source_object, res);
#line 199 "pastebin-plugin.vala"
	block5_data_unref (self);
#line 1910 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_real_do_execute (SynapseAction* base,
                                                         SynapseMatch* match,
                                                         SynapseMatch* target)
{
	SynapsePastebinPluginPastebinAction * self;
	Block5Data* _data5_;
	SynapseMatch* _tmp0_;
#line 176 "pastebin-plugin.vala"
	self = (SynapsePastebinPluginPastebinAction*) base;
#line 176 "pastebin-plugin.vala"
	g_return_if_fail (match != NULL);
#line 176 "pastebin-plugin.vala"
	_data5_ = g_slice_new0 (Block5Data);
#line 176 "pastebin-plugin.vala"
	_data5_->_ref_count_ = 1;
#line 176 "pastebin-plugin.vala"
	_data5_->self = g_object_ref (self);
#line 176 "pastebin-plugin.vala"
	_tmp0_ = _g_object_ref0 (target);
#line 176 "pastebin-plugin.vala"
	_g_object_unref0 (_data5_->target);
#line 176 "pastebin-plugin.vala"
	_data5_->target = _tmp0_;
#line 178 "pastebin-plugin.vala"
	if (G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_URI_MATCH)) {
#line 1939 "pastebin-plugin.c"
		SynapseUriMatch* uri_match = NULL;
		GFile* f = NULL;
		SynapseUriMatch* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		GFile* _tmp4_;
		gchar* path = NULL;
		GFile* _tmp5_;
		gchar* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp11_;
#line 180 "pastebin-plugin.vala"
		uri_match = G_TYPE_CHECK_INSTANCE_CAST (match, SYNAPSE_TYPE_URI_MATCH, SynapseUriMatch);
#line 182 "pastebin-plugin.vala"
		_tmp1_ = uri_match;
#line 182 "pastebin-plugin.vala"
		_tmp2_ = synapse_uri_match_get_uri (_tmp1_);
#line 182 "pastebin-plugin.vala"
		_tmp3_ = _tmp2_;
#line 182 "pastebin-plugin.vala"
		_tmp4_ = g_file_new_for_uri (_tmp3_);
#line 182 "pastebin-plugin.vala"
		f = _tmp4_;
#line 183 "pastebin-plugin.vala"
		_tmp5_ = f;
#line 183 "pastebin-plugin.vala"
		_tmp6_ = g_file_get_path (_tmp5_);
#line 183 "pastebin-plugin.vala"
		path = _tmp6_;
#line 184 "pastebin-plugin.vala"
		_tmp7_ = path;
#line 184 "pastebin-plugin.vala"
		if (_tmp7_ == NULL) {
#line 1973 "pastebin-plugin.c"
			SynapseUriMatch* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
#line 186 "pastebin-plugin.vala"
			_tmp8_ = uri_match;
#line 186 "pastebin-plugin.vala"
			_tmp9_ = synapse_uri_match_get_uri (_tmp8_);
#line 186 "pastebin-plugin.vala"
			_tmp10_ = _tmp9_;
#line 186 "pastebin-plugin.vala"
			g_warning ("pastebin-plugin.vala:186: Unable to get path for %s", _tmp10_);
#line 187 "pastebin-plugin.vala"
			_g_free0 (path);
#line 187 "pastebin-plugin.vala"
			_g_object_unref0 (f);
#line 187 "pastebin-plugin.vala"
			block5_data_unref (_data5_);
#line 187 "pastebin-plugin.vala"
			_data5_ = NULL;
#line 187 "pastebin-plugin.vala"
			return;
#line 1995 "pastebin-plugin.c"
		}
#line 189 "pastebin-plugin.vala"
		_tmp11_ = path;
#line 189 "pastebin-plugin.vala"
		synapse_pastebin_plugin_pastebin_action_pastebin_file (self, _tmp11_, ____lambda16__gasync_ready_callback, block5_data_ref (_data5_));
#line 178 "pastebin-plugin.vala"
		_g_free0 (path);
#line 178 "pastebin-plugin.vala"
		_g_object_unref0 (f);
#line 2005 "pastebin-plugin.c"
	} else {
#line 194 "pastebin-plugin.vala"
		if (G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_TEXT_MATCH)) {
#line 2009 "pastebin-plugin.c"
			SynapseTextMatch* text_match = NULL;
			gchar* _tmp12_ = NULL;
			SynapseTextMatch* _tmp13_;
			gchar* content = NULL;
			gchar* _tmp19_;
			const gchar* _tmp20_;
#line 196 "pastebin-plugin.vala"
			text_match = G_TYPE_CHECK_INSTANCE_CAST (match, SYNAPSE_TYPE_TEXT_MATCH, SynapseTextMatch);
#line 198 "pastebin-plugin.vala"
			_tmp13_ = text_match;
#line 198 "pastebin-plugin.vala"
			if (_tmp13_ != NULL) {
#line 2022 "pastebin-plugin.c"
				SynapseTextMatch* _tmp14_;
				gchar* _tmp15_;
#line 198 "pastebin-plugin.vala"
				_tmp14_ = text_match;
#line 198 "pastebin-plugin.vala"
				_tmp15_ = synapse_text_match_get_text (_tmp14_);
#line 198 "pastebin-plugin.vala"
				_g_free0 (_tmp12_);
#line 198 "pastebin-plugin.vala"
				_tmp12_ = _tmp15_;
#line 2033 "pastebin-plugin.c"
			} else {
				const gchar* _tmp16_;
				const gchar* _tmp17_;
				gchar* _tmp18_;
#line 198 "pastebin-plugin.vala"
				_tmp16_ = synapse_match_get_title (match);
#line 198 "pastebin-plugin.vala"
				_tmp17_ = _tmp16_;
#line 198 "pastebin-plugin.vala"
				_tmp18_ = g_strdup (_tmp17_);
#line 198 "pastebin-plugin.vala"
				_g_free0 (_tmp12_);
#line 198 "pastebin-plugin.vala"
				_tmp12_ = _tmp18_;
#line 2048 "pastebin-plugin.c"
			}
#line 198 "pastebin-plugin.vala"
			_tmp19_ = g_strdup (_tmp12_);
#line 198 "pastebin-plugin.vala"
			content = _tmp19_;
#line 199 "pastebin-plugin.vala"
			_tmp20_ = content;
#line 199 "pastebin-plugin.vala"
			synapse_pastebin_plugin_pastebin_action_pastebin_text (self, _tmp20_, _____lambda17__gasync_ready_callback, block5_data_ref (_data5_));
#line 194 "pastebin-plugin.vala"
			_g_free0 (content);
#line 194 "pastebin-plugin.vala"
			_g_free0 (_tmp12_);
#line 2062 "pastebin-plugin.c"
		}
	}
#line 176 "pastebin-plugin.vala"
	block5_data_unref (_data5_);
#line 176 "pastebin-plugin.vala"
	_data5_ = NULL;
#line 2069 "pastebin-plugin.c"
}

static gboolean
synapse_pastebin_plugin_pastebin_action_real_valid_for_match (SynapseAction* base,
                                                              SynapseMatch* match)
{
	SynapsePastebinPluginPastebinAction * self;
	SynapseUriMatch* um = NULL;
	SynapseUriMatch* _tmp0_;
	GFile* f = NULL;
	SynapseUriMatch* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GFile* _tmp4_;
	GFile* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean _tmp8_;
	SynapseUriMatch* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gboolean result;
#line 206 "pastebin-plugin.vala"
	self = (SynapsePastebinPluginPastebinAction*) base;
#line 206 "pastebin-plugin.vala"
	g_return_val_if_fail (match != NULL, FALSE);
#line 208 "pastebin-plugin.vala"
	if (G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_TEXT_MATCH)) {
#line 209 "pastebin-plugin.vala"
		result = TRUE;
#line 209 "pastebin-plugin.vala"
		return result;
#line 2102 "pastebin-plugin.c"
	}
#line 211 "pastebin-plugin.vala"
	um = G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_URI_MATCH) ? ((SynapseUriMatch*) match) : NULL;
#line 212 "pastebin-plugin.vala"
	_tmp0_ = um;
#line 212 "pastebin-plugin.vala"
	if (_tmp0_ == NULL) {
#line 213 "pastebin-plugin.vala"
		result = FALSE;
#line 213 "pastebin-plugin.vala"
		return result;
#line 2114 "pastebin-plugin.c"
	}
#line 215 "pastebin-plugin.vala"
	_tmp1_ = um;
#line 215 "pastebin-plugin.vala"
	_tmp2_ = synapse_uri_match_get_uri (_tmp1_);
#line 215 "pastebin-plugin.vala"
	_tmp3_ = _tmp2_;
#line 215 "pastebin-plugin.vala"
	_tmp4_ = g_file_new_for_uri (_tmp3_);
#line 215 "pastebin-plugin.vala"
	f = _tmp4_;
#line 216 "pastebin-plugin.vala"
	_tmp5_ = f;
#line 216 "pastebin-plugin.vala"
	_tmp6_ = g_file_get_path (_tmp5_);
#line 216 "pastebin-plugin.vala"
	_tmp7_ = _tmp6_;
#line 216 "pastebin-plugin.vala"
	_tmp8_ = _tmp7_ == NULL;
#line 216 "pastebin-plugin.vala"
	_g_free0 (_tmp7_);
#line 216 "pastebin-plugin.vala"
	if (_tmp8_) {
#line 217 "pastebin-plugin.vala"
		result = FALSE;
#line 217 "pastebin-plugin.vala"
		_g_object_unref0 (f);
#line 217 "pastebin-plugin.vala"
		return result;
#line 2144 "pastebin-plugin.c"
	}
#line 219 "pastebin-plugin.vala"
	_tmp9_ = um;
#line 219 "pastebin-plugin.vala"
	_tmp10_ = synapse_uri_match_get_mime_type (_tmp9_);
#line 219 "pastebin-plugin.vala"
	_tmp11_ = _tmp10_;
#line 219 "pastebin-plugin.vala"
	result = g_content_type_is_a (_tmp11_, "text/*");
#line 219 "pastebin-plugin.vala"
	_g_object_unref0 (f);
#line 219 "pastebin-plugin.vala"
	return result;
#line 2158 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_class_init (SynapsePastebinPluginPastebinActionClass * klass,
                                                    gpointer klass_data)
{
#line 38 "pastebin-plugin.vala"
	synapse_pastebin_plugin_pastebin_action_parent_class = g_type_class_peek_parent (klass);
#line 38 "pastebin-plugin.vala"
	((SynapsePastebinPluginPastebinActionClass *) klass)->process_pastebin_result = (void (*) (SynapsePastebinPluginPastebinAction*, const gchar*, SynapseMatch*)) synapse_pastebin_plugin_pastebin_action_real_process_pastebin_result;
#line 38 "pastebin-plugin.vala"
	((SynapseActionClass *) klass)->do_execute = (void (*) (SynapseAction*, SynapseMatch*, SynapseMatch*)) synapse_pastebin_plugin_pastebin_action_real_do_execute;
#line 38 "pastebin-plugin.vala"
	((SynapseActionClass *) klass)->valid_for_match = (gboolean (*) (SynapseAction*, SynapseMatch*)) synapse_pastebin_plugin_pastebin_action_real_valid_for_match;
#line 2173 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_action_instance_init (SynapsePastebinPluginPastebinAction * self,
                                                       gpointer klass)
{
}

static GType
synapse_pastebin_plugin_pastebin_action_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapsePastebinPluginPastebinActionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_pastebin_plugin_pastebin_action_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapsePastebinPluginPastebinAction), 0, (GInstanceInitFunc) synapse_pastebin_plugin_pastebin_action_instance_init, NULL };
	GType synapse_pastebin_plugin_pastebin_action_type_id;
	synapse_pastebin_plugin_pastebin_action_type_id = g_type_register_static (SYNAPSE_TYPE_ACTION, "SynapsePastebinPluginPastebinAction", &g_define_type_info, 0);
	return synapse_pastebin_plugin_pastebin_action_type_id;
}

static GType
synapse_pastebin_plugin_pastebin_action_get_type (void)
{
	static volatile gsize synapse_pastebin_plugin_pastebin_action_type_id__once = 0;
	if (g_once_init_enter (&synapse_pastebin_plugin_pastebin_action_type_id__once)) {
		GType synapse_pastebin_plugin_pastebin_action_type_id;
		synapse_pastebin_plugin_pastebin_action_type_id = synapse_pastebin_plugin_pastebin_action_get_type_once ();
		g_once_init_leave (&synapse_pastebin_plugin_pastebin_action_type_id__once, synapse_pastebin_plugin_pastebin_action_type_id);
	}
	return synapse_pastebin_plugin_pastebin_action_type_id__once;
}

static SynapsePastebinPluginPastebinToContactAction*
synapse_pastebin_plugin_pastebin_to_contact_action_construct (GType object_type)
{
	SynapsePastebinPluginPastebinToContactAction * self = NULL;
#line 227 "pastebin-plugin.vala"
	self = (SynapsePastebinPluginPastebinToContactAction*) g_object_new (object_type, "title", _ ("Pastebin to contact.."), "description", _ ("Pastebin selection"), "icon-name", "document-send", "has-thumbnail", FALSE, "default-relevancy", SYNAPSE_MATCH_SCORE_AVERAGE, NULL);
#line 225 "pastebin-plugin.vala"
	return self;
#line 2211 "pastebin-plugin.c"
}

static SynapsePastebinPluginPastebinToContactAction*
synapse_pastebin_plugin_pastebin_to_contact_action_new (void)
{
#line 225 "pastebin-plugin.vala"
	return synapse_pastebin_plugin_pastebin_to_contact_action_construct (SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_TO_CONTACT_ACTION);
#line 2219 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_to_contact_action_real_process_pastebin_result (SynapsePastebinPluginPastebinAction* base,
                                                                                 const gchar* url,
                                                                                 SynapseMatch* target)
{
	SynapsePastebinPluginPastebinToContactAction * self;
	SynapseContactMatch* contact = NULL;
	gboolean _tmp0_ = FALSE;
	SynapseContactMatch* _tmp1_;
#line 233 "pastebin-plugin.vala"
	self = (SynapsePastebinPluginPastebinToContactAction*) base;
#line 235 "pastebin-plugin.vala"
	contact = G_TYPE_CHECK_INSTANCE_TYPE (target, SYNAPSE_TYPE_CONTACT_MATCH) ? ((SynapseContactMatch*) target) : NULL;
#line 236 "pastebin-plugin.vala"
	_tmp1_ = contact;
#line 236 "pastebin-plugin.vala"
	if (_tmp1_ == NULL) {
#line 236 "pastebin-plugin.vala"
		_tmp0_ = TRUE;
#line 2241 "pastebin-plugin.c"
	} else {
#line 236 "pastebin-plugin.vala"
		_tmp0_ = url == NULL;
#line 2245 "pastebin-plugin.c"
	}
#line 236 "pastebin-plugin.vala"
	if (_tmp0_) {
#line 238 "pastebin-plugin.vala"
		SYNAPSE_PASTEBIN_PLUGIN_PASTEBIN_ACTION_CLASS (synapse_pastebin_plugin_pastebin_to_contact_action_parent_class)->process_pastebin_result (G_TYPE_CHECK_INSTANCE_CAST (self, SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION, SynapsePastebinPluginPastebinAction), url, NULL);
#line 2251 "pastebin-plugin.c"
	} else {
		SynapseContactMatch* _tmp2_;
#line 242 "pastebin-plugin.vala"
		_tmp2_ = contact;
#line 242 "pastebin-plugin.vala"
		synapse_contact_match_send_message (_tmp2_, url, TRUE);
#line 2258 "pastebin-plugin.c"
	}
}

static gboolean
synapse_pastebin_plugin_pastebin_to_contact_action_real_needs_target (SynapseMatch* base)
{
	SynapsePastebinPluginPastebinToContactAction * self;
	gboolean result;
#line 246 "pastebin-plugin.vala"
	self = (SynapsePastebinPluginPastebinToContactAction*) base;
#line 248 "pastebin-plugin.vala"
	result = TRUE;
#line 248 "pastebin-plugin.vala"
	return result;
#line 2273 "pastebin-plugin.c"
}

static SynapseQueryFlags
synapse_pastebin_plugin_pastebin_to_contact_action_real_target_flags (SynapseMatch* base)
{
	SynapsePastebinPluginPastebinToContactAction * self;
	SynapseQueryFlags result;
#line 251 "pastebin-plugin.vala"
	self = (SynapsePastebinPluginPastebinToContactAction*) base;
#line 253 "pastebin-plugin.vala"
	result = SYNAPSE_QUERY_FLAGS_CONTACTS;
#line 253 "pastebin-plugin.vala"
	return result;
#line 2287 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_to_contact_action_class_init (SynapsePastebinPluginPastebinToContactActionClass * klass,
                                                               gpointer klass_data)
{
#line 223 "pastebin-plugin.vala"
	synapse_pastebin_plugin_pastebin_to_contact_action_parent_class = g_type_class_peek_parent (klass);
#line 223 "pastebin-plugin.vala"
	((SynapsePastebinPluginPastebinActionClass *) klass)->process_pastebin_result = (void (*) (SynapsePastebinPluginPastebinAction*, const gchar*, SynapseMatch*)) synapse_pastebin_plugin_pastebin_to_contact_action_real_process_pastebin_result;
#line 223 "pastebin-plugin.vala"
	((SynapseMatchClass *) klass)->needs_target = (gboolean (*) (SynapseMatch*)) synapse_pastebin_plugin_pastebin_to_contact_action_real_needs_target;
#line 223 "pastebin-plugin.vala"
	((SynapseMatchClass *) klass)->target_flags = (SynapseQueryFlags (*) (SynapseMatch*)) synapse_pastebin_plugin_pastebin_to_contact_action_real_target_flags;
#line 2302 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_pastebin_to_contact_action_instance_init (SynapsePastebinPluginPastebinToContactAction * self,
                                                                  gpointer klass)
{
}

static GType
synapse_pastebin_plugin_pastebin_to_contact_action_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapsePastebinPluginPastebinToContactActionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_pastebin_plugin_pastebin_to_contact_action_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapsePastebinPluginPastebinToContactAction), 0, (GInstanceInitFunc) synapse_pastebin_plugin_pastebin_to_contact_action_instance_init, NULL };
	GType synapse_pastebin_plugin_pastebin_to_contact_action_type_id;
	synapse_pastebin_plugin_pastebin_to_contact_action_type_id = g_type_register_static (SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION, "SynapsePastebinPluginPastebinToContactAction", &g_define_type_info, 0);
	return synapse_pastebin_plugin_pastebin_to_contact_action_type_id;
}

static GType
synapse_pastebin_plugin_pastebin_to_contact_action_get_type (void)
{
	static volatile gsize synapse_pastebin_plugin_pastebin_to_contact_action_type_id__once = 0;
	if (g_once_init_enter (&synapse_pastebin_plugin_pastebin_to_contact_action_type_id__once)) {
		GType synapse_pastebin_plugin_pastebin_to_contact_action_type_id;
		synapse_pastebin_plugin_pastebin_to_contact_action_type_id = synapse_pastebin_plugin_pastebin_to_contact_action_get_type_once ();
		g_once_init_leave (&synapse_pastebin_plugin_pastebin_to_contact_action_type_id__once, synapse_pastebin_plugin_pastebin_to_contact_action_type_id);
	}
	return synapse_pastebin_plugin_pastebin_to_contact_action_type_id__once;
}

static GObject *
synapse_pastebin_plugin_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SynapsePastebinPlugin * self;
	GeeArrayList* _tmp0_;
	GeeList* _tmp1_;
	SynapsePastebinPluginPastebinAction* _tmp2_;
	SynapsePastebinPluginPastebinAction* _tmp3_;
#line 277 "pastebin-plugin.vala"
	parent_class = G_OBJECT_CLASS (synapse_pastebin_plugin_parent_class);
#line 277 "pastebin-plugin.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 277 "pastebin-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_PASTEBIN_PLUGIN, SynapsePastebinPlugin);
#line 279 "pastebin-plugin.vala"
	_tmp0_ = gee_array_list_new (SYNAPSE_PASTEBIN_PLUGIN_TYPE_PASTEBIN_ACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 279 "pastebin-plugin.vala"
	_g_object_unref0 (self->priv->actions);
#line 279 "pastebin-plugin.vala"
	self->priv->actions = (GeeList*) _tmp0_;
#line 280 "pastebin-plugin.vala"
	_tmp1_ = self->priv->actions;
#line 280 "pastebin-plugin.vala"
	_tmp2_ = synapse_pastebin_plugin_pastebin_action_new ();
#line 280 "pastebin-plugin.vala"
	_tmp3_ = _tmp2_;
#line 280 "pastebin-plugin.vala"
	gee_collection_add ((GeeCollection*) _tmp1_, _tmp3_);
#line 280 "pastebin-plugin.vala"
	_g_object_unref0 (_tmp3_);
#line 277 "pastebin-plugin.vala"
	return obj;
#line 2368 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_class_init (SynapsePastebinPluginClass * klass,
                                    gpointer klass_data)
{
#line 24 "pastebin-plugin.vala"
	synapse_pastebin_plugin_parent_class = g_type_class_peek_parent (klass);
#line 24 "pastebin-plugin.vala"
	g_type_class_adjust_private_offset (klass, &SynapsePastebinPlugin_private_offset);
#line 24 "pastebin-plugin.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_synapse_pastebin_plugin_get_property;
#line 24 "pastebin-plugin.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_synapse_pastebin_plugin_set_property;
#line 24 "pastebin-plugin.vala"
	G_OBJECT_CLASS (klass)->constructor = synapse_pastebin_plugin_constructor;
#line 24 "pastebin-plugin.vala"
	G_OBJECT_CLASS (klass)->finalize = synapse_pastebin_plugin_finalize;
#line 24 "pastebin-plugin.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_PASTEBIN_PLUGIN_ENABLED_PROPERTY, synapse_pastebin_plugin_properties[SYNAPSE_PASTEBIN_PLUGIN_ENABLED_PROPERTY] = g_param_spec_boolean ("enabled", "enabled", "enabled", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 272 "pastebin-plugin.vala"
	synapse_pastebin_plugin_register_plugin ();
#line 2391 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_synapse_activatable_interface_init (SynapseActivatableIface * iface,
                                                            gpointer iface_data)
{
#line 38 "pastebin-plugin.vala"
	synapse_pastebin_plugin_synapse_activatable_parent_iface = g_type_interface_peek_parent (iface);
#line 38 "pastebin-plugin.vala"
	iface->activate = (void (*) (SynapseActivatable*)) synapse_pastebin_plugin_real_activate;
#line 38 "pastebin-plugin.vala"
	iface->deactivate = (void (*) (SynapseActivatable*)) synapse_pastebin_plugin_real_deactivate;
#line 38 "pastebin-plugin.vala"
	iface->get_enabled = synapse_pastebin_plugin_real_get_enabled;
#line 38 "pastebin-plugin.vala"
	iface->set_enabled = synapse_pastebin_plugin_real_set_enabled;
#line 2408 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_synapse_action_provider_interface_init (SynapseActionProviderIface * iface,
                                                                gpointer iface_data)
{
#line 38 "pastebin-plugin.vala"
	synapse_pastebin_plugin_synapse_action_provider_parent_iface = g_type_interface_peek_parent (iface);
#line 38 "pastebin-plugin.vala"
	iface->find_for_match = (SynapseResultSet* (*) (SynapseActionProvider*, SynapseQuery*, SynapseMatch*)) synapse_pastebin_plugin_real_find_for_match;
#line 2419 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_instance_init (SynapsePastebinPlugin * self,
                                       gpointer klass)
{
#line 24 "pastebin-plugin.vala"
	self->priv = synapse_pastebin_plugin_get_instance_private (self);
#line 26 "pastebin-plugin.vala"
	self->priv->_enabled = TRUE;
#line 2430 "pastebin-plugin.c"
}

static void
synapse_pastebin_plugin_finalize (GObject * obj)
{
	SynapsePastebinPlugin * self;
#line 24 "pastebin-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_PASTEBIN_PLUGIN, SynapsePastebinPlugin);
#line 275 "pastebin-plugin.vala"
	_g_object_unref0 (self->priv->actions);
#line 38 "pastebin-plugin.vala"
	G_OBJECT_CLASS (synapse_pastebin_plugin_parent_class)->finalize (obj);
#line 2443 "pastebin-plugin.c"
}

static GType
synapse_pastebin_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapsePastebinPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_pastebin_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapsePastebinPlugin), 0, (GInstanceInitFunc) synapse_pastebin_plugin_instance_init, NULL };
	static const GInterfaceInfo synapse_activatable_info = { (GInterfaceInitFunc) synapse_pastebin_plugin_synapse_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo synapse_action_provider_info = { (GInterfaceInitFunc) synapse_pastebin_plugin_synapse_action_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType synapse_pastebin_plugin_type_id;
	synapse_pastebin_plugin_type_id = g_type_register_static (G_TYPE_OBJECT, "SynapsePastebinPlugin", &g_define_type_info, 0);
	g_type_add_interface_static (synapse_pastebin_plugin_type_id, SYNAPSE_TYPE_ACTIVATABLE, &synapse_activatable_info);
	g_type_add_interface_static (synapse_pastebin_plugin_type_id, SYNAPSE_TYPE_ACTION_PROVIDER, &synapse_action_provider_info);
	SynapsePastebinPlugin_private_offset = g_type_add_instance_private (synapse_pastebin_plugin_type_id, sizeof (SynapsePastebinPluginPrivate));
	return synapse_pastebin_plugin_type_id;
}

GType
synapse_pastebin_plugin_get_type (void)
{
	static volatile gsize synapse_pastebin_plugin_type_id__once = 0;
	if (g_once_init_enter (&synapse_pastebin_plugin_type_id__once)) {
		GType synapse_pastebin_plugin_type_id;
		synapse_pastebin_plugin_type_id = synapse_pastebin_plugin_get_type_once ();
		g_once_init_leave (&synapse_pastebin_plugin_type_id__once, synapse_pastebin_plugin_type_id);
	}
	return synapse_pastebin_plugin_type_id__once;
}

static void
_vala_synapse_pastebin_plugin_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	SynapsePastebinPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_TYPE_PASTEBIN_PLUGIN, SynapsePastebinPlugin);
#line 24 "pastebin-plugin.vala"
	switch (property_id) {
#line 24 "pastebin-plugin.vala"
		case SYNAPSE_PASTEBIN_PLUGIN_ENABLED_PROPERTY:
#line 24 "pastebin-plugin.vala"
		g_value_set_boolean (value, synapse_activatable_get_enabled ((SynapseActivatable*) self));
#line 24 "pastebin-plugin.vala"
		break;
#line 2488 "pastebin-plugin.c"
		default:
#line 24 "pastebin-plugin.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 24 "pastebin-plugin.vala"
		break;
#line 2494 "pastebin-plugin.c"
	}
}

static void
_vala_synapse_pastebin_plugin_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	SynapsePastebinPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_TYPE_PASTEBIN_PLUGIN, SynapsePastebinPlugin);
#line 24 "pastebin-plugin.vala"
	switch (property_id) {
#line 24 "pastebin-plugin.vala"
		case SYNAPSE_PASTEBIN_PLUGIN_ENABLED_PROPERTY:
#line 24 "pastebin-plugin.vala"
		synapse_activatable_set_enabled ((SynapseActivatable*) self, g_value_get_boolean (value));
#line 24 "pastebin-plugin.vala"
		break;
#line 2514 "pastebin-plugin.c"
		default:
#line 24 "pastebin-plugin.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 24 "pastebin-plugin.vala"
		break;
#line 2520 "pastebin-plugin.c"
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
#line 24 "pastebin-plugin.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 2531 "pastebin-plugin.c"
		gssize i;
#line 24 "pastebin-plugin.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 24 "pastebin-plugin.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 24 "pastebin-plugin.vala"
				destroy_func (((gpointer*) array)[i]);
#line 2539 "pastebin-plugin.c"
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
#line 24 "pastebin-plugin.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 24 "pastebin-plugin.vala"
	g_free (array);
#line 2554 "pastebin-plugin.c"
}

