changeset 28685:534ff54568eb

Don't attempt to change the alias on the server if the contact is not (yet) on it. Fixes #9242 and #10393.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 03 Oct 2009 21:01:57 +0000
parents 97856e3452d0
children 542b75da206e
files libpurple/protocols/msn/contact.c
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Sat Oct 03 20:01:35 2009 +0000
+++ b/libpurple/protocols/msn/contact.c	Sat Oct 03 21:01:57 2009 +0000
@@ -1417,6 +1417,7 @@
 	xmlnode *contact;
 	xmlnode *contact_info;
 	xmlnode *changes;
+	MsnUser *user = NULL;
 
 	purple_debug_info("msn", "Update contact information for %s with new %s: %s\n",
 		passport ? passport : "(null)",
@@ -1424,6 +1425,12 @@
 		value ? value : "(null)");
 	g_return_if_fail(passport != NULL);
 
+	if (strcmp(passport, "Me") != 0) {
+		user = msn_userlist_find_user(session->userlist, passport);
+		if (!user)
+			return;
+	}
+
 	contact_info = xmlnode_new("contactInfo");
 	changes = xmlnode_new("propertiesChanged");
 
@@ -1464,14 +1471,13 @@
 	xmlnode_insert_child(contact, contact_info);
 	xmlnode_insert_child(contact, changes);
 
-	if (!strcmp(passport, "Me")) {
-		xmlnode *contactType = xmlnode_new_child(contact_info, "contactType");
-		xmlnode_insert_data(contactType, "Me", -1);
-	} else {
-		MsnUser *user = msn_userlist_find_user(session->userlist, passport);
+	if (user) {
 		xmlnode *contactId = xmlnode_new_child(contact, "contactId");
 		msn_callback_state_set_uid(state, user->uid);
 		xmlnode_insert_data(contactId, state->uid, -1);
+	} else {
+		xmlnode *contactType = xmlnode_new_child(contact_info, "contactType");
+		xmlnode_insert_data(contactType, "Me", -1);
 	}
 
 	msn_contact_request(state);