changeset 31010:ba69a8d1cd9a

jingle: termininate the sesion with reason unsupported-applications if we get an unsupported content type
author Marcus Lundblad <ml@update.uu.se>
date Mon, 06 Dec 2010 22:38:56 +0000
parents b78991ee326c
children 81873d69d8d8
files libpurple/protocols/jabber/jingle/jingle.c
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/jingle.c	Sun Dec 05 09:06:00 2010 +0000
+++ b/libpurple/protocols/jabber/jingle/jingle.c	Mon Dec 06 22:38:56 2010 +0000
@@ -98,7 +98,8 @@
 		if (pending_content == NULL) {
 			purple_debug_error("jingle",
 					"Error parsing \"content-add\" content.\n");
-			/* XXX: send error here */
+			jabber_iq_send(jingle_session_terminate_packet(session,
+				"unsupported-applications"));
 		} else {
 			jingle_session_add_pending_content(session,
 					pending_content);
@@ -127,7 +128,8 @@
 			g_free(local_senders);
 		} else {
 			purple_debug_error("jingle", "content_modify: unknown content\n");
-			/* XXX: send error */
+			jabber_iq_send(jingle_session_terminate_packet(session,
+				"unknown-applications"));
 		}
 	}
 }
@@ -176,7 +178,8 @@
 				jingle_session_find_content(session, name, creator);
 		if (parsed_content == NULL) {
 			purple_debug_error("jingle", "Error parsing content\n");
-			/* XXX: send error */
+			jabber_iq_send(jingle_session_terminate_packet(session,
+				"unsupported-applications"));
 		} else {
 			jingle_content_handle_action(parsed_content, content,
 					JINGLE_DESCRIPTION_INFO);
@@ -206,7 +209,8 @@
 				jingle_session_find_content(session, name, creator);
 		if (parsed_content == NULL) {
 			purple_debug_error("jingle", "Error parsing content\n");
-			/* XXX: send error */
+			jabber_iq_send(jingle_session_terminate_packet(session,
+				"unsupported-applications"));
 		} else {
 			jingle_content_handle_action(parsed_content, content,
 					JINGLE_SESSION_ACCEPT);
@@ -230,7 +234,8 @@
 		JingleContent *parsed_content = jingle_content_parse(content);
 		if (parsed_content == NULL) {
 			purple_debug_error("jingle", "Error parsing content\n");
-			/* XXX: send error */
+			jabber_iq_send(jingle_session_terminate_packet(session,
+				"unsupported-applications"));
 		} else {
 			jingle_session_add_content(session, parsed_content);
 			jingle_content_handle_action(parsed_content, content,
@@ -281,7 +286,8 @@
 				jingle_session_find_content(session, name, creator);
 		if (parsed_content == NULL) {
 			purple_debug_error("jingle", "Error parsing content\n");
-			/* XXX: send error */
+			jabber_iq_send(jingle_session_terminate_packet(session,
+				"unsupported-applications"));
 		} else {
 			jingle_content_handle_action(parsed_content, content,
 					JINGLE_TRANSPORT_INFO);