soc.2008.vv: 0ec5b55d: Added xmlnode_get_parent.

maiku at soc.pidgin.im maiku at soc.pidgin.im
Thu Jul 10 21:25:48 EDT 2008


-----------------------------------------------------------------
Revision: 0ec5b55dd93afec1d362669c1c8770785b0816a9
Ancestor: d4ed48aff85610d71fedaf001ff9e5861b7378e1
Author: maiku at soc.pidgin.im
Date: 2008-07-11T01:20:08
Branch: im.pidgin.soc.2008.vv
URL: http://d.pidgin.im/viewmtn/revision/info/0ec5b55dd93afec1d362669c1c8770785b0816a9

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

ChangeLog: 

Added xmlnode_get_parent.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle.c	71330978adc9c64c60f5fdc445531f579d235396
+++ libpurple/protocols/jabber/jingle.c	4f6c358a0f0865ff3d5ae5c5b4d959e39a142c7e
@@ -590,7 +590,7 @@ jabber_jingle_session_create_ack(JingleS
 	JabberIq *result = jabber_iq_new(
 			jabber_jingle_session_get_js(session),
 			JABBER_IQ_RESULT);
-	xmlnode *packet = jingle->parent;
+	xmlnode *packet = xmlnode_get_parent(jingle);
 	jabber_iq_set_id(result, xmlnode_get_attrib(packet, "id"));
 	xmlnode_set_attrib(result->node, "from", xmlnode_get_attrib(packet, "to"));
 	xmlnode_set_attrib(result->node, "to", xmlnode_get_attrib(packet, "from"));
@@ -1361,7 +1361,7 @@ jabber_jingle_session_handle_transport_i
 	if (g_list_length(remote_candidates) > 0) {
 		purple_media_add_remote_candidates(session->media,
 						   xmlnode_get_attrib(content, "name"),
-						   xmlnode_get_attrib(jingle->parent, "from"),
+						   xmlnode_get_attrib(xmlnode_get_parent(jingle), "from"),
 						   remote_candidates);
 		fs_candidate_list_destroy(remote_candidates);
 	}
============================================================
--- libpurple/xmlnode.c	efcedf1793b22ae335060f1adc2407dc964f30e0
+++ libpurple/xmlnode.c	69922f0ffa359c16c8a76b66a5ca15f4dd5e5da9
@@ -307,6 +307,12 @@ const char *xmlnode_get_prefix(xmlnode *
 	return node->prefix;
 }
 
+xmlnode *xmlnode_get_parent(const xmlnode *child)
+{
+	g_return_val_if_fail(child != NULL, NULL);
+	return child->parent;
+}
+
 void
 xmlnode_free(xmlnode *node)
 {
============================================================
--- libpurple/xmlnode.h	f73fde22673b21debb1d446f81d715725367b377
+++ libpurple/xmlnode.h	673eb5ff9cdcc48e9fdb99831c4c26a7e5d1f520
@@ -246,6 +246,15 @@ const char *xmlnode_get_prefix(xmlnode *
 const char *xmlnode_get_prefix(xmlnode *node);
 
 /**
+ * Gets the parent node.
+ *
+ * @param child The child node.
+ *
+ * @return The parent or NULL.
+ */
+xmlnode *xmlnode_get_parent(const xmlnode *child);
+
+/**
  * Returns the node in a string of xml.
  *
  * @param node The starting node to output.


More information about the Commits mailing list