comparison mcabber/src/hbuf.c @ 1268:dbc907b2d92f

Add configurable colors for info and incoming messages (Michal 'vorner' Vaner)
author Mikael Berthe <mikael@lilotux.net>
date Mon, 20 Aug 2007 19:41:31 +0200
parents 3a4018f18bdf
children e42f48103609
comparison
equal deleted inserted replaced
1267:c5257cbe6ae4 1268:dbc907b2d92f
147 if (strlen(text) >= HBB_BLOCKSIZE) { 147 if (strlen(text) >= HBB_BLOCKSIZE) {
148 // Too long 148 // Too long
149 text = "[ERR:LINE_TOO_LONG]"; 149 text = "[ERR:LINE_TOO_LONG]";
150 hbuf_block_elt->prefix.flags |= HBB_PREFIX_INFO; 150 hbuf_block_elt->prefix.flags |= HBB_PREFIX_INFO;
151 } 151 }
152
152 if (hbuf_block_elt->ptr + strlen(text) >= hbuf_block_elt->ptr_end_alloc) { 153 if (hbuf_block_elt->ptr + strlen(text) >= hbuf_block_elt->ptr_end_alloc) {
153 // Too long for the current allocated bloc, we need another one 154 // Too long for the current allocated bloc, we need another one
154 if (!maxhbufblocks) { 155 if (!maxhbufblocks) {
155 // No limit, let's allocate a new block 156 // No limit, let's allocate a new block
156 hbuf_block_elt->ptr = g_new0(char, HBB_BLOCKSIZE); 157 hbuf_block_elt->ptr = g_new0(char, HBB_BLOCKSIZE);
325 if ((blk->flags & HBB_FLAG_PERSISTENT) && blk->prefix.flags) { 326 if ((blk->flags & HBB_FLAG_PERSISTENT) && blk->prefix.flags) {
326 last_persist_prefixflags = blk->prefix.flags; 327 last_persist_prefixflags = blk->prefix.flags;
327 } else { 328 } else {
328 // Propagate highlighting flags 329 // Propagate highlighting flags
329 (*array_elt)->flags |= last_persist_prefixflags & 330 (*array_elt)->flags |= last_persist_prefixflags &
330 (HBB_PREFIX_HLIGHT_OUT | HBB_PREFIX_HLIGHT); 331 (HBB_PREFIX_HLIGHT_OUT | HBB_PREFIX_HLIGHT |
332 HBB_PREFIX_INFO | HBB_PREFIX_IN);
333 //Continuation of a message - omit the prefix
334 (*array_elt)->flags |= HBB_PREFIX_CONT;
331 } 335 }
332 336
333 hbuf = g_list_next(hbuf); 337 hbuf = g_list_next(hbuf);
334 } else 338 } else
335 break; 339 break;