comparison src/gtkconv.c @ 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 4b8c20fcecd6
children cbf9f2e26916
comparison
equal deleted inserted replaced
12357:8dd086d0f2b3 12358:d1af58b4a463
3009 GtkListStore *ls; 3009 GtkListStore *ls;
3010 GdkPixbuf *pixbuf; 3010 GdkPixbuf *pixbuf;
3011 GtkTreeIter iter; 3011 GtkTreeIter iter;
3012 gboolean is_me = FALSE; 3012 gboolean is_me = FALSE;
3013 gboolean is_buddy; 3013 gboolean is_buddy;
3014 GdkColor send_color;
3015
3016 gdk_color_parse(SEND_COLOR, &send_color);
3017 3014
3018 chat = GAIM_CONV_CHAT(conv); 3015 chat = GAIM_CONV_CHAT(conv);
3019 gtkconv = GAIM_GTK_CONVERSATION(conv); 3016 gtkconv = GAIM_GTK_CONVERSATION(conv);
3020 gtkchat = gtkconv->u.chat; 3017 gtkchat = gtkconv->u.chat;
3021 gc = gaim_conversation_get_gc(conv); 3018 gc = gaim_conversation_get_gc(conv);
3031 is_me = TRUE; 3028 is_me = TRUE;
3032 3029
3033 is_buddy = (gaim_find_buddy(conv->account, name) != NULL); 3030 is_buddy = (gaim_find_buddy(conv->account, name) != NULL);
3034 3031
3035 gtk_list_store_append(ls, &iter); 3032 gtk_list_store_append(ls, &iter);
3036 gtk_list_store_set(ls, &iter, 3033
3037 CHAT_USERS_ICON_COLUMN, pixbuf, 3034 if (is_me)
3038 CHAT_USERS_ALIAS_COLUMN, alias, 3035 {
3039 CHAT_USERS_NAME_COLUMN, name, 3036 GdkColor send_color;
3040 CHAT_USERS_FLAGS_COLUMN, flags, 3037 gdk_color_parse(SEND_COLOR, &send_color);
3041 CHAT_USERS_COLOR_COLUMN, is_me ? &send_color : get_nick_color(gtkconv, alias), 3038
3042 CHAT_USERS_BUDDY_COLUMN, is_buddy, 3039 gtk_list_store_set(ls, &iter,
3043 -1); 3040 CHAT_USERS_ICON_COLUMN, pixbuf,
3041 CHAT_USERS_ALIAS_COLUMN, alias,
3042 CHAT_USERS_NAME_COLUMN, name,
3043 CHAT_USERS_FLAGS_COLUMN, flags,
3044 CHAT_USERS_COLOR_COLUMN, &send_color,
3045 CHAT_USERS_BUDDY_COLUMN, is_buddy,
3046 -1);
3047 }
3048 else
3049 {
3050 gtk_list_store_set(ls, &iter,
3051 CHAT_USERS_ICON_COLUMN, pixbuf,
3052 CHAT_USERS_ALIAS_COLUMN, alias,
3053 CHAT_USERS_NAME_COLUMN, name,
3054 CHAT_USERS_FLAGS_COLUMN, flags,
3055 CHAT_USERS_COLOR_COLUMN, get_nick_color(gtkconv, alias),
3056 CHAT_USERS_BUDDY_COLUMN, is_buddy,
3057 -1);
3058 }
3044 3059
3045 if (pixbuf) 3060 if (pixbuf)
3046 g_object_unref(pixbuf); 3061 g_object_unref(pixbuf);
3047 } 3062 }
3048 3063