[telepathy-gabble/master] Allow content names to be overriden in the GTalk dialects

Sjoerd Simons sjoerd.simons at collabora.co.uk
Thu Jun 25 09:59:48 PDT 2009


---
 src/jingle-content.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/jingle-content.c b/src/jingle-content.c
index 7f42f96..314eeca 100644
--- a/src/jingle-content.c
+++ b/src/jingle-content.c
@@ -498,8 +498,12 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
       if (creator == NULL)
           creator = "initiator";
 
-      if (name == NULL)
-          name = "gtalk";
+      /* the google protocols don't give the contents names, so put in a dummy
+       * value if none was set by the session*/
+      if (priv->name == NULL)
+        name = priv->name = g_strdup ("gtalk");
+      else
+        name = priv->name;
 
       if (trans_node == NULL)
         {
@@ -520,6 +524,10 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
           SET_BAD_REQ ("missing required content attributes or elements");
           return;
         }
+
+      /* In proper protocols the name comes from the stanza */
+      g_assert (priv->name == NULL);
+      priv->name = g_strdup (name);
     }
 
   /* if we didn't set it to google-p2p implicitly already, detect it */
@@ -579,9 +587,6 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
   g_assert (priv->transport == NULL);
   priv->transport = trans;
 
-  g_assert (priv->name == NULL);
-  priv->name = g_strdup (name);
-
   g_assert (priv->creator == NULL);
   priv->creator = g_strdup (creator);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list