diff options
author | Timo Sirainen <cras@irssi.org> | 2002-10-14 12:03:37 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-10-14 12:03:37 +0000 |
commit | fae3ae2bfcab714da40bcf1315fb990e14ec3645 (patch) | |
tree | de935f91d1564ab84e2ea3e63352fa743266fcf1 /src/fe-common/core/hilight-text.c | |
parent | 45883d7f3690bad5c8ac22692022bbfdd79262ed (diff) | |
download | irssi-fae3ae2bfcab714da40bcf1315fb990e14ec3645.zip |
Better print /HILIGHT lines. Also cleanup for /IGNORE lines.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2947 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core/hilight-text.c')
-rw-r--r-- | src/fe-common/core/hilight-text.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 1648e26d..9749504b 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -473,6 +473,32 @@ static void read_hilight_config(void) static void hilight_print(int index, HILIGHT_REC *rec) { char *chans, *levelstr; + GString *options; + + options = g_string_new(NULL); + if (!rec->nick || !rec->word) { + if (rec->nick) g_string_append(options, "-nick "); + if (rec->word) g_string_append(options, "-word "); + } + + if (rec->nickmask) g_string_append(options, "-nickmask "); + if (rec->fullword) g_string_append(options, "-fullword "); + if (rec->regexp) { + g_string_append(options, "-regexp "); +#ifdef HAVE_REGEX_H + if (!rec->regexp_compiled) + g_string_append(options, "[INVALID!] "); +#endif + } + + if (options->len > 1) g_string_truncate(options, options->len-1); + + if (rec->priority != 0) + g_string_sprintfa(options, "-priority %d ", rec->priority); + if (rec->color != NULL) + g_string_sprintfa(options, "-color %s ", rec->color); + if (rec->act_color != NULL) + g_string_sprintfa(options, "-actcolor %s ", rec->act_color); chans = rec->channels == NULL ? NULL : g_strjoinv(",", rec->channels); @@ -482,11 +508,10 @@ static void hilight_print(int index, HILIGHT_REC *rec) TXT_HILIGHT_LINE, index, rec->text, chans != NULL ? chans : "", levelstr != NULL ? levelstr : "", - rec->nickmask ? " -mask" : "", - rec->fullword ? " -full" : "", - rec->regexp ? " -regexp" : ""); + options->str); g_free_not_null(chans); g_free_not_null(levelstr); + g_string_free(options, TRUE); } static void cmd_hilight_show(void) |