summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-01-28 16:26:44 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-01-29 14:28:06 +0100
commitb4f51ab2f4c9dc6490d309188ee2717a934e54ee (patch)
treed9e66f98ce502af1dd4ff817b5351d53875c7878
parentc252ced5cf209e869fb75dabae61f18e0db0850d (diff)
new TpChannelManager API
-rw-r--r--plugins/console/channel-manager.c18
-rw-r--r--plugins/test.c1
-rw-r--r--src/auth-manager.c5
-rw-r--r--src/ft-manager.c16
-rw-r--r--src/im-factory.c42
-rw-r--r--src/media-factory.c29
-rw-r--r--src/muc-factory.c74
-rw-r--r--src/private-tubes-factory.c41
-rw-r--r--src/roomlist-manager.c36
-rw-r--r--src/search-manager.c23
-rw-r--r--src/server-tls-manager.c5
11 files changed, 120 insertions, 170 deletions
diff --git a/plugins/console/channel-manager.c b/plugins/console/channel-manager.c
index 2f4955225..bf2a9be05 100644
--- a/plugins/console/channel-manager.c
+++ b/plugins/console/channel-manager.c
@@ -200,7 +200,7 @@ console_channel_closed_cb (
{
GabbleConsoleChannelManager *self = GABBLE_CONSOLE_CHANNEL_MANAGER (user_data);
- tp_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (channel));
if (g_queue_remove (&self->console_channels, channel))
@@ -213,14 +213,14 @@ console_channel_closed_cb (
static gboolean
gabble_console_channel_manager_create_channel (
TpChannelManager *manager,
- gpointer request_token,
+ TpChannelManagerRequest *request,
GHashTable *request_properties)
{
GabbleConsoleChannelManager *self = GABBLE_CONSOLE_CHANNEL_MANAGER (manager);
GabblePluginConnection *connection;
TpBaseChannel *channel = NULL;
GError *error = NULL;
- GSList *request_tokens;
+ GSList *requests;
if (tp_strdiff (tp_asv_get_string (request_properties,
TP_IFACE_CHANNEL ".ChannelType"),
@@ -252,17 +252,17 @@ gabble_console_channel_manager_create_channel (
self);
g_queue_push_tail (&self->console_channels, channel);
- request_tokens = g_slist_prepend (NULL, request_token);
- tp_channel_manager_emit_new_channel (self,
- TP_EXPORTABLE_CHANNEL (channel), request_tokens);
- g_slist_free (request_tokens);
+ requests = g_slist_prepend (NULL, request);
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
+ TP_EXPORTABLE_CHANNEL (channel), requests);
+ g_slist_free (requests);
g_object_unref (connection);
return TRUE;
error:
- tp_channel_manager_emit_request_failed (self, request_token,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request, error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
}
diff --git a/plugins/test.c b/plugins/test.c
index cfcc223fb..3b68e1b27 100644
--- a/plugins/test.c
+++ b/plugins/test.c
@@ -691,7 +691,6 @@ channel_manager_iface_init (gpointer g_iface,
/* not requestable. */
iface->ensure_channel = NULL;
iface->create_channel = NULL;
- iface->request_channel = NULL;
iface->foreach_channel_class = NULL;
}
diff --git a/src/auth-manager.c b/src/auth-manager.c
index ad60d0883..a46d9937a 100644
--- a/src/auth-manager.c
+++ b/src/auth-manager.c
@@ -114,7 +114,7 @@ auth_channel_closed_cb (GabbleServerSaslChannel *channel,
{
SavedError tmp = { NULL, NULL, 0, NULL };
- tp_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (channel));
g_assert (self->priv->channel == channel);
@@ -371,7 +371,7 @@ gabble_auth_manager_start_auth_async (WockyAuthRegistry *registry,
(TpBaseChannel *) self->priv->channel));
g_assert (tp_base_channel_is_registered (
(TpBaseChannel *) self->priv->channel));
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (self->priv->channel), NULL);
}
else
@@ -661,7 +661,6 @@ channel_manager_iface_init (gpointer g_iface,
/* These channels are not requestable. */
iface->ensure_channel = NULL;
iface->create_channel = NULL;
- iface->request_channel = NULL;
iface->foreach_channel_class = NULL;
}
diff --git a/src/ft-manager.c b/src/ft-manager.c
index 5b6d4b5b7..5575c8b2f 100644
--- a/src/ft-manager.c
+++ b/src/ft-manager.c
@@ -302,7 +302,7 @@ gabble_ft_manager_channels_created (GabbleFtManager *self, GList *channels)
self->priv->channels = g_list_append (self->priv->channels, chan);
/* The channels can't satisfy a request because this will always be called
when we receive an incoming jingle-share session */
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (chan), NULL);
}
}
@@ -325,8 +325,8 @@ gabble_ft_manager_channel_created (GabbleFtManager *self,
if (request_token != NULL)
requests = g_slist_prepend (requests, request_token);
- tp_channel_manager_emit_new_channel (self, TP_EXPORTABLE_CHANNEL (chan),
- requests);
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
+ TP_EXPORTABLE_CHANNEL (chan), requests);
g_slist_free (requests);
}
@@ -440,8 +440,8 @@ connection_status_changed_cb (GabbleConnection *conn,
static gboolean
gabble_ft_manager_handle_request (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
GabbleFtManager *self = GABBLE_FT_MANAGER (manager);
GabbleFileTransferChannel *chan;
@@ -588,13 +588,13 @@ gabble_ft_manager_handle_request (TpChannelManager *manager,
goto error;
}
- gabble_ft_manager_channel_created (self, chan, request_token);
+ gabble_ft_manager_channel_created (self, chan, request);
return TRUE;
error:
- tp_channel_manager_emit_request_failed (self, request_token,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request, error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
}
diff --git a/src/im-factory.c b/src/im-factory.c
index 4170d1012..2e9acf36f 100644
--- a/src/im-factory.c
+++ b/src/im-factory.c
@@ -324,8 +324,8 @@ im_channel_closed_cb (GabbleIMChannel *chan, gpointer user_data)
if (tp_base_channel_is_registered (base))
{
- tp_channel_manager_emit_channel_closed_for_object (self,
- (TpExportableChannel *) chan);
+ tp_channel_manager_emit_channel_closed_for_object (
+ TP_CHANNEL_MANAGER (self), (TpExportableChannel *) chan);
}
if (priv->channels != NULL)
@@ -340,7 +340,7 @@ im_channel_closed_cb (GabbleIMChannel *chan, gpointer user_data)
{
DEBUG ("reopening channel with handle %u due to pending messages",
contact_handle);
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
(TpExportableChannel *) chan, NULL);
}
else
@@ -400,7 +400,7 @@ new_im_channel (GabbleImFactory *fac,
else
request_tokens = NULL;
- tp_channel_manager_emit_new_channel (fac,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (fac),
(TpExportableChannel *) chan, request_tokens);
g_slist_free (request_tokens);
@@ -759,13 +759,13 @@ gabble_im_factory_requestotron (GabbleImFactory *self,
goto error;
}
- tp_channel_manager_emit_request_already_satisfied (self, request_token,
- channel);
+ tp_channel_manager_emit_request_already_satisfied (TP_CHANNEL_MANAGER (self),
+ request_token, channel);
return TRUE;
error:
- tp_channel_manager_emit_request_failed (self, request_token,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request_token, error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
}
@@ -773,36 +773,23 @@ error:
static gboolean
gabble_im_factory_create_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
GabbleImFactory *self = GABBLE_IM_FACTORY (manager);
- return gabble_im_factory_requestotron (self, request_token,
+ return gabble_im_factory_requestotron (self, request,
request_properties, TRUE);
}
-
-static gboolean
-gabble_im_factory_request_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
-{
- GabbleImFactory *self = GABBLE_IM_FACTORY (manager);
-
- return gabble_im_factory_requestotron (self, request_token,
- request_properties, FALSE);
-}
-
-
static gboolean
gabble_im_factory_ensure_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
GabbleImFactory *self = GABBLE_IM_FACTORY (manager);
- return gabble_im_factory_requestotron (self, request_token,
+ return gabble_im_factory_requestotron (self, request,
request_properties, FALSE);
}
@@ -817,7 +804,6 @@ channel_manager_iface_init (gpointer g_iface,
iface->type_foreach_channel_class =
gabble_im_factory_type_foreach_channel_class;
iface->create_channel = gabble_im_factory_create_channel;
- iface->request_channel = gabble_im_factory_request_channel;
iface->ensure_channel = gabble_im_factory_ensure_channel;
}
diff --git a/src/media-factory.c b/src/media-factory.c
index df655b568..21100052c 100644
--- a/src/media-factory.c
+++ b/src/media-factory.c
@@ -208,7 +208,7 @@ call_channel_closed_cb (GabbleCallChannel *chan, gpointer user_data)
GabbleMediaFactory *fac = GABBLE_MEDIA_FACTORY (user_data);
GabbleMediaFactoryPrivate *priv = fac->priv;
- tp_channel_manager_emit_channel_closed_for_object (fac,
+ tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (fac),
TP_EXPORTABLE_CHANNEL (chan));
DEBUG ("removing media channel %p with ref count %d",
@@ -236,7 +236,7 @@ call_channel_initialized (GObject *source,
priv->call_channels = g_list_prepend (priv->call_channels,
g_object_ref (mcr->channel));
- tp_channel_manager_emit_new_channel (mcr->self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (mcr->self),
mcr->channel, mcr->request_tokens);
g_signal_connect (mcr->channel, "closed",
@@ -246,8 +246,8 @@ call_channel_initialized (GObject *source,
{
GSList *l;
for (l = mcr->request_tokens; l != NULL; l = g_slist_next (l))
- tp_channel_manager_emit_request_failed (mcr->self, l->data,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (mcr->self),
+ l->data, error->domain, error->code, error->message);
}
media_channel_request_free (mcr);
@@ -554,8 +554,9 @@ gabble_media_factory_create_call (TpChannelManager *manager,
/* Per the spec, we ignore InitialAudio and InitialVideo when
* looking for an existing channel.
*/
- tp_channel_manager_emit_request_already_satisfied (self,
- request_token, TP_EXPORTABLE_CHANNEL (channel));
+ tp_channel_manager_emit_request_already_satisfied (
+ TP_CHANNEL_MANAGER (self), request_token,
+ TP_EXPORTABLE_CHANNEL (channel));
return TRUE;
}
}
@@ -608,28 +609,28 @@ gabble_media_factory_create_call (TpChannelManager *manager,
return TRUE;
error:
- tp_channel_manager_emit_request_failed (self, request_token,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request_token, error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
}
static gboolean
gabble_media_factory_create_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
- return gabble_media_factory_create_call (manager, request_token,
+ return gabble_media_factory_create_call (manager, request,
request_properties, METHOD_CREATE);
}
static gboolean
gabble_media_factory_ensure_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
- return gabble_media_factory_create_call (manager, request_token,
+ return gabble_media_factory_create_call (manager, request,
request_properties, METHOD_ENSURE);
}
diff --git a/src/muc-factory.c b/src/muc-factory.c
index c6b021512..34ce329b0 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -237,15 +237,15 @@ muc_channel_closed_cb (GabbleMucChannel *chan, gpointer user_data)
/* channel is actually reappearing, announce it */
if (tp_base_channel_is_respawning (base))
{
- tp_channel_manager_emit_new_channel (fac,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (fac),
TP_EXPORTABLE_CHANNEL (chan), NULL);
return;
}
if (tp_base_channel_is_registered (base))
{
- tp_channel_manager_emit_channel_closed_for_object (fac,
- TP_EXPORTABLE_CHANNEL (chan));
+ tp_channel_manager_emit_channel_closed_for_object (
+ TP_CHANNEL_MANAGER (fac), TP_EXPORTABLE_CHANNEL (chan));
}
if (tp_base_channel_is_destroyed (base)
@@ -281,7 +281,7 @@ muc_ready_cb (GabbleMucChannel *text_chan,
* have to be) */
if (tp_base_channel_is_registered (base))
{
- tp_channel_manager_emit_new_channel (fac,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (fac),
TP_EXPORTABLE_CHANNEL (text_chan), requests_satisfied_text);
}
@@ -303,7 +303,8 @@ muc_ready_cb (GabbleMucChannel *text_chan,
requests_satisfied_tube = g_slist_reverse (requests_satisfied_tube);
- tp_channel_manager_emit_new_channel (fac, tube_chan,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (fac),
+ tube_chan,
requests_satisfied_tube);
g_slist_free (requests_satisfied_tube);
}
@@ -331,8 +332,8 @@ muc_join_error_cb (GabbleMucChannel *chan,
for (iter = requests_satisfied; iter != NULL; iter = iter->next)
{
- tp_channel_manager_emit_request_failed (fac, iter->data,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (fac),
+ iter->data, error->domain, error->code, error->message);
}
g_slist_free (requests_satisfied);
@@ -355,8 +356,8 @@ muc_join_error_cb (GabbleMucChannel *chan,
for (iter = requests_satisfied; iter != NULL; iter = iter->next)
{
- tp_channel_manager_emit_request_failed (fac, iter->data,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (fac),
+ iter->data, error->domain, error->code, error->message);
}
g_slist_free (requests_satisfied);
@@ -373,7 +374,7 @@ muc_sub_channel_closed_cb (TpSvcChannel *chan,
GabbleMucFactory *fac = GABBLE_MUC_FACTORY (user_data);
GabbleMucChannel *muc;
- tp_channel_manager_emit_channel_closed_for_object (fac,
+ tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (fac),
TP_EXPORTABLE_CHANNEL (chan));
/* GabbleTubeDBus, GabbleTubeStream, and GabbleMucCallChannel all
@@ -401,7 +402,7 @@ muc_channel_new_call (GabbleMucChannel *muc,
DEBUG ("Emitting new Call channel");
- tp_channel_manager_emit_new_channel (fac,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (fac),
TP_EXPORTABLE_CHANNEL (call), requests);
g_signal_connect (call, "closed",
@@ -419,7 +420,7 @@ muc_channel_new_tube (GabbleMucChannel *channel,
/* If the muc channel is ready announce the tube channel right away
* otherwise wait for the text channel to be ready */
if (_gabble_muc_channel_is_ready (channel))
- tp_channel_manager_emit_new_channel (fac,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (fac),
TP_EXPORTABLE_CHANNEL (tube), NULL);
else
gabble_muc_factory_associate_tube (fac, channel, tube);
@@ -860,7 +861,7 @@ cancel_queued_requests (
for (iter = requests_satisfied; iter != NULL; iter = iter->next)
{
- tp_channel_manager_emit_request_failed (self,
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
iter->data, TP_ERROR, TP_ERROR_DISCONNECTED,
"Unable to complete this channel request, we're disconnecting!");
}
@@ -1451,8 +1452,9 @@ handle_text_channel_request (GabbleMucFactory *self,
{
if (tp_base_channel_is_registered (TP_BASE_CHANNEL (text_chan)))
{
- tp_channel_manager_emit_request_already_satisfied (self,
- request_token, TP_EXPORTABLE_CHANNEL (text_chan));
+ tp_channel_manager_emit_request_already_satisfied (
+ TP_CHANNEL_MANAGER (self), request_token,
+ TP_EXPORTABLE_CHANNEL (text_chan));
}
else
{
@@ -1461,7 +1463,8 @@ handle_text_channel_request (GabbleMucFactory *self,
tp_base_channel_register (TP_BASE_CHANNEL (text_chan));
tokens = g_slist_append (NULL, request_token);
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (
+ TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (text_chan), tokens);
g_slist_free (tokens);
}
@@ -1548,7 +1551,7 @@ handle_tube_channel_request (GabbleMucFactory *self,
request_tokens = g_slist_prepend (NULL, request_token);
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (new_channel), request_tokens);
g_slist_free (request_tokens);
@@ -1643,7 +1646,7 @@ call_muc_channel_request_cb (GObject *source,
if (!gabble_muc_channel_request_call_finish (channel,
result, &error))
{
- tp_channel_manager_emit_request_failed (self,
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
request_token, error->domain, error->code, error->message);
g_error_free (error);
}
@@ -1701,9 +1704,9 @@ handle_call_channel_request (GabbleMucFactory *self,
}
else
{
- tp_channel_manager_emit_request_already_satisfied (self,
- request_token,
- TP_EXPORTABLE_CHANNEL (call));
+ tp_channel_manager_emit_request_already_satisfied (
+ TP_CHANNEL_MANAGER (self), request_token,
+ TP_EXPORTABLE_CHANNEL (call));
goto out;
}
}
@@ -1800,8 +1803,8 @@ gabble_muc_factory_request (GabbleMucFactory *self,
if (!h->f (self, request_token, request_properties, require_new,
handle, &error))
{
- tp_channel_manager_emit_request_failed (self, request_token,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request_token, error->domain, error->code, error->message);
g_error_free (error);
}
@@ -1815,36 +1818,24 @@ gabble_muc_factory_request (GabbleMucFactory *self,
static gboolean
gabble_muc_factory_create_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
GabbleMucFactory *self = GABBLE_MUC_FACTORY (manager);
- return gabble_muc_factory_request (self, request_token, request_properties,
+ return gabble_muc_factory_request (self, request, request_properties,
TRUE);
}
static gboolean
-gabble_muc_factory_request_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
-{
- GabbleMucFactory *self = GABBLE_MUC_FACTORY (manager);
-
- return gabble_muc_factory_request (self, request_token, request_properties,
- FALSE);
-}
-
-
-static gboolean
gabble_muc_factory_ensure_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
GabbleMucFactory *self = GABBLE_MUC_FACTORY (manager);
- return gabble_muc_factory_request (self, request_token, request_properties,
+ return gabble_muc_factory_request (self, request, request_properties,
FALSE);
}
@@ -1885,7 +1876,6 @@ channel_manager_iface_init (gpointer g_iface,
iface->foreach_channel = gabble_muc_factory_foreach_channel;
iface->type_foreach_channel_class =
gabble_muc_factory_type_foreach_channel_class;
- iface->request_channel = gabble_muc_factory_request_channel;
iface->create_channel = gabble_muc_factory_create_channel;
iface->ensure_channel = gabble_muc_factory_ensure_channel;
}
diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c
index 61861fc7b..db33df8d3 100644
--- a/src/private-tubes-factory.c
+++ b/src/private-tubes-factory.c
@@ -972,7 +972,7 @@ channel_closed_cb (GabbleTubeIface *tube,
"id", &id,
NULL);
- tp_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (tube));
if (self->priv->tubes != NULL)
@@ -1183,7 +1183,7 @@ new_channel_from_stanza (GabblePrivateTubesFactory *self,
g_hash_table_unref (parameters);
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (tube), NULL);
return tube;
@@ -1347,7 +1347,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
if (request_token != NULL)
request_tokens = g_slist_prepend (NULL, request_token);
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (channel), request_tokens);
g_slist_free (request_tokens);
@@ -1362,15 +1362,16 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
goto error;
}
- tp_channel_manager_emit_request_already_satisfied (self,
- request_token, TP_EXPORTABLE_CHANNEL (channel));
+ tp_channel_manager_emit_request_already_satisfied (
+ TP_CHANNEL_MANAGER (self), request_token,
+ TP_EXPORTABLE_CHANNEL (channel));
}
return TRUE;
error:
- tp_channel_manager_emit_request_failed (self, request_token,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request_token, error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
}
@@ -1378,36 +1379,23 @@ error:
static gboolean
gabble_private_tubes_factory_create_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
GabblePrivateTubesFactory *self = GABBLE_PRIVATE_TUBES_FACTORY (manager);
- return gabble_private_tubes_factory_requestotron (self, request_token,
+ return gabble_private_tubes_factory_requestotron (self, request,
request_properties, TRUE);
}
-
-static gboolean
-gabble_private_tubes_factory_request_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
-{
- GabblePrivateTubesFactory *self = GABBLE_PRIVATE_TUBES_FACTORY (manager);
-
- return gabble_private_tubes_factory_requestotron (self, request_token,
- request_properties, FALSE);
-}
-
-
static gboolean
gabble_private_tubes_factory_ensure_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
GabblePrivateTubesFactory *self = GABBLE_PRIVATE_TUBES_FACTORY (manager);
- return gabble_private_tubes_factory_requestotron (self, request_token,
+ return gabble_private_tubes_factory_requestotron (self, request,
request_properties, FALSE);
}
@@ -1421,7 +1409,6 @@ channel_manager_iface_init (gpointer g_iface,
iface->type_foreach_channel_class =
gabble_private_tubes_factory_type_foreach_channel_class;
iface->create_channel = gabble_private_tubes_factory_create_channel;
- iface->request_channel = gabble_private_tubes_factory_request_channel;
iface->ensure_channel = gabble_private_tubes_factory_ensure_channel;
}
diff --git a/src/roomlist-manager.c b/src/roomlist-manager.c
index 79cba5da6..7876ff089 100644
--- a/src/roomlist-manager.c
+++ b/src/roomlist-manager.c
@@ -297,7 +297,7 @@ roomlist_channel_closed_cb (GabbleRoomlistChannel *channel,
{
GabbleRoomlistManager *self = GABBLE_ROOMLIST_MANAGER (user_data);
- tp_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (channel));
if (self->priv->channels != NULL)
@@ -375,8 +375,9 @@ gabble_roomlist_manager_handle_request (TpChannelManager *manager,
if (good)
{
- tp_channel_manager_emit_request_already_satisfied (self,
- request_token, TP_EXPORTABLE_CHANNEL (channel));
+ tp_channel_manager_emit_request_already_satisfied (
+ TP_CHANNEL_MANAGER (self), request_token,
+ TP_EXPORTABLE_CHANNEL (channel));
return TRUE;
}
}
@@ -389,15 +390,15 @@ gabble_roomlist_manager_handle_request (TpChannelManager *manager,
g_ptr_array_add (self->priv->channels, channel);
request_tokens = g_slist_prepend (NULL, request_token);
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (channel), request_tokens);
g_slist_free (request_tokens);
return TRUE;
error:
- tp_channel_manager_emit_request_failed (self, request_token,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request_token, error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
}
@@ -405,30 +406,20 @@ error:
static gboolean
gabble_roomlist_manager_create_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
- return gabble_roomlist_manager_handle_request (manager, request_token,
+ return gabble_roomlist_manager_handle_request (manager, request,
request_properties, TRUE);
}
static gboolean
-gabble_roomlist_manager_request_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
-{
- return gabble_roomlist_manager_handle_request (manager, request_token,
- request_properties, FALSE);
-}
-
-
-static gboolean
gabble_roomlist_manager_ensure_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
- return gabble_roomlist_manager_handle_request (manager, request_token,
+ return gabble_roomlist_manager_handle_request (manager, request,
request_properties, FALSE);
}
@@ -442,7 +433,6 @@ channel_manager_iface_init (gpointer g_iface,
iface->foreach_channel = gabble_roomlist_manager_foreach_channel;
iface->type_foreach_channel_class =
gabble_roomlist_manager_type_foreach_channel_class;
- iface->request_channel = gabble_roomlist_manager_request_channel;
iface->create_channel = gabble_roomlist_manager_create_channel;
iface->ensure_channel = gabble_roomlist_manager_ensure_channel;
}
diff --git a/src/search-manager.c b/src/search-manager.c
index 15cfc5877..a6b95e59c 100644
--- a/src/search-manager.c
+++ b/src/search-manager.c
@@ -147,8 +147,8 @@ disco_done_cb (GabbleDisco *disco,
}
else
{
- tp_channel_manager_emit_request_failed (self, request_token,
- TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request_token, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
"No Server has been specified and no server has been "
"discovered on the connection");
}
@@ -354,7 +354,7 @@ static void
search_channel_closed_cb (GabbleSearchChannel *chan,
GabbleSearchManager *self)
{
- tp_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self),
(TpExportableChannel *) chan);
remove_search_channel (self, chan);
}
@@ -398,7 +398,7 @@ search_channel_ready_or_not_cb (GabbleSearchChannel *chan,
{
GSList *request_tokens = g_slist_prepend (NULL, ctx->request_token);
- tp_channel_manager_emit_new_channel (ctx->self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (ctx->self),
(TpExportableChannel *) chan, request_tokens);
g_slist_free (request_tokens);
@@ -426,7 +426,7 @@ search_channel_ready_or_not_cb (GabbleSearchChannel *chan,
g_assert (domain == TP_ERROR);
}
- tp_channel_manager_emit_request_failed (ctx->self,
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (ctx->self),
ctx->request_token, domain, code, message);
remove_search_channel (ctx->self, chan);
}
@@ -460,8 +460,8 @@ new_search_channel (GabbleSearchManager *self,
static gboolean
gabble_search_manager_create_channel (TpChannelManager *manager,
- gpointer request_token,
- GHashTable *request_properties)
+ TpChannelManagerRequest *request,
+ GHashTable *request_properties)
{
GabbleSearchManager *self = GABBLE_SEARCH_MANAGER (manager);
GError *error = NULL;
@@ -513,7 +513,7 @@ gabble_search_manager_create_channel (TpChannelManager *manager,
"the disco process");
self->priv->requests_waiting_disco = g_slist_append (
- self->priv->requests_waiting_disco, request_token);
+ self->priv->requests_waiting_disco, request);
return TRUE;
}
@@ -521,12 +521,12 @@ gabble_search_manager_create_channel (TpChannelManager *manager,
server = self->priv->default_jud;
}
- new_search_channel (self, server, request_token);
+ new_search_channel (self, server, request);
return TRUE;
error:
- tp_channel_manager_emit_request_failed (self, request_token,
- error->domain, error->code, error->message);
+ tp_channel_manager_emit_request_failed (TP_CHANNEL_MANAGER (self),
+ request, error->domain, error->code, error->message);
g_error_free (error);
return TRUE;
}
@@ -542,7 +542,6 @@ channel_manager_iface_init (gpointer g_iface,
gabble_search_manager_type_foreach_channel_class;
iface->create_channel = gabble_search_manager_create_channel;
- iface->request_channel = gabble_search_manager_create_channel;
/* Ensuring these channels doesn't really make much sense. */
iface->ensure_channel = NULL;
diff --git a/src/server-tls-manager.c b/src/server-tls-manager.c
index 6a23c998a..92f7d1b15 100644
--- a/src/server-tls-manager.c
+++ b/src/server-tls-manager.c
@@ -218,7 +218,7 @@ server_tls_channel_closed_cb (GabbleServerTLSChannel *channel,
self->priv->completed_channels, l);
}
- tp_channel_manager_emit_channel_closed_for_object (self,
+ tp_channel_manager_emit_channel_closed_for_object (TP_CHANNEL_MANAGER (self),
TP_EXPORTABLE_CHANNEL (channel));
g_object_unref (channel);
}
@@ -389,7 +389,7 @@ gabble_server_tls_manager_verify_async (WockyTLSHandler *handler,
G_CALLBACK (tls_certificate_rejected_cb), self);
/* emit NewChannel on the ChannelManager iface */
- tp_channel_manager_emit_new_channel (self,
+ tp_channel_manager_emit_new_channel (TP_CHANNEL_MANAGER (self),
(TpExportableChannel *) self->priv->channel, NULL);
}
@@ -516,7 +516,6 @@ channel_manager_iface_init (gpointer g_iface,
/* these channels are not requestable. */
iface->ensure_channel = NULL;
iface->create_channel = NULL;
- iface->request_channel = NULL;
iface->foreach_channel_class = NULL;
}