summaryrefslogtreecommitdiff
path: root/plugins/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/console.c')
-rw-r--r--plugins/console.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/plugins/console.c b/plugins/console.c
index 13ca0eccf..b0ba7c592 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 (
+gabble_console_plugin_create_sidecar_async (
GabblePlugin *plugin,
const gchar *sidecar_interface,
GabbleConnection *connection,
@@ -87,10 +87,7 @@ gabble_console_plugin_create_sidecar (
{
GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin),
callback, user_data,
- /* sic: all plugins share gabble_plugin_create_sidecar_finish() so we
- * need to use the same source tag.
- */
- gabble_plugin_create_sidecar);
+ gabble_console_plugin_create_sidecar_async);
GabbleSidecar *sidecar = NULL;
if (!tp_strdiff (sidecar_interface, GABBLE_IFACE_GABBLE_PLUGIN_CONSOLE))
@@ -114,6 +111,27 @@ gabble_console_plugin_create_sidecar (
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,
@@ -124,7 +142,8 @@ plugin_iface_init (
iface->name = "XMPP console";
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
- iface->create_sidecar = gabble_console_plugin_create_sidecar;
+ iface->create_sidecar_async = gabble_console_plugin_create_sidecar_async;
+ iface->create_sidecar_finish = gabble_console_plugin_create_sidecar_finish;
}
GabblePlugin *