summaryrefslogtreecommitdiff
path: root/plugin-base
diff options
context:
space:
mode:
authorSiraj Razick <siraj.razick@collabora.co.uk>2012-01-20 18:22:24 -0500
committerSiraj Razick <siraj.razick@collabora.co.uk>2012-02-01 14:48:43 -0500
commit3e1d4d08094fa6b9d7d8ecfe5e0495f0379e5f3a (patch)
tree9e96f157567d2b8a7bc331d87473b2bdc7da118e /plugin-base
parent4f94ae6e1f8cadad7922ba9d669aac8fcdbf186a (diff)
Updates the Code to match the New Gabble Plugin API
Use GabblePluginConnection instead of GabbleConnection
Diffstat (limited to 'plugin-base')
-rw-r--r--plugin-base/channel-manager.c8
-rw-r--r--plugin-base/ytstenut.c16
2 files changed, 15 insertions, 9 deletions
diff --git a/plugin-base/channel-manager.c b/plugin-base/channel-manager.c
index 0cf6e97..5dcc003 100644
--- a/plugin-base/channel-manager.c
+++ b/plugin-base/channel-manager.c
@@ -40,8 +40,8 @@ typedef SalutConnection FooConnection;
#define foo_connection_get_session salut_connection_get_session
#else
#include <gabble/caps-channel-manager.h>
-typedef GabbleConnection FooConnection;
-#define foo_connection_get_session gabble_connection_get_session
+typedef GabblePluginConnection FooConnection;
+#define foo_connection_get_session gabble_plugin_connection_get_session
#endif
#include <telepathy-ytstenut-glib/telepathy-ytstenut-glib.h>
@@ -498,7 +498,7 @@ ytst_channel_manager_create_channel (TpChannelManager *manager,
tp_asv_get_string (request_properties,
TP_YTS_IFACE_CHANNEL ".TargetService"));
- resource = gabble_connection_pick_best_resource_for_caps (priv->connection,
+ resource = gabble_plugin_connection_pick_best_resource_for_caps (priv->connection,
name, gabble_capability_set_predicate_has, service);
g_free (service);
@@ -511,7 +511,7 @@ ytst_channel_manager_create_channel (TpChannelManager *manager,
jid = g_strdup_printf ("%s/%s", name, resource);
- full_jid = gabble_connection_get_full_jid (priv->connection);
+ full_jid = gabble_plugin_connection_get_full_jid (priv->connection);
#endif
request = ytst_message_channel_build_request (request_properties,
diff --git a/plugin-base/ytstenut.c b/plugin-base/ytstenut.c
index e293354..965ca32 100644
--- a/plugin-base/ytstenut.c
+++ b/plugin-base/ytstenut.c
@@ -19,6 +19,7 @@
*/
#include "config.h"
+#include <stdio.h>
#include "ytstenut.h"
@@ -34,8 +35,9 @@ typedef SalutConnection FooConnection;
typedef SalutSidecar FooSidecar;
#else
#include <gabble/plugin.h>
+#include <gabble/plugin-connection.h>
typedef GabblePlugin FooPlugin;
-typedef GabbleConnection FooConnection;
+typedef GabblePluginConnection FooConnection;
typedef GabbleSidecar FooSidecar;
#endif
@@ -86,7 +88,7 @@ ytstenut_plugin_initialize (SalutPlugin *plugin,
#endif
static void
-ytstenut_plugin_create_sidecar (
+ytstenut_plugin_create_sidecar_async (
FooPlugin *plugin,
const gchar *sidecar_interface,
FooConnection *connection,
@@ -102,7 +104,7 @@ ytstenut_plugin_create_sidecar (
#ifdef SALUT
salut_plugin_create_sidecar_async
#else
- gabble_plugin_create_sidecar
+ ytstenut_plugin_create_sidecar_async
#endif
);
FooSidecar *sidecar = NULL;
@@ -122,17 +124,21 @@ ytstenut_plugin_create_sidecar (
g_simple_async_result_set_op_res_gpointer (result, sidecar, g_object_unref);
g_simple_async_result_complete_in_idle (result);
+
+ g_simple_async_result_is_valid ((GAsyncResult*) result, G_OBJECT (plugin), NULL);
+
g_object_unref (result);
}
static GPtrArray *
ytstenut_plugin_create_channel_managers (
FooPlugin *plugin,
+ FooConnection *plugin_connection,
TpBaseConnection *connection)
{
GPtrArray *ret = g_ptr_array_sized_new (1);
- DEBUG ("%p on connection %p", plugin, connection);
+ DEBUG ("%p on connection %p", plugin, plugin_connection);
g_ptr_array_add (ret, g_object_new (YTST_TYPE_CAPS_MANAGER, NULL));
g_ptr_array_add (ret, ytst_channel_manager_new (connection));
@@ -159,7 +165,7 @@ plugin_iface_init (gpointer g_iface,
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
- iface->create_sidecar = ytstenut_plugin_create_sidecar;
+ iface->create_sidecar_async = ytstenut_plugin_create_sidecar_async;
iface->create_channel_managers = ytstenut_plugin_create_channel_managers;
}