pidgin.vv: a7cead7f: Update to newest XEP-0166 Jingle spec.

maiku at soc.pidgin.im maiku at soc.pidgin.im
Wed Feb 4 23:40:36 EST 2009


-----------------------------------------------------------------
Revision: a7cead7f70499469761cfb1423499dd0200642f7
Ancestor: 7bfd16fffd2e3160d330163728747f37a621a798
Author: maiku at soc.pidgin.im
Date: 2009-02-05T01:31:40
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/a7cead7f70499469761cfb1423499dd0200642f7

Modified files:
        libpurple/protocols/jabber/jingle/jingle.c
        libpurple/protocols/jabber/jingle/jingle.h

ChangeLog: 

Update to newest XEP-0166 Jingle spec.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/jingle.c	4f2da1a1d4c58d27073f412a595e7b56da7ad4a5
+++ libpurple/protocols/jabber/jingle/jingle.c	9820d1527648eacb6ee55ae8be58e300f1642180
@@ -41,8 +41,12 @@ jingle_get_action_name(JingleActionType 
 			return "content-add";
 		case JINGLE_CONTENT_MODIFY:
 			return "content-modify";
+		case JINGLE_CONTENT_REJECT:
+			return "content-reject";
 		case JINGLE_CONTENT_REMOVE:
 			return "content-remove";
+		case JINGLE_DESCRIPTION_INFO:
+			return "description-info";
 		case JINGLE_SESSION_ACCEPT:
 			return "session-accept";
 		case JINGLE_SESSION_INFO:
@@ -55,6 +59,8 @@ jingle_get_action_name(JingleActionType 
 			return "transport-accept";
 		case JINGLE_TRANSPORT_INFO:
 			return "transport-info";
+		case JINGLE_TRANSPORT_REJECT:
+			return "transport-reject";
 		case JINGLE_TRANSPORT_REPLACE:
 			return "transport-replace";
 		default:
@@ -71,8 +77,12 @@ jingle_get_action_type(const gchar *acti
 		return JINGLE_CONTENT_ADD;
 	else if (!strcmp(action, "content-modify"))
 		return JINGLE_CONTENT_MODIFY;
+	else if (!strcmp(action, "content-reject"))
+		return JINGLE_CONTENT_REJECT;
 	else if (!strcmp(action, "content-remove"))
 		return JINGLE_CONTENT_REMOVE;
+	else if (!strcmp(action, "description-info"))
+		return JINGLE_DESCRIPTION_INFO;
 	else if (!strcmp(action, "session-accept"))
 		return JINGLE_SESSION_ACCEPT;
 	else if (!strcmp(action, "session-info"))
@@ -85,6 +95,8 @@ jingle_get_action_type(const gchar *acti
 		return JINGLE_TRANSPORT_ACCEPT;
 	else if (!strcmp(action, "transport-info"))
 		return JINGLE_TRANSPORT_INFO;
+	else if (!strcmp(action, "transport-reject"))
+		return JINGLE_TRANSPORT_REJECT;
 	else if (!strcmp(action, "transport-replace"))
 		return JINGLE_TRANSPORT_REPLACE;
 	else
@@ -207,6 +219,30 @@ static void
 }
 
 static void
+jingle_handle_description_info(JingleSession *session, xmlnode *jingle)
+{
+	xmlnode *content = xmlnode_get_child(jingle, "content");
+
+	jabber_iq_send(jingle_session_create_ack(session, jingle));
+
+	jingle_session_accept_session(session);
+	
+	for (; content; content = xmlnode_get_next_twin(content)) {
+		const gchar *name = xmlnode_get_attrib(content, "name");
+		const gchar *creator = xmlnode_get_attrib(content, "creator");
+		JingleContent *parsed_content =
+				jingle_session_find_content(session, name, creator);
+		if (parsed_content == NULL) {
+			purple_debug_error("jingle", "Error parsing content\n");
+			/* XXX: send error */
+		} else {
+			jingle_content_handle_action(parsed_content, content,
+					JINGLE_DESCRIPTION_INFO);
+		}
+	}
+}
+
+static void
 jingle_handle_session_accept(JingleSession *session, xmlnode *jingle)
 {
 	xmlnode *content = xmlnode_get_child(jingle, "content");
@@ -408,6 +444,8 @@ jingle_parse(JabberStream *js, xmlnode *
 		jingle_handle_content_reject(session, jingle);
 	} else if (!strcmp(action, "content-remove")) {
 		jingle_handle_content_remove(session, jingle);
+	} else if (!strcmp(action, "description-info")) {
+		jingle_handle_description_info(session, jingle);
 	} else if (!strcmp(action, "session-accept")) {
 		jingle_handle_session_accept(session, jingle);
 	} else if (!strcmp(action, "session-info")) {
============================================================
--- libpurple/protocols/jabber/jingle/jingle.h	7d798cff01e7a5f418c2a7486b7bce6d25c69028
+++ libpurple/protocols/jabber/jingle/jingle.h	37db3cbdff936fa7b33241b3e3f0b10b0de9272b
@@ -53,6 +53,7 @@ typedef enum {
 	JINGLE_CONTENT_MODIFY,
 	JINGLE_CONTENT_REJECT,
 	JINGLE_CONTENT_REMOVE,
+	JINGLE_DESCRIPTION_INFO,
 	JINGLE_SESSION_ACCEPT,
 	JINGLE_SESSION_INFO,
 	JINGLE_SESSION_INITIATE,


More information about the Commits mailing list