diff src/protocols/msn/msn.c @ 6858:885c6528843b

[gaim-migrate @ 7403] Moving MSN buddies between groups should no longer reset their server-side friendly name. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 16 Sep 2003 03:56:54 +0000
parents bd433a45a463
children 17514a2f976a
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Tue Sep 16 03:18:44 2003 +0000
+++ b/src/protocols/msn/msn.c	Tue Sep 16 03:56:54 2003 +0000
@@ -406,6 +406,9 @@
 	GList *m = NULL;
 
 	b = gaim_find_buddy(gc->account, who);
+
+	g_return_val_if_fail(b != NULL, NULL);
+
 	user = b->proto_data;
 
 	if (user != NULL) {
@@ -1040,6 +1043,7 @@
 	MsnSession *session = gc->proto_data;
 	MsnGroup *old_group, *new_group;
 	MsnUser *user;
+	const char *friendly;
 	char outparams[MSN_BUF_LEN];
 
 	old_group = msn_groups_find_with_name(session->groups, old_group_name);
@@ -1047,6 +1051,9 @@
 
 	user = msn_users_find_with_passport(session->users, who);
 
+	if ((friendly = msn_user_get_name(user)) == NULL)
+		friendly = msn_user_get_passport(user);
+
 	if (old_group != NULL)
 		msn_user_remove_group_id(user, msn_group_get_id(old_group));
 
@@ -1072,7 +1079,7 @@
 	}
 	else {
 		g_snprintf(outparams, sizeof(outparams), "FL %s %s %d",
-				   who, who, msn_group_get_id(new_group));
+				   who, friendly, msn_group_get_id(new_group));
 
 		if (!msn_servconn_send_command(session->notification_conn,
 									   "ADD", outparams)) {