changeset 6744:a781689ca455

[gaim-migrate @ 7276] alphabetical sort now works again, status and log sorting still need plenty of work committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 04 Sep 2003 21:48:15 +0000
parents 43f540b0d630
children 57a24492434b
files src/blist.c src/blist.h
diffstat 2 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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