[telepathy-gabble/master] Improve selection of the GTalk dialects

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


If a contact only google voice, but not google transport p2p in its
capabilities, select the GTalk 03 dialect, if it has both select GTalk 04
---
 src/media-channel.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/media-channel.c b/src/media-channel.c
index 6c29d2f..5050e3d 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -1425,8 +1425,8 @@ _pick_best_resource (GabbleMediaChannel *chan,
       goto CHOOSE_TRANSPORT;
     }
 
-  /* There is still hope, try GTalk */
-  caps = PRESENCE_CAP_GOOGLE_VOICE;
+  /* There is still hope, try GTalk 0.4 */
+  caps = PRESENCE_CAP_GOOGLE_VOICE | PRESENCE_CAP_GOOGLE_TRANSPORT_P2P;
   resource = gabble_presence_pick_resource_by_caps (presence, caps);
 
   if (resource != NULL)
@@ -1435,6 +1435,16 @@ _pick_best_resource (GabbleMediaChannel *chan,
       goto CHOOSE_TRANSPORT;
     }
 
+  /* GTalk 0.3 maybe ? */
+  caps = PRESENCE_CAP_GOOGLE_VOICE;
+  resource = gabble_presence_pick_resource_by_caps (presence, caps);
+
+  if (resource != NULL)
+    {
+      *dialect = JINGLE_DIALECT_GTALK3;
+      goto CHOOSE_TRANSPORT;
+    }
+
   /* Nope, nothing we can do. */
   return NULL;
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list