qulogic/pidgin

We can do this without forcing a minor bump.
sadrul.conv.persistent
2007-09-15, Sadrul Habib Chowdhury
db156c9a707d
Parents f1b5a671b0d5
Children 954b26d0f8be
We can do this without forcing a minor bump.
--- 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;
};