Mercurial > ~mikael > mcabber > hg
diff mcabber/mcabber/hbuf.c @ 1961:39021fd6b0e1
Try to improve readmarks in some cases
This patch removes the readmark when entering chatmode if the mark is on the
last line. This should hopefully fix weird behavior seen under some
circumstances.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 15 Mar 2011 00:39:17 +0100 |
parents | f309f343070c |
children | ec737f5f1d6f |
line wrap: on
line diff
--- a/mcabber/mcabber/hbuf.c Mon Mar 14 23:45:24 2011 +0100 +++ b/mcabber/mcabber/hbuf.c Tue Mar 15 00:39:17 2011 +0100 @@ -554,6 +554,19 @@ } } +// hbuf_remove_trailing_readmark(hbuf) +// Unset the buffer readmark if it is on the last line +void hbuf_remove_trailing_readmark(GList *hbuf) +{ + hbuf_block *blk; + + if (!hbuf) return; + + hbuf = g_list_last(hbuf); + blk = (hbuf_block*)(hbuf->data); + blk->prefix.flags &= ~HBB_PREFIX_READMARK; +} + // hbuf_get_blocks_number() // Returns the number of allocated hbuf_block's. guint hbuf_get_blocks_number(GList *hbuf)