summaryrefslogtreecommitdiff
path: root/src/salut-tubes-channel.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2007-10-16 12:44:26 +0000
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2007-10-16 12:44:26 +0000
commit5a1b6191026d9804673a1ea84cd1648c4283b00a (patch)
tree4c194ca074ac6907b2dd03eaa566f55eb0213898 /src/salut-tubes-channel.c
parentc2bba0f7bb856275d3dfc84e98cd2aca67961b2f (diff)
tubes-channel: check if we have to publish the tube *before* adding the <tube> markup
Diffstat (limited to 'src/salut-tubes-channel.c')
-rw-r--r--src/salut-tubes-channel.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/salut-tubes-channel.c b/src/salut-tubes-channel.c
index dabb3f65..f9740bf4 100644
--- a/src/salut-tubes-channel.c
+++ b/src/salut-tubes-channel.c
@@ -1005,13 +1005,6 @@ publish_tube_in_node (SalutTubesChannel *self,
g_object_get (G_OBJECT (tube),
"type", &type,
"initiator", &initiator_handle,
- NULL);
-
- if (type == TP_TUBE_TYPE_STREAM && initiator_handle != priv->self_handle)
- /* We only announce stream tubes we initiated */
- return;
-
- g_object_get (G_OBJECT (tube),
"service", &service,
"parameters", &parameters,
"id", &tube_id,
@@ -1077,19 +1070,29 @@ publish_tubes_in_node (gpointer key,
SalutTubeIface *tube = (SalutTubeIface *) value;
struct _i_hate_g_hash_table_foreach *data =
(struct _i_hate_g_hash_table_foreach *) user_data;
+ SalutTubesChannelPrivate *priv = SALUT_TUBES_CHANNEL_GET_PRIVATE (
+ data->self);
TpTubeState state;
GibberXmppNode *tube_node;
+ TpTubeType type;
+ TpHandle initiator;
if (tube == NULL)
return;
g_object_get (tube,
- "state", &state,
- NULL);
+ "state", &state,
+ "type", &type,
+ "initiator", &initiator,
+ NULL);
if (state != TP_TUBE_STATE_OPEN)
return;
+ if (type == TP_TUBE_TYPE_STREAM && initiator != priv->self_handle)
+ /* We only announce stream tubes we initiated */
+ return;
+
tube_node = gibber_xmpp_node_add_child (data->tubes_node, "tube");
publish_tube_in_node (data->self, tube_node, tube);
}