Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/hbuf.c @ 1966:88dafee4ee49
Hopefully fix previous commit
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 18 Mar 2011 19:08:16 +0100 |
parents | ec737f5f1d6f |
children | f016c9c9d992 |
comparison
equal
deleted
inserted
replaced
1965:ec737f5f1d6f | 1966:88dafee4ee49 |
---|---|
295 { | 295 { |
296 hbuf_block *hbuf_b_elt; | 296 hbuf_block *hbuf_b_elt; |
297 | 297 |
298 while (l_line) { | 298 while (l_line) { |
299 hbuf_b_elt = (hbuf_block*)l_line->data; | 299 hbuf_b_elt = (hbuf_block*)l_line->data; |
300 if (hbuf_b_elt->flags & HBB_FLAG_PERSISTENT) | 300 if (hbuf_b_elt->flags & HBB_FLAG_PERSISTENT && |
301 (hbuf_b_elt->flags & ~HBB_PREFIX_READMARK)) | |
301 return l_line; | 302 return l_line; |
302 l_line = g_list_previous(l_line); | 303 l_line = g_list_previous(l_line); |
303 } | 304 } |
304 | 305 |
305 return NULL; | 306 return NULL; |
323 // we need to look at the last non-null prefix, which should be the first | 324 // we need to look at the last non-null prefix, which should be the first |
324 // line of the message. | 325 // line of the message. |
325 last_persist = hbuf_previous_persistent(hbuf); | 326 last_persist = hbuf_previous_persistent(hbuf); |
326 while (last_persist) { | 327 while (last_persist) { |
327 blk = (hbuf_block*)last_persist->data; | 328 blk = (hbuf_block*)last_persist->data; |
328 if ((blk->flags & HBB_FLAG_PERSISTENT) && blk->prefix.flags) { | 329 if ((blk->flags & HBB_FLAG_PERSISTENT) && |
330 (blk->prefix.flags & ~HBB_PREFIX_READMARK)) { | |
329 last_persist_prefixflags = blk->prefix.flags; | 331 last_persist_prefixflags = blk->prefix.flags; |
330 break; | 332 break; |
331 } | 333 } |
332 last_persist = g_list_previous(last_persist); | 334 last_persist = g_list_previous(last_persist); |
333 } | 335 } |
360 HBB_PREFIX_READMARK); | 362 HBB_PREFIX_READMARK); |
361 // Continuation of a message - omit the prefix | 363 // Continuation of a message - omit the prefix |
362 (*array_elt)->flags |= HBB_PREFIX_CONT; | 364 (*array_elt)->flags |= HBB_PREFIX_CONT; |
363 (*array_elt)->mucnicklen = 0; // The nick is in the first one | 365 (*array_elt)->mucnicklen = 0; // The nick is in the first one |
364 // Remove readmark flag from the previous line | 366 // Remove readmark flag from the previous line |
365 if (last_persist_prefixflags & HBB_PREFIX_READMARK) | 367 if (prev_array_elt && last_persist_prefixflags & HBB_PREFIX_READMARK) |
366 prev_array_elt->flags &= ~HBB_PREFIX_READMARK; | 368 prev_array_elt->flags &= ~HBB_PREFIX_READMARK; |
367 } | 369 } |
368 | 370 |
369 prev_array_elt = *array_elt; | 371 prev_array_elt = *array_elt; |
370 | 372 |
483 line.timestamp = blk->prefix.timestamp; | 485 line.timestamp = blk->prefix.timestamp; |
484 line.flags = blk->prefix.flags; | 486 line.flags = blk->prefix.flags; |
485 line.mucnicklen = blk->prefix.mucnicklen; | 487 line.mucnicklen = blk->prefix.mucnicklen; |
486 line.text = g_strndup(blk->ptr, maxlen); | 488 line.text = g_strndup(blk->ptr, maxlen); |
487 | 489 |
488 if ((blk->flags & HBB_FLAG_PERSISTENT) && blk->prefix.flags) { | 490 if ((blk->flags & HBB_FLAG_PERSISTENT) && |
491 (blk->prefix.flags & ~HBB_PREFIX_READMARK)) { | |
489 last_persist_prefixflags = blk->prefix.flags; | 492 last_persist_prefixflags = blk->prefix.flags; |
490 } else { | 493 } else { |
491 // Propagate highlighting flags | 494 // Propagate necessary highlighting flags |
492 line.flags |= last_persist_prefixflags & | 495 line.flags |= last_persist_prefixflags & |
493 (HBB_PREFIX_HLIGHT_OUT | HBB_PREFIX_HLIGHT | | 496 (HBB_PREFIX_HLIGHT_OUT | HBB_PREFIX_HLIGHT | |
494 HBB_PREFIX_INFO | HBB_PREFIX_IN); | 497 HBB_PREFIX_INFO | HBB_PREFIX_IN); |
495 // Continuation of a message - omit the prefix | 498 // Continuation of a message - omit the prefix |
496 line.flags |= HBB_PREFIX_CONT; | 499 line.flags |= HBB_PREFIX_CONT; |