summaryrefslogtreecommitdiff
path: root/src/jingle-transport-google.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-06-22 16:14:22 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2009-06-23 11:30:07 +0100
commitf9f74b7b2249d8fc134624345c95c4257c6ac072 (patch)
treee7f93810e0a781877926e7aff196547938bb1ea5 /src/jingle-transport-google.c
parentdfce1b44821700212f35951931dd5e6bc1942946 (diff)
Remove duplicated <content>-generation code.
Fixes fd.o#22236: “gabble_jingle_content_produce_node and transmit_candidates contain similar but subtly-different <content> stanza generators”. The difference mentioned on that bug (whether or not a <transport/> node is added for GTalk3) was fixed in the course of adding Google Video support.
Diffstat (limited to 'src/jingle-transport-google.c')
-rw-r--r--src/jingle-transport-google.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/src/jingle-transport-google.c b/src/jingle-transport-google.c
index 8d7d70b4..1de83965 100644
--- a/src/jingle-transport-google.c
+++ b/src/jingle-transport-google.c
@@ -415,38 +415,8 @@ transmit_candidates (GabbleJingleTransportGoogle *transport, GList *candidates)
g_object_get (priv->content->session, "dialect", &dialect, NULL);
g_object_get (priv->content, "media-type", &media_type, NULL);
- if (dialect == JINGLE_DIALECT_GTALK3)
- {
- trans_node = sess_node;
- }
- else if (dialect == JINGLE_DIALECT_GTALK4)
- {
- trans_node = lm_message_node_add_child (sess_node, "transport", NULL);
- lm_message_node_set_attribute (trans_node, "xmlns",
- NS_GOOGLE_TRANSPORT_P2P);
- }
- else
- {
- const gchar *name = gabble_jingle_content_get_name (priv->content);
- const gchar *ns = gabble_jingle_content_get_ns (priv->content);
- LmMessageNode *content_node;
-
- /* FIXME: this should use gabble_jingle_content_produce_node(); #22236 */
-
- /* we need the <content> ... */
- content_node = lm_message_node_add_child (sess_node, "content", NULL);
- lm_message_node_set_attribute (content_node, "xmlns", ns);
- lm_message_node_set_attribute (content_node, "name", name);
-
- if (gabble_jingle_content_creator_is_initiator (priv->content))
- lm_message_node_set_attribute (content_node, "creator", "initiator");
- else
- lm_message_node_set_attribute (content_node, "creator", "responder");
-
- /* .. and the <transport> node */
- trans_node = lm_message_node_add_child (content_node, "transport", NULL);
- lm_message_node_set_attribute (trans_node, "xmlns", priv->transport_ns);
- }
+ gabble_jingle_content_produce_node (priv->content, sess_node, FALSE, TRUE,
+ &trans_node);
for (li = candidates; li; li = li->next)
{