# HG changeset patch # User Nathan Walp # Date 1066788090 0 # Node ID b8ce6e194cff8d78b9d9d27d2394b5698666537b # Parent 1c8830db0189d4c745f0ecac511589ec587a7f83 [gaim-migrate @ 7896] Kevin Stange mentioned that we weren't using contact aliases right when sorting, so I fixinated it. committer: Tailor Script diff -r 1c8830db0189 -r b8ce6e194cff src/blist.c --- a/src/blist.c Tue Oct 21 17:41:57 2003 +0000 +++ b/src/blist.c Wed Oct 22 02:01:30 2003 +0000 @@ -106,7 +106,7 @@ } } -static GaimContact *gaim_buddy_get_contact(GaimBuddy *buddy) +GaimContact *gaim_buddy_get_contact(GaimBuddy *buddy) { return (GaimContact*)((GaimBlistNode*)buddy)->parent; } @@ -775,7 +775,13 @@ const char *gaim_contact_get_alias(GaimContact* contact) { - return contact ? contact->alias : NULL; + if(!contact) + return NULL; + + if(contact->alias) + return contact->alias; + + return gaim_get_buddy_alias(contact->priority); } GaimGroup *gaim_group_new(const char *name) diff -r 1c8830db0189 -r b8ce6e194cff src/blist.h --- a/src/blist.h Tue Oct 21 17:41:57 2003 +0000 +++ b/src/blist.h Wed Oct 22 02:01:30 2003 +0000 @@ -378,6 +378,15 @@ GaimBuddyIcon *gaim_buddy_get_icon(const GaimBuddy *buddy); /** + * Returns a buddy's contact. + * + * @param buddy The buddy. + * + * @return The buddy's contact. + */ +GaimContact *gaim_buddy_get_contact(GaimBuddy *buddy); + +/** * Adds a new buddy to the buddy list. * * The buddy will be inserted right after node or prepended to the