# HG changeset patch # User Mikael Berthe # Date 1141642774 -3600 # Node ID 39f67cade02c2418fe67c6fabdc09645909a3d11 # Parent 421b337dc6d297a42d5c215938ef3d6df6bf8e36 Use bold font for outgoing messages diff -r 421b337dc6d2 -r 39f67cade02c mcabber/src/hbuf.c --- 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; diff -r 421b337dc6d2 -r 39f67cade02c mcabber/src/histolog.c --- a/mcabber/src/histolog.c Mon Mar 06 10:25:24 2006 +0100 +++ b/mcabber/src/histolog.c Mon Mar 06 11:59:34 2006 +0100 @@ -216,7 +216,7 @@ if (type == 'M') { if (info == 'S') - prefix_flags = HBB_PREFIX_OUT; + prefix_flags = HBB_PREFIX_OUT | HBB_PREFIX_HLIGHT; else prefix_flags = HBB_PREFIX_IN; xtext = ut_expand_tabs(&data[26]); // Expand tabs diff -r 421b337dc6d2 -r 39f67cade02c mcabber/src/hooks.c --- a/mcabber/src/hooks.c Mon Mar 06 10:25:24 2006 +0100 +++ b/mcabber/src/hooks.c Mon Mar 06 11:59:34 2006 +0100 @@ -92,7 +92,7 @@ wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg); if (!strncmp(msg, "/me ", 4)) wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); - message_flags |= HBB_PREFIX_HLIGHT; + /*message_flags |= HBB_PREFIX_HLIGHT;*/ } else { // This is a regular chatroom message. // Let's see if we are the message sender, in which case we'll diff -r 421b337dc6d2 -r 39f67cade02c mcabber/src/screen.c --- a/mcabber/src/screen.c Mon Mar 06 10:25:24 2006 +0100 +++ b/mcabber/src/screen.c Mon Mar 06 11:59:34 2006 +0100 @@ -407,19 +407,18 @@ dir = '>'; wprintw(win_entry->win, "%.11s #%c# ", date, dir); } else if (line->flags & HBB_PREFIX_IN) { - wprintw(win_entry->win, "%.11s", date); - if (line->flags & HBB_PREFIX_HLIGHT) wattron(win_entry->win, A_BOLD); - wprintw(win_entry->win, " <== ", date); - if (line->flags & HBB_PREFIX_HLIGHT) wattroff(win_entry->win, A_BOLD); + wprintw(win_entry->win, "%.11s <== ", date); } else if (line->flags & HBB_PREFIX_OUT) { - wprintw(win_entry->win, "%.11s", date); - wattron(win_entry->win, A_BOLD); - wprintw(win_entry->win, " --> ", date); - wattroff(win_entry->win, A_BOLD); + wprintw(win_entry->win, "%.11s --> ", date); } else { wprintw(win_entry->win, "%.11s ", date); } - wprintw(win_entry->win, "%s", line->text); // line + + // Display line + if (line->flags & HBB_PREFIX_HLIGHT) wattron(win_entry->win, A_BOLD); + wprintw(win_entry->win, "%s", line->text); + if (line->flags & HBB_PREFIX_HLIGHT) wattroff(win_entry->win, A_BOLD); + wclrtoeol(win_entry->win); g_free(line->text); } else { @@ -1012,7 +1011,7 @@ void scr_WriteOutgoingMessage(const char *jidto, const char *text) { - scr_WriteMessage(jidto, text, 0, HBB_PREFIX_OUT); + scr_WriteMessage(jidto, text, 0, HBB_PREFIX_OUT|HBB_PREFIX_HLIGHT); scr_ShowWindow(jidto); }