merge of '107811b9dda730372dc0ae37aea05b664a77903e'

Mon, 12 Oct 2009 08:27:03 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Mon, 12 Oct 2009 08:27:03 +0000
changeset 28664
a57f48080272
parent 28658
107811b9dda7 (diff)
parent 28663
a83ac37c6155 (current diff)
child 28665
3ac533844419
child 28667
7bab19738f5e

merge of '107811b9dda730372dc0ae37aea05b664a77903e'
and 'a83ac37c61553311ec51a52a0cb93db028c1e574'

--- a/libpurple/protocols/jabber/google.c	Mon Oct 12 05:18:44 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Mon Oct 12 08:27:03 2009 +0000
@@ -95,14 +95,14 @@
 		gchar *participant, GoogleSession *session)
 {
 	GList *candidates = purple_media_get_local_candidates(
-			session->media, session_id, session->remote_jid);
+			session->media, session_id, session->remote_jid), *iter;
 	PurpleMediaCandidate *transport;
 	gboolean video = FALSE;
 
 	if (!strcmp(session_id, "google-video"))
 		video = TRUE;
 
-	for (;candidates;candidates = candidates->next) {
+	for (iter = candidates; iter; iter = iter->next) {
 		JabberIq *iq;
 		gchar *ip, *port, *username, *password;
 		gchar pref[16];
@@ -110,7 +110,7 @@
 		xmlnode *sess;
 		xmlnode *candidate;
 		guint component_id;
-		transport = (PurpleMediaCandidate*)(candidates->data);
+		transport = PURPLE_MEDIA_CANDIDATE(iter->data);
 		component_id = purple_media_candidate_get_component_id(
 				transport);
 
@@ -168,6 +168,7 @@
 
 		jabber_iq_send(iq);
 	}
+	purple_media_candidate_list_free(candidates);
 }
 
 static void
--- a/libpurple/protocols/jabber/jabber.c	Mon Oct 12 05:18:44 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Mon Oct 12 08:27:03 2009 +0000
@@ -1079,39 +1079,19 @@
 					return;
 				}
 			} else {
+				const char *ids[] = {"username", "password", "name", "email", "nick", "first",
+					"last", "address", "city", "state", "zip", "phone", "url", "date",
+					NULL};
 				const char *value = purple_request_field_string_get_value(field);
-
-				if(!strcmp(id, "username")) {
-					y = xmlnode_new_child(query, "username");
-				} else if(!strcmp(id, "password")) {
-					y = xmlnode_new_child(query, "password");
-				} else if(!strcmp(id, "name")) {
-					y = xmlnode_new_child(query, "name");
-				} else if(!strcmp(id, "email")) {
-					y = xmlnode_new_child(query, "email");
-				} else if(!strcmp(id, "nick")) {
-					y = xmlnode_new_child(query, "nick");
-				} else if(!strcmp(id, "first")) {
-					y = xmlnode_new_child(query, "first");
-				} else if(!strcmp(id, "last")) {
-					y = xmlnode_new_child(query, "last");
-				} else if(!strcmp(id, "address")) {
-					y = xmlnode_new_child(query, "address");
-				} else if(!strcmp(id, "city")) {
-					y = xmlnode_new_child(query, "city");
-				} else if(!strcmp(id, "state")) {
-					y = xmlnode_new_child(query, "state");
-				} else if(!strcmp(id, "zip")) {
-					y = xmlnode_new_child(query, "zip");
-				} else if(!strcmp(id, "phone")) {
-					y = xmlnode_new_child(query, "phone");
-				} else if(!strcmp(id, "url")) {
-					y = xmlnode_new_child(query, "url");
-				} else if(!strcmp(id, "date")) {
-					y = xmlnode_new_child(query, "date");
-				} else {
+				int i;
+				for (i = 0; ids[i]; i++) {
+					if (!strcmp(id, ids[i]))
+						break;
+				}
+
+				if (!ids[i])
 					continue;
-				}
+				y = xmlnode_new_child(query, ids[i]);
 				xmlnode_insert_data(y, value, -1);
 				if(cbdata->js->registration && !strcmp(id, "username")) {
 					g_free(cbdata->js->user->node);
--- a/libpurple/protocols/msn/nexus.c	Mon Oct 12 05:18:44 2009 +0000
+++ b/libpurple/protocols/msn/nexus.c	Mon Oct 12 08:27:03 2009 +0000
@@ -508,6 +508,7 @@
 	}
 
 	g_free(ud);
+	g_free(key);
 }
 
 void
--- a/libpurple/protocols/msn/servconn.c	Mon Oct 12 05:18:44 2009 +0000
+++ b/libpurple/protocols/msn/servconn.c	Mon Oct 12 08:27:03 2009 +0000
@@ -299,8 +299,8 @@
 static gboolean
 servconn_idle_timeout_cb(MsnServConn *servconn)
 {
+	servconn->timeout_handle = 0;
 	msn_servconn_disconnect(servconn);
-	servconn->timeout_handle = 0;	/* XXX: servconn may not be valid anymore */
 	return FALSE;
 }
 

mercurial