# HG changeset patch # User Paul Aurich # Date 1247941967 0 # Node ID b419196556c78d6eb84199b4510a052b2b1ac199 # Parent d6377ec7bcd880558792ff3bb756d0808e982d3e corner case: the first group wasn't being put into the hash table. diff -r d6377ec7bcd8 -r b419196556c7 libpurple/blist.c --- a/libpurple/blist.c Sat Jul 18 16:17:32 2009 +0000 +++ b/libpurple/blist.c Sat Jul 18 18:32:47 2009 +0000 @@ -1971,6 +1971,9 @@ if (!purplebuddylist->root) { purplebuddylist->root = gnode; + + key = g_utf8_collate_key(group->name, -1); + g_hash_table_insert(groups_cache, key, group); return; } @@ -1990,6 +1993,9 @@ gnode->prev->next = gnode->next; if (gnode->next) gnode->next->prev = gnode->prev; + } else { + key = g_utf8_collate_key(group->name, -1); + g_hash_table_insert(groups_cache, key, group); } if (node && PURPLE_BLIST_NODE_IS_GROUP(node)) { @@ -2006,9 +2012,6 @@ purplebuddylist->root = gnode; } - key = g_utf8_collate_key(group->name, -1); - g_hash_table_insert(groups_cache, key, group); - purple_blist_schedule_save(); if (ops && ops->update) {