diff src/protocols/msn/userlist.c @ 10533:ace8cd0de6ea

[gaim-migrate @ 11862] Some minor MSN reorganization from Felipe and a bunch of MSN chat related fixes and improvements from me. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 20 Jan 2005 16:37:14 +0000
parents 1a97d5e88d12
children fed2a7c2471d
line wrap: on
line diff
--- a/src/protocols/msn/userlist.c	Thu Jan 20 14:40:56 2005 +0000
+++ b/src/protocols/msn/userlist.c	Thu Jan 20 16:37:14 2005 +0000
@@ -153,10 +153,25 @@
 
 	g_return_val_if_fail(user != NULL, NULL);
 
-	if ((store_name = msn_user_get_store_name(user)) != NULL)
-		return gaim_url_encode(store_name);
+	store_name = msn_user_get_store_name(user);
+
+	if (store_name != NULL)
+		store_name = gaim_url_encode(store_name);
+	else
+		store_name = msn_user_get_passport(user);
 
-	return msn_user_get_passport(user);
+	/* this might be a bit of a hack, but it should prevent notification server
+	 * disconnections for people who have buddies with insane friendly names
+	 * who added you to their buddy list from being disconnected. Stu. */
+	/* Shx: What? Isn't the store_name obtained from the server, and hence it's
+	 * below the BUDDY_ALIAS_MAXLEN ? */
+	/* Stu: yeah, that's why it's a bit of a hack, as you pointed out, we're
+	 * probably decoding the incoming store_name wrong, or something. bleh. */
+
+	if (strlen(store_name) > BUDDY_ALIAS_MAXLEN)
+		store_name = msn_user_get_passport(user);
+
+	return store_name;
 }
 
 static void
@@ -466,7 +481,6 @@
 msn_userlist_remove_group(MsnUserList *userlist, MsnGroup *group)
 {
 	userlist->groups = g_list_remove(userlist->groups, group);
-	msn_group_destroy(group);
 }
 
 MsnGroup *
@@ -553,7 +567,10 @@
 	group = msn_userlist_find_group_with_id(userlist, group_id);
 
 	if (group != NULL)
+	{
 		msn_userlist_remove_group(userlist, group);
+		msn_group_destroy(group);
+	}
 }
 
 void
@@ -630,13 +647,6 @@
 
 	store_name = (user != NULL) ? get_store_name(user) : who;
 
-	/* this might be a bit of a hack, but it should prevent notification server
-	 * disconnections for people who have buddies with insane friendly names
-	 * who added you to their buddy list from being disconnected. Stu. */
-	/* ... No, that sentence didn't parse for me either. Stu. */
-	if (strlen(store_name) > BUDDY_ALIAS_MAXLEN)
-		store_name = who;
-
 	/* Then request the add to the server. */
 	list = lists[list_id];