libpurple/protocols/jabber/google/google_p2p.c

branch
soc.2013.gobjectification
changeset 34935
686fa55b0deb
parent 33650
19eaf308a449
child 35061
307195f879f3
child 36889
4dfe09057bed
--- a/libpurple/protocols/jabber/google/google_p2p.c	Fri Sep 06 21:31:42 2013 +0530
+++ b/libpurple/protocols/jabber/google/google_p2p.c	Sat Sep 07 00:10:19 2013 +0530
@@ -43,8 +43,8 @@
 static void jingle_google_p2p_finalize (GObject *object);
 static void jingle_google_p2p_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
 static void jingle_google_p2p_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static JingleTransport *jingle_google_p2p_parse_internal(xmlnode *google_p2p);
-static xmlnode *jingle_google_p2p_to_xml_internal(JingleTransport *transport, xmlnode *content, JingleActionType action);
+static JingleTransport *jingle_google_p2p_parse_internal(PurpleXmlNode *google_p2p);
+static PurpleXmlNode *jingle_google_p2p_to_xml_internal(JingleTransport *transport, PurpleXmlNode *content, JingleActionType action);
 static void jingle_google_p2p_add_local_candidate(JingleTransport *transport, const gchar *id, guint generation, PurpleMediaCandidate *candidate);
 static GList *jingle_google_p2p_get_remote_candidates(JingleTransport *transport);
 
@@ -354,22 +354,22 @@
 }
 
 static JingleTransport *
-jingle_google_p2p_parse_internal(xmlnode *google_p2p)
+jingle_google_p2p_parse_internal(PurpleXmlNode *google_p2p)
 {
 	JingleTransport *transport = parent_class->parse(google_p2p);
-	xmlnode *candidate = xmlnode_get_child(google_p2p, "candidate");
+	PurpleXmlNode *candidate = purple_xmlnode_get_child(google_p2p, "candidate");
 	JingleGoogleP2PCandidate *google_p2p_candidate = NULL;
 
-	for (; candidate; candidate = xmlnode_get_next_twin(candidate)) {
-		const gchar *generation = xmlnode_get_attrib(candidate, "generation");
-		const gchar *id = xmlnode_get_attrib(candidate, "name");
-		const gchar *address = xmlnode_get_attrib(candidate, "address");
-		const gchar *port = xmlnode_get_attrib(candidate, "port");
-		const gchar *preference = xmlnode_get_attrib(candidate, "preference");
-		const gchar *type = xmlnode_get_attrib(candidate, "type");
-		const gchar *protocol = xmlnode_get_attrib(candidate, "protocol");
-		const gchar *username = xmlnode_get_attrib(candidate, "username");
-		const gchar *password = xmlnode_get_attrib(candidate, "password");
+	for (; candidate; candidate = purple_xmlnode_get_next_twin(candidate)) {
+		const gchar *generation = purple_xmlnode_get_attrib(candidate, "generation");
+		const gchar *id = purple_xmlnode_get_attrib(candidate, "name");
+		const gchar *address = purple_xmlnode_get_attrib(candidate, "address");
+		const gchar *port = purple_xmlnode_get_attrib(candidate, "port");
+		const gchar *preference = purple_xmlnode_get_attrib(candidate, "preference");
+		const gchar *type = purple_xmlnode_get_attrib(candidate, "type");
+		const gchar *protocol = purple_xmlnode_get_attrib(candidate, "protocol");
+		const gchar *username = purple_xmlnode_get_attrib(candidate, "username");
+		const gchar *password = purple_xmlnode_get_attrib(candidate, "password");
 
 		if (!generation || !id || !address || !port || !preference ||
 				!type || !protocol || !username || !password)
@@ -390,10 +390,10 @@
 	return transport;
 }
 
-static xmlnode *
-jingle_google_p2p_to_xml_internal(JingleTransport *transport, xmlnode *content, JingleActionType action)
+static PurpleXmlNode *
+jingle_google_p2p_to_xml_internal(JingleTransport *transport, PurpleXmlNode *content, JingleActionType action)
 {
-	xmlnode *node = parent_class->to_xml(transport, content, action);
+	PurpleXmlNode *node = parent_class->to_xml(transport, content, action);
 
 	if (action == JINGLE_SESSION_INITIATE ||
 			action == JINGLE_SESSION_ACCEPT ||
@@ -405,7 +405,7 @@
 
 		for (; iter; iter = g_list_next(iter)) {
 			JingleGoogleP2PCandidate *candidate = iter->data;
-			xmlnode *xmltransport;
+			PurpleXmlNode *xmltransport;
 			gchar *generation, *network, *port, *preference;
 
 			if (candidate->rem_known == TRUE)
@@ -413,22 +413,22 @@
 
 			candidate->rem_known = TRUE;
 
-			xmltransport = xmlnode_new_child(node, "candidate");
+			xmltransport = purple_xmlnode_new_child(node, "candidate");
 			generation = g_strdup_printf("%d", candidate->generation);
 			network = g_strdup_printf("%d", candidate->network);
 			port = g_strdup_printf("%d", candidate->port);
 			preference = g_strdup_printf("%d", candidate->preference);
 
-			xmlnode_set_attrib(xmltransport, "generation", generation);
-			xmlnode_set_attrib(xmltransport, "name", candidate->id);
-			xmlnode_set_attrib(xmltransport, "address", candidate->address);
-			xmlnode_set_attrib(xmltransport, "network", network);
-			xmlnode_set_attrib(xmltransport, "port", port);
-			xmlnode_set_attrib(xmltransport, "preference", preference);
-			xmlnode_set_attrib(xmltransport, "protocol", candidate->protocol);
-			xmlnode_set_attrib(xmltransport, "type", candidate->type);
-			xmlnode_set_attrib(xmltransport, "username", candidate->username);
-			xmlnode_set_attrib(xmltransport, "password", candidate->password);
+			purple_xmlnode_set_attrib(xmltransport, "generation", generation);
+			purple_xmlnode_set_attrib(xmltransport, "name", candidate->id);
+			purple_xmlnode_set_attrib(xmltransport, "address", candidate->address);
+			purple_xmlnode_set_attrib(xmltransport, "network", network);
+			purple_xmlnode_set_attrib(xmltransport, "port", port);
+			purple_xmlnode_set_attrib(xmltransport, "preference", preference);
+			purple_xmlnode_set_attrib(xmltransport, "protocol", candidate->protocol);
+			purple_xmlnode_set_attrib(xmltransport, "type", candidate->type);
+			purple_xmlnode_set_attrib(xmltransport, "username", candidate->username);
+			purple_xmlnode_set_attrib(xmltransport, "password", candidate->password);
 
 			g_free(generation);
 			g_free(network);

mercurial