diff mcabber/src/hbuf.c @ 729:39f67cade02c

Use bold font for outgoing messages
author Mikael Berthe <mikael@lilotux.net>
date Mon, 06 Mar 2006 11:59:34 +0100
parents ee03b56b93ee
children c502bfe67c31
line wrap: on
line diff
--- a/mcabber/src/hbuf.c	Mon Mar 06 10:25:24 2006 +0100
+++ b/mcabber/src/hbuf.c	Mon Mar 06 11:59:34 2006 +0100
@@ -248,20 +248,36 @@
 hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n)
 {
   unsigned int i;
+  hbuf_block *blk;
+  guchar last_persist_prefixflags = 0;
+  GList *last_persist;
+
+  last_persist = hbuf_previous_persistent(hbuf);
+  if (last_persist && last_persist != hbuf) {
+    blk = (hbuf_block*)(last_persist->data);
+    last_persist_prefixflags = blk->prefix.flags;
+  }
 
   hbb_line **array = g_new0(hbb_line*, n);
   hbb_line **array_elt = array;
 
   for (i=0 ; i < n ; i++) {
     if (hbuf) {
-      hbuf_block *blk = (hbuf_block*)(hbuf->data);
       int maxlen;
+      blk = (hbuf_block*)(hbuf->data);
       maxlen = blk->ptr_end - blk->ptr;
       *array_elt = (hbb_line*)g_new(hbb_line, 1);
       (*array_elt)->timestamp = blk->prefix.timestamp;
       (*array_elt)->flags     = blk->prefix.flags;
       (*array_elt)->text      = g_strndup(blk->ptr, maxlen);
 
+      if (blk->flags & HBB_FLAG_PERSISTENT) {
+        last_persist_prefixflags = blk->prefix.flags;
+      } else {
+        // Propagate hilighting flag
+        (*array_elt)->flags |= last_persist_prefixflags & HBB_PREFIX_HLIGHT;
+      }
+
       hbuf = g_list_next(hbuf);
     } else
       break;