changeset 29123:bb873040d7de

propagate from branch 'im.pidgin.pidgin' (head c9c14c0c44e2863ad15a283f36c5c278a4ea5539) to branch 'im.pidgin.pidgin.next.minor' (head 67e7dd715b2ab1b19565588b7d1b452b33d2606b)
author John Bailey <rekkanoryo@rekkanoryo.org>
date Mon, 12 Oct 2009 17:45:33 +0000
parents a4e4d27fb810 (current diff) d213c8ad89da (diff)
children 51c5cbc0d325
files ChangeLog libpurple/protocols/msn/nexus.c pidgin/gtkcelllayout.c pidgin/gtkcelllayout.h pidgin/gtkcellrendererprogress.c pidgin/gtkcellrendererprogress.h pidgin/gtkcellview.c pidgin/gtkcellview.h pidgin/gtkcellviewmenuitem.c pidgin/gtkcellviewmenuitem.h pidgin/gtkexpander.c pidgin/gtkexpander.h pidgin/pidgincombobox.c pidgin/pidgincombobox.h
diffstat 8 files changed, 32 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 12 05:08:37 2009 +0000
+++ b/ChangeLog	Mon Oct 12 17:45:33 2009 +0000
@@ -23,6 +23,7 @@
 	Yahoo:
 	* Fix sending /buzz.
 	* Fix blocking behavior for federated (MSN/OCS/Sametime) service users.
+	  (Jason Cohen)
 	* Add support for adding OCS and Sametime buddies.  OCS users are added
 	  as "ocs/user@domain.tld" and Sametime users are added as
 	  "ibm/sametime_id".  (Jason Cohen)
--- a/libpurple/protocols/jabber/google.c	Mon Oct 12 05:08:37 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Mon Oct 12 17:45:33 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:08:37 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Mon Oct 12 17:45:33 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/contact.c	Mon Oct 12 05:08:37 2009 +0000
+++ b/libpurple/protocols/msn/contact.c	Mon Oct 12 17:45:33 2009 +0000
@@ -356,9 +356,10 @@
 	char *type;
 	char *member_id;
 	MsnUser *user;
-	xmlnode *annotation;
+	xmlnode *annotation, *display;
 	guint nid = MSN_NETWORK_UNKNOWN;
 	char *invite = NULL;
+	char *display_text;
 
 	passport = xmlnode_get_data(xmlnode_get_child(member, node));
 	if (!purple_email_is_valid(passport)) {
@@ -368,7 +369,13 @@
 
 	type = xmlnode_get_data(xmlnode_get_child(member, "Type"));
 	member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId"));
-	user = msn_userlist_find_add_user(session->userlist, passport, NULL);
+	if ((display = xmlnode_get_child(member, "DisplayName"))) {
+		display_text = xmlnode_get_data(display);
+	} else {
+		display_text = NULL;
+	}
+
+	user = msn_userlist_find_add_user(session->userlist, passport, display_text);
 
 	for (annotation = xmlnode_get_child(member, "Annotations/Annotation");
 	     annotation;
@@ -409,6 +416,7 @@
 	g_free(type);
 	g_free(member_id);
 	g_free(invite);
+	g_free(display_text);
 }
 
 static void
--- a/libpurple/protocols/msn/nexus.c	Mon Oct 12 05:08:37 2009 +0000
+++ b/libpurple/protocols/msn/nexus.c	Mon Oct 12 17:45:33 2009 +0000
@@ -494,6 +494,7 @@
 	}
 
 	g_free(ud);
+	g_free(key);
 }
 
 void
--- a/libpurple/protocols/msn/notification.c	Mon Oct 12 05:08:37 2009 +0000
+++ b/libpurple/protocols/msn/notification.c	Mon Oct 12 17:45:33 2009 +0000
@@ -1098,7 +1098,6 @@
 	}
 
 	if (msn_user_set_friendly_name(user, friendly)) {
-		serv_got_alias(gc, passport, friendly);
 		msn_update_contact(session, passport, MSN_UPDATE_DISPLAY, friendly);
 	}
 	g_free(friendly);
@@ -1263,7 +1262,6 @@
 
 	if (msn_user_set_friendly_name(user, friendly))
 	{
-		serv_got_alias(gc, passport, friendly);
 		msn_update_contact(session, passport, MSN_UPDATE_DISPLAY, friendly);
 	}
 
--- a/libpurple/protocols/msn/servconn.c	Mon Oct 12 05:08:37 2009 +0000
+++ b/libpurple/protocols/msn/servconn.c	Mon Oct 12 17:45:33 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;
 }
 
--- a/libpurple/protocols/msn/user.c	Mon Oct 12 05:08:37 2009 +0000
+++ b/libpurple/protocols/msn/user.c	Mon Oct 12 17:45:33 2009 +0000
@@ -183,12 +183,15 @@
 {
 	g_return_val_if_fail(user != NULL, FALSE);
 
-	if (user->friendly_name && name && !strcmp(user->friendly_name, name))
+	if (user->friendly_name && name && (!strcmp(user->friendly_name, name) ||
+				!strcmp(user->passport, name)))
 		return FALSE;
 
 	g_free(user->friendly_name);
 	user->friendly_name = g_strdup(name);
 
+	serv_got_alias(purple_account_get_connection(user->userlist->session->account),
+			user->passport, name);
 	return TRUE;
 }