/* chat-actions-plugin.c generated by valac 0.56.17, the Vala compiler
 * generated from chat-actions-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 Alberto Aldegheri <albyrock87+dev@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>

#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

enum  {
	SYNAPSE_CHAT_ACTIONS_0_PROPERTY,
	SYNAPSE_CHAT_ACTIONS_ENABLED_PROPERTY,
	SYNAPSE_CHAT_ACTIONS_NUM_PROPERTIES
};
static GParamSpec* synapse_chat_actions_properties[SYNAPSE_CHAT_ACTIONS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SYNAPSE_CHAT_ACTIONS_TYPE_OPEN_CHAT (synapse_chat_actions_open_chat_get_type ())
#define SYNAPSE_CHAT_ACTIONS_OPEN_CHAT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_OPEN_CHAT, SynapseChatActionsOpenChat))
#define SYNAPSE_CHAT_ACTIONS_OPEN_CHAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_CHAT_ACTIONS_TYPE_OPEN_CHAT, SynapseChatActionsOpenChatClass))
#define SYNAPSE_CHAT_ACTIONS_IS_OPEN_CHAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_OPEN_CHAT))
#define SYNAPSE_CHAT_ACTIONS_IS_OPEN_CHAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_CHAT_ACTIONS_TYPE_OPEN_CHAT))
#define SYNAPSE_CHAT_ACTIONS_OPEN_CHAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_OPEN_CHAT, SynapseChatActionsOpenChatClass))

typedef struct _SynapseChatActionsOpenChat SynapseChatActionsOpenChat;
typedef struct _SynapseChatActionsOpenChatClass SynapseChatActionsOpenChatClass;
typedef struct _SynapseChatActionsOpenChatPrivate SynapseChatActionsOpenChatPrivate;
enum  {
	SYNAPSE_CHAT_ACTIONS_OPEN_CHAT_0_PROPERTY,
	SYNAPSE_CHAT_ACTIONS_OPEN_CHAT_NUM_PROPERTIES
};
static GParamSpec* synapse_chat_actions_open_chat_properties[SYNAPSE_CHAT_ACTIONS_OPEN_CHAT_NUM_PROPERTIES];

#define SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE (synapse_chat_actions_send_message_get_type ())
#define SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE, SynapseChatActionsSendMessage))
#define SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE, SynapseChatActionsSendMessageClass))
#define SYNAPSE_CHAT_ACTIONS_IS_SEND_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE))
#define SYNAPSE_CHAT_ACTIONS_IS_SEND_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE))
#define SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE, SynapseChatActionsSendMessageClass))

typedef struct _SynapseChatActionsSendMessage SynapseChatActionsSendMessage;
typedef struct _SynapseChatActionsSendMessageClass SynapseChatActionsSendMessageClass;
typedef struct _SynapseChatActionsSendMessagePrivate SynapseChatActionsSendMessagePrivate;
enum  {
	SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_0_PROPERTY,
	SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_NUM_PROPERTIES
};
static GParamSpec* synapse_chat_actions_send_message_properties[SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_NUM_PROPERTIES];

#define SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE_TO (synapse_chat_actions_send_message_to_get_type ())
#define SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_TO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE_TO, SynapseChatActionsSendMessageTo))
#define SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_TO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE_TO, SynapseChatActionsSendMessageToClass))
#define SYNAPSE_CHAT_ACTIONS_IS_SEND_MESSAGE_TO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE_TO))
#define SYNAPSE_CHAT_ACTIONS_IS_SEND_MESSAGE_TO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE_TO))
#define SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_TO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE_TO, SynapseChatActionsSendMessageToClass))

typedef struct _SynapseChatActionsSendMessageTo SynapseChatActionsSendMessageTo;
typedef struct _SynapseChatActionsSendMessageToClass SynapseChatActionsSendMessageToClass;
typedef struct _SynapseChatActionsSendMessageToPrivate SynapseChatActionsSendMessageToPrivate;
enum  {
	SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_TO_0_PROPERTY,
	SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_TO_NUM_PROPERTIES
};
static GParamSpec* synapse_chat_actions_send_message_to_properties[SYNAPSE_CHAT_ACTIONS_SEND_MESSAGE_TO_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

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

struct _SynapseChatActionsOpenChat {
	SynapseAction parent_instance;
	SynapseChatActionsOpenChatPrivate * priv;
};

struct _SynapseChatActionsOpenChatClass {
	SynapseActionClass parent_class;
};

struct _SynapseChatActionsSendMessage {
	SynapseAction parent_instance;
	SynapseChatActionsSendMessagePrivate * priv;
};

struct _SynapseChatActionsSendMessageClass {
	SynapseActionClass parent_class;
};

struct _SynapseChatActionsSendMessageTo {
	SynapseAction parent_instance;
	SynapseChatActionsSendMessageToPrivate * priv;
};

struct _SynapseChatActionsSendMessageToClass {
	SynapseActionClass parent_class;
};

static gint SynapseChatActions_private_offset;
static gpointer synapse_chat_actions_parent_class = NULL;
static gpointer synapse_chat_actions_open_chat_parent_class = NULL;
static gpointer synapse_chat_actions_send_message_parent_class = NULL;
static gpointer synapse_chat_actions_send_message_to_parent_class = NULL;
static SynapseActivatableIface * synapse_chat_actions_synapse_activatable_parent_iface = NULL;
static SynapseActionProviderIface * synapse_chat_actions_synapse_action_provider_parent_iface = NULL;

static void synapse_chat_actions_real_activate (SynapseActivatable* base);
static void synapse_chat_actions_real_deactivate (SynapseActivatable* base);
static void synapse_chat_actions_register_plugin (void);
static void _synapse_chat_actions_register_plugin_synapse_plugin_register_func (void);
static SynapseResultSet* synapse_chat_actions_real_find_for_match (SynapseActionProvider* base,
                                                            SynapseQuery* query,
                                                            SynapseMatch* match);
static GType synapse_chat_actions_open_chat_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SynapseChatActionsOpenChat* synapse_chat_actions_open_chat_new (void);
static SynapseChatActionsOpenChat* synapse_chat_actions_open_chat_construct (GType object_type);
static void synapse_chat_actions_open_chat_real_do_execute (SynapseAction* base,
                                                     SynapseMatch* match,
                                                     SynapseMatch* target);
static gboolean synapse_chat_actions_open_chat_real_valid_for_match (SynapseAction* base,
                                                              SynapseMatch* match);
static GType synapse_chat_actions_open_chat_get_type_once (void);
static GType synapse_chat_actions_send_message_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SynapseChatActionsSendMessage* synapse_chat_actions_send_message_new (void);
static SynapseChatActionsSendMessage* synapse_chat_actions_send_message_construct (GType object_type);
static void synapse_chat_actions_send_message_real_do_execute (SynapseAction* base,
                                                        SynapseMatch* match,
                                                        SynapseMatch* target);
static gboolean synapse_chat_actions_send_message_real_valid_for_match (SynapseAction* base,
                                                                 SynapseMatch* match);
static gboolean synapse_chat_actions_send_message_real_needs_target (SynapseMatch* base);
static SynapseQueryFlags synapse_chat_actions_send_message_real_target_flags (SynapseMatch* base);
static GType synapse_chat_actions_send_message_get_type_once (void);
static GType synapse_chat_actions_send_message_to_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SynapseChatActionsSendMessageTo* synapse_chat_actions_send_message_to_new (void);
static SynapseChatActionsSendMessageTo* synapse_chat_actions_send_message_to_construct (GType object_type);
static void synapse_chat_actions_send_message_to_real_do_execute (SynapseAction* base,
                                                           SynapseMatch* match,
                                                           SynapseMatch* target);
static gboolean synapse_chat_actions_send_message_to_real_valid_for_match (SynapseAction* base,
                                                                    SynapseMatch* match);
static gboolean synapse_chat_actions_send_message_to_real_needs_target (SynapseMatch* base);
static SynapseQueryFlags synapse_chat_actions_send_message_to_real_target_flags (SynapseMatch* base);
static GType synapse_chat_actions_send_message_to_get_type_once (void);
static GObject * synapse_chat_actions_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static void synapse_chat_actions_finalize (GObject * obj);
static GType synapse_chat_actions_get_type_once (void);
static void _vala_synapse_chat_actions_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_synapse_chat_actions_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);

static inline gpointer
synapse_chat_actions_get_instance_private (SynapseChatActions* self)
{
	return G_STRUCT_MEMBER_P (self, SynapseChatActions_private_offset);
}

static void
synapse_chat_actions_real_activate (SynapseActivatable* base)
{
	SynapseChatActions * self;
#line 28 "chat-actions-plugin.vala"
	self = (SynapseChatActions*) base;
#line 205 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_real_deactivate (SynapseActivatable* base)
{
	SynapseChatActions * self;
#line 33 "chat-actions-plugin.vala"
	self = (SynapseChatActions*) base;
#line 214 "chat-actions-plugin.c"
}

static void
_synapse_chat_actions_register_plugin_synapse_plugin_register_func (void)
{
#line 132 "chat-actions-plugin.vala"
	synapse_chat_actions_register_plugin ();
#line 222 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_register_plugin (void)
{
	SynapsePluginRegistry* _tmp0_;
	SynapsePluginRegistry* _tmp1_;
#line 132 "chat-actions-plugin.vala"
	_tmp0_ = synapse_plugin_registry_get_default ();
#line 132 "chat-actions-plugin.vala"
	_tmp1_ = _tmp0_;
#line 132 "chat-actions-plugin.vala"
	synapse_plugin_registry_register_plugin (_tmp1_, SYNAPSE_TYPE_CHAT_ACTIONS, _ ("Chat actions"), _ ("Open chat, or send a message with your favorite IM"), "empathy", _synapse_chat_actions_register_plugin_synapse_plugin_register_func, TRUE, "");
#line 132 "chat-actions-plugin.vala"
	_g_object_unref0 (_tmp1_);
#line 238 "chat-actions-plugin.c"
}

static SynapseResultSet*
synapse_chat_actions_real_find_for_match (SynapseActionProvider* base,
                                          SynapseQuery* query,
                                          SynapseMatch* match)
{
	SynapseChatActions * self;
	gboolean query_empty = FALSE;
	SynapseQuery _tmp0_;
	const gchar* _tmp1_;
	SynapseResultSet* results = NULL;
	SynapseResultSet* _tmp2_;
	SynapseResultSet* result;
#line 157 "chat-actions-plugin.vala"
	self = (SynapseChatActions*) base;
#line 157 "chat-actions-plugin.vala"
	g_return_val_if_fail (query != NULL, NULL);
#line 157 "chat-actions-plugin.vala"
	g_return_val_if_fail (match != NULL, NULL);
#line 159 "chat-actions-plugin.vala"
	_tmp0_ = *query;
#line 159 "chat-actions-plugin.vala"
	_tmp1_ = _tmp0_.query_string;
#line 159 "chat-actions-plugin.vala"
	query_empty = g_strcmp0 (_tmp1_, "") == 0;
#line 160 "chat-actions-plugin.vala"
	_tmp2_ = synapse_result_set_new ();
#line 160 "chat-actions-plugin.vala"
	results = _tmp2_;
#line 162 "chat-actions-plugin.vala"
	if (query_empty) {
#line 271 "chat-actions-plugin.c"
		{
			GeeList* _action_list = NULL;
			GeeList* _tmp3_;
			gint _action_size = 0;
			GeeList* _tmp4_;
			gint _tmp5_;
			gint _tmp6_;
			gint _action_index = 0;
#line 164 "chat-actions-plugin.vala"
			_tmp3_ = self->priv->actions;
#line 164 "chat-actions-plugin.vala"
			_action_list = _tmp3_;
#line 164 "chat-actions-plugin.vala"
			_tmp4_ = _action_list;
#line 164 "chat-actions-plugin.vala"
			_tmp5_ = gee_collection_get_size ((GeeCollection*) _tmp4_);
#line 164 "chat-actions-plugin.vala"
			_tmp6_ = _tmp5_;
#line 164 "chat-actions-plugin.vala"
			_action_size = _tmp6_;
#line 164 "chat-actions-plugin.vala"
			_action_index = -1;
#line 164 "chat-actions-plugin.vala"
			while (TRUE) {
#line 296 "chat-actions-plugin.c"
				gint _tmp7_;
				gint _tmp8_;
				SynapseAction* action = NULL;
				GeeList* _tmp9_;
				gpointer _tmp10_;
				SynapseAction* _tmp11_;
				SynapseResultSet* _tmp12_;
				SynapseAction* _tmp13_;
				SynapseAction* _tmp14_;
				gint _tmp15_;
				gint _tmp16_;
#line 164 "chat-actions-plugin.vala"
				_action_index = _action_index + 1;
#line 164 "chat-actions-plugin.vala"
				_tmp7_ = _action_index;
#line 164 "chat-actions-plugin.vala"
				_tmp8_ = _action_size;
#line 164 "chat-actions-plugin.vala"
				if (!(_tmp7_ < _tmp8_)) {
#line 164 "chat-actions-plugin.vala"
					break;
#line 318 "chat-actions-plugin.c"
				}
#line 164 "chat-actions-plugin.vala"
				_tmp9_ = _action_list;
#line 164 "chat-actions-plugin.vala"
				_tmp10_ = gee_list_get (_tmp9_, _action_index);
#line 164 "chat-actions-plugin.vala"
				action = (SynapseAction*) _tmp10_;
#line 166 "chat-actions-plugin.vala"
				_tmp11_ = action;
#line 166 "chat-actions-plugin.vala"
				if (!synapse_action_valid_for_match (_tmp11_, match)) {
#line 166 "chat-actions-plugin.vala"
					_g_object_unref0 (action);
#line 166 "chat-actions-plugin.vala"
					continue;
#line 334 "chat-actions-plugin.c"
				}
#line 167 "chat-actions-plugin.vala"
				_tmp12_ = results;
#line 167 "chat-actions-plugin.vala"
				_tmp13_ = action;
#line 167 "chat-actions-plugin.vala"
				_tmp14_ = action;
#line 167 "chat-actions-plugin.vala"
				_tmp15_ = synapse_action_get_default_relevancy (_tmp14_);
#line 167 "chat-actions-plugin.vala"
				_tmp16_ = _tmp15_;
#line 167 "chat-actions-plugin.vala"
				synapse_result_set_add (_tmp12_, (SynapseMatch*) _tmp13_, _tmp16_);
#line 164 "chat-actions-plugin.vala"
				_g_object_unref0 (action);
#line 350 "chat-actions-plugin.c"
			}
		}
	} else {
		GeeList* matchers = NULL;
		SynapseQuery _tmp17_;
		const gchar* _tmp18_;
		GeeList* _tmp19_;
#line 172 "chat-actions-plugin.vala"
		_tmp17_ = *query;
#line 172 "chat-actions-plugin.vala"
		_tmp18_ = _tmp17_.query_string;
#line 172 "chat-actions-plugin.vala"
		_tmp19_ = synapse_query_get_matchers_for_query (_tmp18_, 0, G_REGEX_OPTIMIZE | G_REGEX_CASELESS);
#line 172 "chat-actions-plugin.vala"
		matchers = _tmp19_;
#line 366 "chat-actions-plugin.c"
		{
			GeeList* _action_list = NULL;
			GeeList* _tmp20_;
			gint _action_size = 0;
			GeeList* _tmp21_;
			gint _tmp22_;
			gint _tmp23_;
			gint _action_index = 0;
#line 174 "chat-actions-plugin.vala"
			_tmp20_ = self->priv->actions;
#line 174 "chat-actions-plugin.vala"
			_action_list = _tmp20_;
#line 174 "chat-actions-plugin.vala"
			_tmp21_ = _action_list;
#line 174 "chat-actions-plugin.vala"
			_tmp22_ = gee_collection_get_size ((GeeCollection*) _tmp21_);
#line 174 "chat-actions-plugin.vala"
			_tmp23_ = _tmp22_;
#line 174 "chat-actions-plugin.vala"
			_action_size = _tmp23_;
#line 174 "chat-actions-plugin.vala"
			_action_index = -1;
#line 174 "chat-actions-plugin.vala"
			while (TRUE) {
#line 391 "chat-actions-plugin.c"
				gint _tmp24_;
				gint _tmp25_;
				SynapseAction* action = NULL;
				GeeList* _tmp26_;
				gpointer _tmp27_;
				SynapseAction* _tmp28_;
#line 174 "chat-actions-plugin.vala"
				_action_index = _action_index + 1;
#line 174 "chat-actions-plugin.vala"
				_tmp24_ = _action_index;
#line 174 "chat-actions-plugin.vala"
				_tmp25_ = _action_size;
#line 174 "chat-actions-plugin.vala"
				if (!(_tmp24_ < _tmp25_)) {
#line 174 "chat-actions-plugin.vala"
					break;
#line 408 "chat-actions-plugin.c"
				}
#line 174 "chat-actions-plugin.vala"
				_tmp26_ = _action_list;
#line 174 "chat-actions-plugin.vala"
				_tmp27_ = gee_list_get (_tmp26_, _action_index);
#line 174 "chat-actions-plugin.vala"
				action = (SynapseAction*) _tmp27_;
#line 176 "chat-actions-plugin.vala"
				_tmp28_ = action;
#line 176 "chat-actions-plugin.vala"
				if (!synapse_action_valid_for_match (_tmp28_, match)) {
#line 176 "chat-actions-plugin.vala"
					_g_object_unref0 (action);
#line 176 "chat-actions-plugin.vala"
					continue;
#line 424 "chat-actions-plugin.c"
				}
				{
					GeeList* _matcher_list = NULL;
					GeeList* _tmp29_;
					gint _matcher_size = 0;
					GeeList* _tmp30_;
					gint _tmp31_;
					gint _tmp32_;
					gint _matcher_index = 0;
#line 177 "chat-actions-plugin.vala"
					_tmp29_ = matchers;
#line 177 "chat-actions-plugin.vala"
					_matcher_list = _tmp29_;
#line 177 "chat-actions-plugin.vala"
					_tmp30_ = _matcher_list;
#line 177 "chat-actions-plugin.vala"
					_tmp31_ = gee_collection_get_size ((GeeCollection*) _tmp30_);
#line 177 "chat-actions-plugin.vala"
					_tmp32_ = _tmp31_;
#line 177 "chat-actions-plugin.vala"
					_matcher_size = _tmp32_;
#line 177 "chat-actions-plugin.vala"
					_matcher_index = -1;
#line 177 "chat-actions-plugin.vala"
					while (TRUE) {
#line 450 "chat-actions-plugin.c"
						gint _tmp33_;
						gint _tmp34_;
						GeeMapEntry* matcher = NULL;
						GeeList* _tmp35_;
						gpointer _tmp36_;
						GeeMapEntry* _tmp37_;
						gconstpointer _tmp38_;
						gconstpointer _tmp39_;
						SynapseAction* _tmp40_;
						const gchar* _tmp41_;
						const gchar* _tmp42_;
#line 177 "chat-actions-plugin.vala"
						_matcher_index = _matcher_index + 1;
#line 177 "chat-actions-plugin.vala"
						_tmp33_ = _matcher_index;
#line 177 "chat-actions-plugin.vala"
						_tmp34_ = _matcher_size;
#line 177 "chat-actions-plugin.vala"
						if (!(_tmp33_ < _tmp34_)) {
#line 177 "chat-actions-plugin.vala"
							break;
#line 472 "chat-actions-plugin.c"
						}
#line 177 "chat-actions-plugin.vala"
						_tmp35_ = _matcher_list;
#line 177 "chat-actions-plugin.vala"
						_tmp36_ = gee_list_get (_tmp35_, _matcher_index);
#line 177 "chat-actions-plugin.vala"
						matcher = (GeeMapEntry*) _tmp36_;
#line 179 "chat-actions-plugin.vala"
						_tmp37_ = matcher;
#line 179 "chat-actions-plugin.vala"
						_tmp38_ = gee_map_entry_get_key (_tmp37_);
#line 179 "chat-actions-plugin.vala"
						_tmp39_ = _tmp38_;
#line 179 "chat-actions-plugin.vala"
						_tmp40_ = action;
#line 179 "chat-actions-plugin.vala"
						_tmp41_ = synapse_match_get_title ((SynapseMatch*) _tmp40_);
#line 179 "chat-actions-plugin.vala"
						_tmp42_ = _tmp41_;
#line 179 "chat-actions-plugin.vala"
						if (g_regex_match ((GRegex*) _tmp39_, _tmp42_, 0, NULL)) {
#line 494 "chat-actions-plugin.c"
							SynapseResultSet* _tmp43_;
							SynapseAction* _tmp44_;
							GeeMapEntry* _tmp45_;
							gconstpointer _tmp46_;
							gconstpointer _tmp47_;
#line 181 "chat-actions-plugin.vala"
							_tmp43_ = results;
#line 181 "chat-actions-plugin.vala"
							_tmp44_ = action;
#line 181 "chat-actions-plugin.vala"
							_tmp45_ = matcher;
#line 181 "chat-actions-plugin.vala"
							_tmp46_ = gee_map_entry_get_value (_tmp45_);
#line 181 "chat-actions-plugin.vala"
							_tmp47_ = _tmp46_;
#line 181 "chat-actions-plugin.vala"
							synapse_result_set_add (_tmp43_, (SynapseMatch*) _tmp44_, (gint) ((gintptr) _tmp47_));
#line 182 "chat-actions-plugin.vala"
							_g_object_unref0 (matcher);
#line 182 "chat-actions-plugin.vala"
							break;
#line 516 "chat-actions-plugin.c"
						}
#line 177 "chat-actions-plugin.vala"
						_g_object_unref0 (matcher);
#line 520 "chat-actions-plugin.c"
					}
				}
#line 174 "chat-actions-plugin.vala"
				_g_object_unref0 (action);
#line 525 "chat-actions-plugin.c"
			}
		}
#line 162 "chat-actions-plugin.vala"
		_g_object_unref0 (matchers);
#line 530 "chat-actions-plugin.c"
	}
#line 188 "chat-actions-plugin.vala"
	result = results;
#line 188 "chat-actions-plugin.vala"
	return result;
#line 536 "chat-actions-plugin.c"
}

SynapseChatActions*
synapse_chat_actions_construct (GType object_type)
{
	SynapseChatActions * self = NULL;
#line 24 "chat-actions-plugin.vala"
	self = (SynapseChatActions*) g_object_new (object_type, NULL);
#line 24 "chat-actions-plugin.vala"
	return self;
#line 547 "chat-actions-plugin.c"
}

SynapseChatActions*
synapse_chat_actions_new (void)
{
#line 24 "chat-actions-plugin.vala"
	return synapse_chat_actions_construct (SYNAPSE_TYPE_CHAT_ACTIONS);
#line 555 "chat-actions-plugin.c"
}

static gboolean
synapse_chat_actions_real_get_enabled (SynapseActivatable* base)
{
	gboolean result;
	SynapseChatActions* self;
#line 26 "chat-actions-plugin.vala"
	self = (SynapseChatActions*) base;
#line 26 "chat-actions-plugin.vala"
	result = self->priv->_enabled;
#line 26 "chat-actions-plugin.vala"
	return result;
#line 569 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_real_set_enabled (SynapseActivatable* base,
                                       gboolean value)
{
	SynapseChatActions* self;
	gboolean old_value;
#line 26 "chat-actions-plugin.vala"
	self = (SynapseChatActions*) base;
#line 26 "chat-actions-plugin.vala"
	old_value = synapse_chat_actions_real_get_enabled (base);
#line 26 "chat-actions-plugin.vala"
	if (old_value != value) {
#line 26 "chat-actions-plugin.vala"
		self->priv->_enabled = value;
#line 26 "chat-actions-plugin.vala"
		g_object_notify_by_pspec ((GObject *) self, synapse_chat_actions_properties[SYNAPSE_CHAT_ACTIONS_ENABLED_PROPERTY]);
#line 588 "chat-actions-plugin.c"
	}
}

static SynapseChatActionsOpenChat*
synapse_chat_actions_open_chat_construct (GType object_type)
{
	SynapseChatActionsOpenChat * self = NULL;
#line 42 "chat-actions-plugin.vala"
	self = (SynapseChatActionsOpenChat*) g_object_new (object_type, "title", _ ("Open chat"), "description", _ ("Open a chat with selected contact"), "icon-name", "empathy", "has-thumbnail", FALSE, "default-relevancy", SYNAPSE_MATCH_SCORE_EXCELLENT, NULL);
#line 40 "chat-actions-plugin.vala"
	return self;
#line 600 "chat-actions-plugin.c"
}

static SynapseChatActionsOpenChat*
synapse_chat_actions_open_chat_new (void)
{
#line 40 "chat-actions-plugin.vala"
	return synapse_chat_actions_open_chat_construct (SYNAPSE_CHAT_ACTIONS_TYPE_OPEN_CHAT);
#line 608 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_open_chat_real_do_execute (SynapseAction* base,
                                                SynapseMatch* match,
                                                SynapseMatch* target)
{
	SynapseChatActionsOpenChat * self;
	SynapseContactMatch* cm = NULL;
	SynapseContactMatch* _tmp0_;
#line 48 "chat-actions-plugin.vala"
	self = (SynapseChatActionsOpenChat*) base;
#line 48 "chat-actions-plugin.vala"
	g_return_if_fail (match != NULL);
#line 50 "chat-actions-plugin.vala"
	cm = G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_CONTACT_MATCH) ? ((SynapseContactMatch*) match) : NULL;
#line 51 "chat-actions-plugin.vala"
	if (match == NULL) {
#line 51 "chat-actions-plugin.vala"
		return;
#line 629 "chat-actions-plugin.c"
	}
#line 52 "chat-actions-plugin.vala"
	_tmp0_ = cm;
#line 52 "chat-actions-plugin.vala"
	synapse_contact_match_open_chat (_tmp0_);
#line 635 "chat-actions-plugin.c"
}

static gboolean
synapse_chat_actions_open_chat_real_valid_for_match (SynapseAction* base,
                                                     SynapseMatch* match)
{
	SynapseChatActionsOpenChat * self;
	gboolean result;
#line 55 "chat-actions-plugin.vala"
	self = (SynapseChatActionsOpenChat*) base;
#line 55 "chat-actions-plugin.vala"
	g_return_val_if_fail (match != NULL, FALSE);
#line 57 "chat-actions-plugin.vala"
	result = G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_CONTACT_MATCH);
#line 57 "chat-actions-plugin.vala"
	return result;
#line 652 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_open_chat_class_init (SynapseChatActionsOpenChatClass * klass,
                                           gpointer klass_data)
{
#line 38 "chat-actions-plugin.vala"
	synapse_chat_actions_open_chat_parent_class = g_type_class_peek_parent (klass);
#line 38 "chat-actions-plugin.vala"
	((SynapseActionClass *) klass)->do_execute = (void (*) (SynapseAction*, SynapseMatch*, SynapseMatch*)) synapse_chat_actions_open_chat_real_do_execute;
#line 38 "chat-actions-plugin.vala"
	((SynapseActionClass *) klass)->valid_for_match = (gboolean (*) (SynapseAction*, SynapseMatch*)) synapse_chat_actions_open_chat_real_valid_for_match;
#line 665 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_open_chat_instance_init (SynapseChatActionsOpenChat * self,
                                              gpointer klass)
{
}

static GType
synapse_chat_actions_open_chat_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseChatActionsOpenChatClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_chat_actions_open_chat_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseChatActionsOpenChat), 0, (GInstanceInitFunc) synapse_chat_actions_open_chat_instance_init, NULL };
	GType synapse_chat_actions_open_chat_type_id;
	synapse_chat_actions_open_chat_type_id = g_type_register_static (SYNAPSE_TYPE_ACTION, "SynapseChatActionsOpenChat", &g_define_type_info, 0);
	return synapse_chat_actions_open_chat_type_id;
}

static GType
synapse_chat_actions_open_chat_get_type (void)
{
	static volatile gsize synapse_chat_actions_open_chat_type_id__once = 0;
	if (g_once_init_enter (&synapse_chat_actions_open_chat_type_id__once)) {
		GType synapse_chat_actions_open_chat_type_id;
		synapse_chat_actions_open_chat_type_id = synapse_chat_actions_open_chat_get_type_once ();
		g_once_init_leave (&synapse_chat_actions_open_chat_type_id__once, synapse_chat_actions_open_chat_type_id);
	}
	return synapse_chat_actions_open_chat_type_id__once;
}

static SynapseChatActionsSendMessage*
synapse_chat_actions_send_message_construct (GType object_type)
{
	SynapseChatActionsSendMessage * self = NULL;
#line 65 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessage*) g_object_new (object_type, "title", _ ("Send a message"), "description", _ ("Send a message to the contact"), "icon-name", "message", "has-thumbnail", FALSE, "default-relevancy", SYNAPSE_MATCH_SCORE_VERY_GOOD, NULL);
#line 63 "chat-actions-plugin.vala"
	return self;
#line 703 "chat-actions-plugin.c"
}

static SynapseChatActionsSendMessage*
synapse_chat_actions_send_message_new (void)
{
#line 63 "chat-actions-plugin.vala"
	return synapse_chat_actions_send_message_construct (SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE);
#line 711 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_send_message_real_do_execute (SynapseAction* base,
                                                   SynapseMatch* match,
                                                   SynapseMatch* target)
{
	SynapseChatActionsSendMessage * self;
	SynapseContactMatch* cm = NULL;
	gboolean _tmp0_ = FALSE;
	SynapseContactMatch* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
#line 71 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessage*) base;
#line 71 "chat-actions-plugin.vala"
	g_return_if_fail (match != NULL);
#line 73 "chat-actions-plugin.vala"
	cm = G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_CONTACT_MATCH) ? ((SynapseContactMatch*) match) : NULL;
#line 74 "chat-actions-plugin.vala"
	if (match == NULL) {
#line 74 "chat-actions-plugin.vala"
		_tmp0_ = TRUE;
#line 735 "chat-actions-plugin.c"
	} else {
#line 74 "chat-actions-plugin.vala"
		_tmp0_ = target == NULL;
#line 739 "chat-actions-plugin.c"
	}
#line 74 "chat-actions-plugin.vala"
	if (_tmp0_) {
#line 74 "chat-actions-plugin.vala"
		return;
#line 745 "chat-actions-plugin.c"
	}
#line 75 "chat-actions-plugin.vala"
	_tmp1_ = cm;
#line 75 "chat-actions-plugin.vala"
	_tmp2_ = synapse_match_get_title (target);
#line 75 "chat-actions-plugin.vala"
	_tmp3_ = _tmp2_;
#line 75 "chat-actions-plugin.vala"
	synapse_contact_match_send_message (_tmp1_, _tmp3_, FALSE);
#line 755 "chat-actions-plugin.c"
}

static gboolean
synapse_chat_actions_send_message_real_valid_for_match (SynapseAction* base,
                                                        SynapseMatch* match)
{
	SynapseChatActionsSendMessage * self;
	gboolean result;
#line 78 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessage*) base;
#line 78 "chat-actions-plugin.vala"
	g_return_val_if_fail (match != NULL, FALSE);
#line 80 "chat-actions-plugin.vala"
	result = G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_CONTACT_MATCH);
#line 80 "chat-actions-plugin.vala"
	return result;
#line 772 "chat-actions-plugin.c"
}

static gboolean
synapse_chat_actions_send_message_real_needs_target (SynapseMatch* base)
{
	SynapseChatActionsSendMessage * self;
	gboolean result;
#line 84 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessage*) base;
#line 86 "chat-actions-plugin.vala"
	result = TRUE;
#line 86 "chat-actions-plugin.vala"
	return result;
#line 786 "chat-actions-plugin.c"
}

static SynapseQueryFlags
synapse_chat_actions_send_message_real_target_flags (SynapseMatch* base)
{
	SynapseChatActionsSendMessage * self;
	SynapseQueryFlags result;
#line 89 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessage*) base;
#line 91 "chat-actions-plugin.vala"
	result = SYNAPSE_QUERY_FLAGS_TEXT;
#line 91 "chat-actions-plugin.vala"
	return result;
#line 800 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_send_message_class_init (SynapseChatActionsSendMessageClass * klass,
                                              gpointer klass_data)
{
#line 61 "chat-actions-plugin.vala"
	synapse_chat_actions_send_message_parent_class = g_type_class_peek_parent (klass);
#line 61 "chat-actions-plugin.vala"
	((SynapseActionClass *) klass)->do_execute = (void (*) (SynapseAction*, SynapseMatch*, SynapseMatch*)) synapse_chat_actions_send_message_real_do_execute;
#line 61 "chat-actions-plugin.vala"
	((SynapseActionClass *) klass)->valid_for_match = (gboolean (*) (SynapseAction*, SynapseMatch*)) synapse_chat_actions_send_message_real_valid_for_match;
#line 61 "chat-actions-plugin.vala"
	((SynapseMatchClass *) klass)->needs_target = (gboolean (*) (SynapseMatch*)) synapse_chat_actions_send_message_real_needs_target;
#line 61 "chat-actions-plugin.vala"
	((SynapseMatchClass *) klass)->target_flags = (SynapseQueryFlags (*) (SynapseMatch*)) synapse_chat_actions_send_message_real_target_flags;
#line 817 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_send_message_instance_init (SynapseChatActionsSendMessage * self,
                                                 gpointer klass)
{
}

static GType
synapse_chat_actions_send_message_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseChatActionsSendMessageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_chat_actions_send_message_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseChatActionsSendMessage), 0, (GInstanceInitFunc) synapse_chat_actions_send_message_instance_init, NULL };
	GType synapse_chat_actions_send_message_type_id;
	synapse_chat_actions_send_message_type_id = g_type_register_static (SYNAPSE_TYPE_ACTION, "SynapseChatActionsSendMessage", &g_define_type_info, 0);
	return synapse_chat_actions_send_message_type_id;
}

static GType
synapse_chat_actions_send_message_get_type (void)
{
	static volatile gsize synapse_chat_actions_send_message_type_id__once = 0;
	if (g_once_init_enter (&synapse_chat_actions_send_message_type_id__once)) {
		GType synapse_chat_actions_send_message_type_id;
		synapse_chat_actions_send_message_type_id = synapse_chat_actions_send_message_get_type_once ();
		g_once_init_leave (&synapse_chat_actions_send_message_type_id__once, synapse_chat_actions_send_message_type_id);
	}
	return synapse_chat_actions_send_message_type_id__once;
}

static SynapseChatActionsSendMessageTo*
synapse_chat_actions_send_message_to_construct (GType object_type)
{
	SynapseChatActionsSendMessageTo * self = NULL;
#line 99 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessageTo*) g_object_new (object_type, "title", _ ("Send message to.."), "description", _ ("Send a message to a contact"), "icon-name", "message", "has-thumbnail", FALSE, "default-relevancy", SYNAPSE_MATCH_SCORE_VERY_GOOD, NULL);
#line 97 "chat-actions-plugin.vala"
	return self;
#line 855 "chat-actions-plugin.c"
}

static SynapseChatActionsSendMessageTo*
synapse_chat_actions_send_message_to_new (void)
{
#line 97 "chat-actions-plugin.vala"
	return synapse_chat_actions_send_message_to_construct (SYNAPSE_CHAT_ACTIONS_TYPE_SEND_MESSAGE_TO);
#line 863 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_send_message_to_real_do_execute (SynapseAction* base,
                                                      SynapseMatch* match,
                                                      SynapseMatch* target)
{
	SynapseChatActionsSendMessageTo * self;
	gboolean _tmp0_ = FALSE;
	SynapseContactMatch* cm = NULL;
	SynapseTextMatch* text = NULL;
	gboolean _tmp1_ = FALSE;
	SynapseContactMatch* _tmp2_;
	SynapseContactMatch* _tmp4_;
	SynapseTextMatch* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
#line 105 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessageTo*) base;
#line 105 "chat-actions-plugin.vala"
	g_return_if_fail (match != NULL);
#line 107 "chat-actions-plugin.vala"
	if (match == NULL) {
#line 107 "chat-actions-plugin.vala"
		_tmp0_ = TRUE;
#line 889 "chat-actions-plugin.c"
	} else {
#line 107 "chat-actions-plugin.vala"
		_tmp0_ = target == NULL;
#line 893 "chat-actions-plugin.c"
	}
#line 107 "chat-actions-plugin.vala"
	if (_tmp0_) {
#line 107 "chat-actions-plugin.vala"
		return;
#line 899 "chat-actions-plugin.c"
	}
#line 108 "chat-actions-plugin.vala"
	cm = G_TYPE_CHECK_INSTANCE_TYPE (target, SYNAPSE_TYPE_CONTACT_MATCH) ? ((SynapseContactMatch*) target) : NULL;
#line 109 "chat-actions-plugin.vala"
	text = G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_TEXT_MATCH) ? ((SynapseTextMatch*) match) : NULL;
#line 110 "chat-actions-plugin.vala"
	_tmp2_ = cm;
#line 110 "chat-actions-plugin.vala"
	if (_tmp2_ == NULL) {
#line 110 "chat-actions-plugin.vala"
		_tmp1_ = TRUE;
#line 911 "chat-actions-plugin.c"
	} else {
		SynapseTextMatch* _tmp3_;
#line 110 "chat-actions-plugin.vala"
		_tmp3_ = text;
#line 110 "chat-actions-plugin.vala"
		_tmp1_ = _tmp3_ == NULL;
#line 918 "chat-actions-plugin.c"
	}
#line 110 "chat-actions-plugin.vala"
	if (_tmp1_) {
#line 110 "chat-actions-plugin.vala"
		return;
#line 924 "chat-actions-plugin.c"
	}
#line 111 "chat-actions-plugin.vala"
	_tmp4_ = cm;
#line 111 "chat-actions-plugin.vala"
	_tmp5_ = text;
#line 111 "chat-actions-plugin.vala"
	_tmp6_ = synapse_text_match_get_text (_tmp5_);
#line 111 "chat-actions-plugin.vala"
	_tmp7_ = _tmp6_;
#line 111 "chat-actions-plugin.vala"
	synapse_contact_match_send_message (_tmp4_, _tmp7_, FALSE);
#line 111 "chat-actions-plugin.vala"
	_g_free0 (_tmp7_);
#line 938 "chat-actions-plugin.c"
}

static gboolean
synapse_chat_actions_send_message_to_real_valid_for_match (SynapseAction* base,
                                                           SynapseMatch* match)
{
	SynapseChatActionsSendMessageTo * self;
	gboolean result;
#line 114 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessageTo*) base;
#line 114 "chat-actions-plugin.vala"
	g_return_val_if_fail (match != NULL, FALSE);
#line 116 "chat-actions-plugin.vala"
	result = G_TYPE_CHECK_INSTANCE_TYPE (match, SYNAPSE_TYPE_TEXT_MATCH);
#line 116 "chat-actions-plugin.vala"
	return result;
#line 955 "chat-actions-plugin.c"
}

static gboolean
synapse_chat_actions_send_message_to_real_needs_target (SynapseMatch* base)
{
	SynapseChatActionsSendMessageTo * self;
	gboolean result;
#line 119 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessageTo*) base;
#line 121 "chat-actions-plugin.vala"
	result = TRUE;
#line 121 "chat-actions-plugin.vala"
	return result;
#line 969 "chat-actions-plugin.c"
}

static SynapseQueryFlags
synapse_chat_actions_send_message_to_real_target_flags (SynapseMatch* base)
{
	SynapseChatActionsSendMessageTo * self;
	SynapseQueryFlags result;
#line 124 "chat-actions-plugin.vala"
	self = (SynapseChatActionsSendMessageTo*) base;
#line 126 "chat-actions-plugin.vala"
	result = SYNAPSE_QUERY_FLAGS_CONTACTS;
#line 126 "chat-actions-plugin.vala"
	return result;
#line 983 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_send_message_to_class_init (SynapseChatActionsSendMessageToClass * klass,
                                                 gpointer klass_data)
{
#line 95 "chat-actions-plugin.vala"
	synapse_chat_actions_send_message_to_parent_class = g_type_class_peek_parent (klass);
#line 95 "chat-actions-plugin.vala"
	((SynapseActionClass *) klass)->do_execute = (void (*) (SynapseAction*, SynapseMatch*, SynapseMatch*)) synapse_chat_actions_send_message_to_real_do_execute;
#line 95 "chat-actions-plugin.vala"
	((SynapseActionClass *) klass)->valid_for_match = (gboolean (*) (SynapseAction*, SynapseMatch*)) synapse_chat_actions_send_message_to_real_valid_for_match;
#line 95 "chat-actions-plugin.vala"
	((SynapseMatchClass *) klass)->needs_target = (gboolean (*) (SynapseMatch*)) synapse_chat_actions_send_message_to_real_needs_target;
#line 95 "chat-actions-plugin.vala"
	((SynapseMatchClass *) klass)->target_flags = (SynapseQueryFlags (*) (SynapseMatch*)) synapse_chat_actions_send_message_to_real_target_flags;
#line 1000 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_send_message_to_instance_init (SynapseChatActionsSendMessageTo * self,
                                                    gpointer klass)
{
}

static GType
synapse_chat_actions_send_message_to_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseChatActionsSendMessageToClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_chat_actions_send_message_to_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseChatActionsSendMessageTo), 0, (GInstanceInitFunc) synapse_chat_actions_send_message_to_instance_init, NULL };
	GType synapse_chat_actions_send_message_to_type_id;
	synapse_chat_actions_send_message_to_type_id = g_type_register_static (SYNAPSE_TYPE_ACTION, "SynapseChatActionsSendMessageTo", &g_define_type_info, 0);
	return synapse_chat_actions_send_message_to_type_id;
}

static GType
synapse_chat_actions_send_message_to_get_type (void)
{
	static volatile gsize synapse_chat_actions_send_message_to_type_id__once = 0;
	if (g_once_init_enter (&synapse_chat_actions_send_message_to_type_id__once)) {
		GType synapse_chat_actions_send_message_to_type_id;
		synapse_chat_actions_send_message_to_type_id = synapse_chat_actions_send_message_to_get_type_once ();
		g_once_init_leave (&synapse_chat_actions_send_message_to_type_id__once, synapse_chat_actions_send_message_to_type_id);
	}
	return synapse_chat_actions_send_message_to_type_id__once;
}

static GObject *
synapse_chat_actions_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SynapseChatActions * self;
	GeeArrayList* _tmp0_;
	GeeList* _tmp1_;
	SynapseChatActionsOpenChat* _tmp2_;
	SynapseChatActionsOpenChat* _tmp3_;
	GeeList* _tmp4_;
	SynapseChatActionsSendMessage* _tmp5_;
	SynapseChatActionsSendMessage* _tmp6_;
	GeeList* _tmp7_;
	SynapseChatActionsSendMessageTo* _tmp8_;
	SynapseChatActionsSendMessageTo* _tmp9_;
#line 148 "chat-actions-plugin.vala"
	parent_class = G_OBJECT_CLASS (synapse_chat_actions_parent_class);
#line 148 "chat-actions-plugin.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 148 "chat-actions-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_CHAT_ACTIONS, SynapseChatActions);
#line 150 "chat-actions-plugin.vala"
	_tmp0_ = gee_array_list_new (SYNAPSE_TYPE_ACTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 150 "chat-actions-plugin.vala"
	_g_object_unref0 (self->priv->actions);
#line 150 "chat-actions-plugin.vala"
	self->priv->actions = (GeeList*) _tmp0_;
#line 152 "chat-actions-plugin.vala"
	_tmp1_ = self->priv->actions;
#line 152 "chat-actions-plugin.vala"
	_tmp2_ = synapse_chat_actions_open_chat_new ();
#line 152 "chat-actions-plugin.vala"
	_tmp3_ = _tmp2_;
#line 152 "chat-actions-plugin.vala"
	gee_collection_add ((GeeCollection*) _tmp1_, (SynapseAction*) _tmp3_);
#line 152 "chat-actions-plugin.vala"
	_g_object_unref0 (_tmp3_);
#line 153 "chat-actions-plugin.vala"
	_tmp4_ = self->priv->actions;
#line 153 "chat-actions-plugin.vala"
	_tmp5_ = synapse_chat_actions_send_message_new ();
#line 153 "chat-actions-plugin.vala"
	_tmp6_ = _tmp5_;
#line 153 "chat-actions-plugin.vala"
	gee_collection_add ((GeeCollection*) _tmp4_, (SynapseAction*) _tmp6_);
#line 153 "chat-actions-plugin.vala"
	_g_object_unref0 (_tmp6_);
#line 154 "chat-actions-plugin.vala"
	_tmp7_ = self->priv->actions;
#line 154 "chat-actions-plugin.vala"
	_tmp8_ = synapse_chat_actions_send_message_to_new ();
#line 154 "chat-actions-plugin.vala"
	_tmp9_ = _tmp8_;
#line 154 "chat-actions-plugin.vala"
	gee_collection_add ((GeeCollection*) _tmp7_, (SynapseAction*) _tmp9_);
#line 154 "chat-actions-plugin.vala"
	_g_object_unref0 (_tmp9_);
#line 148 "chat-actions-plugin.vala"
	return obj;
#line 1092 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_class_init (SynapseChatActionsClass * klass,
                                 gpointer klass_data)
{
#line 24 "chat-actions-plugin.vala"
	synapse_chat_actions_parent_class = g_type_class_peek_parent (klass);
#line 24 "chat-actions-plugin.vala"
	g_type_class_adjust_private_offset (klass, &SynapseChatActions_private_offset);
#line 24 "chat-actions-plugin.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_synapse_chat_actions_get_property;
#line 24 "chat-actions-plugin.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_synapse_chat_actions_set_property;
#line 24 "chat-actions-plugin.vala"
	G_OBJECT_CLASS (klass)->constructor = synapse_chat_actions_constructor;
#line 24 "chat-actions-plugin.vala"
	G_OBJECT_CLASS (klass)->finalize = synapse_chat_actions_finalize;
#line 24 "chat-actions-plugin.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SYNAPSE_CHAT_ACTIONS_ENABLED_PROPERTY, synapse_chat_actions_properties[SYNAPSE_CHAT_ACTIONS_ENABLED_PROPERTY] = g_param_spec_boolean ("enabled", "enabled", "enabled", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 143 "chat-actions-plugin.vala"
	synapse_chat_actions_register_plugin ();
#line 1115 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_synapse_activatable_interface_init (SynapseActivatableIface * iface,
                                                         gpointer iface_data)
{
#line 24 "chat-actions-plugin.vala"
	synapse_chat_actions_synapse_activatable_parent_iface = g_type_interface_peek_parent (iface);
#line 24 "chat-actions-plugin.vala"
	iface->activate = (void (*) (SynapseActivatable*)) synapse_chat_actions_real_activate;
#line 24 "chat-actions-plugin.vala"
	iface->deactivate = (void (*) (SynapseActivatable*)) synapse_chat_actions_real_deactivate;
#line 24 "chat-actions-plugin.vala"
	iface->get_enabled = synapse_chat_actions_real_get_enabled;
#line 24 "chat-actions-plugin.vala"
	iface->set_enabled = synapse_chat_actions_real_set_enabled;
#line 1132 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_synapse_action_provider_interface_init (SynapseActionProviderIface * iface,
                                                             gpointer iface_data)
{
#line 24 "chat-actions-plugin.vala"
	synapse_chat_actions_synapse_action_provider_parent_iface = g_type_interface_peek_parent (iface);
#line 24 "chat-actions-plugin.vala"
	iface->find_for_match = (SynapseResultSet* (*) (SynapseActionProvider*, SynapseQuery*, SynapseMatch*)) synapse_chat_actions_real_find_for_match;
#line 1143 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_instance_init (SynapseChatActions * self,
                                    gpointer klass)
{
#line 24 "chat-actions-plugin.vala"
	self->priv = synapse_chat_actions_get_instance_private (self);
#line 26 "chat-actions-plugin.vala"
	self->priv->_enabled = TRUE;
#line 1154 "chat-actions-plugin.c"
}

static void
synapse_chat_actions_finalize (GObject * obj)
{
	SynapseChatActions * self;
#line 24 "chat-actions-plugin.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SYNAPSE_TYPE_CHAT_ACTIONS, SynapseChatActions);
#line 146 "chat-actions-plugin.vala"
	_g_object_unref0 (self->priv->actions);
#line 24 "chat-actions-plugin.vala"
	G_OBJECT_CLASS (synapse_chat_actions_parent_class)->finalize (obj);
#line 1167 "chat-actions-plugin.c"
}

static GType
synapse_chat_actions_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SynapseChatActionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) synapse_chat_actions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SynapseChatActions), 0, (GInstanceInitFunc) synapse_chat_actions_instance_init, NULL };
	static const GInterfaceInfo synapse_activatable_info = { (GInterfaceInitFunc) synapse_chat_actions_synapse_activatable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo synapse_action_provider_info = { (GInterfaceInitFunc) synapse_chat_actions_synapse_action_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType synapse_chat_actions_type_id;
	synapse_chat_actions_type_id = g_type_register_static (G_TYPE_OBJECT, "SynapseChatActions", &g_define_type_info, 0);
	g_type_add_interface_static (synapse_chat_actions_type_id, SYNAPSE_TYPE_ACTIVATABLE, &synapse_activatable_info);
	g_type_add_interface_static (synapse_chat_actions_type_id, SYNAPSE_TYPE_ACTION_PROVIDER, &synapse_action_provider_info);
	SynapseChatActions_private_offset = g_type_add_instance_private (synapse_chat_actions_type_id, sizeof (SynapseChatActionsPrivate));
	return synapse_chat_actions_type_id;
}

GType
synapse_chat_actions_get_type (void)
{
	static volatile gsize synapse_chat_actions_type_id__once = 0;
	if (g_once_init_enter (&synapse_chat_actions_type_id__once)) {
		GType synapse_chat_actions_type_id;
		synapse_chat_actions_type_id = synapse_chat_actions_get_type_once ();
		g_once_init_leave (&synapse_chat_actions_type_id__once, synapse_chat_actions_type_id);
	}
	return synapse_chat_actions_type_id__once;
}

static void
_vala_synapse_chat_actions_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	SynapseChatActions * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_TYPE_CHAT_ACTIONS, SynapseChatActions);
#line 24 "chat-actions-plugin.vala"
	switch (property_id) {
#line 24 "chat-actions-plugin.vala"
		case SYNAPSE_CHAT_ACTIONS_ENABLED_PROPERTY:
#line 24 "chat-actions-plugin.vala"
		g_value_set_boolean (value, synapse_activatable_get_enabled ((SynapseActivatable*) self));
#line 24 "chat-actions-plugin.vala"
		break;
#line 1212 "chat-actions-plugin.c"
		default:
#line 24 "chat-actions-plugin.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 24 "chat-actions-plugin.vala"
		break;
#line 1218 "chat-actions-plugin.c"
	}
}

static void
_vala_synapse_chat_actions_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	SynapseChatActions * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SYNAPSE_TYPE_CHAT_ACTIONS, SynapseChatActions);
#line 24 "chat-actions-plugin.vala"
	switch (property_id) {
#line 24 "chat-actions-plugin.vala"
		case SYNAPSE_CHAT_ACTIONS_ENABLED_PROPERTY:
#line 24 "chat-actions-plugin.vala"
		synapse_activatable_set_enabled ((SynapseActivatable*) self, g_value_get_boolean (value));
#line 24 "chat-actions-plugin.vala"
		break;
#line 1238 "chat-actions-plugin.c"
		default:
#line 24 "chat-actions-plugin.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 24 "chat-actions-plugin.vala"
		break;
#line 1244 "chat-actions-plugin.c"
	}
}

