Mercurial > ~mikael > mcabber > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
728:421b337dc6d2 | 729:39f67cade02c |
---|---|
246 // (The first line will be the line currently pointed by hbuf) | 246 // (The first line will be the line currently pointed by hbuf) |
247 // Note: The caller should free the array and the text pointers after use. | 247 // Note: The caller should free the array and the text pointers after use. |
248 hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n) | 248 hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n) |
249 { | 249 { |
250 unsigned int i; | 250 unsigned int i; |
251 hbuf_block *blk; | |
252 guchar last_persist_prefixflags = 0; | |
253 GList *last_persist; | |
254 | |
255 last_persist = hbuf_previous_persistent(hbuf); | |
256 if (last_persist && last_persist != hbuf) { | |
257 blk = (hbuf_block*)(last_persist->data); | |
258 last_persist_prefixflags = blk->prefix.flags; | |
259 } | |
251 | 260 |
252 hbb_line **array = g_new0(hbb_line*, n); | 261 hbb_line **array = g_new0(hbb_line*, n); |
253 hbb_line **array_elt = array; | 262 hbb_line **array_elt = array; |
254 | 263 |
255 for (i=0 ; i < n ; i++) { | 264 for (i=0 ; i < n ; i++) { |
256 if (hbuf) { | 265 if (hbuf) { |
257 hbuf_block *blk = (hbuf_block*)(hbuf->data); | |
258 int maxlen; | 266 int maxlen; |
267 blk = (hbuf_block*)(hbuf->data); | |
259 maxlen = blk->ptr_end - blk->ptr; | 268 maxlen = blk->ptr_end - blk->ptr; |
260 *array_elt = (hbb_line*)g_new(hbb_line, 1); | 269 *array_elt = (hbb_line*)g_new(hbb_line, 1); |
261 (*array_elt)->timestamp = blk->prefix.timestamp; | 270 (*array_elt)->timestamp = blk->prefix.timestamp; |
262 (*array_elt)->flags = blk->prefix.flags; | 271 (*array_elt)->flags = blk->prefix.flags; |
263 (*array_elt)->text = g_strndup(blk->ptr, maxlen); | 272 (*array_elt)->text = g_strndup(blk->ptr, maxlen); |
264 | 273 |
274 if (blk->flags & HBB_FLAG_PERSISTENT) { | |
275 last_persist_prefixflags = blk->prefix.flags; | |
276 } else { | |
277 // Propagate hilighting flag | |
278 (*array_elt)->flags |= last_persist_prefixflags & HBB_PREFIX_HLIGHT; | |
279 } | |
280 | |
265 hbuf = g_list_next(hbuf); | 281 hbuf = g_list_next(hbuf); |
266 } else | 282 } else |
267 break; | 283 break; |
268 | 284 |
269 array_elt++; | 285 array_elt++; |