summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-02-01 16:07:06 -0500
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-02-01 16:07:06 -0500
commit1d41beb99b03f828fd204e6e18fa7499360937b9 (patch)
tree10046273dae8333e0855041e05dadfe848122460
parenta687785628216f8f73c699096e9aae4a07b811c6 (diff)
Revert "Merge remote-tracking branch 'siraj/windows-compile-fix'"
-rw-r--r--NEWS8
-rw-r--r--gabble/Makefile.am2
-rw-r--r--gabble/connection.h88
-rw-r--r--gabble/gabble.h2
-rw-r--r--gabble/plugin-connection.h132
-rw-r--r--gabble/plugin.h8
-rw-r--r--gabble/telepathy-gabble-uninstalled.pc.in1
-rw-r--r--gabble/telepathy-gabble.pc.in1
-rw-r--r--plugins/Makefile.am45
-rw-r--r--plugins/console.c4
-rw-r--r--plugins/gateways.c4
-rw-r--r--plugins/test.c30
-rw-r--r--plugins/test.h5
-rw-r--r--src/Makefile.am34
-rw-r--r--src/connection.c82
-rw-r--r--src/connection.h66
-rw-r--r--src/plugin-connection.c181
-rw-r--r--src/plugin-loader.c10
-rw-r--r--src/plugin-loader.h5
-rw-r--r--src/plugin.c7
20 files changed, 172 insertions, 543 deletions
diff --git a/NEWS b/NEWS
index 40822d7f6..ea0e3561f 100644
--- a/NEWS
+++ b/NEWS
@@ -30,13 +30,7 @@ API changes to Wocky snapshot:
replies for unhandled IQs, whereas previously this was up to Gabble.
Plugin authors shouldn't notice this change. (Will)
-• fd.o#44331 - Gabble plugin API symbols should be factored out to a separate library :
- gabble_plugin_create_sidecar function is renamed to gabble_plugin_create_sidecar_async
- and new virtual function gabble_plugin_create_sidecar_finish is introduced. All gabble
- plugins should implement these two methods and all internal plugins are updated to use
- this new API.
-
-• fd.o#44331 - Gabble plugin API symbols should be factored out to a separate library :
+* fd.o#44331 - Gabble plugin API symbols should be factored out to a separate library :
gabble_plugin_create_sidecar function is renamed to gabble_plugin_create_sidecar_async
and new virtual function gabble_plugin_create_sidecar_finish is introduced. All gabble
plugins should implement these two methods and all internal plugins are updated to use
diff --git a/gabble/Makefile.am b/gabble/Makefile.am
index 26b874889..f42c837d0 100644
--- a/gabble/Makefile.am
+++ b/gabble/Makefile.am
@@ -8,7 +8,7 @@ gabbleinclude_HEADERS = \
capabilities-set.h \
caps-channel-manager.h \
caps-hash.h \
- plugin-connection.h \
+ connection.h \
error.h \
gabble.h \
namespaces.h \
diff --git a/gabble/connection.h b/gabble/connection.h
new file mode 100644
index 000000000..1d7dccad9
--- /dev/null
+++ b/gabble/connection.h
@@ -0,0 +1,88 @@
+/*
+ * connection.h - connection API available to telepathy-gabble plugins
+ * Copyright © 2010 Collabora Ltd.
+ * Copyright © 2010 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef GABBLE_PLUGINS_CONNECTION_H
+#define GABBLE_PLUGINS_CONNECTION_H
+
+#include <telepathy-glib/base-connection.h>
+#include <telepathy-glib/base-contact-list.h>
+
+#include <gabble/capabilities-set.h>
+#include <gabble/types.h>
+
+#include <wocky/wocky-xep-0115-capabilities.h>
+
+G_BEGIN_DECLS
+
+#define GABBLE_TYPE_CONNECTION (gabble_connection_get_type ())
+#define GABBLE_CONNECTION(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_CONNECTION, GabbleConnection))
+#define GABBLE_CONNECTION_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_CONNECTION, \
+ GabbleConnectionClass))
+#define GABBLE_IS_CONNECTION(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_CONNECTION))
+#define GABBLE_IS_CONNECTION_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_CONNECTION))
+#define GABBLE_CONNECTION_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_CONNECTION, \
+ GabbleConnectionClass))
+
+typedef struct _GabbleConnectionClass GabbleConnectionClass;
+
+GType gabble_connection_get_type (void);
+
+void gabble_connection_update_sidecar_capabilities (
+ GabbleConnection *connection,
+ const GabbleCapabilitySet *add_set,
+ const GabbleCapabilitySet *remove_set);
+gchar *gabble_connection_add_sidecar_own_caps (
+ GabbleConnection *connection,
+ const GabbleCapabilitySet *cap_set,
+ const GPtrArray *identities) G_GNUC_WARN_UNUSED_RESULT;
+gchar *gabble_connection_add_sidecar_own_caps_full (
+ GabbleConnection *connection,
+ const GabbleCapabilitySet *cap_set,
+ const GPtrArray *identities,
+ GPtrArray *data_forms) G_GNUC_WARN_UNUSED_RESULT;
+
+WockySession *gabble_connection_get_session (
+ GabbleConnection *connection);
+
+gchar *gabble_connection_get_full_jid (GabbleConnection *conn);
+
+const gchar * gabble_connection_get_jid_for_caps (GabbleConnection *conn,
+ WockyXep0115Capabilities *caps);
+
+const gchar * gabble_connection_pick_best_resource_for_caps (
+ GabbleConnection *connection,
+ const gchar *jid,
+ GabbleCapabilitySetPredicate predicate,
+ gconstpointer user_data);
+
+TpBaseContactList * gabble_connection_get_contact_list (
+ GabbleConnection *connection);
+
+WockyXep0115Capabilities * gabble_connection_get_caps (
+ GabbleConnection *connection, TpHandle handle);
+
+G_END_DECLS
+
+#endif
diff --git a/gabble/gabble.h b/gabble/gabble.h
index 4465c3428..8393ae8c7 100644
--- a/gabble/gabble.h
+++ b/gabble/gabble.h
@@ -28,7 +28,7 @@
#include <gabble/capabilities-set.h>
#include <gabble/caps-channel-manager.h>
#include <gabble/caps-hash.h>
-#include <gabble/plugin-connection.h>
+#include <gabble/connection.h>
#include <gabble/error.h>
#include <gabble/namespaces.h>
#include <gabble/plugin.h>
diff --git a/gabble/plugin-connection.h b/gabble/plugin-connection.h
deleted file mode 100644
index e80e13410..000000000
--- a/gabble/plugin-connection.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * plugin-connection.h — Connection API available to telepathy-gabble plugins
- * Copyright © 2012 Collabora Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef GABBLE_PLUGIN_CONNECTION_H
-#define GABBLE_PLUGIN_CONNECTION_H
-
-#include <glib-object.h>
-
-#include <telepathy-glib/base-connection.h>
-#include <telepathy-glib/base-contact-list.h>
-
-#include <gabble/capabilities-set.h>
-#include <gabble/types.h>
-
-#include <wocky/wocky-xep-0115-capabilities.h>
-
-G_BEGIN_DECLS
-
-typedef struct _GabblePluginConnection GabblePluginConnection;
-typedef struct _GabblePluginConnectionInterface GabblePluginConnectionInterface;
-
-#define GABBLE_TYPE_PLUGIN_CONNECTION (gabble_plugin_connection_get_type ())
-#define GABBLE_PLUGIN_CONNECTION(o) \
- (G_TYPE_CHECK_INSTANCE_CAST ((o), GABBLE_TYPE_PLUGIN_CONNECTION, \
- GabblePluginConnection))
-#define GABBLE_IS_PLUGIN_CONNECTION(o) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((o), GABBLE_TYPE_PLUGIN_CONNECTION))
-#define GABBLE_PLUGIN_CONNECTION_GET_IFACE(o) \
- (G_TYPE_INSTANCE_GET_INTERFACE ((o), GABBLE_TYPE_PLUGIN_CONNECTION, \
- GabblePluginConnectionInterface))
-
-GType gabble_plugin_connection_get_type (void) G_GNUC_CONST;
-
-typedef gchar * (*GabblePluginConnectionAddSidecarCapsFunc) (
- GabblePluginConnection *connection_service,
- const GabbleCapabilitySet *cap_set,
- const GPtrArray *identities);
-
-typedef gchar * (*GabblePluginConnectionAddSidecarCapsFullFunc) (
- GabblePluginConnection *plugin_connection,
- const GabbleCapabilitySet *cap_set,
- const GPtrArray *identities,
- GPtrArray *data_forms);
-
-typedef WockySession * (*GabblePluginConnectionGetSessionFunc) (
- GabblePluginConnection *plugin_connection);
-
-typedef gchar *(*GabblePluginConnectionGetFullJidFunc) (
- GabblePluginConnection *plugin_connection);
-
-typedef const gchar * (*GabblePluginConnectionGetJidForCapsFunc) (
- GabblePluginConnection *plugin_connection,
- WockyXep0115Capabilities *caps);
-
-typedef const gchar* (*GabblePluginConnectionPickBestResourceForCaps) (
- GabblePluginConnection *plugin_connection,
- const gchar *jid,
- GabbleCapabilitySetPredicate predicate,
- gconstpointer user_data);
-
-typedef TpBaseContactList * (*GabblePluginConnectionGetContactList) (
- GabblePluginConnection *plugin_connection);
-
-typedef WockyXep0115Capabilities * (*GabblePluginConnectionGetCaps) (
- GabblePluginConnection *plugin_connection,
- TpHandle handle);
-
-struct _GabblePluginConnectionInterface
-{
- GTypeInterface parent;
- GabblePluginConnectionAddSidecarCapsFunc add_sidecar_own_caps;
- GabblePluginConnectionAddSidecarCapsFullFunc add_sidecar_own_caps_full;
- GabblePluginConnectionGetSessionFunc get_session;
- GabblePluginConnectionGetFullJidFunc get_full_jid;
- GabblePluginConnectionGetJidForCapsFunc get_jid_for_caps;
- GabblePluginConnectionPickBestResourceForCaps pick_best_resource_for_caps;
- GabblePluginConnectionGetContactList get_contact_list;
- GabblePluginConnectionGetCaps get_caps;
-};
-
-gchar *gabble_plugin_connection_add_sidecar_own_caps (
- GabblePluginConnection *plugin_service,
- const GabbleCapabilitySet *cap_set,
- const GPtrArray *identities);
-
-gchar *gabble_plugin_connection_add_sidecar_own_caps_full (
- GabblePluginConnection *plugin_connection,
- const GabbleCapabilitySet *cap_set,
- const GPtrArray *identities,
- GPtrArray *data_forms) G_GNUC_WARN_UNUSED_RESULT;
-
-WockySession *gabble_plugin_connection_get_session (
- GabblePluginConnection *plugin_connection);
-
-gchar *gabble_plugin_connection_get_full_jid (GabblePluginConnection *conn);
-
-const gchar *gabble_plugin_connection_get_jid_for_caps (
- GabblePluginConnection *plugin_connection,
- WockyXep0115Capabilities *caps);
-
-const gchar *gabble_plugin_connection_pick_best_resource_for_caps (
- GabblePluginConnection *plugin_connection,
- const gchar *jid,
- GabbleCapabilitySetPredicate predicate,
- gconstpointer user_data);
-
-TpBaseContactList *gabble_plugin_connection_get_contact_list (
- GabblePluginConnection *plugin_connection);
-
-WockyXep0115Capabilities *gabble_plugin_connection_get_caps (
- GabblePluginConnection *plugin_connection,
- TpHandle handle);
-
-G_END_DECLS
-
-#endif
diff --git a/gabble/plugin.h b/gabble/plugin.h
index 35621200c..ffb888c29 100644
--- a/gabble/plugin.h
+++ b/gabble/plugin.h
@@ -28,7 +28,7 @@
#include <telepathy-glib/presence-mixin.h>
#include <wocky/wocky-session.h>
-#include <gabble/plugin-connection.h>
+#include <gabble/connection.h>
#include <gabble/sidecar.h>
#include <gabble/types.h>
@@ -48,7 +48,7 @@ typedef struct _GabblePluginInterface GabblePluginInterface;
typedef void (*GabblePluginCreateSidecarImpl) (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabblePluginConnection *plugin_connection,
+ GabbleConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -58,7 +58,6 @@ typedef void (*GabblePluginCreateSidecarImpl) (
* not have a free function. */
typedef GPtrArray * (*GabblePluginCreateChannelManagersImpl) (
GabblePlugin *plugin,
- GabblePluginConnection *plugin_connection,
TpBaseConnection *connection);
typedef GabbleSidecar * (*GabblePluginCreateSidecarFinishImpl) (
@@ -134,7 +133,7 @@ gboolean gabble_plugin_implements_sidecar (
void gabble_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabblePluginConnection *plugin_connection,
+ GabbleConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -156,7 +155,6 @@ const gchar *gabble_plugin_presence_status_for_privacy_list (
const gchar *list_name);
GPtrArray * gabble_plugin_create_channel_managers (GabblePlugin *plugin,
- GabblePluginConnection *plugin_connection,
TpBaseConnection *connection);
/**
diff --git a/gabble/telepathy-gabble-uninstalled.pc.in b/gabble/telepathy-gabble-uninstalled.pc.in
index c4b1847ba..72aa5d1aa 100644
--- a/gabble/telepathy-gabble-uninstalled.pc.in
+++ b/gabble/telepathy-gabble-uninstalled.pc.in
@@ -12,5 +12,4 @@ Description: XMPP backend for the Telepathy framework
Version: @VERSION@
Requires: pkg-config >= 0.21
Requires.private: glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gio-2.0, telepathy-glib >= 0.7.37
-Libs: ${abs_top_builddir}/src/libgabble-plugins.la
Cflags: -I${abs_top_srcdir} -I${abs_top_srcdir}/lib/ext/wocky
diff --git a/gabble/telepathy-gabble.pc.in b/gabble/telepathy-gabble.pc.in
index 40644ad30..d566118ac 100644
--- a/gabble/telepathy-gabble.pc.in
+++ b/gabble/telepathy-gabble.pc.in
@@ -12,5 +12,4 @@ Description: XMPP backend for the Telepathy framework
Version: @VERSION@
Requires: pkg-config >= 0.21
Requires.private: glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gio-2.0, telepathy-glib >= 0.7.37
-Libs: -L${libdir} -lgabble-plugins
Cflags: -I${includedir}/telepathy-gabble-0
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index a6b32eacb..0330cec53 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,31 +1,31 @@
plugindir = $(libdir)/telepathy/gabble-0
installable_plugins = \
- libconsole.la \
- libgateways.la
+ console.la \
+ gateways.la
-libtest_only_plugins = \
- libtest.la
+test_only_plugins = \
+ test.la
-# libtesting-only plugins
+# testing-only plugins
if ENABLE_INSTALLED_TESTS
noinst_LTLIBRARIES = \
$(NULL)
-libtestplugindir = $(gabbletestsdir)/plugins
-libtestplugin_LTLIBRARIES = \
- $(libtest_only_plugins) \
+testplugindir = $(gabbletestsdir)/plugins
+testplugin_LTLIBRARIES = \
+ $(test_only_plugins) \
$(NULL)
-libtest_la_LDFLAGS = $(AM_LDFLAGS)
+test_la_LDFLAGS = $(AM_LDFLAGS)
else
noinst_LTLIBRARIES = \
- $(libtest_only_plugins) \
+ $(test_only_plugins) \
$(NULL)
-# because libtest.la is not installed, libtool will want to compile it as static
+# because test.la is not installed, libtool will want to compile it as static
# despite -shared (a convenience library), unless we also use -rpath
-libtest_la_LDFLAGS = $(AM_LDFLAGS) -rpath $(plugindir)
+test_la_LDFLAGS = $(AM_LDFLAGS) -rpath $(plugindir)
endif
if ENABLE_PLUGINS
@@ -42,30 +42,17 @@ EXTRA_DIST = \
telepathy-gabble-xmpp-console
endif
-AM_LDFLAGS = -avoid-version -shared -no-undefined
+AM_LDFLAGS = -module -avoid-version -shared
-if WINDOWS
-ALL_PLUGIN_LIBS = \
- @WOCKY_LIBS@ \
- @GLIB_LIBS@ \
- @TP_GLIB_LIBS@ \
- $(top_builddir)/extensions/libgabble-extensions.la \
- $(top_builddir)/src/libgabble-plugins.la
-
-libtest_la_LIBADD = $(ALL_PLUGIN_LIBS)
-libgateways_la_LIBADD = $(ALL_PLUGIN_LIBS)
-libconsole_la_LIBADD = $(ALL_PLUGIN_LIBS)
-endif
-
-libtest_la_SOURCES = \
+test_la_SOURCES = \
test.c \
test.h
-libgateways_la_SOURCES = \
+gateways_la_SOURCES = \
gateways.c \
gateways.h
-libconsole_la_SOURCES = \
+console_la_SOURCES = \
console.c \
console.h
diff --git a/plugins/console.c b/plugins/console.c
index 7e980dbf8..8d6795c9d 100644
--- a/plugins/console.c
+++ b/plugins/console.c
@@ -80,7 +80,7 @@ static void
gabble_console_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabblePluginConnection *connection,
+ GabbleConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -315,7 +315,7 @@ gabble_console_sidecar_class_init (GabbleConsoleSidecarClass *klass)
g_object_class_install_property (object_class, PROP_CONNECTION,
g_param_spec_object ("connection", "Connection",
"Gabble connection",
- GABBLE_TYPE_PLUGIN_CONNECTION,
+ GABBLE_TYPE_CONNECTION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_SESSION,
diff --git a/plugins/gateways.c b/plugins/gateways.c
index 139c28de6..1e7b141a2 100644
--- a/plugins/gateways.c
+++ b/plugins/gateways.c
@@ -78,7 +78,7 @@ static void
gabble_gateway_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabblePluginConnection *connection,
+ GabbleConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -353,7 +353,7 @@ gabble_gateway_sidecar_class_init (GabbleGatewaySidecarClass *klass)
g_object_class_install_property (object_class, PROP_CONNECTION,
g_param_spec_object ("connection", "Connection",
"Gabble connection",
- GABBLE_TYPE_PLUGIN_CONNECTION,
+ GABBLE_TYPE_CONNECTION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_SESSION,
diff --git a/plugins/test.c b/plugins/test.c
index 691b84969..43b18ea3b 100644
--- a/plugins/test.c
+++ b/plugins/test.c
@@ -83,7 +83,7 @@ static void
test_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabblePluginConnection *plugin_connection,
+ GabbleConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -106,7 +106,7 @@ test_plugin_create_sidecar_async (
{
g_async_initable_new_async (TEST_TYPE_SIDECAR_IQ, G_PRIORITY_DEFAULT,
NULL, sidecar_iq_created_cb, result, "session", session,
- "plugin-connection", plugin_connection, NULL);
+ "connection", connection, NULL);
return;
}
else
@@ -149,16 +149,15 @@ test_plugin_create_sidecar_finish (
static GPtrArray *
test_plugin_create_channel_managers (GabblePlugin *plugin,
- GabblePluginConnection *plugin_connection,
TpBaseConnection *connection)
{
GPtrArray *ret = g_ptr_array_new ();
- DEBUG ("plugin %p on connection %p", plugin, plugin_connection);
+ DEBUG ("plugin %p on connection %p", plugin, connection);
g_ptr_array_add (ret,
g_object_new (TEST_TYPE_CHANNEL_MANAGER,
- "plugin-connection", plugin_connection,
+ "connection", connection,
NULL));
return ret;
@@ -361,7 +360,7 @@ test_sidecar_iq_set_property (
g_ptr_array_add (identities, identity);
/* set own caps so we proper reply to disco#info */
- hash = gabble_plugin_connection_add_sidecar_own_caps (self->connection,
+ hash = gabble_connection_add_sidecar_own_caps (self->connection,
features, identities);
g_free (hash);
@@ -400,9 +399,9 @@ test_sidecar_iq_class_init (TestSidecarIQClass *klass)
WOCKY_TYPE_SESSION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_CONNECTION,
- g_param_spec_object ("plugin-connection", "Gabble Plugin Connection",
- "Gabble Plugin Connection",
- GABBLE_TYPE_PLUGIN_CONNECTION,
+ g_param_spec_object ("connection", "Gabble Connection",
+ "Gabble connection",
+ GABBLE_TYPE_CONNECTION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
}
@@ -540,7 +539,7 @@ test_channel_manager_set_property (
/* Not reffing this: the connection owns all channel managers, so it
* must outlive us. Taking a reference leads to a cycle.
*/
- self->plugin_connection = g_value_get_object (value);
+ self->connection = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -559,7 +558,7 @@ test_channel_manager_get_property (
switch (property_id)
{
case PROP_CONNECTION:
- g_value_set_object (value, self->plugin_connection);
+ g_value_set_object (value, self->connection);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -584,8 +583,7 @@ test_channel_manager_constructed (GObject *object)
if (G_OBJECT_CLASS (test_channel_manager_parent_class)->constructed != NULL)
G_OBJECT_CLASS (test_channel_manager_parent_class)->constructed (object);
- tp_g_signal_connect_object (self->plugin_connection,
- "porter-available",
+ tp_g_signal_connect_object (self->connection, "porter-available",
G_CALLBACK (test_channel_manager_porter_available_cb),
self, 0);
}
@@ -600,9 +598,9 @@ test_channel_manager_class_init (TestChannelManagerClass *klass)
oclass->constructed = test_channel_manager_constructed;
g_object_class_install_property (oclass, PROP_CONNECTION,
- g_param_spec_object ("plugin-connection", "Gabble Plugin Connection",
- "Gabble Plugin Connection",
- GABBLE_TYPE_PLUGIN_CONNECTION,
+ g_param_spec_object ("connection", "Gabble Connection",
+ "Gabble connection",
+ GABBLE_TYPE_CONNECTION,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
}
diff --git a/plugins/test.h b/plugins/test.h
index cfd441f55..6fe0d1434 100644
--- a/plugins/test.h
+++ b/plugins/test.h
@@ -3,7 +3,6 @@
#include <gio/gio.h>
#include <wocky/wocky-session.h>
#include <gabble/gabble.h>
-#include <gabble/plugin-connection.h>
/* Plugin */
typedef struct _TestPluginClass TestPluginClass;
@@ -105,7 +104,7 @@ struct _TestSidecarIQ {
GObject parent;
GSimpleAsyncResult *result;
WockySession *session;
- GabblePluginConnection *connection;
+ GabbleConnection *connection;
};
GType test_sidecar_iq_get_type (void);
@@ -135,7 +134,7 @@ struct _TestChannelManagerClass {
struct _TestChannelManager {
GObject parent;
- GabblePluginConnection *plugin_connection;
+ GabbleConnection *connection;
};
GType test_channel_manager_get_type (void);
diff --git a/src/Makefile.am b/src/Makefile.am
index af79124db..01afbcc5d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -77,6 +77,7 @@ libgabble_convenience_la_SOURCES = \
conn-util.c \
conn-mail-notif.h \
conn-mail-notif.c \
+ $(top_srcdir)/gabble/connection.h \
connection.h \
connection.c \
connection-manager.h \
@@ -135,6 +136,8 @@ libgabble_convenience_la_SOURCES = \
olpc-activity.c \
plugin-loader.h \
plugin-loader.c \
+ $(top_srcdir)/gabble/plugin.h \
+ plugin.c \
presence.h \
presence.c \
presence-cache.h \
@@ -210,7 +213,6 @@ libgabble_convenience_la_LIBADD = \
$(top_builddir)/extensions/libgabble-extensions.la \
$(top_builddir)/lib/gibber/libgibber.la \
$(top_builddir)/lib/ext/telepathy-yell/telepathy-yell/libtelepathy-yell.la \
- libgabble-plugins.la \
$(ALL_LIBS)
nodist_libgabble_convenience_la_SOURCES = \
@@ -239,29 +241,12 @@ endif
noinst_LTLIBRARIES = libgabble-convenience.la
-lib_LTLIBRARIES = libgabble-plugins.la
-
-libgabble_plugins_la_LDFLAGS = -shared -no-undefined -avoid-version
-
-libgabble_plugins_la_LIBADD = \
- $(top_builddir)/lib/ext/telepathy-yell/telepathy-yell/libtelepathy-yell.la \
- $(top_builddir)/lib/loudmouth/libloudmouth.la \
- $(ALL_LIBS)
-
-libgabble_plugins_la_SOURCES = \
- (top_srcdir)/gabble/capabilities.h \
- capabilities.c \
- $(top_srcdir)/gabble/caps-channel-manager.h \
- caps-channel-manager.c \
- $(top_srcdir)/gabble/debug.h \
- debug.c \
- $(top_srcdir)/gabble/error.h \
- error.c \
- $(top_srcdir)/gabble/plugin.h \
- plugin.c \
- $(top_srcdir)/gabble/plugin-connection.h \
- plugin-connection.c \
- sidecar.c
+if WINDOWS
+lib_LTLIBRARIES = libgabble-runtime.la
+libgabble_runtime_la_LIBADD = libgabble-convenience.la
+libgabble_runtime_la_LDFLAGS = -no-undefined
+libgabble_runtime_la_SOURCES =
+endif
AM_CFLAGS = $(ERROR_CFLAGS) -I$(top_srcdir) -I$(top_builddir) \
@TP_YELL_CFLAGS@ \
@@ -284,6 +269,7 @@ else
ALL_LIBS += @WOCKY_LIBS@
endif
+
# build gibber first
all: gibber
gibber:
diff --git a/src/connection.c b/src/connection.c
index 6b67f9771..44a5202d7 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -51,7 +51,6 @@
#include "bytestream-factory.h"
#include "gabble/capabilities.h"
#include "gabble/caps-channel-manager.h"
-#include "gabble/plugin-connection.h"
#include "caps-hash.h"
#include "auth-manager.h"
#include "conn-aliasing.h"
@@ -98,13 +97,6 @@ static void conn_capabilities_fill_contact_attributes (GObject *obj,
const GArray *contacts, GHashTable *attributes_hash);
static void conn_contact_capabilities_fill_contact_attributes (GObject *obj,
const GArray *contacts, GHashTable *attributes_hash);
-static void gabble_plugin_connection_iface_init (
- GabblePluginConnectionInterface *iface,
- gpointer conn);
-static gchar *_gabble_plugin_connection_get_full_jid (
- GabblePluginConnection *conn);
-static TpBaseContactList *_gabble_plugin_connection_get_contact_list (
- GabblePluginConnection *conn);
G_DEFINE_TYPE_WITH_CODE(GabbleConnection,
gabble_connection,
@@ -150,8 +142,6 @@ G_DEFINE_TYPE_WITH_CODE(GabbleConnection,
conn_power_saving_iface_init);
G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CONNECTION_INTERFACE_ADDRESSING,
conn_addressing_iface_init);
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_PLUGIN_CONNECTION,
- gabble_plugin_connection_iface_init);
)
/* properties */
@@ -311,6 +301,8 @@ struct _GabbleConnectionPrivate
gboolean dispose_has_run;
};
+static guint sig_id_porter_available = 0;
+
static void connection_capabilities_update_cb (GabblePresenceCache *cache,
TpHandle handle,
const GabbleCapabilitySet *old_cap_set,
@@ -331,7 +323,6 @@ static GPtrArray *
_gabble_connection_create_channel_managers (TpBaseConnection *conn)
{
GabbleConnection *self = GABBLE_CONNECTION (conn);
- GabblePluginConnection *plugin_connection = GABBLE_PLUGIN_CONNECTION (self);
GPtrArray *channel_managers = g_ptr_array_sized_new (5);
GabblePluginLoader *loader;
GPtrArray *tmp;
@@ -389,8 +380,7 @@ _gabble_connection_create_channel_managers (TpBaseConnection *conn)
/* plugin channel managers */
loader = gabble_plugin_loader_dup ();
- tmp = gabble_plugin_loader_create_channel_managers (loader,
- plugin_connection, conn);
+ tmp = gabble_plugin_loader_create_channel_managers (loader, conn);
g_object_unref (loader);
g_ptr_array_foreach (tmp, add_to_array, channel_managers);
@@ -399,23 +389,6 @@ _gabble_connection_create_channel_managers (TpBaseConnection *conn)
return channel_managers;
}
-static void
-gabble_plugin_connection_iface_init (
- GabblePluginConnectionInterface *iface,
- gpointer conn)
-{
- iface->add_sidecar_own_caps = gabble_connection_add_sidecar_own_caps;
- iface->add_sidecar_own_caps_full=
- gabble_connection_add_sidecar_own_caps_full;
- iface->get_session = gabble_connection_get_session;
- iface->get_full_jid = _gabble_plugin_connection_get_full_jid;
- iface->get_jid_for_caps = gabble_connection_get_jid_for_caps;
- iface->pick_best_resource_for_caps =
- gabble_connection_pick_best_resource_for_caps;
- iface->get_contact_list = _gabble_plugin_connection_get_contact_list;
- iface->get_caps = gabble_connection_get_caps;
-}
-
static GObject *
gabble_connection_constructor (GType type,
guint n_construct_properties,
@@ -1200,6 +1173,17 @@ gabble_connection_class_init (GabbleConnectionClass *gabble_connection_class)
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * @self: a connection
+ * @porter: a porter
+ *
+ * Emitted when the WockyPorter becomes available.
+ */
+ sig_id_porter_available = g_signal_new ("porter-available",
+ G_OBJECT_CLASS_TYPE (gabble_connection_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, WOCKY_TYPE_PORTER);
+
gabble_connection_class->properties_class.interfaces = prop_interfaces;
tp_dbus_properties_mixin_class_init (object_class,
G_STRUCT_OFFSET (GabbleConnectionClass, properties_class));
@@ -1394,13 +1378,6 @@ gabble_connection_get_full_jid (GabbleConnection *conn)
return g_strconcat (bare_jid, "/", conn->priv->resource, NULL);
}
-static gchar *
-_gabble_plugin_connection_get_full_jid (GabblePluginConnection *plugin_conn)
-{
- GabbleConnection *conn = GABBLE_CONNECTION (plugin_conn);
- return gabble_connection_get_full_jid (conn);
-}
-
/**
* gabble_connection_dup_porter:
*
@@ -1422,10 +1399,8 @@ WockyPorter *gabble_connection_dup_porter (GabbleConnection *conn)
}
WockySession *
-gabble_connection_get_session (GabblePluginConnection *plugin_connection)
+gabble_connection_get_session (GabbleConnection *connection)
{
- GabbleConnection *connection = GABBLE_CONNECTION (plugin_connection);
-
g_return_val_if_fail (GABBLE_IS_CONNECTION (connection), NULL);
return connection->session;
@@ -1901,7 +1876,7 @@ connector_connected (GabbleConnection *self,
g_signal_connect (priv->porter, "remote-error",
G_CALLBACK (remote_error_cb), self);
- g_signal_emit_by_name (self, "porter-available", priv->porter);
+ g_signal_emit (self, sig_id_porter_available, 0, priv->porter);
connect_iq_callbacks (self);
wocky_pep_service_start (self->pep_location, self->session);
@@ -3846,12 +3821,11 @@ gabble_connection_update_sidecar_capabilities (GabbleConnection *self,
/* identities is actually a WockyDiscoIdentityArray */
gchar *
-gabble_connection_add_sidecar_own_caps_full (GabblePluginConnection *self,
+gabble_connection_add_sidecar_own_caps_full (GabbleConnection *self,
const GabbleCapabilitySet *cap_set,
const GPtrArray *identities,
GPtrArray *data_forms)
{
- GabbleConnection *conn = GABBLE_CONNECTION (self);
GPtrArray *identities_copy = ((identities == NULL) ?
wocky_disco_identity_array_new () :
wocky_disco_identity_array_copy (identities));
@@ -3865,7 +3839,7 @@ gabble_connection_add_sidecar_own_caps_full (GabblePluginConnection *self,
ver = gabble_caps_hash_compute_full (cap_set, identities_copy, data_forms);
- gabble_presence_cache_add_own_caps (conn->presence_cache, ver,
+ gabble_presence_cache_add_own_caps (self->presence_cache, ver,
cap_set, identities_copy, data_forms);
wocky_disco_identity_array_free (identities_copy);
@@ -3874,7 +3848,7 @@ gabble_connection_add_sidecar_own_caps_full (GabblePluginConnection *self,
}
gchar *
-gabble_connection_add_sidecar_own_caps (GabblePluginConnection *self,
+gabble_connection_add_sidecar_own_caps (GabbleConnection *self,
const GabbleCapabilitySet *cap_set,
const GPtrArray *identities)
{
@@ -3883,13 +3857,12 @@ gabble_connection_add_sidecar_own_caps (GabblePluginConnection *self,
}
const gchar *
-gabble_connection_get_jid_for_caps (GabblePluginConnection *plugin_conn,
+gabble_connection_get_jid_for_caps (GabbleConnection *conn,
WockyXep0115Capabilities *caps)
{
TpHandle handle;
TpBaseConnection *base;
TpHandleRepoIface *contact_handles;
- GabbleConnection *conn = GABBLE_CONNECTION (plugin_conn);
g_return_val_if_fail (GABBLE_IS_CONNECTION (conn), NULL);
g_return_val_if_fail (GABBLE_IS_PRESENCE (caps), NULL);
@@ -3913,8 +3886,7 @@ gabble_connection_get_jid_for_caps (GabblePluginConnection *plugin_conn,
}
const gchar *
-gabble_connection_pick_best_resource_for_caps (
- GabblePluginConnection *plugin_connection,
+gabble_connection_pick_best_resource_for_caps (GabbleConnection *connection,
const gchar *jid,
GabbleCapabilitySetPredicate predicate,
gconstpointer user_data)
@@ -3922,7 +3894,6 @@ gabble_connection_pick_best_resource_for_caps (
TpBaseConnection *base;
TpHandleRepoIface *contact_handles;
TpHandle handle;
- GabbleConnection *connection = GABBLE_CONNECTION (plugin_connection);
GabblePresence *presence;
g_return_val_if_fail (GABBLE_IS_CONNECTION (connection), NULL);
@@ -3956,20 +3927,11 @@ gabble_connection_get_contact_list (GabbleConnection *connection)
return (TpBaseContactList *) connection->roster;
}
-static TpBaseContactList *
-_gabble_plugin_connection_get_contact_list (
- GabblePluginConnection *plugin_connection)
-{
- GabbleConnection *connection = GABBLE_CONNECTION (plugin_connection);
- return gabble_connection_get_contact_list (connection);
-}
-
WockyXep0115Capabilities *
-gabble_connection_get_caps (GabblePluginConnection *plugin_connection,
+gabble_connection_get_caps (GabbleConnection *connection,
TpHandle handle)
{
GabblePresence *presence;
- GabbleConnection *connection = GABBLE_CONNECTION (plugin_connection);
g_return_val_if_fail (GABBLE_IS_CONNECTION (connection), NULL);
g_return_val_if_fail (handle > 0, NULL);
diff --git a/src/connection.h b/src/connection.h
index c4e209f49..f1fcf3ecd 100644
--- a/src/connection.h
+++ b/src/connection.h
@@ -1,7 +1,7 @@
/*
* gabble-connection.h - Header for GabbleConnection
- * Copyright © 2005-2012 Collabora Ltd.
- * Copyright © 2005-2010 Nokia Corporation
+ * Copyright (C) 2005 Collabora Ltd.
+ * Copyright (C) 2005 Nokia Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -34,6 +34,7 @@
#include <wocky/wocky-session.h>
#include <wocky/wocky-pep-service.h>
+#include "gabble/connection.h"
#include "gabble/capabilities.h"
#ifdef ENABLE_FILE_TRANSFER
#include "ft-manager.h"
@@ -42,69 +43,8 @@
#include "muc-factory.h"
#include "types.h"
-#include <telepathy-glib/base-connection.h>
-#include <telepathy-glib/base-contact-list.h>
-
-#include <gabble/capabilities-set.h>
-#include <gabble/types.h>
-#include <gabble/plugin-connection.h>
-
-#include <wocky/wocky-xep-0115-capabilities.h>
-
G_BEGIN_DECLS
-#define GABBLE_TYPE_CONNECTION (gabble_connection_get_type ())
-#define GABBLE_CONNECTION(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_CONNECTION, GabbleConnection))
-#define GABBLE_CONNECTION_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_CONNECTION, \
- GabbleConnectionClass))
-#define GABBLE_IS_CONNECTION(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_CONNECTION))
-#define GABBLE_IS_CONNECTION_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_CONNECTION))
-#define GABBLE_CONNECTION_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_CONNECTION, \
- GabbleConnectionClass))
-
-typedef struct _GabbleConnectionClass GabbleConnectionClass;
-
-GType gabble_connection_get_type (void);
-
-void gabble_connection_update_sidecar_capabilities (
- GabbleConnection *connection,
- const GabbleCapabilitySet *add_set,
- const GabbleCapabilitySet *remove_set);
-gchar *gabble_connection_add_sidecar_own_caps (
- GabblePluginConnection *connection,
- const GabbleCapabilitySet *cap_set,
- const GPtrArray *identities) G_GNUC_WARN_UNUSED_RESULT;
-gchar *gabble_connection_add_sidecar_own_caps_full (
- GabblePluginConnection *connection,
- const GabbleCapabilitySet *cap_set,
- const GPtrArray *identities,
- GPtrArray *data_forms) G_GNUC_WARN_UNUSED_RESULT;
-
-WockySession *gabble_connection_get_session (
- GabblePluginConnection *connection);
-
-gchar *gabble_connection_get_full_jid (GabbleConnection *conn);
-
-const gchar * gabble_connection_get_jid_for_caps (GabblePluginConnection *conn,
- WockyXep0115Capabilities *caps);
-
-const gchar * gabble_connection_pick_best_resource_for_caps (
- GabblePluginConnection *connection,
- const gchar *jid,
- GabbleCapabilitySetPredicate predicate,
- gconstpointer user_data);
-
-TpBaseContactList * gabble_connection_get_contact_list (
- GabbleConnection *connection);
-
-WockyXep0115Capabilities * gabble_connection_get_caps (
- GabblePluginConnection *connection, TpHandle handle);
-
/* Default parameters for optional parameters */
#define GABBLE_PARAMS_DEFAULT_HTTPS_PROXY_PORT 443
#define GABBLE_PARAMS_DEFAULT_STUN_PORT 3478
diff --git a/src/plugin-connection.c b/src/plugin-connection.c
deleted file mode 100644
index abec9e404..000000000
--- a/src/plugin-connection.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * plugin-connection.c — API for telepathy-gabble plugins
- * Copyright © 2012 Collabora Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "gabble/plugin-connection.h"
-
-#include <glib-object.h>
-#include <gabble/types.h>
-#include <telepathy-glib/errors.h>
-#include <debug.h>
-
-
-static guint sig_id_porter_available = 0;
-
-/**
- * SECTION: gabble-plugin-connection
- * @title: GabblePluginConnection
- * @short_description: Object representing gabble connection, implemented by
- * Gabble internals.
- *
- * This Object represents Gabble Connection.
- *
- * Virtual methods in GabblePluginConnectionInterface interface are implemented
- * by GabbleConnection object. And only Gabble should implement this interface.
- */
-G_DEFINE_INTERFACE (GabblePluginConnection,
- gabble_plugin_connection,
- G_TYPE_OBJECT);
-
-static void
-gabble_plugin_connection_default_init (GabblePluginConnectionInterface *iface)
-{
- static gsize once = 0;
-
- if (g_once_init_enter (&once))
- {
- /**
- * @self: a connection interface
- * @porter: a porter
- *
- * Emitted when the WockyPorter becomes available.
- */
- sig_id_porter_available = g_signal_new (
- "porter-available",
- G_OBJECT_CLASS_TYPE (iface),
- G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, WOCKY_TYPE_PORTER);
- g_once_init_leave (&once, 1);
- }
-}
-
-gchar *
-gabble_plugin_connection_add_sidecar_own_caps (
- GabblePluginConnection *plugin_connection,
- const GabbleCapabilitySet *cap_set,
- const GPtrArray *identities)
-{
- GabblePluginConnectionInterface *iface =
- GABBLE_PLUGIN_CONNECTION_GET_IFACE (plugin_connection);
-
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (iface->add_sidecar_own_caps != NULL, NULL);
-
- return iface->add_sidecar_own_caps (plugin_connection, cap_set, identities);
-}
-
-gchar *
-gabble_plugin_connection_add_sidecar_own_caps_full (
- GabblePluginConnection *plugin_connection,
- const GabbleCapabilitySet *cap_set,
- const GPtrArray *identities,
- GPtrArray *data_forms)
-{
- GabblePluginConnectionInterface *iface =
- GABBLE_PLUGIN_CONNECTION_GET_IFACE (plugin_connection);
-
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (iface->add_sidecar_own_caps_full != NULL, NULL);
-
- return iface->add_sidecar_own_caps_full (plugin_connection, cap_set, identities,
- data_forms);
-}
-
-WockySession *
-gabble_plugin_connection_get_session (
- GabblePluginConnection *plugin_connection)
-{
- GabblePluginConnectionInterface *iface =
- GABBLE_PLUGIN_CONNECTION_GET_IFACE (plugin_connection);
-
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (iface->get_session != NULL, NULL);
-
- return iface->get_session (plugin_connection);
-}
-
-gchar *
-gabble_plugin_connection_get_full_jid (
- GabblePluginConnection *plugin_connection)
-{
- GabblePluginConnectionInterface *iface =
- GABBLE_PLUGIN_CONNECTION_GET_IFACE (plugin_connection);
-
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (iface->get_full_jid != NULL, NULL);
-
- return iface->get_full_jid (plugin_connection);
-}
-
-const gchar *
-gabble_plugin_connection_get_jid_for_caps (
- GabblePluginConnection *plugin_connection,
- WockyXep0115Capabilities *caps)
-{
- GabblePluginConnectionInterface *iface =
- GABBLE_PLUGIN_CONNECTION_GET_IFACE (plugin_connection);
-
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (iface->get_jid_for_caps != NULL, NULL);
-
- return iface->get_jid_for_caps (plugin_connection, caps);
-}
-
-const gchar *
-gabble_plugin_connection_pick_best_resource_for_caps (
- GabblePluginConnection *plugin_connection,
- const gchar *jid,
- GabbleCapabilitySetPredicate predicate,
- gconstpointer user_data)
-{
- GabblePluginConnectionInterface *iface =
- GABBLE_PLUGIN_CONNECTION_GET_IFACE (plugin_connection);
-
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (iface->pick_best_resource_for_caps != NULL, NULL);
-
- return iface->pick_best_resource_for_caps (plugin_connection, jid, predicate,
- user_data);
-}
-
-TpBaseContactList *
-gabble_plugin_connection_get_contact_list (
- GabblePluginConnection *plugin_connection)
-{
- GabblePluginConnectionInterface *iface =
- GABBLE_PLUGIN_CONNECTION_GET_IFACE (plugin_connection);
-
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (iface->get_contact_list != NULL, NULL);
-
- return iface->get_contact_list (plugin_connection);
-}
-
-WockyXep0115Capabilities *
-gabble_plugin_connection_get_caps (
- GabblePluginConnection *plugin_connection,
- TpHandle handle)
-{
- GabblePluginConnectionInterface *iface =
- GABBLE_PLUGIN_CONNECTION_GET_IFACE (plugin_connection);
-
- g_return_val_if_fail (iface != NULL, NULL);
- g_return_val_if_fail (iface->get_contact_list != NULL, NULL);
-
- return iface->get_caps (plugin_connection, handle);
-}
diff --git a/src/plugin-loader.c b/src/plugin-loader.c
index d5a451fec..7e016b899 100644
--- a/src/plugin-loader.c
+++ b/src/plugin-loader.c
@@ -290,10 +290,8 @@ gabble_plugin_loader_create_sidecar (
GSimpleAsyncResult *res = g_simple_async_result_new (G_OBJECT (self),
callback, user_data, gabble_plugin_loader_create_sidecar);
- GabblePluginConnection *gabble_conn =
- GABBLE_PLUGIN_CONNECTION (connection);
- gabble_plugin_create_sidecar_async (p, sidecar_interface,
- gabble_conn, session, create_sidecar_cb, res);
+ gabble_plugin_create_sidecar_async (p, sidecar_interface, connection, session,
+ create_sidecar_cb, res);
return;
}
}
@@ -385,7 +383,6 @@ copy_to_other_array (gpointer data,
GPtrArray *
gabble_plugin_loader_create_channel_managers (
GabblePluginLoader *self,
- GabblePluginConnection *plugin_connection,
TpBaseConnection *connection)
{
GPtrArray *out = g_ptr_array_new ();
@@ -396,8 +393,7 @@ gabble_plugin_loader_create_channel_managers (
GabblePlugin *plugin = g_ptr_array_index (self->priv->plugins, i);
GPtrArray *managers;
- managers = gabble_plugin_create_channel_managers (plugin,
- plugin_connection, connection);
+ managers = gabble_plugin_create_channel_managers (plugin, connection);
if (managers == NULL)
continue;
diff --git a/src/plugin-loader.h b/src/plugin-loader.h
index d22a186eb..9983d4b44 100644
--- a/src/plugin-loader.h
+++ b/src/plugin-loader.h
@@ -28,7 +28,6 @@
#include <wocky/wocky-session.h>
#include "gabble/sidecar.h"
-#include "gabble/plugin-connection.h"
typedef struct _GabblePluginLoader GabblePluginLoader;
typedef struct _GabblePluginLoaderClass GabblePluginLoaderClass;
@@ -87,8 +86,6 @@ const gchar *gabble_plugin_loader_presence_status_for_privacy_list (
const gchar *list_name);
GPtrArray * gabble_plugin_loader_create_channel_managers (
- GabblePluginLoader *self,
- GabblePluginConnection *plugin_connection,
- TpBaseConnection *connection);
+ GabblePluginLoader *self, TpBaseConnection *connection);
#endif /* #ifndef __PLUGIN_LOADER_H__ */
diff --git a/src/plugin.c b/src/plugin.c
index fe38abe57..783e721a4 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -99,7 +99,7 @@ void
gabble_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
- GabblePluginConnection *plugin_connection,
+ GabbleConnection *connection,
WockySession *session,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -122,7 +122,7 @@ gabble_plugin_create_sidecar_async (
"'%s' is buggy: does not imlement create_sidecar_finish",
iface->name);
else
- iface->create_sidecar_async (plugin, sidecar_interface, plugin_connection, session,
+ iface->create_sidecar_async (plugin, sidecar_interface, connection, session,
callback, user_data);
}
@@ -211,7 +211,6 @@ gabble_plugin_presence_status_for_privacy_list (
GPtrArray *
gabble_plugin_create_channel_managers (GabblePlugin *plugin,
- GabblePluginConnection *plugin_connection,
TpBaseConnection *connection)
{
GabblePluginInterface *iface = GABBLE_PLUGIN_GET_INTERFACE (plugin);
@@ -219,7 +218,7 @@ gabble_plugin_create_channel_managers (GabblePlugin *plugin,
GPtrArray *out = NULL;
if (func != NULL)
- out = func (plugin, plugin_connection, connection);
+ out = func (plugin, connection);
return out;
}