diff libpurple/protocols/jabber/parser.c @ 26262:b03430dae08e

Add xmlnode_set_attrib_full that enables you to set an attribute with both a prefix and a namespace. Also, change xmlnode_remove_attribute to remove all existing attributes that match the name. Otherwise, it would just take out the first one, and may not do what you want. Change Bonjour and XMPP to use the new function. References #7681. Fixes #8318.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 13 Mar 2009 04:29:11 +0000
parents b096f7fb6899
children 90d5e3b94a37
line wrap: on
line diff
--- a/libpurple/protocols/jabber/parser.c	Fri Mar 13 02:21:27 2009 +0000
+++ b/libpurple/protocols/jabber/parser.c	Fri Mar 13 04:29:11 2009 +0000
@@ -86,6 +86,8 @@
 			}
 		}
 		for(i=0; i < nb_attributes * 5; i+=5) {
+			const char *name = (const char *)attributes[i];
+			const char *prefix = (const char *)attributes[i+1];
 			const char *attrib_ns = (const char *)attributes[i+2];
 			char *txt;
 			int attrib_len = attributes[i+4] - attributes[i+3];
@@ -97,7 +99,7 @@
 			txt = attrib;
 			attrib = purple_unescape_html(txt);
 			g_free(txt);
-			xmlnode_set_attrib_with_namespace(node, (const char*) attributes[i], attrib_ns, attrib);
+			xmlnode_set_attrib_full(node, name, attrib_ns, prefix, attrib);
 			g_free(attrib);
 		}