comparison libpurple/protocols/jabber/google.c @ 28440:1e529b03ec81

Handle the local accept signal with GTalk/Gmail. This was causing calls initiated by GTalk/Gmail to ring until they timed out if everything apart from accepting was done before clicking accept. Fixes #10043
author maiku@pidgin.im
date Tue, 25 Aug 2009 01:23:37 +0000
parents 98d8c11e4937
children 336d03cdced6 67a97fca157c 196e4c5b2043
comparison
equal deleted inserted replaced
28439:e61b10db0044 28440:1e529b03ec81
294 static void 294 static void
295 google_session_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type, 295 google_session_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type,
296 gchar *sid, gchar *name, gboolean local, 296 gchar *sid, gchar *name, gboolean local,
297 GoogleSession *session) 297 GoogleSession *session)
298 { 298 {
299 if (sid != NULL || name != NULL)
300 return;
301
299 if (type == PURPLE_MEDIA_INFO_HANGUP) { 302 if (type == PURPLE_MEDIA_INFO_HANGUP) {
300 xmlnode *sess; 303 xmlnode *sess;
301 JabberIq *iq = jabber_iq_new(session->js, JABBER_IQ_SET); 304 JabberIq *iq = jabber_iq_new(session->js, JABBER_IQ_SET);
302 305
303 xmlnode_set_attrib(iq->node, "to", session->remote_jid); 306 xmlnode_set_attrib(iq->node, "to", session->remote_jid);
312 xmlnode_set_attrib(iq->node, "to", session->remote_jid); 315 xmlnode_set_attrib(iq->node, "to", session->remote_jid);
313 sess = google_session_create_xmlnode(session, "reject"); 316 sess = google_session_create_xmlnode(session, "reject");
314 xmlnode_insert_child(iq->node, sess); 317 xmlnode_insert_child(iq->node, sess);
315 318
316 jabber_iq_send(iq); 319 jabber_iq_send(iq);
320 } else if (type == PURPLE_MEDIA_INFO_ACCEPT && local == TRUE) {
321 google_session_ready(session);
317 } 322 }
318 } 323 }
319 324
320 static GParameter * 325 static GParameter *
321 jabber_google_session_get_params(JabberStream *js, guint *num) 326 jabber_google_session_get_params(JabberStream *js, guint *num)