# HG changeset patch # User Mike Ruprecht # Date 1215739208 0 # Node ID 84c7bb2ca41fb3b9ff3603f5aeb1322fc3ecd894 # Parent 301bb7478f7422c5f41a68aa154576042223eeff Added xmlnode_get_parent. diff -r 301bb7478f74 -r 84c7bb2ca41f libpurple/protocols/jabber/jingle.c --- a/libpurple/protocols/jabber/jingle.c Fri Jul 11 01:04:44 2008 +0000 +++ b/libpurple/protocols/jabber/jingle.c Fri Jul 11 01:20:08 2008 +0000 @@ -590,7 +590,7 @@ 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 @@ 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); } diff -r 301bb7478f74 -r 84c7bb2ca41f libpurple/xmlnode.c --- a/libpurple/xmlnode.c Fri Jul 11 01:04:44 2008 +0000 +++ b/libpurple/xmlnode.c Fri Jul 11 01:20:08 2008 +0000 @@ -307,6 +307,12 @@ 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) { diff -r 301bb7478f74 -r 84c7bb2ca41f libpurple/xmlnode.h --- a/libpurple/xmlnode.h Fri Jul 11 01:04:44 2008 +0000 +++ b/libpurple/xmlnode.h Fri Jul 11 01:20:08 2008 +0000 @@ -246,6 +246,15 @@ 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.