[Telepathy-commits] [telepathy-gabble/master] Use TpChannelManager; remove GabbleChannelManager
Will Thompson
will.thompson at collabora.co.uk
Tue Sep 23 03:13:41 PDT 2008
---
src/Makefile.am | 2 -
src/channel-manager.c | 418 -------------------------------------------
src/channel-manager.h | 129 -------------
src/conn-olpc.c | 4 +-
src/conn-requests.c | 46 +++---
src/connection.c | 6 +-
src/im-factory.c | 26 ++--
src/media-factory.c | 22 ++--
src/muc-factory.c | 34 ++--
src/private-tubes-factory.c | 24 ++--
src/roomlist-manager.c | 26 ++--
src/roster.c | 26 ++--
12 files changed, 107 insertions(+), 656 deletions(-)
delete mode 100644 src/channel-manager.c
delete mode 100644 src/channel-manager.h
diff --git a/src/Makefile.am b/src/Makefile.am
index bd94c8c..ac1ec2a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,8 +33,6 @@ libgabble_convenience_la_our_sources = \
capabilities.c \
caps-hash.h \
caps-hash.c \
- channel-manager.h \
- channel-manager.c \
conn-aliasing.h \
conn-aliasing.c \
conn-avatars.h \
diff --git a/src/channel-manager.c b/src/channel-manager.c
deleted file mode 100644
index 42dea77..0000000
--- a/src/channel-manager.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * channel-manager.c - factory and manager for channels relating to a
- * particular protocol feature
- *
- * Copyright (C) 2008 Collabora Ltd.
- * Copyright (C) 2008 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
- */
-
-#include "config.h"
-#include "channel-manager.h"
-
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/exportable-channel.h>
-
-#include "gabble-signals-marshal.h"
-
-enum {
- S_NEW_CHANNELS,
- S_REQUEST_ALREADY_SATISFIED,
- S_REQUEST_FAILED,
- S_CHANNEL_CLOSED,
- N_SIGNALS
-};
-
-static guint signals[N_SIGNALS] = {0};
-
-
-static void
-channel_manager_base_init (gpointer klass)
-{
- static gboolean initialized = FALSE;
-
- if (!initialized)
- {
- initialized = TRUE;
-
- /* FIXME: should probably have a better GType for @channels */
- /**
- * GabbleChannelManager::new-channels:
- * @self: the channel manager
- * @channels: a #GHashTable where the keys are
- * #TpExportableChannel instances (hashed and compared
- * by g_direct_hash() and g_direct_equal()) and the values are
- * linked lists (#GSList) of requests (opaque pointers) satisfied by
- * these channels
- *
- * Emitted when new channels have been created. The Connection should
- * generally emit NewChannels (and NewChannel) in response to this
- * signal, and then return from pending CreateChannel, EnsureChannel
- * and/or RequestChannel calls if appropriate.
- */
- signals[S_NEW_CHANNELS] = g_signal_new ("new-channels",
- G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- 0,
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- /**
- * GabbleChannelManager::request-already-satisfied:
- * @self: the channel manager
- * @request_token: opaque pointer supplied by the requester,
- * representing a request
- * @channel: the existing #TpExportableChannel that satisfies the
- * request
- *
- * Emitted when a channel request is satisfied by an existing channel.
- * The Connection should generally respond to this signal by returning
- * success from EnsureChannel or RequestChannel.
- */
- signals[S_REQUEST_ALREADY_SATISFIED] = g_signal_new (
- "request-already-satisfied",
- G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- 0,
- NULL, NULL,
- gabble_marshal_VOID__POINTER_OBJECT,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_OBJECT);
-
- /**
- * GabbleChannelManager::request-failed:
- * @self: the channel manager
- * @request_token: opaque pointer supplied by the requester,
- * representing a request
- * @domain: the domain of a #GError indicating why the request
- * failed
- * @code: the error code of a #GError indicating why the request
- * failed
- * @message: the string part of a #GError indicating why the request
- * failed
- *
- * Emitted when a channel request has failed. The Connection should
- * generally respond to this signal by returning failure from
- * CreateChannel, EnsureChannel or RequestChannel.
- */
- signals[S_REQUEST_FAILED] = g_signal_new ("request-failed",
- G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- 0,
- NULL, NULL,
- gabble_marshal_VOID__POINTER_UINT_INT_STRING,
- G_TYPE_NONE, 4, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_INT,
- G_TYPE_STRING);
-
- /**
- * GabbleChannelManager::channel-closed:
- * @self: the channel manager
- * @path: the channel's object-path
- *
- * Emitted when a channel has been closed. The Connection should
- * generally respond to this signal by emitting ChannelClosed.
- */
- signals[S_CHANNEL_CLOSED] = g_signal_new ("channel-closed",
- G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
- 0,
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE, 1, G_TYPE_STRING);
-
- }
-}
-
-GType
-gabble_channel_manager_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- static const GTypeInfo info = {
- sizeof (GabbleChannelManagerIface),
- channel_manager_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL /* instance_init */
- };
-
- type = g_type_register_static (G_TYPE_INTERFACE,
- "GabbleChannelManager", &info, 0);
- }
-
- return type;
-}
-
-
-/* Signal emission wrappers */
-
-
-/**
- * gabble_channel_manager_emit_new_channels:
- * @instance: An object implementing #GabbleChannelManager
- * @channels: a #GHashTable where the keys are
- * #TpExportableChannel instances (hashed and compared
- * by g_direct_hash() and g_direct_equal()) and the values are
- * linked lists (#GSList) of requests (opaque pointers) satisfied by
- * these channels
- *
- * If @channels is non-empty, emit the #GabbleChannelManager::new-channels
- * signal indicating that those channels have been created.
- */
-void
-gabble_channel_manager_emit_new_channels (gpointer instance,
- GHashTable *channels)
-{
- g_return_if_fail (GABBLE_IS_CHANNEL_MANAGER (instance));
-
- if (g_hash_table_size (channels) == 0)
- return;
-
- g_signal_emit (instance, signals[S_NEW_CHANNELS], 0, channels);
-}
-
-
-/**
- * gabble_channel_manager_emit_new_channel:
- * @instance: An object implementing #GabbleChannelManager
- * @channel: A #TpExportableChannel
- *
- * Emit the #GabbleChannelManager::new-channels signal indicating that the
- * channel has been created. (This is a convenient shortcut for calling
- * gabble_channel_manager_emit_new_channels() with a one-entry hash table.)
- */
-void
-gabble_channel_manager_emit_new_channel (gpointer instance,
- TpExportableChannel *channel,
- GSList *requests)
-{
- GHashTable *channels;
-
- g_return_if_fail (GABBLE_IS_CHANNEL_MANAGER (instance));
- g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel));
-
- channels = g_hash_table_new_full (g_direct_hash, g_direct_equal,
- NULL, NULL);
- g_hash_table_insert (channels, channel, requests);
- g_signal_emit (instance, signals[S_NEW_CHANNELS], 0, channels);
- g_hash_table_destroy (channels);
-}
-
-
-/**
- * gabble_channel_manager_emit_channel_closed:
- * @instance: An object implementing #GabbleChannelManager
- * @path: A channel's object-path
- *
- * Emit the #GabbleChannelManager::channel-closed signal indicating that
- * the channel at the given object path has been closed.
- */
-void
-gabble_channel_manager_emit_channel_closed (gpointer instance,
- const gchar *path)
-{
- g_return_if_fail (GABBLE_IS_CHANNEL_MANAGER (instance));
- g_return_if_fail (tp_dbus_check_valid_object_path (path, NULL));
-
- g_signal_emit (instance, signals[S_CHANNEL_CLOSED], 0, path);
-}
-
-
-/**
- * gabble_channel_manager_emit_channel_closed_for_object:
- * @instance: An object implementing #GabbleChannelManager
- * @channel: A #TpExportableChannel
- *
- * Emit the #GabbleChannelManager::channel-closed signal indicating that
- * the given channel has been closed. (This is a convenient shortcut for
- * calling gabble_channel_manager_emit_channel_closed() with the
- * #TpExportableChannel:object-path property of @channel.)
- */
-void
-gabble_channel_manager_emit_channel_closed_for_object (gpointer instance,
- TpExportableChannel *channel)
-{
- gchar *path;
-
- g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel));
- g_object_get (channel,
- "object-path", &path,
- NULL);
- gabble_channel_manager_emit_channel_closed (instance, path);
- g_free (path);
-}
-
-
-/**
- * gabble_channel_manager_emit_request_already_satisfied:
- * @instance: An object implementing #GabbleChannelManager
- * @request_token: An opaque pointer representing the request that
- * succeeded
- * @channel: The channel that satisfies the request
- *
- * Emit the #GabbleChannelManager::request-already-satisfied signal indicating
- * that the pre-existing channel @channel satisfies @request_token.
- */
-void
-gabble_channel_manager_emit_request_already_satisfied (gpointer instance,
- gpointer request_token,
- TpExportableChannel *channel)
-{
- g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel));
- g_return_if_fail (GABBLE_IS_CHANNEL_MANAGER (instance));
-
- g_signal_emit (instance, signals[S_REQUEST_ALREADY_SATISFIED], 0,
- request_token, channel);
-}
-
-
-/**
- * gabble_channel_manager_emit_request_failed:
- * @instance: An object implementing #GabbleChannelManager
- * @request_token: An opaque pointer representing the request that failed
- * @domain: a #GError domain
- * @code: a #GError code appropriate for @domain
- * @message: the error message
- *
- * Emit the #GabbleChannelManager::request-failed signal indicating that
- * the request @request_token failed for the given reason.
- */
-void
-gabble_channel_manager_emit_request_failed (gpointer instance,
- gpointer request_token,
- GQuark domain,
- gint code,
- const gchar *message)
-{
- g_return_if_fail (GABBLE_IS_CHANNEL_MANAGER (instance));
-
- g_signal_emit (instance, signals[S_REQUEST_FAILED], 0, request_token,
- domain, code, message);
-}
-
-
-/**
- * gabble_channel_manager_emit_request_failed_printf:
- * @instance: An object implementing #GabbleChannelManager
- * @request_token: An opaque pointer representing the request that failed
- * @domain: a #GError domain
- * @code: a #GError code appropriate for @domain
- * @format: a printf-style format string for the error message
- * @...: arguments for the format string
- *
- * Emit the #GabbleChannelManager::request-failed signal indicating that
- * the request @request_token failed for the given reason.
- */
-void
-gabble_channel_manager_emit_request_failed_printf (gpointer instance,
- gpointer request_token,
- GQuark domain,
- gint code,
- const gchar *format,
- ...)
-{
- va_list ap;
- gchar *message;
-
- va_start (ap, format);
- message = g_strdup_vprintf (format, ap);
- va_end (ap);
-
- gabble_channel_manager_emit_request_failed (instance, request_token,
- domain, code, message);
-
- g_free (message);
-}
-
-
-/* Virtual-method wrappers */
-
-
-void
-gabble_channel_manager_foreach_channel (GabbleChannelManager *manager,
- TpExportableChannelFunc func,
- gpointer user_data)
-{
- GabbleChannelManagerIface *iface = GABBLE_CHANNEL_MANAGER_GET_INTERFACE (
- manager);
- GabbleChannelManagerForeachChannelFunc method = iface->foreach_channel;
-
- if (method != NULL)
- {
- method (manager, func, user_data);
- }
- /* ... else assume it has no channels, and do nothing */
-}
-
-
-void
-gabble_channel_manager_foreach_channel_class (GabbleChannelManager *manager,
- GabbleChannelManagerChannelClassFunc func,
- gpointer user_data)
-{
- GabbleChannelManagerIface *iface = GABBLE_CHANNEL_MANAGER_GET_INTERFACE (
- manager);
- GabbleChannelManagerForeachChannelClassFunc method =
- iface->foreach_channel_class;
-
- if (method != NULL)
- {
- method (manager, func, user_data);
- }
- /* ... else assume it has no classes of requestable channel */
-}
-
-
-gboolean
-gabble_channel_manager_create_channel (GabbleChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
-{
- GabbleChannelManagerIface *iface = GABBLE_CHANNEL_MANAGER_GET_INTERFACE (
- manager);
- GabbleChannelManagerRequestFunc method = iface->create_channel;
-
- /* A missing implementation is equivalent to one that always returns FALSE,
- * meaning "can't do that, ask someone else" */
- if (method != NULL)
- return method (manager, request_token, request_properties);
- else
- return FALSE;
-}
-
-
-gboolean
-gabble_channel_manager_request_channel (GabbleChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
-{
- GabbleChannelManagerIface *iface = GABBLE_CHANNEL_MANAGER_GET_INTERFACE (
- manager);
- GabbleChannelManagerRequestFunc method = iface->request_channel;
-
- /* A missing implementation is equivalent to one that always returns FALSE,
- * meaning "can't do that, ask someone else" */
- if (method != NULL)
- return method (manager, request_token, request_properties);
- else
- return FALSE;
-}
diff --git a/src/channel-manager.h b/src/channel-manager.h
deleted file mode 100644
index 30f059e..0000000
--- a/src/channel-manager.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * channel-manager.h - factory and manager for channels relating to a
- * particular protocol feature
- *
- * Copyright (C) 2008 Collabora Ltd.
- * Copyright (C) 2008 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_CHANNEL_MANAGER_H
-#define GABBLE_CHANNEL_MANAGER_H
-
-#include <glib-object.h>
-
-#include <telepathy-glib/exportable-channel.h>
-
-G_BEGIN_DECLS
-
-#define GABBLE_TYPE_CHANNEL_MANAGER (gabble_channel_manager_get_type ())
-
-#define GABBLE_CHANNEL_MANAGER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
- GABBLE_TYPE_CHANNEL_MANAGER, GabbleChannelManager))
-
-#define GABBLE_IS_CHANNEL_MANAGER(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
- GABBLE_TYPE_CHANNEL_MANAGER))
-
-#define GABBLE_CHANNEL_MANAGER_GET_INTERFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
- GABBLE_TYPE_CHANNEL_MANAGER, GabbleChannelManagerIface))
-
-typedef struct _GabbleChannelManager GabbleChannelManager;
-typedef struct _GabbleChannelManagerIface GabbleChannelManagerIface;
-
-
-/* virtual methods */
-
-typedef void (*GabbleChannelManagerForeachChannelFunc) (
- GabbleChannelManager *manager, TpExportableChannelFunc func,
- gpointer user_data);
-
-void gabble_channel_manager_foreach_channel (GabbleChannelManager *manager,
- TpExportableChannelFunc func, gpointer user_data);
-
-
-typedef void (*GabbleChannelManagerChannelClassFunc) (
- GabbleChannelManager *manager,
- GHashTable *fixed_properties,
- const gchar * const *allowed_properties,
- gpointer user_data);
-
-typedef void (*GabbleChannelManagerForeachChannelClassFunc) (
- GabbleChannelManager *manager, GabbleChannelManagerChannelClassFunc func,
- gpointer user_data);
-
-void gabble_channel_manager_foreach_channel_class (
- GabbleChannelManager *manager,
- GabbleChannelManagerChannelClassFunc func, gpointer user_data);
-
-
-typedef gboolean (*GabbleChannelManagerRequestFunc) (
- GabbleChannelManager *manager, gpointer request_token,
- GHashTable *request_properties);
-
-gboolean gabble_channel_manager_create_channel (GabbleChannelManager *manager,
- gpointer request_token, GHashTable *request_properties);
-
-gboolean gabble_channel_manager_request_channel (GabbleChannelManager *manager,
- gpointer request_token, GHashTable *request_properties);
-
-
-struct _GabbleChannelManagerIface {
- GTypeInterface parent;
-
- GabbleChannelManagerForeachChannelFunc foreach_channel;
-
- GabbleChannelManagerForeachChannelClassFunc foreach_channel_class;
-
- GabbleChannelManagerRequestFunc create_channel;
- GabbleChannelManagerRequestFunc request_channel;
- /* in principle we could have EnsureChannel here too */
-
- GCallback _future[8];
- gpointer priv;
-};
-
-
-GType gabble_channel_manager_get_type (void);
-
-
-/* signal emission */
-
-void gabble_channel_manager_emit_new_channel (gpointer instance,
- TpExportableChannel *channel, GSList *requests);
-void gabble_channel_manager_emit_new_channels (gpointer instance,
- GHashTable *channels);
-
-void gabble_channel_manager_emit_channel_closed (gpointer instance,
- const gchar *path);
-void gabble_channel_manager_emit_channel_closed_for_object (gpointer instance,
- TpExportableChannel *channel);
-
-void gabble_channel_manager_emit_request_already_satisfied (
- gpointer instance, gpointer request_token,
- TpExportableChannel *channel);
-
-void gabble_channel_manager_emit_request_failed (gpointer instance,
- gpointer request_token, GQuark domain, gint code, const gchar *message);
-void gabble_channel_manager_emit_request_failed_printf (gpointer instance,
- gpointer request_token, GQuark domain, gint code, const gchar *format,
- ...) G_GNUC_PRINTF (5, 6);
-
-G_END_DECLS
-
-#endif
diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index b19a98a..2bd658c 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -22,12 +22,12 @@
#include <string.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/util.h>
#define DEBUG_FLAG GABBLE_DEBUG_OLPC
#include "debug.h"
-#include "channel-manager.h"
#include "connection.h"
#include "muc-channel.h"
#include "presence-cache.h"
@@ -2632,7 +2632,7 @@ conn_olpc_activity_properties_init (GabbleConnection *conn)
g_signal_connect (conn, "status-changed",
G_CALLBACK (connection_status_changed_cb), NULL);
- g_signal_connect (GABBLE_CHANNEL_MANAGER (conn->muc_factory), "new-channels",
+ g_signal_connect (TP_CHANNEL_MANAGER (conn->muc_factory), "new-channels",
G_CALLBACK (muc_factory_new_channels_cb), conn);
g_signal_connect (conn->presence_cache, "presences-updated",
diff --git a/src/conn-requests.c b/src/conn-requests.c
index 9406cc2..d29583d 100644
--- a/src/conn-requests.c
+++ b/src/conn-requests.c
@@ -22,6 +22,7 @@
#include "conn-requests.h"
#include <telepathy-glib/channel-factory-iface.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/exportable-channel.h>
#include <telepathy-glib/gtypes.h>
@@ -32,7 +33,6 @@
#include "extensions/extensions.h"
#define DEBUG_FLAG GABBLE_DEBUG_CONNECTION
-#include "channel-manager.h"
#include "debug.h"
@@ -458,10 +458,10 @@ conn_requests_request_channel (TpSvcConnection *iface,
for (i = 0; i < self->channel_managers->len; i++)
{
- GabbleChannelManager *manager = GABBLE_CHANNEL_MANAGER (
+ TpChannelManager *manager = TP_CHANNEL_MANAGER (
g_ptr_array_index (self->channel_managers, i));
- if (gabble_channel_manager_request_channel (manager, request,
+ if (tp_channel_manager_request_channel (manager, request,
request_properties))
return;
}
@@ -754,10 +754,10 @@ conn_requests_list_channels (TpSvcConnection *iface,
for (i = 0; i < self->channel_managers->len; i++)
{
- GabbleChannelManager *manager = g_ptr_array_index
+ TpChannelManager *manager = g_ptr_array_index
(self->channel_managers, i);
- gabble_channel_manager_foreach_channel (manager,
+ tp_channel_manager_foreach_channel (manager,
list_channel_manager_foreach_one, values);
}
@@ -823,10 +823,10 @@ conn_requests_get_channel_details (GabbleConnection *self)
for (i = 0; i < self->channel_managers->len; i++)
{
- GabbleChannelManager *manager = GABBLE_CHANNEL_MANAGER (
+ TpChannelManager *manager = TP_CHANNEL_MANAGER (
g_ptr_array_index (self->channel_managers, i));
- gabble_channel_manager_foreach_channel (manager,
+ tp_channel_manager_foreach_channel (manager,
manager_get_channel_details_foreach, details);
}
@@ -835,7 +835,7 @@ conn_requests_get_channel_details (GabbleConnection *self)
static void
-get_requestables_foreach (GabbleChannelManager *manager,
+get_requestables_foreach (TpChannelManager *manager,
GHashTable *fixed_properties,
const gchar * const *allowed_properties,
gpointer user_data)
@@ -867,10 +867,10 @@ conn_requests_get_requestables (GabbleConnection *self)
for (i = 0; i < self->channel_managers->len; i++)
{
- GabbleChannelManager *manager = GABBLE_CHANNEL_MANAGER (
+ TpChannelManager *manager = TP_CHANNEL_MANAGER (
g_ptr_array_index (self->channel_managers, i));
- gabble_channel_manager_foreach_channel_class (manager,
+ tp_channel_manager_foreach_channel_class (manager,
get_requestables_foreach, details);
}
@@ -917,7 +917,7 @@ conn_requests_requestotron (GabbleConnection *self,
ChannelRequest *request = NULL;
GHashTable *altered_properties = NULL;
const gchar *type;
- GabbleChannelManagerRequestFunc func;
+ TpChannelManagerRequestFunc func;
gboolean suppress_handler;
TpHandleType target_handle_type;
TpHandle target_handle;
@@ -1054,13 +1054,13 @@ conn_requests_requestotron (GabbleConnection *self,
switch (method)
{
case METHOD_CREATE_CHANNEL:
- func = gabble_channel_manager_create_channel;
+ func = tp_channel_manager_create_channel;
suppress_handler = TRUE;
break;
#if 0
case METHOD_ENSURE_CHANNEL:
- func = gabble_channel_manager_ensure_channel;
+ func = tp_channel_manager_ensure_channel;
suppress_handler = FALSE;
break;
#endif
@@ -1075,7 +1075,7 @@ conn_requests_requestotron (GabbleConnection *self,
for (i = 0; i < self->channel_managers->len; i++)
{
- GabbleChannelManager *manager = GABBLE_CHANNEL_MANAGER (
+ TpChannelManager *manager = TP_CHANNEL_MANAGER (
g_ptr_array_index (self->channel_managers, i));
if (func (manager, request, requested_properties))
@@ -1184,13 +1184,13 @@ manager_new_channels_foreach (gpointer key,
static void
-manager_new_channels_cb (GabbleChannelManager *manager,
+manager_new_channels_cb (TpChannelManager *manager,
GHashTable *channels,
GabbleConnection *self)
{
GPtrArray *array;
- g_assert (GABBLE_IS_CHANNEL_MANAGER (manager));
+ g_assert (TP_IS_CHANNEL_MANAGER (manager));
g_assert (GABBLE_IS_CONNECTION (self));
array = g_ptr_array_sized_new (g_hash_table_size (channels));
@@ -1205,14 +1205,14 @@ manager_new_channels_cb (GabbleChannelManager *manager,
static void
-manager_request_already_satisfied_cb (GabbleChannelManager *manager,
+manager_request_already_satisfied_cb (TpChannelManager *manager,
gpointer request_token,
TpExportableChannel *channel,
GabbleConnection *self)
{
gchar *object_path;
- g_assert (GABBLE_IS_CHANNEL_MANAGER (manager));
+ g_assert (TP_IS_CHANNEL_MANAGER (manager));
g_assert (TP_IS_EXPORTABLE_CHANNEL (channel));
g_assert (GABBLE_IS_CONNECTION (self));
@@ -1226,7 +1226,7 @@ manager_request_already_satisfied_cb (GabbleChannelManager *manager,
static void
-manager_request_failed_cb (GabbleChannelManager *manager,
+manager_request_failed_cb (TpChannelManager *manager,
gpointer request_token,
guint domain,
gint code,
@@ -1235,7 +1235,7 @@ manager_request_failed_cb (GabbleChannelManager *manager,
{
GError error = { domain, code, message };
- g_assert (GABBLE_IS_CHANNEL_MANAGER (manager));
+ g_assert (TP_IS_CHANNEL_MANAGER (manager));
g_assert (domain > 0);
g_assert (message != NULL);
g_assert (GABBLE_IS_CONNECTION (self));
@@ -1245,11 +1245,11 @@ manager_request_failed_cb (GabbleChannelManager *manager,
static void
-manager_channel_closed_cb (GabbleChannelManager *manager,
+manager_channel_closed_cb (TpChannelManager *manager,
const gchar *path,
GabbleConnection *self)
{
- g_assert (GABBLE_IS_CHANNEL_MANAGER (manager));
+ g_assert (TP_IS_CHANNEL_MANAGER (manager));
g_assert (path != NULL);
g_assert (GABBLE_IS_CONNECTION (self));
@@ -1285,7 +1285,7 @@ gabble_conn_requests_init (GabbleConnection *self)
for (i = 0; i < self->channel_managers->len; i++)
{
- GabbleChannelManager *manager = GABBLE_CHANNEL_MANAGER (
+ TpChannelManager *manager = TP_CHANNEL_MANAGER (
g_ptr_array_index (self->channel_managers, i));
g_signal_connect (manager, "new-channels",
diff --git a/src/connection.c b/src/connection.c
index b24cb0a..514749f 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -29,6 +29,7 @@
#include <dbus/dbus-glib-lowlevel.h>
#include <glib-object.h>
#include <loudmouth/loudmouth.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/enums.h>
#include <telepathy-glib/errors.h>
@@ -46,7 +47,6 @@
#include "bytestream-factory.h"
#include "capabilities.h"
#include "caps-hash.h"
-#include "channel-manager.h"
#include "conn-aliasing.h"
#include "conn-avatars.h"
#include "conn-presence.h"
@@ -1341,8 +1341,8 @@ _gabble_connection_signal_own_presence (GabbleConnection *self, GError **error)
lm_message_unref (message);
/* broadcast presence to MUCs */
- gabble_channel_manager_foreach_channel (
- GABBLE_CHANNEL_MANAGER (self->muc_factory),
+ tp_channel_manager_foreach_channel (
+ TP_CHANNEL_MANAGER (self->muc_factory),
(TpExportableChannelFunc) gabble_muc_channel_send_presence, NULL);
return ret;
diff --git a/src/im-factory.c b/src/im-factory.c
index f0aca7a..f8fd3c2 100644
--- a/src/im-factory.c
+++ b/src/im-factory.c
@@ -27,12 +27,12 @@
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <loudmouth/loudmouth.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/interfaces.h>
#define DEBUG_FLAG GABBLE_DEBUG_IM
-#include "channel-manager.h"
#include "connection.h"
#include "debug.h"
#include "disco.h"
@@ -42,7 +42,7 @@
static void channel_manager_iface_init (gpointer, gpointer);
G_DEFINE_TYPE_WITH_CODE (GabbleImFactory, gabble_im_factory, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CHANNEL_MANAGER,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
channel_manager_iface_init));
/* properties */
@@ -316,7 +316,7 @@ im_channel_closed_cb (GabbleIMChannel *chan, gpointer user_data)
"channel-destroyed", &really_destroyed,
NULL);
- gabble_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (self,
(TpExportableChannel *) chan);
if (priv->channels != NULL)
@@ -337,7 +337,7 @@ im_channel_closed_cb (GabbleIMChannel *chan, gpointer user_data)
DEBUG ("reopening channel with handle %u due to pending messages",
contact_handle);
- gabble_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (self,
(TpExportableChannel *) chan, NULL);
}
}
@@ -388,7 +388,7 @@ new_im_channel (GabbleImFactory *fac,
else
request_tokens = NULL;
- gabble_channel_manager_emit_new_channel (fac,
+ tp_channel_manager_emit_new_channel (fac,
(TpExportableChannel *) chan, request_tokens);
g_slist_free (request_tokens);
@@ -468,7 +468,7 @@ _foreach_slave (gpointer key, gpointer value, gpointer user_data)
}
static void
-gabble_im_factory_foreach_channel (GabbleChannelManager *manager,
+gabble_im_factory_foreach_channel (TpChannelManager *manager,
TpExportableChannelFunc func,
gpointer user_data)
{
@@ -489,8 +489,8 @@ static const gchar * const im_channel_allowed_properties[] = {
static void
-gabble_im_factory_foreach_channel_class (GabbleChannelManager *manager,
- GabbleChannelManagerChannelClassFunc func,
+gabble_im_factory_foreach_channel_class (TpChannelManager *manager,
+ TpChannelManagerChannelClassFunc func,
gpointer user_data)
{
GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -556,12 +556,12 @@ gabble_im_factory_requestotron (GabbleImFactory *self,
goto error;
}
- gabble_channel_manager_emit_request_already_satisfied (self, request_token,
+ tp_channel_manager_emit_request_already_satisfied (self, request_token,
channel);
return TRUE;
error:
- gabble_channel_manager_emit_request_failed (self, request_token,
+ tp_channel_manager_emit_request_failed (self, request_token,
error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
@@ -569,7 +569,7 @@ error:
static gboolean
-gabble_im_factory_create_channel (GabbleChannelManager *manager,
+gabble_im_factory_create_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -581,7 +581,7 @@ gabble_im_factory_create_channel (GabbleChannelManager *manager,
static gboolean
-gabble_im_factory_request_channel (GabbleChannelManager *manager,
+gabble_im_factory_request_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -596,7 +596,7 @@ static void
channel_manager_iface_init (gpointer g_iface,
gpointer iface_data)
{
- GabbleChannelManagerIface *iface = g_iface;
+ TpChannelManagerIface *iface = g_iface;
iface->foreach_channel = gabble_im_factory_foreach_channel;
iface->foreach_channel_class = gabble_im_factory_foreach_channel_class;
diff --git a/src/media-factory.c b/src/media-factory.c
index 2701cfc..3306ba2 100644
--- a/src/media-factory.c
+++ b/src/media-factory.c
@@ -28,12 +28,12 @@
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <loudmouth/loudmouth.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/interfaces.h>
#define DEBUG_FLAG GABBLE_DEBUG_MEDIA
-#include "channel-manager.h"
#include "connection.h"
#include "debug.h"
#include "media-channel.h"
@@ -47,7 +47,7 @@ static LmHandlerResult media_factory_jingle_cb (LmMessageHandler *,
G_DEFINE_TYPE_WITH_CODE (GabbleMediaFactory, gabble_media_factory,
G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CHANNEL_MANAGER,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
channel_manager_iface_init));
/* properties */
@@ -342,7 +342,7 @@ media_factory_jingle_cb (LmMessageHandler *handler,
{
if (chan_is_new)
{
- gabble_channel_manager_emit_new_channel (fac,
+ tp_channel_manager_emit_new_channel (fac,
TP_EXPORTABLE_CHANNEL (chan), NULL);
}
}
@@ -460,7 +460,7 @@ media_channel_closed_cb (GabbleMediaChannel *chan, gpointer user_data)
GabbleMediaFactory *fac = GABBLE_MEDIA_FACTORY (user_data);
GabbleMediaFactoryPrivate *priv = GABBLE_MEDIA_FACTORY_GET_PRIVATE (fac);
- gabble_channel_manager_emit_channel_closed_for_object (fac,
+ tp_channel_manager_emit_channel_closed_for_object (fac,
TP_EXPORTABLE_CHANNEL (chan));
if (priv->channels != NULL)
@@ -818,7 +818,7 @@ gabble_media_factory_constructed (GObject *object)
static void
-gabble_media_factory_foreach_channel (GabbleChannelManager *manager,
+gabble_media_factory_foreach_channel (TpChannelManager *manager,
TpExportableChannelFunc foreach,
gpointer user_data)
{
@@ -848,8 +848,8 @@ static const gchar * const anon_channel_allowed_properties[] = {
static void
-gabble_media_factory_foreach_channel_class (GabbleChannelManager *manager,
- GabbleChannelManagerChannelClassFunc func,
+gabble_media_factory_foreach_channel_class (TpChannelManager *manager,
+ TpChannelManagerChannelClassFunc func,
gpointer user_data)
{
GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -876,7 +876,7 @@ gabble_media_factory_foreach_channel_class (GabbleChannelManager *manager,
static gboolean
-gabble_media_factory_request_channel (GabbleChannelManager *manager,
+gabble_media_factory_request_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -949,14 +949,14 @@ gabble_media_factory_request_channel (GabbleChannelManager *manager,
g_assert (channel != NULL);
request_tokens = g_slist_prepend (NULL, request_token);
- gabble_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (self,
TP_EXPORTABLE_CHANNEL (channel), request_tokens);
g_slist_free (request_tokens);
return TRUE;
error:
- gabble_channel_manager_emit_request_failed (self, request_token,
+ tp_channel_manager_emit_request_failed (self, request_token,
error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
@@ -967,7 +967,7 @@ static void
channel_manager_iface_init (gpointer g_iface,
gpointer iface_data)
{
- GabbleChannelManagerIface *iface = g_iface;
+ TpChannelManagerIface *iface = g_iface;
iface->foreach_channel = gabble_media_factory_foreach_channel;
iface->foreach_channel_class = gabble_media_factory_foreach_channel_class;
diff --git a/src/muc-factory.c b/src/muc-factory.c
index 251024b..47ca36a 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -27,13 +27,13 @@
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <loudmouth/loudmouth.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
#define DEBUG_FLAG GABBLE_DEBUG_MUC
-#include "channel-manager.h"
#include "connection.h"
#include "conn-olpc.h"
#include "debug.h"
@@ -48,7 +48,7 @@
static void channel_manager_iface_init (gpointer, gpointer);
G_DEFINE_TYPE_WITH_CODE (GabbleMucFactory, gabble_muc_factory, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CHANNEL_MANAGER,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
channel_manager_iface_init));
/* properties */
@@ -234,7 +234,7 @@ muc_channel_closed_cb (GabbleMucChannel *chan, gpointer user_data)
GabbleMucFactoryPrivate *priv = GABBLE_MUC_FACTORY_GET_PRIVATE (fac);
TpHandle room_handle;
- gabble_channel_manager_emit_channel_closed_for_object (fac,
+ tp_channel_manager_emit_channel_closed_for_object (fac,
TP_EXPORTABLE_CHANNEL (chan));
if (priv->text_channels != NULL)
@@ -271,7 +271,7 @@ tubes_channel_closed_cb (GabbleTubesChannel *chan, gpointer user_data)
GabbleMucFactoryPrivate *priv = GABBLE_MUC_FACTORY_GET_PRIVATE (fac);
TpHandle room_handle;
- gabble_channel_manager_emit_channel_closed_for_object (fac,
+ tp_channel_manager_emit_channel_closed_for_object (fac,
TP_EXPORTABLE_CHANNEL (chan));
if (priv->tubes_channels != NULL)
@@ -296,7 +296,7 @@ gabble_muc_factory_emit_new_channel (GabbleMucFactory *self,
requests_satisfied = g_hash_table_lookup (priv->queued_requests, channel);
g_hash_table_steal (priv->queued_requests, channel);
requests_satisfied = g_slist_reverse (requests_satisfied);
- gabble_channel_manager_emit_new_channel (self, channel, requests_satisfied);
+ tp_channel_manager_emit_new_channel (self, channel, requests_satisfied);
g_slist_free (requests_satisfied);
}
@@ -341,7 +341,7 @@ muc_join_error_cb (GabbleMucChannel *chan,
for (iter = requests_satisfied; iter != NULL; iter = iter->next)
{
- gabble_channel_manager_emit_request_failed (fac, iter->data,
+ tp_channel_manager_emit_request_failed (fac, iter->data,
error->domain, error->code, error->message);
}
@@ -359,7 +359,7 @@ muc_join_error_cb (GabbleMucChannel *chan,
for (iter = requests_satisfied; iter != NULL; iter = iter->next)
{
- gabble_channel_manager_emit_request_failed (fac, iter->data,
+ tp_channel_manager_emit_request_failed (fac, iter->data,
error->domain, error->code, error->message);
}
@@ -1002,7 +1002,7 @@ cancel_queued_requests (gpointer k,
for (iter = requests_satisfied; iter != NULL; iter = iter->next)
{
- gabble_channel_manager_emit_request_failed (self,
+ tp_channel_manager_emit_request_failed (self,
iter->data, TP_ERRORS, TP_ERROR_DISCONNECTED,
"Unable to complete this channel request, we're disconnecting!");
}
@@ -1141,7 +1141,7 @@ _foreach_slave (gpointer key, gpointer value, gpointer user_data)
}
static void
-gabble_muc_factory_foreach_channel (GabbleChannelManager *manager,
+gabble_muc_factory_foreach_channel (TpChannelManager *manager,
TpExportableChannelFunc foreach,
gpointer user_data)
{
@@ -1241,8 +1241,8 @@ static const gchar * const * muc_tubes_channel_allowed_properties =
static void
-gabble_muc_factory_foreach_channel_class (GabbleChannelManager *manager,
- GabbleChannelManagerChannelClassFunc func,
+gabble_muc_factory_foreach_channel_class (TpChannelManager *manager,
+ TpChannelManagerChannelClassFunc func,
gpointer user_data)
{
GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -1312,7 +1312,7 @@ gabble_muc_factory_request (GabbleMucFactory *self,
}
else
{
- gabble_channel_manager_emit_request_already_satisfied (self,
+ tp_channel_manager_emit_request_already_satisfied (self,
request_token, TP_EXPORTABLE_CHANNEL (text_chan));
}
}
@@ -1339,7 +1339,7 @@ gabble_muc_factory_request (GabbleMucFactory *self,
}
else
{
- gabble_channel_manager_emit_request_already_satisfied (self,
+ tp_channel_manager_emit_request_already_satisfied (self,
request_token, TP_EXPORTABLE_CHANNEL (tubes_chan));
}
}
@@ -1370,7 +1370,7 @@ gabble_muc_factory_request (GabbleMucFactory *self,
}
error:
- gabble_channel_manager_emit_request_failed (self, request_token,
+ tp_channel_manager_emit_request_failed (self, request_token,
error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
@@ -1378,7 +1378,7 @@ error:
static gboolean
-gabble_muc_factory_create_channel (GabbleChannelManager *manager,
+gabble_muc_factory_create_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -1390,7 +1390,7 @@ gabble_muc_factory_create_channel (GabbleChannelManager *manager,
static gboolean
-gabble_muc_factory_request_channel (GabbleChannelManager *manager,
+gabble_muc_factory_request_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -1405,7 +1405,7 @@ static void
channel_manager_iface_init (gpointer g_iface,
gpointer iface_data)
{
- GabbleChannelManagerIface *iface = g_iface;
+ TpChannelManagerIface *iface = g_iface;
iface->foreach_channel = gabble_muc_factory_foreach_channel;
iface->foreach_channel_class = gabble_muc_factory_foreach_channel_class;
diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c
index e71166b..3054e4e 100644
--- a/src/private-tubes-factory.c
+++ b/src/private-tubes-factory.c
@@ -26,13 +26,13 @@
#include <dbus/dbus-glib-lowlevel.h>
#include <loudmouth/loudmouth.h>
#include <telepathy-glib/channel-factory-iface.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
#define DEBUG_FLAG GABBLE_DEBUG_TUBES
-#include "channel-manager.h"
#include "connection.h"
#include "debug.h"
#include "muc-channel.h"
@@ -58,7 +58,7 @@ static void channel_manager_iface_init (gpointer, gpointer);
G_DEFINE_TYPE_WITH_CODE (GabblePrivateTubesFactory,
gabble_private_tubes_factory,
G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CHANNEL_MANAGER,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
channel_manager_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_FACTORY_IFACE,
gabble_private_tubes_factory_iface_init));
@@ -261,7 +261,7 @@ tubes_channel_closed_cb (GabbleTubesChannel *chan,
g_object_get (chan, "handle", &contact_handle, NULL);
- gabble_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (self,
TP_EXPORTABLE_CHANNEL (chan));
DEBUG ("removing tubes channel with handle %d", contact_handle);
@@ -320,7 +320,7 @@ new_tubes_channel (GabblePrivateTubesFactory *fac,
else
request_tokens = NULL;
- gabble_channel_manager_emit_new_channel (fac,
+ tp_channel_manager_emit_new_channel (fac,
TP_EXPORTABLE_CHANNEL (chan), request_tokens);
g_slist_free (request_tokens);
@@ -380,7 +380,7 @@ _foreach_slave (gpointer key,
}
static void
-gabble_private_tubes_factory_foreach_channel (GabbleChannelManager *manager,
+gabble_private_tubes_factory_foreach_channel (TpChannelManager *manager,
TpExportableChannelFunc foreach,
gpointer user_data)
{
@@ -562,8 +562,8 @@ static const gchar * const tubes_channel_allowed_properties[] = {
static void
gabble_private_tubes_factory_foreach_channel_class (
- GabbleChannelManager *manager,
- GabbleChannelManagerChannelClassFunc func,
+ TpChannelManager *manager,
+ TpChannelManagerChannelClassFunc func,
gpointer user_data)
{
GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -637,12 +637,12 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
goto error;
}
- gabble_channel_manager_emit_request_already_satisfied (self, request_token,
+ tp_channel_manager_emit_request_already_satisfied (self, request_token,
channel);
return TRUE;
error:
- gabble_channel_manager_emit_request_failed (self, request_token,
+ tp_channel_manager_emit_request_failed (self, request_token,
error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
@@ -650,7 +650,7 @@ error:
static gboolean
-gabble_private_tubes_factory_create_channel (GabbleChannelManager *manager,
+gabble_private_tubes_factory_create_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -662,7 +662,7 @@ gabble_private_tubes_factory_create_channel (GabbleChannelManager *manager,
static gboolean
-gabble_private_tubes_factory_request_channel (GabbleChannelManager *manager,
+gabble_private_tubes_factory_request_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -677,7 +677,7 @@ static void
channel_manager_iface_init (gpointer g_iface,
gpointer iface_data)
{
- GabbleChannelManagerIface *iface = g_iface;
+ TpChannelManagerIface *iface = g_iface;
iface->foreach_channel = gabble_private_tubes_factory_foreach_channel;
iface->foreach_channel_class =
diff --git a/src/roomlist-manager.c b/src/roomlist-manager.c
index 984dcad..41f0b29 100644
--- a/src/roomlist-manager.c
+++ b/src/roomlist-manager.c
@@ -26,13 +26,13 @@
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <loudmouth/loudmouth.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/util.h>
#define DEBUG_FLAG GABBLE_DEBUG_MUC
-#include "channel-manager.h"
#include "connection.h"
#include "debug.h"
#include "namespaces.h"
@@ -45,7 +45,7 @@ static void channel_manager_iface_init (gpointer, gpointer);
G_DEFINE_TYPE_WITH_CODE (GabbleRoomlistManager, gabble_roomlist_manager,
G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CHANNEL_MANAGER,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
channel_manager_iface_init));
@@ -237,7 +237,7 @@ gabble_roomlist_manager_class_init (GabbleRoomlistManagerClass *klass)
static void
-gabble_roomlist_manager_foreach_channel (GabbleChannelManager *manager,
+gabble_roomlist_manager_foreach_channel (TpChannelManager *manager,
TpExportableChannelFunc foreach,
gpointer user_data)
{
@@ -261,8 +261,8 @@ static const gchar * const roomlist_channel_allowed_properties[] = {
static void
-gabble_roomlist_manager_foreach_channel_class (GabbleChannelManager *manager,
- GabbleChannelManagerChannelClassFunc func,
+gabble_roomlist_manager_foreach_channel_class (TpChannelManager *manager,
+ TpChannelManagerChannelClassFunc func,
gpointer user_data)
{
GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -289,7 +289,7 @@ roomlist_channel_closed_cb (GabbleRoomlistChannel *channel,
{
GabbleRoomlistManager *self = GABBLE_ROOMLIST_MANAGER (user_data);
- gabble_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (self,
TP_EXPORTABLE_CHANNEL (channel));
if (self->priv->channels != NULL)
@@ -301,7 +301,7 @@ roomlist_channel_closed_cb (GabbleRoomlistChannel *channel,
static gboolean
-gabble_roomlist_manager_handle_request (GabbleChannelManager *manager,
+gabble_roomlist_manager_handle_request (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties,
gboolean require_new)
@@ -365,7 +365,7 @@ gabble_roomlist_manager_handle_request (GabbleChannelManager *manager,
if (good)
{
- gabble_channel_manager_emit_request_already_satisfied (self,
+ tp_channel_manager_emit_request_already_satisfied (self,
request_token, TP_EXPORTABLE_CHANNEL (channel));
return TRUE;
}
@@ -387,7 +387,7 @@ gabble_roomlist_manager_handle_request (GabbleChannelManager *manager,
g_ptr_array_add (self->priv->channels, channel);
request_tokens = g_slist_prepend (NULL, request_token);
- gabble_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (self,
TP_EXPORTABLE_CHANNEL (channel), request_tokens);
g_slist_free (request_tokens);
@@ -396,7 +396,7 @@ gabble_roomlist_manager_handle_request (GabbleChannelManager *manager,
return TRUE;
error:
- gabble_channel_manager_emit_request_failed (self, request_token,
+ tp_channel_manager_emit_request_failed (self, request_token,
error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
@@ -404,7 +404,7 @@ error:
static gboolean
-gabble_roomlist_manager_create_channel (GabbleChannelManager *manager,
+gabble_roomlist_manager_create_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -414,7 +414,7 @@ gabble_roomlist_manager_create_channel (GabbleChannelManager *manager,
static gboolean
-gabble_roomlist_manager_request_channel (GabbleChannelManager *manager,
+gabble_roomlist_manager_request_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -427,7 +427,7 @@ static void
channel_manager_iface_init (gpointer g_iface,
gpointer iface_data)
{
- GabbleChannelManagerIface *iface = g_iface;
+ TpChannelManagerIface *iface = g_iface;
iface->foreach_channel = gabble_roomlist_manager_foreach_channel;
iface->foreach_channel_class = gabble_roomlist_manager_foreach_channel_class;
diff --git a/src/roster.c b/src/roster.c
index da7571b..60f6fb5 100644
--- a/src/roster.c
+++ b/src/roster.c
@@ -27,12 +27,12 @@
#include <string.h>
#include <dbus/dbus-glib.h>
+#include <telepathy-glib/channel-manager.h>
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/interfaces.h>
#define DEBUG_FLAG GABBLE_DEBUG_ROSTER
-#include "channel-manager.h"
#include "conn-aliasing.h"
#include "connection.h"
#include "debug.h"
@@ -132,7 +132,7 @@ static void item_edit_free (GabbleRosterItemEdit *edits);
static void gabble_roster_close_all (GabbleRoster *roster);
G_DEFINE_TYPE_WITH_CODE (GabbleRoster, gabble_roster, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CHANNEL_MANAGER,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER,
channel_manager_iface_init));
#define GABBLE_ROSTER_GET_PRIVATE(o) ((o)->priv)
@@ -851,7 +851,7 @@ gabble_roster_emit_new_channel (GabbleRoster *self,
requests_satisfied = g_hash_table_lookup (priv->queued_requests, channel);
g_hash_table_steal (priv->queued_requests, channel);
requests_satisfied = g_slist_reverse (requests_satisfied);
- gabble_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (self,
TP_EXPORTABLE_CHANNEL (channel), requests_satisfied);
g_slist_free (requests_satisfied);
}
@@ -875,7 +875,7 @@ roster_channel_closed_cb (GabbleRosterChannel *channel,
g_assert (handle_type == TP_HANDLE_TYPE_LIST ||
handle_type == TP_HANDLE_TYPE_GROUP);
- gabble_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (self,
TP_EXPORTABLE_CHANNEL (channel));
channels = (handle_type == TP_HANDLE_TYPE_LIST
@@ -1651,7 +1651,7 @@ cancel_queued_requests (gpointer k,
for (iter = requests_satisfied; iter != NULL; iter = iter->next)
{
- gabble_channel_manager_emit_request_failed (self,
+ tp_channel_manager_emit_request_failed (self,
iter->data, TP_ERRORS, TP_ERROR_DISCONNECTED,
"Unable to complete this channel request, we're disconnecting!");
}
@@ -1793,7 +1793,7 @@ _gabble_roster_foreach_channel_helper (gpointer key,
}
static void
-gabble_roster_foreach_channel (GabbleChannelManager *manager,
+gabble_roster_foreach_channel (TpChannelManager *manager,
TpExportableChannelFunc func,
gpointer data)
{
@@ -2477,8 +2477,8 @@ static const gchar * const *group_channel_allowed_properties =
static void
-gabble_roster_foreach_channel_class (GabbleChannelManager *manager,
- GabbleChannelManagerChannelClassFunc func,
+gabble_roster_foreach_channel_class (TpChannelManager *manager,
+ TpChannelManagerChannelClassFunc func,
gpointer user_data)
{
GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -2568,7 +2568,7 @@ gabble_roster_request (GabbleRoster *self,
if (self->priv->roster_received)
{
if (!created)
- gabble_channel_manager_emit_request_already_satisfied (self,
+ tp_channel_manager_emit_request_already_satisfied (self,
request_token, TP_EXPORTABLE_CHANNEL (channel));
}
else
@@ -2579,7 +2579,7 @@ gabble_roster_request (GabbleRoster *self,
return TRUE;
error:
- gabble_channel_manager_emit_request_failed (self, request_token,
+ tp_channel_manager_emit_request_failed (self, request_token,
error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
@@ -2587,7 +2587,7 @@ error:
static gboolean
-gabble_roster_create_channel (GabbleChannelManager *manager,
+gabble_roster_create_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -2603,7 +2603,7 @@ gabble_roster_create_channel (GabbleChannelManager *manager,
static gboolean
-gabble_roster_request_channel (GabbleChannelManager *manager,
+gabble_roster_request_channel (TpChannelManager *manager,
gpointer request_token,
GHashTable *request_properties)
{
@@ -2618,7 +2618,7 @@ static void
channel_manager_iface_init (gpointer g_iface,
gpointer iface_data)
{
- GabbleChannelManagerIface *iface = g_iface;
+ TpChannelManagerIface *iface = g_iface;
iface->foreach_channel = gabble_roster_foreach_channel;
iface->foreach_channel_class = gabble_roster_foreach_channel_class;
--
1.5.6.5
More information about the Telepathy-commits
mailing list