[telepathy-gabble/master] Return candidates if they exist in GtalkProtocol03's Content function.

Mike Ruprecht mike.ruprecht at collabora.co.uk
Tue Dec 29 05:35:29 PST 2009


---
 tests/twisted/jingle/jingletest2.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index 653d76e..3896474 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -239,8 +239,14 @@ class GtalkProtocol03(JingleProtocol):
     # Gtalk has only one content, and <content> node is implicit
     def Content(self, name, creator, senders, children):
         # Normally <content> has <description> and <transport>, but we only
-        # use <description>
+        # use <description> unless <transport> has candidates.
         assert len(children) == 2
+        assert children[1] != None
+        assert children[1][3] != None
+
+        # if <transport> has children return those children (candidates)
+        if len(children[1][3]) > 0:
+            return children[1][3][0]
         return children[0]
 
     def Description(self, type, children):
-- 
1.5.6.5




More information about the telepathy-commits mailing list