diff src/blist.c @ 6034:5a0060191a77

[gaim-migrate @ 6484] (16:32:42) javabsp: Who wants a patch? Fixes 744090 (16:33:15) javabsp: 0.64cvs bad confirmation removing chat room(from blist) (16:33:55) javabsp: It's showing something like "remove chat (null)" if the chat doesn't have an alias committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 05 Jul 2003 20:52:43 +0000
parents 4c16227f7cd9
children 547ba881bc7e
line wrap: on
line diff
--- a/src/blist.c	Sat Jul 05 18:55:07 2003 +0000
+++ b/src/blist.c	Sat Jul 05 20:52:43 2003 +0000
@@ -23,6 +23,7 @@
 #include "blist.h"
 #include "conversation.h"
 #include "debug.h"
+#include "multi.h"
 #include "notify.h"
 #include "prefs.h"
 #include "privacy.h"
@@ -347,6 +348,33 @@
 	return chat;
 }
 
+const char *gaim_chat_get_display_name(struct chat *chat)
+{
+	char *name;
+
+	if(chat->alias){
+		 name = g_strdup(chat->alias);
+	}
+	else{
+		 GList *parts;
+		 GaimPlugin *prpl;
+		 GaimPluginProtocolInfo *prpl_info;
+		 struct proto_chat_entry *pce;
+
+		 prpl = gaim_find_prpl(gaim_account_get_protocol(chat->account));
+		 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl);
+
+		 parts = prpl_info->chat_info(chat->account->gc);
+
+		 pce = parts->data;
+		 name = g_markup_escape_text(g_hash_table_lookup(chat->components,
+														 pce->identifier), -1);
+		 g_list_free(parts);
+	}
+
+	return name;
+}
+
 struct buddy *gaim_buddy_new(GaimAccount *account, const char *screenname, const char *alias)
 {
 	struct buddy *b;