changeset 26075:f45301cc2c84

End google call if stream creation fails.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Tue, 06 Jan 2009 00:21:09 +0000
parents b2b7341c8523
children 2cf44cc855fe
files libpurple/protocols/jabber/google.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Mon Jan 05 10:28:51 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Tue Jan 06 00:21:09 2009 +0000
@@ -225,8 +225,13 @@
 	g_value_init(&param.value, G_TYPE_UINT);
 	g_value_set_uint(&param.value, 1); /* NICE_COMPATIBILITY_GOOGLE */
 
-	purple_media_add_stream(session->media, "google-voice", session->remote_jid, 
-				PURPLE_MEDIA_AUDIO, "nice", 1, &param);
+	if (purple_media_add_stream(session->media, "google-voice", session->remote_jid, 
+				PURPLE_MEDIA_AUDIO, "nice", 1, &param) == FALSE) {
+		purple_media_error(session->media, "Error adding stream.");
+		purple_media_hangup(session->media);
+		google_session_send_terminate(session);
+		return;
+	}
 
 	desc_element = xmlnode_get_child(sess, "description");