cpw.darkrain42.xmpp.iq-handlers: 7c48937e: Fix merge for ./jingle/

paul at darkrain42.org paul at darkrain42.org
Fri Apr 3 14:41:10 EDT 2009


-----------------------------------------------------------------
Revision: 7c48937e8ad8d3fb0546f7d8292474cc54a00c0e
Ancestor: 5a76f438ce788fd3a540e79873eacee60a3bac7a
Author: paul at darkrain42.org
Date: 2009-04-03T17:36:24
Branch: im.pidgin.cpw.darkrain42.xmpp.iq-handlers
URL: http://d.pidgin.im/viewmtn/revision/info/7c48937e8ad8d3fb0546f7d8292474cc54a00c0e

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

ChangeLog: 

Fix merge for ./jingle/

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/jingle.c	9f99f8696d91de320cecfb10008f24a1fcd4df29
+++ libpurple/protocols/jabber/jingle/jingle.c	d829c5019c2f45f35e9a5121a2d7c9710bc134f6
@@ -359,28 +359,21 @@ void
 }
 
 void
-jingle_parse(JabberStream *js, xmlnode *packet)
+jingle_parse(JabberStream *js, const char *from, JabberIqType type,
+             const char *id, xmlnode *jingle)
 {
-	const gchar *type = xmlnode_get_attrib(packet, "type");
-	xmlnode *jingle;
 	const gchar *action;
 	const gchar *sid;
 	JingleActionType action_type;
 	JingleSession *session;
 
-	if (!type || strcmp(type, "set")) {
-		/* send iq error here */
+	if (type != JABBER_IQ_SET) {
+		/* TODO: send iq error here */
 		return;
 	}
 
-	/* is this a Jingle package? */
-	if (!(jingle = xmlnode_get_child(packet, "jingle"))) {
-		/* send iq error here */
-		return;
-	}
-
 	if (!(action = xmlnode_get_attrib(jingle, "action"))) {
-		/* send iq error here */
+		/* TODO: send iq error here */
 		return;
 	}
 
@@ -409,9 +402,10 @@ jingle_parse(JabberStream *js, xmlnode *
 			/* send iq error */
 			return;
 		} else {
-			session = jingle_session_create(js, sid,
-					xmlnode_get_attrib(packet, "to"),
-					xmlnode_get_attrib(packet, "from"), FALSE);
+			char *own_jid = g_strdup_printf("%s@%s/%s", js->user->node,
+					js->user->domain, js->user->resource);
+			session = jingle_session_create(js, sid, own_jid, from, FALSE);
+			g_free(own_jid);
 		}
 	}
 
============================================================
--- libpurple/protocols/jabber/jingle/jingle.h	08a0b73b64cecc07b99a2e12454a8bc658d2e757
+++ libpurple/protocols/jabber/jingle/jingle.h	f73ef7ddd1f8cc203d349bb4e64d468be8802dd4
@@ -69,7 +69,8 @@ GType jingle_get_type(const gchar *type)
 
 GType jingle_get_type(const gchar *type);
 
-void jingle_parse(JabberStream *js, xmlnode *packet);
+void jingle_parse(JabberStream *js, const char *from, JabberIqType type,
+                  const char *id, xmlnode *child);
 
 void jingle_terminate_sessions(JabberStream *js);
 
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	00ade75579a2b54c158ccc8346748449ededc5bb
+++ libpurple/protocols/jabber/jingle/rtp.c	2e4bb2d4b5941ec8a7704cfbd06becda806c3319
@@ -438,12 +438,13 @@ static void
 }
 
 static void
-jingle_rtp_initiate_ack_cb(JabberStream *js, xmlnode *packet, gpointer data)
+jingle_rtp_initiate_ack_cb(JabberStream *js, const char *from,
+                           JabberIqType type, const char *id,
+                           xmlnode *packet, gpointer data)
 {
 	JingleSession *session = data;
 
-	if (!strcmp(xmlnode_get_attrib(packet, "type"), "error") ||
-			xmlnode_get_child(packet, "error")) {
+	if (type == JABBER_IQ_ERROR || xmlnode_get_child(packet, "error")) {
 		purple_media_end(jingle_rtp_get_media(session), NULL, NULL);
 		g_object_unref(session);
 		return;


More information about the Commits mailing list