summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-02-21 10:02:20 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-02-21 10:02:20 +0000
commitda94cce048afbd64571b7aaf01ee68f786797875 (patch)
tree1ca5b25940b287abdf4f7da312a45113d91617a7
parent19eac2dbc40a90f44811fc178508a9fc33cb9b9e (diff)
parentca3488c19990e0a629e46194da3925c291366c77 (diff)
Merge branch 'salut-api-update'
Conflicts: gabble/message-channel.c gabble/status.c salut/message-channel.c salut/status.c
-rw-r--r--gabble/message-channel.c2
-rw-r--r--gabble/status.c2
-rw-r--r--plugin-base/channel-manager.c10
-rw-r--r--plugin-base/ytstenut.c36
-rw-r--r--salut/message-channel.c26
-rw-r--r--salut/message-channel.h4
-rw-r--r--salut/status.c12
-rw-r--r--salut/status.h4
8 files changed, 41 insertions, 55 deletions
diff --git a/gabble/message-channel.c b/gabble/message-channel.c
index 333b129..b20ce2b 100644
--- a/gabble/message-channel.c
+++ b/gabble/message-channel.c
@@ -49,8 +49,6 @@
#include <telepathy-ytstenut-glib/telepathy-ytstenut-glib.h>
-#include <wocky/wocky.h>
-
#include <gabble/plugin-connection.h>
#define DEBUG(msg, ...) \
diff --git a/gabble/status.c b/gabble/status.c
index ab1b063..a0e445f 100644
--- a/gabble/status.c
+++ b/gabble/status.c
@@ -30,8 +30,6 @@
#include <telepathy-glib/svc-generic.h>
#include <telepathy-glib/gtypes.h>
-#include <wocky/wocky.h>
-
#include <telepathy-ytstenut-glib/telepathy-ytstenut-glib.h>
#include "utils.h"
diff --git a/plugin-base/channel-manager.c b/plugin-base/channel-manager.c
index b351cb2..e92441b 100644
--- a/plugin-base/channel-manager.c
+++ b/plugin-base/channel-manager.c
@@ -36,8 +36,8 @@
#ifdef SALUT
#include <salut/caps-channel-manager.h>
-typedef SalutConnection FooConnection;
-#define foo_connection_get_session salut_connection_get_session
+typedef SalutPluginConnection FooConnection;
+#define foo_connection_get_session salut_plugin_connection_get_session
#else
#include <gabble/caps-channel-manager.h>
typedef GabblePluginConnection FooConnection;
@@ -288,7 +288,7 @@ ytst_channel_manager_constructed (GObject *object)
priv->channels = g_queue_new ();
#ifdef SALUT
- session = salut_connection_get_session (priv->connection);
+ session = salut_plugin_connection_get_session (priv->connection);
ytst_channel_manager_porter_available_cb (priv->connection,
wocky_session_get_porter (session), self);
@@ -476,7 +476,7 @@ ytst_channel_manager_create_channel (TpChannelManager *manager,
DEBUG ("Requested channel for handle: %u (%s)", handle, name);
#ifdef SALUT
- session = salut_connection_get_session (priv->connection);
+ session = salut_plugin_connection_get_session (priv->connection);
factory = wocky_session_get_contact_factory (session);
contact = wocky_contact_factory_lookup_ll_contact (factory, name);
if (contact == NULL)
@@ -516,7 +516,7 @@ ytst_channel_manager_create_channel (TpChannelManager *manager,
request = ytst_message_channel_build_request (request_properties,
#ifdef SALUT
- salut_connection_get_name (priv->connection), contact,
+ salut_plugin_connection_get_name (priv->connection), contact,
#else
full_jid, jid,
#endif
diff --git a/plugin-base/ytstenut.c b/plugin-base/ytstenut.c
index d9b9240..fc7e473 100644
--- a/plugin-base/ytstenut.c
+++ b/plugin-base/ytstenut.c
@@ -30,7 +30,7 @@
#include <salut/plugin.h>
#include <salut/protocol.h>
typedef SalutPlugin FooPlugin;
-typedef SalutConnection FooConnection;
+typedef SalutPluginConnection FooConnection;
typedef SalutSidecar FooSidecar;
#else
#include <gabble/plugin.h>
@@ -96,16 +96,8 @@ ytstenut_plugin_create_sidecar_async (
gpointer user_data)
{
GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (plugin),
- callback, user_data,
-#ifdef SALUT
- /* sic: all plugins share salut_plugin_create_sidecar_finish() so we
- * need to use the same source tag.
- */
- salut_plugin_create_sidecar_async
-#else
- ytstenut_plugin_create_sidecar_async
-#endif
- );
+ callback, user_data, ytstenut_plugin_create_sidecar_async);
+
FooSidecar *sidecar = NULL;
if (!tp_strdiff (sidecar_interface, TP_YTS_IFACE_STATUS))
@@ -127,14 +119,13 @@ ytstenut_plugin_create_sidecar_async (
g_object_unref (result);
}
-#ifdef GABBLE
-static GabbleSidecar *
+static FooSidecar *
ytstenut_plugin_create_sidecar_finish (
- GabblePlugin *plugin,
+ FooPlugin *plugin,
GAsyncResult *result,
GError **error)
{
- GabbleSidecar *sidecar;
+ FooSidecar *sidecar;
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
error))
@@ -143,12 +134,17 @@ ytstenut_plugin_create_sidecar_finish (
g_return_val_if_fail (g_simple_async_result_is_valid (result,
G_OBJECT (plugin), ytstenut_plugin_create_sidecar_async), NULL);
- sidecar = GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
+ sidecar =
+#ifdef GABBLE
+ GABBLE_SIDECAR (g_simple_async_result_get_op_res_gpointer (
+ G_SIMPLE_ASYNC_RESULT (result)));
+#else
+ SALUT_SIDECAR (g_simple_async_result_get_op_res_gpointer (
G_SIMPLE_ASYNC_RESULT (result)));
+#endif
return g_object_ref (sidecar);
}
-#endif
static GPtrArray *
ytstenut_plugin_create_channel_managers (
@@ -179,16 +175,14 @@ plugin_iface_init (gpointer g_iface,
#ifdef SALUT
iface->api_version = SALUT_PLUGIN_CURRENT_VERSION;
iface->initialize = ytstenut_plugin_initialize;
- iface->create_sidecar = ytstenut_plugin_create_sidecar_async;
-#else
- iface->create_sidecar_async = ytstenut_plugin_create_sidecar_async;
- iface->create_sidecar_finish = ytstenut_plugin_create_sidecar_finish;
#endif
iface->name = "Ytstenut plugin";
iface->version = PACKAGE_VERSION;
iface->sidecar_interfaces = sidecar_interfaces;
+ iface->create_sidecar_async = ytstenut_plugin_create_sidecar_async;
+ iface->create_sidecar_finish = ytstenut_plugin_create_sidecar_finish;
iface->create_channel_managers = ytstenut_plugin_create_channel_managers;
}
diff --git a/salut/message-channel.c b/salut/message-channel.c
index 87f5f86..8313bda 100644
--- a/salut/message-channel.c
+++ b/salut/message-channel.c
@@ -42,9 +42,7 @@
#include <telepathy-ytstenut-glib/telepathy-ytstenut-glib.h>
-#include <wocky/wocky.h>
-
-#include <salut/connection.h>
+#include <salut/plugin-connection.h>
#define DEBUG(msg, ...) \
g_debug ("%s: " msg, G_STRFUNC, ##__VA_ARGS__)
@@ -328,8 +326,8 @@ ytst_message_channel_close (TpBaseChannel *chan)
{
TpBaseConnection *conn = tp_base_channel_get_connection (
TP_BASE_CHANNEL (self));
- WockySession *session = salut_connection_get_session (
- SALUT_CONNECTION (conn));
+ WockySession *session = salut_plugin_connection_get_session (
+ SALUT_PLUGIN_CONNECTION (conn));
wocky_porter_send_iq_error (
wocky_session_get_porter (session),
@@ -589,7 +587,7 @@ ytst_message_channel_request (TpYtsSvcChannel *channel,
return;
}
- session = salut_connection_get_session (SALUT_CONNECTION (
+ session = salut_plugin_connection_get_session (SALUT_PLUGIN_CONNECTION (
tp_base_channel_get_connection (TP_BASE_CHANNEL (self))));
wocky_porter_send_iq_async (wocky_session_get_porter (session),
@@ -617,9 +615,9 @@ ytst_message_channel_reply (TpYtsSvcChannel *channel,
{
YtstMessageChannel *self = YTST_MESSAGE_CHANNEL (channel);
YtstMessageChannelPrivate *priv = self->priv;
- SalutConnection *conn = SALUT_CONNECTION (tp_base_channel_get_connection (
- TP_BASE_CHANNEL (self)));
- WockySession *session = salut_connection_get_session (conn);
+ SalutPluginConnection *conn = SALUT_PLUGIN_CONNECTION (
+ tp_base_channel_get_connection ( TP_BASE_CHANNEL (self)));
+ WockySession *session = salut_plugin_connection_get_session (conn);
WockyNodeTree *body_tree = NULL;
WockyNode *msg_node;
WockyStanza *reply;
@@ -689,9 +687,9 @@ ytst_message_channel_fail (TpYtsSvcChannel *channel,
YtstMessageChannelPrivate *priv = self->priv;
const gchar *type;
GError *error = NULL;
- SalutConnection *conn = SALUT_CONNECTION (tp_base_channel_get_connection (
- TP_BASE_CHANNEL (self)));
- WockySession *session = salut_connection_get_session (conn);
+ SalutPluginConnection *conn = SALUT_PLUGIN_CONNECTION (
+ tp_base_channel_get_connection (TP_BASE_CHANNEL (self)));
+ WockySession *session = salut_plugin_connection_get_session (conn);
WockyStanza *reply;
/* Can't call this method from this side */
@@ -767,7 +765,7 @@ channel_ytstenut_iface_init (gpointer g_iface,
*/
YtstMessageChannel *
-ytst_message_channel_new (SalutConnection *connection,
+ytst_message_channel_new (SalutPluginConnection *connection,
WockyLLContact *contact,
WockyStanza *request,
TpHandle handle,
@@ -776,7 +774,7 @@ ytst_message_channel_new (SalutConnection *connection,
{
YtstMessageChannel *channel;
- g_return_val_if_fail (SALUT_IS_CONNECTION (connection), NULL);
+ g_return_val_if_fail (SALUT_IS_PLUGIN_CONNECTION (connection), NULL);
g_return_val_if_fail (WOCKY_IS_LL_CONTACT (contact), NULL);
g_return_val_if_fail (WOCKY_IS_STANZA (request), NULL);
diff --git a/salut/message-channel.h b/salut/message-channel.h
index e045b51..1742ad9 100644
--- a/salut/message-channel.h
+++ b/salut/message-channel.h
@@ -27,7 +27,7 @@
#include <wocky/wocky.h>
-#include <salut/connection.h>
+#include <salut/plugin-connection.h>
G_BEGIN_DECLS
@@ -62,7 +62,7 @@ GType ytst_message_channel_get_type (void);
(G_TYPE_INSTANCE_GET_CLASS ((obj), YTST_TYPE_MESSAGE_CHANNEL, \
YtstMessageChannelClass))
-YtstMessageChannel* ytst_message_channel_new (SalutConnection *connection,
+YtstMessageChannel* ytst_message_channel_new (SalutPluginConnection *connection,
WockyLLContact *contact,
WockyStanza *request,
TpHandle handle,
diff --git a/salut/status.c b/salut/status.c
index fd5d826..6125302 100644
--- a/salut/status.c
+++ b/salut/status.c
@@ -31,8 +31,6 @@
#include <telepathy-glib/svc-generic.h>
#include <telepathy-glib/gtypes.h>
-#include <wocky/wocky.h>
-
#include <telepathy-ytstenut-glib/telepathy-ytstenut-glib.h>
#include "utils.h"
@@ -65,7 +63,7 @@ enum
struct _YtstStatusPrivate
{
WockySession *session;
- SalutConnection *connection;
+ SalutPluginConnection *connection;
guint handler_id;
gulong capabilities_changed_id;
@@ -592,8 +590,8 @@ ytst_status_class_init (YtstStatusClass *klass)
param_spec = g_param_spec_object (
"connection",
"Salut connection",
- "SalutConnection object",
- SALUT_TYPE_CONNECTION,
+ "SalutPluginConnection object",
+ SALUT_TYPE_PLUGIN_CONNECTION,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_CONNECTION,
param_spec);
@@ -698,7 +696,7 @@ ytst_status_advertise_status (TpYtsSvcStatus *svc,
capability);
stanza = wocky_pubsub_make_event_stanza (capability,
- salut_connection_get_name (priv->connection), &item);
+ salut_plugin_connection_get_name (priv->connection), &item);
wocky_node_add_node_tree (item, status_tree);
g_object_unref (status_tree);
@@ -740,7 +738,7 @@ sidecar_iface_init (SalutSidecarInterface *iface)
YtstStatus *
ytst_status_new (WockySession *session,
- SalutConnection *connection)
+ SalutPluginConnection *connection)
{
return g_object_new (YTST_TYPE_STATUS,
"session", session,
diff --git a/salut/status.h b/salut/status.h
index 43d3731..a6dda56 100644
--- a/salut/status.h
+++ b/salut/status.h
@@ -27,7 +27,7 @@
#include <wocky/wocky.h>
-#include <salut/connection.h>
+#include <salut/plugin-connection.h>
G_BEGIN_DECLS
@@ -63,7 +63,7 @@ GType ytst_status_get_type (void);
(G_TYPE_INSTANCE_GET_CLASS ((obj), YTST_TYPE_STATUS, YtstStatusClass))
YtstStatus * ytst_status_new (WockySession *session,
- SalutConnection *connection);
+ SalutPluginConnection *connection);
G_END_DECLS