summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.com>2012-03-09 16:45:47 -0500
committerOlivier Crête <olivier.crete@collabora.com>2012-03-09 18:05:24 -0500
commitceb7985d76f8d2c614344b4b6c68d152384b695b (patch)
tree93e8cd274237bcab0a79288d0a291b76411b8198 /src
parent8bbc8e408464f65f5cc93ff18109661f297b39d8 (diff)
Correctly convert JingleCandidateType to Telepathy types
Diffstat (limited to 'src')
-rw-r--r--src/util.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index a686a4b8d..eeda26822 100644
--- a/src/util.c
+++ b/src/util.c
@@ -996,6 +996,22 @@ jingle_pick_best_content_type (GabbleConnection *conn,
}
}
+static TpCallStreamCandidateType
+tp_candidate_type_from_jingle (JingleCandidateType type)
+{
+ switch (type)
+ {
+ default:
+ /* Consider UNKNOWN as LOCAL/HOST */
+ case JINGLE_CANDIDATE_TYPE_LOCAL:
+ return TP_CALL_STREAM_CANDIDATE_TYPE_HOST;
+ case JINGLE_CANDIDATE_TYPE_STUN:
+ return TP_CALL_STREAM_CANDIDATE_TYPE_SERVER_REFLEXIVE;
+ case JINGLE_CANDIDATE_TYPE_RELAY:
+ return TP_CALL_STREAM_CANDIDATE_TYPE_RELAY;
+ }
+}
+
/**
* @candidates: (element-type JingleCandidate): candidates
*
@@ -1018,7 +1034,7 @@ gabble_call_candidates_to_array (GList *candidates)
info = tp_asv_new (
"protocol", G_TYPE_UINT, cand->protocol,
- "type", G_TYPE_UINT, cand->type,
+ "type", G_TYPE_UINT, tp_candidate_type_from_jingle (cand->type),
"foundation", G_TYPE_STRING, cand->id,
"priority", G_TYPE_UINT, cand->preference,
"username", G_TYPE_STRING, cand->username,