summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-02-01 21:07:25 (GMT)
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-02-01 21:07:25 (GMT)
commitab745cbdead64a313fe3e8859cec5bf7c4382dc9 (patch)
tree024c6049bdae369f8833b02c0c5ed38691bbf419
parent1d41beb99b03f828fd204e6e18fa7499360937b9 (diff)
downloadtelepathy-gabble-ab745cbdead64a313fe3e8859cec5bf7c4382dc9.tar.gz
telepathy-gabble-ab745cbdead64a313fe3e8859cec5bf7c4382dc9.tar.xz
Revert "Merge remote-tracking branch 'siraj/plugin-api-change'"
This reverts commit bf805ba0b2ecced81e5c2830a79d021a42da91a7, reversing changes made to 1296a2f5ce46e77787ca42eadb1c2ca4a957a09b.
-rw-r--r--NEWS6
-rw-r--r--gabble/plugin.h16
-rw-r--r--plugins/console.c31
-rw-r--r--plugins/gateways.c31
-rw-r--r--plugins/test.c33
-rw-r--r--src/Makefile.am23
-rw-r--r--src/plugin-loader.c2
-rw-r--r--src/plugin.c24
8 files changed, 34 insertions, 132 deletions
diff --git a/NEWS b/NEWS
index ea0e356..57ad771 100644
--- a/NEWS
+++ b/NEWS
@@ -30,12 +30,6 @@ 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.
-
telepathy-gabble 0.15.3 (2011-12-22)
====================================
diff --git a/gabble/plugin.h b/gabble/plugin.h
index ffb888c..6da99f1 100644
--- a/gabble/plugin.h
+++ b/gabble/plugin.h
@@ -60,11 +60,6 @@ typedef GPtrArray * (*GabblePluginCreateChannelManagersImpl) (
GabblePlugin *plugin,
TpBaseConnection *connection);
-typedef GabbleSidecar * (*GabblePluginCreateSidecarFinishImpl) (
- GabblePlugin *plugin,
- GAsyncResult *result,
- GError **error);
-
struct _GabblePluginPrivacyListMap {
const gchar *presence_status_name;
const gchar *privacy_list_name;
@@ -86,14 +81,9 @@ struct _GabblePluginInterface {
const gchar * const *sidecar_interfaces;
/**
- * An implementation of gabble_plugin_create_sidecar_async().
- */
- GabblePluginCreateSidecarImpl create_sidecar_async;
-
- /**
- * An implementation of gabble_plugin_create_sidecar_finish().
+ * An implementation of gabble_plugin_create_sidecar().
*/
- GabblePluginCreateSidecarFinishImpl create_sidecar_finish;
+ GabblePluginCreateSidecarImpl create_sidecar;
/**
* The plugin's version, conventionally a "."-separated sequence of
@@ -130,7 +120,7 @@ gboolean gabble_plugin_implements_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface);
-void gabble_plugin_create_sidecar_async (
+void gabble_plugin_create_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
diff --git a/plugins/console.c b/plugins/console.c
index 8d6795c..13ca0ec 100644
--- a/plugins/console.c
+++ b/plugins/console.c
@@ -77,7 +77,7 @@ gabble_console_plugin_class_init (GabbleConsolePluginClass *klass)
}
static void
-gabble_console_plugin_create_sidecar_async (
+gabble_console_plugin_create_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
@@ -87,7 +87,10 @@ gabble_console_plugin_create_sidecar_async (
{
GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin),
callback, user_data,
- gabble_console_plugin_create_sidecar_async);
+ /* sic: all plugins share gabble_plugin_create_sidecar_finish() so we
+ * need to use the same source tag.
+ */
+ gabble_plugin_create_sidecar);
GabbleSidecar *sidecar = NULL;
if (!tp_strdiff (sidecar_interface, GABBLE_IFACE_GABBLE_PLUGIN_CONSOLE))
@@ -111,27 +114,6 @@ gabble_console_plugin_create_sidecar_async (
g_object_unref (result);
}
-static GabbleSidecar *
-gabble_console_plugin_create_sidecar_finish (
- GabblePlugin *plugin,
- GAsyncResult *result,
- GError **error)
-{
- GabbleSidecar *sidecar;
-
- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
- error))
- return NULL;
-
- g_return_val_if_fail (g_simple_async_result_is_valid (result,
- G_OBJECT (plugin), gabble_console_plugin_create_sidecar_async), NULL);
-
- sidecar = GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
- G_SIMPLE_ASYNC_RESULT (result)));
-
- return g_object_ref (sidecar);
-}
-
static void
plugin_iface_init (
gpointer g_iface,
@@ -142,8 +124,7 @@ plugin_iface_init (
iface->name = "XMPP console";
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
- iface->create_sidecar_async = gabble_console_plugin_create_sidecar_async;
- iface->create_sidecar_finish = gabble_console_plugin_create_sidecar_finish;
+ iface->create_sidecar = gabble_console_plugin_create_sidecar;
}
GabblePlugin *
diff --git a/plugins/gateways.c b/plugins/gateways.c
index 1e7b141..88a3222 100644
--- a/plugins/gateways.c
+++ b/plugins/gateways.c
@@ -75,7 +75,7 @@ gabble_gateway_plugin_class_init (GabbleGatewayPluginClass *klass)
}
static void
-gabble_gateway_plugin_create_sidecar_async (
+gabble_gateway_plugin_create_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
@@ -85,7 +85,10 @@ gabble_gateway_plugin_create_sidecar_async (
{
GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin),
callback, user_data,
- gabble_gateway_plugin_create_sidecar_async);
+ /* sic: all plugins share gabble_plugin_create_sidecar_finish() so we
+ * need to use the same source tag.
+ */
+ gabble_plugin_create_sidecar);
GabbleSidecar *sidecar = NULL;
if (!tp_strdiff (sidecar_interface, GABBLE_IFACE_GABBLE_PLUGIN_GATEWAYS))
@@ -109,27 +112,6 @@ gabble_gateway_plugin_create_sidecar_async (
g_object_unref (result);
}
-static GabbleSidecar *
-gabble_gateway_plugin_create_sidecar_finish (
- GabblePlugin *plugin,
- GAsyncResult *result,
- GError **error)
-{
- GabbleSidecar *sidecar;
-
- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
- error))
- return NULL;
-
- g_return_val_if_fail (g_simple_async_result_is_valid (result,
- G_OBJECT (plugin), gabble_gateway_plugin_create_sidecar_async), NULL);
-
- sidecar = GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
- G_SIMPLE_ASYNC_RESULT (result)));
-
- return g_object_ref (sidecar);
-}
-
static void
plugin_iface_init (
gpointer g_iface,
@@ -140,8 +122,7 @@ plugin_iface_init (
iface->name = "Gateway registration plugin";
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
- iface->create_sidecar_async = gabble_gateway_plugin_create_sidecar_async;
- iface->create_sidecar_finish = gabble_gateway_plugin_create_sidecar_finish;
+ iface->create_sidecar = gabble_gateway_plugin_create_sidecar;
}
GabblePlugin *
diff --git a/plugins/test.c b/plugins/test.c
index 43b18ea..05d7840 100644
--- a/plugins/test.c
+++ b/plugins/test.c
@@ -80,7 +80,7 @@ sidecar_iq_created_cb (
}
static void
-test_plugin_create_sidecar_async (
+test_plugin_create_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
@@ -90,8 +90,10 @@ test_plugin_create_sidecar_async (
{
GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin),
callback, user_data,
- test_plugin_create_sidecar_async);
-
+ /* sic: all plugins share gabble_plugin_create_sidecar_finish() so we
+ * need to use the same source tag.
+ */
+ gabble_plugin_create_sidecar);
GabbleSidecar *sidecar = NULL;
if (!tp_strdiff (sidecar_interface, IFACE_TEST))
@@ -122,31 +124,9 @@ test_plugin_create_sidecar_async (
g_simple_async_result_set_op_res_gpointer (result, sidecar, g_object_unref);
g_simple_async_result_complete_in_idle (result);
-
g_object_unref (result);
}
-static GabbleSidecar *
-test_plugin_create_sidecar_finish (
- GabblePlugin *plugin,
- GAsyncResult *result,
- GError **error)
-{
- GabbleSidecar *sidecar;
-
- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
- error))
- return NULL;
-
- g_return_val_if_fail (g_simple_async_result_is_valid (result,
- G_OBJECT (plugin), test_plugin_create_sidecar_async), NULL);
-
- sidecar = GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
- G_SIMPLE_ASYNC_RESULT (result)));
-
- return g_object_ref (sidecar);
-}
-
static GPtrArray *
test_plugin_create_channel_managers (GabblePlugin *plugin,
TpBaseConnection *connection)
@@ -184,8 +164,7 @@ plugin_iface_init (
iface->name = "Sidecar test plugin";
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
- iface->create_sidecar_async = test_plugin_create_sidecar_async;
- iface->create_sidecar_finish = test_plugin_create_sidecar_finish;
+ iface->create_sidecar = test_plugin_create_sidecar;
iface->create_channel_managers = test_plugin_create_channel_managers;
iface->presence_statuses = test_presences;
diff --git a/src/Makefile.am b/src/Makefile.am
index 01afbcc..ffcd3d6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -232,22 +232,12 @@ check_c_sources = \
include $(top_srcdir)/tools/check-coding-style.mk
check-local: check-coding-style
-if WINDOWS
-telepathy_gabble_LDADD = -lgabble-runtime
-else
telepathy_gabble_LDADD = libgabble-convenience.la
+
telepathy_gabble_LDFLAGS = -export-dynamic
-endif
noinst_LTLIBRARIES = libgabble-convenience.la
-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@ \
@DBUS_CFLAGS@ @GLIB_CFLAGS@ @WOCKY_CFLAGS@ \
@@ -257,18 +247,13 @@ AM_CFLAGS = $(ERROR_CFLAGS) -I$(top_srcdir) -I$(top_builddir) \
-DG_LOG_DOMAIN=\"gabble\" \
-DPLUGIN_DIR=\"$(libdir)/telepathy/gabble-0\"
-#on windows we need to avoid adding wocky static library twice
-#if not it results in a linker error.
-ALL_LIBS = @DBUS_LIBS@ @GLIB_LIBS@ @TP_GLIB_LIBS@ \
- @SOUP_LIBS@ @NICE_LIBS@ @GMODULE_LIBS@
-
# following flag is requied to make getnameinfo work
if WINDOWS
-AM_CFLAGS += -D_WIN32_WINNT=0x0501
-else
-ALL_LIBS += @WOCKY_LIBS@
+ AM_CFLAGS += -D_WIN32_WINNT=0x0501
endif
+ALL_LIBS = @DBUS_LIBS@ @GLIB_LIBS@ @WOCKY_LIBS@ @TP_GLIB_LIBS@ \
+ @SOUP_LIBS@ @NICE_LIBS@ @GMODULE_LIBS@
# build gibber first
all: gibber
diff --git a/src/plugin-loader.c b/src/plugin-loader.c
index 7e016b8..2568ff5 100644
--- a/src/plugin-loader.c
+++ b/src/plugin-loader.c
@@ -290,7 +290,7 @@ gabble_plugin_loader_create_sidecar (
GSimpleAsyncResult *res = g_simple_async_result_new (G_OBJECT (self),
callback, user_data, gabble_plugin_loader_create_sidecar);
- gabble_plugin_create_sidecar_async (p, sidecar_interface, connection, session,
+ gabble_plugin_create_sidecar (p, sidecar_interface, connection, session,
create_sidecar_cb, res);
return;
}
diff --git a/src/plugin.c b/src/plugin.c
index 783e721..4f35de7 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -96,7 +96,7 @@ gabble_plugin_implements_sidecar (
* @user_data: data to pass to @callback
*/
void
-gabble_plugin_create_sidecar_async (
+gabble_plugin_create_sidecar (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
@@ -111,18 +111,13 @@ gabble_plugin_create_sidecar_async (
user_data, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"Gabble is buggy: '%s' doesn't implement sidecar %s",
iface->name, sidecar_interface);
- else if (iface->create_sidecar_async == NULL)
+ else if (iface->create_sidecar == NULL)
g_simple_async_report_error_in_idle (G_OBJECT (plugin), callback,
user_data, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
"'%s' is buggy: it claims to implement %s, but does not implement "
- "create_sidecar_async", iface->name, sidecar_interface);
- else if (iface->create_sidecar_finish == NULL)
- g_simple_async_report_error_in_idle (G_OBJECT (plugin), callback,
- user_data, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
- "'%s' is buggy: does not imlement create_sidecar_finish",
- iface->name);
+ "create_sidecar", iface->name, sidecar_interface);
else
- iface->create_sidecar_async (plugin, sidecar_interface, connection, session,
+ iface->create_sidecar (plugin, sidecar_interface, connection, session,
callback, user_data);
}
@@ -132,20 +127,17 @@ gabble_plugin_create_sidecar_finish (
GAsyncResult *result,
GError **error)
{
- GabblePluginInterface *iface = GABBLE_PLUGIN_GET_INTERFACE (plugin);
GabbleSidecar *sidecar;
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
error))
return NULL;
- if (iface->create_sidecar_finish == NULL) {
- WARNING ("'%s' is buggy: does not implement create_sidecar_finish", iface->name);
- return NULL;
- }
-
- sidecar = iface->create_sidecar_finish (plugin, result, error);
+ g_return_val_if_fail (g_simple_async_result_is_valid (result,
+ G_OBJECT (plugin), gabble_plugin_create_sidecar), NULL);
+ sidecar = GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
+ G_SIMPLE_ASYNC_RESULT (result)));
return g_object_ref (sidecar);
}