# HG changeset patch # User Luke Schierer # Date 1083607246 0 # Node ID 8ab568b924808a0e97ec5347888a4ca1e2e35311 # Parent 75849c0650e52f4cba5cd48226a8527cc38deaf6 [gaim-migrate @ 9632] " I like the iChat style timestamp, but it's annoying that it constantly adds the timestamp, scrolling old msgs off the screen. This patch will make it only add a timestamp if there have been messages since the last timestamp. Adding a preference checkbox for this is left as an exercise for the reader." --Robert Story as this behavior seems to me more intuitive, i'm going ahead with this patch committer: Tailor Script diff -r 75849c0650e5 -r 8ab568b92480 COPYRIGHT --- a/COPYRIGHT Mon May 03 17:55:46 2004 +0000 +++ b/COPYRIGHT Mon May 03 18:00:46 2004 +0000 @@ -122,6 +122,7 @@ Lex Spoon Kevin Stange David Stoddard +Robert Story Sun Microsystems Mårten (fursten) Svantesson Brian Tarricone diff -r 75849c0650e5 -r 8ab568b92480 ChangeLog --- a/ChangeLog Mon May 03 17:55:46 2004 +0000 +++ b/ChangeLog Mon May 03 18:00:46 2004 +0000 @@ -21,6 +21,7 @@ the conversation window is closed, preventing a crash (Kevin Stange) * Gtk2.0 compatibility fixes (Tim Ringenbach) * Updated and standardized blist signals (Gary Kramlich) + * The timestamp plugin won't spam the conversation now (Robert Story) version 0.77 (04/22/2004): New Features: diff -r 75849c0650e5 -r 8ab568b92480 plugins/timestamp.c --- a/plugins/timestamp.c Mon May 03 17:55:46 2004 +0000 +++ b/plugins/timestamp.c Mon May 03 18:00:46 2004 +0000 @@ -46,14 +46,34 @@ char *buf; char mdate[6]; time_t tim = time(NULL); + gsize len = 0; if (!g_list_find(gaim_get_conversations(), c)) return FALSE; - strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim)); - buf = g_strdup_printf(" %s", mdate); - gaim_conversation_write(c, NULL, buf, GAIM_MESSAGE_NO_LOG, tim); - g_free(buf); + len = GPOINTER_TO_INT( + gaim_conversation_get_data(c, "timestamp-last-size")); + if((NULL != c->history) && (len != c->history->len)) { + + strftime(mdate, sizeof(mdate), "%02H:%02M", localtime(&tim)); + buf = g_strdup_printf("%s", mdate); + } +#ifndef DEBUG_TIMESTAMP + else { + return TRUE; + } +#else + else { + buf = g_strdup_printf("NC"); + } +#endif + + gaim_conversation_write(c, NULL, buf, GAIM_MESSAGE_NO_LOG, tim); + g_free(buf); + + gaim_conversation_set_data(c, "timestamp-last-size", + GINT_TO_POINTER(c->history->len)); + return TRUE; }