summaryrefslogtreecommitdiff
path: root/src/muc-factory.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2010-07-14 14:36:03 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2010-07-14 14:36:03 +0100
commit73fe3ecdf9c77e1f9b8d2c7ca4808f996494562b (patch)
tree564957779ba2e5b28f8b59c3833802e3a650c907 /src/muc-factory.c
parent4677625c03999460c6316f27cdc776d86ca993b2 (diff)
parentc0562b9a6f94c75ab5522d7c7f9ebc11a09e8551 (diff)
downloadtelepathy-gabble-73fe3ecdf9c77e1f9b8d2c7ca4808f996494562b.tar.gz
Merge branch 'toob'
Diffstat (limited to 'src/muc-factory.c')
-rw-r--r--src/muc-factory.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/muc-factory.c b/src/muc-factory.c
index 417edcef9..0017490d7 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -288,6 +288,29 @@ muc_ready_cb (GabbleMucChannel *text_chan,
g_hash_table_steal (priv->queued_requests, tubes_chan);
}
+ /* Announce tube channels now */
+ /* FIXME: we should probably aggregate tube announcement with tubes and text
+ * ones in some cases. */
+ tube_channels = g_hash_table_lookup (priv->tubes_needed_for_tube,
+ tubes_chan);
+
+ tube_channels = g_slist_reverse (tube_channels);
+ for (l = tube_channels; l != NULL; l = g_slist_next (l))
+ {
+ GabbleTubeIface *tube_chan = GABBLE_TUBE_IFACE (l->data);
+ GSList *requests_satisfied_tube;
+
+ requests_satisfied_tube = g_hash_table_lookup (priv->queued_requests,
+ tube_chan);
+ g_hash_table_steal (priv->queued_requests, tube_chan);
+ requests_satisfied_tube = g_slist_reverse (requests_satisfied_tube);
+
+ tp_channel_manager_emit_new_channel (fac,
+ TP_EXPORTABLE_CHANNEL (tube_chan), requests_satisfied_tube);
+
+ g_slist_free (requests_satisfied_tube);
+ }
+
if (tubes_chan == NULL || text_requested)
{
/* There is no tubes channel or the text channel has been explicitely
@@ -318,29 +341,6 @@ muc_ready_cb (GabbleMucChannel *text_chan,
g_hash_table_destroy (channels);
}
- /* Announce tube channels now */
- /* FIXME: we should probably aggregate tube announcement with tubes and text
- * ones in some cases. */
- tube_channels = g_hash_table_lookup (priv->tubes_needed_for_tube,
- tubes_chan);
-
- tube_channels = g_slist_reverse (tube_channels);
- for (l = tube_channels; l != NULL; l = g_slist_next (l))
- {
- GabbleTubeIface *tube_chan = GABBLE_TUBE_IFACE (l->data);
- GSList *requests_satisfied_tube;
-
- requests_satisfied_tube = g_hash_table_lookup (priv->queued_requests,
- tube_chan);
- g_hash_table_steal (priv->queued_requests, tube_chan);
- requests_satisfied_tube = g_slist_reverse (requests_satisfied_tube);
-
- tp_channel_manager_emit_new_channel (fac,
- TP_EXPORTABLE_CHANNEL (tube_chan), requests_satisfied_tube);
-
- g_slist_free (requests_satisfied_tube);
- }
-
g_hash_table_remove (priv->tubes_needed_for_tube, tubes_chan);
g_slist_free (requests_satisfied_text);
g_slist_free (requests_satisfied_tubes);
@@ -1552,7 +1552,6 @@ handle_tube_channel_request (GabbleMucFactory *self,
{
/* We have to wait the tubes channel before announcing */
can_announce_now = FALSE;
- gabble_muc_factory_associate_request (self, tube, request_token);
}
tubes_channel_created = TRUE;
@@ -1592,6 +1591,11 @@ handle_tube_channel_request (GabbleMucFactory *self,
l = g_slist_prepend (l, new_channel);
g_hash_table_insert (priv->tubes_needed_for_tube, tube, l);
+
+ /* And now finally associate the new stream or dbus tube channel with
+ * the request token so that when the muc channel is ready, the request
+ * will be satisfied. */
+ gabble_muc_factory_associate_request (self, new_channel, request_token);
}
g_object_unref (tube);