Text printing changes. Formats are now optionally saved to each line so

later if you used /format it would change the old lines too. However
the actual line changing doesn't work yet :)


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@836 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-11-12 20:20:05 +00:00 committed by cras
commit d1330fff6d
14 changed files with 515 additions and 391 deletions

View file

@ -29,39 +29,38 @@
#include "window-items.h"
#include "nicklist.h"
#include "hilight-text.h"
#include "formats.h"
static const char *noact_channels;
static int hilight_level, activity_level;
static void sig_hilight_text(WINDOW_REC *window, SERVER_REC *server,
const char *channel, void *levelptr,
const char *msg)
static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg)
{
int level, oldlevel, new_data;
int oldlevel, new_data;
level = GPOINTER_TO_INT(levelptr);
if (window == active_win || (level & (MSGLEVEL_NEVER|MSGLEVEL_NO_ACT)))
if (dest->window == active_win ||
(dest->level & (MSGLEVEL_NEVER|MSGLEVEL_NO_ACT)))
return;
/* hilights and private messages get HILIGHT status,
public messages get MSGS status and rest get TEXT */
new_data = (level & (MSGLEVEL_HILIGHT|hilight_level)) ?
new_data = (dest->level & (MSGLEVEL_HILIGHT|hilight_level)) ?
NEWDATA_HILIGHT :
((level & activity_level) ? NEWDATA_MSG : NEWDATA_TEXT);
((dest->level & activity_level) ? NEWDATA_MSG : NEWDATA_TEXT);
/* check that channel isn't in "don't show activity" list */
if (new_data < NEWDATA_HILIGHT &&
channel != NULL && find_substr(noact_channels, channel))
dest->target != NULL && find_substr(noact_channels, dest->target))
return;
oldlevel = window->new_data;
if (window->new_data < new_data) {
window->new_data = new_data;
window->last_color = hilight_last_nick_color();;
signal_emit("window hilight", 1, window);
oldlevel = dest->window->new_data;
if (dest->window->new_data < new_data) {
dest->window->new_data = new_data;
dest->window->last_color = hilight_last_nick_color();;
signal_emit("window hilight", 1, dest->window);
}
signal_emit("window activity", 2, window, GINT_TO_POINTER(oldlevel));
signal_emit("window activity", 2, dest->window, GINT_TO_POINTER(oldlevel));
}
static void sig_dehilight(WINDOW_REC *window, WI_ITEM_REC *item)