| 85 if (!transport) |
85 if (!transport) |
| 86 return NULL; |
86 return NULL; |
| 87 |
87 |
| 88 for (; candidates; candidates = g_list_next(candidates)) { |
88 for (; candidates; candidates = g_list_next(candidates)) { |
| 89 PurpleMediaCandidate *candidate = candidates->data; |
89 PurpleMediaCandidate *candidate = candidates->data; |
| 90 gchar *id = jabber_get_next_id(jingle_session_get_js(session)); |
90 if (purple_media_candidate_get_protocol(candidate) == |
| 91 jingle_transport_add_local_candidate(transport, id, generation, candidate); |
91 PURPLE_MEDIA_NETWORK_PROTOCOL_UDP) { |
| 92 g_free(id); |
92 gchar *id = jabber_get_next_id(jingle_session_get_js(session)); |
| |
93 jingle_transport_add_local_candidate(transport, id, generation, candidate); |
| |
94 g_free(id); |
| |
95 } |
| 93 } |
96 } |
| 94 |
97 |
| 95 return transport; |
98 return transport; |
| 96 } |
99 } |
| 97 |
100 |
| 215 g_signal_handlers_disconnect_by_func(G_OBJECT(media), |
218 g_signal_handlers_disconnect_by_func(G_OBJECT(media), |
| 216 G_CALLBACK(jingle_rtp_new_candidate_cb), |
219 G_CALLBACK(jingle_rtp_new_candidate_cb), |
| 217 session); |
220 session); |
| 218 |
221 |
| 219 g_object_unref(session); |
222 g_object_unref(session); |
| 220 } else if (type == PURPLE_MEDIA_INFO_ACCEPT && |
223 /* The same signal is emited *four* times in case of acceptance |
| |
224 * by purple_media_stream_info() (stream acceptance, session |
| |
225 * acceptance, participant acceptance, and conference acceptance). |
| |
226 * We only react to the first one, where sid and name are given |
| |
227 * non-null values. |
| |
228 */ |
| |
229 } else if (type == PURPLE_MEDIA_INFO_ACCEPT && sid && name && |
| 221 jingle_session_is_initiator(session) == FALSE) { |
230 jingle_session_is_initiator(session) == FALSE) { |
| |
231 |
| 222 jingle_rtp_ready(session); |
232 jingle_rtp_ready(session); |
| 223 } |
233 } |
| 224 } |
234 } |
| 225 |
235 |
| 226 static void |
236 static void |