[Telepathy-commits] [telepathy-gabble/master] GabbleJingleContent: senders are optional instead of required attribute

Senko Rasic senko.rasic at collabora.co.uk
Tue Dec 2 04:34:08 PST 2008


---
 src/jingle-content.c |   36 ++++++++++++------------------------
 1 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/src/jingle-content.c b/src/jingle-content.c
index 7f58ae6..df756db 100644
--- a/src/jingle-content.c
+++ b/src/jingle-content.c
@@ -462,6 +462,9 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
 
   g_assert (priv->transport_ns == NULL);
 
+  if (senders == NULL)
+      senders = "both";
+
   if (google_mode)
     {
       if (creator == NULL)
@@ -470,9 +473,6 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
       if (name == NULL)
           name = "gtalk";
 
-      if (senders == NULL)
-          senders = "both";
-
       if (trans_node == NULL)
         {
           /* gtalk lj0.3 assumes google-p2p transport */
@@ -487,14 +487,7 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
     }
   else
     {
-      /* senders weren't mandatory back then */
-      if (dialect == JINGLE_DIALECT_V015)
-        {
-          DEBUG ("old gabble detected, settings senders = both");
-          senders = "both";
-        }
-
-      if ((trans_node == NULL) || (creator == NULL) || (name == NULL) || (senders == NULL))
+      if ((trans_node == NULL) || (creator == NULL) || (name == NULL))
         {
           SET_BAD_REQ ("missing required content attributes or elements");
           return;
@@ -603,20 +596,15 @@ gabble_jingle_content_parse_accept (GabbleJingleContent *c,
         }
     }
 
-  /* GTalk mode and old Gabble both don't really mind this */
-  if (JINGLE_IS_GOOGLE_DIALECT (dialect) || (dialect == JINGLE_DIALECT_V015))
-    {
-      DEBUG ("gtalk or old gabble detected, settings senders = both");
-    }
-  else
+  if (senders == NULL)
+      senders = "both";
+
+  DEBUG ("changing senders from %s to %s", produce_senders (priv->senders), senders);
+  priv->senders = parse_senders (senders);
+  if (priv->senders == JINGLE_CONTENT_SENDERS_NONE)
     {
-      DEBUG ("changing senders from %s to %s", produce_senders (priv->senders), senders);
-      priv->senders = parse_senders (senders);
-      if (priv->senders == JINGLE_CONTENT_SENDERS_NONE)
-        {
-          SET_BAD_REQ ("invalid content senders");
-          return;
-        }
+      SET_BAD_REQ ("invalid content senders");
+      return;
     }
 
   parse_description (c, desc_node, error);
-- 
1.5.6.5




More information about the Telepathy-commits mailing list