# HG changeset patch # User Paul Aurich # Date 1229974805 0 # Node ID 6eecd6ba286260a43cc3f581a817eac5b6a63f17 # Parent 9b1310f1cc7c1283123570925a44fe86a2646590 Fix situation in which group was not specified and purple_find_buddy_in_group(account, who, NULL or "") won't find the existing PurpleBuddy in "Buddies" diff -r 9b1310f1cc7c -r 6eecd6ba2862 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sun Dec 21 22:42:04 2008 +0000 +++ b/pidgin/gtkblist.c Mon Dec 22 19:40:05 2008 +0000 @@ -6504,13 +6504,22 @@ whoalias = NULL; g = NULL; - if ((grp != NULL) && (*grp != '\0') && ((g = purple_find_group(grp)) == NULL)) + if ((grp != NULL) && (*grp != '\0')) { - g = purple_group_new(grp); - purple_blist_add_group(g, NULL); + if ((g = purple_find_group(grp)) == NULL) + { + g = purple_group_new(grp); + purple_blist_add_group(g, NULL); + } + + b = purple_find_buddy_in_group(data->account, who, g); } - - if ((b = purple_find_buddy_in_group(data->account, who, g)) == NULL) + else if ((b = purple_find_buddy(data->account, who)) != NULL) + { + g = purple_buddy_get_group(b); + } + + if (b == NULL) { b = purple_buddy_new(data->account, who, whoalias); purple_blist_add_buddy(b, NULL, g, NULL);