# HG changeset patch # User Mikael Berthe # Date 1300109121 -3600 # Node ID 256cfc706ae54ecd8d37557673bbd534f3d7540d # Parent 9f443617e96ba75742c21fd0e13a96486d3d96c9 Update readmark support Fix two small issues with readmarks. diff -r 9f443617e96b -r 256cfc706ae5 mcabber/mcabber/screen.c --- a/mcabber/mcabber/screen.c Mon Mar 14 13:17:17 2011 +0100 +++ b/mcabber/mcabber/screen.c Mon Mar 14 14:25:21 2011 +0100 @@ -1174,20 +1174,23 @@ // Do we have a read mark? for (n = 0; n < CHAT_WIN_HEIGHT; n++) { line = *(lines+n); - if (line && line->flags & HBB_PREFIX_READMARK) { - // If this is not the last line, we'll display a mark - if (n+1 < CHAT_WIN_HEIGHT && *(lines+n+1)) - readmark = TRUE; + if (line) { + if (line->flags & HBB_PREFIX_READMARK) { + // If this is not the last line, we'll display a mark + if (n+1 < CHAT_WIN_HEIGHT && *(lines+n+1)) { + readmark = TRUE; + skipline = TRUE; + mark_offset = -1; + } + } + } else if (readmark) { + // There will be empty lines, so we don't need to skip the first line + skipline = FALSE; + mark_offset = 0; } } } - // Skip first line if there's a mark - if (readmark) { - skipline = TRUE; - mark_offset = -1; - } - // Display the lines for (n = 0 ; n < CHAT_WIN_HEIGHT; n++) { int winy = n + mark_offset; @@ -1472,7 +1475,7 @@ if (win_entry->bd->lock) setmsgflg = TRUE; // If this is an outgoing message, update readmark - if (!special && (prefix_flags & HBB_PREFIX_OUT)) + if (!special && (prefix_flags & (HBB_PREFIX_OUT|HBB_PREFIX_HLIGHT_OUT))) hbuf_set_readmark(win_entry->bd->hbuf, FALSE); // Show and refresh the window top_panel(win_entry->panel);