diff mcabber/src/histolog.c @ 184:b5aa2b9c425a

[/trunk] Changeset 196 by mikael * Don't use a char* as prefix, but split it to timestamp + flags. * Don't use a boolean for timestamp, use a time_t (actually we always use a timestamp so the bool made no sense...).
author mikael
date Thu, 05 May 2005 19:38:44 +0000
parents c658c131ea10
children 888ad9f15346
line wrap: on
line diff
--- a/mcabber/src/histolog.c	Thu May 05 15:01:48 2005 +0000
+++ b/mcabber/src/histolog.c	Thu May 05 19:38:44 2005 +0000
@@ -101,12 +101,12 @@
 void hlog_read_history(const char *jid, GList **p_buddyhbuf, guint width)
 {
   char *filename;
-  time_t timestamp;
   guchar type, info;
   char *data, *tail;
+  time_t timestamp;
+  guint prefix_flags;
   guint len;
   FILE *fp;
-  char prefix[32];
 
   if (!FileLoadLogs) return;
 
@@ -155,12 +155,11 @@
       *(tail-1) = 0;
 
     if (type == 'M') {
-      strftime(prefix, 12, "[%H:%M] ", localtime(&timestamp));
       if (info == 'S')
-        strcat(prefix, "--> ");
+        prefix_flags = HBB_PREFIX_OUT;
       else
-        strcat(prefix, "<== ");
-      hbuf_add_line(p_buddyhbuf, &data[18], prefix, width);
+        prefix_flags = HBB_PREFIX_IN;
+      hbuf_add_line(p_buddyhbuf, &data[18], timestamp, prefix_flags, width);
     }
   }
   fclose(fp);