# HG changeset patch # User Jeffrey Connelly # Date 1202975397 0 # Node ID 5aabf4e241884d695237827d868b5024f50148e2 # Parent 5411ca13b8786d350fac3e004455f5cff4e6eb46 In msimprpl, for server-side contacts, first search for an existing group on the client before creating one and adding it to the beginning of the list. If there is an existing group, use that. Fixes problem where MySpaceIM groups always move to the top of the buddy list upon sign-on, because they were always created anew. Closes #3378. diff -r 5411ca13b878 -r 5aabf4e24188 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Mon Feb 11 00:50:42 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.c Thu Feb 14 07:49:57 2008 +0000 @@ -2797,7 +2797,14 @@ * the documentation claims). */ group_name = msim_msg_get_string(contact_info, "GroupName"); if (group_name) { - group = purple_group_new(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); @@ -2813,9 +2820,6 @@ buddy = purple_buddy_new(session->account, username, NULL); } - /* Add group to beginning. See #2752. */ - purple_blist_add_group(group, NULL); - /* TODO: use 'Position' in contact_info to take into account where buddy is */ purple_blist_add_buddy(buddy, NULL, group, NULL /* insertion point */);