changeset 12358:d1af58b4a463

[gaim-migrate @ 14662] This will save us from having to parse the send color for every buddy we add to a chat. That's probably not a big savings, but every little bit helps, right? Yeah, totally untested. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 05 Dec 2005 20:34:00 +0000
parents 8dd086d0f2b3
children cbf9f2e26916
files src/gtkconv.c
diffstat 1 files changed, 26 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Mon Dec 05 19:47:52 2005 +0000
+++ b/src/gtkconv.c	Mon Dec 05 20:34:00 2005 +0000
@@ -3011,9 +3011,6 @@
 	GtkTreeIter iter;
 	gboolean is_me = FALSE;
 	gboolean is_buddy;
-	GdkColor send_color;
-
-	gdk_color_parse(SEND_COLOR, &send_color);
 
 	chat    = GAIM_CONV_CHAT(conv);
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
@@ -3033,14 +3030,32 @@
 	is_buddy = (gaim_find_buddy(conv->account, name) != NULL);
 
 	gtk_list_store_append(ls, &iter);
-	gtk_list_store_set(ls, &iter,
-						CHAT_USERS_ICON_COLUMN,  pixbuf,
-						CHAT_USERS_ALIAS_COLUMN, alias,
-						CHAT_USERS_NAME_COLUMN,  name,
-						CHAT_USERS_FLAGS_COLUMN, flags,
-						CHAT_USERS_COLOR_COLUMN, is_me ? &send_color : get_nick_color(gtkconv, alias),
-						CHAT_USERS_BUDDY_COLUMN, is_buddy,
-						-1);
+
+	if (is_me)
+	{
+		GdkColor send_color;
+		gdk_color_parse(SEND_COLOR, &send_color);
+
+		gtk_list_store_set(ls, &iter,
+							CHAT_USERS_ICON_COLUMN,  pixbuf,
+							CHAT_USERS_ALIAS_COLUMN, alias,
+							CHAT_USERS_NAME_COLUMN,  name,
+							CHAT_USERS_FLAGS_COLUMN, flags,
+							CHAT_USERS_COLOR_COLUMN, &send_color,
+							CHAT_USERS_BUDDY_COLUMN, is_buddy,
+							-1);
+	}
+	else
+	{
+		gtk_list_store_set(ls, &iter,
+							CHAT_USERS_ICON_COLUMN,  pixbuf,
+							CHAT_USERS_ALIAS_COLUMN, alias,
+							CHAT_USERS_NAME_COLUMN,  name,
+							CHAT_USERS_FLAGS_COLUMN, flags,
+							CHAT_USERS_COLOR_COLUMN, get_nick_color(gtkconv, alias),
+							CHAT_USERS_BUDDY_COLUMN, is_buddy,
+							-1);
+	}
 
 	if (pixbuf)
 		g_object_unref(pixbuf);