changeset 22980:77fc073e5a0b

Make MySpace group handling more consistent. References #3378.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 16 May 2008 20:19:12 +0000
parents 18c3c7d8bdbd
children 410f1bf7f734 882af25a8edf
files libpurple/protocols/myspace/myspace.c
diffstat 1 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c	Fri May 16 20:02:20 2008 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Fri May 16 20:19:12 2008 +0000
@@ -2824,21 +2824,17 @@
 	/* 1. Creates a new group, or gets existing group if it exists (or so
 	 * the documentation claims). */
 	group_name = msim_msg_get_string(contact_info, "GroupName");
-	if (group_name) {
-		group = purple_find_group(group_name);
-		if (!group) {
-			group = purple_group_new(group_name);
-			/* Add group to beginning. See #2752. */
-			purple_blist_add_group(group, NULL);
-
-		}
-
-		purple_debug_info("msim_add_contact_from_server_cb",
-				"adding to GroupName: %s\n", group_name);
-		g_free(group_name);
-	} else {
-		group = purple_group_new(_("IM Friends"));
+	if (!group_name) {
+		group_name = g_strdup(_("IM Friends"));
+		purple_debug_info("myspace", "No GroupName specified, defaulting to '%s'.\n", group_name);
 	}
+	group = purple_find_group(group_name);
+	if (!group) {
+		group = purple_group_new(group_name);
+		/* Add group to beginning. See #2752. */
+		purple_blist_add_group(group, NULL);
+	}
+	g_free(group_name);
 
 	/* 2. Get or create buddy */
 	buddy = purple_find_buddy(session->account, username);