changeset 20051:d9a6d6ac2537

We can do this without forcing a minor bump.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 15 Sep 2007 08:21:10 +0000
parents 20c336838629
children f6abebd4d0ff
files pidgin/gtkconv.c pidgin/gtkconv.h
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Sat Sep 15 08:03:47 2007 +0000
+++ b/pidgin/gtkconv.c	Sat Sep 15 08:21:10 2007 +0000
@@ -7363,12 +7363,14 @@
 	PidginConversation *gtkconv = data;
 	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"));
+
 	gtkconv->attach.timer = 0;
 	while (gtkconv->attach.current && count < 100) {  /* XXX: 100 is a random value here */
 		PurpleConvMessage *msg = gtkconv->attach.current->data;
-		if (gtkconv->attach.when && gtkconv->attach.when < msg->when) {
-			gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<HR>", 0);
-			gtkconv->attach.when = 0;
+		if (when && when < msg->when) {
+			gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR><HR>", 0);
+			g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
 		}
 		pidgin_conv_write_conv(gtkconv->active_conv, msg->who, msg->who, msg->what, msg->flags, msg->when);
 		gtkconv->attach.current = gtkconv->attach.current->prev;
@@ -7401,7 +7403,8 @@
 
 	list = purple_conversation_get_message_history(conv);
 	if (list) {
-		gtkconv->attach.when = ((PurpleConvMessage*)(list->data))->when;
+		g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time",
+				GINT_TO_POINTER(((PurpleConvMessage*)(list->data))->when));
 		gtkconv->attach.current = g_list_last(list);
 		gtkconv->attach.timer = g_idle_add(add_message_history_to_gtkconv, gtkconv);
 	} else {
--- a/pidgin/gtkconv.h	Sat Sep 15 08:03:47 2007 +0000
+++ b/pidgin/gtkconv.h	Sat Sep 15 08:21:10 2007 +0000
@@ -168,7 +168,6 @@
 	struct {
 		int timer;
 		GList *current;
-		time_t when;
 	} attach;
 };