diff -r c6d76b49c206 -r e10c4ea18f7c pidgin/gtkconv.c
--- a/pidgin/gtkconv.c Fri Nov 16 23:30:03 2007 +0000
+++ b/pidgin/gtkconv.c Fri Nov 16 23:32:17 2007 +0000
@@ -6519,6 +6519,7 @@
AtkObject *accessibility_obj;
/* I think this is a little longer than it needs to be but I'm lazy. */
char *style;
+ gboolean bold = FALSE;
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
im = PURPLE_CONV_IM(conv);
@@ -6552,7 +6553,7 @@
gtk_list_store_set(gtkconv->infopane_model, &(gtkconv->infopane_iter),
CONV_TEXT_COLUMN, markup, -1);
/* XXX seanegan Why do I have to do this? */
- gtk_widget_queue_draw(gtkconv->infopane);
+ gtk_widget_queue_draw(gtkconv->infopane);
if (title != markup)
g_free(markup);
@@ -6571,31 +6572,41 @@
style = "color=\"#c4a000\"";
} else if (gtkconv->unseen_state == PIDGIN_UNSEEN_NICK) {
atk_object_set_description(accessibility_obj, _("Nick Said"));
- style = "color=\"#204a87\" weight=\"bold\"";
+ style = "color=\"#cc0000\"";
} else if (gtkconv->unseen_state == PIDGIN_UNSEEN_TEXT) {
atk_object_set_description(accessibility_obj, _("Unread Messages"));
- style = "color=\"#cc0000\" weight=\"bold\"";
+ if (gtkconv->active_conv->type == PURPLE_CONV_TYPE_CHAT)
+ style = "color=\"#204a87\" weight=\"bold\"";
+ else
+ style = "color=\"#cc0000\" weight=\"bold\"";
} else if (gtkconv->unseen_state == PIDGIN_UNSEEN_EVENT) {
atk_object_set_description(accessibility_obj, _("New Event"));
- style = "color=\"#888a85\" weight=\"bold\"";
+ style = "color=\"#888a85\"";
} else {
- style = "";
- }
+ style = NULL;
+ }
+
+ if (gtkconv->unseen_state == PIDGIN_UNSEEN_TEXT ||
+ gtkconv->unseen_state == PIDGIN_UNSEEN_NICK ||
+ gtkconv->unseen_state == PIDGIN_UNSEEN_EVENT)
+ bold = TRUE;
- if (*style != '\0')
+ if (style || bold)
{
char *html_title,*label;
html_title = g_markup_escape_text(title, -1);
- label = g_strdup_printf("%s",
- style, html_title);
+ label = g_strdup_printf("%s",
+ style ? style : "",
+ bold ? "weight=\"bold\"" : "",
+ html_title);
g_free(html_title);
gtk_label_set_markup(GTK_LABEL(gtkconv->tab_label), label);
g_free(label);
}
else
gtk_label_set_text(GTK_LABEL(gtkconv->tab_label), title);
-
+
if (pidgin_conv_window_is_active_conversation(conv))
update_typing_icon(gtkconv);
@@ -7397,6 +7408,17 @@
pidgin_conv_update_fields(conv, PIDGIN_CONV_TOPIC);
}
+/* Message history stuff */
+
+/* Compare two PurpleConvMessage's, according to time in ascending order. */
+static int
+message_compare(gconstpointer p1, gconstpointer p2)
+{
+ const PurpleConvMessage *m1 = p1, *m2 = p2;
+ return (m1->when > m2->when);
+}
+
+/* Adds some message history to the gtkconv. This happens in a idle-callback. */
static gboolean
add_message_history_to_gtkconv(gpointer data)
{
@@ -7404,49 +7426,106 @@
int count = 0;
int timer = gtkconv->attach.timer;
time_t when = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->entry), "attach-start-time"));
+ gboolean im = (gtkconv->active_conv->type == PURPLE_CONV_TYPE_IM);
gtkconv->attach.timer = 0;
while (gtkconv->attach.current && count < 100) { /* XXX: 100 is a random value here */
PurpleConvMessage *msg = gtkconv->attach.current->data;
- if (when && when < msg->when) {
+ if (!im && when && when < msg->when) {
gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "