# HG changeset patch # User Nathan Walp # Date 1062712095 0 # Node ID a781689ca455c99ebea9c544c2c35b3a7c9866b3 # Parent 43f540b0d63032a8b1f90ec49591e94e487230f5 [gaim-migrate @ 7276] alphabetical sort now works again, status and log sorting still need plenty of work committer: Tailor Script diff -r 43f540b0d630 -r a781689ca455 src/blist.c --- a/src/blist.c Thu Sep 04 21:33:28 2003 +0000 +++ b/src/blist.c Thu Sep 04 21:48:15 2003 +0000 @@ -1037,6 +1037,26 @@ return ret; } +const char *gaim_blist_chat_get_name(GaimBlistChat *chat) +{ + if(chat->alias && *chat->alias) { + return chat->alias; + } else { + struct proto_chat_entry *pce; + GList *parts, *tmp; + char *ret; + + parts = GAIM_PLUGIN_PROTOCOL_INFO(chat->account->gc->prpl)->chat_info(chat->account->gc); + pce = parts->data; + ret = g_hash_table_lookup(chat->components, pce->identifier); + for(tmp = parts; tmp; tmp = tmp->next) + g_free(tmp->data); + g_list_free(parts); + + return ret; + } +} + GaimBuddy *gaim_find_buddy(GaimAccount *account, const char *name) { GaimBuddy *buddy; diff -r 43f540b0d630 -r a781689ca455 src/blist.h --- a/src/blist.h Thu Sep 04 21:33:28 2003 +0000 +++ b/src/blist.h Thu Sep 04 21:48:15 2003 +0000 @@ -455,6 +455,14 @@ const char *gaim_get_buddy_alias(GaimBuddy *buddy); /** + * Returns the correct name to display for a blist chat. + * + * @param chat The chat whose name will be returned. + * @return The alias (if set), or first component value. + */ +const char *gaim_blist_chat_get_name(GaimBlistChat *chat); + +/** * Finds the buddy struct given a screenname and an account * * @param name The buddy's screenname or NULL to search for more buddies with the same screenname